diff --git a/l2ork_addons/cwiid/.svn/all-wcprops b/l2ork_addons/cwiid/.svn/all-wcprops deleted file mode 100644 index ac6fb113887e4c08255216e7290852778909ac1c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/all-wcprops +++ /dev/null @@ -1,53 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 29 -/cwiid/svn/!svn/ver/201/trunk -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 41 -/cwiid/svn/!svn/ver/137/trunk/Makefile.in -END -configure.ac -K 25 -svn:wc:ra_dav:version-url -V 42 -/cwiid/svn/!svn/ver/182/trunk/configure.ac -END -AUTHORS -K 25 -svn:wc:ra_dav:version-url -V 36 -/cwiid/svn/!svn/ver/23/trunk/AUTHORS -END -ChangeLog -K 25 -svn:wc:ra_dav:version-url -V 39 -/cwiid/svn/!svn/ver/151/trunk/ChangeLog -END -COPYING -K 25 -svn:wc:ra_dav:version-url -V 36 -/cwiid/svn/!svn/ver/14/trunk/COPYING -END -NEWS -K 25 -svn:wc:ra_dav:version-url -V 34 -/cwiid/svn/!svn/ver/132/trunk/NEWS -END -defs.mak.in -K 25 -svn:wc:ra_dav:version-url -V 41 -/cwiid/svn/!svn/ver/137/trunk/defs.mak.in -END -README -K 25 -svn:wc:ra_dav:version-url -V 36 -/cwiid/svn/!svn/ver/177/trunk/README -END diff --git a/l2ork_addons/cwiid/.svn/entries b/l2ork_addons/cwiid/.svn/entries deleted file mode 100644 index 0ea89683b2d04284eb0fd7ddf6a5ff4dfdb2fd41..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/entries +++ /dev/null @@ -1,327 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk -http://abstrakraft.org/cwiid/svn - - - -2009-07-16T14:34:33.764690Z -201 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -python -dir - -Makefile.in -file - - - - -2009-10-18T02:00:41.000000Z -40abc3c387b414e711fc85c8933f63f7 -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -1146 - -lswm -dir - -AUTHORS -file - - - - -2009-10-18T02:00:41.000000Z -57397a0e86c1ac66fdfaa233f0f2f41a -2007-03-06T00:23:32.295405Z -23 -dsmith - - - - - - - - - - - - - - - - - - - - - -40 - -libcwiid -dir - -ChangeLog -file - - - - -2009-10-18T02:00:41.000000Z -43ee468506798afca3814205be11246e -2007-08-27T01:43:12.116446Z -151 -dsmith - - - - - - - - - - - - - - - - - - - - - -12975 - -common -dir - -wmdemo -dir - -wmgui -dir - -README -file - - - - -2009-10-18T02:00:41.000000Z -a35b87cf52b040db44306632309af672 -2008-05-29T00:30:48.159114Z -177 -dsmith - - - - - - - - - - - - - - - - - - - - - -4464 - -defs.mak.in -file - - - - -2009-10-18T02:00:41.000000Z -41a3ff79df80639ecf53cce0f67d8a3d -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -721 - -configure.ac -file - - - - -2009-10-18T02:00:41.000000Z -23b39a6873c492f1a4708e32102323b0 -2008-06-24T19:43:05.601828Z -182 -dsmith - - - - - - - - - - - - - - - - - - - - - -4021 - -wminput -dir - -doc -dir - -COPYING -file - - - - -2009-10-18T02:00:41.000000Z -59530bdf33659b29e73d4adb9f9f6552 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -18002 - -man -dir - -NEWS -file - - - - -2009-10-18T02:00:41.000000Z -401f97169329a72198e45b6151e1c216 -2007-06-29T01:50:26.688278Z -132 -dsmith - - - - - - - - - - - - - - - - - - - - - -731 - diff --git a/l2ork_addons/cwiid/.svn/format b/l2ork_addons/cwiid/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/.svn/text-base/AUTHORS.svn-base b/l2ork_addons/cwiid/.svn/text-base/AUTHORS.svn-base deleted file mode 100644 index 366f31c7d1d8cb30c6bccd565736c52bd7b2f159..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/AUTHORS.svn-base +++ /dev/null @@ -1 +0,0 @@ -L. Donnie Smith <cwiid@abstrakraft.org> diff --git a/l2ork_addons/cwiid/.svn/text-base/COPYING.svn-base b/l2ork_addons/cwiid/.svn/text-base/COPYING.svn-base deleted file mode 100644 index 623b6258a134210f0b0ada106fdaab7f0370d9c5..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/COPYING.svn-base +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - 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. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 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/l2ork_addons/cwiid/.svn/text-base/ChangeLog.svn-base b/l2ork_addons/cwiid/.svn/text-base/ChangeLog.svn-base deleted file mode 100644 index 93e59474c873d123541be37eb729ff1bdbda9ef6..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/ChangeLog.svn-base +++ /dev/null @@ -1,485 +0,0 @@ -2007-08-26 L. Donnie Smith <cwiid@abstrakraft.org> - docs - * updated wminput man page - -2007-08-23 L. Donnie Smith <cwiid@abstrakraft.org> - python - * fixed libdir install bug - -2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * make cwiid_err_default public - - wminput - * added {c,py}_wiimote_deinit functions - * added daemon, quiet, and reconnect options - -2007-07-29 L. Donnie Smith <cwiid@abstrakraft.org> - wminput - * fixed wait forever logic - -2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - configure.ac - * added config.h header - * added with-python argument and associated logic - - lswm - * added config.h include for sources requiring defs - - wmgui - * added config.h include for sources requiring defs - - wminput - * added config.h include for sources requiring defs - * added HAVE_PYTHON tests around all python code - -2007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * changed version - - python - * implemented uninstall - - wminput - * rewrote ir_ptr plugin - * supress error for nonexistent python plugins - -2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> - wminput - * revised error messages - - python - * revised error messages and doc strings - -2007-06-14 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * added sleep after cwiid_find_wiimote call - - python - * added --prefix option to install script - -2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - python - * removed Wiimote_FromC function - * added bdaddr argument to Wiimote.init - * overloaded Wiimote.init to accept CObject (existing wiimote), - and logic to avoid closing it on dealloc - - wminput - * refactored to isolate plugin logic - * now imports python plugins without changing directories - -2007-06-01 Nick <nickishappy@gmail.com> - lswm - * reworked command-line options (added standard options, long options) - - wminput - * reworked command-line options (added standard options, long options) - -2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - python - * added Wiimote_FromC - * exported Wiimote_FromC and ConvertMesgArray as CObjects - * added get_acc_cal - - wminput - * added pyplugin.c, pyplugin.h - * changed wmplugin_exec prototype (&mesg->mesg) - * changed param format (pass pointers) - * added python plugin support (experimental) - -2007-05-30 L. Donnie Smith <cwiid@abstrakraft.org> - configure.ac - * added python/Makefile and PYTHON_VERSION variable - - build system - * added ROOTDIR (massaged DESTDIR) - - python - * added directory - -2007-05-27 Arthur Peters <amp@singingwizard.org> - python - * removed set_mesg_callback from methods table - -2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * removed error_pipe - * fixed error message reporting - * changed cwiid_connect, cwiid_disconnect to cwiid_open, cwiid_close - (added macros for backward compatibility) - * split cwiid_command into cwiid_request_status, cwiid_set_led, - cwiid_set_rumble, cwiid_set_rpt_mode (kept cwiid_command for backward - compatibility) - - wmdemo - * updated for function name changes - - wmgui - * updated for function name changes - - wminput - * updated for function name changes - -2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * added timestamp to message interfaces - * added cwiid_get_acc_cal - - wmdemo - * updated for timestamp addition - - wmgui - * updated for timestamp addition - * use cwiid_get_acc_cal to get acc calibration values - - wminput - * updated for timestamp addition - * use cwiid_get_acc_cal to get acc calibration values (acc plugins) - -2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * rewrite (API overhaul) - - wmdemo - * updated for API overhaul - - wmgui - * updated for API overhaul - - wminput - * updated for API overhaul - -2007-04-15 <work.eric@gmail.com> - wminput - * fixed classic controller configuration bug - -2007-04-12 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * streamlined wiimote filter - -2007-04-12 Petter Reinholdtsen <pere@hungry.com> - wmdemo - * added command-line WIIMOTE_BDADDR - -2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - libcwiid - * renamed from libwiimote - * renamed external data structures - - lswm - * updated for libcwiid rename - - wmdemo - * updated for libcwiid rename - - wmgui - * updated for libcwiid rename - - wminput - * updated for libcwiid rename - -2007-04-08 Arthur Peters <amp@singingwizard.org> - wminput - * added debounce and low-pass filter to ir_ptr plugin - * added low-pass filter to acc plugin - -2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - defs.mak - * added DEBUGFLAGS variable - - wiimote - * fixed incompatible pointer warning in process_error - - wmgui - * fixed signed/unsigned comparison warning in btnRead_clicked - - wminput - * fixed signed/unsigned comparison warning in uinput_open and get_plugin - * copied acc low-pass filter to nunchuk_acc - * removed path from default config symlink target - * added plugins parameters (added lex and parse rules, conf functions, - wmplugin_param_info struct, updated README) - * initialized param info in ir_ptr, nunchuk_acc, and acc plugins - * created Scale params in nunchuk_acc and acc plugins - * set Scale params for neverball config - -2007-04-08 Petter Reinholdtsen <pere@hungry.com> - defs.mak - * created WARNFLAGS variable - * added -W to WARNFLAGS - - wiimote - * fixed signed/unsigned comparison warning in int_listen, send_report, and - exec_write_seq - -2007-04-07 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * changed wiimote_info.class to btclass - -2007-04-03 L. Donnie Smith <cwiid@abstrakraft.org> - configure.ac - * removed --noyywrap from lex - - wiimote - * added queue_flush - * reimplemented queue_queue with queue_flush - * added wiimote_mesg_error message type - * moved RW error state to separate wiimote member - * updated wiimote_read and wiimote_write to trigger and detect rw_error - * cancel rw operations from wiimote_disconnect - * implemented process_error to handle socket read errors - * added rw_status triggers to read and write handlers - - wmdemo - * made wiimote handle global - * disconnect and exit on wiimote_mesg_error - - wmgui - * disconnect on wiimote_mesg_error - - wminput - * exit on wiimote_mesg_error - -2007-04-03 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * fixed wiimote_find_wiimote seg fault - - wmgui - * commented custom wiimote_err (causing Xlib errors) - - wminput - * added stdio.h include to conf.h - -2007-04-02 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * fixed exception handling bugs in bluetooth.c - - wminput - * added wait option - -2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * Moved defs.mak.in to top level directory - * Added directories to defs.mak.in - * Moved CFLAGS directories from defs.mak to Makefiles - * simplified make install deps - - lswm - * created app - - wmdemo - * renamed main.c to wmdemo.c - * updated for wiimote_connect change - * clarified status output menu item, added status request - - wmgui - * updated for wiimote_connect change - - wminput - * updated for wiimote_connect change - - wiimote - * created bluetooth.c - * moved wiimote_findfirst to bluetooth.c, renamed to wiimote_find_wiimote, - added timeout argument - * defined struct wiimote_info - * wrote wiimote_get_info_array - * wiimote_connect now takes a pointer to bdaddr_t - -2007-03-27 L. Donnie Smith <cwiid@abstrakraft.org> - * Added DESTDIR variable to make system - -2007-03-23 L. Donnie Smith <cwiid@abstrakraft.org> - * Corrected installation directory creation logic - * Added .NOTPARALLEL to top level Makefile - -2007-03-19 L. Donnie Smith <cwiid@abstrakraft.org> - * Added --disable-ldconfig option to configure - * Makefiles - append to rather than set compiler options - -2007-03-15 L. Donnie Smith <cwiid@abstrakraft.org> - wminput - * action_enum.awk - explicitly call awk rather than #! /usr/bin/awk - -2007-03-14 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * audited error checking (coda and error handler sections) - * updated comments - * event.c - moved int_listen read/write code to process_read and - process_write, reorganized file - * wiimote_read - changed to obey decode flag only for register read - * wiimote_connect - changed memcpy to bacmp - -2007-03-08 L. Donnie Smith <cwiid@abstrakraft.org> - * added explicit creation of installation directories to prevent - installation errors - - wiimote - * created wiimote_err_t function type - * created wiimote_set_err function - * added wiimote parameter to wiimote_err calls - - wmdemo - * added implementation of wiimote_err_t, wiimote_set_err - -2007-03-05 L. Donnie Smith <cwiid@abstrakraft.org> - * Type audit - boolean ints, const strings where appropriate, stdint.h - wiimote types - * Changed email addresses to cwiid@abstrakraft.org - * Added file ChangeLogs - * Fixed GTK_{CFLAGS,LIBS} in configure.ac and wmgui/Makefile.in - -2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * configure.ac - check for stdint.h - -2007-02-26 L. Donnie Smith <cwiid@abstrakraft.org> - * Changed installation directories to comply with FHS standard - * Added check for yypop_buffer_state in flex - * Various minor documentation changes - * Lowercased "cwiid" in filenames - - wiimote - * added 'static' to local function declarations - - wminput - * added filenames and correct location tracking to parser error messages - * added 'static' to local function declarations (plugins) - -2007-02-21 Romain Beauxis <toots@rastageeks.org> - wminput - * fixed help message - -2007-02-18 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * fixed wiimote_status_mesg allocation size - * changed wiimote_log to wiimote_err with format string and args - * reworked event/callback system to pass arrays of (simultaneous) messages - * added extern "C" declaration to wiimote.h for c++ programs - * added wiimote_t * to wiimote_mesg_t callback prototype (to facilitate - using the same callback for multiple wiimotes) - - wmdemo - * added - - wmgui - * Added parent argument to message function - - wminput - * rewrite: new configuration syntax, plugin architecture - -2007-01-25 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * added rpt_mode_flag lock to prevent race condition - * extended write sequences to simplify multi-part operations - - wmgui - * added status request at connect to populate status boxes - -2007-01-24 L. Donnie Smith <cwiid@abstrakraft.org> - Added uninstall make target - - wiimote - * macros renamed (should be last rename of public macros) - * added status, nunchuk, and classic controller messages - * added intelligent report mode selection - - wmgui - * changed button widgets - * added nunchuk and classic controller support - - wminput - * fixed command-line bug - * updated for wiimote updates - * changes to plugin architecture - gives greater access to plugin - * added LED indicators to default (IR) tracking - -2007-01-16 L. Donnie Smith <cwiid@abstrakraft.org> - wminput - * fixed build error in plugins directory - -2007-01-15 L. Donnie Smith <cwiid@abstrakraft.org> - reworked build system, now using autoconf - - wiimote - * fixed bug in IR report data extraction - * created acc_ir client message - * make install now installs library and header to /usr/local - - wmif - * removed - - wmgui - * reworked GUI - * added force, roll and pitch displays - * removed AutoMake - * split wiimote_callback into separate functions - * rewrote command-line parsing - * added WIIMOTE_BDADDR environment variable lookup - - wminput - * split wiimote_callback into separate functions - * cleaned up cursor tracking - * renamed wminput.c to main.c - * rewrote command-line parsing - * added WIIMOTE_BDADDR environment variable lookup - * created plugin architecture and acc plugin - -2007-01-09 L. Donnie Smith <cwiid@abstrakraft.org> - reworked top-level Makefile - bins install to /usr/local/bin on make install - wiimote - * Changes to message dispatch thread to isolate main thread from dispatch - timing issues (especially GTK apps) - - wmif - * fixed --help bug - - wmgui - * fixed --help bug - * added g_thread_support test before g_thread_init - - wminput - * fixed --help bug - * added #ifdef tests around KEY_ macros in key_enum.{c,awk} - -2007-01-04 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * put mesg callback data in a union - * fixed write flood error (wait for ACK after each packet) - * added IR reporting (mode 0x33 only) - * moved internal definitions from wiimote.h into wiimote_internal.h - (struct wiimote is now opaque) - * wiimote_connect now returns a wiimote_t * - * sends button message only when button status changes - - wmif - * updated for wiimote changes - - wmgui - * updated for wiimote changes - * enabled IR widgets - - wminput - * added to package - -2006-12-31 L. Donnie Smith <cwiid@abstrakraft.org> - wiimote - * changed various macro names and parameter types (mostly signed to unsigned) - * cleaned up LED & RUMBLE command logic - * added ACC reporting - * added data read/write - * created dispatch thread (isolates bluetooth read from app callbacks) - * reset report mode after receive status report - - wmif - * updated for wiimote changes - * added EEPROM read menu option - - wmgui - * updated for wiimote changes - * added ACC output - * added data read/write - * added IR data widgets (not yet enabled) - -2006-12-28 L. Donnie Smith <cwiid@abstrakraft.org> - Initial release diff --git a/l2ork_addons/cwiid/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 6d3ac985792064b26c51734fdc62107bbec6eab4..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,53 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -LIB_DIRS = libcwiid -BIN_DIRS = wmgui wminput lswm -DOC_DIRS = man doc -ifdef PYTHON -BIND_DIRS = python -endif - -SUB_DIRS = $(LIB_DIRS) $(BIN_DIRS) $(DOC_DIRS) $(BIND_DIRS) wmdemo - -all install clean distclean uninstall: TARGET += $(MAKECMDGOALS) - -all install clean distclean uninstall: $(BIN_DIRS) $(LIB_DIRS) $(BIND_DIRS) - -install uninstall distclean: $(DOC_DIRS) - -all clean distclean: wmdemo - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) -$(BIN_DIRS) $(BIND_DIRS): $(LIB_DIRS) -endif -endif - -ifeq ($(MAKECMDGOALS),install) -$(BIN_DIRS) $(LIB_DIRS): $(CWIID_CONFIG_DIR) $(CWIID_PLUGINS_DIR) -endif - -$(SUB_DIRS): - $(MAKE) $(TARGET) -C $@ - -$(CWIID_CONFIG_DIR): - install -d $(CWIID_CONFIG_DIR) - -$(CWIID_PLUGINS_DIR): - install -d $(CWIID_PLUGINS_DIR) - -distclean: - rm -rf Makefile config.log config.status autom4te.cache \ - defs.mak $(COMMON)/include/lib.mak $(COMMON)/include/config.h - -uninstall: - rm -r $(CWIID_PLUGINS_DIR); true - -uninstall_config: - rm -rf $(CWIID_CONFIG_DIR) - -.PHONY: all install clean distclean uninstall uninstall_config $(SUB_DIRS) - -.NOTPARALLEL: diff --git a/l2ork_addons/cwiid/.svn/text-base/NEWS.svn-base b/l2ork_addons/cwiid/.svn/text-base/NEWS.svn-base deleted file mode 100644 index d884e1f4849153a95b4486205f2d208a4f5817e3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/NEWS.svn-base +++ /dev/null @@ -1,46 +0,0 @@ -0.6.00 - - renamed libwiimote to libcwiid to avoid naming conflict with other projects - - rewrite of libcwiid architecture - - Python libcwiid interface - - Python wminput plugins - - rewrite of ir_ptr plugin - -0.5.03 - - Bugfixes, lswm utility, disconnect messages, wminput infinite wait - -0.5.02 - - Bugfixes, configure --disable-ldconfig - -0.5.01 - - Bugfixes - -0.5.00 - - Overhauled wminput configuration - - wmdemo test application - -0.4.01 - - Bugfixes - -0.4.00 - - Status, Nunchuk, Classic Controller support - -0.3.51 - - Bugfixes - -0.3.50 - - Created plugin architecture - - Acc calculations and plugin - -0.3.01 - - Bugfixes - -0.3.00 - - IR Reporting - - wminput Event driver - -0.2.00 - - ACC Reporting - - Memory Read/Write - -0.1.00 - - Initial Release diff --git a/l2ork_addons/cwiid/.svn/text-base/configure.ac.svn-base b/l2ork_addons/cwiid/.svn/text-base/configure.ac.svn-base deleted file mode 100644 index a0d39251c9355901cd51cae4c1427fa63a6c9c3b..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/configure.ac.svn-base +++ /dev/null @@ -1,152 +0,0 @@ -# ChangeLog: -# 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> -# * added config.h header -# * added with-python argument and associated logic -# -# 2007-05-30 L. Donnie Smith <cwiid@abstrakraft.org> -# * added python/Makefile -# * added PYTHON_VERSION variable -# -# 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> -# * updated for libcwiid rename -# -# 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> -# * removed --noyywrap from lex -# -# 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> -# * added lswm/Makefile -# * moved defs.mak -# -# 2007-03-19 L. Donnie Smith <cwiid@abstrakraft.org> -# * added --disable-ldconfig -# -# 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> -# * Initial ChangeLog -# * Check for stdint.h - -AC_INIT(CWiid,0.6.00,cwiid@abstrakraft.org) -AC_CONFIG_HEADER(common/include/config.h) - -AC_PROG_CC -AC_PROG_AWK -AC_PROG_LEX -if test "$LEX" != "flex"; then - AC_MSG_ERROR([flex not found]) -fi -if test -z "`echo %%|$LEX -t|grep yypop_buffer_state`"; then - AC_MSG_ERROR([flex missing yypop_buffer_state - upgrade to version 2.5.33 or later]) -fi -AC_PROG_YACC -if test "$YACC" != "bison -y"; then - AC_MSG_ERROR([bison not found]) -fi - -AC_ARG_WITH( - [python], - [AS_HELP_STRING([--without-python],[compile without python support])], - [case $withval in - yes) - REQUIRE_PYTHON=1 - PYTHON_NAME=python - ;; - no) - REQUIRE_PYTHON= - PYTHON_NAME= - ;; - *) - REQUIRE_PYTHON=1 - PYTHON_NAME=$withval - ;; - esac], - [REQUIRE_PYTHON=1; PYTHON_NAME=python]) -if test $REQUIRE_PYTHON; then - AC_CHECK_PROGS([PYTHON],$PYTHON_NAME) - if test $REQUIRE_PYTHON -a ! $PYTHON; then - AC_MSG_ERROR([$PYTHON_NAME not found]) - fi -fi -AC_SUBST(PYTHON) -if test $PYTHON; then - PYTHON_VERSION=[`$PYTHON -c 'import sys; print sys.version[:3]'`] - AC_SUBST(PYTHON_VERSION) - AC_DEFINE([HAVE_PYTHON],1,[Define to 1 if python support is enabled]) -fi - -AC_CHECK_LIB([pthread], [pthread_create],, - AC_MSG_ERROR([pthread library not found])) -AC_CHECK_LIB([bluetooth], [hci_devid],, - AC_MSG_ERROR([bluetooth library not found])) -AC_CHECK_LIB([dl], [dlopen],, - AC_MSG_ERROR([dl lib not found])) -#AC_CHECK_LIB([rt], [clock_gettime],, -# AC_MSG_ERROR([rt lib not found])) - -AC_HEADER_STDC -AC_CHECK_HEADER([stdint.h],, - AC_MSG_ERROR([stdint.h not found])) -AC_CHECK_HEADER([bluetooth/bluetooth.h],, - AC_MSG_ERROR([bluetooth/bluetooth.h not found])) -AC_CHECK_HEADERS([bluetooth/l2cap.h bluetooth/hci.h],, - AC_MSG_ERROR([bluetooth headers not found]), - [#include <bluetooth/bluetooth.h>]) -AC_CHECK_HEADER([linux/input.h],, - AC_MSG_ERROR([linux/input.h not found])) -AC_CHECK_HEADER([linux/uinput.h],, - AC_MSG_ERROR([linux/uinput.h]), - [#include <linux/input.h>]) - -AC_ISC_POSIX - -AC_ARG_WITH(cwiid-config-dir,AC_HELP_STRING([--with-cwiid-config-dir], - [CWiid configuration directory, default to $(sysconfdir)/cwiid])) -if test -z $with_cwiid_config_dir; then - CWIID_CONFIG_DIR='${sysconfdir}/cwiid' -else - CWIID_CONFIG_DIR=$with_cwiid_config_dir -fi -AC_SUBST(CWIID_CONFIG_DIR) - -AC_ARG_WITH(cwiid-plugins-dir,AC_HELP_STRING([--with-cwiid-plugins-dir], - [CWiid plugins directory, default to $(libdir)/cwiid/plugins])) -if test -n $with_cwiid_plugins_dir; then - CWIID_PLUGINS_DIR='${libdir}/cwiid/plugins' -else - CWIID_PLUGINS_DIR=$with_cwiid_plugins_dir -fi -AC_SUBST(CWIID_PLUGINS_DIR) - -AC_ARG_WITH(ldconfig,AC_HELP_STRING([--disable-ldconfig], - [don't execute ldconfig after install])) -if test "$enable_ldconfig" = "no"; then - LDCONFIG="#ldconfig" -else - LDCONFIG="ldconfig" -fi -AC_SUBST(LDCONFIG) - -pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0" -PKG_CHECK_MODULES([GTK], [$pkg_modules]) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GTK_LIBS) - -AC_OUTPUT( - [Makefile] - [defs.mak] - [common/include/lib.mak] - [doc/Makefile] - [man/Makefile] - [libcwiid/Makefile] - [libcwiid/cwiid.pc] - [wmdemo/Makefile] - [wmgui/Makefile] - [wminput/Makefile] - [wminput/plugins/Makefile] - [wminput/plugins/ir_ptr/Makefile] - [wminput/plugins/acc/Makefile] - [wminput/plugins/nunchuk_acc/Makefile] - [wminput/plugins/led/Makefile] - [wminput/plugins/nunchuk_stick2btn/Makefile] - [lswm/Makefile] - [python/Makefile] - ) - diff --git a/l2ork_addons/cwiid/.svn/text-base/defs.mak.in.svn-base b/l2ork_addons/cwiid/.svn/text-base/defs.mak.in.svn-base deleted file mode 100644 index fb2ff7c7649ef824d6724f8e3760745d5e33f604..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/.svn/text-base/defs.mak.in.svn-base +++ /dev/null @@ -1,36 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -sysconfdir = @sysconfdir@ -libdir = @libdir@ - -datarootdir = @datarootdir@ -mandir = @mandir@ -docdir = @docdir@ - -CC = @CC@ -AWK = @AWK@ -LEX = @LEX@ -YACC = @YACC@ -PYTHON = @PYTHON@ - -COMMON = @abs_top_builddir@/common - -ifdef DESTDIR - ROOTDIR = $(DESTDIR:%/=%) -endif - -CWIID_CONFIG_DIR = $(ROOTDIR)@CWIID_CONFIG_DIR@ -CWIID_PLUGINS_DIR = $(ROOTDIR)@CWIID_PLUGINS_DIR@ - -DEBUGFLAGS = -g -WARNFLAGS = -Wall -W -CFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) @DEFS@ -I$(COMMON)/include diff --git a/l2ork_addons/cwiid/AUTHORS b/l2ork_addons/cwiid/AUTHORS index 366f31c7d1d8cb30c6bccd565736c52bd7b2f159..7e6525d80b52a82962e67850e315b8fe8ed95c37 100644 --- a/l2ork_addons/cwiid/AUTHORS +++ b/l2ork_addons/cwiid/AUTHORS @@ -1 +1,3 @@ -L. Donnie Smith <cwiid@abstrakraft.org> +L. Donnie Smith <cwiid@abstrakraft.org> +Ivica Ico Bukvic <ico@vt.edu> +Deba Pratim Saha <dpsaha@vt.edu> diff --git a/l2ork_addons/cwiid/.svn/text-base/README.svn-base b/l2ork_addons/cwiid/README.md similarity index 90% rename from l2ork_addons/cwiid/.svn/text-base/README.svn-base rename to l2ork_addons/cwiid/README.md index 52a52eb4eca1591e02eb032a4412647e8e69170d..b40e1023db02e378f30b212230b4bf90bd337884 100644 --- a/l2ork_addons/cwiid/.svn/text-base/README.svn-base +++ b/l2ork_addons/cwiid/README.md @@ -1,4 +1,5 @@ Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> +Copyright (C) 2011-2015 Ivica Ico Bukvic <ico@vt.edu> and Deba Pratim Saha <dpsaha@vt.edu> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,7 +50,7 @@ Many distributions do not have /usr/local/lib in the library search path, and on I prefer the second method since it keeps local software in the local directory where it should be, and it fixes the problem for every package using /usr/local/lib, not just CWiid. Until someone offers a convincing argument for the omission of /usr/local/lib from /etc/ld.so.conf, I consider this to be a distribution bug, and method #2 above is the fix. -Please report any compilation errors at http://www.abstrakraft.org/cwiid or to <cwiid@abstrakraft.org>, with preference for the former. +Please report any problems and/or errors to <ico@vt.edu>. EXECUTION ------------------------------------------------------------------------------------------------ @@ -62,10 +63,4 @@ See wminput/README for more information on wminput configuration and execution. FUTURE IDEAS/IMPROVEMENTS ------------------------------------------------------------------------------------------------ The following list is neither complete nor ordered: -wmcp (copy data between files and wiimotes) -Move wiimote communications into a separate daemon (wiimoted) with which applications communicate via sockets (or some other means) -wmgui logging -Implement speaker -gui/control interface to wminput -Implement other drivers such as gesture recognition. - +Implement/test speaker diff --git a/l2ork_addons/cwiid/common/include/.svn/all-wcprops b/l2ork_addons/cwiid/common/include/.svn/all-wcprops deleted file mode 100644 index 4048bc4680d819b750736dc00eb4c05901e9fb78..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/all-wcprops +++ /dev/null @@ -1,35 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/178/trunk/common/include -END -dep.mak -K 25 -svn:wc:ra_dav:version-url -V 51 -/cwiid/svn/!svn/ver/14/trunk/common/include/dep.mak -END -config.h.in -K 25 -svn:wc:ra_dav:version-url -V 56 -/cwiid/svn/!svn/ver/178/trunk/common/include/config.h.in -END -lib.mak.in -K 25 -svn:wc:ra_dav:version-url -V 55 -/cwiid/svn/!svn/ver/125/trunk/common/include/lib.mak.in -END -plugin.mak -K 25 -svn:wc:ra_dav:version-url -V 55 -/cwiid/svn/!svn/ver/125/trunk/common/include/plugin.mak -END -app.mak -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/125/trunk/common/include/app.mak -END diff --git a/l2ork_addons/cwiid/common/include/.svn/entries b/l2ork_addons/cwiid/common/include/.svn/entries deleted file mode 100644 index 214bb92b0733cd6946a4ff6c158fb1782dc3a166..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/entries +++ /dev/null @@ -1,198 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/common/include -http://abstrakraft.org/cwiid/svn - - - -2008-05-29T01:00:00.244078Z -178 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -dep.mak -file - - - - -2009-10-18T02:00:38.000000Z -76bcb17bd43d90135cb20534b7eb7a3e -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -117 - -config.h.in -file - - - - -2009-10-18T02:00:38.000000Z -0996d5989f2715da53751be647f86c1a -2008-05-29T01:00:00.244078Z -178 -dsmith - - - - - - - - - - - - - - - - - - - - - -1928 - -lib.mak.in -file - - - - -2009-10-18T02:00:38.000000Z -c6d317117390e802b7c7576f11fedaa5 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -1477 - -plugin.mak -file - - - - -2009-10-18T02:00:38.000000Z -c46f3a5ec2e46a0f665b7423235a9997 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -762 - -app.mak -file - - - - -2009-10-18T02:00:38.000000Z -999a3ca33b80797bd488ea5fd2bd7cdb -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -580 - diff --git a/l2ork_addons/cwiid/common/include/.svn/format b/l2ork_addons/cwiid/common/include/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/common/include/.svn/text-base/app.mak.svn-base b/l2ork_addons/cwiid/common/include/.svn/text-base/app.mak.svn-base deleted file mode 100644 index f00cf12c2b4553a1df25a0188e68c18e281833a7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/text-base/app.mak.svn-base +++ /dev/null @@ -1,31 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -OBJECTS = $(SOURCES:.c=.o) -DEPS = $(SOURCES:.c=.d) - -INST_DIR ?= /usr/local/bin - -DEST_INST_DIR = $(ROOTDIR)$(INST_DIR) - -all: $(APP_NAME) - -$(APP_NAME): $(OBJECTS) - $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(LDLIBS) - -install: $(APP_NAME) - install -D $(APP_NAME) $(DEST_INST_DIR)/$(APP_NAME) - -clean: - rm -f $(APP_NAME) $(OBJECTS) $(DEPS) - -uninstall: - rm -f $(DEST_INST_DIR)/$(APP_NAME) - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) -include $(COMMON)/include/dep.mak --include $(DEPS) -endif -endif - -.PHONY: all install uninstall clean diff --git a/l2ork_addons/cwiid/common/include/.svn/text-base/config.h.in.svn-base b/l2ork_addons/cwiid/common/include/.svn/text-base/config.h.in.svn-base deleted file mode 100644 index 691bdc2dcd6ccb72ac74808f2be4b1c92dd88225..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/text-base/config.h.in.svn-base +++ /dev/null @@ -1,68 +0,0 @@ -/* common/include/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the <bluetooth/hci.h> header file. */ -#undef HAVE_BLUETOOTH_HCI_H - -/* Define to 1 if you have the <bluetooth/l2cap.h> header file. */ -#undef HAVE_BLUETOOTH_L2CAP_H - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `bluetooth' library (-lbluetooth). */ -#undef HAVE_LIBBLUETOOTH - -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if python support is enabled */ -#undef HAVE_PYTHON - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* 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 - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ -#undef YYTEXT_POINTER diff --git a/l2ork_addons/cwiid/common/include/.svn/text-base/dep.mak.svn-base b/l2ork_addons/cwiid/common/include/.svn/text-base/dep.mak.svn-base deleted file mode 100644 index afbb3bbc897d89379869b8be0915911396a14f70..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/text-base/dep.mak.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -%.d: %.c - @$(CC) -M $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - diff --git a/l2ork_addons/cwiid/common/include/.svn/text-base/lib.mak.in.svn-base b/l2ork_addons/cwiid/common/include/.svn/text-base/lib.mak.in.svn-base deleted file mode 100644 index 5e81ff3888d03f8cc5761ab0b6a7cfe16e87a52e..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/text-base/lib.mak.in.svn-base +++ /dev/null @@ -1,60 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -LDCONFIG = @LDCONFIG@ - -HEADER = $(LIB_NAME).h -STATIC_LIB = lib$(LIB_NAME).a -LINK_NAME = lib$(LIB_NAME).so -SO_NAME = $(LINK_NAME).$(MAJOR_VER) -SHARED_LIB = $(SO_NAME).$(MINOR_VER) -DEST_INC_INST_DIR = $(ROOTDIR)$(INC_INST_DIR) -DEST_LIB_INST_DIR = $(ROOTDIR)$(LIB_INST_DIR) - -OBJECTS = $(SOURCES:.c=.o) -DEPS = $(SOURCES:.c=.d) - -CFLAGS += -fpic - -all: static shared - -static: $(STATIC_LIB) - -shared: $(SHARED_LIB) - -$(STATIC_LIB): $(OBJECTS) - ar rcs $(STATIC_LIB) $(OBJECTS) - -$(SHARED_LIB): $(OBJECTS) - $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) $(LDLIBS) \ - -o $(SHARED_LIB) $(OBJECTS) - -install: install_header install_static install_shared - -install_header: - install -D $(LIB_NAME).h $(DEST_INC_INST_DIR)/$(LIB_NAME).h - -install_static: static - install -D $(STATIC_LIB) $(DEST_LIB_INST_DIR)/$(STATIC_LIB) - -install_shared: shared - install -D $(SHARED_LIB) $(DEST_LIB_INST_DIR)/$(SHARED_LIB) - ln -sf $(SHARED_LIB) $(DEST_LIB_INST_DIR)/$(SO_NAME) - ln -sf $(SO_NAME) $(DEST_LIB_INST_DIR)/$(LINK_NAME) - $(LDCONFIG) - -clean: - rm -f $(STATIC_LIB) $(SHARED_LIB) $(OBJECTS) $(DEPS) - -uninstall: - rm -f $(DEST_INC_INST_DIR)/$(LIB_NAME).h \ - $(DEST_LIB_INST_DIR)/$(STATIC_LIB) \ - $(DEST_LIB_INST_DIR)/$(LINK_NAME)* - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) -include $(COMMON)/include/dep.mak --include $(DEPS) -endif -endif - -.PHONY: all static shared install install_header install_static install_shared clean uninstall diff --git a/l2ork_addons/cwiid/common/include/.svn/text-base/plugin.mak.svn-base b/l2ork_addons/cwiid/common/include/.svn/text-base/plugin.mak.svn-base deleted file mode 100644 index 0f615027fd9b8b12cd1e2723a2478a3f7aa5ede6..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/common/include/.svn/text-base/plugin.mak.svn-base +++ /dev/null @@ -1,37 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -LIB_NAME = $(PLUGIN_NAME).so - -OBJECTS = $(SOURCES:.c=.o) -DEPS = $(SOURCES:.c=.d) - -CFLAGS += -fpic - -#TODO:unify the way ROOTDIR is handled -#Currently, defs.mak adds ROOTDIR to the plugin INST_DIR, -#so we don't do it here -#DEST_INST_DIR = $(ROOTDIR)/$(INST_DIR) -DEST_INST_DIR = $(INST_DIR) - -all: $(LIB_NAME) - -$(LIB_NAME): $(OBJECTS) - $(CC) -shared $(LDFLAGS) $(LDLIBS) -o $(LIB_NAME) $(OBJECTS) - -install: $(LIB_NAME) - install -D $(LIB_NAME) $(DEST_INST_DIR)/$(LIB_NAME) - -clean: - rm -f $(LIB_NAME) $(OBJECTS) $(DEPS) - -uninstall: - rm -f $(INST_DIR)/$(LIB_NAME) - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) -include $(COMMON)/include/dep.mak --include $(DEPS) -endif -endif - -.PHONY: all install clean uninstall diff --git a/l2ork_addons/cwiid/doc/.svn/all-wcprops b/l2ork_addons/cwiid/doc/.svn/all-wcprops deleted file mode 100644 index 9f06ac5c8747cd5667cad82ffbd85122104cacae..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/all-wcprops +++ /dev/null @@ -1,23 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 33 -/cwiid/svn/!svn/ver/125/trunk/doc -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/125/trunk/doc/Makefile.in -END -Xmodmap -K 25 -svn:wc:ra_dav:version-url -V 40 -/cwiid/svn/!svn/ver/14/trunk/doc/Xmodmap -END -wminput.list -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/14/trunk/doc/wminput.list -END diff --git a/l2ork_addons/cwiid/doc/.svn/entries b/l2ork_addons/cwiid/doc/.svn/entries deleted file mode 100644 index 566aeda633c00338575b6cf7da3aa741bf370248..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/doc -http://abstrakraft.org/cwiid/svn - - - -2007-06-14T04:16:11.705163Z -125 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:41.000000Z -3a2cc333c11fbea503c17b4e1bd20979 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -362 - -Xmodmap -file - - - - -2009-10-18T02:00:41.000000Z -d816d961ae3f33f2a109278ee1cb8a5e -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -141 - -wminput.list -file - - - - -2009-10-18T02:00:41.000000Z -d403957e93f2ecffe1d3640985424ede -2007-02-27T01:59:34.071869Z -13 -dsmith - - - - - - - - - - - - - - - - - - - - - -730 - diff --git a/l2ork_addons/cwiid/doc/.svn/format b/l2ork_addons/cwiid/doc/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/doc/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/doc/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 8330ddd054e6a92952ff213d52b8d15bdb10b5e6..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,23 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -docfiles = Xmodmap wminput.list - -DEST_DOC_DIR = $(ROOTDIR)$(docdir) - -all: - -install: $(DEST_DOC_DIR) - install -m 644 $(docfiles) $(DEST_DOC_DIR) - -$(DEST_DOC_DIR): - install -d $(DEST_DOC_DIR) - -uninstall: - rm -rf $(DEST_DOC_DIR) - -distclean: - rm Makefile - -.PHONY: all install uninstall distclean diff --git a/l2ork_addons/cwiid/doc/.svn/text-base/Xmodmap.svn-base b/l2ork_addons/cwiid/doc/.svn/text-base/Xmodmap.svn-base deleted file mode 100644 index 01354332aab16413b990960f42751a25fa1dcc34..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/text-base/Xmodmap.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -keycode 130=XF86HomePage -keycode 151=XF86User2KB -keycode 158=XF86MenuKB -keycode 159=XF86User1KB -keycode 234=XF86Back -keycode 233=XF86Forward diff --git a/l2ork_addons/cwiid/doc/.svn/text-base/wminput.list.svn-base b/l2ork_addons/cwiid/doc/.svn/text-base/wminput.list.svn-base deleted file mode 100644 index a9e562df37daf3c0ff9214226b9fe7b2c8ea02e3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/doc/.svn/text-base/wminput.list.svn-base +++ /dev/null @@ -1,57 +0,0 @@ -#Note: this is a list of button and axis IDs, and is not a valid configuration -#file - -# Wiimote Buttons -Wiimote.Up -Wiimote.Down -Wiimote.Left -Wiimote.Right -Wiimote.A -Wiimote.B -Wiimote.Minus -Wiimote.Plus -Wiimote.Home -Wiimote.1 -Wiimote.2 - -# Wiimote Axes -Wiimote.Dpad.X -Wiimote.Dpad.Y - - -# Nunchuk Buttons -Nunchuk.C -Nunchuk.Z - -# Nunchuk Axes -Nunchuk.Stick.X -Nunchuk.Stick.Y - - -# Classic Controller Buttons -Classic.Up -Classic.Down -Classic.Left -Classic.Right -Classic.Minus -Classic.Plus -Classic.Home -Classic.A -Classic.B -Classic.X -Classic.Y -Classic.ZL -Classic.ZR -Classic.L -Classic.R - -#Classic Controller Axes -Classic.Dpad.X -Classic.Dpad.Y -Classic.LStick.X -Classic.LStick.Y -Classic.RStick.X -Classic.RStick.Y -Classic.LAnalog -Classic.RAnalog - diff --git a/l2ork_addons/cwiid/libcwiid/.svn/all-wcprops b/l2ork_addons/cwiid/libcwiid/.svn/all-wcprops deleted file mode 100644 index 827d393c3283d77c6379ce3406646757dd01d3a5..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/all-wcprops +++ /dev/null @@ -1,77 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 38 -/cwiid/svn/!svn/ver/201/trunk/libcwiid -END -command.c -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/192/trunk/libcwiid/command.c -END -process.c -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/201/trunk/libcwiid/process.c -END -cwiid_internal.h -K 25 -svn:wc:ra_dav:version-url -V 55 -/cwiid/svn/!svn/ver/199/trunk/libcwiid/cwiid_internal.h -END -interface.c -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/199/trunk/libcwiid/interface.c -END -state.c -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/199/trunk/libcwiid/state.c -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/153/trunk/libcwiid/Makefile.in -END -cwiid.h -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/199/trunk/libcwiid/cwiid.h -END -cwiid.pc.in -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/153/trunk/libcwiid/cwiid.pc.in -END -bluetooth.c -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/188/trunk/libcwiid/bluetooth.c -END -thread.c -K 25 -svn:wc:ra_dav:version-url -V 47 -/cwiid/svn/!svn/ver/199/trunk/libcwiid/thread.c -END -connect.c -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/192/trunk/libcwiid/connect.c -END -util.c -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/192/trunk/libcwiid/util.c -END diff --git a/l2ork_addons/cwiid/libcwiid/.svn/entries b/l2ork_addons/cwiid/libcwiid/.svn/entries deleted file mode 100644 index ae36ebcc2b0cdaa96a845e44dfc1abd5d0c4af01..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/entries +++ /dev/null @@ -1,436 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/libcwiid -http://abstrakraft.org/cwiid/svn - - - -2009-07-16T14:34:33.764690Z -201 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -command.c -file - - - - -2009-10-18T02:00:37.000000Z -459b6146d3754734474a0156d0b37d42 -2009-06-16T01:10:15.019820Z -192 -dsmith - - - - - - - - - - - - - - - - - - - - - -10062 - -process.c -file - - - - -2009-10-18T02:00:37.000000Z -5ca120b9f23e56c3d163a09f24792504 -2009-07-16T14:34:33.764690Z -201 -dsmith - - - - - - - - - - - - - - - - - - - - - -8931 - -cwiid_internal.h -file - - - - -2009-10-18T02:00:37.000000Z -516309309383ddfcd765e347099e9868 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -6627 - -interface.c -file - - - - -2009-10-18T02:00:37.000000Z -65dd1f7c3c156a1d7b5ee345e2f7c01a -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -6072 - -state.c -file - - - - -2009-10-18T02:00:37.000000Z -f9bd8ebba521171e1d0fdc52f4b00045 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -8722 - -Makefile.in -file - - - - -2009-10-18T02:00:37.000000Z -9ce331d69f747170a2b241fee5d03880 -2008-01-12T05:23:21.925889Z -153 -dsmith - - - - - - - - - - - - - - - - - - - - - -895 - -cwiid.h -file - - - - -2009-10-18T02:00:37.000000Z -d6a6849ea5556603621a30ff7d5b8871 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -10608 - -cwiid.pc.in -file - - - - -2009-10-18T02:00:37.000000Z -19a2e96b50cdf0fc5d6e9ed523f869fa -2008-01-12T05:23:21.925889Z -153 -dsmith - - - - - - - - - - - - - - - - - - - - - -323 - -bluetooth.c -file - - - - -2009-10-18T02:00:37.000000Z -0a5df8dddc5bf7a968143774efbbd13e -2009-06-14T06:54:24.586938Z -188 -dsmith - - - - - - - - - - - - - - - - - - - - - -5514 - -thread.c -file - - - - -2009-10-18T02:00:37.000000Z -b72b4e5228650654a42e013ed52d75e3 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -9385 - -connect.c -file - - - - -2009-10-18T02:00:37.000000Z -f093cd6c516493a4690d29b59df64119 -2009-06-16T01:10:15.019820Z -192 -dsmith - - - - - - - - - - - - - - - - - - - - - -10875 - -util.c -file - - - - -2009-10-18T02:00:37.000000Z -f77dd6d8656d9ee6fa031bdaba937828 -2009-06-16T01:10:15.019820Z -192 -dsmith - - - - - - - - - - - - - - - - - - - - - -5776 - diff --git a/l2ork_addons/cwiid/libcwiid/.svn/format b/l2ork_addons/cwiid/libcwiid/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 551667f5deaff6f5c0732003b0f2b090582bbbe9..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,43 +0,0 @@ -#Copyright (C) 2006 L. Donnie Smith - -include @top_builddir@/defs.mak - -LIB_NAME = cwiid -MAJOR_VER = 1 -MINOR_VER = 0 -SOURCES = bluetooth.c command.c connect.c interface.c process.c state.c \ - thread.c util.c -LDLIBS += -lbluetooth -lpthread -lrt -LIB_INST_DIR = @libdir@ -INC_INST_DIR = @includedir@ -DEST_PKG_CONFIG_INST_DIR = $(ROOTDIR)@libdir@/pkgconfig - -include $(COMMON)/include/lib.mak - -$(SHARED_LIB): $(SO_NAME) $(LINK_NAME) - -$(SO_NAME): - ln -sf $(SHARED_LIB) $(SO_NAME) - -$(LINK_NAME): - ln -sf $(SO_NAME) $(LINK_NAME) - -install: install_pkgconfig - -uninstall: uninstall_pkgconfig - -install_pkgconfig: - install -D -m 644 cwiid.pc $(DEST_PKG_CONFIG_INST_DIR)/cwiid.pc - -uninstall_pkgconfig: - rm -f $(DEST_PKG_CONFIG_INST_DIR)/cwiid.pc - -clean: remove_links - -remove_links: - rm -f $(SO_NAME) $(LINK_NAME) - -distclean: clean - rm Makefile cwiid.pc - -.PHONY: distclean clean make_links remove_links diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/bluetooth.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/bluetooth.c.svn-base deleted file mode 100644 index 8019d572953b5f2c731e0355ee5ce1a00b5dc9e1..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/bluetooth.c.svn-base +++ /dev/null @@ -1,199 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-04-24 L. Donnie Smith (cwiid@abstrakraft.org> - * * revised error messages - * - * 2007-04-12 L. Donnie Smith <cwiid@abstrakraft.org> - * * streamlined wiimote filter - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-07 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_info.class to btclass - * - * 2007-04-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * fixed cwiid_find_wiimote seg fault - * - * 2007-04-02 L. Donnie Smith <cwiid@abstrakraft.org> - * * exception handling bugs - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * created file - */ - -#include <stdlib.h> -#include <string.h> -#include <bluetooth/bluetooth.h> -#include <bluetooth/hci.h> -#include <bluetooth/hci_lib.h> -#include "cwiid_internal.h" - -/* When filtering wiimotes, in order to avoid having to store the - * remote names before the blue_dev array is malloced (because we don't - * yet know how many wiimotes there are, we'll assume there are no more - * than dev_count, and realloc to the actual number afterwards, since - * reallocing to a smaller chunk should be fast. */ -#define BT_MAX_INQUIRY 256 -/* timeout in 2 second units */ -int cwiid_get_bdinfo_array(int dev_id, unsigned int timeout, int max_bdinfo, - struct cwiid_bdinfo **bdinfo, uint8_t flags) -{ - inquiry_info *dev_list = NULL; - int max_inquiry; - int dev_count; - int sock = -1; - int bdinfo_count; - int i, j; - int err = 0; - int ret; - - /* NULLify for the benefit of error handling */ - *bdinfo = NULL; - - /* If not given (=-1), get the first available Bluetooth interface */ - if (dev_id == -1) { - if ((dev_id = hci_get_route(NULL)) == -1) { - cwiid_err(NULL, "No Bluetooth interface found"); - return -1; - } - } - - /* Get Bluetooth Device List */ - if ((flags & BT_NO_WIIMOTE_FILTER) && (max_bdinfo != -1)) { - max_inquiry = max_bdinfo; - } - else { - max_inquiry = BT_MAX_INQUIRY; - } - if ((dev_count = hci_inquiry(dev_id, timeout, max_inquiry, NULL, - &dev_list, IREQ_CACHE_FLUSH)) == -1) { - cwiid_err(NULL, "Bluetooth device inquiry error"); - err = 1; - goto CODA; - } - - if (dev_count == 0) { - bdinfo_count = 0; - goto CODA; - } - - /* Open connection to Bluetooth Interface */ - if ((sock = hci_open_dev(dev_id)) == -1) { - cwiid_err(NULL, "Bluetooth interface open error"); - err = 1; - goto CODA; - } - - /* Allocate info list */ - if (max_bdinfo == -1) { - max_bdinfo = dev_count; - } - if ((*bdinfo = malloc(max_bdinfo * sizeof **bdinfo)) == NULL) { - cwiid_err(NULL, "Memory allocation error (bdinfo array)"); - err = 1; - goto CODA; - } - - /* Copy dev_list to bdinfo */ - for (bdinfo_count=i=0; (i < dev_count) && (bdinfo_count < max_bdinfo); - i++) { - /* Filter by class */ - if (!(flags & BT_NO_WIIMOTE_FILTER) && - ((dev_list[i].dev_class[0] != WIIMOTE_CLASS_0) || - (dev_list[i].dev_class[1] != WIIMOTE_CLASS_1) || - (dev_list[i].dev_class[2] != WIIMOTE_CLASS_2))) { - continue; - } - - /* timeout (10000) in milliseconds */ - if (hci_read_remote_name(sock, &dev_list[i].bdaddr, BT_NAME_LEN, - (*bdinfo)[bdinfo_count].name, 10000)) { - cwiid_err(NULL, "Bluetooth name read error"); - err = 1; - goto CODA; - } - - /* Filter by name */ - if (!(flags & BT_NO_WIIMOTE_FILTER) && - strncmp((*bdinfo)[bdinfo_count].name, WIIMOTE_NAME, BT_NAME_LEN) && - strncmp((*bdinfo)[bdinfo_count].name, WIIBALANCE_NAME, BT_NAME_LEN)) { - continue; - } - - /* Passed filter, add to bdinfo */ - bacpy(&(*bdinfo)[bdinfo_count].bdaddr, &dev_list[i].bdaddr); - for (j=0; j<3; j++) { - (*bdinfo)[bdinfo_count].btclass[j] = - dev_list[i].dev_class[j]; - } - bdinfo_count++; - } - - if (bdinfo_count == 0) { - free(*bdinfo); - } - else if (bdinfo_count < max_bdinfo) { - if ((*bdinfo = realloc(*bdinfo, bdinfo_count * sizeof **bdinfo)) - == NULL) { - cwiid_err(NULL, "Memory reallocation error (bdinfo array)"); - err = 1; - goto CODA; - } - } - -CODA: - if (dev_list) free(dev_list); - if (sock != -1) hci_close_dev(sock); - if (err) { - if (*bdinfo) free(*bdinfo); - ret = -1; - } - else { - ret = bdinfo_count; - } - return ret; -} - -int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout) -{ - struct cwiid_bdinfo *bdinfo; - int bdinfo_count; - - if (timeout == -1) { - while ((bdinfo_count = cwiid_get_bdinfo_array(-1, 2, 1, &bdinfo, 0)) - == 0); - if (bdinfo_count == -1) { - return -1; - } - } - else { - bdinfo_count = cwiid_get_bdinfo_array(-1, timeout, 1, &bdinfo, 0); - if (bdinfo_count == -1) { - return -1; - } - else if (bdinfo_count == 0) { - cwiid_err(NULL, "No wiimotes found"); - return -1; - } - } - - bacpy(bdaddr, &bdinfo[0].bdaddr); - free(bdinfo); - return 0; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/command.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/command.c.svn-base deleted file mode 100644 index e15d5724335b62d6d599b2b88e8e36caf481f862..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/command.c.svn-base +++ /dev/null @@ -1,374 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * added cwiid_request_status, cwiid_set_let, cwiid_set_rumble, - * cwiid_set_rpt_mode - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul - * * added rw and beep functions from rw.c - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated cwiid_read and cwiid_write to trigger and detect rw_error - * - * 2007-03-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * audited error checking (coda and error handler sections) - * * updated comments - * * cwiid_read - changed to obey decode flag only for register read - * - * 2007-03-06 L. Donnie Smith <cwiid@abstrakraft.org> - * * added wiimote parameter to cwiid_err calls - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#include <stdint.h> -#include <stdlib.h> -#include <time.h> -#include <pthread.h> -#include <unistd.h> -#include "cwiid_internal.h" - -int cwiid_command(cwiid_wiimote_t *wiimote, enum cwiid_command command, - int flags) { - int ret; - - switch (command) { - case CWIID_CMD_STATUS: - ret = cwiid_request_status(wiimote); - break; - case CWIID_CMD_LED: - ret = cwiid_set_led(wiimote, flags); - break; - case CWIID_CMD_RUMBLE: - ret = cwiid_set_rumble(wiimote, flags); - break; - case CWIID_CMD_RPT_MODE: - ret = cwiid_set_rpt_mode(wiimote, flags); - break; - default: - ret = -1; - break; - } - - return ret; -} - -/* TODO: fix error reporting - this is public now and - * should report its own errors */ -int cwiid_send_rpt(cwiid_wiimote_t *wiimote, uint8_t flags, uint8_t report, - size_t len, const void *data) -{ - unsigned char *buf; - - if ((buf = malloc((len*2) * sizeof *buf)) == NULL) { - cwiid_err(wiimote, "Memory allocation error (mesg array)"); - return -1; - } - - buf[0] = BT_TRANS_SET_REPORT | BT_PARAM_OUTPUT; - buf[1] = report; - memcpy(buf+2, data, len); - if (!(flags & CWIID_SEND_RPT_NO_RUMBLE)) { - buf[2] |= wiimote->state.rumble; - } - - if (write(wiimote->ctl_socket, buf, len+2) != (ssize_t)(len+2)) { - free(buf); - return -1; - } - else if (verify_handshake(wiimote)) { - free(buf); - return -1; - } - - return 0; -} - -int cwiid_request_status(cwiid_wiimote_t *wiimote) -{ - unsigned char data; - - data = 0; - if (cwiid_send_rpt(wiimote, 0, RPT_STATUS_REQ, 1, &data)) { - cwiid_err(wiimote, "Status request error"); - return -1; - } - - return 0; -} - -int cwiid_set_led(cwiid_wiimote_t *wiimote, uint8_t led) -{ - unsigned char data; - - /* TODO: assumption: char assignments are atomic, no mutex lock needed */ - wiimote->state.led = led & 0x0F; - data = wiimote->state.led << 4; - if (cwiid_send_rpt(wiimote, 0, RPT_LED_RUMBLE, 1, &data)) { - cwiid_err(wiimote, "Report send error (led)"); - return -1; - } - - return 0; -} - -int cwiid_set_rumble(cwiid_wiimote_t *wiimote, uint8_t rumble) -{ - unsigned char data; - - /* TODO: assumption: char assignments are atomic, no mutex lock needed */ - wiimote->state.rumble = rumble ? 1 : 0; - data = wiimote->state.led << 4; - if (cwiid_send_rpt(wiimote, 0, RPT_LED_RUMBLE, 1, &data)) { - cwiid_err(wiimote, "Report send error (led)"); - return -1; - } - - return 0; -} - -int cwiid_set_rpt_mode(cwiid_wiimote_t *wiimote, uint8_t rpt_mode) -{ - return update_rpt_mode(wiimote, rpt_mode); -} - -#define RPT_READ_REQ_LEN 6 -int cwiid_read(cwiid_wiimote_t *wiimote, uint8_t flags, uint32_t offset, - uint16_t len, void *data) -{ - unsigned char buf[RPT_READ_REQ_LEN]; - struct rw_mesg mesg; - unsigned char *cursor; - int ret = 0; - - /* Compose read request packet */ - buf[0]=flags & (CWIID_RW_EEPROM | CWIID_RW_REG); - buf[1]=(unsigned char)((offset>>16) & 0xFF); - buf[2]=(unsigned char)((offset>>8) & 0xFF); - buf[3]=(unsigned char)(offset & 0xFF); - buf[4]=(unsigned char)((len>>8) & 0xFF); - buf[5]=(unsigned char)(len & 0xFF); - - /* Lock wiimote rw access */ - if (pthread_mutex_lock(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex lock error (rw_mutex)"); - return -1; - } - - /* Setup read info */ - wiimote->rw_status = RW_READ; - - /* TODO: Document: user is responsible for ensuring that read/write - * operations are not in flight while disconnecting. Nothing serious, - * just accesses to freed memory */ - /* Send read request packet */ - if (cwiid_send_rpt(wiimote, 0, RPT_READ_REQ, RPT_READ_REQ_LEN, buf)) { - cwiid_err(wiimote, "Report send error (read)"); - ret = -1; - goto CODA; - } - - /* TODO:Better sanity checks (offset) */ - /* Read packets */ - for (cursor = data; cursor - (unsigned char *)data < len; - cursor += mesg.len) { - if (full_read(wiimote->rw_pipe[0], &mesg, sizeof mesg)) { - cwiid_err(wiimote, "Pipe read error (rw pipe)"); - ret = -1; - goto CODA; - } - - if (mesg.type == RW_CANCEL) { - ret = -1; - goto CODA; - } - else if (mesg.type != RW_READ) { - cwiid_err(wiimote, "Unexpected write message"); - ret = -1; - goto CODA; - } - - if (mesg.error) { - cwiid_err(wiimote, "Wiimote read error"); - ret = -1; - goto CODA; - } - - memcpy(cursor, &mesg.data, mesg.len); - } - -CODA: - /* Clear rw_status */ - wiimote->rw_status = RW_IDLE; - - /* Unlock rw_mutex */ - if (pthread_mutex_unlock(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (rw_mutex) - deadlock warning"); - } - - return ret; -} - -#define RPT_WRITE_LEN 21 -int cwiid_write(cwiid_wiimote_t *wiimote, uint8_t flags, uint32_t offset, - uint16_t len, const void *data) -{ - unsigned char buf[RPT_WRITE_LEN]; - uint16_t sent=0; - struct rw_mesg mesg; - int ret = 0; - - /* Compose write packet header */ - buf[0]=flags; - - /* Lock wiimote rw access */ - if (pthread_mutex_lock(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex lock error (rw mutex)"); - return -1; - } - - /* Send packets */ - wiimote->rw_status = RW_WRITE; - while (sent<len) { - /* Compose write packet */ - buf[1]=(unsigned char)(((offset+sent)>>16) & 0xFF); - buf[2]=(unsigned char)(((offset+sent)>>8) & 0xFF); - buf[3]=(unsigned char)((offset+sent) & 0xFF); - if (len-sent >= 0x10) { - buf[4]=(unsigned char)0x10; - } - else { - buf[4]=(unsigned char)(len-sent); - } - memcpy(buf+5, data+sent, buf[4]); - - if (cwiid_send_rpt(wiimote, 0, RPT_WRITE, RPT_WRITE_LEN, buf)) { - cwiid_err(wiimote, "Report send error (write)"); - ret = -1; - goto CODA; - } - - /* Read packets from pipe */ - if (read(wiimote->rw_pipe[0], &mesg, sizeof mesg) != sizeof mesg) { - cwiid_err(wiimote, "Pipe read error (rw pipe)"); - ret = -1; - goto CODA; - } - - if (mesg.type == RW_CANCEL) { - ret = -1; - goto CODA; - } - else if (mesg.type != RW_WRITE) { - cwiid_err(wiimote, "Unexpected read message"); - ret = -1; - goto CODA; - } - - if (mesg.error) { - cwiid_err(wiimote, "Wiimote write error"); - ret = -1; - goto CODA; - }; - - sent+=buf[4]; - } - -CODA: - /* Clear rw_status */ - wiimote->rw_status = RW_IDLE; - - /* Unlock rw_mutex */ - if (pthread_mutex_unlock(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (rw_mutex) - deadlock warning"); - } - - return ret; -} - - -struct write_seq speaker_enable_seq[] = { - {WRITE_SEQ_RPT, RPT_SPEAKER_ENABLE, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_RPT, RPT_SPEAKER_MUTE, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_MEM, 0xA20009, (const void *)"\x01", 1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xA20001, (const void *)"\x08", 1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xA20001, (const void *)"\x00\x00\x00\x0C\x40\x00\x00", - 7, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xA20008, (const void *)"\x01", 1, CWIID_RW_REG}, - {WRITE_SEQ_RPT, RPT_SPEAKER_MUTE, (const void *)"\x00", 1, 0} -}; - -struct write_seq speaker_disable_seq[] = { - {WRITE_SEQ_RPT, RPT_SPEAKER_MUTE, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_RPT, RPT_SPEAKER_ENABLE, (const void *)"\x00", 1, 0} -}; - -#define SOUND_BUF_LEN 21 -int cwiid_beep(cwiid_wiimote_t *wiimote) -{ - /* unsigned char buf[SOUND_BUF_LEN] = { 0xA0, 0xCC, 0x33, 0xCC, 0x33, - 0xCC, 0x33, 0xCC, 0x33, 0xCC, 0x33, 0xCC, 0x33, 0xCC, 0x33, 0xCC, 0x33, - 0xCC, 0x33, 0xCC, 0x33}; */ - unsigned char buf[SOUND_BUF_LEN] = { 0xA0, 0xC3, 0xC3, 0xC3, 0xC3, - 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, - 0xC3, 0xC3, 0xC3, 0xC3}; - int i; - int ret = 0; - pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER; - pthread_cond_t timer_cond = PTHREAD_COND_INITIALIZER; - struct timespec t; - - if (exec_write_seq(wiimote, SEQ_LEN(speaker_enable_seq), - speaker_enable_seq)) { - cwiid_err(wiimote, "Speaker enable error"); - ret = -1; - } - - pthread_mutex_lock(&timer_mutex); - - for (i=0; i<100; i++) { - clock_gettime(CLOCK_REALTIME, &t); - t.tv_nsec += 10204081; - /* t.tv_nsec += 7000000; */ - if (cwiid_send_rpt(wiimote, 0, RPT_SPEAKER_DATA, SOUND_BUF_LEN, buf)) { - printf("%d\n", i); - cwiid_err(wiimote, "Report send error (speaker data)"); - ret = -1; - break; - } - /* TODO: I should be shot for this, but hey, it works. - * longterm - find a better wait */ - pthread_cond_timedwait(&timer_cond, &timer_mutex, &t); - } - - pthread_mutex_unlock(&timer_mutex); - - if (exec_write_seq(wiimote, SEQ_LEN(speaker_disable_seq), - speaker_disable_seq)) { - cwiid_err(wiimote, "Speaker disable error"); - ret = -1; - } - - return ret; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/connect.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/connect.c.svn-base deleted file mode 100644 index 6bd6777f14ba9266a5eee2b8e75fe845de396100..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/connect.c.svn-base +++ /dev/null @@ -1,354 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2009-06-13 L. Donnie Smith <cwiid@abstrakraft.org> - * * add cwiid_open_timeout function, call it with default from cwiid_open - * - * 2007-06-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added sleep after cwiid_find_wiimote call - * - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * remove error_pipe init and destruct - * * renamed connect and disconnect to open and close - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * cancel rw operations from cwiid_disconnect - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * cwiid_connect now takes a pointer to bdaddr_t - * * changed cwiid_findfirst to cwiid_find_wiimote - * - * 2007-03-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed memcpy to bacmp - * * audited error checking (coda and error handler sections) - * * updated comments - * - * 2007-03-06 L. Donnie Smith <cwiid@abstrakraft.org> - * * added wiimote parameter to cwiid_err calls - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <pthread.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <unistd.h> -#include <bluetooth/bluetooth.h> -#include <bluetooth/l2cap.h> -#include "cwiid_internal.h" - -pthread_mutex_t global_mutex = PTHREAD_MUTEX_INITIALIZER; -static int wiimote_id = 0; - -/* TODO: Turn this onto a macro on next major so version */ -cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags) -{ - return cwiid_open_timeout(bdaddr, flags, 5); -} - -cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout) -{ - struct wiimote *wiimote = NULL; - struct sockaddr_l2 remote_addr; - char mesg_pipe_init = 0, status_pipe_init = 0, rw_pipe_init = 0, - state_mutex_init = 0, rw_mutex_init = 0, rpt_mutex_init = 0, - router_thread_init = 0, status_thread_init = 0; - void *pthread_ret; - - /* Allocate wiimote */ - if ((wiimote = malloc(sizeof *wiimote)) == NULL) { - cwiid_err(NULL, "Memory allocation error (cwiid_wiimote_t)"); - goto ERR_HND; - } - - /* set flags */ - wiimote->flags = flags; - - /* For error detection */ - wiimote->ctl_socket = wiimote->int_socket = -1; - - /* Global Lock, Store and Increment wiimote_id */ - if (pthread_mutex_lock(&global_mutex)) { - cwiid_err(NULL, "Mutex lock error (global mutex)"); - goto ERR_HND; - } - wiimote->id = wiimote_id++; - if (pthread_mutex_unlock(&global_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (global mutex) - " - "deadlock warning"); - goto ERR_HND; - } - - /* If BDADDR_ANY is given, find available wiimote */ - if (bacmp(bdaddr, BDADDR_ANY) == 0) { - if (cwiid_find_wiimote(bdaddr, timeout)) { - goto ERR_HND; - } - sleep(1); - } - - /* Connect to Wiimote */ - /* Control Channel */ - memset(&remote_addr, 0, sizeof remote_addr); - remote_addr.l2_family = AF_BLUETOOTH; - remote_addr.l2_bdaddr = *bdaddr; - remote_addr.l2_psm = htobs(CTL_PSM); - if ((wiimote->ctl_socket = - socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP)) == -1) { - cwiid_err(wiimote, "Socket creation error (control socket)"); - goto ERR_HND; - } - if (connect(wiimote->ctl_socket, (struct sockaddr *)&remote_addr, - sizeof remote_addr)) { - cwiid_err(wiimote, "Socket connect error (control channel)"); - goto ERR_HND; - } - - /* Interrupt Channel */ - remote_addr.l2_psm = htobs(INT_PSM); - if ((wiimote->int_socket = - socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP)) == -1) { - cwiid_err(wiimote, "Socket creation error (interrupt socket)"); - goto ERR_HND; - } - if (connect(wiimote->int_socket, (struct sockaddr *)&remote_addr, - sizeof remote_addr)) { - cwiid_err(wiimote, "Socket connect error (interrupt channel)"); - goto ERR_HND; - } - - /* Create pipes */ - if (pipe(wiimote->mesg_pipe)) { - cwiid_err(wiimote, "Pipe creation error (mesg pipe)"); - goto ERR_HND; - } - mesg_pipe_init = 1; - if (pipe(wiimote->status_pipe)) { - cwiid_err(wiimote, "Pipe creation error (status pipe)"); - goto ERR_HND; - } - status_pipe_init = 1; - if (pipe(wiimote->rw_pipe)) { - cwiid_err(wiimote, "Pipe creation error (rw pipe)"); - goto ERR_HND; - } - rw_pipe_init = 1; - - /* Setup blocking */ - if (fcntl(wiimote->mesg_pipe[1], F_SETFL, O_NONBLOCK)) { - cwiid_err(wiimote, "File control error (mesg write pipe)"); - goto ERR_HND; - } - if (wiimote->flags & CWIID_FLAG_NONBLOCK) { - if (fcntl(wiimote->mesg_pipe[0], F_SETFL, O_NONBLOCK)) { - cwiid_err(wiimote, "File control error (mesg read pipe)"); - goto ERR_HND; - } - } - - /* Init mutexes */ - if (pthread_mutex_init(&wiimote->state_mutex, NULL)) { - cwiid_err(wiimote, "Mutex initialization error (state mutex)"); - goto ERR_HND; - } - state_mutex_init = 1; - if (pthread_mutex_init(&wiimote->rw_mutex, NULL)) { - cwiid_err(wiimote, "Mutex initialization error (rw mutex)"); - goto ERR_HND; - } - rw_mutex_init = 1; - if (pthread_mutex_init(&wiimote->rpt_mutex, NULL)) { - cwiid_err(wiimote, "Mutex initialization error (rpt mutex)"); - goto ERR_HND; - } - rpt_mutex_init = 1; - - /* Set rw_status before starting router thread */ - wiimote->rw_status = RW_IDLE; - - /* Launch interrupt channel listener and dispatch threads */ - if (pthread_create(&wiimote->router_thread, NULL, - (void *(*)(void *))&router_thread, wiimote)) { - cwiid_err(wiimote, "Thread creation error (router thread)"); - goto ERR_HND; - } - router_thread_init = 1; - if (pthread_create(&wiimote->status_thread, NULL, - (void *(*)(void *))&status_thread, wiimote)) { - cwiid_err(wiimote, "Thread creation error (status thread)"); - goto ERR_HND; - } - status_thread_init = 1; - - /* Success! Update state */ - memset(&wiimote->state, 0, sizeof wiimote->state); - wiimote->mesg_callback = NULL; - cwiid_set_led(wiimote, 0); - cwiid_request_status(wiimote); - - return wiimote; - -ERR_HND: - if (wiimote) { - /* Close threads */ - if (router_thread_init) { - pthread_cancel(wiimote->router_thread); - if (pthread_join(wiimote->router_thread, &pthread_ret)) { - cwiid_err(wiimote, "Thread join error (router thread)"); - } - else if (!((pthread_ret == PTHREAD_CANCELED) && - (pthread_ret == NULL))) { - cwiid_err(wiimote, "Bad return value from router thread"); - } - } - - if (status_thread_init) { - pthread_cancel(wiimote->status_thread); - if (pthread_join(wiimote->status_thread, &pthread_ret)) { - cwiid_err(wiimote, "Thread join error (status thread)"); - } - else if (!((pthread_ret == PTHREAD_CANCELED) && (pthread_ret == NULL))) { - cwiid_err(wiimote, "Bad return value from status thread"); - } - } - - /* Close Sockets */ - if (wiimote->int_socket != -1) { - if (close(wiimote->int_socket)) { - cwiid_err(wiimote, "Socket close error (interrupt channel)"); - } - } - if (wiimote->ctl_socket != -1) { - if (close(wiimote->ctl_socket)) { - cwiid_err(wiimote, "Socket close error (control channel)"); - } - } - /* Close Pipes */ - if (mesg_pipe_init) { - if (close(wiimote->mesg_pipe[0]) || close(wiimote->mesg_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (mesg pipe)"); - } - } - if (status_pipe_init) { - if (close(wiimote->status_pipe[0]) || - close(wiimote->status_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (status pipe)"); - } - } - if (rw_pipe_init) { - if (close(wiimote->rw_pipe[0]) || close(wiimote->rw_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (rw pipe)"); - } - } - /* Destroy Mutexes */ - if (state_mutex_init) { - if (pthread_mutex_destroy(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (state mutex)"); - } - } - if (rw_mutex_init) { - if (pthread_mutex_destroy(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (rw mutex)"); - } - } - if (rpt_mutex_init) { - if (pthread_mutex_destroy(&wiimote->rpt_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (rpt mutex)"); - } - } - free(wiimote); - } - return NULL; -} - -int cwiid_close(cwiid_wiimote_t *wiimote) -{ - void *pthread_ret; - - /* Cancel and join router_thread and status_thread */ - if (pthread_cancel(wiimote->router_thread)) { - /* if thread quit abnormally, would have printed it's own error */ - } - if (pthread_join(wiimote->router_thread, &pthread_ret)) { - cwiid_err(wiimote, "Thread join error (router thread)"); - } - else if (!((pthread_ret == PTHREAD_CANCELED) || (pthread_ret == NULL))) { - cwiid_err(wiimote, "Bad return value from router thread"); - } - - if (pthread_cancel(wiimote->status_thread)) { - /* if thread quit abnormally, would have printed it's own error */ - } - if (pthread_join(wiimote->status_thread, &pthread_ret)) { - cwiid_err(wiimote, "Thread join error (status thread)"); - } - else if (!((pthread_ret == PTHREAD_CANCELED) || (pthread_ret == NULL))) { - cwiid_err(wiimote, "Bad return value from status thread"); - } - - if (wiimote->mesg_callback) { - if (cancel_mesg_callback(wiimote)) { - /* prints it's own errors */ - } - } - - if (cancel_rw(wiimote)) { - /* prints it's own errors */ - } - - /* Close sockets */ - if (close(wiimote->int_socket)) { - cwiid_err(wiimote, "Socket close error (interrupt channel)"); - } - if (close(wiimote->ctl_socket)) { - cwiid_err(wiimote, "Socket close error (control channel)"); - } - /* Close Pipes */ - if (close(wiimote->mesg_pipe[0]) || close(wiimote->mesg_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (mesg pipe)"); - } - if (close(wiimote->status_pipe[0]) || close(wiimote->status_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (status pipe)"); - } - if (close(wiimote->rw_pipe[0]) || close(wiimote->rw_pipe[1])) { - cwiid_err(wiimote, "Pipe close error (rw pipe)"); - } - /* Destroy mutexes */ - if (pthread_mutex_destroy(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (state)"); - } - if (pthread_mutex_destroy(&wiimote->rw_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (rw)"); - } - if (pthread_mutex_destroy(&wiimote->rpt_mutex)) { - cwiid_err(wiimote, "Mutex destroy error (rpt)"); - } - - free(wiimote); - - return 0; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.h.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.h.svn-base deleted file mode 100644 index e21a85f02fd586b4468aff48b21bfd615a28d653..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.h.svn-base +++ /dev/null @@ -1,405 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * make cwiid_err_default public - * - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_connect, cwiid_disconnect to cwiid_open, cwiid_close - * * added cwiid_request_status, cwiid_set_let, cwiid_set_rumble, - * cwiid_set_rpt_mode - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to message functions - * * added cwiid_get_acc_cal - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-07 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_info.class to btclass - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * added cwiid_mesg_error message type - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * cwiid_connect now takes a pointer to bdaddr_t - * * added cwiid_info definition and macros - * * added cwiid_get_info_array prototype - * * changed cwiid_findfirst to cwiid_find_wiimote - * - * 2007-03-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * added cwiid_err_t definition - * * added cwiid_set_err prototype - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifndef CWIID_H -#define CWIID_H - -#include <stdarg.h> -#include <stdint.h> -#include <time.h> -#include <bluetooth/bluetooth.h> /* bdaddr_t */ - -/* Flags */ -#define CWIID_FLAG_MESG_IFC 0x01 -#define CWIID_FLAG_CONTINUOUS 0x02 -#define CWIID_FLAG_REPEAT_BTN 0x04 -#define CWIID_FLAG_NONBLOCK 0x08 -#define CWIID_FLAG_MOTIONPLUS 0x10 - -/* Report Mode Flags */ -#define CWIID_RPT_STATUS 0x01 -#define CWIID_RPT_BTN 0x02 -#define CWIID_RPT_ACC 0x04 -#define CWIID_RPT_IR 0x08 -#define CWIID_RPT_NUNCHUK 0x10 -#define CWIID_RPT_CLASSIC 0x20 -#define CWIID_RPT_BALANCE 0x40 -#define CWIID_RPT_MOTIONPLUS 0x80 -#define CWIID_RPT_EXT (CWIID_RPT_NUNCHUK | CWIID_RPT_CLASSIC | \ - CWIID_RPT_BALANCE | CWIID_RPT_MOTIONPLUS) - -/* LED flags */ -#define CWIID_LED1_ON 0x01 -#define CWIID_LED2_ON 0x02 -#define CWIID_LED3_ON 0x04 -#define CWIID_LED4_ON 0x08 - -/* Button flags */ -#define CWIID_BTN_2 0x0001 -#define CWIID_BTN_1 0x0002 -#define CWIID_BTN_B 0x0004 -#define CWIID_BTN_A 0x0008 -#define CWIID_BTN_MINUS 0x0010 -#define CWIID_BTN_HOME 0x0080 -#define CWIID_BTN_LEFT 0x0100 -#define CWIID_BTN_RIGHT 0x0200 -#define CWIID_BTN_DOWN 0x0400 -#define CWIID_BTN_UP 0x0800 -#define CWIID_BTN_PLUS 0x1000 - -#define CWIID_NUNCHUK_BTN_Z 0x01 -#define CWIID_NUNCHUK_BTN_C 0x02 - -#define CWIID_CLASSIC_BTN_UP 0x0001 -#define CWIID_CLASSIC_BTN_LEFT 0x0002 -#define CWIID_CLASSIC_BTN_ZR 0x0004 -#define CWIID_CLASSIC_BTN_X 0x0008 -#define CWIID_CLASSIC_BTN_A 0x0010 -#define CWIID_CLASSIC_BTN_Y 0x0020 -#define CWIID_CLASSIC_BTN_B 0x0040 -#define CWIID_CLASSIC_BTN_ZL 0x0080 -#define CWIID_CLASSIC_BTN_R 0x0200 -#define CWIID_CLASSIC_BTN_PLUS 0x0400 -#define CWIID_CLASSIC_BTN_HOME 0x0800 -#define CWIID_CLASSIC_BTN_MINUS 0x1000 -#define CWIID_CLASSIC_BTN_L 0x2000 -#define CWIID_CLASSIC_BTN_DOWN 0x4000 -#define CWIID_CLASSIC_BTN_RIGHT 0x8000 - -/* Send Report flags */ -#define CWIID_SEND_RPT_NO_RUMBLE 0x01 - -/* Data Read/Write flags */ -#define CWIID_RW_EEPROM 0x00 -#define CWIID_RW_REG 0x04 -#define CWIID_RW_DECODE 0x00 - -/* Maximum Data Read Length */ -#define CWIID_MAX_READ_LEN 0xFFFF - -/* Array Index Defs */ -#define CWIID_X 0 -#define CWIID_Y 1 -#define CWIID_Z 2 -#define CWIID_PHI 0 -#define CWIID_THETA 1 -#define CWIID_PSI 2 - -/* Acc Defs */ -#define CWIID_ACC_MAX 0xFF - -/* IR Defs */ -#define CWIID_IR_SRC_COUNT 4 -#define CWIID_IR_X_MAX 1024 -#define CWIID_IR_Y_MAX 768 - -/* Battery */ -#define CWIID_BATTERY_MAX 0xD0 - -/* Classic Controller Maxes */ -#define CWIID_CLASSIC_L_STICK_MAX 0x3F -#define CWIID_CLASSIC_R_STICK_MAX 0x1F -#define CWIID_CLASSIC_LR_MAX 0x1F - -/* Environment Variables */ -#define WIIMOTE_BDADDR "WIIMOTE_BDADDR" - -/* Callback Maximum Message Count */ -#define CWIID_MAX_MESG_COUNT 5 - -/* Enumerations */ -enum cwiid_command { - CWIID_CMD_STATUS, - CWIID_CMD_LED, - CWIID_CMD_RUMBLE, - CWIID_CMD_RPT_MODE -}; - -enum cwiid_mesg_type { - CWIID_MESG_STATUS, - CWIID_MESG_BTN, - CWIID_MESG_ACC, - CWIID_MESG_IR, - CWIID_MESG_NUNCHUK, - CWIID_MESG_CLASSIC, - CWIID_MESG_BALANCE, - CWIID_MESG_MOTIONPLUS, - CWIID_MESG_ERROR, - CWIID_MESG_UNKNOWN -}; - -enum cwiid_ext_type { - CWIID_EXT_NONE, - CWIID_EXT_NUNCHUK, - CWIID_EXT_CLASSIC, - CWIID_EXT_BALANCE, - CWIID_EXT_MOTIONPLUS, - CWIID_EXT_UNKNOWN -}; - -enum cwiid_error { - CWIID_ERROR_NONE, - CWIID_ERROR_DISCONNECT, - CWIID_ERROR_COMM -}; - -struct acc_cal { - uint8_t zero[3]; - uint8_t one[3]; -}; - -struct balance_cal { - uint16_t right_top[3]; - uint16_t right_bottom[3]; - uint16_t left_top[3]; - uint16_t left_bottom[3]; -}; - -/* Message Structs */ -struct cwiid_status_mesg { - enum cwiid_mesg_type type; - uint8_t battery; - enum cwiid_ext_type ext_type; -}; - -struct cwiid_btn_mesg { - enum cwiid_mesg_type type; - uint16_t buttons; -}; - -struct cwiid_acc_mesg { - enum cwiid_mesg_type type; - uint8_t acc[3]; -}; - -struct cwiid_ir_src { - char valid; - uint16_t pos[2]; - int8_t size; -}; - -struct cwiid_ir_mesg { - enum cwiid_mesg_type type; - struct cwiid_ir_src src[CWIID_IR_SRC_COUNT]; -}; - -struct cwiid_nunchuk_mesg { - enum cwiid_mesg_type type; - uint8_t stick[2]; - uint8_t acc[3]; - uint8_t buttons; -}; - -struct cwiid_classic_mesg { - enum cwiid_mesg_type type; - uint8_t l_stick[2]; - uint8_t r_stick[2]; - uint8_t l; - uint8_t r; - uint16_t buttons; -}; - -struct cwiid_balance_mesg { - enum cwiid_mesg_type type; - uint16_t right_top; - uint16_t right_bottom; - uint16_t left_top; - uint16_t left_bottom; -}; - -struct cwiid_motionplus_mesg { - enum cwiid_mesg_type type; - uint16_t angle_rate[3]; -}; - -struct cwiid_error_mesg { - enum cwiid_mesg_type type; - enum cwiid_error error; -}; - -union cwiid_mesg { - enum cwiid_mesg_type type; - struct cwiid_status_mesg status_mesg; - struct cwiid_btn_mesg btn_mesg; - struct cwiid_acc_mesg acc_mesg; - struct cwiid_ir_mesg ir_mesg; - struct cwiid_nunchuk_mesg nunchuk_mesg; - struct cwiid_classic_mesg classic_mesg; - struct cwiid_balance_mesg balance_mesg; - struct cwiid_motionplus_mesg motionplus_mesg; - struct cwiid_error_mesg error_mesg; -}; - -/* State Structs */ -struct nunchuk_state { - uint8_t stick[2]; - uint8_t acc[3]; - uint8_t buttons; -}; - -struct classic_state { - uint8_t l_stick[2]; - uint8_t r_stick[2]; - uint8_t l; - uint8_t r; - uint16_t buttons; -}; - -struct balance_state { - uint16_t right_top; - uint16_t right_bottom; - uint16_t left_top; - uint16_t left_bottom; -}; - -struct motionplus_state { - uint16_t angle_rate[3]; -}; - -union ext_state { - struct nunchuk_state nunchuk; - struct classic_state classic; - struct balance_state balance; - struct motionplus_state motionplus; -}; - -struct cwiid_state { - uint8_t rpt_mode; - uint8_t led; - uint8_t rumble; - uint8_t battery; - uint16_t buttons; - uint8_t acc[3]; - struct cwiid_ir_src ir_src[CWIID_IR_SRC_COUNT]; - enum cwiid_ext_type ext_type; - union ext_state ext; - enum cwiid_error error; -}; - -/* Typedefs */ -typedef struct wiimote cwiid_wiimote_t; - -typedef void cwiid_mesg_callback_t(cwiid_wiimote_t *, int, - union cwiid_mesg [], struct timespec *); -typedef void cwiid_err_t(cwiid_wiimote_t *, const char *, va_list ap); - -/* get_bdinfo */ -#define BT_NO_WIIMOTE_FILTER 0x01 -#define BT_NAME_LEN 32 - -struct cwiid_bdinfo { - bdaddr_t bdaddr; - uint8_t btclass[3]; - char name[BT_NAME_LEN]; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Error reporting (library wide) */ -int cwiid_set_err(cwiid_err_t *err); -void cwiid_err_default(struct wiimote *wiimote, const char *str, va_list ap); - -/* Connection */ -#define cwiid_connect cwiid_open -#define cwiid_disconnect cwiid_close -cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags); -cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout); -int cwiid_close(cwiid_wiimote_t *wiimote); - -int cwiid_get_id(cwiid_wiimote_t *wiimote); -int cwiid_set_data(cwiid_wiimote_t *wiimote, const void *data); -const void *cwiid_get_data(cwiid_wiimote_t *wiimote); -int cwiid_enable(cwiid_wiimote_t *wiimote, int flags); -int cwiid_disable(cwiid_wiimote_t *wiimote, int flags); - -/* Interfaces */ -int cwiid_set_mesg_callback(cwiid_wiimote_t *wiimote, - cwiid_mesg_callback_t *callback); -int cwiid_get_mesg(cwiid_wiimote_t *wiimote, int *mesg_count, - union cwiid_mesg *mesg[], struct timespec *timestamp); -int cwiid_get_state(cwiid_wiimote_t *wiimote, struct cwiid_state *state); -int cwiid_get_acc_cal(struct wiimote *wiimote, enum cwiid_ext_type ext_type, - struct acc_cal *acc_cal); -int cwiid_get_balance_cal(struct wiimote *wiimote, - struct balance_cal *balance_cal); - -/* Operations */ -int cwiid_command(cwiid_wiimote_t *wiimote, enum cwiid_command command, - int flags); -int cwiid_send_rpt(cwiid_wiimote_t *wiimote, uint8_t flags, uint8_t report, - size_t len, const void *data); -int cwiid_request_status(cwiid_wiimote_t *wiimote); -int cwiid_set_led(cwiid_wiimote_t *wiimote, uint8_t led); -int cwiid_set_rumble(cwiid_wiimote_t *wiimote, uint8_t rumble); -int cwiid_set_rpt_mode(cwiid_wiimote_t *wiimote, uint8_t rpt_mode); -int cwiid_read(cwiid_wiimote_t *wiimote, uint8_t flags, uint32_t offset, - uint16_t len, void *data); -int cwiid_write(cwiid_wiimote_t *wiimote, uint8_t flags, uint32_t offset, - uint16_t len, const void *data); -/* int cwiid_beep(cwiid_wiimote_t *wiimote); */ - -/* HCI functions */ -int cwiid_get_bdinfo_array(int dev_id, unsigned int timeout, int max_bdinfo, - struct cwiid_bdinfo **bdinfo, uint8_t flags); -int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.pc.in.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.pc.in.svn-base deleted file mode 100644 index 66e334684427be42a0b6cc6984716796281893c3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid.pc.in.svn-base +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -sysconfdir=@sysconfdir@ -cwiid_config_dir=@CWIID_CONFIG_DIR@ -cwiid_plugins_dir=@CWIID_PLUGINS_DIR@ - -Name: CWiid -Description: CWiid Wiimote Interface -Version: @PACKAGE_VERSION@ -Requires: bluez -Libs: -L${libdir} -lcwiid -Cflags: -I${includedir} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid_internal.h.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid_internal.h.svn-base deleted file mode 100644 index 937a6e34970c6b1a2221593bea86ecd2f739d745..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/cwiid_internal.h.svn-base +++ /dev/null @@ -1,224 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * remove error_pipe - * * add struct mesg_array to process_error - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to mesg_array - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * moved RW error state to separate member - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * removed CWIID_CMP_LEN macro and cwiid_findfirst prototype - * - * 2007-03-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * added wiimote parameter to cwiid_err prototype - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifndef CWIID_INTERNAL_H -#define CWIID_INTERNAL_H - -#include <stdint.h> -#include <pthread.h> -#include <sys/types.h> /* ssize_t */ -#include "cwiid.h" - -/* Bluetooth magic numbers */ -#define BT_TRANS_MASK 0xF0 -#define BT_TRANS_HANDSHAKE 0x00 -#define BT_TRANS_SET_REPORT 0x50 -#define BT_TRANS_DATA 0xA0 -#define BT_TRANS_DATAC 0xB0 - -#define BT_PARAM_MASK 0x0F -/* HANDSHAKE params */ -#define BT_PARAM_SUCCESSFUL 0x00 -#define BT_PARAM_NOT_READY 0x01 -#define BT_PARAM_ERR_INVALID_REPORT_ID 0x02 -#define BT_PARAM_ERR_UNSUPPORTED_REQUEST 0x03 -#define BT_PARAM_ERR_INVALID_PARAMETER 0x04 -#define BT_PARAM_ERR_UNKNOWN 0x0E -#define BT_PARAM_ERR_FATAL 0x0F -/* SET_REPORT, DATA, DATAC params */ -#define BT_PARAM_INPUT 0x01 -#define BT_PARAM_OUTPUT 0x02 -#define BT_PARAM_FEATURE 0x03 - -/* Wiimote specific magic numbers */ -#define WIIMOTE_NAME "Nintendo RVL-CNT-01" -#define WIIBALANCE_NAME "Nintendo RVL-WBC-01" -#define WIIMOTE_CLASS_0 0x04 -#define WIIMOTE_CLASS_1 0x25 -#define WIIMOTE_CLASS_2 0x00 - -/* Wiimote port/channel/PSMs */ -#define CTL_PSM 17 -#define INT_PSM 19 - -/* Report numbers */ -#define RPT_LED_RUMBLE 0x11 -#define RPT_RPT_MODE 0x12 -#define RPT_IR_ENABLE1 0x13 -#define RPT_SPEAKER_ENABLE 0x14 -#define RPT_STATUS_REQ 0x15 -#define RPT_WRITE 0x16 -#define RPT_READ_REQ 0x17 -#define RPT_SPEAKER_DATA 0x18 -#define RPT_SPEAKER_MUTE 0x19 -#define RPT_IR_ENABLE2 0x1A -#define RPT_STATUS 0x20 -#define RPT_READ_DATA 0x21 -#define RPT_WRITE_ACK 0x22 -#define RPT_BTN 0x30 -#define RPT_BTN_ACC 0x31 -#define RPT_BTN_EXT8 0x32 -#define RPT_BTN_ACC_IR12 0x33 -#define RPT_BTN_EXT19 0x34 -#define RPT_BTN_ACC_EXT16 0x35 -#define RPT_BTN_IR10_EXT9 0x36 -#define RPT_BTN_ACC_IR10_EXT6 0x37 -#define RPT_EXT21 0x3D -#define RPT_BTN_ACC_IR36_1 0x3E -#define RPT_BTN_ACC_IR36_2 0x3F - -/* Button Mask (masks unknown bits in button bytes) */ -#define BTN_MASK_0 0x1F -#define BTN_MASK_1 0x9F -#define NUNCHUK_BTN_MASK 0x03 - -/* Extension Values */ -#define EXT_NONE 0x2E -#define EXT_PARTIAL 0xFF -#define EXT_NUNCHUK 0x00 -#define EXT_CLASSIC 0x01 -#define EXT_BALANCE 0x2A -#define EXT_MOTIONPLUS 0x04 - -/* IR Enable blocks */ -#define MARCAN_IR_BLOCK_1 "\x00\x00\x00\x00\x00\x00\x90\x00\xC0" -#define MARCAN_IR_BLOCK_2 "\x40\x00" -#define CLIFF_IR_BLOCK_1 "\x02\x00\x00\x71\x01\x00\xAA\x00\x64" -#define CLIFF_IR_BLOCK_2 "\x63\x03" - -/* Write Sequences */ -enum write_seq_type { - WRITE_SEQ_RPT, - WRITE_SEQ_MEM -}; - -struct write_seq { - enum write_seq_type type; - uint32_t report_offset; - const void *data; - uint16_t len; - uint8_t flags; -}; - -#define SEQ_LEN(seq) (sizeof(seq)/sizeof(struct write_seq)) - -/* Message arrays */ -struct mesg_array { - uint8_t count; - struct timespec timestamp; - union cwiid_mesg array[CWIID_MAX_MESG_COUNT]; -}; - -/* RW State/Mesg */ -enum rw_status { - RW_IDLE, - RW_READ, - RW_WRITE, - RW_CANCEL -}; - -struct rw_mesg { - enum rw_status type; - uint8_t error; - uint32_t offset; - uint8_t len; - char data[16]; -}; - -/* Wiimote struct */ -struct wiimote { - int flags; - int ctl_socket; - int int_socket; - pthread_t router_thread; - pthread_t status_thread; - pthread_t mesg_callback_thread; - int mesg_pipe[2]; - int status_pipe[2]; - int rw_pipe[2]; - struct cwiid_state state; - enum rw_status rw_status; - cwiid_mesg_callback_t *mesg_callback; - pthread_mutex_t state_mutex; - pthread_mutex_t rw_mutex; - pthread_mutex_t rpt_mutex; - int id; - const void *data; -}; - -/* prototypes */ -/* thread.c */ -void *router_thread(struct wiimote *wiimote); -void *status_thread(struct wiimote *wiimote); -void *mesg_callback_thread(struct wiimote *wiimote); - -/* util.c */ -void cwiid_err(struct wiimote *wiimote, const char *str, ...); -int verify_handshake(struct wiimote *wiimote); -int exec_write_seq(struct wiimote *wiimote, unsigned int len, - struct write_seq *seq); -int full_read(int fd, void *buf, size_t len); -int write_mesg_array(struct wiimote *wiimote, struct mesg_array *ma); -int read_mesg_array(int fd, struct mesg_array *ma); -int cancel_rw(struct wiimote *wiimote); -int cancel_mesg_callback(struct wiimote *wiimote); - -/* process.c */ -int process_error(struct wiimote *, ssize_t, struct mesg_array *); -int process_status(struct wiimote *, const unsigned char *, - struct mesg_array *); -int process_btn(struct wiimote *, const unsigned char *, struct mesg_array *); -int process_acc(struct wiimote *, const unsigned char *, struct mesg_array *); -int process_ir10(struct wiimote *, const unsigned char *, struct mesg_array *); -int process_ir12(struct wiimote *, const unsigned char *, struct mesg_array *); -int process_ext(struct wiimote *, unsigned char *, unsigned char, - struct mesg_array *); -int process_read(struct wiimote *, unsigned char *); -int process_write(struct wiimote *, unsigned char *); - -/* state.c */ -int update_state(struct wiimote *wiimote, struct mesg_array *ma); -int update_rpt_mode(struct wiimote *wiimote, int8_t rpt_mode); - -#endif diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/interface.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/interface.c.svn-base deleted file mode 100644 index c6bb030279780ab6f416e8475e75ef517be0d2b0..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/interface.c.svn-base +++ /dev/null @@ -1,222 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to cwiid_get_mesg - * * added cwiid_get_acc_cal - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * created for API overhaul - */ - -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include <pthread.h> -#include <fcntl.h> -#include <unistd.h> -#include "cwiid_internal.h" - -int cwiid_get_id(cwiid_wiimote_t *wiimote) -{ - return wiimote->id; -} - -int cwiid_set_data(cwiid_wiimote_t *wiimote, const void *data) -{ - wiimote->data = data; - return 0; -} - -const void *cwiid_get_data(cwiid_wiimote_t *wiimote) -{ - return wiimote->data; -} - -int cwiid_enable(cwiid_wiimote_t *wiimote, int flags) -{ - unsigned char data; - - if ((flags & CWIID_FLAG_NONBLOCK) && - !(wiimote->flags & CWIID_FLAG_NONBLOCK)) { - if (fcntl(wiimote->mesg_pipe[0], F_SETFL, O_NONBLOCK)) { - cwiid_err(wiimote, "File control error (mesg pipe)"); - return -1; - } - } - if (flags & CWIID_FLAG_MOTIONPLUS) { - data = 0x04; - cwiid_write(wiimote, CWIID_RW_REG, 0xA600FE, 1, &data); - cwiid_request_status(wiimote); - } - wiimote->flags |= flags; - return 0; -} - -int cwiid_disable(cwiid_wiimote_t *wiimote, int flags) -{ - unsigned char data; - - if ((flags & CWIID_FLAG_NONBLOCK) && - (wiimote->flags & CWIID_FLAG_NONBLOCK)) { - if (fcntl(wiimote->mesg_pipe[0], F_SETFL, 0)) { - cwiid_err(wiimote, "File control error (mesg pipe)"); - return -1; - } - } - if (flags & CWIID_FLAG_MOTIONPLUS) { - data = 0x55; - cwiid_write(wiimote, CWIID_RW_REG, 0xA400F0, 1, &data); - data = 0x00; - cwiid_write(wiimote, CWIID_RW_REG, 0xA400FB, 1, &data); - cwiid_request_status(wiimote); - } - wiimote->flags &= ~flags; - return 0; -} - -int cwiid_set_mesg_callback(cwiid_wiimote_t *wiimote, - cwiid_mesg_callback_t *callback) -{ - if (wiimote->mesg_callback) { - if (cancel_mesg_callback(wiimote)) { - /* prints it's own errors */ - return -1; - } - } - - wiimote->mesg_callback = callback; - - if (wiimote->mesg_callback) { - if (pthread_create(&wiimote->mesg_callback_thread, NULL, - (void *(*)(void *))&mesg_callback_thread, wiimote)) { - cwiid_err(wiimote, "Thread creation error (callback thread)"); - return -1; - } - } - - return 0; -} - -int cwiid_get_mesg(cwiid_wiimote_t *wiimote, int *mesg_count, - union cwiid_mesg *mesg[], struct timespec *timestamp) -{ - struct mesg_array ma; - - if (read_mesg_array(wiimote->mesg_pipe[0], &ma)) { - if (errno == EAGAIN) { - return -1; - } - else { - cwiid_err(wiimote, "Pipe read error (mesg_pipe)"); - return -1; - } - } - - *mesg_count = ma.count; - *timestamp = ma.timestamp; - - if ((*mesg = malloc(ma.count * sizeof ma.array[0])) == NULL) { - cwiid_err(wiimote, "Memory allocation error (mesg array)"); - return -1; - } - - memcpy(*mesg, &ma.array, ma.count * sizeof (*mesg)[0]); - - return 0; -} - -int cwiid_get_state(cwiid_wiimote_t *wiimote, struct cwiid_state *state) -{ - if (pthread_mutex_lock(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex lock error (state mutex)"); - return -1; - } - - memcpy(state, &wiimote->state, sizeof *state); - - if (pthread_mutex_unlock(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (state mutex) - " - "deadlock warning"); - return -1; - } - - return 0; -} - -int cwiid_get_acc_cal(cwiid_wiimote_t *wiimote, enum cwiid_ext_type ext_type, - struct acc_cal *acc_cal) -{ - uint8_t flags; - uint32_t offset; - unsigned char buf[7]; - char *err_str; - - switch (ext_type) { - case CWIID_EXT_NONE: - flags = CWIID_RW_EEPROM; - offset = 0x16; - err_str = ""; - break; - case CWIID_EXT_NUNCHUK: - flags = CWIID_RW_REG; - offset = 0xA40020; - err_str = "nunchuk "; - break; - default: - cwiid_err(wiimote, "Unsupported calibration request"); - return -1; - } - if (cwiid_read(wiimote, flags, offset, 7, buf)) { - cwiid_err(wiimote, "Read error (%scal)", err_str); - return -1; - } - - acc_cal->zero[CWIID_X] = buf[0]; - acc_cal->zero[CWIID_Y] = buf[1]; - acc_cal->zero[CWIID_Z] = buf[2]; - acc_cal->one[CWIID_X] = buf[4]; - acc_cal->one[CWIID_Y] = buf[5]; - acc_cal->one[CWIID_Z] = buf[6]; - - return 0; -} - -int cwiid_get_balance_cal(cwiid_wiimote_t *wiimote, - struct balance_cal *balance_cal) -{ - unsigned char buf[24]; - - if (cwiid_read(wiimote, CWIID_RW_REG, 0xa40024, 24, buf)) { - cwiid_err(wiimote, "Read error (balancecal)"); - return -1; - } - balance_cal->right_top[0] = ((uint16_t)buf[0]<<8 | (uint16_t)buf[1]); - balance_cal->right_bottom[0] = ((uint16_t)buf[2]<<8 | (uint16_t)buf[3]); - balance_cal->left_top[0] = ((uint16_t)buf[4]<<8 | (uint16_t)buf[5]); - balance_cal->left_bottom[0] = ((uint16_t)buf[6]<<8 | (uint16_t)buf[7]); - balance_cal->right_top[1] = ((uint16_t)buf[8]<<8 | (uint16_t)buf[9]); - balance_cal->right_bottom[1] = ((uint16_t)buf[10]<<8 | (uint16_t)buf[11]); - balance_cal->left_top[1] = ((uint16_t)buf[12]<<8 | (uint16_t)buf[13]); - balance_cal->left_bottom[1] = ((uint16_t)buf[14]<<8 | (uint16_t)buf[15]); - balance_cal->right_top[2] = ((uint16_t)buf[16]<<8 | (uint16_t)buf[17]); - balance_cal->right_bottom[2] = ((uint16_t)buf[18]<<8 | (uint16_t)buf[19]); - balance_cal->left_top[2] = ((uint16_t)buf[20]<<8 | (uint16_t)buf[21]); - balance_cal->left_bottom[2] = ((uint16_t)buf[22]<<8 | (uint16_t)buf[23]); - - return 0; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/process.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/process.c.svn-base deleted file mode 100644 index 8d723b91a23bb96a979e7b6b08dc53e1bdd12f02..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/process.c.svn-base +++ /dev/null @@ -1,301 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * process_err adds error_mesg to mesg_array - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * created for API overhaul (moved from old event.c) - */ - -#include <unistd.h> -#include "cwiid_internal.h" - -int process_error(struct wiimote *wiimote, ssize_t len, struct mesg_array *ma) -{ - struct cwiid_error_mesg *error_mesg; - - error_mesg = &ma->array[ma->count++].error_mesg; - error_mesg->type = CWIID_MESG_ERROR; - if (len == 0) { - error_mesg->error = CWIID_ERROR_DISCONNECT; - } - else { - error_mesg->error = CWIID_ERROR_COMM; - } - - if (cancel_rw(wiimote)) { - cwiid_err(wiimote, "RW cancel error"); - } - - return 0; -} - -int process_status(struct wiimote *wiimote, const unsigned char *data, - struct mesg_array *ma) -{ - struct cwiid_status_mesg status_mesg; - - status_mesg.type = CWIID_MESG_STATUS; - status_mesg.battery = data[5]; - if (data[2] & 0x02) { - /* status_thread will figure out what it is */ - status_mesg.ext_type = CWIID_EXT_UNKNOWN; - } - else { - status_mesg.ext_type = CWIID_EXT_NONE; - } - - if (write(wiimote->status_pipe[1], &status_mesg, sizeof status_mesg) - != sizeof status_mesg) { - cwiid_err(wiimote, "Status pipe write error"); - return -1; - } - - return 0; -} - -int process_btn(struct wiimote *wiimote, const unsigned char *data, - struct mesg_array *ma) -{ - struct cwiid_btn_mesg *btn_mesg; - uint16_t buttons; - - buttons = (data[0] & BTN_MASK_0)<<8 | - (data[1] & BTN_MASK_1); - if (wiimote->state.rpt_mode & CWIID_RPT_BTN) { - if ((wiimote->state.buttons != buttons) || - (wiimote->flags & CWIID_FLAG_REPEAT_BTN)) { - btn_mesg = &ma->array[ma->count++].btn_mesg; - btn_mesg->type = CWIID_MESG_BTN; - btn_mesg->buttons = buttons; - } - } - - return 0; -} - -int process_acc(struct wiimote *wiimote, const unsigned char *data, - struct mesg_array *ma) -{ - struct cwiid_acc_mesg *acc_mesg; - - if (wiimote->state.rpt_mode & CWIID_RPT_ACC) { - acc_mesg = &ma->array[ma->count++].acc_mesg; - acc_mesg->type = CWIID_MESG_ACC; - acc_mesg->acc[CWIID_X] = data[0]; - acc_mesg->acc[CWIID_Y] = data[1]; - acc_mesg->acc[CWIID_Z] = data[2]; - } - - return 0; -} - -int process_ir10(struct wiimote *wiimote, const unsigned char *data, - struct mesg_array *ma) -{ - struct cwiid_ir_mesg *ir_mesg; - int i; - const unsigned char *block; - - if (wiimote->state.rpt_mode & CWIID_RPT_IR) { - ir_mesg = &ma->array[ma->count++].ir_mesg; - ir_mesg->type = CWIID_MESG_IR; - - for (i=0, block=data; i < CWIID_IR_SRC_COUNT; i+=2, block+=5) { - if (block[0] == 0xFF) { - ir_mesg->src[i].valid = 0; - } - else { - ir_mesg->src[i].valid = 1; - ir_mesg->src[i].pos[CWIID_X] = ((uint16_t)block[2] & 0x30)<<4 | - (uint16_t)block[0]; - ir_mesg->src[i].pos[CWIID_Y] = ((uint16_t)block[2] & 0xC0)<<2 | - (uint16_t)block[1]; - ir_mesg->src[i].size = -1; - } - - if (block[3] == 0xFF) { - ir_mesg->src[i+1].valid = 0; - } - else { - ir_mesg->src[i+1].valid = 1; - ir_mesg->src[i+1].pos[CWIID_X] = - ((uint16_t)block[2] & 0x03)<<8 | - (uint16_t)block[3]; - ir_mesg->src[i+1].pos[CWIID_Y] = - ((uint16_t)block[2] & 0x0C)<<6 | - (uint16_t)block[4]; - ir_mesg->src[i+1].size = -1; - } - } - } - - return 0; -} - -int process_ir12(struct wiimote *wiimote, const unsigned char *data, - struct mesg_array *ma) -{ - struct cwiid_ir_mesg *ir_mesg; - int i; - const unsigned char *block; - - if (wiimote->state.rpt_mode & CWIID_RPT_IR) { - ir_mesg = &ma->array[ma->count++].ir_mesg; - ir_mesg->type = CWIID_MESG_IR; - - for (i=0, block=data; i < CWIID_IR_SRC_COUNT; i++, block+=3) { - if (block[0] == 0xFF) { - ir_mesg->src[i].valid = 0; - } - else { - ir_mesg->src[i].valid = 1; - ir_mesg->src[i].pos[CWIID_X] = ((uint16_t)block[2] & 0x30)<<4 | - (uint16_t)block[0]; - ir_mesg->src[i].pos[CWIID_Y] = ((uint16_t)block[2] & 0xC0)<<2 | - (uint16_t)block[1]; - ir_mesg->src[i].size = block[2] & 0x0F; - } - } - } - - return 0; -} - -int process_ext(struct wiimote *wiimote, unsigned char *data, - unsigned char len, struct mesg_array *ma) -{ - struct cwiid_nunchuk_mesg *nunchuk_mesg; - struct cwiid_classic_mesg *classic_mesg; - struct cwiid_balance_mesg *balance_mesg; - struct cwiid_motionplus_mesg *motionplus_mesg; - int i; - - switch (wiimote->state.ext_type) { - case CWIID_EXT_NONE: - cwiid_err(wiimote, "Received unexpected extension report"); - break; - case CWIID_EXT_UNKNOWN: - break; - case CWIID_EXT_NUNCHUK: - if (wiimote->state.rpt_mode & CWIID_RPT_NUNCHUK) { - nunchuk_mesg = &ma->array[ma->count++].nunchuk_mesg; - nunchuk_mesg->type = CWIID_MESG_NUNCHUK; - nunchuk_mesg->stick[CWIID_X] = data[0]; - nunchuk_mesg->stick[CWIID_Y] = data[1]; - nunchuk_mesg->acc[CWIID_X] = data[2]; - nunchuk_mesg->acc[CWIID_Y] = data[3]; - nunchuk_mesg->acc[CWIID_Z] = data[4]; - nunchuk_mesg->buttons = ~data[5] & NUNCHUK_BTN_MASK; - } - break; - case CWIID_EXT_CLASSIC: - if (wiimote->state.rpt_mode & CWIID_RPT_CLASSIC) { - classic_mesg = &ma->array[ma->count++].classic_mesg; - classic_mesg->type = CWIID_MESG_CLASSIC; - - for (i=0; i < 6; i++) { - data[i] = data[i]; - } - - classic_mesg->l_stick[CWIID_X] = data[0] & 0x3F; - classic_mesg->l_stick[CWIID_Y] = data[1] & 0x3F; - classic_mesg->r_stick[CWIID_X] = (data[0] & 0xC0)>>3 | - (data[1] & 0xC0)>>5 | - (data[2] & 0x80)>>7; - classic_mesg->r_stick[CWIID_Y] = data[2] & 0x1F; - classic_mesg->l = (data[2] & 0x60)>>2 | - (data[3] & 0xE0)>>5; - classic_mesg->r = data[3] & 0x1F; - classic_mesg->buttons = ~((uint16_t)data[4]<<8 | - (uint16_t)data[5]); - } - break; - case CWIID_EXT_BALANCE: - if (wiimote->state.rpt_mode & CWIID_RPT_BALANCE) { - balance_mesg = &ma->array[ma->count++].balance_mesg; - balance_mesg->type = CWIID_MESG_BALANCE; - balance_mesg->right_top = ((uint16_t)data[0]<<8 | - (uint16_t)data[1]); - balance_mesg->right_bottom = ((uint16_t)data[2]<<8 | - (uint16_t)data[3]); - balance_mesg->left_top = ((uint16_t)data[4]<<8 | - (uint16_t)data[5]); - balance_mesg->left_bottom = ((uint16_t)data[6]<<8 | - (uint16_t)data[7]); - } - case CWIID_EXT_MOTIONPLUS: - if (wiimote->state.rpt_mode & CWIID_RPT_MOTIONPLUS) { - motionplus_mesg = &ma->array[ma->count++].motionplus_mesg; - motionplus_mesg->type = CWIID_MESG_MOTIONPLUS; - motionplus_mesg->angle_rate[CWIID_PHI] = ((uint16_t)data[5] & 0xFC)<<6 | - (uint16_t)data[2]; - motionplus_mesg->angle_rate[CWIID_THETA] = ((uint16_t)data[4] & 0xFC)<<6 | - (uint16_t)data[1]; - motionplus_mesg->angle_rate[CWIID_PSI] = ((uint16_t)data[3] & 0xFC)<<6 | - (uint16_t)data[0]; - } - break; - } - - return 0; -} - -int process_read(struct wiimote *wiimote, unsigned char *data) -{ - struct rw_mesg rw_mesg; - - if (wiimote->rw_status != RW_READ) { - cwiid_err(wiimote, "Received unexpected read report"); - return -1; - } - - rw_mesg.type = RW_READ; - rw_mesg.len = (data[0]>>4)+1; - rw_mesg.error = data[0] & 0x0F; - memcpy(&rw_mesg.data, data+3, rw_mesg.len); - - if (write(wiimote->rw_pipe[1], &rw_mesg, sizeof rw_mesg) != - sizeof rw_mesg) { - cwiid_err(wiimote, "RW pipe write error"); - return -1; - } - - return 0; -} - -int process_write(struct wiimote *wiimote, unsigned char *data) -{ - struct rw_mesg rw_mesg; - - if (wiimote->rw_status != RW_WRITE) { - cwiid_err(wiimote, "Received unexpected write report"); - return -1; - } - - rw_mesg.type = RW_WRITE; - rw_mesg.error = data[0]; - - if (write(wiimote->rw_pipe[1], &rw_mesg, sizeof rw_mesg) != - sizeof rw_mesg) { - cwiid_err(wiimote, "RW pipe write error"); - return -1; - } - - return 0; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/state.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/state.c.svn-base deleted file mode 100644 index bf077fcd4f9e0b4340bb8663dcd5b5822ec91355..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/state.c.svn-base +++ /dev/null @@ -1,260 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * created for API overhaul (update_rpt_mode moved from command.c) - */ - -#include <string.h> -#include <pthread.h> -#include "cwiid_internal.h" - -int update_state(struct wiimote *wiimote, struct mesg_array *ma) -{ - int i; - union cwiid_mesg *mesg; - - if (pthread_mutex_lock(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex lock error (state mutex)"); - return -1; - } - - for (i=0; i < ma->count; i++) { - mesg = &ma->array[i]; - - switch (mesg->type) { - case CWIID_MESG_STATUS: - wiimote->state.battery = mesg->status_mesg.battery; - if (wiimote->state.ext_type != mesg->status_mesg.ext_type) { - memset(&wiimote->state.ext, 0, sizeof wiimote->state.ext); - wiimote->state.ext_type = mesg->status_mesg.ext_type; - } - break; - case CWIID_MESG_BTN: - wiimote->state.buttons = mesg->btn_mesg.buttons; - break; - case CWIID_MESG_ACC: - memcpy(wiimote->state.acc, mesg->acc_mesg.acc, - sizeof wiimote->state.acc); - break; - case CWIID_MESG_IR: - memcpy(wiimote->state.ir_src, mesg->ir_mesg.src, - sizeof wiimote->state.ir_src); - break; - case CWIID_MESG_NUNCHUK: - memcpy(wiimote->state.ext.nunchuk.stick, - mesg->nunchuk_mesg.stick, - sizeof wiimote->state.ext.nunchuk.stick); - memcpy(wiimote->state.ext.nunchuk.acc, - mesg->nunchuk_mesg.acc, - sizeof wiimote->state.ext.nunchuk.acc); - wiimote->state.ext.nunchuk.buttons = mesg->nunchuk_mesg.buttons; - break; - case CWIID_MESG_CLASSIC: - memcpy(wiimote->state.ext.classic.l_stick, - mesg->classic_mesg.l_stick, - sizeof wiimote->state.ext.classic.l_stick); - memcpy(wiimote->state.ext.classic.r_stick, - mesg->classic_mesg.r_stick, - sizeof wiimote->state.ext.classic.r_stick); - wiimote->state.ext.classic.l = mesg->classic_mesg.l; - wiimote->state.ext.classic.r = mesg->classic_mesg.r; - wiimote->state.ext.classic.buttons = mesg->classic_mesg.buttons; - break; - case CWIID_MESG_BALANCE: - wiimote->state.ext.balance.right_top = mesg->balance_mesg.right_top; - wiimote->state.ext.balance.right_bottom = mesg->balance_mesg.right_bottom; - wiimote->state.ext.balance.left_top = mesg->balance_mesg.left_top; - wiimote->state.ext.balance.left_bottom = mesg->balance_mesg.left_bottom; - break; - case CWIID_MESG_MOTIONPLUS: - memcpy(wiimote->state.ext.motionplus.angle_rate, - mesg->motionplus_mesg.angle_rate, - sizeof wiimote->state.ext.motionplus.angle_rate); - break; - case CWIID_MESG_ERROR: - wiimote->state.error = mesg->error_mesg.error; - break; - case CWIID_MESG_UNKNOWN: - /* do nothing, error has already been printed */ - break; - } - } - - if (pthread_mutex_unlock(&wiimote->state_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (state mutex) - " - "deadlock warning"); - return -1; - } - - return 0; -} - -/* IR Sensitivity Block */ -unsigned char ir_block1[] = CLIFF_IR_BLOCK_1; -unsigned char ir_block2[] = CLIFF_IR_BLOCK_2; - -struct write_seq ir_enable10_seq[] = { - {WRITE_SEQ_RPT, RPT_IR_ENABLE1, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_RPT, RPT_IR_ENABLE2, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_MEM, 0xB00030, (const void *)"\x08", 1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB00000, ir_block1, sizeof(ir_block1)-1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB0001A, ir_block2, sizeof(ir_block2)-1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB00033, (const void *)"\x01", 1, CWIID_RW_REG} -}; - -struct write_seq ir_enable12_seq[] = { - {WRITE_SEQ_RPT, RPT_IR_ENABLE1, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_RPT, RPT_IR_ENABLE2, (const void *)"\x04", 1, 0}, - {WRITE_SEQ_MEM, 0xB00030, (const void *)"\x08", 1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB00000, ir_block1, sizeof(ir_block1)-1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB0001A, ir_block2, sizeof(ir_block2)-1, CWIID_RW_REG}, - {WRITE_SEQ_MEM, 0xB00033, (const void *)"\x03", 1, CWIID_RW_REG} -}; - -struct write_seq ir_disable_seq[] = { - {WRITE_SEQ_RPT, RPT_IR_ENABLE1, (const void *)"\x00", 1, 0}, - {WRITE_SEQ_RPT, RPT_IR_ENABLE2, (const void *)"\x00", 1, 0} -}; - -#define RPT_MODE_BUF_LEN 2 -int update_rpt_mode(struct wiimote *wiimote, int8_t rpt_mode) -{ - unsigned char buf[RPT_MODE_BUF_LEN]; - uint8_t rpt_type; - struct write_seq *ir_enable_seq; - int seq_len; - - /* rpt_mode = bitmask of requested report types */ - /* rpt_type = report id sent to the wiimote */ - if (pthread_mutex_lock(&wiimote->rpt_mutex)) { - cwiid_err(wiimote, "Mutex lock error (rpt mutex)"); - return -1; - } - - /* -1 updates the reporting mode using old rpt_mode - * (reporting type may change if extensions are - * plugged in/unplugged */ - if (rpt_mode == -1) { - rpt_mode = wiimote->state.rpt_mode; - } - - /* Pick a report mode based on report flags */ - if ((rpt_mode & CWIID_RPT_EXT) && - ((wiimote->state.ext_type == CWIID_EXT_NUNCHUK) || - (wiimote->state.ext_type == CWIID_EXT_CLASSIC) || - (wiimote->state.ext_type == CWIID_EXT_MOTIONPLUS))) { - if ((rpt_mode & CWIID_RPT_IR) && (rpt_mode & CWIID_RPT_ACC)) { - rpt_type = RPT_BTN_ACC_IR10_EXT6; - ir_enable_seq = ir_enable10_seq; - seq_len = SEQ_LEN(ir_enable10_seq); - } - else if (rpt_mode & CWIID_RPT_IR) { - rpt_type = RPT_BTN_IR10_EXT9; - ir_enable_seq = ir_enable10_seq; - seq_len = SEQ_LEN(ir_enable10_seq); - } - else if (rpt_mode & CWIID_RPT_ACC) { - rpt_type = RPT_BTN_ACC_EXT16; - } - else if (rpt_mode & CWIID_RPT_BTN) { - rpt_type = RPT_BTN_EXT8; - } - else { - rpt_type = RPT_EXT21; - } - } - else if ((rpt_mode & CWIID_RPT_EXT) && - wiimote->state.ext_type == CWIID_EXT_BALANCE) { - rpt_type = RPT_BTN_EXT8; - } - else { - if (rpt_mode & CWIID_RPT_IR) { - rpt_type = RPT_BTN_ACC_IR12; - ir_enable_seq = ir_enable12_seq; - seq_len = SEQ_LEN(ir_enable12_seq); - } - else if (rpt_mode & CWIID_RPT_ACC) { - rpt_type = RPT_BTN_ACC; - } - else { - rpt_type = RPT_BTN; - } - } - - /* Enable IR */ - /* TODO: only do this when necessary (record old IR mode) */ - if ((rpt_mode & CWIID_RPT_IR)) { - if (exec_write_seq(wiimote, seq_len, ir_enable_seq)) { - cwiid_err(wiimote, "IR enable error"); - return -1; - } - } - /* Disable IR */ - else if ((wiimote->state.rpt_mode & CWIID_RPT_IR) && - !(rpt_mode & CWIID_RPT_IR)) { - if (exec_write_seq(wiimote, SEQ_LEN(ir_disable_seq), ir_disable_seq)) { - cwiid_err(wiimote, "IR disable error"); - return -1; - } - } - - /* Send SET_REPORT */ - buf[0] = (wiimote->flags & CWIID_FLAG_CONTINUOUS) ? 0x04 : 0; - buf[1] = rpt_type; - if (cwiid_send_rpt(wiimote, 0, RPT_RPT_MODE, RPT_MODE_BUF_LEN, buf)) { - cwiid_err(wiimote, "Send report error (report mode)"); - return -1; - } - - /* clear state for unreported data */ - if (CWIID_RPT_BTN & ~rpt_mode & wiimote->state.rpt_mode) { - wiimote->state.buttons = 0; - } - if (CWIID_RPT_ACC & ~rpt_mode & wiimote->state.rpt_mode) { - memset(wiimote->state.acc, 0, sizeof wiimote->state.acc); - } - if (CWIID_RPT_IR & ~rpt_mode & wiimote->state.rpt_mode) { - memset(wiimote->state.ir_src, 0, sizeof wiimote->state.ir_src); - } - if ((wiimote->state.ext_type == CWIID_EXT_NUNCHUK) && - (CWIID_RPT_NUNCHUK & ~rpt_mode & wiimote->state.rpt_mode)) { - memset(&wiimote->state.ext, 0, sizeof wiimote->state.ext); - } - else if ((wiimote->state.ext_type == CWIID_EXT_CLASSIC) && - (CWIID_RPT_CLASSIC & ~rpt_mode & wiimote->state.rpt_mode)) { - memset(&wiimote->state.ext, 0, sizeof wiimote->state.ext); - } - else if ((wiimote->state.ext_type == CWIID_EXT_BALANCE) && - (CWIID_RPT_BALANCE & ~rpt_mode & wiimote->state.rpt_mode)) { - memset(&wiimote->state.ext, 0, sizeof wiimote->state.ext); - } - else if ((wiimote->state.ext_type == CWIID_EXT_MOTIONPLUS) && - (CWIID_RPT_MOTIONPLUS & ~rpt_mode & wiimote->state.rpt_mode)) { - memset(&wiimote->state.ext, 0, sizeof wiimote->state.ext); - } - - wiimote->state.rpt_mode = rpt_mode; - - if (pthread_mutex_unlock(&wiimote->rpt_mutex)) { - cwiid_err(wiimote, "Mutex unlock error (rpt mutex) - " - "deadlock warning"); - return -1; - } - - return 0; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/thread.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/thread.c.svn-base deleted file mode 100644 index 955075e08323366a16132515ad8311cd84c919ad..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/thread.c.svn-base +++ /dev/null @@ -1,306 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * send error_mesg from process_error - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to message array - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul (renamed from event.c) - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * fixed incompatible pointer warning in process_error - * - * 2007-04-08 Petter Reinholdtsen <pere@hungry.com> - * * fixed signed/unsigned comparison error in int_listen - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * implemented process_error to handle socket read errors - * * added rw_status triggers to read and write handlers - * - * 2007-03-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * audit error checking - * * reorganized file - * * moved int_listen read/write code to process_read and process_write - * * updated (some/a few) comments - * - * 2007-03-06 L. Donnie Smith <cwiid@abstrakraft.org> - * * added wiimote parameter to cwiid_err calls - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#include <stdint.h> -#include <stdlib.h> -#include <string.h> -#include <pthread.h> -#include <time.h> -#include <unistd.h> -#include "cwiid_internal.h" - -#define READ_BUF_LEN 23 -void *router_thread(struct wiimote *wiimote) -{ - unsigned char buf[READ_BUF_LEN]; - ssize_t len; - struct mesg_array ma; - char err, print_clock_err = 1; - - while (1) { - /* Read packet */ - len = read(wiimote->int_socket, buf, READ_BUF_LEN); - ma.count = 0; - if (clock_gettime(CLOCK_REALTIME, &ma.timestamp)) { - if (print_clock_err) { - cwiid_err(wiimote, "clock_gettime error"); - print_clock_err = 0; - } - } - err = 0; - if ((len == -1) || (len == 0)) { - process_error(wiimote, len, &ma); - write_mesg_array(wiimote, &ma); - /* Quit! */ - break; - } - else { - /* Verify first byte (DATA/INPUT) */ - if (buf[0] != (BT_TRANS_DATA | BT_PARAM_INPUT)) { - cwiid_err(wiimote, "Invalid packet type"); - } - - /* Main switch */ - /* printf("%.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); - printf("%.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X\n", buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]); - printf("%.2X %.2X %.2X %.2X %.2X %.2X %.2X %.2X\n", buf[16], buf[17], buf[18], buf[19], buf[20], buf[21], buf[22], buf[23]); - printf("\n"); */ - switch (buf[1]) { - case RPT_STATUS: - err = process_status(wiimote, &buf[2], &ma); - break; - case RPT_BTN: - err = process_btn(wiimote, &buf[2], &ma); - break; - case RPT_BTN_ACC: - err = process_btn(wiimote, &buf[2], &ma) || - process_acc(wiimote, &buf[4], &ma); - break; - case RPT_BTN_EXT8: - err = process_btn(wiimote, &buf[2], &ma) || - process_ext(wiimote, &buf[4], 8, &ma); - break; - case RPT_BTN_ACC_IR12: - err = process_btn(wiimote, &buf[2], &ma) || - process_acc(wiimote, &buf[4], &ma) || - process_ir12(wiimote, &buf[7], &ma); - break; - case RPT_BTN_EXT19: - err = process_btn(wiimote, &buf[2], &ma) || - process_ext(wiimote, &buf[4], 19, &ma); - break; - case RPT_BTN_ACC_EXT16: - err = process_btn(wiimote, &buf[2], &ma) || - process_acc(wiimote, &buf[4], &ma) || - process_ext(wiimote, &buf[7], 16, &ma); - break; - case RPT_BTN_IR10_EXT9: - err = process_btn(wiimote, &buf[2], &ma) || - process_ir10(wiimote, &buf[4], &ma) || - process_ext(wiimote, &buf[14], 9, &ma); - break; - case RPT_BTN_ACC_IR10_EXT6: - err = process_btn(wiimote, &buf[2], &ma) || - process_acc(wiimote, &buf[4], &ma) || - process_ir10(wiimote, &buf[7], &ma) || - process_ext(wiimote, &buf[17], 6, &ma); - break; - case RPT_EXT21: - err = process_ext(wiimote, &buf[2], 21, &ma); - break; - case RPT_BTN_ACC_IR36_1: - case RPT_BTN_ACC_IR36_2: - cwiid_err(wiimote, "Unsupported report type received " - "(interleaved data)"); - err = 1; - break; - case RPT_READ_DATA: - err = process_read(wiimote, &buf[4]) || - process_btn(wiimote, &buf[2], &ma); - break; - case RPT_WRITE_ACK: - err = process_write(wiimote, &buf[2]); - break; - default: - cwiid_err(wiimote, "Unknown message type"); - err = 1; - break; - } - - if (!err && (ma.count > 0)) { - if (update_state(wiimote, &ma)) { - cwiid_err(wiimote, "State update error"); - } - if (wiimote->flags & CWIID_FLAG_MESG_IFC) { - /* prints its own errors */ - write_mesg_array(wiimote, &ma); - } - } - } - } - - return NULL; -} - -void *status_thread(struct wiimote *wiimote) -{ - struct mesg_array ma; - struct cwiid_status_mesg *status_mesg; - unsigned char buf[2]; - - ma.count = 1; - status_mesg = &ma.array[0].status_mesg; - - while (1) { - if (full_read(wiimote->status_pipe[0], status_mesg, - sizeof *status_mesg)) { - cwiid_err(wiimote, "Pipe read error (status)"); - /* Quit! */ - break; - } - - if (status_mesg->type != CWIID_MESG_STATUS) { - cwiid_err(wiimote, "Bad message on status pipe"); - continue; - } - - if (status_mesg->ext_type == CWIID_EXT_UNKNOWN) { - /* Read extension ID */ - if (cwiid_read(wiimote, CWIID_RW_REG, 0xA400FE, 1, &buf[0])) { - cwiid_err(wiimote, "Read error (extension error)"); - status_mesg->ext_type = CWIID_EXT_UNKNOWN; - } - /* If the extension didn't change, or if the extension is a - * MotionPlus, no init necessary */ - switch (buf[0]) { - case EXT_NONE: - status_mesg->ext_type = CWIID_EXT_NONE; - break; - case EXT_NUNCHUK: - status_mesg->ext_type = CWIID_EXT_NUNCHUK; - break; - case EXT_CLASSIC: - status_mesg->ext_type = CWIID_EXT_CLASSIC; - break; - case EXT_BALANCE: - status_mesg->ext_type = CWIID_EXT_BALANCE; - break; - case EXT_MOTIONPLUS: - status_mesg->ext_type = CWIID_EXT_MOTIONPLUS; - break; - case EXT_PARTIAL: - /* Everything (but MotionPlus) shows up as partial until initialized */ - buf[0] = 0x55; - buf[1] = 0x00; - /* Initialize extension register space */ - if (cwiid_write(wiimote, CWIID_RW_REG, 0xA400F0, 1, &buf[0])) { - cwiid_err(wiimote, "Extension initialization error"); - status_mesg->ext_type = CWIID_EXT_UNKNOWN; - } - else if (cwiid_write(wiimote, CWIID_RW_REG, 0xA400FB, 1, &buf[1])) { - cwiid_err(wiimote, "Extension initialization error"); - status_mesg->ext_type = CWIID_EXT_UNKNOWN; - } - /* Read extension ID */ - else if (cwiid_read(wiimote, CWIID_RW_REG, 0xA400FE, 1, &buf[0])) { - cwiid_err(wiimote, "Read error (extension error)"); - status_mesg->ext_type = CWIID_EXT_UNKNOWN; - } - else { - switch (buf[0]) { - case EXT_NONE: - case EXT_PARTIAL: - status_mesg->ext_type = CWIID_EXT_NONE; - break; - case EXT_NUNCHUK: - status_mesg->ext_type = CWIID_EXT_NUNCHUK; - break; - case EXT_CLASSIC: - status_mesg->ext_type = CWIID_EXT_CLASSIC; - break; - case EXT_BALANCE: - status_mesg->ext_type = CWIID_EXT_BALANCE; - break; - default: - status_mesg->ext_type = CWIID_EXT_UNKNOWN; - break; - } - } - break; - } - } - - if (update_state(wiimote, &ma)) { - cwiid_err(wiimote, "State update error"); - } - if (update_rpt_mode(wiimote, -1)) { - cwiid_err(wiimote, "Error reseting report mode"); - } - if ((wiimote->state.rpt_mode & CWIID_RPT_STATUS) && - (wiimote->flags & CWIID_FLAG_MESG_IFC)) { - if (write_mesg_array(wiimote, &ma)) { - /* prints its own errors */ - } - } - } - - return NULL; -} - -void *mesg_callback_thread(struct wiimote *wiimote) -{ - int mesg_pipe = wiimote->mesg_pipe[0]; - cwiid_mesg_callback_t *callback = wiimote->mesg_callback; - struct mesg_array ma; - int cancelstate; - - while (1) { - if (read_mesg_array(mesg_pipe, &ma)) { - cwiid_err(wiimote, "Mesg pipe read error"); - continue; - } - - /* TODO: The callback can still be called once after disconnect, - * although it's very unlikely. User must keep track and avoid - * accessing the wiimote struct after disconnect. */ - if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cancelstate)) { - cwiid_err(wiimote, "Cancel state disable error (callback thread)"); - } - callback(wiimote, ma.count, ma.array, &ma.timestamp); - if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &cancelstate)) { - cwiid_err(wiimote, "Cancel state restore error (callback thread)"); - } - } - - return NULL; -} diff --git a/l2ork_addons/cwiid/libcwiid/.svn/text-base/util.c.svn-base b/l2ork_addons/cwiid/libcwiid/.svn/text-base/util.c.svn-base deleted file mode 100644 index a7b8b3a8934c1650a78de18257324d64fb2206dc..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/libcwiid/.svn/text-base/util.c.svn-base +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2008-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * make cwiid_err_default public - * * clean up cwiid_err - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * rewrite for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * renamed wiimote to libcwiid, renamed structures accordingly - * - * 2007-04-08 Petter Reinholdtsen <pere@hungry.com> - * * fixed signed/unsigned comparison warning in send_report and - * exec_write_seq - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * removed cwiid_findfirst (moved to bluetooth.c) - * - * 2007-03-27 L. Donnie Smith <cwiid@abstrakraft.org> - * * moved cwiid_findfirst to bluetooth.c - * - * 2007-03-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * audited error checking (coda and error handler sections) - * - * 2007-03-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * created cwiid_err_func variable - * * created cwiid_err_default - * * added wiimote parameter to cwiid_err definition and calls - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#include <errno.h> -#include <stdarg.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include "cwiid_internal.h" - -cwiid_err_t cwiid_err_default; - -static cwiid_err_t *cwiid_err_func = &cwiid_err_default; - -int cwiid_set_err(cwiid_err_t *err) -{ - /* TODO: assuming pointer assignment is atomic operation */ - /* if it is, and the user doesn't care about race conditions, we don't - * either */ - cwiid_err_func = err; - return 0; -} - -void cwiid_err_default(struct wiimote *wiimote, const char *str, va_list ap) -{ - vfprintf(stderr, str, ap); - fprintf(stderr, "\n"); -} - -void cwiid_err(struct wiimote *wiimote, const char *str, ...) -{ - va_list ap; - - if (cwiid_err_func) { - va_start(ap, str); - (*cwiid_err_func)(wiimote, str, ap); - va_end(ap); - } -} - -int verify_handshake(struct wiimote *wiimote) -{ - unsigned char handshake; - if (read(wiimote->ctl_socket, &handshake, 1) != 1) { - cwiid_err(wiimote, "Socket read error (handshake)"); - return -1; - } - else if ((handshake & BT_TRANS_MASK) != BT_TRANS_HANDSHAKE) { - cwiid_err(wiimote, "Handshake expected, non-handshake received"); - return -1; - } - else if ((handshake & BT_PARAM_MASK) != BT_PARAM_SUCCESSFUL) { - cwiid_err(wiimote, "Non-successful handshake"); - return -1; - } - - return 0; -} - -int exec_write_seq(struct wiimote *wiimote, unsigned int len, - struct write_seq *seq) -{ - unsigned int i; - - for (i=0; i < len; i++) { - switch (seq[i].type) { - case WRITE_SEQ_RPT: - if (cwiid_send_rpt(wiimote, seq[i].flags, seq[i].report_offset, - seq[i].len, seq[i].data)) { - return -1; - } - break; - case WRITE_SEQ_MEM: - if (cwiid_write(wiimote, seq[i].flags, seq[i].report_offset, - seq[i].len, seq[i].data)) { - return -1; - } - break; - } - } - - return 0; -} - -int full_read(int fd, void *buf, size_t len) -{ - ssize_t last_len = 0; - - do { - if ((last_len = read(fd, buf, len)) == -1) { - return -1; - } - len -= last_len; - buf += last_len; - } while (len > 0); - - return 0; -} - -int write_mesg_array(struct wiimote *wiimote, struct mesg_array *ma) -{ - ssize_t len = (void *)&ma->array[ma->count] - (void *)ma; - int ret = 0; - - /* This must remain a single write operation to ensure atomicity, - * which is required to avoid mutexes and cancellation issues */ - if (write(wiimote->mesg_pipe[1], ma, len) != len) { - if (errno == EAGAIN) { - cwiid_err(wiimote, "Mesg pipe overflow"); - if (fcntl(wiimote->mesg_pipe[1], F_SETFL, 0)) { - cwiid_err(wiimote, "File control error (mesg pipe)"); - ret = -1; - } - else { - if (write(wiimote->mesg_pipe[1], ma, len) != len) { - cwiid_err(wiimote, "Pipe write error (mesg pipe)"); - ret = -1; - } - if (fcntl(wiimote->mesg_pipe[1], F_SETFL, O_NONBLOCK)) { - cwiid_err(wiimote, "File control error (mesg pipe"); - } - } - } - else { - cwiid_err(wiimote, "Pipe write error (mesg pipe)"); - ret = -1; - } - } - - return ret; -} - -int read_mesg_array(int fd, struct mesg_array *ma) -{ - ssize_t len; - - len = (void *)&ma->array[0] - (void *)ma; - if (full_read(fd, ma, len)) { - return -1; - } - - len = ma->count * sizeof ma->array[0]; - if (full_read(fd, &ma->array[0], len)) { - return -1; - } - - return 0; -} - -int cancel_rw(struct wiimote *wiimote) -{ - struct rw_mesg rw_mesg; - - rw_mesg.type = RW_CANCEL; - - if (write(wiimote->rw_pipe[1], &rw_mesg, sizeof rw_mesg) != - sizeof rw_mesg) { - cwiid_err(wiimote, "Pipe write error (rw)"); - return -1; - } - - return 0; -} - -int cancel_mesg_callback(struct wiimote *wiimote) -{ - int ret = 0; - - if (pthread_cancel(wiimote->mesg_callback_thread)) { - cwiid_err(wiimote, "Thread cancel error (callback thread)"); - ret = -1; - } - - if (pthread_detach(wiimote->mesg_callback_thread)) { - cwiid_err(wiimote, "Thread detach error (callback thread)"); - ret = -1; - } - - return ret; -} diff --git a/l2ork_addons/cwiid/lswm/.svn/all-wcprops b/l2ork_addons/cwiid/lswm/.svn/all-wcprops deleted file mode 100644 index 981226ee617833824a1f3850a2914c6d289ee9c3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/lswm/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 34 -/cwiid/svn/!svn/ver/137/trunk/lswm -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/137/trunk/lswm/Makefile.in -END -lswm.c -K 25 -svn:wc:ra_dav:version-url -V 41 -/cwiid/svn/!svn/ver/137/trunk/lswm/lswm.c -END diff --git a/l2ork_addons/cwiid/lswm/.svn/entries b/l2ork_addons/cwiid/lswm/.svn/entries deleted file mode 100644 index 032bc401e99ff147225b0f40d720242aebfc2aa2..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/lswm/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/lswm -http://abstrakraft.org/cwiid/svn - - - -2007-07-28T18:47:03.521454Z -137 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:36.000000Z -418b1cccaddaca6ef99721e123a58fa8 -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -301 - -lswm.c -file - - - - -2009-10-18T02:00:36.000000Z -fd39fe0179e0281b523436814ecad8bc -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -3715 - diff --git a/l2ork_addons/cwiid/lswm/.svn/format b/l2ork_addons/cwiid/lswm/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/lswm/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/lswm/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/lswm/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 79e8b5b83e1f8202c8de6ed32437441348d53841..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/lswm/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,19 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -APP_NAME = lswm - -SOURCES = lswm.c - -CFLAGS += -I@top_builddir@/libcwiid -LDFLAGS += -L@top_builddir@/libcwiid -LDLIBS += -lcwiid -INST_DIR = @bindir@ - -include $(COMMON)/include/app.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/lswm/.svn/text-base/lswm.c.svn-base b/l2ork_addons/cwiid/lswm/.svn/text-base/lswm.c.svn-base deleted file mode 100644 index 85e7ba08188f5ef61459571fe1b8584a86887d81..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/lswm/.svn/text-base/lswm.c.svn-base +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * added config.h include - * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION - * - * 2007-06-01 Nick <nickishappy@gmail.com> - * * reworked command-line options (added standard options, long options) - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-07 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_info.class to btclass - * - * 2007-04-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * created file - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <bluetooth/bluetooth.h> -#include <cwiid.h> -#include <getopt.h> - -void print_usage(void) -{ - printf("lswm lists availiable wiimotes\n"); - printf("Usage: %s [OPTIONS]...\n\n", "lswm"); - printf("Options:\n"); - printf("\t-h, --help\t\tPrints this output.\n"); - printf("\t-v, --version\t\toutput version information and exit.\n"); - printf("\t-l, --long\t\tlong format (device details).\n"); - printf("\t-q, --quiet\t\tquiet mode (less verbose).\n"); - printf("\t-a, --all\t\tlist all bluetooth devices (not just wiimotes).\n"); -} - -int main(int argc, char *argv[]) -{ - int c; - uint8_t flags = 0; - char long_format = 0; - char quiet = 0; - struct cwiid_bdinfo *bdinfo; - int bdinfo_count; - int i; - char ba_str[18]; - - /* Parse options */ - while (1) { - int option_index = 0; - - static struct option long_options[] = { - {"help", 0, 0, 'h'}, - {"all", 0, 0, 'a'}, - {"long", 0, 0, 'l'}, - {"version", 0, 0, 'v'}, - {"quiet", 0, 0, 'q'}, - {0, 0, 0, 0} - }; - - c = getopt_long(argc, argv, "halvq", long_options, &option_index); - - if (c == -1) { - break; - } - - switch (c) { - case 'h': - print_usage(); - return 0; - break; - case 'a': - flags |= BT_NO_WIIMOTE_FILTER; - break; - case 'l': - long_format = 1; - break; - case 'v': - printf("CWiid Version %s\n", PACKAGE_VERSION); - return 0; - break; - case 'q': - quiet = 1; - break; - case '?': - default: - fprintf(stderr, "Try '%s --help' for more information\n", argv[0]); - return -1; - break; - } - } - - /* Handle quiet mode */ - if (quiet) { - cwiid_set_err(NULL); - } - /* Print discoverable mode message */ - else if (flags & BT_NO_WIIMOTE_FILTER) { - fprintf(stderr, "Put Bluetooth devices in discoverable mode now...\n"); - } - else { - fprintf(stderr, "Put Wiimotes in discoverable mode now " - "(press 1+2)...\n"); - } - - /* Get device info */ - if ((bdinfo_count = cwiid_get_bdinfo_array(-1, 2, -1, &bdinfo, flags)) - == -1) { - return -1; - } - - /* Print info */ - for (i=0; i < bdinfo_count; i++) { - ba2str(&bdinfo[i].bdaddr, ba_str); - if (long_format) { - printf("%s 0x%.2X%.2X%.2X %s\n", ba_str, bdinfo[i].btclass[2], - bdinfo[i].btclass[1], bdinfo[i].btclass[0], bdinfo[i].name); - } - else { - printf("%s\n", ba_str); - } - } - - return 0; -} diff --git a/l2ork_addons/cwiid/man/.svn/all-wcprops b/l2ork_addons/cwiid/man/.svn/all-wcprops deleted file mode 100644 index 842a8e7bdae37da0a8818cc3c410e22e71344c7c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/.svn/all-wcprops +++ /dev/null @@ -1,11 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 33 -/cwiid/svn/!svn/ver/151/trunk/man -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/125/trunk/man/Makefile.in -END diff --git a/l2ork_addons/cwiid/man/.svn/entries b/l2ork_addons/cwiid/man/.svn/entries deleted file mode 100644 index 256a090de7142b4dd80c4826b9fa65d561921825..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/.svn/entries +++ /dev/null @@ -1,65 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/man -http://abstrakraft.org/cwiid/svn - - - -2007-08-27T01:43:12.116446Z -151 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:41.000000Z -b480f7a1313478fd28fd05b468b174a5 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -351 - -man1 -dir - diff --git a/l2ork_addons/cwiid/man/.svn/format b/l2ork_addons/cwiid/man/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/man/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/man/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 2677999479acfb9e11e8a78781f639948b897a7c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,22 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -DEST_MAN_DIR = $(ROOTDIR)$(mandir) - -all: - -install: - for f in `ls man?/*.?`; do \ - install -D -m 644 $$f $(DEST_MAN_DIR)/$$f ; \ - done - -uninstall: - for f in `ls man?/*.?`; do \ - rm -f $(DEST_MAN_DIR)/$$f ; \ - done - -distclean: - rm Makefile - -.PHONY: all install uninstall distclean diff --git a/l2ork_addons/cwiid/man/man1/.svn/all-wcprops b/l2ork_addons/cwiid/man/man1/.svn/all-wcprops deleted file mode 100644 index ec24341c962c4afea001d8f4708126f7ef2d46ce..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/man1/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 38 -/cwiid/svn/!svn/ver/151/trunk/man/man1 -END -wminput.1 -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/151/trunk/man/man1/wminput.1 -END -wmgui.1 -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/55/trunk/man/man1/wmgui.1 -END diff --git a/l2ork_addons/cwiid/man/man1/.svn/entries b/l2ork_addons/cwiid/man/man1/.svn/entries deleted file mode 100644 index 05bf222c79e4526f1b3f602b0152ed204f95cd7c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/man1/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/man/man1 -http://abstrakraft.org/cwiid/svn - - - -2007-08-27T01:43:12.116446Z -151 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -wminput.1 -file - - - - -2009-10-18T02:00:41.000000Z -efc3dc4db241a7385a25f7414dc6663a -2007-08-27T01:43:12.116446Z -151 -dsmith - - - - - - - - - - - - - - - - - - - - - -4220 - -wmgui.1 -file - - - - -2009-10-18T02:00:41.000000Z -bcc6c0c552aaacfab6d4edc0800b5c03 -2007-04-02T03:18:54.731288Z -55 -dsmith - - - - - - - - - - - - - - - - - - - - - -1665 - diff --git a/l2ork_addons/cwiid/man/man1/.svn/format b/l2ork_addons/cwiid/man/man1/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/man1/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/man/man1/.svn/text-base/wmgui.1.svn-base b/l2ork_addons/cwiid/man/man1/.svn/text-base/wmgui.1.svn-base deleted file mode 100644 index 53676ceabd8deecc938acc8de30774b82d15a43d..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/man1/.svn/text-base/wmgui.1.svn-base +++ /dev/null @@ -1,47 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH WMGUI 1 "janvier 18, 2007" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp <n> insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -wmgui \- GTK gui to the wiimote -.SH SYNOPSIS -.B wmgui -.RI [ options ] -.br -.SH DESCRIPTION -This manual page documents briefly the -.B wmgui -command. -.PP -.\" TeX users may be more comfortable with the \fB<whatever>\fP and -.\" \fI<whatever>\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBwmgui\fP is a program that provides a simple GTK gui to the wiimote. -.SH OPTIONS -.TP -.B \-h -Show summary of options. -.TP -.B bdaddr -Specify the wiimote bluetooth address. The bluetooth device address (bdaddr) of the wiimote can be specified on the command-line, or through the WIIMOTE_BDADDR environment variable, in the that order of precedence. If neither is given, the first wiimote found by hci_inquiry will be used. -.SH SEE ALSO -.BR wminput (1), -.br -.SH AUTHOR -wmgui was written by L. Donnie Smith <cwiid@abstrakraft.org> -.PP -This manual page was written by Romain Beauxis <toots@rastageeks.org>, -for the Debian project (but may be used by others). diff --git a/l2ork_addons/cwiid/man/man1/.svn/text-base/wminput.1.svn-base b/l2ork_addons/cwiid/man/man1/.svn/text-base/wminput.1.svn-base deleted file mode 100644 index e94331815e9739bf008cd77ad121b47e3054b372..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/man/man1/.svn/text-base/wminput.1.svn-base +++ /dev/null @@ -1,92 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH WMINPUT 1 "janvier 18, 2007" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp <n> insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -wminput \- an event driver for the wiimote -.SH SYNOPSIS -.B wminput -.RI [ options ] -.br -.SH DESCRIPTION -This manual page documents briefly the -.B wminput -command. -.PP -.\" TeX users may be more comfortable with the \fB<whatever>\fP and -.\" \fI<whatever>\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBwminput\fP is a program that provides an event driver for the wiimote, supporting all buttons (except Power) and pointer tracking, and featuring a tracking algorithm plugin architecture. -.PP -Your kernel must be configured with uinput support (INPUT_UINPUT, or Device Drivers/Input Device Support/Miscellaneous Drivers/User Level Driver Support under menuconfig). Compile into the kernel or as a module. See http://gentoo-wiki.com/HOWTO_Compile_a_Kernel_Manually for information on kernel compilation. -By default, some (most? all?) udev configurations set up a uinput device file readable only by root. Using wminput as a user other than root requires configuration udev to change the permissions on uinput. Place the following line in a file in /etc/udev/rules.d (see the documentation for your distro for the recommended file for local rules) to allow anyone on the system to use uinput: -.PP -KERNEL=="uinput", MODE="0666" -.PP -A more secure method uses the following line to allow anyone in <group> to use wminput, and adds only the desired users to <group>: -.PP -KERNEL=="uinput", GROUP="<group>" -.PP -A uinput group can be created specifically for this purpose, or another existing group such as wheel can be used. -.PP -See usr/share/doc/wminput/wminput.conf.sample for an example wminput configuration file. Copy this file to ~/.CWiid/wminput.conf and change as desired. -.PP -Getting X to recognize non-standard key symbols, and mapping actions to those symbols, is not automatic. An excellent tutorial at http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys can help you set this up. An overview of the process (see the HOWTO for more information): -.br -1.Edit ~/.CWiid/wminput.conf -.br -2.Use xev, wminput, and your wiimote to find out if the key symbols are already mapped, and find the key codes if they are not. -.br -3.If the codes are not mapped to the appropriate symbols, edit ~/.Xmodmap, and use xmodmap to map them. (A copy of my ~/.Xmodmap is included in CWiid/doc) -.br -4.Use xbindkeys or a window manager-specific utility to map the key symbols to specific actions. -.PP -wminput tracking plugins are, by default, installed to /usr/lib/CWiid/plugins. Plugins may also be placed in ~/.CWiid/plugins, and plugins placed here will take precedence. - -.SH OPTIONS -.TP -.B \-h -Show summary of options. -.TP -.B \-v, --version -Output version information and exit. -.TP -.B \-c, --config [file] -Choose config file to use. -.TP -.B \-d, --daemon -Implies -q, -r, and -w. -.TP -.B \-q, --quiet -Reduce output to errors -.TP -.B \-r, --reconnect [wait] -Automatically try reconnect after wiimote disconnect. -.TP -.B \-w, --wait -Wait indefinitely for wiimote to connect. -.TP -.B bdaddr -Specify the wiimote bluetooth address. The bluetooth device address (bdaddr) of the wiimote can be specified on the command-line, or through the WIIMOTE_BDADDR environment variable, in the that order of precedence. If neither is given, the first wiimote found by hci_inquiry will be used. - -.SH SEE ALSO -.BR wmgui (1), -.br -.SH AUTHOR -wminput was written by L. Donnie Smith <cwiid@abstrakraft.org> -.PP -This manual page was written by Romain Beauxis <toots@rastageeks.org>, -for the Debian project (but may be used by others). diff --git a/l2ork_addons/cwiid/python/.svn/all-wcprops b/l2ork_addons/cwiid/python/.svn/all-wcprops deleted file mode 100644 index 907c46c5058b0d25b963976b0b9378b31cedfa3f..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/all-wcprops +++ /dev/null @@ -1,29 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 36 -/cwiid/svn/!svn/ver/199/trunk/python -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/147/trunk/python/Makefile.in -END -cwiidmodule.c -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/199/trunk/python/cwiidmodule.c -END -setup.py -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/125/trunk/python/setup.py -END -Wiimote.c -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/199/trunk/python/Wiimote.c -END diff --git a/l2ork_addons/cwiid/python/.svn/entries b/l2ork_addons/cwiid/python/.svn/entries deleted file mode 100644 index 21ab6882b7f2270efa8d607d1d0e6d11780a7d13..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/entries +++ /dev/null @@ -1,164 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/python -http://abstrakraft.org/cwiid/svn - - - -2009-07-03T19:11:23.657888Z -199 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:36.000000Z -eb5472e39030449486ff6fa505cb5014 -2007-08-24T00:21:13.225681Z -147 -dsmith - - - - - - - - - - - - - - - - - - - - - -538 - -cwiidmodule.c -file - - - - -2009-10-18T02:00:36.000000Z -77dd41eec9d6797387135db05c4df8cd -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -6424 - -setup.py -file - - - - -2009-10-18T02:00:36.000000Z -ea5ace0c75e84f029d94fcbbcb06783c -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -153 - -Wiimote.c -file - - - - -2009-10-18T02:00:36.000000Z -77d0c23c249e88b9ce75e4bc478d7ac5 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -29666 - diff --git a/l2ork_addons/cwiid/python/.svn/format b/l2ork_addons/cwiid/python/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/python/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/python/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 0d7efdf3c003c29042ae4066772cbc8ee2e6dc4c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,24 +0,0 @@ -#Copyright (C) 2007 Justin M. Tulloss - -include @top_builddir@/defs.mak - -ifdef ROOTDIR - SET_ROOT_DIR = "--root=$(ROOTDIR)" -endif - -all: - $(PYTHON) setup.py build_ext $(DEBUGFLAGS) -I@top_builddir@/libcwiid -L@top_builddir@/libcwiid -lcwiid - -install: - $(PYTHON) setup.py install --install-lib=${libdir}/python@PYTHON_VERSION@/site-packages $(SET_ROOT_DIR) - -uninstall: - rm -f $(ROOTDIR)${libdir}/python@PYTHON_VERSION@/site-packages/cwiid.so - -clean: - rm -rf build - -distclean: clean - rm Makefile - -.PHONY: all install uninstall clean distclean diff --git a/l2ork_addons/cwiid/python/.svn/text-base/Wiimote.c.svn-base b/l2ork_addons/cwiid/python/.svn/text-base/Wiimote.c.svn-base deleted file mode 100644 index a9ed71756edbe58a42e2d803f4b25ea689ce32be..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/text-base/Wiimote.c.svn-base +++ /dev/null @@ -1,1069 +0,0 @@ -/* - * Copyright (C) 2007 Justin M. Tulloss <jmtulloss@gmail.com> - * - * Interface from Python to libcwiid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2008-01-19 L. Donnie Smith <cwiid@abstrakraft.org> - * * print callback error tracebacks - * - * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> - * * revised error messages and doc strings - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * removed Wiimote_FromC function - * * added bdaddr argument to Wiimote.init - * * overloaded Wiimote.init to accept CObject (existing wiimote), - * and logic to avoid closing it on dealloc - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * added Wiimote_FromC - * * added get_acc_cal - * - * 2007-05-27 Arthur Peters <amp@singingwizard.org> - * * removed set_mesg_callback from methods table - * - * 2007-05-22 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed disconnect to close - * * replaced command with attributes for rpt_mode, rumble, led, - * added request_status method - * * fixed memory leak in get_mesg - * * added function names to argument parsing errors - * * changed to processMesg to ConvertMesgArray with global visibility - * - * 2007-05-15 L. Donnie Smith <cwiid@abstrakraft.org> - * * revised message types - * * revised argument/keylist parsing - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * moved Wiimote class to separate file - */ - -#include "Python.h" -#include "structmember.h" -#include <errno.h> -#include <bluetooth/bluetooth.h> -#include "cwiid.h" - -#if (PY_VERSION_HEX < 0x02050000) - #ifndef PY_SSIZE_T_MIN - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #endif -#endif - -typedef struct { - PyObject_HEAD - cwiid_wiimote_t *wiimote; - PyObject *callback; - char close_on_dealloc; -} Wiimote; - -/* method prototypes */ -static PyObject * - Wiimote_new(PyTypeObject *type, PyObject *args, PyObject *kwds); -static void Wiimote_dealloc(Wiimote *self); -static int Wiimote_init(Wiimote *self, PyObject *args, PyObject *kwds); -static PyObject *Wiimote_close(Wiimote *self); - -static PyObject *Wiimote_enable(Wiimote *self, PyObject *args, PyObject *kwds); -static PyObject * - Wiimote_disable(Wiimote *self, PyObject *args, PyObject *kwds); - -static int - Wiimote_set_mesg_callback(Wiimote *self, PyObject *args, void *closure); -static PyObject *Wiimote_get_mesg(Wiimote *self); -static PyObject *Wiimote_get_state(Wiimote *self, void *closure); -static PyObject *Wiimote_get_acc_cal(Wiimote *self, PyObject *args, - PyObject *kwds); -static PyObject *Wiimote_get_balance_cal(Wiimote *self); - -static PyObject *Wiimote_request_status(Wiimote *self); -static int Wiimote_set_led(Wiimote *self, PyObject *PyLed, void *closure); -static int - Wiimote_set_rumble(Wiimote *self, PyObject *PyRumble, void *closure); -static int - Wiimote_set_rpt_mode(Wiimote *self, PyObject *PyRptMode, void *closure); - -static PyObject *Wiimote_send_rpt(Wiimote *self, PyObject *args, PyObject *kwds); -static PyObject *Wiimote_read(Wiimote *self, PyObject *args, PyObject *kwds); -static PyObject *Wiimote_write(Wiimote *self, PyObject *args, PyObject *kwds); - -/* helper prototypes */ -static cwiid_mesg_callback_t CallbackBridge; -PyObject *ConvertMesgArray(int mesg_count, union cwiid_mesg mesg[]); - -static PyMethodDef Wiimote_Methods[] = -{ - {"close", (PyCFunction)Wiimote_close, METH_NOARGS, - "close()\n\nClose the Wiimote connection"}, - {"enable", (PyCFunction)Wiimote_enable, METH_VARARGS | METH_KEYWORDS, - "enable(flags)\n\nenable Wiimote connection flags"}, - {"disable", (PyCFunction)Wiimote_disable, METH_VARARGS | METH_KEYWORDS, - "disable(flags)\n\ndisable Wiimote connection flags"}, - {"get_mesg", (PyCFunction)Wiimote_get_mesg, METH_NOARGS, - "get_mesg() -> message list\n\nretrieve message list from queue"}, - {"get_acc_cal", (PyCFunction)Wiimote_get_acc_cal, - METH_VARARGS | METH_KEYWORDS, - "get_acc_cal(extension) -> calibration tuple\n\n" - "retrieve accelerometer calibration information"}, - {"get_balance_cal", (PyCFunction)Wiimote_get_balance_cal, METH_NOARGS, - "get_balance_cal() -> calibration tuple\n\n" - "retrieve Balance Board calibration information"}, - {"request_status", (PyCFunction)Wiimote_request_status, METH_NOARGS, - "request_status()\n\nrequest status message"}, - {"read", (PyCFunction)Wiimote_read, METH_VARARGS | METH_KEYWORDS, - "read(flags,offset,len) -> buffer\n\nread data from Wiimote"}, - {"send_rpt", (PyCFunction)Wiimote_send_rpt, METH_VARARGS | METH_KEYWORDS, - "send_rpt(flags,report,buffer)\n\nsend a report to Wiimote"}, - {"write", (PyCFunction)Wiimote_write, METH_VARARGS | METH_KEYWORDS, - "write(flags,offset,buffer)\n\nwrite data to Wiimote"}, - {NULL, NULL, 0, NULL} -}; - -static PyGetSetDef Wiimote_GetSet[] = { - {"state", (getter)Wiimote_get_state, NULL, "Wiimote state", NULL}, - {"mesg_callback", NULL, (setter)Wiimote_set_mesg_callback, - "Wiimote message callback", NULL}, - {"led", NULL, (setter)Wiimote_set_led, "Wiimote led state", NULL}, - {"rumble", NULL, (setter)Wiimote_set_rumble, "Wiimote rumble state", NULL}, - {"rpt_mode", NULL, (setter)Wiimote_set_rpt_mode, "Wiimote report mode", - NULL}, - {NULL, NULL, NULL, NULL, NULL} -}; - -PyTypeObject Wiimote_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - "cwiid.Wiimote", /* tp_name */ - sizeof(Wiimote), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)Wiimote_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_compare */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "CWiid Wiimote connection object", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - Wiimote_Methods, /* tp_methods */ - 0, /* tp_members */ - Wiimote_GetSet, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)Wiimote_init, /* tp_init */ - 0, /* tp_alloc */ - Wiimote_new, /* tp_new */ -}; - -/* Allocate and deallocate functions */ -static PyObject * - Wiimote_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -{ - Wiimote* self; - - if (!(self = (Wiimote *) type->tp_alloc(type, 0))) { - return NULL; - } - - self->wiimote = NULL; - Py_INCREF(self->callback = Py_None); - self->close_on_dealloc = 0; - - return (PyObject*) self; -} - -static void Wiimote_dealloc(Wiimote *self) -{ - if (self->close_on_dealloc && self->wiimote) { - cwiid_close(self->wiimote); - } - Py_XDECREF(self->callback); - self->ob_type->tp_free((PyObject *)self); -} - -static int Wiimote_init(Wiimote* self, PyObject* args, PyObject *kwds) -{ - static char *kwlist[] = {"bdaddr", "flags", NULL}; - PyObject *PyObj; - cwiid_wiimote_t *wiimote = NULL; - char *str_bdaddr = NULL; - bdaddr_t bdaddr; - int flags = 0; - - /* Overloaded function - if a single CObject is passed in, it's - * an existing CObject. Otherwise, create a new one */ - if (PyTuple_Size(args) == 1) { - PyObj = PyTuple_GET_ITEM(args, 0); - if (PyCObject_Check(PyObj)) { - wiimote = PyCObject_AsVoidPtr(PyObj); - self->close_on_dealloc = 0; - } - } - - if (!wiimote) { - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|si:cwiid.Wiimote.init", - kwlist, &str_bdaddr, &flags)) { - return -1; - } - - if (str_bdaddr) { - if (str2ba(str_bdaddr, &bdaddr)) { - PyErr_SetString(PyExc_ValueError, "bad bdaddr"); - return -1; - } - } - else { - bdaddr = *BDADDR_ANY; - } - - Py_BEGIN_ALLOW_THREADS - wiimote = cwiid_open(&bdaddr, flags); - Py_END_ALLOW_THREADS - if (!wiimote) { - PyErr_SetString(PyExc_RuntimeError, - "Error opening wiimote connection"); - return -1; - } - else { - self->close_on_dealloc = 1; - } - } - - cwiid_set_data(wiimote, self); - self->wiimote = wiimote; - return 0; -} - -#define SET_CLOSED_ERROR PyErr_SetString(PyExc_ValueError, "Wiimote is closed") - -static PyObject *Wiimote_close(Wiimote *self) -{ - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (cwiid_close(self->wiimote)) { - PyErr_SetString(PyExc_RuntimeError, - "Error closing wiimote connection"); - self->wiimote = NULL; - return NULL; - } - self->wiimote = NULL; - - Py_RETURN_NONE; -} - -static PyObject *Wiimote_enable(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = {"flags", NULL}; - int flags; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i:cwiid.Wiimote.enable", - kwlist, &flags)) { - return NULL; - } - - if (cwiid_enable(self->wiimote, flags)) { - PyErr_SetString(PyExc_RuntimeError, "Error enabling wiimote flags"); - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject *Wiimote_disable(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = {"flags", NULL}; - int flags; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "i:cwiid.Wiimote.disable", - kwlist, &flags)) { - return NULL; - } - - if (cwiid_disable(self->wiimote, flags)) { - PyErr_SetString(PyExc_RuntimeError, "Error disabling wiimote flags"); - return NULL; - } - - Py_RETURN_NONE; -} - -static int - Wiimote_set_mesg_callback(Wiimote *self, PyObject *NewCallback, - void *closure) -{ - PyObject *OldCallback; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return -1; - } - - if (!PyCallable_Check(NewCallback)) { - PyErr_SetString(PyExc_TypeError, "callback must be callable!"); - } - OldCallback = self->callback; - - if ((OldCallback == Py_None) && (NewCallback != Py_None)) { - if (cwiid_set_mesg_callback(self->wiimote, CallbackBridge)) { - PyErr_SetString(PyExc_AttributeError, - "Error setting wiimote callback"); - return -1; - } - } - else if ((OldCallback != Py_None) && (NewCallback == Py_None)) { - if (cwiid_set_mesg_callback(self->wiimote, NULL)) { - PyErr_SetString(PyExc_AttributeError, - "Error clearing wiimote callback"); - return -1; - } - } - - Py_INCREF(NewCallback); - Py_DECREF(OldCallback); - self->callback = NewCallback; - - return 0; -} - -static PyObject *Wiimote_get_mesg(Wiimote *self) -{ - union cwiid_mesg *mesg; - int mesg_count; - struct timespec t; - PyObject *PyMesg; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (cwiid_get_mesg(self->wiimote, &mesg_count, &mesg, &t)) { - if (errno == EAGAIN) { - Py_RETURN_NONE; - } - else { - PyErr_SetString(PyExc_RuntimeError, - "Error getting wiimote message list"); - return NULL; - } - } - - PyMesg = ConvertMesgArray(mesg_count, mesg); - - free(mesg); - - return PyMesg; -} - -static PyObject *Wiimote_get_state(Wiimote* self, void *closure) -{ - struct cwiid_state state; - PyObject *PyState; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (cwiid_get_state(self->wiimote, &state)) { - PyErr_SetString(PyExc_IOError, "get state error"); - return NULL; - } - - PyState = Py_BuildValue("{s:B,s:B,s:B,s:B,s:i,s:i}", - "rpt_mode", state.rpt_mode, - "led", state.led, - "rumble", state.rumble, - "battery", state.battery, - "ext_type", state.ext_type, - "error", state.error); - - if (state.rpt_mode & CWIID_RPT_BTN) { - PyObject *PyBtn = Py_BuildValue("I", state.buttons); - if (!PyBtn) { - Py_DECREF(PyState); - return NULL; - } - if (PyDict_SetItemString(PyState, "buttons", PyBtn)) { - Py_DECREF(PyState); - Py_DECREF(PyBtn); - return NULL; - } - Py_DECREF(PyBtn); - } - - if (state.rpt_mode & CWIID_RPT_ACC) { - PyObject *PyAcc = Py_BuildValue("(B,B,B)", - state.acc[CWIID_X], - state.acc[CWIID_Y], - state.acc[CWIID_Z]); - if (!PyAcc) { - Py_DECREF(PyState); - return NULL; - } - if (PyDict_SetItemString(PyState, "acc", PyAcc)) { - Py_DECREF(PyState); - Py_DECREF(PyAcc); - return NULL; - } - Py_DECREF(PyAcc); - } - - if (state.rpt_mode & CWIID_RPT_IR) { - int i; - PyObject *PyIr = PyList_New(CWIID_IR_SRC_COUNT); - - if (!PyIr) { - Py_DECREF(PyState); - return NULL; - } - - if (PyDict_SetItemString(PyState, "ir_src", PyIr)) { - Py_DECREF(PyState); - Py_DECREF(PyIr); - return NULL; - } - - Py_DECREF(PyIr); - - for (i=0; i < CWIID_IR_SRC_COUNT; i++) { - PyObject *PyIrSrc; - PyObject *PySize; - - if (state.ir_src[i].valid) { - PyIrSrc = Py_BuildValue("{s:(I,I)}", - "pos", - state.ir_src[i].pos[CWIID_X], - state.ir_src[i].pos[CWIID_Y]); - if (!PyIrSrc) { - Py_DECREF(PyState); - return NULL; - } - - if (state.ir_src[i].size != -1) { - if (!(PySize = PyInt_FromLong( - (long)state.ir_src[i].size))) { - Py_DECREF(PyState); - Py_DECREF(PyIrSrc); - return NULL; - } - if (PyDict_SetItemString(PyIrSrc, "size", PySize)) { - Py_DECREF(PyState); - Py_DECREF(PyIrSrc); - Py_DECREF(PySize); - return NULL; - } - - Py_DECREF(PySize); - } - } - else { - Py_INCREF(PyIrSrc = Py_None); - } - - PyList_SET_ITEM(PyIr, i, PyIrSrc); - } - } - - switch (state.ext_type) { - PyObject *PyExt; - case CWIID_EXT_NUNCHUK: - if (state.rpt_mode & CWIID_RPT_NUNCHUK) { - PyExt = Py_BuildValue("{s:(B,B),s:(B,B,B),s:I}", - "stick", - state.ext.nunchuk.stick[CWIID_X], - state.ext.nunchuk.stick[CWIID_Y], - "acc", - state.ext.nunchuk.acc[CWIID_X], - state.ext.nunchuk.acc[CWIID_Y], - state.ext.nunchuk.acc[CWIID_Z], - "buttons", state.ext.nunchuk.buttons); - - if (!PyExt) { - Py_DECREF(PyState); - return NULL; - } - - if (PyDict_SetItemString(PyState, "nunchuk", PyExt)) { - Py_DECREF(PyState); - Py_DECREF(PyExt); - return NULL; - } - - Py_DECREF(PyExt); - } - break; - case CWIID_EXT_CLASSIC: - if (state.rpt_mode & CWIID_RPT_CLASSIC) { - PyExt = Py_BuildValue("{s:(B,B),s:(B,B),s:B,s:B,s:I}", - "l_stick", - state.ext.classic.l_stick[CWIID_X], - state.ext.classic.l_stick[CWIID_Y], - "r_stick", - state.ext.classic.r_stick[CWIID_X], - state.ext.classic.r_stick[CWIID_Y], - "l", state.ext.classic.l, - "r", state.ext.classic.r, - "buttons", state.ext.classic.buttons); - - if (!PyExt) { - Py_DECREF(PyState); - return NULL; - } - - if (PyDict_SetItemString(PyState, "classic", PyExt)) { - Py_DECREF(PyState); - Py_DECREF(PyExt); - return NULL; - } - - Py_DECREF(PyExt); - } - break; - case CWIID_EXT_BALANCE: - if (state.rpt_mode & CWIID_RPT_BALANCE) { - PyExt = Py_BuildValue("{s:I,s:I,s:I,s:I}", - "right_top", - state.ext.balance.right_top, - "right_bottom", - state.ext.balance.right_bottom, - "left_top", - state.ext.balance.left_top, - "left_bottom", - state.ext.balance.left_bottom); - - if (!PyExt) { - Py_DECREF(PyState); - return NULL; - } - - if (PyDict_SetItemString(PyState, "balance", PyExt)) { - Py_DECREF(PyState); - Py_DECREF(PyExt); - return NULL; - } - - Py_DECREF(PyExt); - } - break; - case CWIID_EXT_MOTIONPLUS: - if (state.rpt_mode & CWIID_RPT_MOTIONPLUS) { - PyExt = Py_BuildValue("{s:(I,I,I)}", - "angle_rate", - state.ext.motionplus.angle_rate[CWIID_PHI], - state.ext.motionplus.angle_rate[CWIID_THETA], - state.ext.motionplus.angle_rate[CWIID_PSI]); - - if (!PyExt) { - Py_DECREF(PyState); - return NULL; - } - - if (PyDict_SetItemString(PyState, "motionplus", PyExt)) { - Py_DECREF(PyState); - Py_DECREF(PyExt); - return NULL; - } - - Py_DECREF(PyExt); - } - break; - default: - break; - } - - return PyState; -} - -static PyObject *Wiimote_get_acc_cal(Wiimote *self, PyObject *args, - PyObject *kwds) -{ - static char *kwlist[] = { "ext_type", NULL }; - int ext_type; - struct acc_cal acc_cal; - PyObject *PyAccCal; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, - "i:cwiid.Wiimote.get_acc_cal", kwlist, - &ext_type)) { - return NULL; - } - - if (cwiid_get_acc_cal(self->wiimote, ext_type, &acc_cal)) { - PyErr_SetString(PyExc_RuntimeError, - "Error getting wiimote acc calibration"); - return NULL; - } - - if (!(PyAccCal = Py_BuildValue("([i,i,i],[i,i,i])", acc_cal.zero[0], - acc_cal.zero[1], acc_cal.zero[2], - acc_cal.one[0], acc_cal.one[1], - acc_cal.one[2]))) { - return NULL; - } - - return PyAccCal; -} - -static PyObject *Wiimote_get_balance_cal(Wiimote *self) -{ - struct balance_cal balance_cal; - PyObject *PyBalCal; - - if (cwiid_get_balance_cal(self->wiimote, &balance_cal)) { - PyErr_SetString(PyExc_RuntimeError, - "Error getting balance board calibration"); - return NULL; - } - - if (!(PyBalCal = Py_BuildValue("([i,i,i],[i,i,i],[i,i,i],[i,i,i])", - balance_cal.right_top[0], - balance_cal.right_top[1], - balance_cal.right_top[2], - balance_cal.right_bottom[0], - balance_cal.right_bottom[1], - balance_cal.right_bottom[2], - balance_cal.left_top[0], - balance_cal.left_top[1], - balance_cal.left_top[2], - balance_cal.left_bottom[0], - balance_cal.left_bottom[1], - balance_cal.left_bottom[2]))) { - return NULL; - } - - return PyBalCal; -} - -static PyObject *Wiimote_request_status(Wiimote *self) -{ - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (cwiid_request_status(self->wiimote)) { - PyErr_SetString(PyExc_RuntimeError, "Error requesting wiimote status"); - return NULL; - } - - Py_RETURN_NONE; -} - -static int Wiimote_set_led(Wiimote *self, PyObject *PyLed, void *closure) -{ - long led; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return -1; - } - - if (((led = PyInt_AsLong(PyLed)) == -1) && PyErr_Occurred()) { - return -1; - } - - if (cwiid_set_led(self->wiimote, (uint8_t)led)) { - PyErr_SetString(PyExc_AttributeError, - "Error setting wiimote led state"); - return -1; - } - - return 0; -} - -static int - Wiimote_set_rumble(Wiimote *self, PyObject *PyRumble, void *closure) -{ - long rumble; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return -1; - } - - if (((rumble = PyInt_AsLong(PyRumble)) == -1) && PyErr_Occurred()) { - return -1; - } - - if (cwiid_set_rumble(self->wiimote, (uint8_t)rumble)) { - PyErr_SetString(PyExc_AttributeError, - "Error setting wiimote rumble state"); - return -1; - } - - return 0; -} - -static int - Wiimote_set_rpt_mode(Wiimote *self, PyObject *PyRptMode, void *closure) -{ - long rpt_mode; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return -1; - } - - if (((rpt_mode = PyInt_AsLong(PyRptMode)) == -1) && PyErr_Occurred()) { - return -1; - } - - if (cwiid_set_rpt_mode(self->wiimote, (uint8_t)rpt_mode)) { - PyErr_SetString(PyExc_AttributeError, - "Error setting wiimote report mode"); - return -1; - } - - return 0; -} - -/* static PyObject *Wiimote_command(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = { "command", "flags", NULL }; - int command, flags; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwlist, &command, - &flags)) { - return NULL; - } - - cwiid_command(self->wiimote, (enum cwiid_command)command, (uint8_t)flags); - - Py_RETURN_NONE; -} -*/ - -static PyObject *Wiimote_send_rpt(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = { "flags", "report", "buffer", NULL }; - unsigned char flags, report; - void *buf; - int len; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "BBt#:cwiid.Wiimote.send_rpt", - kwlist, &flags, &report, &buf, &len)) { - return NULL; - } - - if (cwiid_send_rpt(self->wiimote, flags, report, len, buf)) { - PyErr_SetString(PyExc_RuntimeError, "Error sending report"); - return NULL; - } - - Py_RETURN_NONE; -} - -static PyObject *Wiimote_read(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = { "flags", "offset", "len", NULL }; - unsigned char flags; - unsigned int offset; - Py_ssize_t len; - void *buf; - PyObject *pyRetBuf; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "BII:cwiid.Wiimote.read", - kwlist, &flags, &offset, &len)) { - return NULL; - } - - if (!(pyRetBuf = PyBuffer_New(len))) { - return NULL; - } - if (PyObject_AsWriteBuffer(pyRetBuf, &buf, &len)) { - Py_DECREF(pyRetBuf); - return NULL; - } - if (cwiid_read(self->wiimote,flags,offset,len,buf)) { - PyErr_SetString(PyExc_RuntimeError, "Error reading wiimote data"); - Py_DECREF(pyRetBuf); - return NULL; - } - - return pyRetBuf; -} - -static PyObject *Wiimote_write(Wiimote *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = { "flags", "offset", "buffer", NULL }; - unsigned char flags; - unsigned int offset; - void *buf; - int len; - - if (!self->wiimote) { - SET_CLOSED_ERROR; - return NULL; - } - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "BIt#:cwiid.Wiimote.write", - kwlist, &flags, &offset, &buf, &len)) { - return NULL; - } - - if (cwiid_write(self->wiimote, flags, offset, len, buf)) { - PyErr_SetString(PyExc_RuntimeError, "Error writing wiimote data"); - return NULL; - } - - Py_RETURN_NONE; -} - -static void CallbackBridge(cwiid_wiimote_t *wiimote, int mesg_count, - union cwiid_mesg mesg[], struct timespec *t) -{ - PyObject *ArgTuple; - PyObject *PySelf; - PyGILState_STATE gstate; - - gstate = PyGILState_Ensure(); - - ArgTuple = ConvertMesgArray(mesg_count, mesg); - - /* Put id and the list of messages as the arguments to the callback */ - PySelf = (PyObject *) cwiid_get_data(wiimote); - if (!PyObject_CallFunction(((Wiimote *)PySelf)->callback, "(O, d)", - ArgTuple, - t->tv_sec + ((double) t->tv_nsec) * 1e-9)) { - PyErr_Print(); - } - - Py_XDECREF(ArgTuple); - PyGILState_Release(gstate); -} - -/* This is the function responsible for marshaling the cwiid messages from - * C to python. It's rather complicated since it uses a complex C union - * to store the data and multiple enumerations to figure out what data is - * actually being sent. Neither of these common C types really translate - * well into Python. I've done my best to translate it to python as follows: - * - * Python callback takes arg (mesgs). The mesgs is a list of - * mesg tuples which contain the mesg type and a dict of the arguments. - * - * Ex: - * mesgs =>[(cwiid.STATUS_MESG,{"battery":battery,"ext_type":ext_type}), - * (cwiid.BTN_MESG,buttons), - * (cwiid.ACC_MESG,(x,y,z)), - * (cwiid.IR_MESG,[{"pos":(x,y),"size":size}, ...]), - * (cwiid.NUNCHUK_MESG,{"stick":(x,y),"acc":(x,y,z), - * "buttons":buttons}, - * (cwiid.CLASSIC_MESG,{"l_stick":(x,y),"r_stick":(x,y),"l":l,"r":r, - * "buttons":buttons}, - * (cwiid.BALANCE_MESG,{"right_top":right_top, - * "right_bottom":right_bottom, - * "left_top":left_top, - * "left_bottom":left_bottom}, - * (cwiid.MOTIONPLUS_MESG,{"angle_rate":(psi,theta,phi)}, - * (cwiid.ERROR_MESG,error)] - */ -PyObject *ConvertMesgArray(int mesg_count, union cwiid_mesg mesg[]) -{ - PyObject *mesglist; /* List of message tuples */ - PyObject *amesg; /* A single message (type, [arguments]) */ - PyObject *mesgVal; /* Dictionary of arguments for a message */ - PyObject *PyIrList; - int i, j; - - if (!(mesglist = PyList_New(mesg_count))) { - return NULL; - } - - for (i = 0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_STATUS: - mesgVal = Py_BuildValue("{s:B,s:i}", - "battery", mesg[i].status_mesg.battery, - "ext_type", mesg[i].status_mesg.ext_type); - break; - case CWIID_MESG_BTN: - mesgVal = Py_BuildValue("I", mesg[i].btn_mesg.buttons); - break; - case CWIID_MESG_ACC: - mesgVal = Py_BuildValue("(B,B,B)", mesg[i].acc_mesg.acc[CWIID_X], - mesg[i].acc_mesg.acc[CWIID_Y], - mesg[i].acc_mesg.acc[CWIID_Z]); - break; - case CWIID_MESG_IR: - mesgVal = NULL; - - if (!(PyIrList = PyList_New(CWIID_IR_SRC_COUNT))) { - break; - } - - for (j=0; j < CWIID_IR_SRC_COUNT; j++) { - PyObject *PyIrSrc; - PyObject *PySize; - - if (mesg[i].ir_mesg.src[j].valid) { - PyIrSrc = Py_BuildValue("{s:(I,I)}", - "pos", - mesg[i].ir_mesg.src[j].pos[CWIID_X], - mesg[i].ir_mesg.src[j].pos[CWIID_Y]); - - if (!PyIrSrc) { - Py_DECREF(PyIrList); - PyIrList = NULL; - break; - } - - if (mesg[i].ir_mesg.src[j].size != -1) { - if (!(PySize = PyInt_FromLong( - (long)mesg[i].ir_mesg.src[j].size))) { - Py_DECREF(PyIrList); - Py_DECREF(PyIrSrc); - PyIrList = NULL; - break; - } - if (PyDict_SetItemString(PyIrSrc, "size", PySize)) { - Py_DECREF(PyIrList); - Py_DECREF(PyIrSrc); - Py_DECREF(PySize); - PyIrList = NULL; - break; - } - - Py_DECREF(PySize); - } - } - else { - Py_INCREF(PyIrSrc = Py_None); - } - PyList_SET_ITEM(PyIrList, j, PyIrSrc); - } - - if (!PyIrList) { - break; - } - - mesgVal = PyIrList; - break; - case CWIID_MESG_NUNCHUK: - mesgVal = Py_BuildValue("{s:(B,B),s:(B,B,B),s:I}", - "stick", - mesg[i].nunchuk_mesg.stick[CWIID_X], - mesg[i].nunchuk_mesg.stick[CWIID_Y], - "acc", - mesg[i].nunchuk_mesg.acc[CWIID_X], - mesg[i].nunchuk_mesg.acc[CWIID_Y], - mesg[i].nunchuk_mesg.acc[CWIID_Z], - "buttons", mesg[i].nunchuk_mesg.buttons); - break; - case CWIID_MESG_CLASSIC: - mesgVal = Py_BuildValue("{s:(B,B),s:(B,B),s:B,s:B,s:I}", - "l_stick", - mesg[i].classic_mesg.l_stick[CWIID_X], - mesg[i].classic_mesg.l_stick[CWIID_Y], - "r_stick", - mesg[i].classic_mesg.r_stick[CWIID_X], - mesg[i].classic_mesg.r_stick[CWIID_Y], - "l", mesg[i].classic_mesg.l, - "r", mesg[i].classic_mesg.r, - "buttons", mesg[i].classic_mesg.buttons); - break; - case CWIID_MESG_BALANCE: - mesgVal = Py_BuildValue("{s:I,s:I,s:I,s:I}", - "right_top", - mesg[i].balance_mesg.right_top, - "right_bottom", - mesg[i].balance_mesg.right_bottom, - "left_top", - mesg[i].balance_mesg.left_top, - "left_bottom", - mesg[i].balance_mesg.left_bottom); - break; - case CWIID_MESG_MOTIONPLUS: - mesgVal = Py_BuildValue("{s:(I,I,I)}", - "angle_rate", - mesg[i].motionplus_mesg.angle_rate[CWIID_PHI], - mesg[i].motionplus_mesg.angle_rate[CWIID_THETA], - mesg[i].motionplus_mesg.angle_rate[CWIID_PSI]); - break; - case CWIID_MESG_ERROR: - mesgVal = Py_BuildValue("i", mesg[i].error_mesg.error); - break; - default: - Py_INCREF(mesgVal = Py_None); - break; - } - - if (!mesgVal) { - return NULL; - } - - /* Finally Put the type next to the message in a tuple and - * append them to the list of messages */ - if (!(amesg = Py_BuildValue("(iO)", mesg[i].type, mesgVal))) { - Py_DECREF(mesgVal); - return NULL; - } - Py_DECREF(mesgVal); - PyList_SET_ITEM(mesglist, i, amesg); - } - - return mesglist; -} diff --git a/l2ork_addons/cwiid/python/.svn/text-base/cwiidmodule.c.svn-base b/l2ork_addons/cwiid/python/.svn/text-base/cwiidmodule.c.svn-base deleted file mode 100644 index 0ac9447955a2a1487a66e3b8696950d6c2607f24..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/text-base/cwiidmodule.c.svn-base +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (C) 2007 Justin M. Tulloss <jmtulloss@gmail.com> - * - * Interface from Python to libcwiid - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * removed Wiimote_FromC function - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * added CObjects for Wiimote_FromC and ConvertMesgArray - * - * 2007-05-22 L. Donnie Smith <cwiid@abstrakraft.org> - * * clarified variable names - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * moved Wiimote class to separate files - * - * 2007-05-12 L. Donnie Smith <cwiid@abstrakraft.org> - * * added keywords to read - * * finished get_mesg - * * cleaned up types in get_state - * * finished processMesgs - * - * 2007-05-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * finished get_state - * * fixed read buffer issue - * * implemented write - * * cleaned up types - * * removed notImplemented (no longer needed) - * - * 2007-05-07 L. Donnie Smith <cwiid@abstrakraft.org> - * * C-style comments - * * changed struct name to Wiimote - * * removed dlopen, unused includes - * * spaces to tabs, misc stylistic changes to match CWiid code - * * changed self types to Wiimote - * * made bdaddr local - * * improved error checking in Wiimote_init - * * implemented disconnect, enable, disable - * * partially implemented get_state - * - * 2007-05-07 Justin M. Tulloss <jmtulloss@gmail.com> - * * Refactored according to dsmith's wishes, removed unnecessary locks - * * implemented read - * - * 2007-04-26 Justin M. Tulloss <jmtulloss@gmail.com> - * * Updated for new libcwiid API - * - * 2007-04-24 Justin M. Tulloss <jmtulloss@gmail.com> - * * Initial Changelog - */ - -#include "Python.h" - -#include <stdlib.h> - -#include "cwiid.h" -#include "structmember.h" - -/* externally defined types */ -extern PyTypeObject Wiimote_Type; -extern PyObject *ConvertMesgArray(int, union cwiid_mesg []); - -/* cwiid module initializer */ -PyMODINIT_FUNC initcwiid(void); - -/* constants, enumerations */ -#define CWIID_CONST_MACRO(a) {#a, CWIID_##a} -static struct { - char *name; - int value; -} cwiid_constants[] = { - CWIID_CONST_MACRO(FLAG_MESG_IFC), - CWIID_CONST_MACRO(FLAG_CONTINUOUS), - CWIID_CONST_MACRO(FLAG_REPEAT_BTN), - CWIID_CONST_MACRO(FLAG_NONBLOCK), - CWIID_CONST_MACRO(FLAG_MOTIONPLUS), - CWIID_CONST_MACRO(RPT_STATUS), - CWIID_CONST_MACRO(RPT_BTN), - CWIID_CONST_MACRO(RPT_ACC), - CWIID_CONST_MACRO(RPT_IR), - CWIID_CONST_MACRO(RPT_NUNCHUK), - CWIID_CONST_MACRO(RPT_CLASSIC), - CWIID_CONST_MACRO(RPT_BALANCE), - CWIID_CONST_MACRO(RPT_MOTIONPLUS), - CWIID_CONST_MACRO(RPT_EXT), - CWIID_CONST_MACRO(LED1_ON), - CWIID_CONST_MACRO(LED2_ON), - CWIID_CONST_MACRO(LED3_ON), - CWIID_CONST_MACRO(LED4_ON), - CWIID_CONST_MACRO(BTN_2), - CWIID_CONST_MACRO(BTN_1), - CWIID_CONST_MACRO(BTN_B), - CWIID_CONST_MACRO(BTN_A), - CWIID_CONST_MACRO(BTN_MINUS), - CWIID_CONST_MACRO(BTN_HOME), - CWIID_CONST_MACRO(BTN_LEFT), - CWIID_CONST_MACRO(BTN_RIGHT), - CWIID_CONST_MACRO(BTN_DOWN), - CWIID_CONST_MACRO(BTN_UP), - CWIID_CONST_MACRO(BTN_PLUS), - CWIID_CONST_MACRO(NUNCHUK_BTN_Z), - CWIID_CONST_MACRO(NUNCHUK_BTN_C), - CWIID_CONST_MACRO(CLASSIC_BTN_UP), - CWIID_CONST_MACRO(CLASSIC_BTN_LEFT), - CWIID_CONST_MACRO(CLASSIC_BTN_ZR), - CWIID_CONST_MACRO(CLASSIC_BTN_X), - CWIID_CONST_MACRO(CLASSIC_BTN_A), - CWIID_CONST_MACRO(CLASSIC_BTN_Y), - CWIID_CONST_MACRO(CLASSIC_BTN_B), - CWIID_CONST_MACRO(CLASSIC_BTN_ZL), - CWIID_CONST_MACRO(CLASSIC_BTN_R), - CWIID_CONST_MACRO(CLASSIC_BTN_PLUS), - CWIID_CONST_MACRO(CLASSIC_BTN_HOME), - CWIID_CONST_MACRO(CLASSIC_BTN_MINUS), - CWIID_CONST_MACRO(CLASSIC_BTN_L), - CWIID_CONST_MACRO(CLASSIC_BTN_DOWN), - CWIID_CONST_MACRO(CLASSIC_BTN_RIGHT), - CWIID_CONST_MACRO(SEND_RPT_NO_RUMBLE), - CWIID_CONST_MACRO(RW_EEPROM), - CWIID_CONST_MACRO(RW_REG), - CWIID_CONST_MACRO(RW_DECODE), - CWIID_CONST_MACRO(MAX_READ_LEN), - CWIID_CONST_MACRO(X), - CWIID_CONST_MACRO(Y), - CWIID_CONST_MACRO(Z), - CWIID_CONST_MACRO(PHI), - CWIID_CONST_MACRO(THETA), - CWIID_CONST_MACRO(PSI), - CWIID_CONST_MACRO(IR_SRC_COUNT), - CWIID_CONST_MACRO(IR_X_MAX), - CWIID_CONST_MACRO(IR_Y_MAX), - CWIID_CONST_MACRO(BATTERY_MAX), - CWIID_CONST_MACRO(CLASSIC_L_STICK_MAX), - CWIID_CONST_MACRO(CLASSIC_R_STICK_MAX), - CWIID_CONST_MACRO(CLASSIC_LR_MAX), - CWIID_CONST_MACRO(CMD_STATUS), - CWIID_CONST_MACRO(CMD_LED), - CWIID_CONST_MACRO(CMD_RUMBLE), - CWIID_CONST_MACRO(CMD_RPT_MODE), - CWIID_CONST_MACRO(MESG_STATUS), - CWIID_CONST_MACRO(MESG_BTN), - CWIID_CONST_MACRO(MESG_ACC), - CWIID_CONST_MACRO(MESG_IR), - CWIID_CONST_MACRO(MESG_NUNCHUK), - CWIID_CONST_MACRO(MESG_CLASSIC), - CWIID_CONST_MACRO(MESG_BALANCE), - CWIID_CONST_MACRO(MESG_MOTIONPLUS), - CWIID_CONST_MACRO(MESG_ERROR), - CWIID_CONST_MACRO(MESG_UNKNOWN), - CWIID_CONST_MACRO(EXT_NONE), - CWIID_CONST_MACRO(EXT_NUNCHUK), - CWIID_CONST_MACRO(EXT_CLASSIC), - CWIID_CONST_MACRO(EXT_BALANCE), - CWIID_CONST_MACRO(EXT_MOTIONPLUS), - CWIID_CONST_MACRO(EXT_UNKNOWN), - CWIID_CONST_MACRO(ERROR_DISCONNECT), - CWIID_CONST_MACRO(ERROR_COMM), - {NULL, 0} -}; - -/* Associates cwiid functions with python ones */ -static PyMethodDef Module_Methods[] = -{ - {NULL, NULL, 0, NULL} -}; - -PyMODINIT_FUNC initcwiid(void) -{ - PyObject *Module; - PyObject *CObj; - int i; - - PyEval_InitThreads(); - - if (PyType_Ready(&Wiimote_Type) < 0) { - return; - } - - if (!(Module = Py_InitModule3("cwiid", Module_Methods, - "CWiid Wiimote Interface"))) { - return; - } - - Py_INCREF(&Wiimote_Type); - PyModule_AddObject(Module, "Wiimote", (PyObject*)&Wiimote_Type); - - for (i = 0; cwiid_constants[i].name; i++) { - /* No way to report errors from here, so just ignore them and hope - * for segfault */ - PyModule_AddIntConstant(Module, cwiid_constants[i].name, - cwiid_constants[i].value); - } - - if (!(CObj = PyCObject_FromVoidPtr(ConvertMesgArray, NULL))) { - return; - } - PyModule_AddObject(Module, "ConvertMesgArray", CObj); -} - diff --git a/l2ork_addons/cwiid/python/.svn/text-base/setup.py.svn-base b/l2ork_addons/cwiid/python/.svn/text-base/setup.py.svn-base deleted file mode 100644 index 4916eb7b5a393a105a72a7aea08df90def3b234e..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/python/.svn/text-base/setup.py.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -from distutils.core import setup, Extension - -setup(name='cwiid', - version='0.6.00', - ext_modules=[Extension('cwiid', ['cwiidmodule.c', 'Wiimote.c'])] - ) diff --git a/l2ork_addons/cwiid/wmdemo/.svn/all-wcprops b/l2ork_addons/cwiid/wmdemo/.svn/all-wcprops deleted file mode 100644 index abab3189c477f4f11be0ad7cb7ac9187445d33be..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/all-wcprops +++ /dev/null @@ -1,23 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 36 -/cwiid/svn/!svn/ver/199/trunk/wmdemo -END -wmdemo.py -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/199/trunk/wmdemo/wmdemo.py -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 47 -/cwiid/svn/!svn/ver/83/trunk/wmdemo/Makefile.in -END -wmdemo.c -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/199/trunk/wmdemo/wmdemo.c -END diff --git a/l2ork_addons/cwiid/wmdemo/.svn/entries b/l2ork_addons/cwiid/wmdemo/.svn/entries deleted file mode 100644 index 6949385695d3af6b628ca13814b071578999dc0e..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wmdemo -http://abstrakraft.org/cwiid/svn - - - -2009-07-03T19:11:23.657888Z -199 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -wmdemo.py -file - - - - -2009-10-18T02:00:38.000000Z -bc998490b455ae2022c249fdcf29d31d -2009-07-03T19:11:23.657888Z -199 -dsmith -has-props - - - - - - - - - - - - - - - - - - - - -6220 - -Makefile.in -file - - - - -2009-10-18T02:00:38.000000Z -40331d5292e080b18a38f7bf6466d226 -2007-04-11T02:57:27.217197Z -83 -dsmith - - - - - - - - - - - - - - - - - - - - - -305 - -wmdemo.c -file - - - - -2009-10-18T02:00:38.000000Z -6a7a06e1cdb34484722fd68a57e8283e -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -12021 - diff --git a/l2ork_addons/cwiid/wmdemo/.svn/format b/l2ork_addons/cwiid/wmdemo/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wmdemo/.svn/prop-base/wmdemo.py.svn-base b/l2ork_addons/cwiid/wmdemo/.svn/prop-base/wmdemo.py.svn-base deleted file mode 100644 index 869ac71cf7e4d72d9ab52f86d630c1c3f0c017ce..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/prop-base/wmdemo.py.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 14 -svn:executable -V 1 -* -END diff --git a/l2ork_addons/cwiid/wmdemo/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wmdemo/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 56aed5831cc46fa45f16897d81a5aaf3c27dd469..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,19 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -APP_NAME = wmdemo - -SOURCES = wmdemo.c - -CFLAGS += -I@top_builddir@/libcwiid -LDFLAGS += -L@top_builddir@/libcwiid -LDLIBS += -lcwiid -INST_DIR = @bindir@ - -include $(COMMON)/include/app.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.c.svn-base b/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.c.svn-base deleted file mode 100644 index 70a25a118deb7902d8d58d5c448272d1050afbfd..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.c.svn-base +++ /dev/null @@ -1,410 +0,0 @@ -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> - -#include <cwiid.h> - -/* This is a sample program written to demonstrate basic CWiid libwiimote - * usage, until _actual_ documentation can be written. It's quick and dirty - * has a horrible interface, but it's sparce enough to pick out the important - * parts easily. For examples of read and write code, see wmgui. Speaker - * support is "experimental" (read: bad) enough to be disabled. The beginnings - * of a speaker output function are in libwiimote source. */ -/* Note: accelerometer (including nunchuk) and IR outputs produce a - * lot of data - the purpose of this program is demonstration, not good - * interface, and it shows. */ - -cwiid_mesg_callback_t cwiid_callback; - -#define toggle_bit(bf,b) \ - (bf) = ((bf) & b) \ - ? ((bf) & ~(b)) \ - : ((bf) | (b)) - -#define MENU \ - "1: toggle LED 1\n" \ - "2: toggle LED 2\n" \ - "3: toggle LED 3\n" \ - "4: toggle LED 4\n" \ - "5: toggle rumble\n" \ - "a: toggle accelerometer reporting\n" \ - "b: toggle button reporting\n" \ - "c: enable motionplus, if connected\n" \ - "e: toggle extension reporting\n" \ - "i: toggle ir reporting\n" \ - "m: toggle messages\n" \ - "p: print this menu\n" \ - "r: request status message ((t) enables callback output)\n" \ - "s: print current state\n" \ - "t: toggle status reporting\n" \ - "x: exit\n" - -void set_led_state(cwiid_wiimote_t *wiimote, unsigned char led_state); -void set_rpt_mode(cwiid_wiimote_t *wiimote, unsigned char rpt_mode); -void print_state(struct cwiid_state *state); - -cwiid_err_t err; -void err(cwiid_wiimote_t *wiimote, const char *s, va_list ap) -{ - if (wiimote) printf("%d:", cwiid_get_id(wiimote)); - else printf("-1:"); - vprintf(s, ap); - printf("\n"); -} - -int main(int argc, char *argv[]) -{ - cwiid_wiimote_t *wiimote; /* wiimote handle */ - struct cwiid_state state; /* wiimote state */ - bdaddr_t bdaddr; /* bluetooth device address */ - unsigned char mesg = 0; - unsigned char led_state = 0; - unsigned char rpt_mode = 0; - unsigned char rumble = 0; - int exit = 0; - - cwiid_set_err(err); - - /* Connect to address given on command-line, if present */ - if (argc > 1) { - str2ba(argv[1], &bdaddr); - } - else { - bdaddr = *BDADDR_ANY; - } - - /* Connect to the wiimote */ - printf("Put Wiimote in discoverable mode now (press 1+2)...\n"); - if (!(wiimote = cwiid_open(&bdaddr, 0))) { - fprintf(stderr, "Unable to connect to wiimote\n"); - return -1; - } - if (cwiid_set_mesg_callback(wiimote, cwiid_callback)) { - fprintf(stderr, "Unable to set message callback\n"); - } - - printf("Note: To demonstrate the new API interfaces, wmdemo no longer " - "enables messages by default.\n" - "Output can be gathered through the new state-based interface (s), " - "or by enabling the messages interface (m).\n"); - - /* Menu */ - printf("%s", MENU); - - while (!exit) { - switch (getchar()) { - case '1': - toggle_bit(led_state, CWIID_LED1_ON); - set_led_state(wiimote, led_state); - break; - case '2': - toggle_bit(led_state, CWIID_LED2_ON); - set_led_state(wiimote, led_state); - break; - case '3': - toggle_bit(led_state, CWIID_LED3_ON); - set_led_state(wiimote, led_state); - break; - case '4': - toggle_bit(led_state, CWIID_LED4_ON); - set_led_state(wiimote, led_state); - break; - case '5': - toggle_bit(rumble, 1); - if (cwiid_set_rumble(wiimote, rumble)) { - fprintf(stderr, "Error setting rumble\n"); - } - break; - case 'a': - toggle_bit(rpt_mode, CWIID_RPT_ACC); - set_rpt_mode(wiimote, rpt_mode); - break; - case 'b': - toggle_bit(rpt_mode, CWIID_RPT_BTN); - set_rpt_mode(wiimote, rpt_mode); - break; - case 'c': - cwiid_enable(wiimote, CWIID_FLAG_MOTIONPLUS); - break; - case 'e': - /* CWIID_RPT_EXT is actually - * CWIID_RPT_NUNCHUK | CWIID_RPT_CLASSIC | CWIID_RPT_BALANCE */ - toggle_bit(rpt_mode, CWIID_RPT_EXT); - set_rpt_mode(wiimote, rpt_mode); - break; - case 'i': - /* libwiimote picks the highest quality IR mode available with the - * other options selected (not including as-yet-undeciphered - * interleaved mode */ - toggle_bit(rpt_mode, CWIID_RPT_IR); - set_rpt_mode(wiimote, rpt_mode); - break; - case 'm': - if (!mesg) { - if (cwiid_enable(wiimote, CWIID_FLAG_MESG_IFC)) { - fprintf(stderr, "Error enabling messages\n"); - } - else { - mesg = 1; - } - } - else { - if (cwiid_disable(wiimote, CWIID_FLAG_MESG_IFC)) { - fprintf(stderr, "Error disabling message\n"); - } - else { - mesg = 0; - } - } - break; - case 'p': - printf("%s", MENU); - break; - case 'r': - if (cwiid_request_status(wiimote)) { - fprintf(stderr, "Error requesting status message\n"); - } - break; - case 's': - if (cwiid_get_state(wiimote, &state)) { - fprintf(stderr, "Error getting state\n"); - } - print_state(&state); - break; - case 't': - toggle_bit(rpt_mode, CWIID_RPT_STATUS); - set_rpt_mode(wiimote, rpt_mode); - break; - case 'x': - exit = -1; - break; - case '\n': - break; - default: - fprintf(stderr, "invalid option\n"); - } - } - - if (cwiid_close(wiimote)) { - fprintf(stderr, "Error on wiimote disconnect\n"); - return -1; - } - - return 0; -} - -void set_led_state(cwiid_wiimote_t *wiimote, unsigned char led_state) -{ - if (cwiid_set_led(wiimote, led_state)) { - fprintf(stderr, "Error setting LEDs \n"); - } -} - -void set_rpt_mode(cwiid_wiimote_t *wiimote, unsigned char rpt_mode) -{ - if (cwiid_set_rpt_mode(wiimote, rpt_mode)) { - fprintf(stderr, "Error setting report mode\n"); - } -} - -void print_state(struct cwiid_state *state) -{ - int i; - int valid_source = 0; - - printf("Report Mode:"); - if (state->rpt_mode & CWIID_RPT_STATUS) printf(" STATUS"); - if (state->rpt_mode & CWIID_RPT_BTN) printf(" BTN"); - if (state->rpt_mode & CWIID_RPT_ACC) printf(" ACC"); - if (state->rpt_mode & CWIID_RPT_IR) printf(" IR"); - if (state->rpt_mode & CWIID_RPT_NUNCHUK) printf(" NUNCHUK"); - if (state->rpt_mode & CWIID_RPT_CLASSIC) printf(" CLASSIC"); - if (state->rpt_mode & CWIID_RPT_BALANCE) printf(" BALANCE"); - if (state->rpt_mode & CWIID_RPT_MOTIONPLUS) printf(" MOTIONPLUS"); - printf("\n"); - - printf("Active LEDs:"); - if (state->led & CWIID_LED1_ON) printf(" 1"); - if (state->led & CWIID_LED2_ON) printf(" 2"); - if (state->led & CWIID_LED3_ON) printf(" 3"); - if (state->led & CWIID_LED4_ON) printf(" 4"); - printf("\n"); - - printf("Rumble: %s\n", state->rumble ? "On" : "Off"); - - printf("Battery: %d%%\n", - (int)(100.0 * state->battery / CWIID_BATTERY_MAX)); - - printf("Buttons: %X\n", state->buttons); - - printf("Acc: x=%d y=%d z=%d\n", state->acc[CWIID_X], state->acc[CWIID_Y], - state->acc[CWIID_Z]); - - printf("IR: "); - for (i = 0; i < CWIID_IR_SRC_COUNT; i++) { - if (state->ir_src[i].valid) { - valid_source = 1; - printf("(%d,%d) ", state->ir_src[i].pos[CWIID_X], - state->ir_src[i].pos[CWIID_Y]); - } - } - if (!valid_source) { - printf("no sources detected"); - } - printf("\n"); - - switch (state->ext_type) { - case CWIID_EXT_NONE: - printf("No extension\n"); - break; - case CWIID_EXT_UNKNOWN: - printf("Unknown extension attached\n"); - break; - case CWIID_EXT_NUNCHUK: - printf("Nunchuk: btns=%.2X stick=(%d,%d) acc.x=%d acc.y=%d " - "acc.z=%d\n", state->ext.nunchuk.buttons, - state->ext.nunchuk.stick[CWIID_X], - state->ext.nunchuk.stick[CWIID_Y], - state->ext.nunchuk.acc[CWIID_X], - state->ext.nunchuk.acc[CWIID_Y], - state->ext.nunchuk.acc[CWIID_Z]); - break; - case CWIID_EXT_CLASSIC: - printf("Classic: btns=%.4X l_stick=(%d,%d) r_stick=(%d,%d) " - "l=%d r=%d\n", state->ext.classic.buttons, - state->ext.classic.l_stick[CWIID_X], - state->ext.classic.l_stick[CWIID_Y], - state->ext.classic.r_stick[CWIID_X], - state->ext.classic.r_stick[CWIID_Y], - state->ext.classic.l, state->ext.classic.r); - break; - case CWIID_EXT_BALANCE: - printf("Balance: right_top=%d right_bottom=%d " - "left_top=%d left_bottom=%d\n", - state->ext.balance.right_top, - state->ext.balance.right_bottom, - state->ext.balance.left_top, - state->ext.balance.left_bottom); - break; - case CWIID_EXT_MOTIONPLUS: - printf("MotionPlus: angle_rate=(%d,%d,%d)\n", - state->ext.motionplus.angle_rate[0], - state->ext.motionplus.angle_rate[1], - state->ext.motionplus.angle_rate[2]); - break; - } -} - -/* Prototype cwiid_callback with cwiid_callback_t, define it with the actual - * type - this will cause a compile error (rather than some undefined bizarre - * behavior) if cwiid_callback_t changes */ -/* cwiid_mesg_callback_t has undergone a few changes lately, hopefully this - * will be the last. Some programs need to know which messages were received - * simultaneously (e.g. for correlating accelerometer and IR data), and the - * sequence number mechanism used previously proved cumbersome, so we just - * pass an array of messages, all of which were received at the same time. - * The id is to distinguish between multiple wiimotes using the same callback. - * */ -void cwiid_callback(cwiid_wiimote_t *wiimote, int mesg_count, - union cwiid_mesg mesg[], struct timespec *timestamp) -{ - int i, j; - int valid_source; - - for (i=0; i < mesg_count; i++) - { - switch (mesg[i].type) { - case CWIID_MESG_STATUS: - printf("Status Report: battery=%d extension=", - mesg[i].status_mesg.battery); - switch (mesg[i].status_mesg.ext_type) { - case CWIID_EXT_NONE: - printf("none"); - break; - case CWIID_EXT_NUNCHUK: - printf("Nunchuk"); - break; - case CWIID_EXT_CLASSIC: - printf("Classic Controller"); - break; - case CWIID_EXT_BALANCE: - printf("Balance Board"); - break; - case CWIID_EXT_MOTIONPLUS: - printf("MotionPlus"); - break; - default: - printf("Unknown Extension"); - break; - } - printf("\n"); - break; - case CWIID_MESG_BTN: - printf("Button Report: %.4X\n", mesg[i].btn_mesg.buttons); - break; - case CWIID_MESG_ACC: - printf("Acc Report: x=%d, y=%d, z=%d\n", - mesg[i].acc_mesg.acc[CWIID_X], - mesg[i].acc_mesg.acc[CWIID_Y], - mesg[i].acc_mesg.acc[CWIID_Z]); - break; - case CWIID_MESG_IR: - printf("IR Report: "); - valid_source = 0; - for (j = 0; j < CWIID_IR_SRC_COUNT; j++) { - if (mesg[i].ir_mesg.src[j].valid) { - valid_source = 1; - printf("(%d,%d) ", mesg[i].ir_mesg.src[j].pos[CWIID_X], - mesg[i].ir_mesg.src[j].pos[CWIID_Y]); - } - } - if (!valid_source) { - printf("no sources detected"); - } - printf("\n"); - break; - case CWIID_MESG_NUNCHUK: - printf("Nunchuk Report: btns=%.2X stick=(%d,%d) acc.x=%d acc.y=%d " - "acc.z=%d\n", mesg[i].nunchuk_mesg.buttons, - mesg[i].nunchuk_mesg.stick[CWIID_X], - mesg[i].nunchuk_mesg.stick[CWIID_Y], - mesg[i].nunchuk_mesg.acc[CWIID_X], - mesg[i].nunchuk_mesg.acc[CWIID_Y], - mesg[i].nunchuk_mesg.acc[CWIID_Z]); - break; - case CWIID_MESG_CLASSIC: - printf("Classic Report: btns=%.4X l_stick=(%d,%d) r_stick=(%d,%d) " - "l=%d r=%d\n", mesg[i].classic_mesg.buttons, - mesg[i].classic_mesg.l_stick[CWIID_X], - mesg[i].classic_mesg.l_stick[CWIID_Y], - mesg[i].classic_mesg.r_stick[CWIID_X], - mesg[i].classic_mesg.r_stick[CWIID_Y], - mesg[i].classic_mesg.l, mesg[i].classic_mesg.r); - break; - case CWIID_MESG_BALANCE: - printf("Balance Report: right_top=%d right_bottom=%d " - "left_top=%d left_bottom=%d\n", - mesg[i].balance_mesg.right_top, - mesg[i].balance_mesg.right_bottom, - mesg[i].balance_mesg.left_top, - mesg[i].balance_mesg.left_bottom); - break; - case CWIID_MESG_MOTIONPLUS: - printf("MotionPlus Report: angle_rate=(%d,%d,%d)\n", - mesg[i].motionplus_mesg.angle_rate[0], - mesg[i].motionplus_mesg.angle_rate[1], - mesg[i].motionplus_mesg.angle_rate[2]); - break; - case CWIID_MESG_ERROR: - if (cwiid_close(wiimote)) { - fprintf(stderr, "Error on wiimote disconnect\n"); - exit(-1); - } - exit(0); - break; - default: - printf("Unknown Report"); - break; - } - } -} diff --git a/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.py.svn-base b/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.py.svn-base deleted file mode 100644 index 86434c3f37b39b1fc98a989d6e3df0d5d24d39c9..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmdemo/.svn/text-base/wmdemo.py.svn-base +++ /dev/null @@ -1,226 +0,0 @@ -#!/usr/bin/python -import cwiid -import sys - -menu = '''1: toggle LED 1 -2: toggle LED 2 -3: toggle LED 3 -4: toggle LED 4 -5: toggle rumble -a: toggle accelerometer reporting -b: toggle button reporting -c: enable motionplus, if connected -e: toggle extension reporting -i: toggle ir reporting -m: toggle messages -p: print this menu -r: request status message ((t) enables callback output) -s: print current state -t: toggle status reporting -x: exit''' - -def main(): - led = 0 - rpt_mode = 0 - rumble = 0 - mesg = False - - #Connect to address given on command-line, if present - print 'Put Wiimote in discoverable mode now (press 1+2)...' - global wiimote - if len(sys.argv) > 1: - wiimote = cwiid.Wiimote(sys.argv[1]) - else: - wiimote = cwiid.Wiimote() - - wiimote.mesg_callback = callback - - print menu - - exit = 0 - while not exit: - c = sys.stdin.read(1) - if c == '1': - led ^= cwiid.LED1_ON - wiimote.led = led - elif c == '2': - led ^= cwiid.LED2_ON - wiimote.led = led - elif c == '3': - led ^= cwiid.LED3_ON - wiimote.led = led - elif c == '4': - led ^= cwiid.LED4_ON - wiimote.led = led - elif c == '5': - rumble ^= 1 - wiimote.rumble = rumble - elif c == 'a': - rpt_mode ^= cwiid.RPT_ACC - wiimote.rpt_mode = rpt_mode - elif c == 'b': - rpt_mode ^= cwiid.RPT_BTN - wiimote.rpt_mode = rpt_mode - elif c == 'c': - wiimote.enable(cwiid.FLAG_MOTIONPLUS) - elif c == 'e': - rpt_mode ^= cwiid.RPT_EXT - wiimote.rpt_mode = rpt_mode - elif c == 'i': - rpt_mode ^= cwiid.RPT_IR - wiimote.rpt_mode = rpt_mode - elif c == 'm': - mesg = not mesg - if mesg: - wiimote.enable(cwiid.FLAG_MESG_IFC); - else: - wiimote.disable(cwiid.FLAG_MESG_IFC); - elif c == 'p': - print menu - elif c == 'r': - wiimote.request_status() - elif c == 's': - print_state(wiimote.state) - elif c == 't': - rpt_mode ^= cwiid.RPT_STATUS - wiimote.rpt_mode = rpt_mode - elif c == 'x': - exit = -1; - elif c == '\n': - pass - else: - print 'invalid option' - - wiimote.close() - -def print_state(state): - print 'Report Mode:', - for r in ['STATUS', 'BTN', 'ACC', 'IR', 'NUNCHUK', 'CLASSIC', 'BALANCE', 'MOTIONPLUS']: - if state['rpt_mode'] & eval('cwiid.RPT_' + r): - print r, - print - - print 'Active LEDs:', - for led in ['1','2','3','4']: - if state['led'] & eval('cwiid.LED' + led + '_ON'): - print led, - print - - print 'Rumble:', state['rumble'] and 'On' or 'Off' - - print 'Battery:', int(100.0 * state['battery'] / cwiid.BATTERY_MAX) - - if 'buttons' in state: - print 'Buttons:', state['buttons'] - - if 'acc' in state: - print 'Acc: x=%d y=%d z=%d' % (state['acc'][cwiid.X], - state['acc'][cwiid.Y], - state['acc'][cwiid.Z]) - - if 'ir_src' in state: - valid_src = False - print 'IR:', - for src in state['ir_src']: - if src: - valid_src = True - print src['pos'], - - if not valid_src: - print 'no sources detected' - else: - print - - if state['ext_type'] == cwiid.EXT_NONE: - print 'No extension' - elif state['ext_type'] == cwiid.EXT_UNKNOWN: - print 'Unknown extension attached' - elif state['ext_type'] == cwiid.EXT_NUNCHUK: - if state.has_key('nunchuk'): - print 'Nunchuk: btns=%.2X stick=%r acc.x=%d acc.y=%d acc.z=%d' % \ - (state['nunchuk']['buttons'], state['nunchuk']['stick'], - state['nunchuk']['acc'][cwiid.X], - state['nunchuk']['acc'][cwiid.Y], - state['nunchuk']['acc'][cwiid.Z]) - elif state['ext_type'] == cwiid.EXT_CLASSIC: - if state.has_key('classic'): - print 'Classic: btns=%.4X l_stick=%r r_stick=%r l=%d r=%d' % \ - (state['classic']['buttons'], - state['classic']['l_stick'], state['classic']['r_stick'], - state['classic']['l'], state['classic']['r']) - elif state['ext_type'] == cwiid.EXT_BALANCE: - if state.has_key('balance'): - print 'Balance: right_top=%d right_bottom=%d left_top=%d left_bottom=%d' % \ - (state['balance']['right_top'], state['balance']['right_bottom'], - state['balance']['left_top'], state['balance']['left_bottom']) - elif state['ext_type'] == cwiid.EXT_MOTIONPLUS: - if state.has_key('motionplus'): - print 'MotionPlus: angle_rate=(%d,%d,%d)' % state['motionplus']['angle_rate'] - -def callback(mesg_list, time): - print 'time: %f' % time - for mesg in mesg_list: - if mesg[0] == cwiid.MESG_STATUS: - print 'Status Report: battery=%d extension=' % \ - mesg[1]['battery'], - if mesg[1]['ext_type'] == cwiid.EXT_NONE: - print 'none' - elif mesg[1]['ext_type'] == cwiid.EXT_NUNCHUK: - print 'Nunchuk' - elif mesg[1]['ext_type'] == cwiid.EXT_CLASSIC: - print 'Classic Controller' - elif mesg[1]['ext_type'] == cwiid.EXT_BALANCE: - print 'Balance Board' - elif mesg[1]['ext_type'] == cwiid.EXT_MOTIONPLUS: - print 'MotionPlus' - else: - print 'Unknown Extension' - - elif mesg[0] == cwiid.MESG_BTN: - print 'Button Report: %.4X' % mesg[1] - - elif mesg[0] == cwiid.MESG_ACC: - print 'Acc Report: x=%d, y=%d, z=%d' % \ - (mesg[1][cwiid.X], mesg[1][cwiid.Y], mesg[1][cwiid.Z]) - - elif mesg[0] == cwiid.MESG_IR: - valid_src = False - print 'IR Report: ', - for src in mesg[1]: - if src: - valid_src = True - print src['pos'], - - if not valid_src: - print 'no sources detected' - else: - print - - elif mesg[0] == cwiid.MESG_NUNCHUK: - print ('Nunchuk Report: btns=%.2X stick=%r ' + \ - 'acc.x=%d acc.y=%d acc.z=%d') % \ - (mesg[1]['buttons'], mesg[1]['stick'], - mesg[1]['acc'][cwiid.X], mesg[1]['acc'][cwiid.Y], - mesg[1]['acc'][cwiid.Z]) - elif mesg[0] == cwiid.MESG_CLASSIC: - print ('Classic Report: btns=%.4X l_stick=%r ' + \ - 'r_stick=%r l=%d r=%d') % \ - (mesg[1]['buttons'], mesg[1]['l_stick'], - mesg[1]['r_stick'], mesg[1]['l'], mesg[1]['r']) - elif mesg[0] == cwiid.MESG_BALANCE: - print ('Balance Report: right_top=%d right_bottom=%d ' + \ - 'left_top=%d left_bottom=%d') % \ - (mesg[1]['right_top'], mesg[1]['right_bottom'], - mesg[1]['left_top'], mesg[1]['left_bottom']) - elif mesg[0] == cwiid.MESG_MOTIONPLUS: - print 'MotionPlus Report: angle_rate=(%d,%d,%d)' % \ - mesg[1]['angle_rate'] - elif mesg[0] == cwiid.MESG_ERROR: - print "Error message received" - global wiimote - wiimote.close() - exit(-1) - else: - print 'Unknown Report' - -main() diff --git a/l2ork_addons/cwiid/wmgui/.svn/all-wcprops b/l2ork_addons/cwiid/wmgui/.svn/all-wcprops deleted file mode 100644 index ea51c426b828394fb406b8b067d1897c057ff83c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/all-wcprops +++ /dev/null @@ -1,77 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 35 -/cwiid/svn/!svn/ver/199/trunk/wmgui -END -wmgui.glade.bak -K 25 -svn:wc:ra_dav:version-url -V 50 -/cwiid/svn/!svn/ver/14/trunk/wmgui/wmgui.glade.bak -END -wmgui.gladep.bak -K 25 -svn:wc:ra_dav:version-url -V 51 -/cwiid/svn/!svn/ver/14/trunk/wmgui/wmgui.gladep.bak -END -callbacks.c -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/14/trunk/wmgui/callbacks.c -END -interface.c -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/14/trunk/wmgui/interface.c -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 47 -/cwiid/svn/!svn/ver/137/trunk/wmgui/Makefile.in -END -support.h -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/14/trunk/wmgui/support.h -END -wmgui.glade -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/14/trunk/wmgui/wmgui.glade -END -wmgui.gladep -K 25 -svn:wc:ra_dav:version-url -V 47 -/cwiid/svn/!svn/ver/14/trunk/wmgui/wmgui.gladep -END -callbacks.h -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/14/trunk/wmgui/callbacks.h -END -main.c -K 25 -svn:wc:ra_dav:version-url -V 42 -/cwiid/svn/!svn/ver/199/trunk/wmgui/main.c -END -interface.h -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/14/trunk/wmgui/interface.h -END -support.c -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/14/trunk/wmgui/support.c -END diff --git a/l2ork_addons/cwiid/wmgui/.svn/entries b/l2ork_addons/cwiid/wmgui/.svn/entries deleted file mode 100644 index 757b7297fe775f458fbcf172deedb63bc321dbab..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/entries +++ /dev/null @@ -1,436 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wmgui -http://abstrakraft.org/cwiid/svn - - - -2009-07-03T19:11:23.657888Z -199 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -wmgui.glade.bak -file - - - - -2009-10-18T02:00:38.000000Z -400c9e038305794e31334069ede70ff1 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -127014 - -wmgui.gladep.bak -file - - - - -2009-10-18T02:00:38.000000Z -0abb8ad29bb171acd149e22907c93b19 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -585 - -callbacks.c -file - - - - -2009-10-18T02:00:38.000000Z -e55dfc290d2d145b40d32f06dd1e9e1c -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -1758 - -interface.c -file - - - - -2009-10-18T02:00:38.000000Z -7f2e548dfd36f941a6660da8aea68800 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -72799 - -Makefile.in -file - - - - -2009-10-18T02:00:38.000000Z -b8ddd48aa8739a6db170177e918df648 -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -352 - -support.h -file - - - - -2009-10-18T02:00:38.000000Z -7e5ef87a0e9a6800adf0ae8a5d69a2f8 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -1333 - -wmgui.glade -file - - - - -2009-10-18T02:00:38.000000Z -400c9e038305794e31334069ede70ff1 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -127014 - -wmgui.gladep -file - - - - -2009-10-18T02:00:38.000000Z -0abb8ad29bb171acd149e22907c93b19 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -585 - -callbacks.h -file - - - - -2009-10-18T02:00:38.000000Z -ba5bd443cb8926a902a7c682dfb90aa8 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -1584 - -main.c -file - - - - -2009-10-18T02:00:38.000000Z -472562e6ae9ca720bef145831b11c8c1 -2009-07-03T19:11:23.657888Z -199 -dsmith - - - - - - - - - - - - - - - - - - - - - -41676 - -interface.h -file - - - - -2009-10-18T02:00:38.000000Z -55fc5400bec68fc71e176944457e64c7 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -127 - -support.c -file - - - - -2009-10-18T02:00:38.000000Z -171a06b9bd1223b9717b2f18ae866f25 -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -3665 - diff --git a/l2ork_addons/cwiid/wmgui/.svn/format b/l2ork_addons/cwiid/wmgui/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 41b205eb880880bf0d6cdcc933fcc675dfb5c9c9..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,19 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -APP_NAME = wmgui - -SOURCES = main.c interface.c support.c - -CFLAGS += @GTK_CFLAGS@ -I@top_builddir@/libcwiid -LDFLAGS += -L@top_builddir@/libcwiid -LDLIBS += @GTK_LIBS@ -lm -lcwiid -INST_DIR = @bindir@ - -include $(COMMON)/include/app.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.c.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.c.svn-base deleted file mode 100644 index 4d4ef4cc3584392807bf424a9df5a784280645ea..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.c.svn-base +++ /dev/null @@ -1,98 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <gtk/gtk.h> - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - - -void -on_new1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_open1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_save1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_save_as1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_quit1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_cut1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_copy1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_paste1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_delete1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_about1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_menuSettings_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.h.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.h.svn-base deleted file mode 100644 index 15fadfc6e5558c15ed608bd91d8229c11d80be19..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/callbacks.h.svn-base +++ /dev/null @@ -1,46 +0,0 @@ -#include <gtk/gtk.h> - - -void -on_new1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_open1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_save1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_save_as1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_quit1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_cut1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_copy1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_paste1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_delete1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_about1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_menuSettings_activate (GtkMenuItem *menuitem, - gpointer user_data); diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.c.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.c.svn-base deleted file mode 100644 index f0d1ad9acbeadecb8ed5d91930268cd350e9b71a..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.c.svn-base +++ /dev/null @@ -1,1827 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <string.h> -#include <stdio.h> - -#include <gdk/gdkkeysyms.h> -#include <gtk/gtk.h> - -#include "callbacks.h" -#include "interface.h" -#include "support.h" - -#define GLADE_HOOKUP_OBJECT(component,widget,name) \ - g_object_set_data_full (G_OBJECT (component), name, \ - gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) - -#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ - g_object_set_data (G_OBJECT (component), name, widget) - -GtkWidget* -create_winMain (void) -{ - GtkWidget *winMain; - GtkWidget *vbox1; - GtkWidget *menubar1; - GtkWidget *menuitem1; - GtkWidget *menuitem1_menu; - GtkWidget *menuConnect; - GtkWidget *image27; - GtkWidget *menuDisconnect; - GtkWidget *image28; - GtkWidget *separatormenuitem1; - GtkWidget *menuQuit; - GtkWidget *image29; - GtkWidget *menuSettings; - GtkWidget *menuSettings_menu; - GtkWidget *chkAcc; - GtkWidget *chkIR; - GtkWidget *chkExt; - GtkWidget *menuControls; - GtkWidget *menuControls_menu; - GtkWidget *chkLED1; - GtkWidget *chkLED2; - GtkWidget *chkLED3; - GtkWidget *chkLED4; - GtkWidget *separator1; - GtkWidget *chkRumble; - GtkWidget *menuView; - GtkWidget *menuView_menu; - GtkWidget *menuRW; - GtkWidget *menuHelp; - GtkWidget *menuHelp_menu; - GtkWidget *menuAbout; - GtkWidget *hbox1; - GtkWidget *frame1; - GtkWidget *alignment1; - GtkWidget *table1; - GtkWidget *alignment3; - GtkWidget *evUp; - GtkWidget *lblUp; - GtkWidget *alignment4; - GtkWidget *evLeft; - GtkWidget *lblLeft; - GtkWidget *alignment5; - GtkWidget *evRight; - GtkWidget *lblRight; - GtkWidget *alignment6; - GtkWidget *evDown; - GtkWidget *lblDown; - GtkWidget *alignment7; - GtkWidget *evA; - GtkWidget *lblA; - GtkWidget *alignment9; - GtkWidget *evB; - GtkWidget *lblB; - GtkWidget *alignment10; - GtkWidget *evMinus; - GtkWidget *lblMinus; - GtkWidget *alignment11; - GtkWidget *evHome; - GtkWidget *lblHome; - GtkWidget *alignment12; - GtkWidget *evPlus; - GtkWidget *lblPlus; - GtkWidget *alignment13; - GtkWidget *ev1; - GtkWidget *lbl1; - GtkWidget *alignment14; - GtkWidget *ev2; - GtkWidget *lbl2; - GtkWidget *label1; - GtkWidget *frame2; - GtkWidget *alignment2; - GtkWidget *hbox2; - GtkWidget *table4; - GtkWidget *progAccX; - GtkWidget *progAccY; - GtkWidget *progAccZ; - GtkWidget *lblAccX; - GtkWidget *lblAccXVal; - GtkWidget *lblAccY; - GtkWidget *lblAccYVal; - GtkWidget *lblAccZ; - GtkWidget *lblAccZVal; - GtkWidget *lblPitch; - GtkWidget *lblPitchVal; - GtkWidget *lblRoll; - GtkWidget *lblRollVal; - GtkWidget *lblAcc; - GtkWidget *lblAccVal; - GtkWidget *btnBeep; - GtkWidget *frame3; - GtkWidget *drawIR; - GtkWidget *lblIR; - GtkWidget *label2; - GtkWidget *hbox10; - GtkWidget *frame4; - GtkWidget *alignment28; - GtkWidget *hbox12; - GtkWidget *vbox4; - GtkWidget *drawNCStick; - GtkWidget *hbox13; - GtkWidget *evNCC; - GtkWidget *lblNCC; - GtkWidget *evNCZ; - GtkWidget *lblNCZ; - GtkWidget *table8; - GtkWidget *lblNCAccX; - GtkWidget *lblNCAccY; - GtkWidget *lblNCAccZ; - GtkWidget *lblNCAcc; - GtkWidget *lblNCRoll; - GtkWidget *lblNCPitch; - GtkWidget *lblNCAccXVal; - GtkWidget *lblNCAccYVal; - GtkWidget *lblNCAccZVal; - GtkWidget *lblNCAccVal; - GtkWidget *lblNCRollVal; - GtkWidget *lblNCPitchVal; - GtkWidget *progNCAccX; - GtkWidget *progNCAccZ; - GtkWidget *progNCAccY; - GtkWidget *lblNC; - GtkWidget *frame5; - GtkWidget *alignment29; - GtkWidget *vbox5; - GtkWidget *table9; - GtkWidget *alignment15; - GtkWidget *evCCLeft; - GtkWidget *lblCCLeft; - GtkWidget *alignment16; - GtkWidget *evCCUp; - GtkWidget *lblCCUp; - GtkWidget *alignment17; - GtkWidget *evCCDown; - GtkWidget *lblCCDown; - GtkWidget *alignment18; - GtkWidget *evCCRight; - GtkWidget *lblCCRight; - GtkWidget *alignment19; - GtkWidget *evCCMinus; - GtkWidget *lblCCMinus; - GtkWidget *alignment20; - GtkWidget *evCCHome; - GtkWidget *lblCCHome; - GtkWidget *alignment21; - GtkWidget *evCCPlus; - GtkWidget *lblCCPlus; - GtkWidget *alignment22; - GtkWidget *evCCZL; - GtkWidget *lblCCZL; - GtkWidget *alignment23; - GtkWidget *evCCZR; - GtkWidget *lblCCZR; - GtkWidget *alignment24; - GtkWidget *evCCX; - GtkWidget *lblCCX; - GtkWidget *alignment25; - GtkWidget *evCCY; - GtkWidget *lblCCY; - GtkWidget *alignment26; - GtkWidget *evCCB; - GtkWidget *lblCCB; - GtkWidget *alignment27; - GtkWidget *evCCA; - GtkWidget *lblCCA; - GtkWidget *hbox15; - GtkWidget *drawCCLStick; - GtkWidget *drawCCRStick; - GtkWidget *table10; - GtkWidget *lblCCLVal; - GtkWidget *lblCCRVal; - GtkWidget *progCCL; - GtkWidget *progCCR; - GtkWidget *evCCR; - GtkWidget *lblCCR; - GtkWidget *evCCL; - GtkWidget *lblCCL; - GtkWidget *lblClassic; - GtkWidget *hbox11; - GtkWidget *statConnection; - GtkWidget *statBattery; - GtkWidget *statExtension; - GtkAccelGroup *accel_group; - - accel_group = gtk_accel_group_new (); - - winMain = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (winMain, "winMain"); - gtk_window_set_title (GTK_WINDOW (winMain), "wmgui"); - - vbox1 = gtk_vbox_new (FALSE, 3); - gtk_widget_set_name (vbox1, "vbox1"); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (winMain), vbox1); - - menubar1 = gtk_menu_bar_new (); - gtk_widget_set_name (menubar1, "menubar1"); - gtk_widget_show (menubar1); - gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0); - - menuitem1 = gtk_menu_item_new_with_mnemonic ("_File"); - gtk_widget_set_name (menuitem1, "menuitem1"); - gtk_widget_show (menuitem1); - gtk_container_add (GTK_CONTAINER (menubar1), menuitem1); - - menuitem1_menu = gtk_menu_new (); - gtk_widget_set_name (menuitem1_menu, "menuitem1_menu"); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menuitem1_menu); - - menuConnect = gtk_image_menu_item_new_with_mnemonic ("_Connect"); - gtk_widget_set_name (menuConnect, "menuConnect"); - gtk_widget_show (menuConnect); - gtk_container_add (GTK_CONTAINER (menuitem1_menu), menuConnect); - gtk_widget_add_accelerator (menuConnect, "activate", accel_group, - GDK_C, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - image27 = gtk_image_new_from_stock ("gtk-connect", GTK_ICON_SIZE_MENU); - gtk_widget_set_name (image27, "image27"); - gtk_widget_show (image27); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuConnect), image27); - - menuDisconnect = gtk_image_menu_item_new_with_mnemonic ("_Disconnect"); - gtk_widget_set_name (menuDisconnect, "menuDisconnect"); - gtk_widget_show (menuDisconnect); - gtk_container_add (GTK_CONTAINER (menuitem1_menu), menuDisconnect); - gtk_widget_add_accelerator (menuDisconnect, "activate", accel_group, - GDK_D, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - image28 = gtk_image_new_from_stock ("gtk-disconnect", GTK_ICON_SIZE_MENU); - gtk_widget_set_name (image28, "image28"); - gtk_widget_show (image28); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuDisconnect), image28); - - separatormenuitem1 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separatormenuitem1, "separatormenuitem1"); - gtk_widget_show (separatormenuitem1); - gtk_container_add (GTK_CONTAINER (menuitem1_menu), separatormenuitem1); - gtk_widget_set_sensitive (separatormenuitem1, FALSE); - - menuQuit = gtk_image_menu_item_new_with_mnemonic ("_Quit"); - gtk_widget_set_name (menuQuit, "menuQuit"); - gtk_widget_show (menuQuit); - gtk_container_add (GTK_CONTAINER (menuitem1_menu), menuQuit); - gtk_widget_add_accelerator (menuQuit, "activate", accel_group, - GDK_Q, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - image29 = gtk_image_new_from_stock ("gtk-quit", GTK_ICON_SIZE_MENU); - gtk_widget_set_name (image29, "image29"); - gtk_widget_show (image29); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuQuit), image29); - - menuSettings = gtk_menu_item_new_with_mnemonic ("_Settings"); - gtk_widget_set_name (menuSettings, "menuSettings"); - gtk_widget_show (menuSettings); - gtk_container_add (GTK_CONTAINER (menubar1), menuSettings); - - menuSettings_menu = gtk_menu_new (); - gtk_widget_set_name (menuSettings_menu, "menuSettings_menu"); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuSettings), menuSettings_menu); - - chkAcc = gtk_check_menu_item_new_with_mnemonic ("_Acc Data"); - gtk_widget_set_name (chkAcc, "chkAcc"); - gtk_widget_show (chkAcc); - gtk_container_add (GTK_CONTAINER (menuSettings_menu), chkAcc); - gtk_widget_add_accelerator (chkAcc, "activate", accel_group, - GDK_A, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - chkIR = gtk_check_menu_item_new_with_mnemonic ("_IR Data"); - gtk_widget_set_name (chkIR, "chkIR"); - gtk_widget_show (chkIR); - gtk_container_add (GTK_CONTAINER (menuSettings_menu), chkIR); - gtk_widget_add_accelerator (chkIR, "activate", accel_group, - GDK_I, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - chkExt = gtk_check_menu_item_new_with_mnemonic ("_Extension Data"); - gtk_widget_set_name (chkExt, "chkExt"); - gtk_widget_show (chkExt); - gtk_container_add (GTK_CONTAINER (menuSettings_menu), chkExt); - gtk_widget_add_accelerator (chkExt, "activate", accel_group, - GDK_E, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - menuControls = gtk_menu_item_new_with_mnemonic ("_Controls"); - gtk_widget_set_name (menuControls, "menuControls"); - gtk_widget_show (menuControls); - gtk_container_add (GTK_CONTAINER (menubar1), menuControls); - - menuControls_menu = gtk_menu_new (); - gtk_widget_set_name (menuControls_menu, "menuControls_menu"); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuControls), menuControls_menu); - - chkLED1 = gtk_check_menu_item_new_with_mnemonic ("LED _1"); - gtk_widget_set_name (chkLED1, "chkLED1"); - gtk_widget_show (chkLED1); - gtk_container_add (GTK_CONTAINER (menuControls_menu), chkLED1); - gtk_widget_add_accelerator (chkLED1, "activate", accel_group, - GDK_1, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - chkLED2 = gtk_check_menu_item_new_with_mnemonic ("LED _2"); - gtk_widget_set_name (chkLED2, "chkLED2"); - gtk_widget_show (chkLED2); - gtk_container_add (GTK_CONTAINER (menuControls_menu), chkLED2); - gtk_widget_add_accelerator (chkLED2, "activate", accel_group, - GDK_2, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - chkLED3 = gtk_check_menu_item_new_with_mnemonic ("LED _3"); - gtk_widget_set_name (chkLED3, "chkLED3"); - gtk_widget_show (chkLED3); - gtk_container_add (GTK_CONTAINER (menuControls_menu), chkLED3); - gtk_widget_add_accelerator (chkLED3, "activate", accel_group, - GDK_3, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - chkLED4 = gtk_check_menu_item_new_with_mnemonic ("LED _4"); - gtk_widget_set_name (chkLED4, "chkLED4"); - gtk_widget_show (chkLED4); - gtk_container_add (GTK_CONTAINER (menuControls_menu), chkLED4); - gtk_widget_add_accelerator (chkLED4, "activate", accel_group, - GDK_4, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - separator1 = gtk_separator_menu_item_new (); - gtk_widget_set_name (separator1, "separator1"); - gtk_widget_show (separator1); - gtk_container_add (GTK_CONTAINER (menuControls_menu), separator1); - gtk_widget_set_sensitive (separator1, FALSE); - - chkRumble = gtk_check_menu_item_new_with_mnemonic ("_Rumble"); - gtk_widget_set_name (chkRumble, "chkRumble"); - gtk_widget_show (chkRumble); - gtk_container_add (GTK_CONTAINER (menuControls_menu), chkRumble); - gtk_widget_add_accelerator (chkRumble, "activate", accel_group, - GDK_R, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - menuView = gtk_menu_item_new_with_mnemonic ("_View"); - gtk_widget_set_name (menuView, "menuView"); - gtk_widget_show (menuView); - gtk_container_add (GTK_CONTAINER (menubar1), menuView); - - menuView_menu = gtk_menu_new (); - gtk_widget_set_name (menuView_menu, "menuView_menu"); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuView), menuView_menu); - - menuRW = gtk_menu_item_new_with_mnemonic ("_Memory Read/Write"); - gtk_widget_set_name (menuRW, "menuRW"); - gtk_widget_show (menuRW); - gtk_container_add (GTK_CONTAINER (menuView_menu), menuRW); - gtk_widget_add_accelerator (menuRW, "activate", accel_group, - GDK_M, GDK_CONTROL_MASK, - GTK_ACCEL_VISIBLE); - - menuHelp = gtk_menu_item_new_with_mnemonic ("_Help"); - gtk_widget_set_name (menuHelp, "menuHelp"); - gtk_widget_show (menuHelp); - gtk_container_add (GTK_CONTAINER (menubar1), menuHelp); - - menuHelp_menu = gtk_menu_new (); - gtk_widget_set_name (menuHelp_menu, "menuHelp_menu"); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuHelp), menuHelp_menu); - - menuAbout = gtk_menu_item_new_with_mnemonic ("_About"); - gtk_widget_set_name (menuAbout, "menuAbout"); - gtk_widget_show (menuAbout); - gtk_container_add (GTK_CONTAINER (menuHelp_menu), menuAbout); - - hbox1 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox1, "hbox1"); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0); - - frame1 = gtk_frame_new (NULL); - gtk_widget_set_name (frame1, "frame1"); - gtk_widget_show (frame1); - gtk_box_pack_start (GTK_BOX (hbox1), frame1, TRUE, TRUE, 3); - - alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment1, "alignment1"); - gtk_widget_show (alignment1); - gtk_container_add (GTK_CONTAINER (frame1), alignment1); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0); - - table1 = gtk_table_new (6, 3, TRUE); - gtk_widget_set_name (table1, "table1"); - gtk_widget_show (table1); - gtk_container_add (GTK_CONTAINER (alignment1), table1); - - alignment3 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment3, "alignment3"); - gtk_widget_show (alignment3); - gtk_table_attach (GTK_TABLE (table1), alignment3, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evUp = gtk_event_box_new (); - gtk_widget_set_name (evUp, "evUp"); - gtk_widget_show (evUp); - gtk_container_add (GTK_CONTAINER (alignment3), evUp); - - lblUp = gtk_label_new ("Up"); - gtk_widget_set_name (lblUp, "lblUp"); - gtk_widget_show (lblUp); - gtk_container_add (GTK_CONTAINER (evUp), lblUp); - - alignment4 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment4, "alignment4"); - gtk_widget_show (alignment4); - gtk_table_attach (GTK_TABLE (table1), alignment4, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evLeft = gtk_event_box_new (); - gtk_widget_set_name (evLeft, "evLeft"); - gtk_widget_show (evLeft); - gtk_container_add (GTK_CONTAINER (alignment4), evLeft); - - lblLeft = gtk_label_new ("Left"); - gtk_widget_set_name (lblLeft, "lblLeft"); - gtk_widget_show (lblLeft); - gtk_container_add (GTK_CONTAINER (evLeft), lblLeft); - - alignment5 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment5, "alignment5"); - gtk_widget_show (alignment5); - gtk_table_attach (GTK_TABLE (table1), alignment5, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evRight = gtk_event_box_new (); - gtk_widget_set_name (evRight, "evRight"); - gtk_widget_show (evRight); - gtk_container_add (GTK_CONTAINER (alignment5), evRight); - - lblRight = gtk_label_new ("Right"); - gtk_widget_set_name (lblRight, "lblRight"); - gtk_widget_show (lblRight); - gtk_container_add (GTK_CONTAINER (evRight), lblRight); - - alignment6 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment6, "alignment6"); - gtk_widget_show (alignment6); - gtk_table_attach (GTK_TABLE (table1), alignment6, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evDown = gtk_event_box_new (); - gtk_widget_set_name (evDown, "evDown"); - gtk_widget_show (evDown); - gtk_container_add (GTK_CONTAINER (alignment6), evDown); - - lblDown = gtk_label_new ("Down"); - gtk_widget_set_name (lblDown, "lblDown"); - gtk_widget_show (lblDown); - gtk_container_add (GTK_CONTAINER (evDown), lblDown); - - alignment7 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment7, "alignment7"); - gtk_widget_show (alignment7); - gtk_table_attach (GTK_TABLE (table1), alignment7, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evA = gtk_event_box_new (); - gtk_widget_set_name (evA, "evA"); - gtk_widget_show (evA); - gtk_container_add (GTK_CONTAINER (alignment7), evA); - - lblA = gtk_label_new ("A"); - gtk_widget_set_name (lblA, "lblA"); - gtk_widget_show (lblA); - gtk_container_add (GTK_CONTAINER (evA), lblA); - - alignment9 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment9, "alignment9"); - gtk_widget_show (alignment9); - gtk_table_attach (GTK_TABLE (table1), alignment9, 2, 3, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evB = gtk_event_box_new (); - gtk_widget_set_name (evB, "evB"); - gtk_widget_show (evB); - gtk_container_add (GTK_CONTAINER (alignment9), evB); - - lblB = gtk_label_new ("B"); - gtk_widget_set_name (lblB, "lblB"); - gtk_widget_show (lblB); - gtk_container_add (GTK_CONTAINER (evB), lblB); - - alignment10 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment10, "alignment10"); - gtk_widget_show (alignment10); - gtk_table_attach (GTK_TABLE (table1), alignment10, 0, 1, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evMinus = gtk_event_box_new (); - gtk_widget_set_name (evMinus, "evMinus"); - gtk_widget_show (evMinus); - gtk_container_add (GTK_CONTAINER (alignment10), evMinus); - - lblMinus = gtk_label_new ("-"); - gtk_widget_set_name (lblMinus, "lblMinus"); - gtk_widget_show (lblMinus); - gtk_container_add (GTK_CONTAINER (evMinus), lblMinus); - - alignment11 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment11, "alignment11"); - gtk_widget_show (alignment11); - gtk_table_attach (GTK_TABLE (table1), alignment11, 1, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evHome = gtk_event_box_new (); - gtk_widget_set_name (evHome, "evHome"); - gtk_widget_show (evHome); - gtk_container_add (GTK_CONTAINER (alignment11), evHome); - - lblHome = gtk_label_new ("Home"); - gtk_widget_set_name (lblHome, "lblHome"); - gtk_widget_show (lblHome); - gtk_container_add (GTK_CONTAINER (evHome), lblHome); - - alignment12 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment12, "alignment12"); - gtk_widget_show (alignment12); - gtk_table_attach (GTK_TABLE (table1), alignment12, 2, 3, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evPlus = gtk_event_box_new (); - gtk_widget_set_name (evPlus, "evPlus"); - gtk_widget_show (evPlus); - gtk_container_add (GTK_CONTAINER (alignment12), evPlus); - - lblPlus = gtk_label_new ("+"); - gtk_widget_set_name (lblPlus, "lblPlus"); - gtk_widget_show (lblPlus); - gtk_container_add (GTK_CONTAINER (evPlus), lblPlus); - - alignment13 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment13, "alignment13"); - gtk_widget_show (alignment13); - gtk_table_attach (GTK_TABLE (table1), alignment13, 0, 1, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - ev1 = gtk_event_box_new (); - gtk_widget_set_name (ev1, "ev1"); - gtk_widget_show (ev1); - gtk_container_add (GTK_CONTAINER (alignment13), ev1); - - lbl1 = gtk_label_new ("1"); - gtk_widget_set_name (lbl1, "lbl1"); - gtk_widget_show (lbl1); - gtk_container_add (GTK_CONTAINER (ev1), lbl1); - - alignment14 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment14, "alignment14"); - gtk_widget_show (alignment14); - gtk_table_attach (GTK_TABLE (table1), alignment14, 2, 3, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - ev2 = gtk_event_box_new (); - gtk_widget_set_name (ev2, "ev2"); - gtk_widget_show (ev2); - gtk_container_add (GTK_CONTAINER (alignment14), ev2); - - lbl2 = gtk_label_new ("2"); - gtk_widget_set_name (lbl2, "lbl2"); - gtk_widget_show (lbl2); - gtk_container_add (GTK_CONTAINER (ev2), lbl2); - - label1 = gtk_label_new ("<b>Buttons</b>"); - gtk_widget_set_name (label1, "label1"); - gtk_widget_show (label1); - gtk_frame_set_label_widget (GTK_FRAME (frame1), label1); - gtk_label_set_use_markup (GTK_LABEL (label1), TRUE); - - frame2 = gtk_frame_new (NULL); - gtk_widget_set_name (frame2, "frame2"); - gtk_widget_show (frame2); - gtk_box_pack_start (GTK_BOX (hbox1), frame2, TRUE, TRUE, 3); - - alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment2, "alignment2"); - gtk_widget_show (alignment2); - gtk_container_add (GTK_CONTAINER (frame2), alignment2); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0); - - hbox2 = gtk_hbox_new (TRUE, 6); - gtk_widget_set_name (hbox2, "hbox2"); - gtk_widget_show (hbox2); - gtk_container_add (GTK_CONTAINER (alignment2), hbox2); - - table4 = gtk_table_new (6, 3, FALSE); - gtk_widget_set_name (table4, "table4"); - gtk_widget_show (table4); - gtk_box_pack_start (GTK_BOX (hbox2), table4, TRUE, TRUE, 0); - gtk_table_set_row_spacings (GTK_TABLE (table4), 3); - - progAccX = gtk_progress_bar_new (); - gtk_widget_set_name (progAccX, "progAccX"); - gtk_widget_show (progAccX); - gtk_table_attach (GTK_TABLE (table4), progAccX, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progAccX, FALSE); - - progAccY = gtk_progress_bar_new (); - gtk_widget_set_name (progAccY, "progAccY"); - gtk_widget_show (progAccY); - gtk_table_attach (GTK_TABLE (table4), progAccY, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progAccY, FALSE); - - progAccZ = gtk_progress_bar_new (); - gtk_widget_set_name (progAccZ, "progAccZ"); - gtk_widget_show (progAccZ); - gtk_table_attach (GTK_TABLE (table4), progAccZ, 2, 3, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progAccZ, FALSE); - - lblAccX = gtk_label_new ("X:"); - gtk_widget_set_name (lblAccX, "lblAccX"); - gtk_widget_show (lblAccX); - gtk_table_attach (GTK_TABLE (table4), lblAccX, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblAccX, FALSE); - gtk_label_set_justify (GTK_LABEL (lblAccX), GTK_JUSTIFY_RIGHT); - gtk_misc_set_alignment (GTK_MISC (lblAccX), 0, 0.5); - - lblAccXVal = gtk_label_new ("0"); - gtk_widget_set_name (lblAccXVal, "lblAccXVal"); - gtk_widget_show (lblAccXVal); - gtk_table_attach (GTK_TABLE (table4), lblAccXVal, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblAccXVal, 35, -1); - gtk_widget_set_sensitive (lblAccXVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblAccXVal), 0, 0.5); - - lblAccY = gtk_label_new ("Y:"); - gtk_widget_set_name (lblAccY, "lblAccY"); - gtk_widget_show (lblAccY); - gtk_table_attach (GTK_TABLE (table4), lblAccY, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblAccY, FALSE); - gtk_label_set_justify (GTK_LABEL (lblAccY), GTK_JUSTIFY_RIGHT); - gtk_misc_set_alignment (GTK_MISC (lblAccY), 0, 0.5); - - lblAccYVal = gtk_label_new ("0"); - gtk_widget_set_name (lblAccYVal, "lblAccYVal"); - gtk_widget_show (lblAccYVal); - gtk_table_attach (GTK_TABLE (table4), lblAccYVal, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblAccYVal, 35, -1); - gtk_widget_set_sensitive (lblAccYVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblAccYVal), 0, 0.5); - - lblAccZ = gtk_label_new ("Z:"); - gtk_widget_set_name (lblAccZ, "lblAccZ"); - gtk_widget_show (lblAccZ); - gtk_table_attach (GTK_TABLE (table4), lblAccZ, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblAccZ, FALSE); - gtk_label_set_justify (GTK_LABEL (lblAccZ), GTK_JUSTIFY_RIGHT); - gtk_misc_set_alignment (GTK_MISC (lblAccZ), 0, 0.5); - - lblAccZVal = gtk_label_new ("0"); - gtk_widget_set_name (lblAccZVal, "lblAccZVal"); - gtk_widget_show (lblAccZVal); - gtk_table_attach (GTK_TABLE (table4), lblAccZVal, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblAccZVal, 35, -1); - gtk_widget_set_sensitive (lblAccZVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblAccZVal), 0, 0.5); - - lblPitch = gtk_label_new ("Pitch:"); - gtk_widget_set_name (lblPitch, "lblPitch"); - gtk_widget_show (lblPitch); - gtk_table_attach (GTK_TABLE (table4), lblPitch, 0, 1, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblPitch, FALSE); - gtk_label_set_justify (GTK_LABEL (lblPitch), GTK_JUSTIFY_RIGHT); - gtk_misc_set_alignment (GTK_MISC (lblPitch), 0, 0.5); - - lblPitchVal = gtk_label_new ("0"); - gtk_widget_set_name (lblPitchVal, "lblPitchVal"); - gtk_widget_show (lblPitchVal); - gtk_table_attach (GTK_TABLE (table4), lblPitchVal, 1, 2, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblPitchVal, 35, -1); - gtk_widget_set_sensitive (lblPitchVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblPitchVal), 0, 0.5); - - lblRoll = gtk_label_new ("Roll:"); - gtk_widget_set_name (lblRoll, "lblRoll"); - gtk_widget_show (lblRoll); - gtk_table_attach (GTK_TABLE (table4), lblRoll, 0, 1, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblRoll, FALSE); - gtk_label_set_justify (GTK_LABEL (lblRoll), GTK_JUSTIFY_RIGHT); - gtk_misc_set_alignment (GTK_MISC (lblRoll), 0, 0.5); - - lblRollVal = gtk_label_new ("0"); - gtk_widget_set_name (lblRollVal, "lblRollVal"); - gtk_widget_show (lblRollVal); - gtk_table_attach (GTK_TABLE (table4), lblRollVal, 1, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblRollVal, 35, -1); - gtk_widget_set_sensitive (lblRollVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblRollVal), 0, 0.5); - - lblAcc = gtk_label_new ("Acc:"); - gtk_widget_set_name (lblAcc, "lblAcc"); - gtk_widget_show (lblAcc); - gtk_table_attach (GTK_TABLE (table4), lblAcc, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblAcc, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblAcc), 0, 0.5); - - lblAccVal = gtk_label_new ("0"); - gtk_widget_set_name (lblAccVal, "lblAccVal"); - gtk_widget_show (lblAccVal); - gtk_table_attach (GTK_TABLE (table4), lblAccVal, 1, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblAccVal, 35, -1); - gtk_widget_set_sensitive (lblAccVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblAccVal), 0, 0.5); - - btnBeep = gtk_button_new_with_mnemonic ("Beep"); - gtk_widget_set_name (btnBeep, "btnBeep"); - gtk_table_attach (GTK_TABLE (table4), btnBeep, 2, 3, 4, 5, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - - frame3 = gtk_frame_new (NULL); - gtk_widget_set_name (frame3, "frame3"); - gtk_widget_show (frame3); - gtk_box_pack_start (GTK_BOX (hbox2), frame3, TRUE, TRUE, 0); - gtk_container_set_border_width (GTK_CONTAINER (frame3), 4); - gtk_frame_set_shadow_type (GTK_FRAME (frame3), GTK_SHADOW_IN); - - drawIR = gtk_drawing_area_new (); - gtk_widget_set_name (drawIR, "drawIR"); - gtk_widget_show (drawIR); - gtk_container_add (GTK_CONTAINER (frame3), drawIR); - - lblIR = gtk_label_new ("IR"); - gtk_widget_set_name (lblIR, "lblIR"); - gtk_widget_show (lblIR); - gtk_frame_set_label_widget (GTK_FRAME (frame3), lblIR); - gtk_widget_set_sensitive (lblIR, FALSE); - gtk_label_set_use_markup (GTK_LABEL (lblIR), TRUE); - - label2 = gtk_label_new ("<b>Motion Sensors</b>"); - gtk_widget_set_name (label2, "label2"); - gtk_widget_show (label2); - gtk_frame_set_label_widget (GTK_FRAME (frame2), label2); - gtk_label_set_use_markup (GTK_LABEL (label2), TRUE); - - hbox10 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox10, "hbox10"); - gtk_widget_show (hbox10); - gtk_box_pack_start (GTK_BOX (vbox1), hbox10, FALSE, FALSE, 0); - - frame4 = gtk_frame_new (NULL); - gtk_widget_set_name (frame4, "frame4"); - gtk_widget_show (frame4); - gtk_box_pack_start (GTK_BOX (hbox10), frame4, TRUE, TRUE, 3); - - alignment28 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment28, "alignment28"); - gtk_widget_show (alignment28); - gtk_container_add (GTK_CONTAINER (frame4), alignment28); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment28), 0, 0, 12, 0); - - hbox12 = gtk_hbox_new (FALSE, 4); - gtk_widget_set_name (hbox12, "hbox12"); - gtk_widget_show (hbox12); - gtk_container_add (GTK_CONTAINER (alignment28), hbox12); - - vbox4 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox4, "vbox4"); - gtk_widget_show (vbox4); - gtk_box_pack_start (GTK_BOX (hbox12), vbox4, TRUE, TRUE, 0); - - drawNCStick = gtk_drawing_area_new (); - gtk_widget_set_name (drawNCStick, "drawNCStick"); - gtk_widget_show (drawNCStick); - gtk_box_pack_start (GTK_BOX (vbox4), drawNCStick, TRUE, FALSE, 0); - gtk_widget_set_size_request (drawNCStick, 50, 50); - - hbox13 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox13, "hbox13"); - gtk_widget_show (hbox13); - gtk_box_pack_start (GTK_BOX (vbox4), hbox13, TRUE, FALSE, 0); - - evNCC = gtk_event_box_new (); - gtk_widget_set_name (evNCC, "evNCC"); - gtk_widget_show (evNCC); - gtk_box_pack_start (GTK_BOX (hbox13), evNCC, TRUE, TRUE, 0); - - lblNCC = gtk_label_new ("C"); - gtk_widget_set_name (lblNCC, "lblNCC"); - gtk_widget_show (lblNCC); - gtk_container_add (GTK_CONTAINER (evNCC), lblNCC); - - evNCZ = gtk_event_box_new (); - gtk_widget_set_name (evNCZ, "evNCZ"); - gtk_widget_show (evNCZ); - gtk_box_pack_start (GTK_BOX (hbox13), evNCZ, TRUE, TRUE, 0); - - lblNCZ = gtk_label_new ("Z"); - gtk_widget_set_name (lblNCZ, "lblNCZ"); - gtk_widget_show (lblNCZ); - gtk_container_add (GTK_CONTAINER (evNCZ), lblNCZ); - - table8 = gtk_table_new (6, 3, FALSE); - gtk_widget_set_name (table8, "table8"); - gtk_widget_show (table8); - gtk_box_pack_start (GTK_BOX (hbox12), table8, FALSE, TRUE, 0); - gtk_table_set_row_spacings (GTK_TABLE (table8), 3); - - lblNCAccX = gtk_label_new ("X:"); - gtk_widget_set_name (lblNCAccX, "lblNCAccX"); - gtk_widget_show (lblNCAccX); - gtk_table_attach (GTK_TABLE (table8), lblNCAccX, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCAccX, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccX), 0, 0.5); - - lblNCAccY = gtk_label_new ("Y:"); - gtk_widget_set_name (lblNCAccY, "lblNCAccY"); - gtk_widget_show (lblNCAccY); - gtk_table_attach (GTK_TABLE (table8), lblNCAccY, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCAccY, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccY), 0, 0.5); - - lblNCAccZ = gtk_label_new ("Z:"); - gtk_widget_set_name (lblNCAccZ, "lblNCAccZ"); - gtk_widget_show (lblNCAccZ); - gtk_table_attach (GTK_TABLE (table8), lblNCAccZ, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCAccZ, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccZ), 0, 0.5); - - lblNCAcc = gtk_label_new ("Acc:"); - gtk_widget_set_name (lblNCAcc, "lblNCAcc"); - gtk_widget_show (lblNCAcc); - gtk_table_attach (GTK_TABLE (table8), lblNCAcc, 0, 1, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCAcc, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAcc), 0, 0.5); - - lblNCRoll = gtk_label_new ("Roll:"); - gtk_widget_set_name (lblNCRoll, "lblNCRoll"); - gtk_widget_show (lblNCRoll); - gtk_table_attach (GTK_TABLE (table8), lblNCRoll, 0, 1, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCRoll, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCRoll), 0, 0.5); - - lblNCPitch = gtk_label_new ("Pitch:"); - gtk_widget_set_name (lblNCPitch, "lblNCPitch"); - gtk_widget_show (lblNCPitch); - gtk_table_attach (GTK_TABLE (table8), lblNCPitch, 0, 1, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (lblNCPitch, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCPitch), 0, 0.5); - - lblNCAccXVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCAccXVal, "lblNCAccXVal"); - gtk_widget_show (lblNCAccXVal); - gtk_table_attach (GTK_TABLE (table8), lblNCAccXVal, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCAccXVal, 35, -1); - gtk_widget_set_sensitive (lblNCAccXVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccXVal), 0, 0.5); - - lblNCAccYVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCAccYVal, "lblNCAccYVal"); - gtk_widget_show (lblNCAccYVal); - gtk_table_attach (GTK_TABLE (table8), lblNCAccYVal, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCAccYVal, 35, -1); - gtk_widget_set_sensitive (lblNCAccYVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccYVal), 0, 0.5); - - lblNCAccZVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCAccZVal, "lblNCAccZVal"); - gtk_widget_show (lblNCAccZVal); - gtk_table_attach (GTK_TABLE (table8), lblNCAccZVal, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCAccZVal, 35, -1); - gtk_widget_set_sensitive (lblNCAccZVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccZVal), 0, 0.5); - - lblNCAccVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCAccVal, "lblNCAccVal"); - gtk_widget_show (lblNCAccVal); - gtk_table_attach (GTK_TABLE (table8), lblNCAccVal, 1, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCAccVal, 35, -1); - gtk_widget_set_sensitive (lblNCAccVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCAccVal), 0, 0.5); - - lblNCRollVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCRollVal, "lblNCRollVal"); - gtk_widget_show (lblNCRollVal); - gtk_table_attach (GTK_TABLE (table8), lblNCRollVal, 1, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCRollVal, 35, -1); - gtk_widget_set_sensitive (lblNCRollVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCRollVal), 0, 0.5); - - lblNCPitchVal = gtk_label_new ("0"); - gtk_widget_set_name (lblNCPitchVal, "lblNCPitchVal"); - gtk_widget_show (lblNCPitchVal); - gtk_table_attach (GTK_TABLE (table8), lblNCPitchVal, 1, 2, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblNCPitchVal, 35, -1); - gtk_widget_set_sensitive (lblNCPitchVal, FALSE); - gtk_misc_set_alignment (GTK_MISC (lblNCPitchVal), 0, 0.5); - - progNCAccX = gtk_progress_bar_new (); - gtk_widget_set_name (progNCAccX, "progNCAccX"); - gtk_widget_show (progNCAccX); - gtk_table_attach (GTK_TABLE (table8), progNCAccX, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progNCAccX, FALSE); - - progNCAccZ = gtk_progress_bar_new (); - gtk_widget_set_name (progNCAccZ, "progNCAccZ"); - gtk_widget_show (progNCAccZ); - gtk_table_attach (GTK_TABLE (table8), progNCAccZ, 2, 3, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progNCAccZ, FALSE); - - progNCAccY = gtk_progress_bar_new (); - gtk_widget_set_name (progNCAccY, "progNCAccY"); - gtk_widget_show (progNCAccY); - gtk_table_attach (GTK_TABLE (table8), progNCAccY, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_sensitive (progNCAccY, FALSE); - - lblNC = gtk_label_new ("<b>Nunchuk</b>"); - gtk_widget_set_name (lblNC, "lblNC"); - gtk_widget_show (lblNC); - gtk_frame_set_label_widget (GTK_FRAME (frame4), lblNC); - gtk_label_set_use_markup (GTK_LABEL (lblNC), TRUE); - - frame5 = gtk_frame_new (NULL); - gtk_widget_set_name (frame5, "frame5"); - gtk_widget_show (frame5); - gtk_box_pack_start (GTK_BOX (hbox10), frame5, TRUE, TRUE, 3); - - alignment29 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment29, "alignment29"); - gtk_widget_show (alignment29); - gtk_container_add (GTK_CONTAINER (frame5), alignment29); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment29), 0, 0, 12, 0); - - vbox5 = gtk_vbox_new (FALSE, 5); - gtk_widget_set_name (vbox5, "vbox5"); - gtk_widget_show (vbox5); - gtk_container_add (GTK_CONTAINER (alignment29), vbox5); - - table9 = gtk_table_new (3, 9, TRUE); - gtk_widget_set_name (table9, "table9"); - gtk_widget_show (table9); - gtk_box_pack_start (GTK_BOX (vbox5), table9, TRUE, TRUE, 0); - - alignment15 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment15, "alignment15"); - gtk_widget_show (alignment15); - gtk_table_attach (GTK_TABLE (table9), alignment15, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evCCLeft = gtk_event_box_new (); - gtk_widget_set_name (evCCLeft, "evCCLeft"); - gtk_widget_show (evCCLeft); - gtk_container_add (GTK_CONTAINER (alignment15), evCCLeft); - - lblCCLeft = gtk_label_new ("Left"); - gtk_widget_set_name (lblCCLeft, "lblCCLeft"); - gtk_widget_show (lblCCLeft); - gtk_container_add (GTK_CONTAINER (evCCLeft), lblCCLeft); - - alignment16 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment16, "alignment16"); - gtk_widget_show (alignment16); - gtk_table_attach (GTK_TABLE (table9), alignment16, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evCCUp = gtk_event_box_new (); - gtk_widget_set_name (evCCUp, "evCCUp"); - gtk_widget_show (evCCUp); - gtk_container_add (GTK_CONTAINER (alignment16), evCCUp); - - lblCCUp = gtk_label_new ("Up"); - gtk_widget_set_name (lblCCUp, "lblCCUp"); - gtk_widget_show (lblCCUp); - gtk_container_add (GTK_CONTAINER (evCCUp), lblCCUp); - - alignment17 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment17, "alignment17"); - gtk_widget_show (alignment17); - gtk_table_attach (GTK_TABLE (table9), alignment17, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); - - evCCDown = gtk_event_box_new (); - gtk_widget_set_name (evCCDown, "evCCDown"); - gtk_widget_show (evCCDown); - gtk_container_add (GTK_CONTAINER (alignment17), evCCDown); - - lblCCDown = gtk_label_new ("Down"); - gtk_widget_set_name (lblCCDown, "lblCCDown"); - gtk_widget_show (lblCCDown); - gtk_container_add (GTK_CONTAINER (evCCDown), lblCCDown); - - alignment18 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment18, "alignment18"); - gtk_widget_show (alignment18); - gtk_table_attach (GTK_TABLE (table9), alignment18, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCRight = gtk_event_box_new (); - gtk_widget_set_name (evCCRight, "evCCRight"); - gtk_widget_show (evCCRight); - gtk_container_add (GTK_CONTAINER (alignment18), evCCRight); - - lblCCRight = gtk_label_new ("Right"); - gtk_widget_set_name (lblCCRight, "lblCCRight"); - gtk_widget_show (lblCCRight); - gtk_container_add (GTK_CONTAINER (evCCRight), lblCCRight); - - alignment19 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment19, "alignment19"); - gtk_widget_show (alignment19); - gtk_table_attach (GTK_TABLE (table9), alignment19, 3, 4, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCMinus = gtk_event_box_new (); - gtk_widget_set_name (evCCMinus, "evCCMinus"); - gtk_widget_show (evCCMinus); - gtk_container_add (GTK_CONTAINER (alignment19), evCCMinus); - - lblCCMinus = gtk_label_new ("-"); - gtk_widget_set_name (lblCCMinus, "lblCCMinus"); - gtk_widget_show (lblCCMinus); - gtk_container_add (GTK_CONTAINER (evCCMinus), lblCCMinus); - - alignment20 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment20, "alignment20"); - gtk_widget_show (alignment20); - gtk_table_attach (GTK_TABLE (table9), alignment20, 4, 5, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCHome = gtk_event_box_new (); - gtk_widget_set_name (evCCHome, "evCCHome"); - gtk_widget_show (evCCHome); - gtk_container_add (GTK_CONTAINER (alignment20), evCCHome); - - lblCCHome = gtk_label_new ("Home"); - gtk_widget_set_name (lblCCHome, "lblCCHome"); - gtk_widget_show (lblCCHome); - gtk_container_add (GTK_CONTAINER (evCCHome), lblCCHome); - - alignment21 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment21, "alignment21"); - gtk_widget_show (alignment21); - gtk_table_attach (GTK_TABLE (table9), alignment21, 5, 6, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCPlus = gtk_event_box_new (); - gtk_widget_set_name (evCCPlus, "evCCPlus"); - gtk_widget_show (evCCPlus); - gtk_container_add (GTK_CONTAINER (alignment21), evCCPlus); - - lblCCPlus = gtk_label_new ("+"); - gtk_widget_set_name (lblCCPlus, "lblCCPlus"); - gtk_widget_show (lblCCPlus); - gtk_container_add (GTK_CONTAINER (evCCPlus), lblCCPlus); - - alignment22 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment22, "alignment22"); - gtk_widget_show (alignment22); - gtk_table_attach (GTK_TABLE (table9), alignment22, 3, 4, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCZL = gtk_event_box_new (); - gtk_widget_set_name (evCCZL, "evCCZL"); - gtk_widget_show (evCCZL); - gtk_container_add (GTK_CONTAINER (alignment22), evCCZL); - - lblCCZL = gtk_label_new ("ZL"); - gtk_widget_set_name (lblCCZL, "lblCCZL"); - gtk_widget_show (lblCCZL); - gtk_container_add (GTK_CONTAINER (evCCZL), lblCCZL); - - alignment23 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment23, "alignment23"); - gtk_widget_show (alignment23); - gtk_table_attach (GTK_TABLE (table9), alignment23, 5, 6, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCZR = gtk_event_box_new (); - gtk_widget_set_name (evCCZR, "evCCZR"); - gtk_widget_show (evCCZR); - gtk_container_add (GTK_CONTAINER (alignment23), evCCZR); - - lblCCZR = gtk_label_new ("ZR"); - gtk_widget_set_name (lblCCZR, "lblCCZR"); - gtk_widget_show (lblCCZR); - gtk_container_add (GTK_CONTAINER (evCCZR), lblCCZR); - - alignment24 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment24, "alignment24"); - gtk_widget_show (alignment24); - gtk_table_attach (GTK_TABLE (table9), alignment24, 7, 8, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCX = gtk_event_box_new (); - gtk_widget_set_name (evCCX, "evCCX"); - gtk_widget_show (evCCX); - gtk_container_add (GTK_CONTAINER (alignment24), evCCX); - - lblCCX = gtk_label_new ("X"); - gtk_widget_set_name (lblCCX, "lblCCX"); - gtk_widget_show (lblCCX); - gtk_container_add (GTK_CONTAINER (evCCX), lblCCX); - - alignment25 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment25, "alignment25"); - gtk_widget_show (alignment25); - gtk_table_attach (GTK_TABLE (table9), alignment25, 6, 7, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCY = gtk_event_box_new (); - gtk_widget_set_name (evCCY, "evCCY"); - gtk_widget_show (evCCY); - gtk_container_add (GTK_CONTAINER (alignment25), evCCY); - - lblCCY = gtk_label_new ("Y"); - gtk_widget_set_name (lblCCY, "lblCCY"); - gtk_widget_show (lblCCY); - gtk_container_add (GTK_CONTAINER (evCCY), lblCCY); - - alignment26 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment26, "alignment26"); - gtk_widget_show (alignment26); - gtk_table_attach (GTK_TABLE (table9), alignment26, 7, 8, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCB = gtk_event_box_new (); - gtk_widget_set_name (evCCB, "evCCB"); - gtk_widget_show (evCCB); - gtk_container_add (GTK_CONTAINER (alignment26), evCCB); - - lblCCB = gtk_label_new ("B"); - gtk_widget_set_name (lblCCB, "lblCCB"); - gtk_widget_show (lblCCB); - gtk_container_add (GTK_CONTAINER (evCCB), lblCCB); - - alignment27 = gtk_alignment_new (0.5, 0.5, 1, 1); - gtk_widget_set_name (alignment27, "alignment27"); - gtk_widget_show (alignment27); - gtk_table_attach (GTK_TABLE (table9), alignment27, 8, 9, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - evCCA = gtk_event_box_new (); - gtk_widget_set_name (evCCA, "evCCA"); - gtk_widget_show (evCCA); - gtk_container_add (GTK_CONTAINER (alignment27), evCCA); - - lblCCA = gtk_label_new ("A"); - gtk_widget_set_name (lblCCA, "lblCCA"); - gtk_widget_show (lblCCA); - gtk_container_add (GTK_CONTAINER (evCCA), lblCCA); - - hbox15 = gtk_hbox_new (FALSE, 5); - gtk_widget_set_name (hbox15, "hbox15"); - gtk_widget_show (hbox15); - gtk_box_pack_start (GTK_BOX (vbox5), hbox15, TRUE, TRUE, 0); - - drawCCLStick = gtk_drawing_area_new (); - gtk_widget_set_name (drawCCLStick, "drawCCLStick"); - gtk_widget_show (drawCCLStick); - gtk_box_pack_start (GTK_BOX (hbox15), drawCCLStick, TRUE, TRUE, 0); - gtk_widget_set_size_request (drawCCLStick, 50, 50); - - drawCCRStick = gtk_drawing_area_new (); - gtk_widget_set_name (drawCCRStick, "drawCCRStick"); - gtk_widget_show (drawCCRStick); - gtk_box_pack_start (GTK_BOX (hbox15), drawCCRStick, TRUE, TRUE, 0); - gtk_widget_set_size_request (drawCCRStick, 50, 50); - - table10 = gtk_table_new (2, 3, FALSE); - gtk_widget_set_name (table10, "table10"); - gtk_widget_show (table10); - gtk_box_pack_start (GTK_BOX (hbox15), table10, TRUE, TRUE, 0); - - lblCCLVal = gtk_label_new ("0"); - gtk_widget_set_name (lblCCLVal, "lblCCLVal"); - gtk_widget_show (lblCCLVal); - gtk_table_attach (GTK_TABLE (table10), lblCCLVal, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblCCLVal, 35, -1); - gtk_misc_set_alignment (GTK_MISC (lblCCLVal), 0, 0.5); - - lblCCRVal = gtk_label_new ("0"); - gtk_widget_set_name (lblCCRVal, "lblCCRVal"); - gtk_widget_show (lblCCRVal); - gtk_table_attach (GTK_TABLE (table10), lblCCRVal, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_widget_set_size_request (lblCCRVal, 35, -1); - gtk_misc_set_alignment (GTK_MISC (lblCCRVal), 0, 0.5); - - progCCL = gtk_progress_bar_new (); - gtk_widget_set_name (progCCL, "progCCL"); - gtk_widget_show (progCCL); - gtk_table_attach (GTK_TABLE (table10), progCCL, 2, 3, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - progCCR = gtk_progress_bar_new (); - gtk_widget_set_name (progCCR, "progCCR"); - gtk_widget_show (progCCR); - gtk_table_attach (GTK_TABLE (table10), progCCR, 2, 3, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - evCCR = gtk_event_box_new (); - gtk_widget_set_name (evCCR, "evCCR"); - gtk_widget_show (evCCR); - gtk_table_attach (GTK_TABLE (table10), evCCR, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - lblCCR = gtk_label_new ("R:"); - gtk_widget_set_name (lblCCR, "lblCCR"); - gtk_widget_show (lblCCR); - gtk_container_add (GTK_CONTAINER (evCCR), lblCCR); - gtk_misc_set_alignment (GTK_MISC (lblCCR), 0, 0.5); - - evCCL = gtk_event_box_new (); - gtk_widget_set_name (evCCL, "evCCL"); - gtk_widget_show (evCCL); - gtk_table_attach (GTK_TABLE (table10), evCCL, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - lblCCL = gtk_label_new ("L:"); - gtk_widget_set_name (lblCCL, "lblCCL"); - gtk_widget_show (lblCCL); - gtk_container_add (GTK_CONTAINER (evCCL), lblCCL); - gtk_misc_set_alignment (GTK_MISC (lblCCL), 0, 0.5); - - lblClassic = gtk_label_new ("<b>Classic Controller</b>"); - gtk_widget_set_name (lblClassic, "lblClassic"); - gtk_widget_show (lblClassic); - gtk_frame_set_label_widget (GTK_FRAME (frame5), lblClassic); - gtk_label_set_use_markup (GTK_LABEL (lblClassic), TRUE); - - hbox11 = gtk_hbox_new (TRUE, 0); - gtk_widget_set_name (hbox11, "hbox11"); - gtk_widget_show (hbox11); - gtk_box_pack_start (GTK_BOX (vbox1), hbox11, FALSE, FALSE, 0); - - statConnection = gtk_statusbar_new (); - gtk_widget_set_name (statConnection, "statConnection"); - gtk_widget_show (statConnection); - gtk_box_pack_start (GTK_BOX (hbox11), statConnection, TRUE, TRUE, 0); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statConnection), FALSE); - - statBattery = gtk_statusbar_new (); - gtk_widget_set_name (statBattery, "statBattery"); - gtk_widget_show (statBattery); - gtk_box_pack_start (GTK_BOX (hbox11), statBattery, FALSE, TRUE, 0); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statBattery), FALSE); - - statExtension = gtk_statusbar_new (); - gtk_widget_set_name (statExtension, "statExtension"); - gtk_widget_show (statExtension); - gtk_box_pack_start (GTK_BOX (hbox11), statExtension, FALSE, TRUE, 0); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statExtension), FALSE); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (winMain, winMain, "winMain"); - GLADE_HOOKUP_OBJECT (winMain, vbox1, "vbox1"); - GLADE_HOOKUP_OBJECT (winMain, menubar1, "menubar1"); - GLADE_HOOKUP_OBJECT (winMain, menuitem1, "menuitem1"); - GLADE_HOOKUP_OBJECT (winMain, menuitem1_menu, "menuitem1_menu"); - GLADE_HOOKUP_OBJECT (winMain, menuConnect, "menuConnect"); - GLADE_HOOKUP_OBJECT (winMain, image27, "image27"); - GLADE_HOOKUP_OBJECT (winMain, menuDisconnect, "menuDisconnect"); - GLADE_HOOKUP_OBJECT (winMain, image28, "image28"); - GLADE_HOOKUP_OBJECT (winMain, separatormenuitem1, "separatormenuitem1"); - GLADE_HOOKUP_OBJECT (winMain, menuQuit, "menuQuit"); - GLADE_HOOKUP_OBJECT (winMain, image29, "image29"); - GLADE_HOOKUP_OBJECT (winMain, menuSettings, "menuSettings"); - GLADE_HOOKUP_OBJECT (winMain, menuSettings_menu, "menuSettings_menu"); - GLADE_HOOKUP_OBJECT (winMain, chkAcc, "chkAcc"); - GLADE_HOOKUP_OBJECT (winMain, chkIR, "chkIR"); - GLADE_HOOKUP_OBJECT (winMain, chkExt, "chkExt"); - GLADE_HOOKUP_OBJECT (winMain, menuControls, "menuControls"); - GLADE_HOOKUP_OBJECT (winMain, menuControls_menu, "menuControls_menu"); - GLADE_HOOKUP_OBJECT (winMain, chkLED1, "chkLED1"); - GLADE_HOOKUP_OBJECT (winMain, chkLED2, "chkLED2"); - GLADE_HOOKUP_OBJECT (winMain, chkLED3, "chkLED3"); - GLADE_HOOKUP_OBJECT (winMain, chkLED4, "chkLED4"); - GLADE_HOOKUP_OBJECT (winMain, separator1, "separator1"); - GLADE_HOOKUP_OBJECT (winMain, chkRumble, "chkRumble"); - GLADE_HOOKUP_OBJECT (winMain, menuView, "menuView"); - GLADE_HOOKUP_OBJECT (winMain, menuView_menu, "menuView_menu"); - GLADE_HOOKUP_OBJECT (winMain, menuRW, "menuRW"); - GLADE_HOOKUP_OBJECT (winMain, menuHelp, "menuHelp"); - GLADE_HOOKUP_OBJECT (winMain, menuHelp_menu, "menuHelp_menu"); - GLADE_HOOKUP_OBJECT (winMain, menuAbout, "menuAbout"); - GLADE_HOOKUP_OBJECT (winMain, hbox1, "hbox1"); - GLADE_HOOKUP_OBJECT (winMain, frame1, "frame1"); - GLADE_HOOKUP_OBJECT (winMain, alignment1, "alignment1"); - GLADE_HOOKUP_OBJECT (winMain, table1, "table1"); - GLADE_HOOKUP_OBJECT (winMain, alignment3, "alignment3"); - GLADE_HOOKUP_OBJECT (winMain, evUp, "evUp"); - GLADE_HOOKUP_OBJECT (winMain, lblUp, "lblUp"); - GLADE_HOOKUP_OBJECT (winMain, alignment4, "alignment4"); - GLADE_HOOKUP_OBJECT (winMain, evLeft, "evLeft"); - GLADE_HOOKUP_OBJECT (winMain, lblLeft, "lblLeft"); - GLADE_HOOKUP_OBJECT (winMain, alignment5, "alignment5"); - GLADE_HOOKUP_OBJECT (winMain, evRight, "evRight"); - GLADE_HOOKUP_OBJECT (winMain, lblRight, "lblRight"); - GLADE_HOOKUP_OBJECT (winMain, alignment6, "alignment6"); - GLADE_HOOKUP_OBJECT (winMain, evDown, "evDown"); - GLADE_HOOKUP_OBJECT (winMain, lblDown, "lblDown"); - GLADE_HOOKUP_OBJECT (winMain, alignment7, "alignment7"); - GLADE_HOOKUP_OBJECT (winMain, evA, "evA"); - GLADE_HOOKUP_OBJECT (winMain, lblA, "lblA"); - GLADE_HOOKUP_OBJECT (winMain, alignment9, "alignment9"); - GLADE_HOOKUP_OBJECT (winMain, evB, "evB"); - GLADE_HOOKUP_OBJECT (winMain, lblB, "lblB"); - GLADE_HOOKUP_OBJECT (winMain, alignment10, "alignment10"); - GLADE_HOOKUP_OBJECT (winMain, evMinus, "evMinus"); - GLADE_HOOKUP_OBJECT (winMain, lblMinus, "lblMinus"); - GLADE_HOOKUP_OBJECT (winMain, alignment11, "alignment11"); - GLADE_HOOKUP_OBJECT (winMain, evHome, "evHome"); - GLADE_HOOKUP_OBJECT (winMain, lblHome, "lblHome"); - GLADE_HOOKUP_OBJECT (winMain, alignment12, "alignment12"); - GLADE_HOOKUP_OBJECT (winMain, evPlus, "evPlus"); - GLADE_HOOKUP_OBJECT (winMain, lblPlus, "lblPlus"); - GLADE_HOOKUP_OBJECT (winMain, alignment13, "alignment13"); - GLADE_HOOKUP_OBJECT (winMain, ev1, "ev1"); - GLADE_HOOKUP_OBJECT (winMain, lbl1, "lbl1"); - GLADE_HOOKUP_OBJECT (winMain, alignment14, "alignment14"); - GLADE_HOOKUP_OBJECT (winMain, ev2, "ev2"); - GLADE_HOOKUP_OBJECT (winMain, lbl2, "lbl2"); - GLADE_HOOKUP_OBJECT (winMain, label1, "label1"); - GLADE_HOOKUP_OBJECT (winMain, frame2, "frame2"); - GLADE_HOOKUP_OBJECT (winMain, alignment2, "alignment2"); - GLADE_HOOKUP_OBJECT (winMain, hbox2, "hbox2"); - GLADE_HOOKUP_OBJECT (winMain, table4, "table4"); - GLADE_HOOKUP_OBJECT (winMain, progAccX, "progAccX"); - GLADE_HOOKUP_OBJECT (winMain, progAccY, "progAccY"); - GLADE_HOOKUP_OBJECT (winMain, progAccZ, "progAccZ"); - GLADE_HOOKUP_OBJECT (winMain, lblAccX, "lblAccX"); - GLADE_HOOKUP_OBJECT (winMain, lblAccXVal, "lblAccXVal"); - GLADE_HOOKUP_OBJECT (winMain, lblAccY, "lblAccY"); - GLADE_HOOKUP_OBJECT (winMain, lblAccYVal, "lblAccYVal"); - GLADE_HOOKUP_OBJECT (winMain, lblAccZ, "lblAccZ"); - GLADE_HOOKUP_OBJECT (winMain, lblAccZVal, "lblAccZVal"); - GLADE_HOOKUP_OBJECT (winMain, lblPitch, "lblPitch"); - GLADE_HOOKUP_OBJECT (winMain, lblPitchVal, "lblPitchVal"); - GLADE_HOOKUP_OBJECT (winMain, lblRoll, "lblRoll"); - GLADE_HOOKUP_OBJECT (winMain, lblRollVal, "lblRollVal"); - GLADE_HOOKUP_OBJECT (winMain, lblAcc, "lblAcc"); - GLADE_HOOKUP_OBJECT (winMain, lblAccVal, "lblAccVal"); - GLADE_HOOKUP_OBJECT (winMain, btnBeep, "btnBeep"); - GLADE_HOOKUP_OBJECT (winMain, frame3, "frame3"); - GLADE_HOOKUP_OBJECT (winMain, drawIR, "drawIR"); - GLADE_HOOKUP_OBJECT (winMain, lblIR, "lblIR"); - GLADE_HOOKUP_OBJECT (winMain, label2, "label2"); - GLADE_HOOKUP_OBJECT (winMain, hbox10, "hbox10"); - GLADE_HOOKUP_OBJECT (winMain, frame4, "frame4"); - GLADE_HOOKUP_OBJECT (winMain, alignment28, "alignment28"); - GLADE_HOOKUP_OBJECT (winMain, hbox12, "hbox12"); - GLADE_HOOKUP_OBJECT (winMain, vbox4, "vbox4"); - GLADE_HOOKUP_OBJECT (winMain, drawNCStick, "drawNCStick"); - GLADE_HOOKUP_OBJECT (winMain, hbox13, "hbox13"); - GLADE_HOOKUP_OBJECT (winMain, evNCC, "evNCC"); - GLADE_HOOKUP_OBJECT (winMain, lblNCC, "lblNCC"); - GLADE_HOOKUP_OBJECT (winMain, evNCZ, "evNCZ"); - GLADE_HOOKUP_OBJECT (winMain, lblNCZ, "lblNCZ"); - GLADE_HOOKUP_OBJECT (winMain, table8, "table8"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccX, "lblNCAccX"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccY, "lblNCAccY"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccZ, "lblNCAccZ"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAcc, "lblNCAcc"); - GLADE_HOOKUP_OBJECT (winMain, lblNCRoll, "lblNCRoll"); - GLADE_HOOKUP_OBJECT (winMain, lblNCPitch, "lblNCPitch"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccXVal, "lblNCAccXVal"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccYVal, "lblNCAccYVal"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccZVal, "lblNCAccZVal"); - GLADE_HOOKUP_OBJECT (winMain, lblNCAccVal, "lblNCAccVal"); - GLADE_HOOKUP_OBJECT (winMain, lblNCRollVal, "lblNCRollVal"); - GLADE_HOOKUP_OBJECT (winMain, lblNCPitchVal, "lblNCPitchVal"); - GLADE_HOOKUP_OBJECT (winMain, progNCAccX, "progNCAccX"); - GLADE_HOOKUP_OBJECT (winMain, progNCAccZ, "progNCAccZ"); - GLADE_HOOKUP_OBJECT (winMain, progNCAccY, "progNCAccY"); - GLADE_HOOKUP_OBJECT (winMain, lblNC, "lblNC"); - GLADE_HOOKUP_OBJECT (winMain, frame5, "frame5"); - GLADE_HOOKUP_OBJECT (winMain, alignment29, "alignment29"); - GLADE_HOOKUP_OBJECT (winMain, vbox5, "vbox5"); - GLADE_HOOKUP_OBJECT (winMain, table9, "table9"); - GLADE_HOOKUP_OBJECT (winMain, alignment15, "alignment15"); - GLADE_HOOKUP_OBJECT (winMain, evCCLeft, "evCCLeft"); - GLADE_HOOKUP_OBJECT (winMain, lblCCLeft, "lblCCLeft"); - GLADE_HOOKUP_OBJECT (winMain, alignment16, "alignment16"); - GLADE_HOOKUP_OBJECT (winMain, evCCUp, "evCCUp"); - GLADE_HOOKUP_OBJECT (winMain, lblCCUp, "lblCCUp"); - GLADE_HOOKUP_OBJECT (winMain, alignment17, "alignment17"); - GLADE_HOOKUP_OBJECT (winMain, evCCDown, "evCCDown"); - GLADE_HOOKUP_OBJECT (winMain, lblCCDown, "lblCCDown"); - GLADE_HOOKUP_OBJECT (winMain, alignment18, "alignment18"); - GLADE_HOOKUP_OBJECT (winMain, evCCRight, "evCCRight"); - GLADE_HOOKUP_OBJECT (winMain, lblCCRight, "lblCCRight"); - GLADE_HOOKUP_OBJECT (winMain, alignment19, "alignment19"); - GLADE_HOOKUP_OBJECT (winMain, evCCMinus, "evCCMinus"); - GLADE_HOOKUP_OBJECT (winMain, lblCCMinus, "lblCCMinus"); - GLADE_HOOKUP_OBJECT (winMain, alignment20, "alignment20"); - GLADE_HOOKUP_OBJECT (winMain, evCCHome, "evCCHome"); - GLADE_HOOKUP_OBJECT (winMain, lblCCHome, "lblCCHome"); - GLADE_HOOKUP_OBJECT (winMain, alignment21, "alignment21"); - GLADE_HOOKUP_OBJECT (winMain, evCCPlus, "evCCPlus"); - GLADE_HOOKUP_OBJECT (winMain, lblCCPlus, "lblCCPlus"); - GLADE_HOOKUP_OBJECT (winMain, alignment22, "alignment22"); - GLADE_HOOKUP_OBJECT (winMain, evCCZL, "evCCZL"); - GLADE_HOOKUP_OBJECT (winMain, lblCCZL, "lblCCZL"); - GLADE_HOOKUP_OBJECT (winMain, alignment23, "alignment23"); - GLADE_HOOKUP_OBJECT (winMain, evCCZR, "evCCZR"); - GLADE_HOOKUP_OBJECT (winMain, lblCCZR, "lblCCZR"); - GLADE_HOOKUP_OBJECT (winMain, alignment24, "alignment24"); - GLADE_HOOKUP_OBJECT (winMain, evCCX, "evCCX"); - GLADE_HOOKUP_OBJECT (winMain, lblCCX, "lblCCX"); - GLADE_HOOKUP_OBJECT (winMain, alignment25, "alignment25"); - GLADE_HOOKUP_OBJECT (winMain, evCCY, "evCCY"); - GLADE_HOOKUP_OBJECT (winMain, lblCCY, "lblCCY"); - GLADE_HOOKUP_OBJECT (winMain, alignment26, "alignment26"); - GLADE_HOOKUP_OBJECT (winMain, evCCB, "evCCB"); - GLADE_HOOKUP_OBJECT (winMain, lblCCB, "lblCCB"); - GLADE_HOOKUP_OBJECT (winMain, alignment27, "alignment27"); - GLADE_HOOKUP_OBJECT (winMain, evCCA, "evCCA"); - GLADE_HOOKUP_OBJECT (winMain, lblCCA, "lblCCA"); - GLADE_HOOKUP_OBJECT (winMain, hbox15, "hbox15"); - GLADE_HOOKUP_OBJECT (winMain, drawCCLStick, "drawCCLStick"); - GLADE_HOOKUP_OBJECT (winMain, drawCCRStick, "drawCCRStick"); - GLADE_HOOKUP_OBJECT (winMain, table10, "table10"); - GLADE_HOOKUP_OBJECT (winMain, lblCCLVal, "lblCCLVal"); - GLADE_HOOKUP_OBJECT (winMain, lblCCRVal, "lblCCRVal"); - GLADE_HOOKUP_OBJECT (winMain, progCCL, "progCCL"); - GLADE_HOOKUP_OBJECT (winMain, progCCR, "progCCR"); - GLADE_HOOKUP_OBJECT (winMain, evCCR, "evCCR"); - GLADE_HOOKUP_OBJECT (winMain, lblCCR, "lblCCR"); - GLADE_HOOKUP_OBJECT (winMain, evCCL, "evCCL"); - GLADE_HOOKUP_OBJECT (winMain, lblCCL, "lblCCL"); - GLADE_HOOKUP_OBJECT (winMain, lblClassic, "lblClassic"); - GLADE_HOOKUP_OBJECT (winMain, hbox11, "hbox11"); - GLADE_HOOKUP_OBJECT (winMain, statConnection, "statConnection"); - GLADE_HOOKUP_OBJECT (winMain, statBattery, "statBattery"); - GLADE_HOOKUP_OBJECT (winMain, statExtension, "statExtension"); - - gtk_window_add_accel_group (GTK_WINDOW (winMain), accel_group); - - return winMain; -} - -GtkWidget* -create_winRW (void) -{ - GtkWidget *winRW; - GtkWidget *vbox3; - GtkWidget *label25; - GtkWidget *hbox3; - GtkWidget *table6; - GtkWidget *label29; - GtkWidget *label30; - GtkWidget *txtReadOffset; - GtkWidget *txtReadLen; - GtkWidget *radReadEEPROM; - GSList *radReadEEPROM_group = NULL; - GtkWidget *radReadReg; - GtkWidget *hbox7; - GtkWidget *btnRead; - GtkWidget *hbox4; - GtkWidget *label31; - GtkWidget *table7; - GtkWidget *label33; - GtkWidget *label34; - GtkWidget *txtWriteOffset; - GtkWidget *txtWriteData; - GtkWidget *radWriteEEPROM; - GSList *radWriteEEPROM_group = NULL; - GtkWidget *radWriteReg; - GtkWidget *hbox8; - GtkWidget *btnWrite; - GtkWidget *hbox6; - GtkWidget *label32; - GtkWidget *scrolledwindow1; - GtkWidget *tvRW; - GtkWidget *hbox9; - GtkWidget *btnRWClose; - - winRW = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (winRW, "winRW"); - gtk_window_set_title (GTK_WINDOW (winRW), "Memory Read/Write"); - - vbox3 = gtk_vbox_new (FALSE, 4); - gtk_widget_set_name (vbox3, "vbox3"); - gtk_widget_show (vbox3); - gtk_container_add (GTK_CONTAINER (winRW), vbox3); - gtk_container_set_border_width (GTK_CONTAINER (vbox3), 5); - - label25 = gtk_label_new ("Note: all values are in hex"); - gtk_widget_set_name (label25, "label25"); - gtk_widget_show (label25); - gtk_box_pack_start (GTK_BOX (vbox3), label25, FALSE, FALSE, 0); - - hbox3 = gtk_hbox_new (FALSE, 5); - gtk_widget_set_name (hbox3, "hbox3"); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox3), hbox3, FALSE, TRUE, 0); - - table6 = gtk_table_new (6, 2, FALSE); - gtk_widget_set_name (table6, "table6"); - gtk_widget_show (table6); - gtk_box_pack_start (GTK_BOX (hbox3), table6, TRUE, TRUE, 0); - gtk_table_set_row_spacings (GTK_TABLE (table6), 2); - - label29 = gtk_label_new ("Offset:"); - gtk_widget_set_name (label29, "label29"); - gtk_widget_show (label29); - gtk_table_attach (GTK_TABLE (table6), label29, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label29), 0, 0.5); - - label30 = gtk_label_new ("Length:"); - gtk_widget_set_name (label30, "label30"); - gtk_widget_show (label30); - gtk_table_attach (GTK_TABLE (table6), label30, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label30), 0, 0.5); - - txtReadOffset = gtk_entry_new (); - gtk_widget_set_name (txtReadOffset, "txtReadOffset"); - gtk_widget_show (txtReadOffset); - gtk_table_attach (GTK_TABLE (table6), txtReadOffset, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - txtReadLen = gtk_entry_new (); - gtk_widget_set_name (txtReadLen, "txtReadLen"); - gtk_widget_show (txtReadLen); - gtk_table_attach (GTK_TABLE (table6), txtReadLen, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - radReadEEPROM = gtk_radio_button_new_with_mnemonic (NULL, "EEPROM"); - gtk_widget_set_name (radReadEEPROM, "radReadEEPROM"); - gtk_widget_show (radReadEEPROM); - gtk_table_attach (GTK_TABLE (table6), radReadEEPROM, 0, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radReadEEPROM), radReadEEPROM_group); - radReadEEPROM_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radReadEEPROM)); - - radReadReg = gtk_radio_button_new_with_mnemonic (NULL, "Register"); - gtk_widget_set_name (radReadReg, "radReadReg"); - gtk_widget_show (radReadReg); - gtk_table_attach (GTK_TABLE (table6), radReadReg, 0, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radReadReg), radReadEEPROM_group); - radReadEEPROM_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radReadReg)); - - hbox7 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox7, "hbox7"); - gtk_widget_show (hbox7); - gtk_table_attach (GTK_TABLE (table6), hbox7, 0, 2, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - btnRead = gtk_button_new_with_mnemonic ("Read"); - gtk_widget_set_name (btnRead, "btnRead"); - gtk_widget_show (btnRead); - gtk_box_pack_start (GTK_BOX (hbox7), btnRead, TRUE, FALSE, 0); - - hbox4 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox4, "hbox4"); - gtk_widget_show (hbox4); - gtk_table_attach (GTK_TABLE (table6), hbox4, 0, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - label31 = gtk_label_new ("Read"); - gtk_widget_set_name (label31, "label31"); - gtk_widget_show (label31); - gtk_box_pack_start (GTK_BOX (hbox4), label31, TRUE, FALSE, 0); - - table7 = gtk_table_new (6, 2, FALSE); - gtk_widget_set_name (table7, "table7"); - gtk_widget_show (table7); - gtk_box_pack_start (GTK_BOX (hbox3), table7, TRUE, TRUE, 0); - gtk_table_set_row_spacings (GTK_TABLE (table7), 2); - - label33 = gtk_label_new ("Offset:"); - gtk_widget_set_name (label33, "label33"); - gtk_widget_show (label33); - gtk_table_attach (GTK_TABLE (table7), label33, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label33), 0, 0.5); - - label34 = gtk_label_new ("Data:"); - gtk_widget_set_name (label34, "label34"); - gtk_widget_show (label34); - gtk_table_attach (GTK_TABLE (table7), label34, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_misc_set_alignment (GTK_MISC (label34), 0, 0.5); - - txtWriteOffset = gtk_entry_new (); - gtk_widget_set_name (txtWriteOffset, "txtWriteOffset"); - gtk_widget_show (txtWriteOffset); - gtk_table_attach (GTK_TABLE (table7), txtWriteOffset, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - txtWriteData = gtk_entry_new (); - gtk_widget_set_name (txtWriteData, "txtWriteData"); - gtk_widget_show (txtWriteData); - gtk_table_attach (GTK_TABLE (table7), txtWriteData, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - - radWriteEEPROM = gtk_radio_button_new_with_mnemonic (NULL, "EEPROM"); - gtk_widget_set_name (radWriteEEPROM, "radWriteEEPROM"); - gtk_widget_show (radWriteEEPROM); - gtk_table_attach (GTK_TABLE (table7), radWriteEEPROM, 0, 2, 3, 4, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radWriteEEPROM), radWriteEEPROM_group); - radWriteEEPROM_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radWriteEEPROM)); - - radWriteReg = gtk_radio_button_new_with_mnemonic (NULL, "Register"); - gtk_widget_set_name (radWriteReg, "radWriteReg"); - gtk_widget_show (radWriteReg); - gtk_table_attach (GTK_TABLE (table7), radWriteReg, 0, 2, 4, 5, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (radWriteReg), radWriteEEPROM_group); - radWriteEEPROM_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radWriteReg)); - - hbox8 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox8, "hbox8"); - gtk_widget_show (hbox8); - gtk_table_attach (GTK_TABLE (table7), hbox8, 0, 2, 5, 6, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - btnWrite = gtk_button_new_with_mnemonic ("Write"); - gtk_widget_set_name (btnWrite, "btnWrite"); - gtk_widget_show (btnWrite); - gtk_box_pack_start (GTK_BOX (hbox8), btnWrite, TRUE, FALSE, 0); - - hbox6 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox6, "hbox6"); - gtk_widget_show (hbox6); - gtk_table_attach (GTK_TABLE (table7), hbox6, 0, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_FILL), 0, 0); - - label32 = gtk_label_new ("Write"); - gtk_widget_set_name (label32, "label32"); - gtk_widget_show (label32); - gtk_box_pack_start (GTK_BOX (hbox6), label32, TRUE, FALSE, 0); - - scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); - gtk_widget_show (scrolledwindow1); - gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow1, TRUE, TRUE, 0); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); - - tvRW = gtk_text_view_new (); - gtk_widget_set_name (tvRW, "tvRW"); - gtk_widget_show (tvRW); - gtk_container_add (GTK_CONTAINER (scrolledwindow1), tvRW); - - hbox9 = gtk_hbox_new (FALSE, 0); - gtk_widget_set_name (hbox9, "hbox9"); - gtk_widget_show (hbox9); - gtk_box_pack_start (GTK_BOX (vbox3), hbox9, FALSE, TRUE, 0); - - btnRWClose = gtk_button_new_with_mnemonic ("Close"); - gtk_widget_set_name (btnRWClose, "btnRWClose"); - gtk_widget_show (btnRWClose); - gtk_box_pack_start (GTK_BOX (hbox9), btnRWClose, TRUE, FALSE, 0); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (winRW, winRW, "winRW"); - GLADE_HOOKUP_OBJECT (winRW, vbox3, "vbox3"); - GLADE_HOOKUP_OBJECT (winRW, label25, "label25"); - GLADE_HOOKUP_OBJECT (winRW, hbox3, "hbox3"); - GLADE_HOOKUP_OBJECT (winRW, table6, "table6"); - GLADE_HOOKUP_OBJECT (winRW, label29, "label29"); - GLADE_HOOKUP_OBJECT (winRW, label30, "label30"); - GLADE_HOOKUP_OBJECT (winRW, txtReadOffset, "txtReadOffset"); - GLADE_HOOKUP_OBJECT (winRW, txtReadLen, "txtReadLen"); - GLADE_HOOKUP_OBJECT (winRW, radReadEEPROM, "radReadEEPROM"); - GLADE_HOOKUP_OBJECT (winRW, radReadReg, "radReadReg"); - GLADE_HOOKUP_OBJECT (winRW, hbox7, "hbox7"); - GLADE_HOOKUP_OBJECT (winRW, btnRead, "btnRead"); - GLADE_HOOKUP_OBJECT (winRW, hbox4, "hbox4"); - GLADE_HOOKUP_OBJECT (winRW, label31, "label31"); - GLADE_HOOKUP_OBJECT (winRW, table7, "table7"); - GLADE_HOOKUP_OBJECT (winRW, label33, "label33"); - GLADE_HOOKUP_OBJECT (winRW, label34, "label34"); - GLADE_HOOKUP_OBJECT (winRW, txtWriteOffset, "txtWriteOffset"); - GLADE_HOOKUP_OBJECT (winRW, txtWriteData, "txtWriteData"); - GLADE_HOOKUP_OBJECT (winRW, radWriteEEPROM, "radWriteEEPROM"); - GLADE_HOOKUP_OBJECT (winRW, radWriteReg, "radWriteReg"); - GLADE_HOOKUP_OBJECT (winRW, hbox8, "hbox8"); - GLADE_HOOKUP_OBJECT (winRW, btnWrite, "btnWrite"); - GLADE_HOOKUP_OBJECT (winRW, hbox6, "hbox6"); - GLADE_HOOKUP_OBJECT (winRW, label32, "label32"); - GLADE_HOOKUP_OBJECT (winRW, scrolledwindow1, "scrolledwindow1"); - GLADE_HOOKUP_OBJECT (winRW, tvRW, "tvRW"); - GLADE_HOOKUP_OBJECT (winRW, hbox9, "hbox9"); - GLADE_HOOKUP_OBJECT (winRW, btnRWClose, "btnRWClose"); - - return winRW; -} - diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.h.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.h.svn-base deleted file mode 100644 index 655bd1bc38d0476e9d58269c42977e4a2f0e9687..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/interface.h.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -GtkWidget* create_winMain (void); -GtkWidget* create_winRW (void); diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/main.c.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/main.c.svn-base deleted file mode 100644 index 0f61136676adf090f063ef5f5d142df284afd2b9..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/main.c.svn-base +++ /dev/null @@ -1,1284 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * added config.h include - * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION - * - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_{connect,disconnect,command} to - * cwiid_{open,close,request_status|set_led|set_rumble|set_rpt_mode} - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to message callback - * * use cwiid_get_acc_cal to get acc calibration values - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@anstrakraft.org> - * * fixed signed/unsigned comparison warning in btnRead_clicked - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * disconnect on cwiid_mesg_error - * - * 2007-04-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * commented custom cwiid_err (causing Xlib errors) - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial Changelog - * * type audit (stdint, const, char booleans) - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define APP_NAME "CWiid wmgui" -#define APP_VERSION PACKAGE_VERSION -#define APP_COPYRIGHT "Copyright (C) 2007 L. Donnie Smith " \ - "<cwiid@abstrakraft.org>" -#define APP_COMMENTS "Wiimote GUI" - -#include <ctype.h> -#include <float.h> -#include <math.h> -#include <stdio.h> -#include <stdint.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> - -#include <glib.h> -#include <gtk/gtk.h> - -#include "interface.h" -#include "support.h" - -#include <bluetooth/bluetooth.h> -#include "cwiid.h" - -#define PI 3.14159265358979323 - -struct stick { - char valid; - uint8_t x; - uint8_t y; - uint8_t max; -}; - -/* Globals */ -cwiid_wiimote_t *wiimote = NULL; -bdaddr_t bdaddr; -struct acc_cal wm_cal, nc_cal; -struct cwiid_ir_mesg ir_data; -struct stick nc_stick; -struct stick cc_l_stick, cc_r_stick; - -/* Widgets */ -GtkWidget *winMain; -GtkWidget *winRW; -GtkWidget *winDialog; -GtkWidget *menuConnect, *menuDisconnect, *menuQuit, *menuRW, *menuAbout; -GtkWidget *chkAcc, *chkIR, *chkExt; -GtkWidget *chkLED1, *chkLED2, *chkLED3, *chkLED4; -GtkWidget *chkRumble; -GtkWidget *evUp, *evDown, *evLeft, *evRight, *evA, *evB, - *evMinus, *evPlus, *evHome, *ev1, *ev2; -GtkWidget *lblUp, *lblDown, *lblLeft, *lblRight, *lblA, *lblB, - *lblMinus, *lblPlus, *lblHome, *lbl1, *lbl2; -GtkWidget *lblAccX, *lblAccY, *lblAccZ; -GtkWidget *lblAccXVal, *lblAccYVal, *lblAccZVal; -GtkWidget *progAccX, *progAccY, *progAccZ; -GtkWidget *lblAcc, *lblRoll, *lblPitch; -GtkWidget *lblAccVal, *lblRollVal, *lblPitchVal; -GtkWidget *lblIR; -GtkWidget *drawIR; -GtkWidget *lblNC; -GtkWidget *drawNCStick; -GtkWidget *evNCC, *evNCZ; -GtkWidget *lblNCC, *lblNCZ; -GtkWidget *lblNCAccX, *lblNCAccY, *lblNCAccZ; -GtkWidget *lblNCAccXVal, *lblNCAccYVal, *lblNCAccZVal; -GtkWidget *progNCAccX, *progNCAccY, *progNCAccZ; -GtkWidget *lblNCAcc, *lblNCRoll, *lblNCPitch; -GtkWidget *lblNCAccVal, *lblNCRollVal, *lblNCPitchVal; -GtkWidget *evCCUp, *evCCDown, *evCCLeft, *evCCRight, *evCCMinus, *evCCPlus, - *evCCHome, *evCCA, *evCCB, *evCCX, *evCCY, *evCCZL, *evCCZR; -GtkWidget *lblCCUp, *lblCCDown, *lblCCLeft, *lblCCRight, *lblCCMinus, - *lblCCPlus, *lblCCHome, *lblCCA, *lblCCB, *lblCCX, *lblCCY, *lblCCZL, - *lblCCZR; -GtkWidget *drawCCLStick, *drawCCRStick; -GtkWidget *evCCL, *evCCR; -GtkWidget *lblCCL, *lblCCR; -GtkWidget *lblCCLVal, *lblCCRVal; -GtkWidget *progCCL, *progCCR; -GtkWidget *statConnection, *statBattery, *statExtension; -GtkWidget *txtReadOffset, *txtReadLen; -GtkWidget *radReadEEPROM, *radReadReg; -GtkWidget *btnRead; -GtkWidget *txtWriteOffset, *txtWriteData; -GtkWidget *radWriteEEPROM, *radWriteReg; -GtkWidget *btnWrite; -GtkWidget *tvRW; -GtkWidget *btnRWClose; -GtkWidget *btnBeep; - -GtkTextBuffer *tbRW; - -GdkColor btn_on, btn_off; - -/* Utility functions */ -void set_gui_state(); -void clear_widgets(); -void clear_acc_widgets(); -void clear_ir_data(); -void clear_nunchuk_widgets(); -void clear_classic_widgets(); -void message(GtkMessageType type, const gchar *message, GtkWindow *parent); -void status(const gchar *status); - -/* GTK Callbacks */ -gboolean winMain_delete_event(void); -gboolean winRW_delete_event(void); -void menuConnect_activate(void); -void menuDisconnect_activate(void); -void menuQuit_activate(void); -void menuRW_activate(void); -void menuAbout_activate(void); -void chkAcc_toggled(void); -void chkIR_toggled(void); -void chkExt_toggled(void); -void chkLED_toggled(void); -void chkRumble_toggled(void); -void drawIR_expose_event(void); -void drawStick_expose_event(GtkWidget *, GdkEventExpose *, struct stick *); -void btnRead_clicked(void); -void btnWrite_clicked(void); -void btnRWClose_clicked(void); -void btnBeep_clicked(void); - -void set_report_mode(void); - -/* Wiimote Callback */ -cwiid_mesg_callback_t cwiid_callback; - -/* Wiimote Handler Functions */ -void cwiid_btn(struct cwiid_btn_mesg *); -void cwiid_acc(struct cwiid_acc_mesg *); -void cwiid_ir(struct cwiid_ir_mesg *); -void cwiid_nunchuk(struct cwiid_nunchuk_mesg *); -void cwiid_classic(struct cwiid_classic_mesg *); - -/* GetOpt */ -#define OPTSTRING "h" -extern char *optarg; -extern int optind, opterr, optopt; - -#define USAGE "usage:%s [-h] [BDADDR]\n" - -/* -cwiid_err_t err; - -void err(int id, const char *s, ...) -{ - message(GTK_MESSAGE_ERROR, s, GTK_WINDOW(winMain)); -} -*/ - -int main (int argc, char *argv[]) -{ - int c; - char *str_addr; - - gtk_set_locale (); - gtk_init (&argc, &argv); - - if (!g_thread_supported()) { - g_thread_init(NULL); - } - gdk_threads_init(); - gdk_threads_enter(); - - /* cwiid_set_err(err); */ - - /* Parse Options */ - while ((c = getopt(argc, argv, OPTSTRING)) != -1) { - switch (c) { - case 'h': - printf(USAGE, argv[0]); - return 0; - break; - case '?': - return -1; - break; - default: - printf("unknown command-line option: -%c\n", c); - break; - } - } - - /* BDADDR */ - if (optind < argc) { - if (str2ba(argv[optind], &bdaddr)) { - printf("invalid bdaddr\n"); - bdaddr = *BDADDR_ANY; - } - optind++; - if (optind < argc) { - printf("invalid command-line\n"); - printf(USAGE, argv[0]); - return -1; - } - } - else if ((str_addr = getenv(WIIMOTE_BDADDR)) != NULL) { - if (str2ba(str_addr, &bdaddr)) { - printf("invalid address in %s\n", WIIMOTE_BDADDR); - bdaddr = *BDADDR_ANY; - } - } - else { - bdaddr = *BDADDR_ANY; - } - - /* Create the window */ - winMain = create_winMain(); - winRW = create_winRW(); - - /* Lookup Widgets */ - menuConnect = lookup_widget(winMain, "menuConnect"); - menuDisconnect = lookup_widget(winMain, "menuDisconnect"); - menuQuit = lookup_widget(winMain, "menuQuit"); - menuRW = lookup_widget(winMain, "menuRW"); - menuAbout = lookup_widget(winMain, "menuAbout"); - chkAcc = lookup_widget(winMain, "chkAcc"); - chkIR = lookup_widget(winMain, "chkIR"); - chkExt = lookup_widget(winMain, "chkExt"); - chkLED1 = lookup_widget(winMain, "chkLED1"); - chkLED2 = lookup_widget(winMain, "chkLED2"); - chkLED3 = lookup_widget(winMain, "chkLED3"); - chkLED4 = lookup_widget(winMain, "chkLED4"); - chkRumble = lookup_widget(winMain, "chkRumble"); - evUp = lookup_widget(winMain, "evUp"); - evDown = lookup_widget(winMain, "evDown"); - evLeft = lookup_widget(winMain, "evLeft"); - evRight = lookup_widget(winMain, "evRight"); - evA = lookup_widget(winMain, "evA"); - evB = lookup_widget(winMain, "evB"); - evMinus = lookup_widget(winMain, "evMinus"); - evPlus = lookup_widget(winMain, "evPlus"); - evHome = lookup_widget(winMain, "evHome"); - ev1 = lookup_widget(winMain, "ev1"); - ev2 = lookup_widget(winMain, "ev2"); - lblUp = lookup_widget(winMain, "lblUp"); - lblDown = lookup_widget(winMain, "lblDown"); - lblLeft = lookup_widget(winMain, "lblLeft"); - lblRight = lookup_widget(winMain, "lblRight"); - lblA = lookup_widget(winMain, "lblA"); - lblB = lookup_widget(winMain, "lblB"); - lblMinus = lookup_widget(winMain, "lblMinus"); - lblPlus = lookup_widget(winMain, "lblPlus"); - lblHome = lookup_widget(winMain, "lblHome"); - lbl1 = lookup_widget(winMain, "lbl1"); - lbl2 = lookup_widget(winMain, "lbl2"); - lblAccX = lookup_widget(winMain, "lblAccX"); - lblAccY = lookup_widget(winMain, "lblAccY"); - lblAccZ = lookup_widget(winMain, "lblAccZ"); - lblAccXVal = lookup_widget(winMain, "lblAccXVal"); - lblAccYVal = lookup_widget(winMain, "lblAccYVal"); - lblAccZVal = lookup_widget(winMain, "lblAccZVal"); - progAccX = lookup_widget(winMain, "progAccX"); - progAccY = lookup_widget(winMain, "progAccY"); - progAccZ = lookup_widget(winMain, "progAccZ"); - lblAcc = lookup_widget(winMain, "lblAcc"); - lblRoll = lookup_widget(winMain, "lblRoll"); - lblPitch = lookup_widget(winMain, "lblPitch"); - lblAccVal = lookup_widget(winMain, "lblAccVal"); - lblRollVal = lookup_widget(winMain, "lblRollVal"); - lblPitchVal = lookup_widget(winMain, "lblPitchVal"); - lblIR = lookup_widget(winMain, "lblIR"); - drawIR = lookup_widget(winMain, "drawIR"); - lblNC = lookup_widget(winMain, "lblNC"); - drawNCStick = lookup_widget(winMain, "drawNCStick"); - evNCC = lookup_widget(winMain, "evNCC"); - evNCZ = lookup_widget(winMain, "evNCZ"); - lblNCC = lookup_widget(winMain, "lblNCC"); - lblNCZ = lookup_widget(winMain, "lblNCZ"); - lblNCAccX = lookup_widget(winMain, "lblNCAccX"); - lblNCAccY = lookup_widget(winMain, "lblNCAccY"); - lblNCAccZ = lookup_widget(winMain, "lblNCAccZ"); - lblNCAccXVal = lookup_widget(winMain, "lblNCAccXVal"); - lblNCAccYVal = lookup_widget(winMain, "lblNCAccYVal"); - lblNCAccZVal = lookup_widget(winMain, "lblNCAccZVal"); - progNCAccX = lookup_widget(winMain, "progNCAccX"); - progNCAccY = lookup_widget(winMain, "progNCAccY"); - progNCAccZ = lookup_widget(winMain, "progNCAccZ"); - lblNCAcc = lookup_widget(winMain, "lblNCAcc"); - lblNCRoll = lookup_widget(winMain, "lblNCRoll"); - lblNCPitch = lookup_widget(winMain, "lblNCPitch"); - lblNCAccVal = lookup_widget(winMain, "lblNCAccVal"); - lblNCRollVal = lookup_widget(winMain, "lblNCRollVal"); - lblNCPitchVal = lookup_widget(winMain, "lblNCPitchVal"); - evCCUp = lookup_widget(winMain, "evCCUp"); - evCCDown = lookup_widget(winMain, "evCCDown"); - evCCLeft = lookup_widget(winMain, "evCCLeft"); - evCCRight = lookup_widget(winMain, "evCCRight"); - evCCMinus = lookup_widget(winMain, "evCCMinus"); - evCCPlus = lookup_widget(winMain, "evCCPlus"); - evCCHome = lookup_widget(winMain, "evCCHome"); - evCCA = lookup_widget(winMain, "evCCA"); - evCCB = lookup_widget(winMain, "evCCB"); - evCCX = lookup_widget(winMain, "evCCX"); - evCCY = lookup_widget(winMain, "evCCY"); - evCCZL = lookup_widget(winMain, "evCCZL"); - evCCZR = lookup_widget(winMain, "evCCZR"); - lblCCUp = lookup_widget(winMain, "lblCCUp"); - lblCCDown = lookup_widget(winMain, "lblCCDown"); - lblCCLeft = lookup_widget(winMain, "lblCCLeft"); - lblCCRight = lookup_widget(winMain, "lblCCRight"); - lblCCMinus = lookup_widget(winMain, "lblCCMinus"); - lblCCPlus = lookup_widget(winMain, "lblCCPlus"); - lblCCHome = lookup_widget(winMain, "lblCCHome"); - lblCCA = lookup_widget(winMain, "lblCCA"); - lblCCB = lookup_widget(winMain, "lblCCB"); - lblCCX = lookup_widget(winMain, "lblCCX"); - lblCCY = lookup_widget(winMain, "lblCCY"); - lblCCZL = lookup_widget(winMain, "lblCCZL"); - lblCCZR = lookup_widget(winMain, "lblCCZR"); - drawCCLStick = lookup_widget(winMain, "drawCCLStick"); - drawCCRStick = lookup_widget(winMain, "drawCCRStick"); - evCCL = lookup_widget(winMain, "evCCL"); - evCCR = lookup_widget(winMain, "evCCR"); - lblCCL = lookup_widget(winMain, "lblCCL"); - lblCCR = lookup_widget(winMain, "lblCCR"); - lblCCLVal = lookup_widget(winMain, "lblCCLVal"); - lblCCRVal = lookup_widget(winMain, "lblCCRVal"); - progCCL = lookup_widget(winMain, "progCCL"); - progCCR = lookup_widget(winMain, "progCCR"); - statConnection = lookup_widget(winMain, "statConnection"); - statBattery = lookup_widget(winMain, "statBattery"); - statExtension = lookup_widget(winMain, "statExtension"); - txtReadOffset = lookup_widget(winRW, "txtReadOffset"); - txtReadLen = lookup_widget(winRW, "txtReadLen"); - radReadEEPROM = lookup_widget(winRW, "radReadEEPROM"); - radReadReg = lookup_widget(winRW, "radReadReg"); - btnRead = lookup_widget(winRW, "btnRead"); - txtWriteOffset = lookup_widget(winRW, "txtWriteOffset"); - txtWriteData = lookup_widget(winRW, "txtWriteData"); - radWriteEEPROM = lookup_widget(winRW, "radWriteEEPROM"); - radWriteReg = lookup_widget(winRW, "radWriteReg"); - btnWrite = lookup_widget(winRW, "btnWrite"); - tvRW = lookup_widget(winRW, "tvRW"); - btnRWClose = lookup_widget(winRW, "btnRWClose"); - btnBeep = lookup_widget(winMain, "btnBeep"); - - tbRW = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tvRW)); - - /* Connect Callbacks */ - g_signal_connect(winMain, "delete_event", G_CALLBACK(winMain_delete_event), - NULL); - g_signal_connect(winRW, "delete_event", G_CALLBACK(winRW_delete_event), - NULL); - g_signal_connect(menuConnect, "activate", G_CALLBACK(menuConnect_activate), - NULL); - g_signal_connect(menuDisconnect, "activate", - G_CALLBACK(menuDisconnect_activate), NULL); - g_signal_connect(menuQuit, "activate", G_CALLBACK(menuQuit_activate), - NULL); - g_signal_connect(menuRW, "activate", G_CALLBACK(menuRW_activate), NULL); - g_signal_connect(menuAbout, "activate", G_CALLBACK(menuAbout_activate), - NULL); - g_signal_connect(chkAcc, "toggled", G_CALLBACK(chkAcc_toggled), NULL); - g_signal_connect(chkIR, "toggled", G_CALLBACK(chkIR_toggled), NULL); - g_signal_connect(chkExt, "toggled", G_CALLBACK(chkExt_toggled), NULL); - g_signal_connect(chkLED1, "toggled", G_CALLBACK(chkLED_toggled), NULL); - g_signal_connect(chkLED2, "toggled", G_CALLBACK(chkLED_toggled), NULL); - g_signal_connect(chkLED3, "toggled", G_CALLBACK(chkLED_toggled), NULL); - g_signal_connect(chkLED4, "toggled", G_CALLBACK(chkLED_toggled), NULL); - g_signal_connect(chkRumble, "toggled", G_CALLBACK(chkRumble_toggled), - NULL); - g_signal_connect(drawIR, "expose_event", - G_CALLBACK(drawIR_expose_event), NULL); - g_signal_connect(drawNCStick, "expose_event", - G_CALLBACK(drawStick_expose_event), &nc_stick); - g_signal_connect(drawCCLStick, "expose_event", - G_CALLBACK(drawStick_expose_event), &cc_l_stick); - g_signal_connect(drawCCRStick, "expose_event", - G_CALLBACK(drawStick_expose_event), &cc_r_stick); - g_signal_connect(btnRead, "clicked", G_CALLBACK(btnRead_clicked), NULL); - g_signal_connect(btnWrite, "clicked", G_CALLBACK(btnWrite_clicked), NULL); - g_signal_connect(btnRWClose, "clicked", G_CALLBACK(btnRWClose_clicked), - NULL); - g_signal_connect(btnBeep, "clicked", G_CALLBACK(btnBeep_clicked), NULL); - - /* Initialize */ - btn_on.red = 0; btn_on.blue = 0; btn_on.green = 0xFFFF; - btn_off = gtk_widget_get_style(evUp)->bg[GTK_STATE_NORMAL]; - - nc_stick.max = 0xFF; - cc_l_stick.max = CWIID_CLASSIC_L_STICK_MAX; - cc_r_stick.max = CWIID_CLASSIC_R_STICK_MAX; - - set_gui_state(); - clear_widgets(); - status("No connection"); - - gtk_widget_show(winMain); - - gtk_main(); - gdk_threads_leave(); - return 0; -} - -void message(GtkMessageType type, const gchar *message, GtkWindow *parent) -{ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new(parent, 0, type, GTK_BUTTONS_OK, message); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); -} - -void status(const gchar *status) -{ - gtk_statusbar_push(GTK_STATUSBAR(statConnection), 0, status); -} - -void set_gui_state() -{ - gboolean connected; - gboolean acc_active; - gboolean ext_active; - - connected = wiimote ? TRUE : FALSE; - /* Set Input Widget Sensitivities */ - gtk_widget_set_sensitive(menuConnect, !connected); - gtk_widget_set_sensitive(menuDisconnect, connected); - gtk_widget_set_sensitive(chkLED1, connected); - gtk_widget_set_sensitive(chkLED2, connected); - gtk_widget_set_sensitive(chkLED3, connected); - gtk_widget_set_sensitive(chkLED4, connected); - gtk_widget_set_sensitive(chkRumble, connected); - gtk_widget_set_sensitive(btnRead, connected); - gtk_widget_set_sensitive(btnWrite, connected); - - /* Set Button Sensitivities */ - gtk_widget_set_sensitive(lblUp, connected); - gtk_widget_set_sensitive(lblDown, connected); - gtk_widget_set_sensitive(lblLeft, connected); - gtk_widget_set_sensitive(lblRight, connected); - gtk_widget_set_sensitive(lblA, connected); - gtk_widget_set_sensitive(lblB, connected); - gtk_widget_set_sensitive(lblMinus, connected); - gtk_widget_set_sensitive(lblPlus, connected); - gtk_widget_set_sensitive(lblHome, connected); - gtk_widget_set_sensitive(lbl1, connected); - gtk_widget_set_sensitive(lbl2, connected); - - acc_active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkAcc)); - /* Set Acc Widget Sensitivities */ - gtk_widget_set_sensitive(lblAccX, acc_active); - gtk_widget_set_sensitive(lblAccY, acc_active); - gtk_widget_set_sensitive(lblAccZ, acc_active); - gtk_widget_set_sensitive(lblAccXVal, acc_active); - gtk_widget_set_sensitive(lblAccYVal, acc_active); - gtk_widget_set_sensitive(lblAccZVal, acc_active); - gtk_widget_set_sensitive(progAccX, acc_active); - gtk_widget_set_sensitive(progAccY, acc_active); - gtk_widget_set_sensitive(progAccZ, acc_active); - gtk_widget_set_sensitive(lblAcc, acc_active); - gtk_widget_set_sensitive(lblRoll, acc_active); - gtk_widget_set_sensitive(lblPitch, acc_active); - gtk_widget_set_sensitive(lblAccVal, acc_active); - gtk_widget_set_sensitive(lblRollVal, acc_active); - gtk_widget_set_sensitive(lblPitchVal, acc_active); - - /* Set IC Widget Sensitivities */ - gtk_widget_set_sensitive(lblIR, - gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkIR))); - - ext_active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkExt)); - /* Set Extension Widget Sensitivities */ - gtk_widget_set_sensitive(lblNCC, ext_active); - gtk_widget_set_sensitive(lblNCZ, ext_active); - gtk_widget_set_sensitive(lblNCAccX, ext_active); - gtk_widget_set_sensitive(lblNCAccY, ext_active); - gtk_widget_set_sensitive(lblNCAccZ, ext_active); - gtk_widget_set_sensitive(lblNCAccXVal, ext_active); - gtk_widget_set_sensitive(lblNCAccYVal, ext_active); - gtk_widget_set_sensitive(lblNCAccZVal, ext_active); - gtk_widget_set_sensitive(progNCAccX, ext_active); - gtk_widget_set_sensitive(progNCAccY, ext_active); - gtk_widget_set_sensitive(progNCAccZ, ext_active); - gtk_widget_set_sensitive(lblNCAcc, ext_active); - gtk_widget_set_sensitive(lblNCRoll, ext_active); - gtk_widget_set_sensitive(lblNCPitch, ext_active); - gtk_widget_set_sensitive(lblNCAccVal, ext_active); - gtk_widget_set_sensitive(lblNCRollVal, ext_active); - gtk_widget_set_sensitive(lblNCPitchVal, ext_active); - gtk_widget_set_sensitive(lblCCUp, ext_active); - gtk_widget_set_sensitive(lblCCDown, ext_active); - gtk_widget_set_sensitive(lblCCLeft, ext_active); - gtk_widget_set_sensitive(lblCCRight, ext_active); - gtk_widget_set_sensitive(lblCCMinus, ext_active); - gtk_widget_set_sensitive(lblCCPlus, ext_active); - gtk_widget_set_sensitive(lblCCHome, ext_active); - gtk_widget_set_sensitive(lblCCA, ext_active); - gtk_widget_set_sensitive(lblCCB, ext_active); - gtk_widget_set_sensitive(lblCCX, ext_active); - gtk_widget_set_sensitive(lblCCY, ext_active); - gtk_widget_set_sensitive(lblCCZL, ext_active); - gtk_widget_set_sensitive(lblCCZR, ext_active); - gtk_widget_set_sensitive(lblCCL, ext_active); - gtk_widget_set_sensitive(lblCCR, ext_active); - gtk_widget_set_sensitive(lblCCLVal, ext_active); - gtk_widget_set_sensitive(lblCCRVal, ext_active); - gtk_widget_set_sensitive(progCCL, ext_active); - gtk_widget_set_sensitive(progCCR, ext_active); -} - -void clear_widgets() -{ - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED1), FALSE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED2), FALSE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED3), FALSE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED4), FALSE); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkRumble), FALSE); - - gtk_statusbar_push(GTK_STATUSBAR(statBattery), 0, ""); - gtk_statusbar_push(GTK_STATUSBAR(statExtension), 0, ""); - - clear_acc_widgets(); - clear_ir_data(); - clear_nunchuk_widgets(); - clear_classic_widgets(); -} - -void clear_acc_widgets() -{ - gtk_label_set_text(GTK_LABEL(lblAccXVal), "0"); - gtk_label_set_text(GTK_LABEL(lblAccYVal), "0"); - gtk_label_set_text(GTK_LABEL(lblAccZVal), "0"); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccX), 0.0); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccY), 0.0); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccZ), 0.0); - gtk_label_set_text(GTK_LABEL(lblAccVal), "0"); - gtk_label_set_text(GTK_LABEL(lblRollVal), "0"); - gtk_label_set_text(GTK_LABEL(lblPitchVal), "0"); -} - -void clear_ir_data() -{ - int i; - - for (i=0; i < CWIID_IR_SRC_COUNT; i++) { - ir_data.src[i].pos[CWIID_X] = -1; - ir_data.src[i].pos[CWIID_Y] = -1; - ir_data.src[i].size = -1; - } - gtk_widget_queue_draw(drawIR); -} - -void clear_nunchuk_widgets() -{ - nc_stick.valid = 0; - gtk_widget_queue_draw(drawNCStick); - - gtk_label_set_text(GTK_LABEL(lblNCAccXVal), "0"); - gtk_label_set_text(GTK_LABEL(lblNCAccYVal), "0"); - gtk_label_set_text(GTK_LABEL(lblNCAccZVal), "0"); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccX), 0.0); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccY), 0.0); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccZ), 0.0); - gtk_label_set_text(GTK_LABEL(lblNCAccVal), "0"); - gtk_label_set_text(GTK_LABEL(lblNCRollVal), "0"); - gtk_label_set_text(GTK_LABEL(lblNCPitchVal), "0"); -} - -void clear_classic_widgets() -{ - cc_l_stick.valid = 0; - gtk_widget_queue_draw(drawCCLStick); - cc_r_stick.valid = 0; - gtk_widget_queue_draw(drawCCRStick); - - gtk_label_set_text(GTK_LABEL(lblCCLVal), "0"); - gtk_label_set_text(GTK_LABEL(lblCCRVal), "0"); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progCCL), 0.0); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progCCR), 0.0); -} - -gboolean winMain_delete_event(void) -{ - menuQuit_activate(); - return FALSE; -} - -gboolean winRW_delete_event(void) -{ - btnRWClose_clicked(); - return TRUE; -} - -void menuConnect_activate(void) -{ - char reset_bdaddr = 0; - - if (bacmp(&bdaddr, BDADDR_ANY) == 0) { - reset_bdaddr = 1; - } - message(GTK_MESSAGE_INFO, - "Put Wiimote in discoverable mode (press 1+2) and press OK", - GTK_WINDOW(winMain)); - if ((wiimote = cwiid_open(&bdaddr, CWIID_FLAG_MESG_IFC)) == NULL) { - message(GTK_MESSAGE_ERROR, "Unable to connect", GTK_WINDOW(winMain)); - status("No connection"); - } - else if (cwiid_set_mesg_callback(wiimote, &cwiid_callback)) { - message(GTK_MESSAGE_ERROR, "Error setting callback", - GTK_WINDOW(winMain)); - if (cwiid_close(wiimote)) { - message(GTK_MESSAGE_ERROR, "Error on disconnect", - GTK_WINDOW(winMain)); - } - wiimote = NULL; - status("No connection"); - } - else { - status("Connected"); - if (cwiid_get_acc_cal(wiimote, CWIID_EXT_NONE, &wm_cal)) { - message(GTK_MESSAGE_ERROR, "Unable to retrieve accelerometer " - "calibration", GTK_WINDOW(winMain)); - } - set_gui_state(); - set_report_mode(); - cwiid_enable(wiimote, CWIID_FLAG_MOTIONPLUS); - cwiid_request_status(wiimote); - } - - if (reset_bdaddr) { - bdaddr = *BDADDR_ANY; - } -} - -void menuDisconnect_activate(void) -{ - if (cwiid_close(wiimote)) { - message(GTK_MESSAGE_ERROR, "Error on disconnect", GTK_WINDOW(winMain)); - } - wiimote = NULL; - status("No connection"); - clear_widgets(); - set_gui_state(); -} - -void menuQuit_activate(void) -{ - if (wiimote) { - menuDisconnect_activate(); - } - gtk_main_quit(); -} - -void menuRW_activate(void) -{ - gtk_widget_show(winRW); -} - -void menuAbout_activate(void) -{ - gtk_show_about_dialog(GTK_WINDOW(winMain), - "name", APP_NAME, - "version", APP_VERSION, - "copyright", APP_COPYRIGHT, - "comments", APP_COMMENTS, - NULL); -} - -void chkAcc_toggled(void) -{ - if (wiimote) { - set_report_mode(); - } - if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkAcc))) { - clear_acc_widgets(); - } - set_gui_state(); -} - -void chkIR_toggled(void) -{ - if (wiimote) { - set_report_mode(); - } - if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkIR))) { - clear_ir_data(); - } - set_gui_state(); -} - -void chkExt_toggled(void) -{ - if (wiimote) { - set_report_mode(); - } - if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkExt))) { - clear_nunchuk_widgets(); - clear_classic_widgets(); - } - set_gui_state(); -} - -void chkLED_toggled(void) -{ - uint8_t LED_state; - - if (wiimote) { - LED_state = - (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkLED1)) - ? CWIID_LED1_ON : 0) | - (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkLED2)) - ? CWIID_LED2_ON : 0) | - (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkLED3)) - ? CWIID_LED3_ON : 0) | - (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkLED4)) - ? CWIID_LED4_ON : 0); - if (cwiid_set_led(wiimote, LED_state)) { - message(GTK_MESSAGE_ERROR, "error setting LEDs", - GTK_WINDOW(winMain)); - } - } -} - -void chkRumble_toggled(void) -{ - if (wiimote) { - if (cwiid_set_rumble(wiimote, - gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkRumble)))) { - message(GTK_MESSAGE_ERROR, "error setting rumble", - GTK_WINDOW(winMain)); - } - } -} - -void drawIR_expose_event(void) -{ - int i; - int size; - gint width, height; - - gdk_window_get_geometry(drawIR->window, NULL, NULL, &width, &height, NULL); - - for (i=0; i < CWIID_IR_SRC_COUNT; i++) { - if (ir_data.src[i].valid) { - if (ir_data.src[i].size == -1) { - size = 3; - } - else { - size = ir_data.src[i].size+1; - } - gdk_draw_arc(drawIR->window, - drawIR->style->fg_gc[GTK_WIDGET_STATE(drawIR)], - TRUE, - ir_data.src[i].pos[CWIID_X] * width / CWIID_IR_X_MAX, - height - ir_data.src[i].pos[CWIID_Y] * height / - CWIID_IR_Y_MAX, - size, size, - 0, 64 * 360); - } - } -} - -void drawStick_expose_event(GtkWidget *drawStick, GdkEventExpose *event, - struct stick *stick) -{ - gint width, height; - - gdk_window_get_geometry(drawStick->window, NULL, NULL, &width, &height, - NULL); - gdk_draw_arc(drawStick->window, - drawStick->style->fg_gc[GTK_WIDGET_STATE(drawStick)], - FALSE, - 0, 0, width-1, height-1, 0, 64*360); - if (stick->valid) { - gdk_draw_arc(drawStick->window, - drawStick->style->fg_gc[GTK_WIDGET_STATE(drawStick)], - TRUE, - (double)stick->x/stick->max*width - 2, - (1 - (double)stick->y/stick->max)*height - 2, - 3, 3, 0, 64*360); - } -} - -void btnRead_clicked(void) -{ - static unsigned char buf[CWIID_MAX_READ_LEN]; - static char txt[CWIID_MAX_READ_LEN*4+50]; /* 3 chars per byte, with - * plenty extra */ - GtkTextIter text_iter; - GtkTextMark *p_text_mark; - char *cursor; - unsigned int offset, len; - int flags; - unsigned int i; - - /* Decode arguments */ - offset = strtol(gtk_entry_get_text(GTK_ENTRY(txtReadOffset)), &cursor, 16); - if (*cursor != '\0') { - message(GTK_MESSAGE_ERROR, "Invalid read offset", GTK_WINDOW(winRW)); - } - - len = strtol(gtk_entry_get_text(GTK_ENTRY(txtReadLen)), &cursor, 16); - if (*cursor != '\0') { - message(GTK_MESSAGE_ERROR, "Invalid read len", GTK_WINDOW(winRW)); - } - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radReadReg))) { - flags = CWIID_RW_REG; - } - else { - flags = CWIID_RW_EEPROM; - } - - /* Make the call */ - if (cwiid_read(wiimote, flags, offset, len, buf)) { - message(GTK_MESSAGE_ERROR, "Wiimote read error", GTK_WINDOW(winRW)); - } - else { - /* construct the hexedit-style string */ - cursor=txt; - sprintf(cursor, "0x%08X:", offset & ~0xF); - cursor+=11; - for (i=0; i < (offset & 0xF); i++) { - sprintf(cursor, " "); - cursor+=3; - } - for (i=0; i < len; i++) { - if ((((i + offset) & 0xF) == 0) && (i!=0)) { - sprintf(cursor, "\n0x%08X:", offset+i); - cursor+=12; - } - if (((i +offset) & 0x7) == 0) { - sprintf(cursor, " "); - cursor++; - } - sprintf(cursor, "%02X ", buf[i]); - cursor+=3; - } - sprintf(cursor, "\n\n"); - - gtk_text_buffer_get_end_iter(tbRW, &text_iter); - p_text_mark = gtk_text_buffer_create_mark(tbRW, NULL, &text_iter, - TRUE); - gtk_text_buffer_insert(tbRW, &text_iter, txt, -1); - gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(tvRW), p_text_mark, 0.01, - TRUE, 0.0, 0.0); - } -} - -char chartox(char c) -{ - char str[2]; - char *endptr; - int val; - - str[0] = c; - str[1] = '\0'; - val = strtol(str, &endptr, 16); - if (*endptr != '\0') { - return -1; - } - - return (char)val; -} - -#define MAX_WRITE_LEN 0x20 -void btnWrite_clicked(void) -{ - static unsigned char buf[MAX_WRITE_LEN]; - char *cursor, *data; - uint32_t offset; - uint16_t len; - uint8_t flags; - - /* Decode arguments */ - offset = strtol(gtk_entry_get_text(GTK_ENTRY(txtWriteOffset)), &cursor, 16); - if (*cursor != '\0') { - message(GTK_MESSAGE_ERROR, "Invalid read offset", GTK_WINDOW(winRW)); - } - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radWriteReg))) { - flags = CWIID_RW_REG; - } - else { - flags = CWIID_RW_EEPROM; - } - - data = (char *) gtk_entry_get_text(GTK_ENTRY(txtWriteData)); - cursor = data; - len = 0; - while (*cursor != '\0') { - if (len > MAX_WRITE_LEN) { - message(GTK_MESSAGE_ERROR, "Message too long", GTK_WINDOW(winRW)); - return; - } - /* Trim Leading spaces */ - while (*cursor == ' ') { - cursor++; - } - /* Test for end */ - if (*cursor == '\0') { - break; - } - /* Read first nibble */ - if (!isxdigit((int)*cursor)) { - message(GTK_MESSAGE_ERROR, "Invalid write data", - GTK_WINDOW(winRW)); - return; - } - buf[len] = chartox(*cursor)<<4; - - /* Read second nibble */ - cursor++; - if (!isxdigit((int)*cursor)) { - message(GTK_MESSAGE_ERROR, - "Invalid write data (digits must come in pairs)", - GTK_WINDOW(winRW)); - return; - } - buf[len] = buf[len] | chartox(*cursor); - - cursor++; - len++; - } - - if (len == 0) { - message(GTK_MESSAGE_ERROR, "No write data", GTK_WINDOW(winRW)); - return; - } - - /* Make the call */ - if (cwiid_write(wiimote, flags, offset, len, buf)) { - message(GTK_MESSAGE_ERROR, "Wiimote write error", GTK_WINDOW(winRW)); - } - else { - message(GTK_MESSAGE_INFO, "Wiimote write successful", - GTK_WINDOW(winRW)); - } -} - -void btnRWClose_clicked(void) -{ - gtk_widget_hide(winRW); -} - -void btnBeep_clicked(void) -{ - /*if (cwiid_beep(wiimote)) { - message(GTK_MESSAGE_ERROR, "Wiimote sound error", GTK_WINDOW(winMain)); - }*/ -} - -void set_report_mode(void) -{ - uint8_t rpt_mode; - - rpt_mode = CWIID_RPT_STATUS | CWIID_RPT_BTN; - - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkIR))) { - rpt_mode |= CWIID_RPT_IR; - } - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkAcc))) { - rpt_mode |= CWIID_RPT_ACC; - } - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkExt))) { - rpt_mode |= CWIID_RPT_EXT; - } - if (cwiid_set_rpt_mode(wiimote, rpt_mode)) { - message(GTK_MESSAGE_ERROR, "error setting report mode", - GTK_WINDOW(winMain)); - } -} - -#define BATTERY_STR_LEN 14 /* "Battery: 100%" + '\0' */ -void cwiid_callback(cwiid_wiimote_t *wiimote, int mesg_count, - union cwiid_mesg mesg_array[], struct timespec *timestamp) -{ - int i; - char battery[BATTERY_STR_LEN]; - char *ext_str; - static enum cwiid_ext_type ext_type = CWIID_EXT_NONE; - - gdk_threads_enter(); - for (i=0; i < mesg_count; i++) { - switch (mesg_array[i].type) { - case CWIID_MESG_STATUS: - snprintf(battery, BATTERY_STR_LEN,"Battery:%d%%", - (int) (100.0 * mesg_array[i].status_mesg.battery / - CWIID_BATTERY_MAX)); - gtk_statusbar_push(GTK_STATUSBAR(statBattery), 0, battery); - switch (mesg_array[i].status_mesg.ext_type) { - case CWIID_EXT_NONE: - ext_str = "No extension"; - break; - case CWIID_EXT_NUNCHUK: - ext_str = "Nunchuk"; - if (ext_type != CWIID_EXT_NUNCHUK) { - if (cwiid_get_acc_cal(wiimote, CWIID_EXT_NUNCHUK, - &nc_cal)) { - message(GTK_MESSAGE_ERROR, - "Unable to retrieve accelerometer calibration", - GTK_WINDOW(winMain)); - } - } - break; - case CWIID_EXT_CLASSIC: - ext_str = "Classic controller"; - break; - case CWIID_EXT_MOTIONPLUS: - ext_str = "MotionPlus"; - break; - case CWIID_EXT_UNKNOWN: - ext_str = "Unknown extension"; - break; - } - gtk_statusbar_push(GTK_STATUSBAR(statExtension), 0, ext_str); - clear_nunchuk_widgets(); - clear_classic_widgets(); - ext_type = mesg_array[i].status_mesg.ext_type; - break; - case CWIID_MESG_BTN: - cwiid_btn(&mesg_array[i].btn_mesg); - break; - case CWIID_MESG_ACC: - cwiid_acc(&mesg_array[i].acc_mesg); - break; - case CWIID_MESG_IR: - cwiid_ir(&mesg_array[i].ir_mesg); - break; - case CWIID_MESG_NUNCHUK: - cwiid_nunchuk(&mesg_array[i].nunchuk_mesg); - break; - case CWIID_MESG_CLASSIC: - cwiid_classic(&mesg_array[i].classic_mesg); - break; - case CWIID_MESG_ERROR: - menuDisconnect_activate(); - break; - default: - break; - } - } - gdk_flush(); - gdk_threads_leave(); -} - -void cwiid_btn(struct cwiid_btn_mesg *mesg) -{ - gtk_widget_modify_bg(evUp, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_UP) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evDown, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_DOWN) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evLeft, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_LEFT) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evRight, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_RIGHT) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evA, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_A) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evB, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_B) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evMinus, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_MINUS) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evPlus, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_PLUS) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evHome, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_HOME) ? &btn_on : &btn_off); - gtk_widget_modify_bg(ev1, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_1) ? &btn_on : &btn_off); - gtk_widget_modify_bg(ev2, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_BTN_2) ? &btn_on : &btn_off); -} - -#define LBLVAL_LEN 6 -void cwiid_acc(struct cwiid_acc_mesg *mesg) -{ - static gchar str[LBLVAL_LEN]; - double a_x, a_y, a_z, a; - double roll, pitch; - - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkAcc))) { - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_X]); - gtk_label_set_text(GTK_LABEL(lblAccXVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccX), - (double)mesg->acc[CWIID_X]/0xFF); - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_Y]); - gtk_label_set_text(GTK_LABEL(lblAccYVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccY), - (double)mesg->acc[CWIID_Y]/0xFF); - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_Z]); - gtk_label_set_text(GTK_LABEL(lblAccZVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progAccZ), - (double)mesg->acc[CWIID_Z]/0xFF); - - a_x = ((double)mesg->acc[CWIID_X] - wm_cal.zero[CWIID_X]) / - (wm_cal.one[CWIID_X] - wm_cal.zero[CWIID_X]); - a_y = ((double)mesg->acc[CWIID_Y] - wm_cal.zero[CWIID_Y]) / - (wm_cal.one[CWIID_Y] - wm_cal.zero[CWIID_Y]); - a_z = ((double)mesg->acc[CWIID_Z] - wm_cal.zero[CWIID_Z]) / - (wm_cal.one[CWIID_Z] - wm_cal.zero[CWIID_Z]); - a = sqrt(pow(a_x,2)+pow(a_y,2)+pow(a_z,2)); - - roll = atan(a_x/a_z); - if (a_z <= 0.0) { - roll += PI * ((a_x > 0.0) ? 1 : -1); - } - roll *= -1; - - pitch = atan(a_y/a_z*cos(roll)); - - g_snprintf(str, LBLVAL_LEN, "%.2f", a); - gtk_label_set_text(GTK_LABEL(lblAccVal), str); - g_snprintf(str, LBLVAL_LEN, "%.2f", roll); - gtk_label_set_text(GTK_LABEL(lblRollVal), str); - g_snprintf(str, LBLVAL_LEN, "%.2f", pitch); - gtk_label_set_text(GTK_LABEL(lblPitchVal), str); - } -} - -void cwiid_ir(struct cwiid_ir_mesg *mesg) -{ - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkIR))) { - /* memcpy(&ir_data, mesg, sizeof(struct cwiid_ir_mesg)); */ - ir_data = *mesg; - gtk_widget_queue_draw(drawIR); - } -} - -void cwiid_nunchuk(struct cwiid_nunchuk_mesg *mesg) -{ - static gchar str[LBLVAL_LEN]; - double a_x, a_y, a_z, a; - double roll, pitch; - - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkExt))) { - gtk_widget_modify_bg(evNCC, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_NUNCHUK_BTN_C) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evNCZ, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_NUNCHUK_BTN_Z) ? &btn_on : &btn_off); - - nc_stick.valid = 1; - nc_stick.x = mesg->stick[CWIID_X]; - nc_stick.y = mesg->stick[CWIID_Y]; - gtk_widget_queue_draw(drawNCStick); - - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_X]); - gtk_label_set_text(GTK_LABEL(lblNCAccXVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccX), - (double)mesg->acc[CWIID_X]/0xFF); - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_Y]); - gtk_label_set_text(GTK_LABEL(lblNCAccYVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccY), - (double)mesg->acc[CWIID_Y]/0xFF); - g_snprintf(str, LBLVAL_LEN, "%X", mesg->acc[CWIID_Z]); - gtk_label_set_text(GTK_LABEL(lblNCAccZVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progNCAccZ), - (double)mesg->acc[CWIID_Z]/0xFF); - - /* TODO: get nunchuk calibration */ - a_x = ((double)mesg->acc[CWIID_X] - nc_cal.zero[CWIID_X]) / - (nc_cal.one[CWIID_X] - nc_cal.zero[CWIID_X]); - a_y = ((double)mesg->acc[CWIID_Y] - nc_cal.zero[CWIID_Y]) / - (nc_cal.one[CWIID_Y] - nc_cal.zero[CWIID_Y]); - a_z = ((double)mesg->acc[CWIID_Z] - nc_cal.zero[CWIID_Z]) / - (nc_cal.one[CWIID_Z] - nc_cal.zero[CWIID_Z]); - a = sqrt(pow(a_x,2)+pow(a_y,2)+pow(a_z,2)); - roll = atan(a_x/a_z); - if (a_z <= 0.0) { - roll += PI * ((a_x > 0.0) ? 1 : -1); - } - roll *= -1; - - pitch = atan(a_y/a_z*cos(roll)); - - g_snprintf(str, LBLVAL_LEN, "%.2f", a); - gtk_label_set_text(GTK_LABEL(lblNCAccVal), str); - g_snprintf(str, LBLVAL_LEN, "%.2f", roll); - gtk_label_set_text(GTK_LABEL(lblNCRollVal), str); - g_snprintf(str, LBLVAL_LEN, "%.2f", pitch); - gtk_label_set_text(GTK_LABEL(lblNCPitchVal), str); - } -} - -void cwiid_classic(struct cwiid_classic_mesg *mesg) -{ - static gchar str[LBLVAL_LEN]; - - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(chkExt))) { - gtk_widget_modify_bg(evCCUp, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_UP) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCDown, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_DOWN) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCLeft, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_LEFT) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCRight, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_RIGHT) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCMinus, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_MINUS) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCPlus, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_PLUS) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCHome, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_HOME) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCA, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_A) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCB, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_B) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCX, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_X) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCY, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_Y) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCZL, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_ZL) ? &btn_on : &btn_off); - gtk_widget_modify_bg(evCCZR, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_ZR) ? &btn_on : &btn_off); - - cc_l_stick.valid = 1; - cc_l_stick.x = mesg->l_stick[CWIID_X]; - cc_l_stick.y = mesg->l_stick[CWIID_Y]; - gtk_widget_queue_draw(drawCCLStick); - - cc_r_stick.valid = 1; - cc_r_stick.x = mesg->r_stick[CWIID_X]; - cc_r_stick.y = mesg->r_stick[CWIID_Y]; - gtk_widget_queue_draw(drawCCRStick); - - g_snprintf(str, LBLVAL_LEN, "%X", mesg->l); - gtk_label_set_text(GTK_LABEL(lblCCLVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progCCL), - (double)mesg->l/CWIID_CLASSIC_LR_MAX); - gtk_widget_modify_bg(evCCL, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_L) ? &btn_on : &btn_off); - g_snprintf(str, LBLVAL_LEN, "%X", mesg->r); - gtk_label_set_text(GTK_LABEL(lblCCRVal), str); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progCCR), - (double)mesg->r/CWIID_CLASSIC_LR_MAX); - gtk_widget_modify_bg(evCCR, GTK_STATE_NORMAL, - (mesg->buttons & CWIID_CLASSIC_BTN_R) ? &btn_on : &btn_off); - } -} - diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/support.c.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/support.c.svn-base deleted file mode 100644 index 7dc3c78cb605d02eff9bf5d10b8dc8ee0e05e9cd..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/support.c.svn-base +++ /dev/null @@ -1,144 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <string.h> -#include <stdio.h> - -#include <gtk/gtk.h> - -#include "support.h" - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -static GList *pixmaps_directories = NULL; - -/* Use this function to set the directory containing installed pixmaps. */ -void -add_pixmap_directory (const gchar *directory) -{ - pixmaps_directories = g_list_prepend (pixmaps_directories, - g_strdup (directory)); -} - -/* This is an internally used function to find pixmap files. */ -static gchar* -find_pixmap_file (const gchar *filename) -{ - GList *elem; - - /* We step through each of the pixmaps directory to find it. */ - elem = pixmaps_directories; - while (elem) - { - gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, - G_DIR_SEPARATOR_S, filename); - if (g_file_test (pathname, G_FILE_TEST_EXISTS)) - return pathname; - g_free (pathname); - elem = elem->next; - } - return NULL; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - gchar *pathname = NULL; - GtkWidget *pixmap; - - if (!filename || !filename[0]) - return gtk_image_new (); - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return gtk_image_new (); - } - - pixmap = gtk_image_new_from_file (pathname); - g_free (pathname); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GdkPixbuf* -create_pixbuf (const gchar *filename) -{ - gchar *pathname = NULL; - GdkPixbuf *pixbuf; - GError *error = NULL; - - if (!filename || !filename[0]) - return NULL; - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning ("Couldn't find pixmap file: %s", filename); - return NULL; - } - - pixbuf = gdk_pixbuf_new_from_file (pathname, &error); - if (!pixbuf) - { - fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", - pathname, error->message); - g_error_free (error); - } - g_free (pathname); - return pixbuf; -} - -/* This is used to set ATK action descriptions. */ -void -glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description) -{ - gint n_actions, i; - - n_actions = atk_action_get_n_actions (action); - for (i = 0; i < n_actions; i++) - { - if (!strcmp (atk_action_get_name (action, i), action_name)) - atk_action_set_description (action, i, description); - } -} - diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/support.h.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/support.h.svn-base deleted file mode 100644 index 2dea079c2a421d686d539e798a3a0f54463f331a..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/support.h.svn-base +++ /dev/null @@ -1,44 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <gtk/gtk.h> - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - - -/* Use this function to set the directory containing installed pixmaps. */ -void add_pixmap_directory (const gchar *directory); - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps used in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename); - -/* This is used to create the pixbufs used in the interface. */ -GdkPixbuf* create_pixbuf (const gchar *filename); - -/* This is used to set ATK action descriptions. */ -void glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description); - diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.bak.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.bak.svn-base deleted file mode 100644 index bc94eb9f10bf57b749c4571dd6982a90b25265a2..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.bak.svn-base +++ /dev/null @@ -1,3348 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="winMain"> - <property name="visible">True</property> - <property name="title" translatable="yes">wmgui</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkMenuBar" id="menubar1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="menuitem1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_File</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem1_menu"> - - <child> - <widget class="GtkImageMenuItem" id="menuConnect"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Connect</property> - <property name="use_underline">True</property> - <accelerator key="C" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image27"> - <property name="visible">True</property> - <property name="stock">gtk-connect</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menuDisconnect"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Disconnect</property> - <property name="use_underline">True</property> - <accelerator key="D" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image28"> - <property name="visible">True</property> - <property name="stock">gtk-disconnect</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menuQuit"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Quit</property> - <property name="use_underline">True</property> - <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image29"> - <property name="visible">True</property> - <property name="stock">gtk-quit</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuSettings"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Settings</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuSettings_menu"> - - <child> - <widget class="GtkCheckMenuItem" id="chkAcc"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Acc Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkIR"> - <property name="visible">True</property> - <property name="label" translatable="yes">_IR Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkExt"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Extension Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuControls"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Controls</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuControls_menu"> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED1"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _1</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="1" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED2"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _2</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="2" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED3"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _3</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="3" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED4"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _4</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="4" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkRumble"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Rumble</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuView"> - <property name="visible">True</property> - <property name="label" translatable="yes">_View</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuView_menu"> - - <child> - <widget class="GtkMenuItem" id="menuRW"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Memory Read/Write</property> - <property name="use_underline">True</property> - <accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuHelp"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Help</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuHelp_menu"> - - <child> - <widget class="GtkMenuItem" id="menuAbout"> - <property name="visible">True</property> - <property name="label" translatable="yes">_About</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table1"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">True</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evUp"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblUp"> - <property name="visible">True</property> - <property name="label" translatable="yes">Up</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evLeft"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblLeft"> - <property name="visible">True</property> - <property name="label" translatable="yes">Left</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evRight"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblRight"> - <property name="visible">True</property> - <property name="label" translatable="yes">Right</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evDown"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblDown"> - <property name="visible">True</property> - <property name="label" translatable="yes">Down</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment7"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evA"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblA"> - <property name="visible">True</property> - <property name="label" translatable="yes">A</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment9"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evB"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblB"> - <property name="visible">True</property> - <property name="label" translatable="yes">B</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment10"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evMinus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblMinus"> - <property name="visible">True</property> - <property name="label" translatable="yes">-</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment11"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evHome"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblHome"> - <property name="visible">True</property> - <property name="label" translatable="yes">Home</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment12"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evPlus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblPlus"> - <property name="visible">True</property> - <property name="label" translatable="yes">+</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment13"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="ev1"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lbl1"> - <property name="visible">True</property> - <property name="label" translatable="yes">1</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment14"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="ev2"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lbl2"> - <property name="visible">True</property> - <property name="label" translatable="yes">2</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Buttons</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">True</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkTable" id="table4"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkProgressBar" id="progAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">X:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccXVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Y:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccYVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Z:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccZVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblPitch"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Pitch:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblPitchVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblRoll"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Roll:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblRollVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAcc"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Acc:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnBeep"> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Beep</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkDrawingArea" id="drawIR"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblIR"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">IR</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Motion Sensors</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox10"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame4"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment28"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox12"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <widget class="GtkVBox" id="vbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkDrawingArea" id="drawNCStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox13"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkEventBox" id="evNCC"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblNCC"> - <property name="visible">True</property> - <property name="label" translatable="yes">C</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evNCZ"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblNCZ"> - <property name="visible">True</property> - <property name="label" translatable="yes">Z</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table8"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="lblNCAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">X:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Y:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Z:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAcc"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Acc:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCRoll"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Roll:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCPitch"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Pitch:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccXVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccYVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccZVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCRollVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCPitchVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblNC"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Nunchuk</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame5"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment29"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox5"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkTable" id="table9"> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">9</property> - <property name="homogeneous">True</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkAlignment" id="alignment15"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCLeft"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCLeft"> - <property name="visible">True</property> - <property name="label" translatable="yes">Left</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment16"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCUp"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCUp"> - <property name="visible">True</property> - <property name="label" translatable="yes">Up</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment17"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCDown"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCDown"> - <property name="visible">True</property> - <property name="label" translatable="yes">Down</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment18"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCRight"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCRight"> - <property name="visible">True</property> - <property name="label" translatable="yes">Right</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment19"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCMinus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCMinus"> - <property name="visible">True</property> - <property name="label" translatable="yes">-</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment20"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCHome"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCHome"> - <property name="visible">True</property> - <property name="label" translatable="yes">Home</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment21"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCPlus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCPlus"> - <property name="visible">True</property> - <property name="label" translatable="yes">+</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment22"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCZL"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCZL"> - <property name="visible">True</property> - <property name="label" translatable="yes">ZL</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment23"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCZR"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCZR"> - <property name="visible">True</property> - <property name="label" translatable="yes">ZR</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment24"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCX"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCX"> - <property name="visible">True</property> - <property name="label" translatable="yes">X</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">7</property> - <property name="right_attach">8</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment25"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCY"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCY"> - <property name="visible">True</property> - <property name="label" translatable="yes">Y</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">6</property> - <property name="right_attach">7</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment26"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCB"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCB"> - <property name="visible">True</property> - <property name="label" translatable="yes">B</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">7</property> - <property name="right_attach">8</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment27"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCA"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCA"> - <property name="visible">True</property> - <property name="label" translatable="yes">A</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">8</property> - <property name="right_attach">9</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox15"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkDrawingArea" id="drawCCLStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkDrawingArea" id="drawCCRStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table10"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="lblCCLVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblCCRVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progCCL"> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progCCR"> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evCCR"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCR"> - <property name="visible">True</property> - <property name="label" translatable="yes">R:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evCCL"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCL"> - <property name="visible">True</property> - <property name="label" translatable="yes">L:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblClassic"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Classic Controller</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox11"> - <property name="visible">True</property> - <property name="homogeneous">True</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkStatusbar" id="statConnection"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkStatusbar" id="statBattery"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkStatusbar" id="statExtension"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="winRW"> - <property name="visible">True</property> - <property name="title" translatable="yes">Memory Read/Write</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="vbox3"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <widget class="GtkLabel" id="label25"> - <property name="visible">True</property> - <property name="label" translatable="yes">Note: all values are in hex</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkTable" id="table6"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">2</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="label29"> - <property name="visible">True</property> - <property name="label" translatable="yes">Offset:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label30"> - <property name="visible">True</property> - <property name="label" translatable="yes">Length:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtReadOffset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtReadLen"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radReadEEPROM"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">EEPROM</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radReadReg"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Register</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radReadEEPROM</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox7"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnRead"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Read</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label31"> - <property name="visible">True</property> - <property name="label" translatable="yes">Read</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table7"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">2</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="label33"> - <property name="visible">True</property> - <property name="label" translatable="yes">Offset:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label34"> - <property name="visible">True</property> - <property name="label" translatable="yes">Data:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtWriteOffset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtWriteData"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radWriteEEPROM"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">EEPROM</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radWriteReg"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Register</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radWriteEEPROM</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnWrite"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Write</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox6"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label32"> - <property name="visible">True</property> - <property name="label" translatable="yes">Write</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTextView" id="tvRW"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="overwrite">False</property> - <property name="accepts_tab">True</property> - <property name="justification">GTK_JUSTIFY_LEFT</property> - <property name="wrap_mode">GTK_WRAP_NONE</property> - <property name="cursor_visible">True</property> - <property name="pixels_above_lines">0</property> - <property name="pixels_below_lines">0</property> - <property name="pixels_inside_wrap">0</property> - <property name="left_margin">0</property> - <property name="right_margin">0</property> - <property name="indent">0</property> - <property name="text" translatable="yes"></property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox9"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnRWClose"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Close</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.svn-base deleted file mode 100644 index bc94eb9f10bf57b749c4571dd6982a90b25265a2..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.glade.svn-base +++ /dev/null @@ -1,3348 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> - -<widget class="GtkWindow" id="winMain"> - <property name="visible">True</property> - <property name="title" translatable="yes">wmgui</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkMenuBar" id="menubar1"> - <property name="visible">True</property> - - <child> - <widget class="GtkMenuItem" id="menuitem1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_File</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuitem1_menu"> - - <child> - <widget class="GtkImageMenuItem" id="menuConnect"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Connect</property> - <property name="use_underline">True</property> - <accelerator key="C" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image27"> - <property name="visible">True</property> - <property name="stock">gtk-connect</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menuDisconnect"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Disconnect</property> - <property name="use_underline">True</property> - <accelerator key="D" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image28"> - <property name="visible">True</property> - <property name="stock">gtk-disconnect</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menuQuit"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Quit</property> - <property name="use_underline">True</property> - <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/> - - <child internal-child="image"> - <widget class="GtkImage" id="image29"> - <property name="visible">True</property> - <property name="stock">gtk-quit</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuSettings"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Settings</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuSettings_menu"> - - <child> - <widget class="GtkCheckMenuItem" id="chkAcc"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Acc Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkIR"> - <property name="visible">True</property> - <property name="label" translatable="yes">_IR Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkExt"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Extension Data</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuControls"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Controls</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuControls_menu"> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED1"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _1</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="1" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED2"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _2</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="2" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED3"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _3</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="3" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkLED4"> - <property name="visible">True</property> - <property name="label" translatable="yes">LED _4</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="4" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator1"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkCheckMenuItem" id="chkRumble"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Rumble</property> - <property name="use_underline">True</property> - <property name="active">False</property> - <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuView"> - <property name="visible">True</property> - <property name="label" translatable="yes">_View</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuView_menu"> - - <child> - <widget class="GtkMenuItem" id="menuRW"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Memory Read/Write</property> - <property name="use_underline">True</property> - <accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/> - </widget> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menuHelp"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Help</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menuHelp_menu"> - - <child> - <widget class="GtkMenuItem" id="menuAbout"> - <property name="visible">True</property> - <property name="label" translatable="yes">_About</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkTable" id="table1"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">True</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkAlignment" id="alignment3"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evUp"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblUp"> - <property name="visible">True</property> - <property name="label" translatable="yes">Up</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evLeft"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblLeft"> - <property name="visible">True</property> - <property name="label" translatable="yes">Left</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evRight"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblRight"> - <property name="visible">True</property> - <property name="label" translatable="yes">Right</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evDown"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblDown"> - <property name="visible">True</property> - <property name="label" translatable="yes">Down</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment7"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evA"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblA"> - <property name="visible">True</property> - <property name="label" translatable="yes">A</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment9"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evB"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblB"> - <property name="visible">True</property> - <property name="label" translatable="yes">B</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment10"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evMinus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblMinus"> - <property name="visible">True</property> - <property name="label" translatable="yes">-</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment11"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evHome"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblHome"> - <property name="visible">True</property> - <property name="label" translatable="yes">Home</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment12"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evPlus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblPlus"> - <property name="visible">True</property> - <property name="label" translatable="yes">+</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment13"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="ev1"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lbl1"> - <property name="visible">True</property> - <property name="label" translatable="yes">1</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment14"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="ev2"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lbl2"> - <property name="visible">True</property> - <property name="label" translatable="yes">2</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Buttons</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">True</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkTable" id="table4"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkProgressBar" id="progAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">X:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccXVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Y:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccYVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Z:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccZVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblPitch"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Pitch:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblPitchVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblRoll"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Roll:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblRollVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAcc"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Acc:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblAccVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnBeep"> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Beep</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame3"> - <property name="border_width">4</property> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - - <child> - <widget class="GtkDrawingArea" id="drawIR"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblIR"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">IR</property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Motion Sensors</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox10"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkFrame" id="frame4"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment28"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox12"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <widget class="GtkVBox" id="vbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkDrawingArea" id="drawNCStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox13"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkEventBox" id="evNCC"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblNCC"> - <property name="visible">True</property> - <property name="label" translatable="yes">C</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evNCZ"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblNCZ"> - <property name="visible">True</property> - <property name="label" translatable="yes">Z</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table8"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">3</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="lblNCAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">X:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Y:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Z:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAcc"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Acc:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCRoll"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Roll:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCPitch"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">Pitch:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccXVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccYVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccZVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCAccVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCRollVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblNCPitchVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccX"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccZ"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progNCAccY"> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblNC"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Nunchuk</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkFrame" id="frame5"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0.5</property> - <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> - - <child> - <widget class="GtkAlignment" id="alignment29"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">12</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox5"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkTable" id="table9"> - <property name="visible">True</property> - <property name="n_rows">3</property> - <property name="n_columns">9</property> - <property name="homogeneous">True</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkAlignment" id="alignment15"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCLeft"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCLeft"> - <property name="visible">True</property> - <property name="label" translatable="yes">Left</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment16"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCUp"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCUp"> - <property name="visible">True</property> - <property name="label" translatable="yes">Up</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment17"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCDown"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCDown"> - <property name="visible">True</property> - <property name="label" translatable="yes">Down</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment18"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCRight"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCRight"> - <property name="visible">True</property> - <property name="label" translatable="yes">Right</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment19"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCMinus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCMinus"> - <property name="visible">True</property> - <property name="label" translatable="yes">-</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment20"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCHome"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCHome"> - <property name="visible">True</property> - <property name="label" translatable="yes">Home</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">4</property> - <property name="right_attach">5</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment21"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCPlus"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCPlus"> - <property name="visible">True</property> - <property name="label" translatable="yes">+</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment22"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCZL"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCZL"> - <property name="visible">True</property> - <property name="label" translatable="yes">ZL</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment23"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCZR"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCZR"> - <property name="visible">True</property> - <property name="label" translatable="yes">ZR</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment24"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCX"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCX"> - <property name="visible">True</property> - <property name="label" translatable="yes">X</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">7</property> - <property name="right_attach">8</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment25"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCY"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCY"> - <property name="visible">True</property> - <property name="label" translatable="yes">Y</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">6</property> - <property name="right_attach">7</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment26"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCB"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCB"> - <property name="visible">True</property> - <property name="label" translatable="yes">B</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">7</property> - <property name="right_attach">8</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment27"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkEventBox" id="evCCA"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCA"> - <property name="visible">True</property> - <property name="label" translatable="yes">A</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">8</property> - <property name="right_attach">9</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox15"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkDrawingArea" id="drawCCLStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkDrawingArea" id="drawCCRStick"> - <property name="width_request">50</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table10"> - <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">3</property> - <property name="homogeneous">False</property> - <property name="row_spacing">0</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="lblCCLVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblCCRVal"> - <property name="width_request">35</property> - <property name="visible">True</property> - <property name="label" translatable="yes">0</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progCCL"> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progCCR"> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.10000000149</property> - </widget> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evCCR"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCR"> - <property name="visible">True</property> - <property name="label" translatable="yes">R:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkEventBox" id="evCCL"> - <property name="visible">True</property> - <property name="visible_window">True</property> - <property name="above_child">False</property> - - <child> - <widget class="GtkLabel" id="lblCCL"> - <property name="visible">True</property> - <property name="label" translatable="yes">L:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="lblClassic"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Classic Controller</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">label_item</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">3</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox11"> - <property name="visible">True</property> - <property name="homogeneous">True</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkStatusbar" id="statConnection"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkStatusbar" id="statBattery"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkStatusbar" id="statExtension"> - <property name="visible">True</property> - <property name="has_resize_grip">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="winRW"> - <property name="visible">True</property> - <property name="title" translatable="yes">Memory Read/Write</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="vbox3"> - <property name="border_width">5</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">4</property> - - <child> - <widget class="GtkLabel" id="label25"> - <property name="visible">True</property> - <property name="label" translatable="yes">Note: all values are in hex</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkTable" id="table6"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">2</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="label29"> - <property name="visible">True</property> - <property name="label" translatable="yes">Offset:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label30"> - <property name="visible">True</property> - <property name="label" translatable="yes">Length:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtReadOffset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtReadLen"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radReadEEPROM"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">EEPROM</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radReadReg"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Register</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radReadEEPROM</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox7"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnRead"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Read</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label31"> - <property name="visible">True</property> - <property name="label" translatable="yes">Read</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkTable" id="table7"> - <property name="visible">True</property> - <property name="n_rows">6</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> - <property name="row_spacing">2</property> - <property name="column_spacing">0</property> - - <child> - <widget class="GtkLabel" id="label33"> - <property name="visible">True</property> - <property name="label" translatable="yes">Offset:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label34"> - <property name="visible">True</property> - <property name="label" translatable="yes">Data:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtWriteOffset"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="txtWriteData"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radWriteEEPROM"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">EEPROM</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radWriteReg"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Register</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radWriteEEPROM</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnWrite"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Write</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox6"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label32"> - <property name="visible">True</property> - <property name="label" translatable="yes">Write</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_IN</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTextView" id="tvRW"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="overwrite">False</property> - <property name="accepts_tab">True</property> - <property name="justification">GTK_JUSTIFY_LEFT</property> - <property name="wrap_mode">GTK_WRAP_NONE</property> - <property name="cursor_visible">True</property> - <property name="pixels_above_lines">0</property> - <property name="pixels_below_lines">0</property> - <property name="pixels_inside_wrap">0</property> - <property name="left_margin">0</property> - <property name="right_margin">0</property> - <property name="indent">0</property> - <property name="text" translatable="yes"></property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox9"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkButton" id="btnRWClose"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Close</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.bak.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.bak.svn-base deleted file mode 100644 index 01ab8d295e47f4e314ec4fa8e6ec045a01a0579f..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.bak.svn-base +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name>wmgui</name> - <program_name>wmgui</program_name> - <source_directory></source_directory> - <pixmaps_directory></pixmaps_directory> - <gnome_support>FALSE</gnome_support> - <gettext_support>FALSE</gettext_support> - <use_widget_names>TRUE</use_widget_names> - <output_main_file>FALSE</output_main_file> - <output_build_files>FALSE</output_build_files> - <backup_source_files>FALSE</backup_source_files> -</glade-project> diff --git a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.svn-base b/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.svn-base deleted file mode 100644 index 01ab8d295e47f4e314ec4fa8e6ec045a01a0579f..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wmgui/.svn/text-base/wmgui.gladep.svn-base +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> - -<glade-project> - <name>wmgui</name> - <program_name>wmgui</program_name> - <source_directory></source_directory> - <pixmaps_directory></pixmaps_directory> - <gnome_support>FALSE</gnome_support> - <gettext_support>FALSE</gettext_support> - <use_widget_names>TRUE</use_widget_names> - <output_main_file>FALSE</output_main_file> - <output_build_files>FALSE</output_build_files> - <backup_source_files>FALSE</backup_source_files> -</glade-project> diff --git a/l2ork_addons/cwiid/wminput/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/.svn/all-wcprops deleted file mode 100644 index fa20a95bb4b20479fd36c130b0813c3062f00b59..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/all-wcprops +++ /dev/null @@ -1,107 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 37 -/cwiid/svn/!svn/ver/190/trunk/wminput -END -action_enum.txt -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/14/trunk/wminput/action_enum.txt -END -c_plugin.c -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/142/trunk/wminput/c_plugin.c -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 49 -/cwiid/svn/!svn/ver/180/trunk/wminput/Makefile.in -END -action_enum.awk -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/29/trunk/wminput/action_enum.awk -END -c_plugin.h -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/142/trunk/wminput/c_plugin.h -END -py_plugin.c -K 25 -svn:wc:ra_dav:version-url -V 49 -/cwiid/svn/!svn/ver/142/trunk/wminput/py_plugin.c -END -wmplugin.h -K 25 -svn:wc:ra_dav:version-url -V 48 -/cwiid/svn/!svn/ver/125/trunk/wminput/wmplugin.h -END -py_plugin.h -K 25 -svn:wc:ra_dav:version-url -V 49 -/cwiid/svn/!svn/ver/142/trunk/wminput/py_plugin.h -END -README -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/132/trunk/wminput/README -END -util.c -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/125/trunk/wminput/util.c -END -util.h -K 25 -svn:wc:ra_dav:version-url -V 43 -/cwiid/svn/!svn/ver/74/trunk/wminput/util.h -END -parser.y -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/76/trunk/wminput/parser.y -END -main.c -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/151/trunk/wminput/main.c -END -uinput.c -K 25 -svn:wc:ra_dav:version-url -V 46 -/cwiid/svn/!svn/ver/125/trunk/wminput/uinput.c -END -conf.c -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/137/trunk/wminput/conf.c -END -lexer.l -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/190/trunk/wminput/lexer.l -END -conf.h -K 25 -svn:wc:ra_dav:version-url -V 44 -/cwiid/svn/!svn/ver/137/trunk/wminput/conf.h -END diff --git a/l2ork_addons/cwiid/wminput/.svn/entries b/l2ork_addons/cwiid/wminput/.svn/entries deleted file mode 100644 index 50394a34f3c51202c4a7f61cdad55762b8fc0af1..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/entries +++ /dev/null @@ -1,612 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput -http://abstrakraft.org/cwiid/svn - - - -2009-06-15T00:05:32.153066Z -190 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -action_enum.txt -file - - - - -2009-10-18T02:00:41.000000Z -14c8e97f15471eb3496c52889214303e -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -10593 - -c_plugin.c -file - - - - -2009-10-18T02:00:41.000000Z -6580c619e59750b4c1ac5062e76e37f6 -2007-08-15T03:28:42.323148Z -142 -dsmith - - - - - - - - - - - - - - - - - - - - - -4322 - -plugins -dir - -Makefile.in -file - - - - -2009-10-18T02:00:41.000000Z -827f82a7d28aba4ba83f38da29027f2c -2008-06-05T14:09:16.426899Z -180 -dsmith - - - - - - - - - - - - - - - - - - - - - -1601 - -action_enum.awk -file - - - - -2009-10-18T02:00:41.000000Z -5b79c86a983269bfef18ad4b3a9d00d6 -2007-03-15T20:09:44.970011Z -29 -dsmith -has-props - - - - - - - - - - - - - - - - - - - - -292 - -c_plugin.h -file - - - - -2009-10-18T02:00:41.000000Z -066674b7cd38a2a8f9e265233ff252b0 -2007-08-15T03:28:42.323148Z -142 -dsmith - - - - - - - - - - - - - - - - - - - - - -1523 - -py_plugin.c -file - - - - -2009-10-18T02:00:41.000000Z -b483f7f043699916615a9b6282ef9f94 -2007-08-15T03:28:42.323148Z -142 -dsmith - - - - - - - - - - - - - - - - - - - - - -14881 - -wmplugin.h -file - - - - -2009-10-18T02:00:41.000000Z -3affc4fe4a761de7633b44d2bca0f674 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -2610 - -configs -dir - -py_plugin.h -file - - - - -2009-10-18T02:00:41.000000Z -53e0fa82218c89944b5e67cb4c4d2b99 -2007-08-15T03:28:42.323148Z -142 -dsmith - - - - - - - - - - - - - - - - - - - - - -1634 - -README -file - - - - -2009-10-18T02:00:41.000000Z -45baff6c04d1e188b11461c9670e8b9a -2007-06-29T01:50:26.688278Z -132 -dsmith - - - - - - - - - - - - - - - - - - - - - -7589 - -util.c -file - - - - -2009-10-18T02:00:41.000000Z -9f321868bf5ecf8e6e1540147c09e5a0 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -1196 - -util.h -file - - - - -2009-10-18T02:00:41.000000Z -7073cab9e2f56bda6c9ce2ddc2948c7e -2007-04-09T03:27:54.544859Z -74 -dsmith - - - - - - - - - - - - - - - - - - - - - -971 - -parser.y -file - - - - -2009-10-18T02:00:41.000000Z -bb21e4f2410e847124f545ff0b8c408a -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -2885 - -uinput.c -file - - - - -2009-10-18T02:00:41.000000Z -5cec53e746a1cda4a0c9e3f7d404c753 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -7827 - -main.c -file - - - - -2009-10-18T02:00:41.000000Z -5bd0ab3b49bb00394a60c5c8445ca80a -2007-08-27T01:43:12.116446Z -151 -dsmith - - - - - - - - - - - - - - - - - - - - - -20187 - -conf.c -file - - - - -2009-10-18T02:00:41.000000Z -de88effc00811774ad3a363438d3f793 -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -15831 - -lexer.l -file - - - - -2009-10-18T02:00:41.000000Z -dd36f451a86fb4a99f550cf456ec7c0e -2009-06-15T00:05:32.153066Z -190 -dsmith - - - - - - - - - - - - - - - - - - - - - -6518 - -conf.h -file - - - - -2009-10-18T02:00:41.000000Z -76be0f4566761f25426ec47cbba2ce8b -2007-07-28T18:47:03.521454Z -137 -dsmith - - - - - - - - - - - - - - - - - - - - - -6037 - diff --git a/l2ork_addons/cwiid/wminput/.svn/format b/l2ork_addons/cwiid/wminput/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/.svn/prop-base/action_enum.awk.svn-base b/l2ork_addons/cwiid/wminput/.svn/prop-base/action_enum.awk.svn-base deleted file mode 100644 index a6697057e79e27363a08306bb706410e31059f92..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/prop-base/action_enum.awk.svn-base +++ /dev/null @@ -1,5 +0,0 @@ -K 14 -svn:executable -V 0 - -END diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 009d4d5cdae2e9b7e1b1e14c8f38ae63046bb315..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,70 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -APP_NAME = wminput - -SOURCES = main.c conf.c c_plugin.c uinput.c action_enum.c util.c -#kludge to make sure YACC/LEX sources are listed last, otherwise we get errors -#when building dependencies -LAST_SOURCES = parser.c lexer.c - -WMINPUT_CONFIG_DIR = $(CWIID_CONFIG_DIR)/wminput -CFLAGS += -I@top_builddir@/libcwiid \ - -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \ - -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" - -LDLIBS += -lcwiid -ldl -LDFLAGS += -L@top_builddir@/libcwiid -rdynamic -INST_DIR = @bindir@ - -YFLAGS += -d - -ifdef PYTHON - SOURCES += py_plugin.c - CFLAGS += -I/usr/include/python@PYTHON_VERSION@ - LDLIBS += -lpython@PYTHON_VERSION@ -endif - -SOURCES += $(LAST_SOURCES) - -include $(COMMON)/include/app.mak - -all install clean distclean uninstall: make_plugins - -install: install_configs - -#DON'T UNINSTALL CONFIGS -#uninstall: uninstall_configs - -make_plugins: - $(MAKE) $(MAKECMDGOALS) -C plugins - -install_configs: - install -d $(WMINPUT_CONFIG_DIR) - install configs/* $(WMINPUT_CONFIG_DIR) - ln -sf acc_led $(WMINPUT_CONFIG_DIR)/default - -#uninstall_configs: -# rm -f $(WMINPUT_CONFIG_DIR)/default -# for c in `ls configs`; do \ -# rm -f $(WMINPUT_CONFIG_DIR)/$$c; \ -# done -# rmdir $(WMINPUT_CONFIG_DIR); true - -action_enum.c: action_enum.awk action_enum.txt - $(AWK) -f action_enum.awk action_enum.txt > action_enum.c - -conf.o lexer.c: y.tab.h - -y.tab.h: parser.c - -clean: clean_gen - -clean_gen: - rm -f action_enum.c parser.c lexer.c y.tab.h - -distclean: clean - rm Makefile - -.PHONY: all install clean distclean uninstall make_plugins clean_gen diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/README.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/README.svn-base deleted file mode 100644 index 9301d12b5a072ad1e553236bfcd23186db93d602..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/README.svn-base +++ /dev/null @@ -1,93 +0,0 @@ -Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -OVERVIEW ------------------------------------------------------------------------------------------------- -wminput is an Linux event, mouse, and joystick driver for the wiimote using the uinput system. It supports assigning key/button symbols to buttons on the wiimote, nunchuk, and classic controller, and axes symbols to wiimote axes including direction pads, "analog" sticks, and "analog" shoulder buttons. Furthermore, it provides a plugin interface through which more advanced functionality can be implemented, such as accelerometer and ir calculations. Plugins can provide button-type events and axes. - -EXECUTION ------------------------------------------------------------------------------------------------- -wminput [-h] [-w] [-c config] [bdaddr] - --h: print usage and exit --w: on startup, wait (without timing out) until a wiimote is found --c config: specifies the configuration file to load. "default" is the default configuration file (on install, a symlink is created to the acc_ptr configuration. The search directories are specified below in the section on configuration files, or an absolute or relative pathname may be given. -bdaddr: specifies the bluetooth device address of the wiimote. If unspecified, the environment variable WIIMOTE_BDADDR is used. If this variable does not exist, a connection is made with the first wiimote found. - - -CONFIGURATION REQUIREMENTS ------------------------------------------------------------------------------------------------- -uinput kernel support is required. joydev and evdev are required for joystick and event interfaces, respectively. See http://gentoo-wiki.com/HOWTO_Compile_a_Kernel_Manually for information on kernel compilation. - -By default, some (most? all?) udev configurations set up a uinput device file readable only by root. Using wminput as a user other than root requires udev to change the permissions on uinput. Place the following line in a file in /etc/udev/rules.d (see the documentation for your distro for the recommended file for local rules) to allow anyone on the system to use uinput: -KERNEL=="uinput", MODE="0666" -A more secure method uses the following line to allow anyone in <group> to use wminput, and adds only the desired users to <group>: -KERNEL=="uinput", GROUP="<group>" -A uinput group can be created specifically for this purpose, or an existing group such as wheel can be used. - -Key symbols can be assigned to wminput button events. While standard keys are supported by X by default, non-standard key symbols, and mapping actions to those symbols, is not automatic. An excellent tutorial at http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys can help you set this up. An overview of the process described there: -1.Assign the key symbol in question to a button in a wminput configuration file. -2.Use wminput and the wiimote to generate that key symbol, using xev to find out if the key symbol is already mapped, and find the key code if it is not. -3.If the code is not mapped to the appropriate symbol, edit ~/.Xmodmap, and use xmodmap to map them. (A copy of my ~/.Xmodmap is included in cwiid/doc) -4.Use xbindkeys or a window manager-specific utility to map the key symbols to specific actions. - -Wiimote buttons can be mapped to modifier keys (control, shift, alt, etc.) with the command xmodmap command 'add [mod] = [keysym]', where keysym is the key symbol mapped in the process described above, and mod is one of the modifier names listed by 'xmodmap -pm' (mod1 = alt). - -CONFIGURATION FILES ------------------------------------------------------------------------------------------------- -Configuration files are installed in /usr/local/etc/cwiid/wminput. Configuration search directory order is ~/.cwiid/wminput, /usr/local/etc/cwiid/wminput. -Configuration files specify the mapping of button and key symbols to wiimote buttons, and axis symbols to wiimote axes. The grammar is as follows (words in angle brackets are to be replaced by appropriate values or strings, without the brackets): - -# <text> - Comment - -include <inc_file> - Include the file specified by inc_file. - -Wiimote.<button> = <button_symbol> -Nunchuk.<button> = <button_symbol> -Classic.<button> = <button_symbol> -Plugin.<plugin>.<button> = <button_symbol> - Map the button or key symbol specified on the right-hand side to the button event specified on the left-hand side. Button and key symbols are listed in /usr/include/linux/input.h (BTN_* and KEY_* macros), and in cwiid/wminput/action_enum.txt. All valid wiimote, nunchuk, and classic buttons are listed in cwiid/doc/wminput.list. - -Wiimote.<axis> = [-][~]<abs_axis_symbol> | [-]<rel_axis_symbol> -Nunchuk.<axis> = [-][~]<abs_axis_symbol> | [-]<rel_axis_symbol> -Classic.<axis> = [-][~]<abs_axis_symbol> | [-]<rel_axis_symbol> -Plugin.<plugin>.<axis> = [-][~]<abs_axis_symbol> | [-]<rel_axis_symbol> - Map the axis symbol specified on the right-hand side to the axis event specified on the left-hand side. Axis symbols are listed in /usr/include/linux/input.h (ABS_* and REL_* macros), and in cwiid/wminput/action_enum.txt. All valid wiimote, nunchuk, and classic axes are listed in cwiid/doc/wminput.list. A - before the axis symbol inverts the axis. A ~ is usually required before an absolute axis symbol in order to use it for cursor movement. - -Plugin.<plugin>.<param> = <int> | <float> - Set the value of a plugin parameter. Ints are silently cast to floats, and floats are cast to ints with a warning. - -Wiimote.Rumble = On | Off - Activates or deactivates force feedback/rumble function. - -An event device is always created. A mouse device is created if REL_X, REL_Y, and BTN_LEFT symbols are mapped (~ABS_X and ~ABS_Y effectively map REL_X and REL_Y, respectively). A joystick device is created if ABS_X is mapped. - -PLUGINS ------------------------------------------------------------------------------------------------- -Plugins provide a mechanism for more advanced wiimote event programming. The following plugins are provided: -ir_ptr - rough IR tracking algorithm. Provides X and Y axes representing the calculated cursor position. - -acc - accelerometer calculations. Provides X and Y relative axes for cursor tracking, and Roll and Pitch axes. - -nunchuk_acc - nunchuk accelerometer calculations. Identical to acc, but using the nunchuk accelerometers. - -Plugins are by default installed in /usr/local/lib/cwiid/plugins. Plugin search directory order is ~/.cwiid/plugins, /usr/local/lib/cwiid/plugins. - -For developers, the plugin API is specified in cwiid/wminput/wmplugin.h. The examples cover most of the functionality, except buttons, which are triggered by asserting the i^th bit of the buttons element of struct wmplugin_data, where i is the index of the button. - -Plugins may now be implemented in Python, as well as C. A Python version of the acc plugin may be found in cwiid/wminput/plugins/acc. diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.awk.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.awk.svn-base deleted file mode 100644 index 405330f940922a7ca8d7f3e1c3945a27e9ba96d3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.awk.svn-base +++ /dev/null @@ -1,18 +0,0 @@ -BEGIN { - print "#include <stdlib.h>" - print "#include <linux/input.h>" - print "#include \"conf.h\"" - print - print "struct lookup_enum action_enum[] = {" -} - -/^#define/ { - printf "#ifdef %s\n", $2 - printf "\t{\"%s\",\t%s},\n", $2, $2 - print "#endif" -} - -END { - print "\t{NULL, 0}" - print "};" -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.txt.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.txt.svn-base deleted file mode 100644 index 0b2f7a91a57d1c4d657b19eda28fc8d444f4f656..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/action_enum.txt.svn-base +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright (c) 1999-2002 Vojtech Pavlik - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ - -#define KEY_ESC 1 -#define KEY_1 2 -#define KEY_2 3 -#define KEY_3 4 -#define KEY_4 5 -#define KEY_5 6 -#define KEY_6 7 -#define KEY_7 8 -#define KEY_8 9 -#define KEY_9 10 -#define KEY_0 11 -#define KEY_MINUS 12 -#define KEY_EQUAL 13 -#define KEY_BACKSPACE 14 -#define KEY_TAB 15 -#define KEY_Q 16 -#define KEY_W 17 -#define KEY_E 18 -#define KEY_R 19 -#define KEY_T 20 -#define KEY_Y 21 -#define KEY_U 22 -#define KEY_I 23 -#define KEY_O 24 -#define KEY_P 25 -#define KEY_LEFTBRACE 26 -#define KEY_RIGHTBRACE 27 -#define KEY_ENTER 28 -#define KEY_LEFTCTRL 29 -#define KEY_A 30 -#define KEY_S 31 -#define KEY_D 32 -#define KEY_F 33 -#define KEY_G 34 -#define KEY_H 35 -#define KEY_J 36 -#define KEY_K 37 -#define KEY_L 38 -#define KEY_SEMICOLON 39 -#define KEY_APOSTROPHE 40 -#define KEY_GRAVE 41 -#define KEY_LEFTSHIFT 42 -#define KEY_BACKSLASH 43 -#define KEY_Z 44 -#define KEY_X 45 -#define KEY_C 46 -#define KEY_V 47 -#define KEY_B 48 -#define KEY_N 49 -#define KEY_M 50 -#define KEY_COMMA 51 -#define KEY_DOT 52 -#define KEY_SLASH 53 -#define KEY_RIGHTSHIFT 54 -#define KEY_KPASTERISK 55 -#define KEY_LEFTALT 56 -#define KEY_SPACE 57 -#define KEY_CAPSLOCK 58 -#define KEY_F1 59 -#define KEY_F2 60 -#define KEY_F3 61 -#define KEY_F4 62 -#define KEY_F5 63 -#define KEY_F6 64 -#define KEY_F7 65 -#define KEY_F8 66 -#define KEY_F9 67 -#define KEY_F10 68 -#define KEY_NUMLOCK 69 -#define KEY_SCROLLLOCK 70 -#define KEY_KP7 71 -#define KEY_KP8 72 -#define KEY_KP9 73 -#define KEY_KPMINUS 74 -#define KEY_KP4 75 -#define KEY_KP5 76 -#define KEY_KP6 77 -#define KEY_KPPLUS 78 -#define KEY_KP1 79 -#define KEY_KP2 80 -#define KEY_KP3 81 -#define KEY_KP0 82 -#define KEY_KPDOT 83 - -#define KEY_ZENKAKUHANKAKU 85 -#define KEY_102ND 86 -#define KEY_F11 87 -#define KEY_F12 88 -#define KEY_RO 89 -#define KEY_KATAKANA 90 -#define KEY_HIRAGANA 91 -#define KEY_HENKAN 92 -#define KEY_KATAKANAHIRAGANA 93 -#define KEY_MUHENKAN 94 -#define KEY_KPJPCOMMA 95 -#define KEY_KPENTER 96 -#define KEY_RIGHTCTRL 97 -#define KEY_KPSLASH 98 -#define KEY_SYSRQ 99 -#define KEY_RIGHTALT 100 -#define KEY_LINEFEED 101 -#define KEY_HOME 102 -#define KEY_UP 103 -#define KEY_PAGEUP 104 -#define KEY_LEFT 105 -#define KEY_RIGHT 106 -#define KEY_END 107 -#define KEY_DOWN 108 -#define KEY_PAGEDOWN 109 -#define KEY_INSERT 110 -#define KEY_DELETE 111 -#define KEY_MACRO 112 -#define KEY_MUTE 113 -#define KEY_VOLUMEDOWN 114 -#define KEY_VOLUMEUP 115 -#define KEY_POWER 116 -#define KEY_KPEQUAL 117 -#define KEY_KPPLUSMINUS 118 -#define KEY_PAUSE 119 - -#define KEY_KPCOMMA 121 -#define KEY_HANGUEL 122 -#define KEY_HANJA 123 -#define KEY_YEN 124 -#define KEY_LEFTMETA 125 -#define KEY_RIGHTMETA 126 -#define KEY_COMPOSE 127 - -#define KEY_STOP 128 -#define KEY_AGAIN 129 -#define KEY_PROPS 130 -#define KEY_UNDO 131 -#define KEY_FRONT 132 -#define KEY_COPY 133 -#define KEY_OPEN 134 -#define KEY_PASTE 135 -#define KEY_FIND 136 -#define KEY_CUT 137 -#define KEY_HELP 138 -#define KEY_MENU 139 -#define KEY_CALC 140 -#define KEY_SETUP 141 -#define KEY_SLEEP 142 -#define KEY_WAKEUP 143 -#define KEY_FILE 144 -#define KEY_SENDFILE 145 -#define KEY_DELETEFILE 146 -#define KEY_XFER 147 -#define KEY_PROG1 148 -#define KEY_PROG2 149 -#define KEY_WWW 150 -#define KEY_MSDOS 151 -#define KEY_COFFEE 152 -#define KEY_DIRECTION 153 -#define KEY_CYCLEWINDOWS 154 -#define KEY_MAIL 155 -#define KEY_BOOKMARKS 156 -#define KEY_COMPUTER 157 -#define KEY_BACK 158 -#define KEY_FORWARD 159 -#define KEY_CLOSECD 160 -#define KEY_EJECTCD 161 -#define KEY_EJECTCLOSECD 162 -#define KEY_NEXTSONG 163 -#define KEY_PLAYPAUSE 164 -#define KEY_PREVIOUSSONG 165 -#define KEY_STOPCD 166 -#define KEY_RECORD 167 -#define KEY_REWIND 168 -#define KEY_PHONE 169 -#define KEY_ISO 170 -#define KEY_CONFIG 171 -#define KEY_HOMEPAGE 172 -#define KEY_REFRESH 173 -#define KEY_EXIT 174 -#define KEY_MOVE 175 -#define KEY_EDIT 176 -#define KEY_SCROLLUP 177 -#define KEY_SCROLLDOWN 178 -#define KEY_KPLEFTPAREN 179 -#define KEY_KPRIGHTPAREN 180 -#define KEY_NEW 181 -#define KEY_REDO 182 - -#define KEY_F13 183 -#define KEY_F14 184 -#define KEY_F15 185 -#define KEY_F16 186 -#define KEY_F17 187 -#define KEY_F18 188 -#define KEY_F19 189 -#define KEY_F20 190 -#define KEY_F21 191 -#define KEY_F22 192 -#define KEY_F23 193 -#define KEY_F24 194 - -#define KEY_PLAYCD 200 -#define KEY_PAUSECD 201 -#define KEY_PROG3 202 -#define KEY_PROG4 203 -#define KEY_SUSPEND 205 -#define KEY_CLOSE 206 -#define KEY_PLAY 207 -#define KEY_FASTFORWARD 208 -#define KEY_BASSBOOST 209 -#define KEY_PRINT 210 -#define KEY_HP 211 -#define KEY_CAMERA 212 -#define KEY_SOUND 213 -#define KEY_QUESTION 214 -#define KEY_EMAIL 215 -#define KEY_CHAT 216 -#define KEY_SEARCH 217 -#define KEY_CONNECT 218 -#define KEY_FINANCE 219 -#define KEY_SPORT 220 -#define KEY_SHOP 221 -#define KEY_ALTERASE 222 -#define KEY_CANCEL 223 -#define KEY_BRIGHTNESSDOWN 224 -#define KEY_BRIGHTNESSUP 225 -#define KEY_MEDIA 226 - -#define KEY_SWITCHVIDEOMODE 227 -#define KEY_KBDILLUMTOGGLE 228 -#define KEY_KBDILLUMDOWN 229 -#define KEY_KBDILLUMUP 230 - -#define KEY_SEND 231 -#define KEY_REPLY 232 -#define KEY_FORWARDMAIL 233 -#define KEY_SAVE 234 -#define KEY_DOCUMENTS 235 - -#define KEY_BATTERY 236 - -#define KEY_UNKNOWN 240 - -#define BTN_MISC 0x100 -#define BTN_0 0x100 -#define BTN_1 0x101 -#define BTN_2 0x102 -#define BTN_3 0x103 -#define BTN_4 0x104 -#define BTN_5 0x105 -#define BTN_6 0x106 -#define BTN_7 0x107 -#define BTN_8 0x108 -#define BTN_9 0x109 - -#define BTN_MOUSE 0x110 -#define BTN_LEFT 0x110 -#define BTN_RIGHT 0x111 -#define BTN_MIDDLE 0x112 -#define BTN_SIDE 0x113 -#define BTN_EXTRA 0x114 -#define BTN_FORWARD 0x115 -#define BTN_BACK 0x116 -#define BTN_TASK 0x117 - -#define BTN_JOYSTICK 0x120 -#define BTN_TRIGGER 0x120 -#define BTN_THUMB 0x121 -#define BTN_THUMB2 0x122 -#define BTN_TOP 0x123 -#define BTN_TOP2 0x124 -#define BTN_PINKIE 0x125 -#define BTN_BASE 0x126 -#define BTN_BASE2 0x127 -#define BTN_BASE3 0x128 -#define BTN_BASE4 0x129 -#define BTN_BASE5 0x12a -#define BTN_BASE6 0x12b -#define BTN_DEAD 0x12f - -#define BTN_GAMEPAD 0x130 -#define BTN_A 0x130 -#define BTN_B 0x131 -#define BTN_C 0x132 -#define BTN_X 0x133 -#define BTN_Y 0x134 -#define BTN_Z 0x135 -#define BTN_TL 0x136 -#define BTN_TR 0x137 -#define BTN_TL2 0x138 -#define BTN_TR2 0x139 -#define BTN_SELECT 0x13a -#define BTN_START 0x13b -#define BTN_MODE 0x13c -#define BTN_THUMBL 0x13d -#define BTN_THUMBR 0x13e - -#define BTN_DIGI 0x140 -#define BTN_TOOL_PEN 0x140 -#define BTN_TOOL_RUBBER 0x141 -#define BTN_TOOL_BRUSH 0x142 -#define BTN_TOOL_PENCIL 0x143 -#define BTN_TOOL_AIRBRUSH 0x144 -#define BTN_TOOL_FINGER 0x145 -#define BTN_TOOL_MOUSE 0x146 -#define BTN_TOOL_LENS 0x147 -#define BTN_TOUCH 0x14a -#define BTN_STYLUS 0x14b -#define BTN_STYLUS2 0x14c -#define BTN_TOOL_DOUBLETAP 0x14d -#define BTN_TOOL_TRIPLETAP 0x14e - -#define BTN_WHEEL 0x150 -#define BTN_GEAR_DOWN 0x150 -#define BTN_GEAR_UP 0x151 - -#define KEY_OK 0x160 -#define KEY_SELECT 0x161 -#define KEY_GOTO 0x162 -#define KEY_CLEAR 0x163 -#define KEY_POWER2 0x164 -#define KEY_OPTION 0x165 -#define KEY_INFO 0x166 -#define KEY_TIME 0x167 -#define KEY_VENDOR 0x168 -#define KEY_ARCHIVE 0x169 -#define KEY_PROGRAM 0x16a -#define KEY_CHANNEL 0x16b -#define KEY_FAVORITES 0x16c -#define KEY_EPG 0x16d -#define KEY_PVR 0x16e -#define KEY_MHP 0x16f -#define KEY_LANGUAGE 0x170 -#define KEY_TITLE 0x171 -#define KEY_SUBTITLE 0x172 -#define KEY_ANGLE 0x173 -#define KEY_ZOOM 0x174 -#define KEY_MODE 0x175 -#define KEY_KEYBOARD 0x176 -#define KEY_SCREEN 0x177 -#define KEY_PC 0x178 -#define KEY_TV 0x179 -#define KEY_TV2 0x17a -#define KEY_VCR 0x17b -#define KEY_VCR2 0x17c -#define KEY_SAT 0x17d -#define KEY_SAT2 0x17e -#define KEY_CD 0x17f -#define KEY_TAPE 0x180 -#define KEY_RADIO 0x181 -#define KEY_TUNER 0x182 -#define KEY_PLAYER 0x183 -#define KEY_TEXT 0x184 -#define KEY_DVD 0x185 -#define KEY_AUX 0x186 -#define KEY_MP3 0x187 -#define KEY_AUDIO 0x188 -#define KEY_VIDEO 0x189 -#define KEY_DIRECTORY 0x18a -#define KEY_LIST 0x18b -#define KEY_MEMO 0x18c -#define KEY_CALENDAR 0x18d -#define KEY_RED 0x18e -#define KEY_GREEN 0x18f -#define KEY_YELLOW 0x190 -#define KEY_BLUE 0x191 -#define KEY_CHANNELUP 0x192 -#define KEY_CHANNELDOWN 0x193 -#define KEY_FIRST 0x194 -#define KEY_LAST 0x195 -#define KEY_AB 0x196 -#define KEY_NEXT 0x197 -#define KEY_RESTART 0x198 -#define KEY_SLOW 0x199 -#define KEY_SHUFFLE 0x19a -#define KEY_BREAK 0x19b -#define KEY_PREVIOUS 0x19c -#define KEY_DIGITS 0x19d -#define KEY_TEEN 0x19e -#define KEY_TWEN 0x19f - -#define KEY_DEL_EOL 0x1c0 -#define KEY_DEL_EOS 0x1c1 -#define KEY_INS_LINE 0x1c2 -#define KEY_DEL_LINE 0x1c3 - -#define KEY_FN 0x1d0 -#define KEY_FN_ESC 0x1d1 -#define KEY_FN_F1 0x1d2 -#define KEY_FN_F2 0x1d3 -#define KEY_FN_F3 0x1d4 -#define KEY_FN_F4 0x1d5 -#define KEY_FN_F5 0x1d6 -#define KEY_FN_F6 0x1d7 -#define KEY_FN_F7 0x1d8 -#define KEY_FN_F8 0x1d9 -#define KEY_FN_F9 0x1da -#define KEY_FN_F10 0x1db -#define KEY_FN_F11 0x1dc -#define KEY_FN_F12 0x1dd -#define KEY_FN_1 0x1de -#define KEY_FN_2 0x1df -#define KEY_FN_D 0x1e0 -#define KEY_FN_E 0x1e1 -#define KEY_FN_F 0x1e2 -#define KEY_FN_S 0x1e3 -#define KEY_FN_B 0x1e4 - -#define KEY_BRL_DOT1 0x1f1 -#define KEY_BRL_DOT2 0x1f2 -#define KEY_BRL_DOT3 0x1f3 -#define KEY_BRL_DOT4 0x1f4 -#define KEY_BRL_DOT5 0x1f5 -#define KEY_BRL_DOT6 0x1f6 -#define KEY_BRL_DOT7 0x1f7 -#define KEY_BRL_DOT8 0x1f8 - -/* - * Relative axes - */ - -#define REL_X 0x00 -#define REL_Y 0x01 -#define REL_Z 0x02 -#define REL_RX 0x03 -#define REL_RY 0x04 -#define REL_RZ 0x05 -#define REL_HWHEEL 0x06 -#define REL_DIAL 0x07 -#define REL_WHEEL 0x08 -#define REL_MISC 0x09 - -/* - * Absolute axes - */ - -#define ABS_X 0x00 -#define ABS_Y 0x01 -#define ABS_Z 0x02 -#define ABS_RX 0x03 -#define ABS_RY 0x04 -#define ABS_RZ 0x05 -#define ABS_THROTTLE 0x06 -#define ABS_RUDDER 0x07 -#define ABS_WHEEL 0x08 -#define ABS_GAS 0x09 -#define ABS_BRAKE 0x0a -#define ABS_HAT0X 0x10 -#define ABS_HAT0Y 0x11 -#define ABS_HAT1X 0x12 -#define ABS_HAT1Y 0x13 -#define ABS_HAT2X 0x14 -#define ABS_HAT2Y 0x15 -#define ABS_HAT3X 0x16 -#define ABS_HAT3Y 0x17 -#define ABS_PRESSURE 0x18 -#define ABS_DISTANCE 0x19 -#define ABS_TILT_X 0x1a -#define ABS_TILT_Y 0x1b -#define ABS_TOOL_WIDTH 0x1c -#define ABS_VOLUME 0x20 -#define ABS_MISC 0x28 - diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.c.svn-base deleted file mode 100644 index 160bfca4f104a21bd48f8d537486d1c11208804d..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.c.svn-base +++ /dev/null @@ -1,182 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added c_wiimote_deinit - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#include <stdlib.h> - -#include <dlfcn.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -#include "cwiid.h" -#include "conf.h" -#include "util.h" -#include "wmplugin.h" - -struct c_plugin { - void *handle; - wmplugin_init_t *init; - wmplugin_exec_t *exec; -}; - -static cwiid_wiimote_t *wiimote; - -int c_init(void) -{ - return 0; -} - -int c_wiimote(cwiid_wiimote_t *arg_wiimote) -{ - wiimote = arg_wiimote; - - return 0; -} - -void c_wiimote_deinit() -{ - return; -} - -void c_deinit(void) -{ - return; -} - -#define PLUGIN_PATHNAME_LEN 128 -int c_plugin_open(struct plugin *plugin, char *dir) -{ - char pathname[PLUGIN_PATHNAME_LEN]; - struct stat buf; - wmplugin_info_t *info; - void *handle; - - snprintf(pathname, PLUGIN_PATHNAME_LEN, "%s/%s.so", dir, plugin->name); - if (stat(pathname, &buf)) { - return -1; - } - if (!(handle = dlopen(pathname, RTLD_NOW))) { - wminput_err(dlerror()); - return -1; - } - - plugin->type = PLUGIN_C; - if (!(plugin->p = malloc(sizeof(struct c_plugin)))) { - wminput_err("malloc error"); - return -1; - } - if (!(info = dlsym(handle, "wmplugin_info"))) { - wminput_err("Unable to load plugin info function: %s", - dlerror()); - free(plugin->p); - dlclose(handle); - return -1; - } - if (!(plugin->info = (*(wmplugin_info_t *)info)())) { - wminput_err("Invalid plugin info from %s", plugin->name); - free(plugin->p); - dlclose(handle); - return -1; - } - if (!(((struct c_plugin *)plugin->p)->init = dlsym(handle, - "wmplugin_init"))) { - wminput_err("Unable to load plugin init function: %s", dlerror()); - free(plugin->p); - dlclose(handle); - return -1; - } - if (!(((struct c_plugin *)plugin->p)->exec = dlsym(handle, - "wmplugin_exec"))) { - wminput_err("Unable to load plugin exec function: %s", dlerror()); - free(plugin->p); - dlclose(handle); - return -1; - } - - ((struct c_plugin *)plugin->p)->handle = handle; - - return 0; -} - -void c_plugin_close(struct plugin *plugin) -{ - dlclose(((struct c_plugin *)plugin->p)->handle); - free(plugin->p); -} - -int c_plugin_init(struct plugin *plugin, int id) -{ - return ((struct c_plugin *)plugin->p)->init(id, wiimote); -} - -int c_plugin_exec(struct plugin *plugin, int mesg_count, - union cwiid_mesg mesg[]) -{ - if (!(plugin->data = ((struct c_plugin *)plugin->p)->exec(mesg_count, - mesg))) { - return -1; - } - - return 0; -} - -int c_plugin_param_int(struct plugin *plugin, int i, int value) -{ - switch (plugin->info->param_info[i].type) { - case WMPLUGIN_PARAM_INT: - *(int *)plugin->info->param_info[i].ptr = value; - break; - case WMPLUGIN_PARAM_FLOAT: - *(float *)plugin->info->param_info[i].ptr = value; - break; - } - - return 0; -} - -int c_plugin_param_float(struct plugin *plugin, int i, float value) -{ - switch (plugin->info->param_info[i].type) { - case WMPLUGIN_PARAM_INT: - wminput_err("possible loss of precision: %s.%s (cast float to int)", - plugin->name, plugin->info->param_info[i].name); - *(int *)plugin->info->param_info[i].ptr = value; - break; - case WMPLUGIN_PARAM_FLOAT: - *(float *)plugin->info->param_info[i].ptr = value; - break; - } - - return 0; -} - -void wmplugin_err(int id, char *str, ...) -{ - va_list ap; - - va_start(ap, str); - vfprintf(stderr, str, ap); - fprintf(stderr, "\n"); - va_end(ap); -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.h.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.h.svn-base deleted file mode 100644 index 766f69055bdc7d50493bd342e8a90d420c1f74fe..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/c_plugin.h.svn-base +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added c_wiimote_deinit - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#ifndef C_PLUGIN_H -#define C_PLUGIN_H - -int c_init(void); -int c_wiimote(cwiid_wiimote_t *wiimote); -void c_wiimote_deinit(void); -void c_deinit(void); -int c_plugin_open(struct plugin *plugin, char *dir); -void c_plugin_close(struct plugin *plugin); -int c_plugin_init(struct plugin *plugin, int id); -int c_plugin_exec(struct plugin *plugin, int mesg_count, - union cwiid_mesg mesg[]); -int c_plugin_param_int(struct plugin *plugin, int i, int value); -int c_plugin_param_float(struct plugin *plugin, int i, float value); - -#endif - diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/conf.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/conf.c.svn-base deleted file mode 100644 index fe6d7a9b5ed9fcb1027499dbe06715255619165a..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/conf.c.svn-base +++ /dev/null @@ -1,630 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * added config.h include - * * added HAVE_PYTHON tests around all python code - * - * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> - * * revised error messages - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * refactored to isolate plugin logic - * - * 2007-06-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * fixed plugin->data malloc bug - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * added python plugin support - * * changed param interface (pass pointers) - * - * 2007-04-15 <work.eric@gmail.com> - * * fixed classic controller configuration bug - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * fixed pointer qualifier warning in get_plugin - * * created conf_plugin_param_{int,float} functions - * - * 2007-03-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "conf.h" -#include "util.h" -#include "y.tab.h" -#include "c_plugin.h" -#ifdef HAVE_PYTHON -#include "py_plugin.h" -#endif - -extern FILE *yyin; -extern int yyparse(); - -extern struct lookup_enum action_enum[]; -struct conf *cur_conf; - -struct plugin *get_plugin(struct conf *conf, const char *name); - -int conf_load(struct conf *conf, const char *conf_name, - char *config_search_dirs[], char *plugin_search_dirs[]) -{ - conf_init(conf); - cur_conf = conf; - - cur_conf->config_search_dirs = config_search_dirs; - cur_conf->plugin_search_dirs = plugin_search_dirs; - if (!(yyin = conf_push_config(cur_conf, conf_name, NULL))) { - return -1; - } - - if (yyparse()) { - if (fclose(yyin)) { - wminput_err("Error closing configuration file"); - } - conf_unload(cur_conf); - return -1; - } - - if (uinput_open(cur_conf)) { - conf_unload(cur_conf); - return -1; - } - - return 0; -} - -int conf_unload(struct conf *conf) -{ - int i; - - for (i=0; i < CONF_MAX_PLUGINS; i++) { - if (conf->plugins[i].name) { - free(conf->plugins[i].name); - switch (conf->plugins[i].type) { - case PLUGIN_C: - c_plugin_close(&conf->plugins[i]); - break; -#ifdef HAVE_PYTHON - case PLUGIN_PYTHON: - py_plugin_close(&conf->plugins[i]); - break; -#endif - } - } - } - - return 0; -} - -int conf_ff(struct conf *conf, unsigned char enabled) -{ - if (enabled) { - conf->ff = 1; - conf->dev.ff_effects_max = 1; - } - else { - conf->ff = 0; - conf->dev.ff_effects_max = 0; - } - - return 0; -} - -int conf_button(struct conf *conf, int source, __u16 button, __u16 action) -{ - switch (source) { - case CONF_WM: - conf->rpt_mode_flags |= CWIID_RPT_BTN; - conf->wiimote_bmap[button].active = 1; - conf->wiimote_bmap[button].action = action; - break; - case CONF_NC: - conf->rpt_mode_flags |= CWIID_RPT_NUNCHUK; - conf->nunchuk_bmap[button].active = 1; - conf->nunchuk_bmap[button].action = action; - break; - case CONF_CC: - conf->rpt_mode_flags |= CWIID_RPT_CLASSIC; - conf->classic_bmap[button].active = 1; - conf->classic_bmap[button].action = action; - break; - } - - return 0; -} - -int conf_axis(struct conf *conf, int axis, __u16 axis_type, __u16 action, - char flags) -{ - conf->amap[axis].active = 1; - conf->amap[axis].axis_type = axis_type; - conf->amap[axis].action = action; - conf->amap[axis].flags = flags; - - if (axis_type == EV_ABS) { - if (!(conf->dev.absmax[action] == -1) || - !(conf->dev.absmin[action] == -1)) { - wminput_err("Warning: duplicate absolute axis assignment"); - } - } - - switch (axis) { - case CONF_WM_AXIS_DPAD_X: - case CONF_WM_AXIS_DPAD_Y: - conf->rpt_mode_flags |= CWIID_RPT_BTN; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = 1; - conf->dev.absmin[action] = -1; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - case CONF_NC_AXIS_STICK_X: - case CONF_NC_AXIS_STICK_Y: - conf->rpt_mode_flags |= CWIID_RPT_NUNCHUK; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = 0xFF; - conf->dev.absmin[action] = 0; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - case CONF_CC_AXIS_DPAD_X: - case CONF_CC_AXIS_DPAD_Y: - conf->rpt_mode_flags |= CWIID_RPT_CLASSIC; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = 1; - conf->dev.absmin[action] = -1; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - case CONF_CC_AXIS_L_STICK_X: - case CONF_CC_AXIS_L_STICK_Y: - conf->rpt_mode_flags |= CWIID_RPT_CLASSIC; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = CWIID_CLASSIC_L_STICK_MAX; - conf->dev.absmin[action] = 0; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - case CONF_CC_AXIS_R_STICK_X: - case CONF_CC_AXIS_R_STICK_Y: - conf->rpt_mode_flags |= CWIID_RPT_CLASSIC; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = CWIID_CLASSIC_R_STICK_MAX; - conf->dev.absmin[action] = 0; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - case CONF_CC_AXIS_L: - case CONF_CC_AXIS_R: - conf->rpt_mode_flags |= CWIID_RPT_CLASSIC; - if (axis_type == EV_ABS) { - conf->dev.absmax[action] = CWIID_CLASSIC_LR_MAX; - conf->dev.absmin[action] = 0; - conf->dev.absfuzz[action] = 0; - conf->dev.absflat[action] = 0; - } - break; - } - - return 0; -} - -int conf_plugin_button(struct conf *conf, const char *name, const char *button, - __u16 action) -{ - struct plugin *plugin; - int i; - unsigned char button_found = 0; - - if ((plugin = get_plugin(conf, name)) == NULL) { - return -1; - } - - for (i=0; i < plugin->info->button_count; i++) { - if (!strcmp(plugin->info->button_info[i].name, button)) { - button_found = 1; - break; - } - } - - if (!button_found) { - wminput_err("Invalid plugin button: %s.%s", name, button); - return -1; - } - else { - plugin->bmap[i].active = 1; - plugin->bmap[i].action = action; - } - - return 0; -} - -int conf_plugin_axis(struct conf *conf, const char *name, const char *axis, - __u16 axis_type, __u16 action, char flags) -{ - struct plugin *plugin; - int i; - unsigned char axis_found = 0; - unsigned char mismatch = 0; - - if ((plugin = get_plugin(conf, name)) == NULL) { - return -1; - } - - for (i=0; i < plugin->info->axis_count; i++) { - if (!strcmp(plugin->info->axis_info[i].name, axis)) { - axis_found = 1; - break; - } - } - - if (!axis_found) { - wminput_err("Invalid plugin axis: %s.%s", name, axis); - return -1; - } - - switch (axis_type) { - case CONF_ABS: - if (!(plugin->info->axis_info[i].type & WMPLUGIN_ABS)) { - mismatch = 1; - } - break; - case CONF_REL: - if (!(plugin->info->axis_info[i].type & WMPLUGIN_REL)) { - mismatch = 1; - } - break; - } - if (mismatch) { - wminput_err("Warning: axis type mismatch - %s.%s", name, axis); - } - - plugin->amap[i].active = 1; - plugin->amap[i].axis_type = axis_type; - plugin->amap[i].action = action; - plugin->amap[i].flags = flags; - - if (axis_type == EV_ABS) { - if (!(conf->dev.absmax[action] == -1) || - !(conf->dev.absmin[action] == -1)) { - wminput_err("Warning: duplicate absolute axis assignment"); - } - - conf->dev.absmax[action] = plugin->info->axis_info[i].max; - conf->dev.absmin[action] = plugin->info->axis_info[i].min; - conf->dev.absfuzz[action] = plugin->info->axis_info[i].fuzz; - conf->dev.absflat[action] = plugin->info->axis_info[i].flat; - } - - return 0; -} - -int conf_plugin_param_int(struct conf *conf, const char *name, - const char *param, int value) -{ - struct plugin *plugin; - int i; - unsigned char param_found = 0; - - if ((plugin = get_plugin(conf, name)) == NULL) { - return -1; - } - - for (i=0; i < plugin->info->param_count; i++) { - if (!strcmp(plugin->info->param_info[i].name, param)) { - param_found = 1; - break; - } - } - - if (!param_found) { - wminput_err("Invalid plugin parameter: %s.%s", name, param); - return -1; - } - - switch (plugin->type) { - case PLUGIN_C: - if (c_plugin_param_int(plugin, i, value)) { - return -1; - } - break; -#ifdef HAVE_PYTHON - case PLUGIN_PYTHON: - if (py_plugin_param_int(plugin, i, value)) { - return -1; - } - break; -#endif - } - - return 0; -} - -int conf_plugin_param_float(struct conf *conf, const char *name, - const char *param, float value) -{ - struct plugin *plugin; - int i; - unsigned char param_found = 0; - - if ((plugin = get_plugin(conf, name)) == NULL) { - return -1; - } - - for (i=0; i < plugin->info->param_count; i++) { - if (!strcmp(plugin->info->param_info[i].name, param)) { - param_found = 1; - break; - } - } - - if (!param_found) { - wminput_err("Invalid plugin parameter: %s.%s", name, param); - return -1; - } - - switch (plugin->type) { - case PLUGIN_C: - if (c_plugin_param_float(plugin, i, value)) { - return -1; - } - break; -#ifdef HAVE_PYTHON - case PLUGIN_PYTHON: - if (py_plugin_param_float(plugin, i, value)) { - return -1; - } - break; -#endif - } - - return 0; -} - -void conf_init(struct conf *conf) -{ - int i, j; - - conf->fd = -1; - conf->config_search_dirs = NULL; - conf->plugin_search_dirs = NULL; - conf->current_config_filename = NULL; - conf->stack_index = -1; - for (i=0; i < CONF_MAX_INCLUDE_DEPTH; i++) { - conf->config_filename_stack[i] = NULL; - } - conf->rpt_mode_flags = 0; - memset(&conf->dev, 0, sizeof conf->dev); - strncpy(conf->dev.name, UINPUT_NAME, UINPUT_MAX_NAME_SIZE); - conf->dev.id.bustype = UINPUT_BUSTYPE; - conf->dev.id.vendor = UINPUT_VENDOR; - conf->dev.id.product = UINPUT_PRODUCT; - conf->dev.id.version = UINPUT_VERSION; - for (i=0; i < ABS_MAX; i++) { - conf->dev.absmax[i] = -1; - conf->dev.absmin[i] = -1; - conf->dev.absfuzz[i] = -1; - conf->dev.absflat[i] = -1; - } - conf->ff = 0; - conf->wiimote_bmap[CONF_WM_BTN_UP].mask = CWIID_BTN_UP; - conf->wiimote_bmap[CONF_WM_BTN_DOWN].mask = CWIID_BTN_DOWN; - conf->wiimote_bmap[CONF_WM_BTN_LEFT].mask = CWIID_BTN_LEFT; - conf->wiimote_bmap[CONF_WM_BTN_RIGHT].mask = CWIID_BTN_RIGHT; - conf->wiimote_bmap[CONF_WM_BTN_A].mask = CWIID_BTN_A; - conf->wiimote_bmap[CONF_WM_BTN_B].mask = CWIID_BTN_B; - conf->wiimote_bmap[CONF_WM_BTN_MINUS].mask = CWIID_BTN_MINUS; - conf->wiimote_bmap[CONF_WM_BTN_PLUS].mask = CWIID_BTN_PLUS; - conf->wiimote_bmap[CONF_WM_BTN_HOME].mask = CWIID_BTN_HOME; - conf->wiimote_bmap[CONF_WM_BTN_1].mask = CWIID_BTN_1; - conf->wiimote_bmap[CONF_WM_BTN_2].mask = CWIID_BTN_2; - conf->nunchuk_bmap[CONF_NC_BTN_C].mask = CWIID_NUNCHUK_BTN_C; - conf->nunchuk_bmap[CONF_NC_BTN_Z].mask = CWIID_NUNCHUK_BTN_Z; - conf->classic_bmap[CONF_CC_BTN_UP].mask = CWIID_CLASSIC_BTN_UP; - conf->classic_bmap[CONF_CC_BTN_DOWN].mask = CWIID_CLASSIC_BTN_DOWN; - conf->classic_bmap[CONF_CC_BTN_LEFT].mask = CWIID_CLASSIC_BTN_LEFT; - conf->classic_bmap[CONF_CC_BTN_RIGHT].mask = CWIID_CLASSIC_BTN_RIGHT; - conf->classic_bmap[CONF_CC_BTN_MINUS].mask = CWIID_CLASSIC_BTN_MINUS; - conf->classic_bmap[CONF_CC_BTN_PLUS].mask = CWIID_CLASSIC_BTN_PLUS; - conf->classic_bmap[CONF_CC_BTN_HOME].mask = CWIID_CLASSIC_BTN_HOME; - conf->classic_bmap[CONF_CC_BTN_A].mask = CWIID_CLASSIC_BTN_A; - conf->classic_bmap[CONF_CC_BTN_B].mask = CWIID_CLASSIC_BTN_B; - conf->classic_bmap[CONF_CC_BTN_X].mask = CWIID_CLASSIC_BTN_X; - conf->classic_bmap[CONF_CC_BTN_Y].mask = CWIID_CLASSIC_BTN_Y; - conf->classic_bmap[CONF_CC_BTN_ZL].mask = CWIID_CLASSIC_BTN_ZL; - conf->classic_bmap[CONF_CC_BTN_ZR].mask = CWIID_CLASSIC_BTN_ZR; - conf->classic_bmap[CONF_CC_BTN_L].mask = CWIID_CLASSIC_BTN_L; - conf->classic_bmap[CONF_CC_BTN_R].mask = CWIID_CLASSIC_BTN_R; - for (i=0; i < CONF_WM_BTN_COUNT; i++) { - conf->wiimote_bmap[i].active = 0; - } - for (i=0; i < CONF_NC_BTN_COUNT; i++) { - conf->nunchuk_bmap[i].active = 0; - } - for (i=0; i < CONF_CC_BTN_COUNT; i++) { - conf->classic_bmap[i].active = 0; - } - for (i=0; i < CONF_AXIS_COUNT; i++) { - conf->amap[i].active = 0; - conf->amap[i].axis_type = -1; - conf->amap[i].action = -1; - conf->amap[i].flags = 0; - } - for (i=0; i < CONF_MAX_PLUGINS; i++) { - conf->plugins[i].name = NULL; - conf->plugins[i].rpt_mode_flags = 0; - conf->plugins[i].prev_buttons = 0; - for (j=0; j < WMPLUGIN_MAX_BUTTON_COUNT; j++) { - conf->plugins[i].bmap[j].active = 0; - conf->plugins[i].bmap[j].mask = 1<<i; - conf->plugins[i].bmap[j].action = -1; - } - for (j=0; j < WMPLUGIN_MAX_AXIS_COUNT; j++) { - conf->plugins[i].amap[j].active = 0; - conf->plugins[i].amap[j].axis_type = -1; - conf->plugins[i].amap[j].action = -1; - conf->plugins[i].amap[j].flags = 0; - } - } -} - -#define CONF_PATHNAME_LEN 128 -FILE *conf_push_config(struct conf *conf, const char *filename, YYLTYPE *yyloc) -{ - int i; - FILE *file; - char pathname[CONF_PATHNAME_LEN]; - const char *stackname; - - if (conf->stack_index+1 >= CONF_MAX_INCLUDE_DEPTH) { - wminput_err("Maximum include depth exceeded: %s", filename); - return NULL; - } - - /* filename == / or ./ or ../ */ - if ((filename[0] == '/') || - ((filename[0] == '.') && - ((filename[1] == '/') || - ((filename[1] == '.') && (filename[2] == '/'))))) { - stackname = filename; - file = fopen(filename, "r"); - } - else { - for (i=0; conf->config_search_dirs[i]; i++) { - snprintf(pathname, CONF_PATHNAME_LEN, "%s/%s", - conf->config_search_dirs[i], filename); - if ((file = fopen(pathname, "r"))) { - stackname = pathname; - break; - } - } - } - - if (!file) { - wminput_err("File not found: %s", filename); - return NULL; - } - - conf->stack_index++; - if ((conf->config_filename_stack[conf->stack_index] = - malloc(strlen(stackname) + 1)) == NULL) { - wminput_err("Error allocating pathname"); - conf->stack_index--; - return NULL; - } - strcpy(conf->config_filename_stack[conf->stack_index], stackname); - if (yyloc) { - conf->yyloc_stack[conf->stack_index] = *yyloc; - } - - conf->current_config_filename = - conf->config_filename_stack[conf->stack_index]; - - return file; -} - -int conf_pop_config(struct conf *conf, YYLTYPE *yyloc) -{ - if (conf->stack_index == -1) { - return -1; - } - - free(conf->config_filename_stack[conf->stack_index]); - *yyloc = conf->yyloc_stack[conf->stack_index]; - - conf->stack_index--; - - conf->current_config_filename = - conf->config_filename_stack[conf->stack_index]; - - return 0; -} - -int lookup_action(const char *str_action) -{ - int i=0; - - while (action_enum[i].name) { - if (!strcmp(str_action, action_enum[i].name)) { - return action_enum[i].value; - } - i++; - } - - return -1; -} - -struct plugin *get_plugin(struct conf *conf, const char *name) -{ - int i; - char plugin_found = 0; - struct plugin *plugin; - - for (i=0; i < CONF_MAX_PLUGINS; i++) { - if (!conf->plugins[i].name) { - break; - } - else if (!strcmp(conf->plugins[i].name, name)) { - return &conf->plugins[i]; - } - } - - if (i == CONF_MAX_PLUGINS) { - wminput_err("Maximum number of plugins exceeded"); - return NULL; - } - - plugin = &conf->plugins[i]; - plugin->name = (char *)name; - - for (i=0; conf->plugin_search_dirs[i]; i++) { - if (!c_plugin_open(plugin, conf->plugin_search_dirs[i])) { - plugin_found = 1; - break; - } -#ifdef HAVE_PYTHON - if (!py_plugin_open(plugin, conf->plugin_search_dirs[i])) { - plugin_found = 1; - break; - } -#endif - } - - if (!plugin_found) { - wminput_err("Plugin not found: %s", name); - free(plugin->name); - plugin->name = NULL; - return NULL; - } - - return plugin; -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/conf.h.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/conf.h.svn-base deleted file mode 100644 index 73c299a53e1b240abdc4f75ae9ae1574560cb17e..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/conf.h.svn-base +++ /dev/null @@ -1,223 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * added config.h include - * * added HAVE_PYTHON tests around all python code - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * refactored to isolate plugin logic - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * added python plugin support - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * added conf_plugin_param_{int,float} prototypes - * - * 2007-04-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * added stdio.h include - * - * 2007-03-02 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifndef CONF_H -#define CONF_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdint.h> -#include <stdio.h> -#include <linux/input.h> -#include <linux/uinput.h> - -#include "cwiid.h" -#include "wmplugin.h" -#include "y.tab.h" - -#define CONF_WM 1 -#define CONF_NC 2 -#define CONF_CC 3 - -#define CONF_WM_BTN_UP 0 -#define CONF_WM_BTN_DOWN 1 -#define CONF_WM_BTN_LEFT 2 -#define CONF_WM_BTN_RIGHT 3 -#define CONF_WM_BTN_A 4 -#define CONF_WM_BTN_B 5 -#define CONF_WM_BTN_MINUS 6 -#define CONF_WM_BTN_PLUS 7 -#define CONF_WM_BTN_HOME 8 -#define CONF_WM_BTN_1 9 -#define CONF_WM_BTN_2 10 - -#define CONF_NC_BTN_C 0 -#define CONF_NC_BTN_Z 1 - -#define CONF_CC_BTN_UP 0 -#define CONF_CC_BTN_DOWN 1 -#define CONF_CC_BTN_LEFT 2 -#define CONF_CC_BTN_RIGHT 3 -#define CONF_CC_BTN_MINUS 4 -#define CONF_CC_BTN_PLUS 5 -#define CONF_CC_BTN_HOME 6 -#define CONF_CC_BTN_A 7 -#define CONF_CC_BTN_B 8 -#define CONF_CC_BTN_X 9 -#define CONF_CC_BTN_Y 10 -#define CONF_CC_BTN_ZL 11 -#define CONF_CC_BTN_ZR 12 -#define CONF_CC_BTN_L 13 -#define CONF_CC_BTN_R 14 - -#define CONF_WM_BTN_COUNT 11 -#define CONF_NC_BTN_COUNT 2 -#define CONF_CC_BTN_COUNT 15 - -#define CONF_WM_AXIS_DPAD_X 0 -#define CONF_WM_AXIS_DPAD_Y 1 -#define CONF_NC_AXIS_STICK_X 2 -#define CONF_NC_AXIS_STICK_Y 3 -#define CONF_CC_AXIS_DPAD_X 4 -#define CONF_CC_AXIS_DPAD_Y 5 -#define CONF_CC_AXIS_L_STICK_X 6 -#define CONF_CC_AXIS_L_STICK_Y 7 -#define CONF_CC_AXIS_R_STICK_X 8 -#define CONF_CC_AXIS_R_STICK_Y 9 -#define CONF_CC_AXIS_L 10 -#define CONF_CC_AXIS_R 11 - -#define CONF_AXIS_COUNT 12 - -#define CONF_MAX_PLUGINS 6 - -#define CONF_ABS EV_ABS -#define CONF_REL EV_REL - -/* flags */ -#define CONF_INVERT 0x01 -#define CONF_POINTER 0x02 - -#define UINPUT_NAME "Nintendo Wiimote" -#ifdef BUS_BLUETOOTH -#define UINPUT_BUSTYPE BUS_BLUETOOTH -#else -#define UINPUT_BUSTYPE BUS_USB -#endif -#define UINPUT_VENDOR 0x0001 -#define UINPUT_PRODUCT 0x0001 -#ifndef UINPUT_VERSION -#define UINPUT_VERSION 0x0001 -#endif - -struct lookup_enum { - const char *name; - __u16 value; -}; - -struct btn_map { - unsigned char active; - uint16_t mask; - __u16 action; -}; - -struct axis_map { - unsigned char active; - __u16 axis_type; - __u16 action; - uint8_t flags; -}; - -enum plugin_type { - PLUGIN_C, -#ifdef HAVE_PYTHON - PLUGIN_PYTHON -#endif -}; - -struct plugin { - char *name; - enum plugin_type type; - uint8_t rpt_mode_flags; - struct wmplugin_info *info; - struct wmplugin_data *data; - uint16_t prev_buttons; - struct btn_map bmap[WMPLUGIN_MAX_BUTTON_COUNT]; - struct axis_map amap[WMPLUGIN_MAX_AXIS_COUNT]; - void *p; -}; - -#define CONF_MAX_INCLUDE_DEPTH 10 - -struct conf { - int fd; - char **config_search_dirs; - char **plugin_search_dirs; - char *current_config_filename; - int stack_index; - char *config_filename_stack[CONF_MAX_INCLUDE_DEPTH]; - YYLTYPE yyloc_stack[CONF_MAX_INCLUDE_DEPTH]; - uint8_t rpt_mode_flags; - struct uinput_user_dev dev; - unsigned char ff; - struct btn_map wiimote_bmap[CONF_WM_BTN_COUNT]; - struct btn_map nunchuk_bmap[CONF_NC_BTN_COUNT]; - struct btn_map classic_bmap[CONF_CC_BTN_COUNT]; - struct axis_map amap[CONF_AXIS_COUNT]; - struct plugin plugins[CONF_MAX_PLUGINS]; -}; - -struct uinput_listen_data { - cwiid_wiimote_t *wiimote; - struct conf *conf; -}; - -int conf_load(struct conf *conf, const char *conf_name, - char *config_search_dirs[], char *plugin_search_dirs[]); -int conf_unload(struct conf *conf); - -int conf_ff(struct conf *conf, unsigned char enabled); -int conf_button(struct conf *conf, int source, __u16 button, __u16 action); -int conf_axis(struct conf *conf, int axis, __u16 axis_type, __u16 action, - char flags); -int conf_plugin_button(struct conf *conf, const char *name, const char *button, - __u16 action); -int conf_plugin_axis(struct conf *conf, const char *name, const char *axis, - __u16 axis_type, __u16 action, char flags); -int conf_plugin_param_int(struct conf *conf, const char *name, - const char *param, int value); -int conf_plugin_param_float(struct conf *conf, const char *name, - const char *param, float value); - -void conf_init(struct conf *conf); -FILE *conf_push_config(struct conf *conf, const char *filename, YYLTYPE *yyloc); -int conf_pop_config(struct conf *conf, YYLTYPE *yyloc); -int lookup_action(const char *str_action); - -int uinput_open(struct conf *conf); -int uinput_close(struct conf *conf); -int send_event(struct conf *conf, __u16 type, __u16 code, __s32 value); -void *uinput_listen(struct uinput_listen_data *data); - -#endif - diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/lexer.l.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/lexer.l.svn-base deleted file mode 100644 index 271fff2bc8223f7929508cb0597e5c8d66e1c7db..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/lexer.l.svn-base +++ /dev/null @@ -1,200 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * added param rules - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -%{ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "conf.h" -#include "util.h" -#include "y.tab.h" - -#define step \ - do { \ - yylloc.first_line = yylloc.last_line; \ - yylloc.first_column = yylloc.last_column; \ - yylloc.last_column += strlen(yytext); \ - } while(0) - -#define step_nl \ - do { \ - yylloc.first_line = yylloc.last_line; \ - yylloc.first_column = yylloc.last_column; \ - yylloc.last_line++; \ - yylloc.last_column = 0; \ - } while (0) - -extern struct conf *cur_conf; -%} - -WM Wiimote\. -NC Nunchuk\. -CC Classic\. -PLUGIN Plugin\. -ID [[:alnum:]_][[:alnum:]_-]* -ACTION (KEY|BTN|ABS|REL)_[[:alnum:]_]+ -FILENAME [[:alnum:]_.-]+ -INT [0-9]+ -FLOAT [0-9]+(\.[0-9]*)?([eE][+/-]?[0-9]+)? -BLANK [[:blank:]]+ - -%option nounput -%x inc postinc -%% -^include { - yylloc.first_line = yylloc.last_line; - yylloc.first_column = yylloc.last_column; - yylloc.last_line++; - yylloc.last_column = strlen(yytext) -1; - BEGIN(inc); - } -<inc>{BLANK} { step; } -<inc>{FILENAME} { - FILE *file; - step; - if ((file = conf_push_config(cur_conf, yytext, &yylloc))) { - yypush_buffer_state(yy_create_buffer(file, - YY_BUF_SIZE)); - yylloc.first_line = yylloc.last_line = 0; - yylloc.first_column = yylloc.last_column = 0; - } - BEGIN(INITIAL); - } -<<EOF>> { - yypop_buffer_state(); - conf_pop_config(cur_conf, &yylloc); - if (YY_CURRENT_BUFFER) { - BEGIN(postinc); - } - else { - yyterminate(); - } - } -<postinc>\n { step_nl; BEGIN(INITIAL); } - -#[^\n]* { step; } -<*>{BLANK} { step; } -[-\.=~] { step; return *yytext; } -\n { step_nl; return '\n'; } - -{WM}Rumble { step; return WM_RUMBLE; } - -{WM}Up { step; yylval.Int = CONF_WM_BTN_UP; return WM_BTN; } -{WM}Down { step; yylval.Int = CONF_WM_BTN_DOWN; return WM_BTN; } -{WM}Left { step; yylval.Int = CONF_WM_BTN_LEFT; return WM_BTN; } -{WM}Right { step; yylval.Int = CONF_WM_BTN_RIGHT; return WM_BTN; } -{WM}A { step; yylval.Int = CONF_WM_BTN_A; return WM_BTN; } -{WM}B { step; yylval.Int = CONF_WM_BTN_B; return WM_BTN; } -{WM}Minus { step; yylval.Int = CONF_WM_BTN_MINUS; return WM_BTN; } -{WM}Plus { step; yylval.Int = CONF_WM_BTN_PLUS; return WM_BTN; } -{WM}Home { step; yylval.Int = CONF_WM_BTN_HOME; return WM_BTN; } -{WM}1 { step; yylval.Int = CONF_WM_BTN_1; return WM_BTN; } -{WM}2 { step; yylval.Int = CONF_WM_BTN_2; return WM_BTN; } - -{NC}C { step; yylval.Int = CONF_NC_BTN_C; return NC_BTN; } -{NC}Z { step; yylval.Int = CONF_NC_BTN_Z; return NC_BTN; } - -{CC}Up { step; yylval.Int = CONF_CC_BTN_UP; return CC_BTN; } -{CC}Down { step; yylval.Int = CONF_CC_BTN_DOWN; return CC_BTN; } -{CC}Left { step; yylval.Int = CONF_CC_BTN_LEFT; return CC_BTN; } -{CC}Right { step; yylval.Int = CONF_CC_BTN_RIGHT; return CC_BTN; } -{CC}Minus { step; yylval.Int = CONF_CC_BTN_MINUS; return CC_BTN; } -{CC}Plus { step; yylval.Int = CONF_CC_BTN_PLUS; return CC_BTN; } -{CC}Home { step; yylval.Int = CONF_CC_BTN_HOME; return CC_BTN; } -{CC}A { step; yylval.Int = CONF_CC_BTN_A; return CC_BTN; } -{CC}B { step; yylval.Int = CONF_CC_BTN_B; return CC_BTN; } -{CC}X { step; yylval.Int = CONF_CC_BTN_X; return CC_BTN; } -{CC}Y { step; yylval.Int = CONF_CC_BTN_Y; return CC_BTN; } -{CC}ZL { step; yylval.Int = CONF_CC_BTN_ZL; return CC_BTN; } -{CC}ZR { step; yylval.Int = CONF_CC_BTN_ZR; return CC_BTN; } -{CC}L { step; yylval.Int = CONF_CC_BTN_L; return CC_BTN; } -{CC}R { step; yylval.Int = CONF_CC_BTN_R; return CC_BTN; } - - -{WM}Dpad\.X { step; yylval.Int = CONF_WM_AXIS_DPAD_X; return AXIS; } -{WM}Dpad\.Y { step; yylval.Int = CONF_WM_AXIS_DPAD_Y; return AXIS; } - -{NC}Stick\.X { step; yylval.Int = CONF_NC_AXIS_STICK_X; return AXIS; } -{NC}Stick\.Y { step; yylval.Int = CONF_NC_AXIS_STICK_Y; return AXIS; } - -{CC}Dpad\.X { step; yylval.Int = CONF_CC_AXIS_DPAD_X; return AXIS; } -{CC}Dpad\.Y { step; yylval.Int = CONF_CC_AXIS_DPAD_Y; return AXIS; } -{CC}LStick\.X { step; yylval.Int = CONF_CC_AXIS_L_STICK_X;return AXIS; } -{CC}LStick\.Y { step; yylval.Int = CONF_CC_AXIS_L_STICK_Y;return AXIS; } -{CC}RStick\.X { step; yylval.Int = CONF_CC_AXIS_R_STICK_X;return AXIS; } -{CC}RStick\.Y { step; yylval.Int = CONF_CC_AXIS_R_STICK_Y;return AXIS; } -{CC}LAnalog { step; yylval.Int = CONF_CC_AXIS_L; return AXIS; } -{CC}RAnalog { step; yylval.Int = CONF_CC_AXIS_R; return AXIS; } - -{PLUGIN} { step; return PLUGIN; } - -On { step; yylval.Int = -1; return ON_OFF; } -Off { step; yylval.Int = 0; return ON_OFF; } - -{INT} { step; yylval.Int = atoi(yytext); return INT; } -{FLOAT} { step; yylval.Float = atof(yytext); return FLOAT; } - -{ACTION} { - step; - yylval.Int = lookup_action(yytext); - if (yylval.Int == -1) { - wminput_err("unknown identifier %s", - yytext); - } - else { - switch (*yytext) { - case 'K': - case 'B': - return BTN_ACTION; - break; - case 'A': - return ABS_AXIS_ACTION; - break; - case 'R': - return REL_AXIS_ACTION; - break; - } - } - } - -{ID} { - step; - yylval.String = malloc(strlen(yytext) + 1); - if (!yylval.String) { - wminput_err("error on malloc"); - } - else { - strcpy(yylval.String, yytext); - return ID; - } - } - -. { step; wminput_err("unexpected character %c", *yytext); } -%% - -int yywrap() -{ - return -1; -} - diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/main.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/main.c.svn-base deleted file mode 100644 index fafb0c9d84182d8dc900cc04c70e93efe2440be4..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/main.c.svn-base +++ /dev/null @@ -1,774 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added daemon, quiet, and reconnect options - * - * 2007-07-29 L. Donnie Smith <cwiid@abstrakraft.org> - * * fixed wait forever logic - * - * 2007-07-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * added config.h include - * * use PACKAGE_VERSION from config.h instead of CWIID_VERSION - * * added HAVE_PYTHON tests around all python code - * - * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> - * * revised error messages - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * refactored to isolate plugin logic - * - * 2007-06-01 Nick <nickishappy@gmail.com> - * * reworked command-line options (added standard options, long options) - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * added python plugin support - * * pass mesg instead of &mesg to wmplugin_exec - * - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_{connect,disconnect,command} to - * cwiid_{open,close,request_status|set_led|set_rumble|set_rpt_mode} - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added timestamp to message callback - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * update for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * exit on cwiid_error - * - * 2007-03-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <errno.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <getopt.h> - -#include <pthread.h> -#include <signal.h> -#include <sys/types.h> -#include <unistd.h> - -#include <cwiid.h> - -#include "conf.h" -#include "util.h" -#include "wmplugin.h" -#include "c_plugin.h" - -#ifdef HAVE_PYTHON -#include "py_plugin.h" -#endif - -struct conf conf; - -/* Prototypes */ -cwiid_mesg_callback_t cwiid_callback; -int wminput_set_report_mode(); -void process_btn_mesg(struct cwiid_btn_mesg *mesg); -void process_nunchuk_mesg(struct cwiid_nunchuk_mesg *mesg); -void process_classic_mesg(struct cwiid_classic_mesg *mesg); -void process_plugin(struct plugin *, int, union cwiid_mesg []); - -/* Globals */ -cwiid_wiimote_t *wiimote; -char init; - -#define DEFAULT_CONFIG_FILE "default" - -#define HOME_DIR_LEN 128 - -void print_usage(void) -{ - printf("wminput is a program that allows you to use a wiimote as a standard input device\n"); - printf("Usage: %s [OPTIONS]...\n\n", "wminput"); - printf("Options:\n"); - printf("\t-h, --help\t\tPrints this output.\n"); - printf("\t-v, --version\t\tOutput version information and exit.\n"); - printf("\t-c, --config [file]\tChoose config file to use.\n"); - printf("\t-d, --daemon\t\tImplies -q, -r, and -w.\n"); - printf("\t-q, --quiet\t\tReduce output to errors\n"); - printf("\t-r, --reconnect [wait]\tAutomatically try reconnect after wiimote disconnect.\n"); - printf("\t-w, --wait\t\tWait indefinitely for wiimote to connect.\n"); -} - -void cwiid_err_connect(struct wiimote *wiimote, const char *str, va_list ap) -{ - /* TODO: temporary kludge to stifle error messages from cwiid_open */ - if (errno != EHOSTDOWN) { - vfprintf(stderr, str, ap); - fprintf(stderr, "\n"); - } -} - -int main(int argc, char *argv[]) -{ - char wait_forever = 0, quiet = 0, reconnect = 0, reconnect_wait = 0; - char *config_search_dirs[3], *plugin_search_dirs[3]; - char *config_filename = DEFAULT_CONFIG_FILE; - char home_config_dir[HOME_DIR_LEN]; - char home_plugin_dir[HOME_DIR_LEN]; - char *tmp; - int c, i; - char *str_addr; - bdaddr_t bdaddr, current_bdaddr; - sigset_t sigset; - int signum, ret=0; - struct uinput_listen_data uinput_listen_data; - pthread_t uinput_listen_thread; - - init = 1; - - /* Parse Options */ - while (1) { - int option_index = 0; - - static struct option long_options[] = { - {"help", 0, 0, 'h'}, - {"version", 0, 0, 'v'}, - {"config", 1, 0, 'c'}, - {"daemon", 0, 0, 'd'}, - {"quiet", 0, 0, 'q'}, - {"reconnect", 2, 0, 'r'}, - {"wait", 0, 0, 'w'}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "hvc:dqr::w", long_options, &option_index); - - if (c == -1) { - break; - } - - switch (c) { - case 'h': - print_usage(); - return 0; - break; - case 'v': - printf("CWiid Version %s\n", PACKAGE_VERSION); - return 0; - break; - case 'c': - config_filename = optarg; - break; - case 'd': - wait_forever = 1; - quiet = 1; - reconnect = 1; - break; - case 'q': - quiet = 1; - break; - case 'r': - reconnect = 1; - if (optarg) { - reconnect_wait = strtol(optarg, &tmp, 10); - if (*tmp != '\0') { - wminput_err("bad reconnect wait time"); - return -1; - } - } - break; - case 'w': - wait_forever = 1; - break; - case '?': - printf("Try `wminput --help` for more information\n"); - return 1; - break; - default: - return -1; - break; - } - } - - if (c_init()) { - return -1; - } - -#ifdef HAVE_PYTHON - if (py_init()) { - return -1; - } -#endif - - /* Load Config */ - /* Setup search directory arrays */ - if ((tmp = getenv("HOME")) == NULL) { - wminput_err("Unable to find home directory"); - config_search_dirs[0] = WMINPUT_CONFIG_DIR; - plugin_search_dirs[0] = CWIID_PLUGINS_DIR; - config_search_dirs[1] = plugin_search_dirs[1] = NULL; - } - else { - snprintf(home_config_dir, HOME_DIR_LEN, "%s/.cwiid/wminput", tmp); - snprintf(home_plugin_dir, HOME_DIR_LEN, "%s/.cwiid/plugins", tmp); - config_search_dirs[0] = home_config_dir; - plugin_search_dirs[0] = home_plugin_dir; - config_search_dirs[1] = WMINPUT_CONFIG_DIR; - plugin_search_dirs[1] = CWIID_PLUGINS_DIR; - config_search_dirs[2] = plugin_search_dirs[2] = NULL; - } - - if (conf_load(&conf, config_filename, config_search_dirs, - plugin_search_dirs)) { - return -1; - } - - /* Determine BDADDR */ - /* priority: command-line option, environment variable, BDADDR_ANY */ - if (optind < argc) { - if (str2ba(argv[optind], &bdaddr)) { - wminput_err("invalid bdaddr"); - bdaddr = *BDADDR_ANY; - } - optind++; - if (optind < argc) { - wminput_err("invalid command-line"); - print_usage(); - conf_unload(&conf); - return -1; - } - } - else if ((str_addr = getenv(WIIMOTE_BDADDR)) != NULL) { - if (str2ba(str_addr, &bdaddr)) { - wminput_err("invalid address in %s", WIIMOTE_BDADDR); - bdaddr = *BDADDR_ANY; - } - } - else { - bdaddr = *BDADDR_ANY; - } - - sigemptyset(&sigset); - sigaddset(&sigset, SIGTERM); - sigaddset(&sigset, SIGINT); - sigaddset(&sigset, SIGUSR1); - - do { - bacpy(¤t_bdaddr, &bdaddr); - - /* Wiimote Connect */ - if (!quiet) { - printf("Put Wiimote in discoverable mode now (press 1+2)...\n"); - } - if (wait_forever) { - if (!bacmp(¤t_bdaddr, BDADDR_ANY)) { - if (cwiid_find_wiimote(¤t_bdaddr, -1)) { - wminput_err("error finding wiimote"); - conf_unload(&conf); - return -1; - } - } - /* TODO: avoid continuously calling cwiid_open */ - cwiid_set_err(cwiid_err_connect); - while (!(wiimote = cwiid_open(¤t_bdaddr, CWIID_FLAG_MESG_IFC))); - cwiid_set_err(cwiid_err_default); - } - else { - if ((wiimote = cwiid_open(¤t_bdaddr, CWIID_FLAG_MESG_IFC)) == NULL) { - wminput_err("unable to connect"); - conf_unload(&conf); - return -1; - } - } - if (cwiid_set_mesg_callback(wiimote, &cwiid_callback)) { - wminput_err("error setting callback"); - conf_unload(&conf); - return -1; - } - - if (c_wiimote(wiimote)) { - conf_unload(&conf); - return -1; - } -#ifdef HAVE_PYTHON - if (py_wiimote(wiimote)) { - conf_unload(&conf); - return -1; - } -#endif - - /* init plugins */ - for (i=0; (i < CONF_MAX_PLUGINS) && conf.plugins[i].name; i++) { - switch (conf.plugins[i].type) { - case PLUGIN_C: - if (c_plugin_init(&conf.plugins[i], i)) { - wminput_err("error on %s init", conf.plugins[i].name); - conf_unload(&conf); - cwiid_close(wiimote); - return -1; - } - break; -#ifdef HAVE_PYTHON - case PLUGIN_PYTHON: - if (py_plugin_init(&conf.plugins[i], i)) { - wminput_err("error %s init", conf.plugins[i].name); - conf_unload(&conf); - cwiid_close(wiimote); - return -1; - } - break; -#endif - } - } - - if (wminput_set_report_mode()) { - conf_unload(&conf); - cwiid_close(wiimote); - return -1; - } - - uinput_listen_data.wiimote = wiimote; - uinput_listen_data.conf = &conf; - if (pthread_create(&uinput_listen_thread, NULL, - (void *(*)(void *))uinput_listen, - &uinput_listen_data)) { - wminput_err("error starting uinput listen thread"); - conf_unload(&conf); - cwiid_close(wiimote); - return -1; - } - - if (!quiet) { - printf("Ready.\n"); - } - - init = 0; - - /* wait */ - sigprocmask(SIG_BLOCK, &sigset, NULL); - sigwait(&sigset, &signum); - sigprocmask(SIG_UNBLOCK, &sigset, NULL); - - if ((signum == SIGTERM) || (signum == SIGINT)) { - reconnect = 0; - } - - if (pthread_cancel(uinput_listen_thread)) { - wminput_err("Error canceling uinput listen thread"); - ret = -1; - } - else if (pthread_join(uinput_listen_thread, NULL)) { - wminput_err("Error joining uinput listen thread"); - ret = -1; - } - - c_wiimote_deinit(); -#ifdef HAVE_PYTHON - py_wiimote_deinit(); -#endif - - /* disconnect */ - if (cwiid_close(wiimote)) { - wminput_err("Error on wiimote disconnect"); - ret = -1; - } - - if (reconnect && reconnect_wait) { - sleep(reconnect_wait); - } - } while (reconnect); - - if (conf_unload(&conf)) { - ret = -1; - } - - c_deinit(); -#ifdef HAVE_PYTHON - py_deinit(); -#endif - - if (!quiet) { - printf("Exiting.\n"); - } - - return ret; -} - -int wminput_set_report_mode() -{ - unsigned char rpt_mode_flags; - int i; - - rpt_mode_flags = conf.rpt_mode_flags; - - for (i=0; (i < CONF_MAX_PLUGINS) && conf.plugins[i].name; i++) { - rpt_mode_flags |= conf.plugins[i].rpt_mode_flags; - } - - if (cwiid_set_rpt_mode(wiimote, rpt_mode_flags)) { - wminput_err("Error setting report mode"); - return -1; - } - - return 0; -} - -int wmplugin_set_rpt_mode(int id, uint8_t flags) -{ - conf.plugins[id].rpt_mode_flags = flags; - - if (!init) { - wminput_set_report_mode(); - } - - return 0; -} - -void cwiid_callback(cwiid_wiimote_t *wiimote, int mesg_count, - union cwiid_mesg mesg[], struct timespec *timestamp) -{ - int i; - - for (i=0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_BTN: - process_btn_mesg((struct cwiid_btn_mesg *) &mesg[i]); - break; - case CWIID_MESG_NUNCHUK: - process_nunchuk_mesg((struct cwiid_nunchuk_mesg *) &mesg[i]); - break; - case CWIID_MESG_CLASSIC: - process_classic_mesg((struct cwiid_classic_mesg *) &mesg[i]); - break; - case CWIID_MESG_ERROR: - if (kill(getpid(),SIGUSR1)) { - wminput_err("Error sending SIGUSR1"); - } - break; - default: - break; - } - } - for (i=0; (i < CONF_MAX_PLUGINS) && conf.plugins[i].name; i++) { - process_plugin(&conf.plugins[i], mesg_count, mesg); - } - send_event(&conf, EV_SYN, SYN_REPORT, 0); -} - -void process_btn_mesg(struct cwiid_btn_mesg *mesg) -{ - static uint16_t prev_buttons = 0; - uint16_t pressed, released; - __s32 axis_value; - int i; - - /* Wiimote Button/Key Events */ - pressed = mesg->buttons & ~prev_buttons; - released = ~mesg->buttons & prev_buttons; - for (i=0; i < CONF_WM_BTN_COUNT; i++) { - if (conf.wiimote_bmap[i].active) { - if (pressed & conf.wiimote_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.wiimote_bmap[i].action, 1); - } - else if (released & conf.wiimote_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.wiimote_bmap[i].action, 0); - } - } - } - prev_buttons = mesg->buttons; - - /* Wiimote.Dpad.X */ - if (conf.amap[CONF_WM_AXIS_DPAD_X].active) { - axis_value = 0; - if (mesg->buttons & CWIID_BTN_LEFT) { - axis_value = -1; - } - else if (mesg->buttons & CWIID_BTN_RIGHT) { - axis_value = 1; - } - if (conf.amap[CONF_WM_AXIS_DPAD_X].flags & CONF_INVERT) { - axis_value *= -1; - } - send_event(&conf, conf.amap[CONF_WM_AXIS_DPAD_X].axis_type, - conf.amap[CONF_WM_AXIS_DPAD_X].action, axis_value); - } - - /* Wiimote.Dpad.Y */ - if (conf.amap[CONF_WM_AXIS_DPAD_Y].active) { - axis_value = 0; - if (mesg->buttons & CWIID_BTN_DOWN) { - axis_value = -1; - } - else if (mesg->buttons & CWIID_BTN_UP) { - axis_value = 1; - } - if (conf.amap[CONF_WM_AXIS_DPAD_Y].flags & CONF_INVERT) { - axis_value *= -1; - } - send_event(&conf, conf.amap[CONF_WM_AXIS_DPAD_Y].axis_type, - conf.amap[CONF_WM_AXIS_DPAD_Y].action, axis_value); - } -} - -void process_nunchuk_mesg(struct cwiid_nunchuk_mesg *mesg) -{ - static uint8_t prev_buttons = 0; - uint8_t pressed, released; - __s32 axis_value; - int i; - - /* Nunchuk Button/Key Events */ - pressed = mesg->buttons & ~prev_buttons; - released = ~mesg->buttons & prev_buttons; - for (i=0; i < CONF_NC_BTN_COUNT; i++) { - if (conf.nunchuk_bmap[i].active) { - if (pressed & conf.nunchuk_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.nunchuk_bmap[i].action, 1); - } - else if (released & conf.nunchuk_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.nunchuk_bmap[i].action, 0); - } - } - } - prev_buttons = mesg->buttons; - - /* Nunchuk.Stick.X */ - if (conf.amap[CONF_NC_AXIS_STICK_X].active) { - axis_value = mesg->stick[CWIID_X]; - if (conf.amap[CONF_NC_AXIS_STICK_X].flags & CONF_INVERT) { - axis_value = 0xFF - axis_value; - } - send_event(&conf, conf.amap[CONF_NC_AXIS_STICK_X].axis_type, - conf.amap[CONF_NC_AXIS_STICK_X].action, axis_value); - } - - /* Nunchuk.Stick.Y */ - if (conf.amap[CONF_NC_AXIS_STICK_Y].active) { - axis_value = mesg->stick[CWIID_Y]; - if (conf.amap[CONF_NC_AXIS_STICK_Y].flags & CONF_INVERT) { - axis_value = 0xFF - axis_value; - } - send_event(&conf, conf.amap[CONF_NC_AXIS_STICK_Y].axis_type, - conf.amap[CONF_NC_AXIS_STICK_Y].action, axis_value); - } -} - -void process_classic_mesg(struct cwiid_classic_mesg *mesg) -{ - static uint16_t prev_buttons = 0; - uint16_t pressed, released; - __s32 axis_value; - int i; - - /* Classic Button/Key Events */ - pressed = mesg->buttons & ~prev_buttons; - released = ~mesg->buttons & prev_buttons; - for (i=0; i < CONF_CC_BTN_COUNT; i++) { - if (conf.classic_bmap[i].active) { - if (pressed & conf.classic_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.classic_bmap[i].action, 1); - } - else if (released & conf.classic_bmap[i].mask) { - send_event(&conf, EV_KEY, conf.classic_bmap[i].action, 0); - } - } - } - prev_buttons = mesg->buttons; - - /* Classic.Dpad.X */ - if (conf.amap[CONF_CC_AXIS_DPAD_X].active) { - axis_value = 0; - if (mesg->buttons & CWIID_CLASSIC_BTN_LEFT) { - axis_value = -1; - } - else if (mesg->buttons & CWIID_CLASSIC_BTN_RIGHT) { - axis_value = 1; - } - if (conf.amap[CONF_CC_AXIS_DPAD_X].flags & CONF_INVERT) { - axis_value *= -1; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_DPAD_X].axis_type, - conf.amap[CONF_CC_AXIS_DPAD_X].action, axis_value); - } - - /* Classic.Dpad.Y */ - if (conf.amap[CONF_CC_AXIS_DPAD_Y].active) { - axis_value = 0; - if (mesg->buttons & CWIID_CLASSIC_BTN_DOWN) { - axis_value = -1; - } - else if (mesg->buttons & CWIID_CLASSIC_BTN_UP) { - axis_value = 1; - } - if (conf.amap[CONF_CC_AXIS_DPAD_Y].flags & CONF_INVERT) { - axis_value *= -1; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_DPAD_Y].axis_type, - conf.amap[CONF_CC_AXIS_DPAD_Y].action, axis_value); - } - - /* Classic.LStick.X */ - if (conf.amap[CONF_CC_AXIS_L_STICK_X].active) { - axis_value = mesg->l_stick[CWIID_X]; - if (conf.amap[CONF_CC_AXIS_L_STICK_X].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_L_STICK_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_L_STICK_X].axis_type, - conf.amap[CONF_CC_AXIS_L_STICK_X].action, axis_value); - } - - /* Classic.LStick.Y */ - if (conf.amap[CONF_CC_AXIS_L_STICK_Y].active) { - axis_value = mesg->l_stick[CWIID_Y]; - if (conf.amap[CONF_CC_AXIS_L_STICK_Y].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_L_STICK_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_L_STICK_Y].axis_type, - conf.amap[CONF_CC_AXIS_L_STICK_Y].action, axis_value); - } - - /* Classic.RStick.X */ - if (conf.amap[CONF_CC_AXIS_R_STICK_X].active) { - axis_value = mesg->r_stick[CWIID_X]; - if (conf.amap[CONF_CC_AXIS_R_STICK_X].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_R_STICK_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_R_STICK_X].axis_type, - conf.amap[CONF_CC_AXIS_R_STICK_X].action, axis_value); - } - - /* Classic.RStick.Y */ - if (conf.amap[CONF_CC_AXIS_R_STICK_Y].active) { - axis_value = mesg->r_stick[CWIID_Y]; - if (conf.amap[CONF_CC_AXIS_R_STICK_Y].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_R_STICK_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_R_STICK_Y].axis_type, - conf.amap[CONF_CC_AXIS_R_STICK_Y].action, axis_value); - } - - /* Classic.LAnalog */ - if (conf.amap[CONF_CC_AXIS_L].active) { - axis_value = mesg->l; - if (conf.amap[CONF_CC_AXIS_L].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_LR_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_L].axis_type, - conf.amap[CONF_CC_AXIS_L].action, axis_value); - } - - /* Classic.RAnalog */ - if (conf.amap[CONF_CC_AXIS_R].active) { - axis_value = mesg->r; - if (conf.amap[CONF_CC_AXIS_R].flags & CONF_INVERT) { - axis_value = CWIID_CLASSIC_LR_MAX - axis_value; - } - send_event(&conf, conf.amap[CONF_CC_AXIS_R].axis_type, - conf.amap[CONF_CC_AXIS_R].action, axis_value); - } -} - -void process_plugin(struct plugin *plugin, int mesg_count, - union cwiid_mesg mesg[]) -{ - static union cwiid_mesg plugin_mesg[CWIID_MAX_MESG_COUNT]; - int plugin_mesg_count = 0; - int i; - uint8_t flag; - uint16_t pressed, released; - __s32 axis_value; - - for (i=0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_STATUS: - flag = CWIID_RPT_STATUS; - break; - case CWIID_MESG_BTN: - flag = CWIID_RPT_BTN; - break; - case CWIID_MESG_ACC: - flag = CWIID_RPT_ACC; - break; - case CWIID_MESG_IR: - flag = CWIID_RPT_IR; - break; - case CWIID_MESG_NUNCHUK: - flag = CWIID_RPT_NUNCHUK; - break; - case CWIID_MESG_CLASSIC: - flag = CWIID_RPT_CLASSIC; - break; - default: - break; - } - if (plugin->rpt_mode_flags & flag) { - /* TODO: copy correct (smaller) message size */ - memcpy(&plugin_mesg[plugin_mesg_count++], &mesg[i], sizeof mesg[i]); - } - } - - if (plugin_mesg_count > 0) { - switch (plugin->type) { - case PLUGIN_C: - if (c_plugin_exec(plugin, plugin_mesg_count, plugin_mesg)) { - return; - } - break; -#ifdef HAVE_PYTHON - case PLUGIN_PYTHON: - if (py_plugin_exec(plugin, plugin_mesg_count, plugin_mesg)) { - return; - } - break; -#endif - } - - /* Plugin Button/Key Events */ - pressed = plugin->data->buttons & ~plugin->prev_buttons; - released = ~plugin->data->buttons & plugin->prev_buttons; - for (i=0; i < plugin->info->button_count; i++) { - if (plugin->bmap[i].active) { - if (pressed & 1<<i) { - send_event(&conf, EV_KEY, plugin->bmap[i].action, 1); - } - else if (released & 1<<i) { - send_event(&conf, EV_KEY, plugin->bmap[i].action, 0); - } - } - } - plugin->prev_buttons = plugin->data->buttons; - - /* Plugin Axis Events */ - for (i=0; i < plugin->info->axis_count; i++) { - if (plugin->amap[i].active && plugin->data->axes && - plugin->data->axes[i].valid) { - axis_value = plugin->data->axes[i].value; - if (plugin->amap[i].flags & CONF_INVERT) { - axis_value = plugin->info->axis_info[i].max + - plugin->info->axis_info[i].min - axis_value; - } - send_event(&conf, plugin->amap[i].axis_type, - plugin->amap[i].action, axis_value); - } - } - } -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/parser.y.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/parser.y.svn-base deleted file mode 100644 index 32eb218abffae316b7ad4713e7b3d210b0f5aeb3..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/parser.y.svn-base +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * added param rules - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -%{ -#include <stdarg.h> -#include <stdio.h> -#include <linux/input.h> -#include "conf.h" -#include "util.h" - -int yylex(void); -void yyerror(char const *, ...); - -extern struct conf *cur_conf; -%} - -%union { - int Int; - float Float; - char *String; -} - -%error-verbose -%locations - -%token <Int> INT ON_OFF WM_BTN NC_BTN CC_BTN BTN_ACTION AXIS ABS_AXIS_ACTION - REL_AXIS_ACTION -%token <Float> FLOAT -%token <String> ID -%token WM_RUMBLE PLUGIN - -%start conf_list - -%type <Int> sign pointer -%% - -conf_list: - /* empty */ - | conf_list conf_line -; - -conf_line: - '\n' - | conf_item '\n' -; - -conf_item: - WM_RUMBLE '=' ON_OFF - { conf_ff(cur_conf, $3); } - | WM_BTN '=' BTN_ACTION - { conf_button(cur_conf, CONF_WM, $1, $3); } - | NC_BTN '=' BTN_ACTION - { conf_button(cur_conf, CONF_NC, $1, $3); } - | CC_BTN '=' BTN_ACTION - { conf_button(cur_conf, CONF_CC, $1, $3); } - | AXIS '=' sign pointer ABS_AXIS_ACTION - { conf_axis(cur_conf, $1, CONF_ABS, $5, $3 | $4); } - | AXIS '=' sign REL_AXIS_ACTION - { conf_axis(cur_conf, $1, CONF_REL, $4, $3); } - | PLUGIN ID '.' ID '=' BTN_ACTION - { conf_plugin_button(cur_conf, $2, $4, $6); } - | PLUGIN ID '.' ID '=' sign pointer ABS_AXIS_ACTION - { conf_plugin_axis(cur_conf, $2, $4, CONF_ABS, $8, $6 | $7); } - | PLUGIN ID '.' ID '=' sign REL_AXIS_ACTION - { conf_plugin_axis(cur_conf, $2, $4, CONF_REL, $7, $6); } - | PLUGIN ID '.' ID '=' INT - { conf_plugin_param_int(cur_conf, $2, $4, $6); } - | PLUGIN ID '.' ID '=' FLOAT - { conf_plugin_param_float(cur_conf, $2, $4, $6); } -; - -sign: - /* empty */ - { $$ = 0; } - | '-' { $$ = CONF_INVERT; } -; - -pointer: - /* empty */ - { $$ = 0; } - | '~' { $$ = CONF_POINTER; } -%% - -void yyerror(char const *s, ...) -{ - va_list ap; - - va_start(ap, s); - wminput_err("%s: line %d, column %d:", cur_conf->current_config_filename, - yylloc.first_line, yylloc.first_column); - wminput_err((char *)s, ap); - va_end(ap); -} - diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.c.svn-base deleted file mode 100644 index 086cb5bd3e7a999eccef576461c320dc3aed50eb..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.c.svn-base +++ /dev/null @@ -1,626 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added py_wiimote_deinit - * - * 2007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * supress error for nonexistent python plugins - * - * 2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> - * * revised error messages - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * relocated all python plugin logic here - * * now imports plugins without changing directories - * - * 2007-06-03 L. Donnie Smith <cwiid@abstrakraft.org> - * * added WMPLUGIN_ABS and WMPLUGIN_REL constants - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#include "Python.h" - -#include <stdint.h> -#include <stdlib.h> - -#include <unistd.h> - -#include "structmember.h" -#include "cwiid.h" - -#include "wmplugin.h" -#include "conf.h" -#include "util.h" - -/* TODO: print error messages */ -/* TODO: improve error checking */ - -struct py_plugin { - PyObject *PyInfo; - PyObject *handle; - PyObject *init; - PyObject *exec; -}; - -static PyObject *PyCWiidModule = NULL; -static PyObject *PySysModule = NULL; -static PyObject *PyPath = NULL; -static PyObject *PyWiimote = NULL; -static PyObject *(*ConvertMesgArray)(int, union cwiid_mesg[]); - -static int py_plugin_info(struct plugin *, PyObject *); -static PyObject *set_rpt_mode(PyObject *, PyObject *, PyObject *); - -#define WMPLUGIN_CONST_MACRO(a) {#a, WMPLUGIN_##a} -static struct { - char *name; - int value; -} wmplugin_constants[] = { - WMPLUGIN_CONST_MACRO(ABS), - WMPLUGIN_CONST_MACRO(REL), - WMPLUGIN_CONST_MACRO(PARAM_INT), - WMPLUGIN_CONST_MACRO(PARAM_FLOAT), - {NULL, 0} -}; - -static PyMethodDef Module_Methods[] = -{ - {"set_rpt_mode", (PyCFunction)set_rpt_mode, METH_VARARGS | METH_KEYWORDS, - "set_rpt_mode(id, rpt_mode)\n\nset the plugin report mode"}, - {NULL, NULL, 0, NULL} -}; - -int py_init(void) -{ - PyObject *PyObj, *PyWmPluginModule; - int i; - - Py_InitializeEx(0); - - if (!(PyCWiidModule = PyImport_ImportModule("cwiid"))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!(PySysModule = PyImport_ImportModule("sys"))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!(PyPath = PyObject_GetAttrString(PySysModule, "path"))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!(PyObj = PyObject_GetAttrString(PyCWiidModule, - "ConvertMesgArray"))) { - PyErr_Print(); - goto ERR_HND; - } - ConvertMesgArray = PyCObject_AsVoidPtr(PyObj); - Py_DECREF(PyObj); - - /* note: PyWmPluginModule is a borrowed reference - do not decref */ - if (!(PyWmPluginModule = Py_InitModule3("wmplugin", Module_Methods, - "wminput plugin interface"))) { - PyErr_Print(); - goto ERR_HND; - } - - for (i = 0; wmplugin_constants[i].name; i++) { - if (PyModule_AddIntConstant(PyWmPluginModule, - wmplugin_constants[i].name, - wmplugin_constants[i].value)) { - PyErr_Print(); - goto ERR_HND; - } - } - - return 0; - -ERR_HND: - if (PyCWiidModule) { - Py_DECREF(PyCWiidModule); - PyCWiidModule = NULL; - } - - if (PyPath) { - Py_DECREF(PyPath); - PyPath = NULL; - } - - if (PySysModule) { - Py_DECREF(PySysModule); - PySysModule = NULL; - } - - Py_Finalize(); - - return -1; -} - -int py_wiimote(cwiid_wiimote_t *wiimote) -{ - PyObject *PyWiimoteType, *PyCObject, *PyArgs; - - if (!(PyWiimoteType = PyObject_GetAttrString(PyCWiidModule, "Wiimote"))) { - PyErr_Print(); - return -1; - } - - if (!(PyCObject = PyCObject_FromVoidPtr(wiimote, NULL))) { - PyErr_Print(); - Py_DECREF(PyWiimoteType); - return -1; - } - - if (!(PyArgs = Py_BuildValue("(O)", PyCObject))) { - PyErr_Print(); - Py_DECREF(PyCObject); - Py_DECREF(PyWiimoteType); - return -1; - } - - Py_DECREF(PyCObject); - - if (!(PyWiimote = PyObject_CallObject(PyWiimoteType, PyArgs))) { - PyErr_Print(); - Py_DECREF(PyArgs); - Py_DECREF(PyWiimoteType); - return -1; - } - - Py_DECREF(PyArgs); - Py_DECREF(PyWiimoteType); - - return 0; -} - -void py_wiimote_deinit() -{ - Py_DECREF(PyWiimote); -} - -void py_deinit(void) -{ - Py_DECREF(PyCWiidModule); - Py_DECREF(PyPath); - Py_DECREF(PySysModule); - Py_Finalize(); -} - -int py_plugin_open(struct plugin *plugin, char *dir) -{ - PyObject *handle, *info; - PyObject *PyStr; - PyObject *PyErrType, *PyErr, *PyTraceback; - - if (!(PyStr = PyString_FromString(dir))) { - PyErr_Print(); - return -1; - } - - if (PyList_Insert(PyPath, 0, PyStr)) { - Py_DECREF(PyStr); - return -1; - } - - if (!(handle = PyImport_ImportModule(plugin->name))) { - /* ignore "module not found" errors in top level module */ - PyErr_Fetch(&PyErrType, &PyErr, &PyTraceback); - PyErr_NormalizeException(&PyErrType, &PyErr, &PyTraceback); - if (PyErr_GivenExceptionMatches(PyErr, PyExc_ImportError) && - !PyTraceback) { - Py_XDECREF(PyErrType); - Py_XDECREF(PyErr); - } - else { - PyErr_Restore(PyErrType, PyErr, PyTraceback); - PyErr_Print(); - } - - if (PySequence_DelItem(PyPath, 0)) { - PyErr_Print(); - } - Py_DECREF(PyStr); - return -1; - } - - if (PySequence_DelItem(PyPath, 0)) { - PyErr_Print(); - } - Py_DECREF(PyStr); - - if (!(plugin->p = malloc(sizeof(struct py_plugin)))) { - wminput_err("Error allocating py_plugin"); - return -1; - } - - plugin->type = PLUGIN_PYTHON; - plugin->info = NULL; - plugin->data = NULL; - ((struct py_plugin *) plugin->p)->init = NULL; - ((struct py_plugin *) plugin->p)->exec = NULL; - - if (!(plugin->info = malloc(sizeof *plugin->info))) { - wminput_err("Error allocating plugin info"); - goto ERR_HND; - } - if (!(plugin->data = malloc(sizeof *plugin->data))) { - wminput_err("Error allocating plugin data"); - goto ERR_HND; - } - if (!(((struct py_plugin *)plugin->p)->init = - PyObject_GetAttrString(handle, "wmplugin_init"))) { - PyErr_Print(); - goto ERR_HND; - } - if (!PyCallable_Check(((struct py_plugin *)plugin->p)->init)) { - wminput_err("Unable to load plugin init function: not callable"); - goto ERR_HND; - } - if (!(((struct py_plugin *)plugin->p)->exec = - PyObject_GetAttrString(handle, "wmplugin_exec"))) { - PyErr_Print(); - goto ERR_HND; - } - if (!PyCallable_Check(((struct py_plugin *)plugin->p)->exec)) { - wminput_err("Unable to load plugin exec function: not callable"); - goto ERR_HND; - } - if (!(info = PyObject_GetAttrString(handle, "wmplugin_info"))) { - PyErr_Print(); - goto ERR_HND; - } - if (!PyCallable_Check(info)) { - wminput_err("Unable to load plugin info function: not callable"); - Py_DECREF((PyObject *)info); - goto ERR_HND; - } - if (py_plugin_info(plugin, info)) { - wminput_err("Error on python_info"); - Py_DECREF((PyObject *)info); - goto ERR_HND; - } - Py_DECREF((PyObject *)info); - - ((struct py_plugin *) plugin->p)->handle = handle; - - return 0; - -ERR_HND: - if (plugin->info) { - free(plugin->info); - } - if (plugin->data) { - free(plugin->data); - } - if (plugin->p) { - if (((struct py_plugin *)plugin->p)->init) { - Py_DECREF(((struct py_plugin *)plugin->p)->init); - } - if (((struct py_plugin *)plugin->p)->exec) { - Py_DECREF(((struct py_plugin *)plugin->p)->exec); - } - free(plugin->p); - } - Py_DECREF(handle); - return -1; -} - -void py_plugin_close(struct plugin *plugin) -{ - free(plugin->info); - free(plugin->data); - Py_DECREF(((struct py_plugin *)plugin->p)->PyInfo); - Py_DECREF(((struct py_plugin *)plugin->p)->init); - Py_DECREF(((struct py_plugin *)plugin->p)->exec); - Py_DECREF(((struct py_plugin *)plugin->p)->handle); - free(plugin->p); -} - -static int py_plugin_info(struct plugin *plugin, PyObject *info) -{ - PyObject *PyButtonInfo, *PyAxisInfo, *PyParamInfo; - PyObject *PyObj; - int i; - - if (!(((struct py_plugin *)plugin->p)->PyInfo = - PyObject_CallObject(info, NULL))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!PyArg_ParseTuple(((struct py_plugin *)plugin->p)->PyInfo, "OOO", - &PyButtonInfo, &PyAxisInfo, &PyParamInfo)) { - PyErr_Print(); - goto ERR_HND; - } - - if (!(PySequence_Check(PyButtonInfo) && PySequence_Check(PyAxisInfo) && - PySequence_Check(PyParamInfo))) { - wminput_err("Type error in wminput_info: info not sequences"); - goto ERR_HND; - } - - plugin->info->button_count = PySequence_Size(PyButtonInfo); - for (i=0; i < plugin->info->button_count; i++) { - if (!(PyObj = PySequence_GetItem(PyButtonInfo, i))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!(plugin->info->button_info[i].name = PyString_AsString(PyObj))) { - PyErr_Print(); - Py_DECREF(PyObj); - goto ERR_HND; - } - - Py_DECREF(PyObj); - } - - plugin->info->axis_count = PySequence_Size(PyAxisInfo); - for (i=0; i < plugin->info->axis_count; i++) { - unsigned int type; - - if (!(PyObj = PySequence_GetItem(PyAxisInfo, i))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!PyArg_ParseTuple(PyObj, "sIiiii", - &plugin->info->axis_info[i].name, - &type, - &plugin->info->axis_info[i].max, - &plugin->info->axis_info[i].min, - &plugin->info->axis_info[i].fuzz, - &plugin->info->axis_info[i].flat)) { - PyErr_Print(); - Py_DECREF(PyObj); - goto ERR_HND; - } - - plugin->info->axis_info[i].type = type; - - Py_DECREF(PyObj); - } - - plugin->info->param_count = PySequence_Size(PyParamInfo); - for (i=0; i < plugin->info->param_count; i++) { - if (!(PyObj = PySequence_GetItem(PyParamInfo, i))) { - PyErr_Print(); - goto ERR_HND; - } - - if (!PyArg_ParseTuple(PyObj, "siO", &plugin->info->param_info[i].name, - &plugin->info->param_info[i].type, - &plugin->info->param_info[i].ptr)) { - PyErr_Print(); - Py_DECREF(PyObj); - goto ERR_HND; - } - - Py_DECREF(PyObj); - } - - return 0; - -ERR_HND: - if (((struct py_plugin *)plugin->p)->PyInfo) { - Py_DECREF(((struct py_plugin *)plugin->p)->PyInfo); - } - - return -1; -} - -int py_plugin_init(struct plugin *plugin, int id) -{ - PyObject *PyArgs; - - if (!(PyArgs = Py_BuildValue("(i,O)", id, PyWiimote))) { - PyErr_Print(); - return -1; - } - - if (!PyObject_CallObject(((struct py_plugin *)plugin->p)->init, PyArgs)) { - PyErr_Print(); - Py_DECREF(PyArgs); - return -1; - } - - Py_DECREF(PyArgs); - - return 0; -} - -int py_plugin_exec(struct plugin *plugin, int mesg_count, - union cwiid_mesg mesg[]) -{ - PyObject *PyArgs, *PyMesg, *PyData, *PyButtonData, *PyAxisData, *PyObj; - int i; - - if (!(PyMesg = ConvertMesgArray(mesg_count, mesg))) { - PyErr_Print(); - return -1; - } - - if (!(PyArgs = Py_BuildValue("(O)", PyMesg))) { - PyErr_Print(); - Py_DECREF(PyMesg); - return -1; - } - - Py_DECREF(PyMesg); - - if (!(PyData = PyObject_CallObject(((struct py_plugin *)plugin->p)->exec, - PyArgs))) { - PyErr_Print(); - Py_DECREF(PyArgs); - return -1; - } - - Py_DECREF(PyArgs); - - if (!PyArg_ParseTuple(PyData, "OO", &PyButtonData, &PyAxisData)) { - PyErr_Print(); - Py_DECREF(PyData); - return -1; - } - - if (!(PySequence_Check(PyButtonData) && PySequence_Check(PyAxisData))) { - wminput_err("Type error on wminput_exec: exec not sequences"); - Py_DECREF(PyData); - return -1; - } - - if (PySequence_Size(PyButtonData) != plugin->info->button_count) { - wminput_err("Type error on wminput_exec: bad button sequence"); - Py_DECREF(PyData); - return -1; - } - plugin->data->buttons = 0; - for (i=0; i < plugin->info->button_count; i++) { - if (!(PyObj = PySequence_GetItem(PyButtonData, i))) { - PyErr_Print(); - Py_DECREF(PyData); - return -1; - } - - if (PyObj == Py_True) { - plugin->data->buttons |= 1<<i; - } - else if (PyObj != Py_False) { - wminput_err("Type error on wminput_exec: bad button value"); - Py_DECREF(PyObj); - Py_DECREF(PyData); - return -1; - } - - Py_DECREF(PyObj); - } - - if (PySequence_Size(PyAxisData) != plugin->info->axis_count) { - wminput_err("Error on wminput_exec: bad axis sequence"); - Py_DECREF(PyData); - return -1; - } - for (i=0; i < plugin->info->axis_count; i++) { - if (!(PyObj = PySequence_GetItem(PyAxisData, i))) { - PyErr_Print(); - Py_DECREF(PyData); - return -1; - } - - if (PyObj == Py_None) { - plugin->data->axes[i].valid = 0; - } - else if (!PyInt_Check(PyObj)) { - wminput_err("Type error on wminput_exec: bad axis value"); - Py_DECREF(PyObj); - Py_DECREF(PyData); - return -1; - } - else { - plugin->data->axes[i].valid = 1; - plugin->data->axes[i].value = PyInt_AsLong(PyObj); - } - - Py_DECREF(PyObj); - } - - Py_DECREF(PyData); - - return 0; -} - -int py_plugin_param_int(struct plugin *plugin, int i, int value) -{ - PyObject *PyObj; - - switch (plugin->info->param_info[i].type) { - case WMPLUGIN_PARAM_INT: - PyObj = PyInt_FromLong(value); - if (PyObject_SetAttrString(((struct py_plugin *)plugin->p)->handle, - plugin->info->param_info[i].name, - PyObj)) { - PyErr_Print(); - return -1; - } - break; - case WMPLUGIN_PARAM_FLOAT: - PyObj = PyFloat_FromDouble((double)value); - if (PyObject_SetAttrString(((struct py_plugin *)plugin->p)->handle, - plugin->info->param_info[i].name, - PyObj)) { - PyErr_Print(); - return -1; - } - break; - } - - return 0; -} - -int py_plugin_param_float(struct plugin *plugin, int i, float value) -{ - PyObject *PyObj; - - switch (plugin->info->param_info[i].type) { - case WMPLUGIN_PARAM_INT: - wminput_err("possible loss of precision: %s.%s (cast float to int)", - plugin->name, plugin->info->param_info[i].name); - PyObj = PyInt_FromLong((int)value); - if (PyObject_SetAttrString(((struct py_plugin *)plugin->p)->handle, - plugin->info->param_info[i].name, - PyObj)) { - PyErr_Print(); - return -1; - } - break; - case WMPLUGIN_PARAM_FLOAT: - PyObj = PyFloat_FromDouble((double)value); - if (PyObject_SetAttrString(((struct py_plugin *)plugin->p)->handle, - plugin->info->param_info[i].name, - PyObj)) { - PyErr_Print(); - return -1; - } - break; - } - - return 0; -} - -static PyObject *set_rpt_mode(PyObject *self, PyObject *args, PyObject *kwds) -{ - static char *kwlist[] = {"id", "rpt_mode", NULL}; - int id, rpt_mode; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ii:wmplugin:set_rpt_mode", - kwlist, &id, &rpt_mode)) { - return NULL; - } - - if (wmplugin_set_rpt_mode(id, rpt_mode)) { - return NULL; - } - - Py_RETURN_NONE; -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.h.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.h.svn-base deleted file mode 100644 index e3eda362064297f12246c952ec6f37078c9de14f..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/py_plugin.h.svn-base +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-08-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * added py_wiimote_deinit - * - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * refactored to isolate plugin logic - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#ifndef PY_PLUGIN_H -#define PY_PLUGIN_H - -int py_init(void); -int py_wiimote(cwiid_wiimote_t *wiimote); -void py_wiimote_deinit(void); -void py_deinit(void); -int py_plugin_open(struct plugin *plugin, char *dir); -void py_plugin_close(struct plugin *plugin); -int py_plugin_init(struct plugin *plugin, int id); -int py_plugin_exec(struct plugin *plugin, int mesg_count, - union cwiid_mesg mesg[]); -int py_plugin_param_int(struct plugin *plugin, int i, int value); -int py_plugin_param_float(struct plugin *plugin, int i, float value); - -#endif diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/uinput.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/uinput.c.svn-base deleted file mode 100644 index e3fceae799aad32772b3b0b69587964c77c75bcb..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/uinput.c.svn-base +++ /dev/null @@ -1,292 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_{connect,disconnect,command} to - * cwiid_{open,close,request_status|set_led|set_rumble|set_rpt_mode} - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@anstrakraft.org> - * * fixed signed/unsigned comparison warning in uinput_open - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#include <stdint.h> -#include <string.h> - -#include <fcntl.h> -#include <sys/ioctl.h> -#include <sys/types.h> -#include <unistd.h> - -#include <linux/input.h> -#include <linux/uinput.h> - -#include "conf.h" -#include "util.h" - -/* UInput */ -char *uinput_filename[] = {"/dev/uinput", "/dev/input/uinput", - "/dev/misc/uinput"}; -#define UINPUT_FILENAME_COUNT (sizeof(uinput_filename)/sizeof(char *)) - -int uinput_open(struct conf *conf) -{ - unsigned int i; - int j; - int request; - - /* Open uinput device */ - for (i=0; i < UINPUT_FILENAME_COUNT; i++) { - if ((conf->fd = open(uinput_filename[i], O_RDWR)) >= 0) { - break; - } - } - if (conf->fd < 0) { - wminput_err("unable to open uinput"); - return -1; - } - - if (write(conf->fd, &conf->dev, sizeof conf->dev) != sizeof conf->dev) { - wminput_err("error on uinput device setup"); - close(conf->fd); - return -1; - } - - if (conf->ff) { - if (ioctl(conf->fd, UI_SET_EVBIT, EV_FF) < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - if (ioctl(conf->fd, UI_SET_FFBIT, FF_RUMBLE) < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - } - - if (ioctl(conf->fd, UI_SET_EVBIT, EV_KEY) < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - - for (i=0; i < CONF_WM_BTN_COUNT; i++) { - if (conf->wiimote_bmap[i].active) { - if (ioctl(conf->fd, UI_SET_KEYBIT, conf->wiimote_bmap[i].action) - < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - for (i=0; i < CONF_NC_BTN_COUNT; i++) { - if (conf->nunchuk_bmap[i].active) { - if (ioctl(conf->fd, UI_SET_KEYBIT, conf->nunchuk_bmap[i].action) - < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - for (i=0; i < CONF_CC_BTN_COUNT; i++) { - if (conf->classic_bmap[i].active) { - if (ioctl(conf->fd, UI_SET_KEYBIT, conf->classic_bmap[i].action) - < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - for (i=0; i < CONF_AXIS_COUNT; i++) { - if (conf->amap[i].active) { - if (ioctl(conf->fd, UI_SET_EVBIT, conf->amap[i].axis_type) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - request = (conf->amap[i].axis_type == EV_ABS) ? UI_SET_ABSBIT - : UI_SET_RELBIT; - if (ioctl(conf->fd, request, conf->amap[i].action) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - if ((conf->amap[i].flags & CONF_POINTER) && - (conf->amap[i].axis_type == EV_ABS) && - ((conf->amap[i].action == ABS_X) || - (conf->amap[i].action == ABS_Y) || - (conf->amap[i].action == ABS_Z))) { - if (ioctl(conf->fd, UI_SET_EVBIT, EV_REL) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - if (ioctl(conf->fd, UI_SET_RELBIT, conf->amap[i].action) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - } - for (i=0; i < CONF_MAX_PLUGINS; i++) { - if (conf->plugins[i].name) { - for (j=0; j < conf->plugins[i].info->button_count; j++) { - if (conf->plugins[i].bmap[j].active) { - if (ioctl(conf->fd, UI_SET_KEYBIT, - conf->plugins[i].bmap[j].action) < 0) { - wminput_err("error on uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - for (j=0; j < conf->plugins[i].info->axis_count; j++) { - if (conf->plugins[i].amap[j].active) { - if (ioctl(conf->fd, UI_SET_EVBIT, - conf->plugins[i].amap[j].axis_type) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - request = (conf->plugins[i].amap[j].axis_type == EV_ABS) - ? UI_SET_ABSBIT - : UI_SET_RELBIT; - if (ioctl(conf->fd, request, - conf->plugins[i].amap[j].action) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - if ((conf->plugins[i].amap[j].flags & CONF_POINTER) && - (conf->plugins[i].amap[j].axis_type == EV_ABS) && - ((conf->plugins[i].amap[j].action == ABS_X) || - (conf->plugins[i].amap[j].action == ABS_Y) || - (conf->plugins[i].amap[j].action == ABS_Z))) { - if (ioctl(conf->fd, UI_SET_EVBIT, EV_REL) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - if (ioctl(conf->fd, UI_SET_RELBIT, - conf->plugins[i].amap[j].action) < 0) { - wminput_err("error uinput ioctl"); - close(conf->fd); - return -1; - } - } - } - } - } - } - - if (ioctl(conf->fd, UI_DEV_CREATE) < 0) { - wminput_err("Error on uinput dev create"); - close(conf->fd); - return -1; - } - - return 0; -} - -int uinput_close(struct conf *conf) -{ - if (close(conf->fd)) { - wminput_err("Error on uinput close"); - return -1; - } - - return 0; -} - -int send_event(struct conf *conf, __u16 type, __u16 code, __s32 value) -{ - struct input_event event; - - memset(&event, 0, sizeof(event)); - event.type = type; - event.code = code; - event.value = value; - - if (write(conf->fd, &event, sizeof(event)) != sizeof(event)) { - wminput_err("Error on send_event"); - return -1; - } - - return 0; -} - -void *uinput_listen(struct uinput_listen_data *data) -{ - size_t len; - struct input_event event; - struct uinput_ff_upload upload; - struct uinput_ff_erase erase; - - do { - if ((len = read(data->conf->fd, &event, sizeof event)) != - sizeof event) { - wminput_err("Error on uinput read"); - continue; - } - - switch (event.type) { - case EV_UINPUT: - switch (event.code) { - case UI_FF_UPLOAD: - erase.request_id = event.value; - if (ioctl(data->conf->fd, UI_BEGIN_FF_UPLOAD, &upload) < 0) { - wminput_err("Error on ff upload begin"); - } - if (cwiid_set_rumble(data->wiimote, 1)) { - wminput_err("Error setting rumble"); - } - if (ioctl(data->conf->fd, UI_END_FF_UPLOAD, &upload) < 0) { - wminput_err("Error on ff upload end"); - } - break; - case UI_FF_ERASE: - erase.request_id = event.value; - if (ioctl(data->conf->fd, UI_BEGIN_FF_ERASE, &erase) < 0) { - wminput_err("Error on ff erase begin"); - } - if (cwiid_set_rumble(data->wiimote, 0)) { - wminput_err("Error clearing rumble"); - } - if (ioctl(data->conf->fd, UI_END_FF_ERASE, &erase) < 0) { - wminput_err("Error on ff erase end"); - } - break; - default: - break; - } - break; - default: - break; - } - } while (-1); -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/util.c.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/util.c.svn-base deleted file mode 100644 index 77c0eac1ebe58c9210ab2cad7ce3e0b1b8437917..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/util.c.svn-base +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-05 L. Donnie Smith <cwiid@abstrakraft.org> - * * refactored to isolate plugin logic - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#include <stdarg.h> -#include <stdio.h> - -#include "wmplugin.h" - -void wminput_err(char *str, ...) -{ - va_list ap; - - va_start(ap, str); - vfprintf(stderr, str, ap); - fprintf(stderr, "\n"); - va_end(ap); -} diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/util.h.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/util.h.svn-base deleted file mode 100644 index 264eae83a9506d3d13110baa964c1c3fd0fbf938..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/util.h.svn-base +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - */ - -#ifndef UTIL_H -#define UTIL_H - -void wminput_err(char *str, ...); - -#endif diff --git a/l2ork_addons/cwiid/wminput/.svn/text-base/wmplugin.h.svn-base b/l2ork_addons/cwiid/wminput/.svn/text-base/wmplugin.h.svn-base deleted file mode 100644 index 5e4e8c2e6d87784abeb587f26b27f8aa2265f5e9..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/.svn/text-base/wmplugin.h.svn-base +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed wmplugin_exec prototype (pass mesg instead of &mesg) - * * changed param interface (pass pointers) - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * added param structs - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * type audit (stdint, const, char booleans) - */ - -#ifndef WMPLUGIN_H -#define WMPLUGIN_H - -#include <stdint.h> -#include <linux/input.h> -#include <cwiid.h> - -#define WMPLUGIN_MAX_BUTTON_COUNT 16 -#define WMPLUGIN_MAX_AXIS_COUNT 6 -#define WMPLUGIN_MAX_PARAM_COUNT 16 - -#define WMPLUGIN_ABS 1 -#define WMPLUGIN_REL 2 - -struct wmplugin_button_info { - char *name; -}; - -struct wmplugin_axis_info { - char *name; - __u16 type; - int max; - int min; - int fuzz; - int flat; -}; - -enum wmplugin_param_type { - WMPLUGIN_PARAM_INT, - WMPLUGIN_PARAM_FLOAT -}; - -struct wmplugin_param_info { - char *name; - enum wmplugin_param_type type; - void *ptr; -}; - -struct wmplugin_info { - unsigned char button_count; - struct wmplugin_button_info button_info[WMPLUGIN_MAX_BUTTON_COUNT]; - unsigned char axis_count; - struct wmplugin_axis_info axis_info[WMPLUGIN_MAX_AXIS_COUNT]; - unsigned char param_count; - struct wmplugin_param_info param_info[WMPLUGIN_MAX_PARAM_COUNT]; -}; - -struct wmplugin_axis { - char valid; - __s32 value; -}; - -struct wmplugin_data { - uint16_t buttons; - struct wmplugin_axis axes[WMPLUGIN_MAX_AXIS_COUNT]; -}; - -typedef struct wmplugin_info *wmplugin_info_t(void); -typedef int wmplugin_init_t(int, cwiid_wiimote_t *); -typedef struct wmplugin_data *wmplugin_exec_t(int, union cwiid_mesg []); - -int wmplugin_set_rpt_mode(int id, uint8_t rpt_mode); -void wmplugin_err(int id, char *str, ...); - -#endif diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/configs/.svn/all-wcprops deleted file mode 100644 index 7129d11fff57c942a30a2c34dfd38d156d4214b7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/all-wcprops +++ /dev/null @@ -1,53 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/182/trunk/wminput/configs -END -ir_ptr -K 25 -svn:wc:ra_dav:version-url -V 51 -/cwiid/svn/!svn/ver/76/trunk/wminput/configs/ir_ptr -END -nunchuk_acc_ptr -K 25 -svn:wc:ra_dav:version-url -V 60 -/cwiid/svn/!svn/ver/76/trunk/wminput/configs/nunchuk_acc_ptr -END -acc_led -K 25 -svn:wc:ra_dav:version-url -V 53 -/cwiid/svn/!svn/ver/181/trunk/wminput/configs/acc_led -END -neverball -K 25 -svn:wc:ra_dav:version-url -V 54 -/cwiid/svn/!svn/ver/76/trunk/wminput/configs/neverball -END -acc_ptr -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/76/trunk/wminput/configs/acc_ptr -END -buttons -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/76/trunk/wminput/configs/buttons -END -gamepad -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/14/trunk/wminput/configs/gamepad -END -nunchuk_stick2btn -K 25 -svn:wc:ra_dav:version-url -V 63 -/cwiid/svn/!svn/ver/182/trunk/wminput/configs/nunchuk_stick2btn -END diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/entries b/l2ork_addons/cwiid/wminput/configs/.svn/entries deleted file mode 100644 index 3a7e3209adbb335f1bfe5d4351e5522b304420dc..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/entries +++ /dev/null @@ -1,300 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/configs -http://abstrakraft.org/cwiid/svn - - - -2008-06-24T19:43:05.601828Z -182 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -ir_ptr -file - - - - -2009-10-18T02:00:40.000000Z -fcc02e610767d9531a08c2d572bc5e95 -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -76 - -nunchuk_acc_ptr -file - - - - -2009-10-18T02:00:40.000000Z -564cedef2403c34e16685b135e4684bc -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -93 - -acc_led -file - - - - -2009-10-18T02:00:40.000000Z -55de147976557736befa65d8713012ab -2008-06-24T18:48:23.017858Z -181 -dsmith - - - - - - - - - - - - - - - - - - - - - -378 - -neverball -file - - - - -2009-10-18T02:00:40.000000Z -584bd91024870a9583609f647749e728 -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -120 - -acc_ptr -file - - - - -2009-10-18T02:00:40.000000Z -d0df97df08b7ed0035192b035c178183 -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -69 - -buttons -file - - - - -2009-10-18T02:00:40.000000Z -53c3b45a38edb4284d6757d27249c7a3 -2007-04-09T03:48:56.600105Z -76 -dsmith - - - - - - - - - - - - - - - - - - - - - -627 - -gamepad -file - - - - -2009-10-18T02:00:40.000000Z -6477e354c166a55912f5c0a6b7b38d8f -2007-02-21T16:27:55.778617Z -3 -dsmith - - - - - - - - - - - - - - - - - - - - - -406 - -nunchuk_stick2btn -file - - - - -2009-10-18T02:00:40.000000Z -bb63b5c313958b293a865006cdfaef6c -2008-06-24T19:43:05.601828Z -182 -dsmith - - - - - - - - - - - - - - - - - - - - - -472 - diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/format b/l2ork_addons/cwiid/wminput/configs/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_led.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_led.svn-base deleted file mode 100644 index 0d56a4d4cff6a6510b7fc2dd97ffb3ef44f55104..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_led.svn-base +++ /dev/null @@ -1,16 +0,0 @@ -#acc_led - -include buttons - -Plugin.acc.X = REL_X -Plugin.acc.Y = REL_Y - -# You can set Plugin.led.Led[1->4] to 1 -# to have that led be active all the time -Plugin.led.Led4 = 1 - -# Setting battery to 1 enables the battery check function -# By default the keypress is A + B -# You can change this by setting Plugin.led.Button to any -# wiimote or attachment button -Plugin.led.Battery = 1 diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_ptr.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_ptr.svn-base deleted file mode 100644 index 14f8d5a29564508defabec304750b465aa9fa597..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/acc_ptr.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -#acc_ptr - -include buttons - -Plugin.acc.X = REL_X -Plugin.acc.Y = REL_Y diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/buttons.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/buttons.svn-base deleted file mode 100644 index 5a5df3750423efb29e1cfd309eac7150c32189bf..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/buttons.svn-base +++ /dev/null @@ -1,32 +0,0 @@ -#buttons - -Wiimote.A = BTN_LEFT -Wiimote.B = BTN_RIGHT -Wiimote.Up = KEY_UP -Wiimote.Down = KEY_DOWN -Wiimote.Left = KEY_LEFT -Wiimote.Right = KEY_RIGHT -Wiimote.Minus = KEY_BACK -Wiimote.Plus = KEY_FORWARD -Wiimote.Home = KEY_HOME -Wiimote.1 = KEY_PROG1 -Wiimote.2 = KEY_PROG2 - -Nunchuk.C = BTN_LEFT -Nunchuk.Z = BTN_RIGHT - -Classic.Up = KEY_UP -Classic.Down = KEY_DOWN -Classic.Left = KEY_LEFT -Classic.Right = KEY_RIGHT -Classic.Minus = KEY_BACK -Classic.Plus = KEY_FORWARD -Classic.Home = KEY_HOME -Classic.A = BTN_LEFT -Classic.B = BTN_RIGHT -#Classic.X = -#Classic.Y = -#Classic.ZL = -#Classic.ZR = -#Classic.L = -#Classic.R = diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/gamepad.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/gamepad.svn-base deleted file mode 100644 index e4b357d33ff4ddab1859e1b43306bd38d78a1a79..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/gamepad.svn-base +++ /dev/null @@ -1,19 +0,0 @@ -# gameport - -Classic.Dpad.X = ABS_X -Classic.Dpad.Y = ABS_Y -Classic.LStick.X = ABS_HAT0X -Classic.LStick.Y = ABS_HAT0Y -Classic.RStick.X = ABS_HAT1X -Classic.RStick.Y = ABS_HAT1Y -Classic.A = BTN_A -Classic.B = BTN_B -Classic.X = BTN_X -Classic.Y = BTN_Y -Classic.Minus = BTN_SELECT -Classic.Plus = BTN_START -Classic.Home = BTN_MODE -Classic.L = BTN_TL -Classic.R = BTN_TR -Classic.ZL = BTN_TL2 -Classic.ZR = BTN_TR2 diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/ir_ptr.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/ir_ptr.svn-base deleted file mode 100644 index 194433a6250a753acdc8c603556ade84bcef75cd..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/ir_ptr.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -#ir_ptr - -include buttons - -Plugin.ir_ptr.X = ~ABS_X -Plugin.ir_ptr.Y = ~ABS_Y diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/neverball.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/neverball.svn-base deleted file mode 100644 index 8dd9f0837388119f8330e8b370509111cceb4201..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/neverball.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -# neverball - -Plugin.acc.Roll = ABS_X -Plugin.acc.Roll_Scale = 2.0 -Plugin.acc.Pitch = -ABS_Y -Plugin.acc.Pitch_Scale = 2.0 diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_acc_ptr.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_acc_ptr.svn-base deleted file mode 100644 index d97f9e79335b163661718fe6c08ddfddb10b36c1..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_acc_ptr.svn-base +++ /dev/null @@ -1,6 +0,0 @@ -#nunchuk_acc_ptr - -include buttons - -Plugin.nunchuk_acc.X = REL_X -Plugin.nunchuk_acc.Y = REL_Y diff --git a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_stick2btn.svn-base b/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_stick2btn.svn-base deleted file mode 100644 index d4270198a4da0b1ffcba6a36db65a1f783d80f31..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/configs/.svn/text-base/nunchuk_stick2btn.svn-base +++ /dev/null @@ -1,16 +0,0 @@ -# Fps config for wminput by kyrlian -# needs plugins ir_fps and nunchuk_kb -# available from http://kyrlian.free.fr/binaries/cwiid/latest/ -# wminput source and info at http://abstrakraft.org/cwiid/ - -include buttons - -Nunchuk.C = KEY_C -Nunchuk.Z = KEY_SPACE - -#plugin for nunchuk stick -Plugin.nunchuk_stick2btn.Up = KEY_UP -Plugin.nunchuk_stick2btn.Down = KEY_DOWN -Plugin.nunchuk_stick2btn.Left = KEY_LEFT -Plugin.nunchuk_stick2btn.Right = KEY_RIGHT - diff --git a/l2ork_addons/cwiid/wminput/plugins/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/.svn/all-wcprops deleted file mode 100644 index dc239cf62b187b830dc09f17c6533219a89cc66a..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/.svn/all-wcprops +++ /dev/null @@ -1,11 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 45 -/cwiid/svn/!svn/ver/182/trunk/wminput/plugins -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 57 -/cwiid/svn/!svn/ver/182/trunk/wminput/plugins/Makefile.in -END diff --git a/l2ork_addons/cwiid/wminput/plugins/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/.svn/entries deleted file mode 100644 index 9023c7e1ffb51055ac723018e803e98d6f981152..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/.svn/entries +++ /dev/null @@ -1,77 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins -http://abstrakraft.org/cwiid/svn - - - -2008-06-24T19:43:05.601828Z -182 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -ir_ptr -dir - -nunchuk_acc -dir - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -96ceca5c6b4ba9fd4bb7dfd34c657322 -2008-06-24T19:43:05.601828Z -182 -dsmith - - - - - - - - - - - - - - - - - - - - - -369 - -led -dir - -acc -dir - -nunchuk_stick2btn -dir - diff --git a/l2ork_addons/cwiid/wminput/plugins/.svn/format b/l2ork_addons/cwiid/wminput/plugins/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index c05f8bcdb3d1fcec54cde46ae87e3df57211e12c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,17 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGINS = ir_ptr acc nunchuk_acc led nunchuk_stick2btn - -all install clean distclean uninstall: TARGET += $(MAKECMDGOALS) - -all install clean distclean uninstall: $(PLUGINS) - -$(PLUGINS): - $(MAKE) $(TARGET) -C $@ - -distclean: clean - rm Makefile - -.PHONY: all install clean distclean uninstall $(PLUGINS) diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/all-wcprops deleted file mode 100644 index e4fd8e40be64f4ad3de1cd8864cd82ab9b69eb05..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/all-wcprops +++ /dev/null @@ -1,23 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 49 -/cwiid/svn/!svn/ver/125/trunk/wminput/plugins/acc -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 60 -/cwiid/svn/!svn/ver/83/trunk/wminput/plugins/acc/Makefile.in -END -acc.c -K 25 -svn:wc:ra_dav:version-url -V 55 -/cwiid/svn/!svn/ver/125/trunk/wminput/plugins/acc/acc.c -END -acc.py -K 25 -svn:wc:ra_dav:version-url -V 56 -/cwiid/svn/!svn/ver/125/trunk/wminput/plugins/acc/acc.py -END diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/entries deleted file mode 100644 index 097a416fba47690d08e13c423b80a23d3cdc47e0..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/entries +++ /dev/null @@ -1,130 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins/acc -http://abstrakraft.org/cwiid/svn - - - -2007-06-14T04:16:11.705163Z -125 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -1a2d1e2e5cc668b736f9f62070e6e450 -2007-04-11T02:57:27.217197Z -83 -dsmith - - - - - - - - - - - - - - - - - - - - - -299 - -acc.c -file - - - - -2009-10-18T02:00:39.000000Z -b7a273a779d81356fe558545e63fa3c1 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -5724 - -acc.py -file - - - - -2009-10-18T02:00:39.000000Z -6b938ac7002789d7bd99d221cabc9d67 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -1698 - diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/format b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 41f6604d4c753f75372a5a3b40cfc6e9cef1db75..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,16 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGIN_NAME = acc -SOURCES = acc.c -CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid -LDLIBS += -lm -INST_DIR = $(CWIID_PLUGINS_DIR) - -include $(COMMON)/include/plugin.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.c.svn-base b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.c.svn-base deleted file mode 100644 index 7ea6b95c2fea45c1bbea1e95b18d8a23ba1a6be5..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.c.svn-base +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for wmplugin_exec prototype change (&mesg->mesg) - * * updated for param interface change (pass pointers) - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * use cwiid_get_acc_cal to get acc calibration values - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * initialized params - * * added Scale params - * - * 2007-04-08 Arthur Peters <amp@singingwizard.org> - * * added low-pass filter - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * type audit (stdint, const, char booleans) - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * made global variables static - */ - -#include <math.h> - -#include "wmplugin.h" - -#define PI 3.14159265358979323 - -static unsigned char info_init = 0; -static struct wmplugin_info info; -static struct wmplugin_data data; - -static struct acc_cal acc_cal; - -static int plugin_id; - -wmplugin_info_t wmplugin_info; -wmplugin_init_t wmplugin_init; -wmplugin_exec_t wmplugin_exec; -static void process_acc(struct cwiid_acc_mesg *mesg); - -static float Roll_Scale = 1.0; -static float Pitch_Scale = 1.0; -static float X_Scale = 1.0; -static float Y_Scale = 1.0; - -struct wmplugin_info *wmplugin_info() { - if (!info_init) { - info.button_count = 0; - info.axis_count = 4; - info.axis_info[0].name = "Roll"; - info.axis_info[0].type = WMPLUGIN_ABS; - info.axis_info[0].max = 3141; - info.axis_info[0].min = -3141; - info.axis_info[0].fuzz = 0; - info.axis_info[0].flat = 0; - info.axis_info[1].name = "Pitch"; - info.axis_info[1].type = WMPLUGIN_ABS; - info.axis_info[1].max = 1570; - info.axis_info[1].min = -1570; - info.axis_info[1].fuzz = 0; - info.axis_info[1].flat = 0; - info.axis_info[2].name = "X"; - info.axis_info[2].type = WMPLUGIN_ABS | WMPLUGIN_REL; - info.axis_info[2].max = 16; - info.axis_info[2].min = -16; - info.axis_info[2].fuzz = 0; - info.axis_info[2].flat = 0; - info.axis_info[3].name = "Y"; - info.axis_info[3].type = WMPLUGIN_ABS | WMPLUGIN_REL; - info.axis_info[3].max = 16; - info.axis_info[3].min = -16; - info.axis_info[3].fuzz = 0; - info.axis_info[3].flat = 0; - info.param_count = 4; - info.param_info[0].name = "Roll_Scale"; - info.param_info[0].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[0].ptr = &Roll_Scale; - info.param_info[1].name = "Pitch_Scale"; - info.param_info[1].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[1].ptr = &Pitch_Scale; - info.param_info[2].name = "X_Scale"; - info.param_info[2].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[2].ptr = &X_Scale; - info.param_info[3].name = "Y_Scale"; - info.param_info[3].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[3].ptr = &Y_Scale; - info_init = 1; - } - return &info; -} - -int wmplugin_init(int id, cwiid_wiimote_t *wiimote) -{ - plugin_id = id; - - data.buttons = 0; - data.axes[0].valid = 1; - data.axes[1].valid = 1; - if (wmplugin_set_rpt_mode(id, CWIID_RPT_ACC)) { - return -1; - } - - if (cwiid_get_acc_cal(wiimote, CWIID_EXT_NONE, &acc_cal)) { - wmplugin_err(id, "calibration error"); - return -1; - } - - return 0; -} - -struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[]) -{ - int i; - struct wmplugin_data *ret = NULL; - - for (i=0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_ACC: - process_acc(&mesg[i].acc_mesg); - ret = &data; - break; - default: - break; - } - } - - return ret; -} - -#define NEW_AMOUNT 0.1 -#define OLD_AMOUNT (1.0-NEW_AMOUNT) -double a_x = 0, a_y = 0, a_z = 0; - -static void process_acc(struct cwiid_acc_mesg *mesg) -{ - double a; - double roll, pitch; - - a_x = (((double)mesg->acc[CWIID_X] - acc_cal.zero[CWIID_X]) / - (acc_cal.one[CWIID_X] - acc_cal.zero[CWIID_X]))*NEW_AMOUNT + - a_x*OLD_AMOUNT; - a_y = (((double)mesg->acc[CWIID_Y] - acc_cal.zero[CWIID_Y]) / - (acc_cal.one[CWIID_Y] - acc_cal.zero[CWIID_Y]))*NEW_AMOUNT + - a_y*OLD_AMOUNT; - a_z = (((double)mesg->acc[CWIID_Z] - acc_cal.zero[CWIID_Z]) / - (acc_cal.one[CWIID_Z] - acc_cal.zero[CWIID_Z]))*NEW_AMOUNT + - a_z*OLD_AMOUNT; - - a = sqrt(pow(a_x,2)+pow(a_y,2)+pow(a_z,2)); - roll = atan(a_x/a_z); - if (a_z <= 0.0) { - roll += PI * ((a_x > 0.0) ? 1 : -1); - } - - pitch = atan(a_y/a_z*cos(roll)); - - data.axes[0].value = roll * 1000 * Roll_Scale; - data.axes[1].value = pitch * 1000 * Pitch_Scale; - - if ((a > 0.85) && (a < 1.15)) { - if ((fabs(roll)*(180/PI) > 10) && (fabs(pitch)*(180/PI) < 80)) { - data.axes[2].valid = 1; - data.axes[2].value = roll * 5 * X_Scale; - } - else { - data.axes[2].valid = 0; - } - if (fabs(pitch)*(180/PI) > 10) { - data.axes[3].valid = 1; - data.axes[3].value = pitch * 10 * Y_Scale; - } - else { - data.axes[3].valid = 0; - } - } - else { - data.axes[2].valid = 0; - data.axes[3].valid = 0; - } -} - diff --git a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.py.svn-base b/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.py.svn-base deleted file mode 100644 index acc615115412d8b3eedfc0d8ebbf054834ab94cb..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/acc/.svn/text-base/acc.py.svn-base +++ /dev/null @@ -1,64 +0,0 @@ -import wmplugin -import cwiid -import math - -acc_zero = None -acc_one = None -acc = [0,0,0] - -NEW_AMOUNT = 0.1 -OLD_AMOUNT = 1 - NEW_AMOUNT - -Roll_Scale = 1 -Pitch_Scale = 1 -X_Scale = 1 -Y_Scale = 1 - -def wmplugin_info(): - return [], \ - [("Roll", wmplugin.ABS, 3141, -3141, 0, 0), \ - ("Pitch", wmplugin.ABS, 1570, -1570, 0, 0), \ - ("X", wmplugin.ABS | wmplugin.REL, 16, -16, 0, 0), \ - ("Y", wmplugin.ABS | wmplugin.REL, 16, -16, 0, 0)], \ - [("Roll_Scale", wmplugin.PARAM_FLOAT, Roll_Scale), \ - ("Pitch_Scale", wmplugin.PARAM_FLOAT, Pitch_Scale), \ - ("X_Scale", wmplugin.PARAM_FLOAT, X_Scale), \ - ("Y_Scale", wmplugin.PARAM_FLOAT, Y_Scale)] - -def wmplugin_init(id, wiimote): - global acc_zero, acc_one - - wmplugin.set_rpt_mode(id, cwiid.RPT_ACC) - acc_zero, acc_one = wiimote.get_acc_cal(cwiid.EXT_NONE) - return - -def wmplugin_exec(mesg): - global acc_zero, acc_one, acc - axes = [None, None, None, None] - - for m in mesg: - if m[0] == cwiid.MESG_ACC: - acc = [NEW_AMOUNT*(new-zero)/(one-zero) + OLD_AMOUNT*old - for old,new,zero,one in zip(acc,m[1],acc_zero,acc_one)] - a = math.sqrt(sum(map(lambda x: x**2, acc))) - - roll = math.atan(acc[cwiid.X]/acc[cwiid.Z]) - if acc[cwiid.Z] <= 0: - if acc[cwiid.X] > 0: roll += math.pi - else: roll -= math.pi - - pitch = math.atan(acc[cwiid.Y]/acc[cwiid.Z]*math.cos(roll)) - - axes[0] = int(roll * 1000 * Roll_Scale) - axes[1] = int(pitch * 1000 * Pitch_Scale) - - if (a > 0.85) and (a < 1.15): - if (math.fabs(roll)*(180/math.pi) > 10) and \ - (math.fabs(pitch)*(180/math.pi) < 80): - axes[2] = int(roll * 5 * X_Scale) - - if (math.fabs(pitch)*(180/math.pi) > 10): - axes[3] = int(pitch * 10 * Y_Scale) - - return [], axes - diff --git a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/all-wcprops deleted file mode 100644 index ad8bd209fc6bcc755d5ba2ef843c52d9f51f4c89..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 52 -/cwiid/svn/!svn/ver/180/trunk/wminput/plugins/ir_ptr -END -ir_ptr.c -K 25 -svn:wc:ra_dav:version-url -V 61 -/cwiid/svn/!svn/ver/180/trunk/wminput/plugins/ir_ptr/ir_ptr.c -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 63 -/cwiid/svn/!svn/ver/83/trunk/wminput/plugins/ir_ptr/Makefile.in -END diff --git a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/entries deleted file mode 100644 index 6df83b175b65fe4e55ac3dc6b4339cec52d73abe..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins/ir_ptr -http://abstrakraft.org/cwiid/svn - - - -2008-06-05T14:09:16.426899Z -180 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -ir_ptr.c -file - - - - -2009-10-18T02:00:39.000000Z -e355c8434dd04086b5131bcfeb7c64b6 -2008-06-05T14:09:16.426899Z -180 -dsmith - - - - - - - - - - - - - - - - - - - - - -5254 - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -650f81c1289fbfaae6e1cea69326f2ff -2007-04-11T02:57:27.217197Z -83 -dsmith - - - - - - - - - - - - - - - - - - - - - -291 - diff --git a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/format b/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 7bc8d867b5f05afa74cbb7c3421077f51a875a36..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,15 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGIN_NAME = ir_ptr -SOURCES = ir_ptr.c -CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid -INST_DIR = $(CWIID_PLUGINS_DIR) - -include $(COMMON)/include/plugin.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/ir_ptr.c.svn-base b/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/ir_ptr.c.svn-base deleted file mode 100644 index 4a9f3cae3e06a41e79860a625e4143fe90517c25..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/ir_ptr/.svn/text-base/ir_ptr.c.svn-base +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiidabstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> - * * Converted to single source - * * Added deadspace at edges - * - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for wmplugin_exec prototype change (&mesg->mesg) - * - * 2007-05-16 L. Donnie Smith <cwiid@abstrakraft.org> - * * changed cwiid_{connect,disconnect,command} to - * cwiid_{open,close,request_status|set_led|set_rumble|set_rpt_mode} - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * initialized param array - * - * 2007-04-08 Arthur Peters <amp@singingwizard.org> - * * added debounce and low pass filter - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * type audit (stdint, const, char booleans) - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * made global variables static - */ - -#include "wmplugin.h" - -#define DEBOUNCE_THRESHOLD 50 -#define NEW_AMOUNT 0.3 -#define OLD_AMOUNT (1.0 - NEW_AMOUNT) -#define X_EDGE 50 -#define Y_EDGE 50 - -cwiid_wiimote_t *wiimote; - -static struct wmplugin_info info; -static struct wmplugin_data data; - -wmplugin_info_t wmplugin_info; -wmplugin_init_t wmplugin_init; -wmplugin_exec_t wmplugin_exec; - -struct wmplugin_info *wmplugin_info() { - static unsigned char info_init = 0; - - if (!info_init) { - info.button_count = 0; - info.axis_count = 2; - info.axis_info[0].name = "X"; - info.axis_info[0].type = WMPLUGIN_ABS; - info.axis_info[0].max = CWIID_IR_X_MAX - X_EDGE; - info.axis_info[0].min = X_EDGE; - info.axis_info[0].fuzz = 0; - info.axis_info[0].flat = 0; - info.axis_info[1].name = "Y"; - info.axis_info[1].type = WMPLUGIN_ABS; - info.axis_info[1].max = CWIID_IR_Y_MAX - Y_EDGE; - info.axis_info[1].min = Y_EDGE; - info.axis_info[1].fuzz = 0; - info.axis_info[1].flat = 0; - info.param_count = 0; - info_init = 1; - } - return &info; -} - -int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote) -{ - wiimote = arg_wiimote; - - data.buttons = 0; - - if (wmplugin_set_rpt_mode(id, CWIID_RPT_IR)) { - return -1; - } - - return 0; -} - -struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[]) -{ - static int src_index = -1; - static int debounce = 0; - static uint8_t old_flag; - - int i; - uint8_t flag; - struct cwiid_ir_mesg *ir_mesg; - - ir_mesg = NULL; - for (i=0; i < mesg_count; i++) { - if (mesg[i].type == CWIID_MESG_IR) { - ir_mesg = &mesg[i].ir_mesg; - } - } - - if (!ir_mesg) { - return NULL; - } - - /* invalidate src index if source is no longer present */ - if ((src_index != -1) && !ir_mesg->src[src_index].valid) { - if (debounce > DEBOUNCE_THRESHOLD) { - src_index = -1; - } - else { - debounce++; - } - } - else { - debounce = 0; - } - - /* of not set, pick largest available source */ - if (src_index == -1) { - for (i=0; i < CWIID_IR_SRC_COUNT; i++) { - if (ir_mesg->src[i].valid) { - if ((src_index == -1) || - (ir_mesg->src[i].size > ir_mesg->src[src_index].size)) { - src_index = i; - } - } - } - } - - /* LEDs */ - /* Commented out so it doesn't overide led plugin. - * It shouldn't matter, since only one IR source - * is used now anyways. If the pointer is moving, - * it sees a source. - switch (src_index) { - case 0: - flag = CWIID_LED1_ON; - break; - case 1: - flag = CWIID_LED2_ON; - break; - case 2: - flag = CWIID_LED3_ON; - break; - case 3: - flag = CWIID_LED4_ON; - break; - default: - flag = 0; - break; - } - - if (flag != old_flag) { - cwiid_set_led(wiimote, flag); - old_flag = flag; - } - */ - - if ((src_index == -1) || !ir_mesg->src[src_index].valid) { - data.axes[0].valid = data.axes[1].valid = 0; - } - else { - data.axes[0].valid = data.axes[1].valid = 1; - data.axes[0].value = NEW_AMOUNT * (CWIID_IR_X_MAX - - ir_mesg->src[src_index].pos[CWIID_X]) - + OLD_AMOUNT * data.axes[0].value; - data.axes[1].value = NEW_AMOUNT * ir_mesg->src[src_index].pos[CWIID_Y] - + OLD_AMOUNT * data.axes[1].value; - - if (data.axes[0].value > CWIID_IR_X_MAX - X_EDGE) { - data.axes[0].value = CWIID_IR_X_MAX - X_EDGE; - } - else if (data.axes[0].value < X_EDGE) { - data.axes[0].value = X_EDGE; - } - if (data.axes[1].value > CWIID_IR_Y_MAX - Y_EDGE) { - data.axes[1].value = CWIID_IR_Y_MAX - Y_EDGE; - } - else if (data.axes[1].value < Y_EDGE) { - data.axes[1].value = Y_EDGE; - } - } - - return &data; -} diff --git a/l2ork_addons/cwiid/wminput/plugins/led/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/led/.svn/all-wcprops deleted file mode 100644 index 13478b2b16a10f8a66fe395e860ebce6238e6c15..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/led/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 49 -/cwiid/svn/!svn/ver/180/trunk/wminput/plugins/led -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 61 -/cwiid/svn/!svn/ver/178/trunk/wminput/plugins/led/Makefile.in -END -led.c -K 25 -svn:wc:ra_dav:version-url -V 55 -/cwiid/svn/!svn/ver/180/trunk/wminput/plugins/led/led.c -END diff --git a/l2ork_addons/cwiid/wminput/plugins/led/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/led/.svn/entries deleted file mode 100644 index f12f8a897173be35ef76086bee10ee7629a6d838..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/led/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins/led -http://abstrakraft.org/cwiid/svn - - - -2008-06-05T14:09:16.426899Z -180 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -e0ad94c31b54fe86e22d9d3972b38c12 -2008-05-29T01:00:00.244078Z -178 -dsmith - - - - - - - - - - - - - - - - - - - - - -285 - -led.c -file - - - - -2009-10-18T02:00:39.000000Z -7a36fd1d1748ece2d73cb49b66873563 -2008-06-05T14:09:16.426899Z -180 -dsmith - - - - - - - - - - - - - - - - - - - - - -3168 - diff --git a/l2ork_addons/cwiid/wminput/plugins/led/.svn/format b/l2ork_addons/cwiid/wminput/plugins/led/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/led/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 86cdde6d2cc99febeb6b857ae2b754f4735ae8a8..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,15 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGIN_NAME = led -SOURCES = led.c -CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid -INST_DIR = $(CWIID_PLUGINS_DIR) - -include $(COMMON)/include/plugin.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/led.c.svn-base b/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/led.c.svn-base deleted file mode 100644 index 93b96d9c132318f0f008040f871561c3f094288b..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/led/.svn/text-base/led.c.svn-base +++ /dev/null @@ -1,134 +0,0 @@ -#include "wmplugin.h" -#include <math.h> - - -cwiid_wiimote_t *wiimote; - -static unsigned char info_init = 0; -static struct wmplugin_info info; -static struct wmplugin_data data; - -wmplugin_info_t wmplugin_info; -wmplugin_init_t wmplugin_init; -wmplugin_exec_t wmplugin_exec; - -static int Led1 = 0; -static int Led2 = 0; -static int Led3 = 0; -static int Led4 = 0; -static int Battery = 0; -static uint8_t Button = CWIID_BTN_A + CWIID_BTN_B; - -static void show_battery(); - -struct wmplugin_info *wmplugin_info() -{ - if (!info_init) { - info.button_count = 0; - info.axis_count = 0; - info.param_count = 6; - info.param_info[0].name = "Led1"; - info.param_info[0].type = WMPLUGIN_PARAM_INT; - info.param_info[0].ptr = &Led1; - info.param_info[1].name = "Led2"; - info.param_info[1].type = WMPLUGIN_PARAM_INT; - info.param_info[1].ptr = &Led2; - info.param_info[2].name = "Led3"; - info.param_info[2].type = WMPLUGIN_PARAM_INT; - info.param_info[2].ptr = &Led3; - info.param_info[3].name = "Led4"; - info.param_info[3].type = WMPLUGIN_PARAM_INT; - info.param_info[3].ptr = &Led4; - info.param_info[4].name = "Battery"; - info.param_info[4].type = WMPLUGIN_PARAM_INT; - info.param_info[4].ptr = &Battery; - info.param_info[5].name = "Button"; - info.param_info[5].type = WMPLUGIN_PARAM_INT; - info.param_info[5].ptr = &Button; - info_init = 1; - } - return &info; -} - -int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote) -{ - wiimote = arg_wiimote; - - uint8_t led_state = (Led1 ? CWIID_LED1_ON : 0) - | (Led2 ? CWIID_LED2_ON : 0) - | (Led3 ? CWIID_LED3_ON : 0) - | (Led4 ? CWIID_LED4_ON : 0); - - cwiid_command(wiimote, CWIID_CMD_LED, led_state); - - if (wmplugin_set_rpt_mode(id, CWIID_RPT_BTN)) { - return -1; - } - - return 0; -} - -struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[]) -{ - int i; - uint8_t button; - struct cwiid_btn_message *btn_mesg; - - uint8_t led_state = (Led1 ? CWIID_LED1_ON : 0) - | (Led2 ? CWIID_LED2_ON : 0) - | (Led3 ? CWIID_LED3_ON : 0) - | (Led4 ? CWIID_LED4_ON : 0); - - if(Battery != 0) { - btn_mesg = NULL; - for (i=0; i < mesg_count; i++) { - if (mesg[i].type == CWIID_MESG_BTN) { - btn_mesg = &mesg[i].btn_mesg; - button = mesg[i].btn_mesg.buttons; - } - } - - if (!btn_mesg) { - return NULL; - } - - if(button == Button) { - show_battery(); - } - else { - cwiid_command(wiimote, CWIID_CMD_LED, led_state); - } - } - - return &data; -} - -static void show_battery() -{ - struct cwiid_state state; - float battery_percent; - int battery_led; - - cwiid_get_state(wiimote, &state); - - // calculate battery as a percent, then decide how many leds to light up - battery_percent = (100*state.battery / CWIID_BATTERY_MAX); - battery_led = ceil(battery_percent / 25); - - switch(battery_led) { - case 1: - cwiid_set_led(wiimote, CWIID_LED1_ON); - break; - case 2: - cwiid_set_led(wiimote, CWIID_LED1_ON | CWIID_LED2_ON ); - break; - case 3: - cwiid_set_led(wiimote, CWIID_LED1_ON | CWIID_LED2_ON | CWIID_LED3_ON ); - break; - case 4: - cwiid_set_led(wiimote, CWIID_LED1_ON | CWIID_LED2_ON | CWIID_LED3_ON | CWIID_LED4_ON ); - break; - default: - break; - } -} diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/all-wcprops deleted file mode 100644 index 76e7c4ae60ec30fd6e14d5c7c9c6c72a12f3a91c..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 57 -/cwiid/svn/!svn/ver/125/trunk/wminput/plugins/nunchuk_acc -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 68 -/cwiid/svn/!svn/ver/83/trunk/wminput/plugins/nunchuk_acc/Makefile.in -END -nunchuk_acc.c -K 25 -svn:wc:ra_dav:version-url -V 71 -/cwiid/svn/!svn/ver/125/trunk/wminput/plugins/nunchuk_acc/nunchuk_acc.c -END diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/entries deleted file mode 100644 index 52d7953cddc8d7dba1c063be9860700fd6b54467..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins/nunchuk_acc -http://abstrakraft.org/cwiid/svn - - - -2007-06-14T04:16:11.705163Z -125 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -631cfd5be63c2aa5984788499e6e6712 -2007-04-11T02:57:27.217197Z -83 -dsmith - - - - - - - - - - - - - - - - - - - - - -315 - -nunchuk_acc.c -file - - - - -2009-10-18T02:00:39.000000Z -ae9ab289ae7c09b833b21f5dc652a946 -2007-06-14T04:16:11.705163Z -125 -dsmith - - - - - - - - - - - - - - - - - - - - - -6036 - diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/format b/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index ec76cae81548280fded097993700eb2c16ece257..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,16 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGIN_NAME = nunchuk_acc -SOURCES = nunchuk_acc.c -CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid -LDLIBS += -lm -INST_DIR = $(CWIID_PLUGINS_DIR) - -include $(COMMON)/include/plugin.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/nunchuk_acc.c.svn-base b/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/nunchuk_acc.c.svn-base deleted file mode 100644 index 47f66738f5efa74482ea3bd904fbf86bdd8a3c77..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_acc/.svn/text-base/nunchuk_acc.c.svn-base +++ /dev/null @@ -1,209 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * ChangeLog: - * 2007-06-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for wmplugin_exec prototype change (&mesg->mesg) - * * updated for param interface change (pass pointers) - * - * 2007-05-14 L. Donnie Smith <cwiid@abstrakraft.org> - * * use cwiid_get_acc_cal to get acc calibration values - * - * 2007-04-24 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for API overhaul - * - * 2007-04-09 L. Donnie Smith <cwiid@abstrakraft.org> - * * updated for libcwiid rename - * - * 2007-04-08 L. Donnie Smith <cwiid@abstrakraft.org> - * * copied low-pass filter from acc plugin - * * initialized params - * * added Scale params - * - * 2007-03-04 L. Donnie Smith <cwiid@abstrakraft.org> - * * type audit (stdint, const, char booleans) - * - * 2007-03-01 L. Donnie Smith <cwiid@abstrakraft.org> - * * Initial ChangeLog - * * made global variables static - */ - -#include <math.h> - -#include "wmplugin.h" - -#define PI 3.14159265358979323 - -static unsigned char info_init = 0; -static struct wmplugin_info info; -static struct wmplugin_data data; - -static cwiid_wiimote_t *wiimote; - -static struct acc_cal acc_cal; -static int plugin_id; - -wmplugin_info_t wmplugin_info; -wmplugin_init_t wmplugin_init; -wmplugin_exec_t wmplugin_exec; -static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg); - -static float Roll_Scale = 1.0; -static float Pitch_Scale = 1.0; -static float X_Scale = 1.0; -static float Y_Scale = 1.0; - -struct wmplugin_info *wmplugin_info() { - if (!info_init) { - info.button_count = 0; - info.axis_count = 4; - info.axis_info[0].name = "Roll"; - info.axis_info[0].type = WMPLUGIN_ABS; - info.axis_info[0].max = 3141; - info.axis_info[0].min = -3141; - info.axis_info[0].fuzz = 0; - info.axis_info[0].flat = 0; - info.axis_info[1].name = "Pitch"; - info.axis_info[1].type = WMPLUGIN_ABS; - info.axis_info[1].max = 1570; - info.axis_info[1].min = -1570; - info.axis_info[1].fuzz = 0; - info.axis_info[1].flat = 0; - info.axis_info[2].name = "X"; - info.axis_info[2].type = WMPLUGIN_ABS | WMPLUGIN_REL; - info.axis_info[2].max = 16; - info.axis_info[2].min = -16; - info.axis_info[2].fuzz = 0; - info.axis_info[2].flat = 0; - info.axis_info[3].name = "Y"; - info.axis_info[3].type = WMPLUGIN_ABS | WMPLUGIN_REL; - info.axis_info[3].max = 16; - info.axis_info[3].min = -16; - info.axis_info[3].fuzz = 0; - info.axis_info[3].flat = 0; - info.param_count = 4; - info.param_info[0].name = "Roll_Scale"; - info.param_info[0].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[0].ptr = &Roll_Scale; - info.param_info[1].name = "Pitch_Scale"; - info.param_info[1].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[1].ptr = &Pitch_Scale; - info.param_info[2].name = "X_Scale"; - info.param_info[2].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[2].ptr = &X_Scale; - info.param_info[3].name = "Y_Scale"; - info.param_info[3].type = WMPLUGIN_PARAM_FLOAT; - info.param_info[3].ptr = &Y_Scale; - info_init = 1; - } - return &info; -} - -int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote) -{ - plugin_id = id; - wiimote = arg_wiimote; - data.buttons = 0; - data.axes[0].valid = 1; - data.axes[1].valid = 1; - if (wmplugin_set_rpt_mode(id, CWIID_RPT_STATUS | CWIID_RPT_NUNCHUK)) { - return -1; - } - - return 0; -} - -struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[]) -{ - int i; - enum cwiid_ext_type ext_type = CWIID_EXT_NONE; - struct wmplugin_data *ret = NULL; - - for (i=0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_STATUS: - if ((mesg[i].status_mesg.ext_type == CWIID_EXT_NUNCHUK) && - (ext_type != CWIID_EXT_NUNCHUK)) { - if (cwiid_get_acc_cal(wiimote, CWIID_EXT_NUNCHUK, &acc_cal)) { - wmplugin_err(plugin_id, "calibration error"); - } - } - ext_type = mesg[i].status_mesg.ext_type; - break; - case CWIID_MESG_NUNCHUK: - process_nunchuk(&mesg[i].nunchuk_mesg); - ret = &data; - break; - default: - break; - } - } - - return ret; -} - -#define NEW_AMOUNT 0.1 -#define OLD_AMOUNT (1.0-NEW_AMOUNT) -double a_x = 0, a_y = 0, a_z = 0; - -static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg) -{ - double a; - double roll, pitch; - - a_x = (((double)mesg->acc[CWIID_X] - acc_cal.zero[CWIID_X]) / - (acc_cal.one[CWIID_X] - acc_cal.zero[CWIID_X]))*NEW_AMOUNT + - a_x*OLD_AMOUNT; - a_y = (((double)mesg->acc[CWIID_Y] - acc_cal.zero[CWIID_Y]) / - (acc_cal.one[CWIID_Y] - acc_cal.zero[CWIID_Y]))*NEW_AMOUNT + - a_y*OLD_AMOUNT; - a_z = (((double)mesg->acc[CWIID_Z] - acc_cal.zero[CWIID_Z]) / - (acc_cal.one[CWIID_Z] - acc_cal.zero[CWIID_Z]))*NEW_AMOUNT + - a_z*OLD_AMOUNT; - - a = sqrt(pow(a_x,2)+pow(a_y,2)+pow(a_z,2)); - roll = atan(a_x/a_z); - if (a_z <= 0.0) { - roll += PI * ((a_x > 0.0) ? 1 : -1); - } - - pitch = atan(a_y/a_z*cos(roll)); - - data.axes[0].value = roll * 1000 * Roll_Scale; - data.axes[1].value = pitch * 1000 * Pitch_Scale; - - if ((a > 0.85) && (a < 1.15)) { - if ((fabs(roll)*(180/PI) > 10) && (fabs(pitch)*(180/PI) < 80)) { - data.axes[2].valid = 1; - data.axes[2].value = roll * 5 * X_Scale; - } - else { - data.axes[2].valid = 0; - } - if (fabs(pitch)*(180/PI) > 10) { - data.axes[3].valid = 1; - data.axes[3].value = pitch * 10 * Y_Scale; - } - else { - data.axes[3].valid = 0; - } - } - else { - data.axes[2].valid = 0; - data.axes[3].valid = 0; - } -} - diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/all-wcprops b/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/all-wcprops deleted file mode 100644 index 4db5799cb135b00661846a4574ffe153fcf6f72f..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/all-wcprops +++ /dev/null @@ -1,17 +0,0 @@ -K 25 -svn:wc:ra_dav:version-url -V 63 -/cwiid/svn/!svn/ver/182/trunk/wminput/plugins/nunchuk_stick2btn -END -nunchuk_stick2btn.c -K 25 -svn:wc:ra_dav:version-url -V 83 -/cwiid/svn/!svn/ver/182/trunk/wminput/plugins/nunchuk_stick2btn/nunchuk_stick2btn.c -END -Makefile.in -K 25 -svn:wc:ra_dav:version-url -V 75 -/cwiid/svn/!svn/ver/182/trunk/wminput/plugins/nunchuk_stick2btn/Makefile.in -END diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/entries b/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/entries deleted file mode 100644 index 7f28f70d2e37f22850fb6efb66a3ea90319ca3d0..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/entries +++ /dev/null @@ -1,96 +0,0 @@ -9 - -dir -201 -http://abstrakraft.org/cwiid/svn/trunk/wminput/plugins/nunchuk_stick2btn -http://abstrakraft.org/cwiid/svn - - - -2008-06-24T19:43:05.601828Z -182 -dsmith - - -svn:special svn:externals svn:needs-lock - - - - - - - - - - - -918edb2d-ff29-0410-9de2-eb38e7f22bc7 - -nunchuk_stick2btn.c -file - - - - -2009-10-18T02:00:39.000000Z -1f0abdc763b3803813c3f643f6cde975 -2008-06-24T19:43:05.601828Z -182 -dsmith - - - - - - - - - - - - - - - - - - - - - -2496 - -Makefile.in -file - - - - -2009-10-18T02:00:39.000000Z -0c15d3f9d93270e1d0175b21682d6cd9 -2008-06-24T19:43:05.601828Z -182 -dsmith - - - - - - - - - - - - - - - - - - - - - -327 - diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/format b/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/format deleted file mode 100644 index ec635144f60048986bc560c5576355344005e6e7..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/format +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/Makefile.in.svn-base b/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/Makefile.in.svn-base deleted file mode 100644 index 3b51d7d223e861394ab48bfb143bf3bec28c68b2..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/Makefile.in.svn-base +++ /dev/null @@ -1,16 +0,0 @@ -#Copyright (C) 2007 L. Donnie Smith - -include @top_builddir@/defs.mak - -PLUGIN_NAME = nunchuk_stick2btn -SOURCES = nunchuk_stick2btn.c -CFLAGS += -I@top_builddir@/wminput -I@top_builddir@/libcwiid -LDLIBS += -lm -INST_DIR = $(CWIID_PLUGINS_DIR) - -include $(COMMON)/include/plugin.mak - -distclean: clean - rm Makefile - -.PHONY: distclean diff --git a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/nunchuk_stick2btn.c.svn-base b/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/nunchuk_stick2btn.c.svn-base deleted file mode 100644 index 6797881ac1c0603888cb02e258534e164352ac69..0000000000000000000000000000000000000000 --- a/l2ork_addons/cwiid/wminput/plugins/nunchuk_stick2btn/.svn/text-base/nunchuk_stick2btn.c.svn-base +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2007 L. Donnie Smith <cwiid@abstrakraft.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "wmplugin.h" - -/* Button flags */ -#define STICK_KEY_UP 0x0001 -#define STICK_KEY_DOWN 0x0002 -#define STICK_KEY_RIGHT 0x0004 -#define STICK_KEY_LEFT 0x0008 -#define STICK_MID_VAL 128 -#define STICK_NEUTRAL 20 - -static unsigned char info_init = 0; -static struct wmplugin_info info; -static struct wmplugin_data data; - -wmplugin_info_t wmplugin_info; -wmplugin_init_t wmplugin_init; -wmplugin_exec_t wmplugin_exec; -static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg); - -struct wmplugin_info *wmplugin_info() { - if (!info_init) { - info.button_count = 4; - info.button_info[0].name = "Up"; - info.button_info[1].name = "Down"; - info.button_info[2].name = "Right"; - info.button_info[3].name = "Left"; - info.axis_count = 0; - info_init = 1; - } - return &info; -} - -int wmplugin_init(int id, cwiid_wiimote_t *arg_wiimote) -{ - data.buttons = 0; - if (wmplugin_set_rpt_mode(id, CWIID_RPT_NUNCHUK)) { - return -1; - } - - return 0; -} - -struct wmplugin_data *wmplugin_exec(int mesg_count, union cwiid_mesg mesg[]) -{ - int i; - struct wmplugin_data *ret = NULL; - - for (i=0; i < mesg_count; i++) { - switch (mesg[i].type) { - case CWIID_MESG_NUNCHUK: - process_nunchuk(&mesg[i].nunchuk_mesg); - ret = &data; - break; - default: - break; - } - } - - return ret; -} - -static void process_nunchuk(struct cwiid_nunchuk_mesg *mesg) -{ - int stx = mesg->stick[CWIID_X]; - int sty = mesg->stick[CWIID_Y]; - - data.buttons=0; - if (sty > STICK_MID_VAL+STICK_NEUTRAL) data.buttons |= STICK_KEY_UP; - if (sty < STICK_MID_VAL-STICK_NEUTRAL) data.buttons |= STICK_KEY_DOWN; - if (stx > STICK_MID_VAL+STICK_NEUTRAL) data.buttons |= STICK_KEY_RIGHT; - if (stx < STICK_MID_VAL-STICK_NEUTRAL) data.buttons |= STICK_KEY_LEFT; -} -