mousetweaks r3 - in trunk: . data help help/C help/C/figures man pixmaps po src
- From: gerdk svn gnome org
- To: svn-commits-list gnome org
- Subject: mousetweaks r3 - in trunk: . data help help/C help/C/figures man pixmaps po src
- Date: Fri, 11 Jan 2008 13:34:56 +0000 (GMT)
Author: gerdk
Date: Fri Jan 11 13:34:55 2008
New Revision: 3
URL: http://svn.gnome.org/viewvc/mousetweaks?rev=3&view=rev
Log:
Initial commit
Added:
trunk/AUTHORS
trunk/COPYING
trunk/COPYING.FDL
trunk/COPYING.GPL
trunk/ChangeLog
trunk/INSTALL
trunk/MAINTAINERS
trunk/Makefile.am
trunk/NEWS
trunk/README
trunk/TODO
trunk/autogen.sh (contents, props changed)
trunk/configure.ac
trunk/data/
trunk/data/DwellClick_Factory.server.in.in
trunk/data/Makefile.am
trunk/data/PointerCapture_Factory.server.in.in
trunk/data/ctw.glade
trunk/data/dwell-click-applet.glade
trunk/data/mousetweaks.schemas
trunk/data/pointer-capture-applet.glade
trunk/data/pointer-capture-applet.schemas
trunk/help/
trunk/help/C/
trunk/help/C/Makefile.am
trunk/help/C/figures/
trunk/help/C/figures/mt-add-applet-to-panel-window.png (contents, props changed)
trunk/help/C/figures/mt-control-panel-delay-click-enabled.png (contents, props changed)
trunk/help/C/figures/mt-control-panel-dwell-click-enabled.png (contents, props changed)
trunk/help/C/figures/mt-delay-click-checkbox.png (contents, props changed)
trunk/help/C/figures/mt-delay-click-pause-time-slider.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-checkbox.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-click-type-applet.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-click-type-window.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-gesture-mapping.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-ignore-movement-slider.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-pause-time-slider.png (contents, props changed)
trunk/help/C/figures/mt-dwell-click-trigger-choice.png (contents, props changed)
trunk/help/C/figures/mt-pointer-capture-context-menu.png (contents, props changed)
trunk/help/C/figures/mt-pointer-capture-locked.png (contents, props changed)
trunk/help/C/figures/mt-pointer-capture-preferences-window.png (contents, props changed)
trunk/help/C/legal.xml
trunk/help/C/mousetweaks.xml
trunk/help/ChangeLog
trunk/help/Makefile.am
trunk/man/
trunk/man/Makefile.am
trunk/man/mousetweaks.1
trunk/pixmaps/
trunk/pixmaps/Makefile.am
trunk/pixmaps/human-double.png (contents, props changed)
trunk/pixmaps/human-drag.png (contents, props changed)
trunk/pixmaps/human-right.png (contents, props changed)
trunk/pixmaps/human-single.png (contents, props changed)
trunk/po/
trunk/po/ChangeLog
trunk/po/LINGUAS
trunk/po/POTFILES.in
trunk/po/POTFILES.skip
trunk/po/de.po
trunk/po/fr.po
trunk/po/it.po
trunk/src/
trunk/src/Makefile.am
trunk/src/dwell-click-applet.c
trunk/src/mt-common.c
trunk/src/mt-common.h
trunk/src/mt-ctw.c
trunk/src/mt-ctw.h
trunk/src/mt-dbus.c
trunk/src/mt-dbus.h
trunk/src/mt-main.c
trunk/src/mt-main.h
trunk/src/mt-pidfile.c
trunk/src/mt-pidfile.h
trunk/src/mt-session.c
trunk/src/mt-session.h
trunk/src/mt-timer.c
trunk/src/mt-timer.h
trunk/src/pointer-capture-applet.c
Added: trunk/AUTHORS
==============================================================================
--- (empty file)
+++ trunk/AUTHORS Fri Jan 11 13:34:55 2008
@@ -0,0 +1,10 @@
+Source code:
+ Gerd Kohlberger <lowfi chello at>
+
+Manual:
+ Francesco Fumanti <francesco fumanti gmx net>
+
+Translation:
+ DE - Gerd Kohlberger <lowfi chello at>
+ IT, FR - Francesco Fumanti <francesco fumanti gmx net>
+
Added: trunk/COPYING
==============================================================================
--- (empty file)
+++ trunk/COPYING Fri Jan 11 13:34:55 2008
@@ -0,0 +1,9 @@
+Copying information:
+
+The files included in the mousetweaks source package are licensed under the
+GNU General Public License version 3.0. The manual and its pictures are
+licensed under the GNU Free Documentation License version 1.1.
+
+You can find a copy of the text of the licenses in the root
+directory of the mousetweaks source package. The files with the
+licenses are named COPYING.GPL and COPYING.FDL
Added: trunk/COPYING.FDL
==============================================================================
--- (empty file)
+++ trunk/COPYING.FDL Fri Jan 11 13:34:55 2008
@@ -0,0 +1,355 @@
+ GNU Free Documentation License
+ Version 1.1, March 2000
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ 51 Franklin St, 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.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document "free" in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The "Document", below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as "you".
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section entitled "History", and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. In any section entitled "Acknowledgements" or "Dedications",
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section as "Endorsements"
+ or to conflict in title with any Invariant Section.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled "History"
+in the various original documents, forming one section entitled
+"History"; likewise combine any sections entitled "Acknowledgements",
+and any sections entitled "Dedications". You must delete all sections
+entitled "Endorsements."
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an "aggregate", and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document 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.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation 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. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write "no Front-Cover Texts" instead of
+"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
Added: trunk/COPYING.GPL
==============================================================================
--- (empty file)
+++ trunk/COPYING.GPL Fri Jan 11 13:34:55 2008
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. 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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. 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.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ 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.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ 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
+state 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 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU 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 Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Added: trunk/INSTALL
==============================================================================
--- (empty file)
+++ trunk/INSTALL Fri Jan 11 13:34:55 2008
@@ -0,0 +1,234 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
Added: trunk/MAINTAINERS
==============================================================================
--- (empty file)
+++ trunk/MAINTAINERS Fri Jan 11 13:34:55 2008
@@ -0,0 +1,8 @@
+Francesco Fumanti
+E-Mail: <frfumanti svn gnome org>
+UserID: frfumanti
+
+Gerd Kohlberger
+E-Mail: <gerdk svn gnome org>
+UserID: gerdk
+
Added: trunk/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,13 @@
+SUBDIRS = src data pixmaps po help man
+
+EXTRA_DIST = \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in \
+ COPYING.GPL \
+ COPYING.FDL
+
+DISTCLEANFILES = \
+ intltool-extract \
+ intltool-merge \
+ intltool-update
Added: trunk/NEWS
==============================================================================
--- (empty file)
+++ trunk/NEWS Fri Jan 11 13:34:55 2008
@@ -0,0 +1,144 @@
+Version 0.2.8
+-------------
+
+Fixes/Improvements:
+ * Fix cursor restoring
+ * Several changes for packaging
+
+Translations:
+ * Gerd Kohlberger [de]
+ * Francesco Fumanti [it] [fr]
+
+2007-11-22 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.2.6
+-------------
+
+New features:
+ * Full documentation (Francesco Fumanti)
+ * New preferences dialog with HIG and Usability improvements
+ * Man page for mousetweaks daemon
+
+Fixes/Improvements:
+ * Improved Autostart handling
+ * Build system improvements
+ * Fix possible leak
+ * Fix gesture dwelling in context menus
+ * Add Xfixes and remove libdaemon dependency
+ * Various code clean-ups
+
+Translations:
+ * Gerd Kohlberger [de]
+ * Francesco Fumanti [it] [fr]
+
+2007-11-14 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.2.4
+-------------
+
+New features:
+ * Split main application into daemon and configuration gui
+ * Can now be use in GDM
+
+Fixes/Improvements:
+ * Remove tray icon
+ * Start/Stop button for the daemon
+ * Improved command-line options
+ * Don't use the full argument vector as session restart command
+
+Translations:
+ * Gerd Kohlberger [de]
+ * Francesco Fumanti [it] [fr]
+
+2007-10-12 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.2.2
+-------------
+
+New features:
+ * Add command-line options
+
+Fixes/Improvements:
+ * Fix bug introduced in 0.2.0 which made dwelling with gesture mode unuseable
+
+Translations:
+ * Gerd Kohlberger [de]
+ * Francesco Fumanti [it] [fr]
+
+2007-08-22 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.2.0
+-------------
+
+New features:
+ * Internationlization support
+
+Fixes/Improvements:
+ * Moved about dialogs to glade
+ * Removed help buttons again, until we have documentation
+ * Use proper distance calculation
+ * Add missing window icons
+
+Translations:
+ * Gerd Kohlberger [de]
+
+2007-08-13 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.1.6
+-------------
+
+New features:
+ * GNOME help support (no actual documentation yet)
+
+Fixes/Improvements:
+ * Removed dwell-click applet note
+ * added drag cursor for dwelling
+ * Dialogs always showed yes/no buttons
+ * Removed 'restore single click' option
+ * Split source files
+ * Build sytem improvements
+
+2007-07-18 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.1.4
+-------------
+
+Fixes/Improvements:
+ * Use gnome mouse icon and honor current theme
+ * Add 'Disable' option to dwell gesture menus
+ * Don't allow impossible gesture settings
+ * Improve warning dialogs
+ * Bug in the ctw context menu
+ * Under certain conditions disabling and reenabling dwell-click failed
+
+2007-07-13 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.1.2
+-------------
+
+New features:
+ * GNOME session support
+ * Preferences dialog for click-type applet
+
+Fixes/Improvements:
+ * Better defaults
+ * Warning dialogs
+ * Better dbus implementation
+ * Build system improvements
+
+2007-06-29 Gerd Kohlberger <lowfi chello at>
+
+
+Version 0.1.0
+-------------
+
+ * Initial Release
+
+2007-06-23 Gerd Kohlberger <lowfi chello at>
Added: trunk/README
==============================================================================
--- (empty file)
+++ trunk/README Fri Jan 11 13:34:55 2008
@@ -0,0 +1,32 @@
+Mousetweaks 0.3.0
+-----------------
+
+Description:
+
+ The Mousetweaks package provides mouse accessibility enhancements for
+ the GNOME desktop. These enhancements are:
+
+ 1. It offers a way to perform the various clicks without using any
+ hardware button.
+
+ 2. It allows users to perform a right click by doing a click&hold
+ of the left mousebutton. (For a left-handed mouse user, the termes
+ left and right have to be inverted.)
+
+ 3. It provides an applet that the user can install on a panel. This
+ applet creates an area on the panel into which the pointer can
+ be captured until the user releases it with a predefined button
+ and modifier combination.
+
+
+Components of Mousetweaks:
+
+ * mousetweaks: daemon that provides the enhancements 1 and 2 of
+ the above description
+
+ * dwell-click-applet: optional applet to select the click-types when
+ enhancement 1 of the above description is used
+
+ * pointer-capture-applet: applet that provides enhancement 3 of
+ the above description
+
Added: trunk/TODO
==============================================================================
--- (empty file)
+++ trunk/TODO Fri Jan 11 13:34:55 2008
@@ -0,0 +1 @@
+
Added: trunk/autogen.sh
==============================================================================
--- (empty file)
+++ trunk/autogen.sh Fri Jan 11 13:34:55 2008
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="mousetweaks"
+
+(test -f $srcdir/src/mt-main.c) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+which gnome-autogen.sh || {
+ echo "You need to install gnome-common from the GNOME SVN"
+ exit 1
+}
+
+USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
Added: trunk/configure.ac
==============================================================================
--- (empty file)
+++ trunk/configure.ac Fri Jan 11 13:34:55 2008
@@ -0,0 +1,157 @@
+AC_PREREQ(2.57)
+
+AC_INIT([mousetweaks], [2.21.5], [lowfi chello at], [mousetweaks])
+AC_CONFIG_SRCDIR([src])
+AC_CONFIG_HEADER([config.h])
+AC_PREFIX_DEFAULT([/usr])
+
+AM_INIT_AUTOMAKE([1.9])
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_HEADER_STDC
+AC_C_CONST
+
+dnl *************
+dnl i18n
+dnl *************
+
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+
+GETTEXT_PACKAGE=mousetweaks
+AC_SUBST(GETTEXT_PACKAGE)
+
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext Package])
+AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
+
+localedir=$datadir/locale
+AC_SUBST(localedir)
+
+GNOME_DOC_INIT
+
+dnl *************
+dnl deps
+dnl *************
+
+PKG_CHECK_MODULES(GCONF, gconf-2.0, have_gconf=true, have_gconf=false)
+if test "x${have_gconf}" = "xfalse"; then
+ AC_MSG_ERROR([No gconf-2.0 package information found])
+fi
+
+AC_SUBST(GCONF_CFLAGS)
+AC_SUBST(GCONF_LIBS)
+
+AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
+if test x"$GCONFTOOL" = xno; then
+ AC_MSG_ERROR([gconftool-2 executable not found in your path])
+fi
+
+AM_GCONF_SOURCE_2
+
+PKG_CHECK_MODULES(GTK, gtk+-2.0, have_gtk=true, have_gtk=false)
+if test "x${have_gtk}" = "xfalse"; then
+ AC_MSG_ERROR([No gtk+-2.0 package information found])
+fi
+
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+
+PKG_CHECK_MODULES(GLADE, libglade-2.0, have_glade=true, have_glade=false)
+if test "x${have_glade}" = "xfalse"; then
+ AC_MSG_ERROR([No libglade-2.0 package information found])
+fi
+
+AC_SUBST(GLADE_CFLAGS)
+AC_SUBST(GLADE_LIBS)
+
+AC_ARG_ENABLE(pointer-capture,
+ [ --disable-pointer-capture Disable pointer-capture applet],
+ [build_pca=$enableval], [build_pca=yes])
+
+AM_CONDITIONAL(BUILD_PCA, test "x$build_pca" = "xyes")
+if test "$build_pca" = yes; then
+ AC_DEFINE(BUILD_PCA, 1, [Build pointer-capture applet])
+fi
+
+AC_ARG_ENABLE(click-type,
+ [ --disable-click-type Disable click-type applet],
+ [build_cta=$enableval], [build_cta=yes])
+
+AM_CONDITIONAL(BUILD_CTA, test "x$build_cta" = "xyes")
+if test "$build_cta" = yes; then
+ AC_DEFINE(BUILD_CTA, 1, [Build click-type applet])
+fi
+
+PKG_CHECK_MODULES(PANEL, libpanelapplet-2.0, have_panel=true, have_panel=false)
+if test "x${have_panel}" = "xfalse"; then
+ AC_MSG_ERROR([No libpanelapplet-2.0 package information found])
+fi
+
+AC_SUBST(PANEL_CFLAGS)
+AC_SUBST(PANEL_LIBS)
+
+PKG_CHECK_MODULES(CSPI, cspi-1.0, have_spi=true, have_spi=false)
+if test "x${have_spi}" = "xfalse"; then
+ AC_MSG_ERROR([No cspi-1.0 package information found])
+fi
+
+AC_SUBST(CSPI_CFLAGS)
+AC_SUBST(CSPI_LIBS)
+
+PKG_CHECK_MODULES(DBUS, dbus-glib-1, have_dbus=true, have_dbus=false)
+if test "x${have_dbus}" = "xfalse"; then
+ AC_MSG_ERROR([No dbus-glib-1 package information found])
+fi
+
+AC_SUBST(DBUS_CFLAGS)
+AC_SUBST(DBUS_LIBS)
+
+PKG_CHECK_MODULES(GNOME, libgnome-2.0, have_gnome=true, have_gnome=false)
+if test "x${have_gnome}" = "xfalse"; then
+ AC_MSG_ERROR([No libgnome-2.0 package information found])
+fi
+
+AC_SUBST(GNOME_CFLAGS)
+AC_SUBST(GNOME_LIBS)
+
+PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0, have_gnomeui=true, have_gnomeui=false)
+if test "x${have_gnomeui}" = "xfalse"; then
+ AC_MSG_ERROR([No libgnomeui-2.0 package information found])
+fi
+
+AC_SUBST(GNOMEUI_CFLAGS)
+AC_SUBST(GNOMEUI_LIBS)
+
+PKG_CHECK_MODULES(XFIXES, xfixes, have_xfixes=true, have_xfixes=false)
+if test "x${have_xfixes}" = "xfalse"; then
+ AC_MSG_ERROR([No xfixes package information found])
+fi
+
+AC_SUBST(XFIXES_CFLAGS)
+AC_SUBST(XFIXES_LIBS)
+
+dnl *************
+dnl dirs
+dnl *************
+
+icondir=$datadir/pixmaps
+AC_SUBST(icondir)
+
+gladedir=$datadir/mousetweaks
+AC_SUBST(gladedir)
+
+AC_OUTPUT([Makefile
+ src/Makefile
+ data/Makefile
+ pixmaps/Makefile
+ po/Makefile.in
+ help/Makefile
+ man/Makefile])
+
+echo ""
+echo "Building panel applets:"
+echo " pointer-capture: $build_pca"
+echo " dwell-click: $build_cta"
+echo ""
Added: trunk/data/DwellClick_Factory.server.in.in
==============================================================================
--- (empty file)
+++ trunk/data/DwellClick_Factory.server.in.in Fri Jan 11 13:34:55 2008
@@ -0,0 +1,25 @@
+<oaf_info>
+<oaf_server iid="OAFIID:DwellClickApplet_Factory" type="exe"
+ location="@bindir@/dwell-click-applet">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:Bonobo/GenericFactory:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" value="Dwell Click Factory"/>
+ <oaf_attribute name="description" type="string" value="Dwell Click Factory"/>
+</oaf_server>
+<oaf_server iid="OAFIID:DwellClickApplet" type="factory"
+ location="OAFIID:DwellClickApplet_Factory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+ <item value="IDL:Bonobo/Control:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" _value="Dwell Click"/>
+ <oaf_attribute name="description" type="string" _value="Select dwelling click type"/>
+ <oaf_attribute name="panel:category" type="string" value="Accessibility"/>
+ <oaf_attribute name="panel:icon" type="string" value="gnome-dev-mouse-optical"/>
+</oaf_server>
+</oaf_info>
Added: trunk/data/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,62 @@
+if BUILD_PCA
+pca_schemas = pointer-capture-applet.schemas
+pca_glade = pointer-capture-applet.glade
+pca_server = PointerCapture_Factory.server.in
+endif
+
+if BUILD_CTA
+cta_glade = dwell-click-applet.glade
+cta_server = DwellClick_Factory.server.in
+endif
+
+serverdir = $(libdir)/bonobo/servers
+server_in_files = $(pca_server) $(cta_server)
+server_in_in_files = $(server_in_files:.server.in=.server.in.in)
+server_DATA = $(server_in_files:.server.in=.server)
+
+if BUILD_PCA
+$(pca_server): $(pca_server).in Makefile
+ sed -e "s|\ bindir\@|$(bindir)|g" < $< > $@
+endif
+
+if BUILD_CTA
+$(cta_server): $(cta_server).in Makefile
+ sed -e "s|\ bindir\@|$(bindir)|g" < $< > $@
+endif
+
+ INTLTOOL_SERVER_RULE@
+
+xmldir = $(datadir)/mousetweaks
+xml_DATA = ctw.glade $(pca_glade) $(cta_glade)
+
+ INTLTOOL_DESKTOP_RULE@
+
+schemasdir = @GCONF_SCHEMA_FILE_DIR@
+schemas_DATA = mousetweaks.schemas $(pca_schemas)
+
+if GCONF_SCHEMAS_INSTALL
+install-data-local:
+ -GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
+ $(GCONFTOOL) --makefile-install-rule mousetweaks.schemas
+if BUILD_PCA
+ -GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
+ $(GCONFTOOL) --makefile-install-rule $(pca_schemas)
+endif
+
+uninstall-local:
+ -GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
+ $(GCONFTOOL) --makefile-uninstall-rule mousetweaks.schemas
+if BUILD_PCA
+ -GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
+ $(GCONFTOOL) --makefile-uninstall-rule $(pca_schemas)
+endif
+endif
+
+EXTRA_DIST = \
+ $(xml_DATA) \
+ $(schemas_DATA) \
+ $(server_in_in_files)
+
+DISTCLEANFILES = \
+ $(server_DATA) \
+ $(server_in_files)
Added: trunk/data/PointerCapture_Factory.server.in.in
==============================================================================
--- (empty file)
+++ trunk/data/PointerCapture_Factory.server.in.in Fri Jan 11 13:34:55 2008
@@ -0,0 +1,26 @@
+<oaf_info>
+<oaf_server iid="OAFIID:PointerCaptureApplet_Factory" type="exe"
+ location="@bindir@/pointer-capture-applet">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:Bonobo/GenericFactory:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" value="Pointer Capture Factory"/>
+ <oaf_attribute name="description" type="string" value="Pointer Capture Factory"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:PointerCaptureApplet" type="factory"
+ location="OAFIID:PointerCaptureApplet_Factory">
+
+ <oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+ <item value="IDL:Bonobo/Control:1.0"/>
+ <item value="IDL:Bonobo/Unknown:1.0"/>
+ </oaf_attribute>
+ <oaf_attribute name="name" type="string" _value="Pointer Capture"/>
+ <oaf_attribute name="description" type="string" _value="Area to lock the pointer"/>
+ <oaf_attribute name="panel:category" type="string" value="Accessibility"/>
+ <oaf_attribute name="panel:icon" type="string" value="gnome-dev-mouse-optical"/>
+</oaf_server>
+</oaf_info>
Added: trunk/data/ctw.glade
==============================================================================
--- (empty file)
+++ trunk/data/ctw.glade Fri Jan 11 13:34:55 2008
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.0 on Sun Oct 14 13:20:35 2007 -->
+<glade-interface>
+ <widget class="GtkMenu" id="popup">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkRadioMenuItem" id="both">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Show Icons and Text</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_as_radio">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioMenuItem" id="icon">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Show Icons only</property>
+ <property name="use_underline">True</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">both</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioMenuItem" id="text">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Show Text only</property>
+ <property name="use_underline">True</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">both</property>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkWindow" id="ctw">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">4</property>
+ <property name="title" translatable="yes">Dwell Click Type</property>
+ <property name="icon_name">gnome-dev-mouse-optical</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <child>
+ <widget class="GtkHBox" id="box">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">2</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkRadioButton" id="single">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage" id="single_i">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">1</property>
+ <property name="pixbuf">human-single.png</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="single_l">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Single Click</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="double">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single</property>
+ <child>
+ <widget class="GtkVBox" id="vbox14">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage" id="double_i">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">1</property>
+ <property name="pixbuf">human-double.png</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="double_l">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Double Click</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="drag">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single</property>
+ <child>
+ <widget class="GtkVBox" id="vbox15">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage" id="drag_i">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">1</property>
+ <property name="pixbuf">human-drag.png</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="drag_l">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Drag Click</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="right">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single</property>
+ <child>
+ <widget class="GtkVBox" id="vbox16">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage" id="right_i">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">1</property>
+ <property name="pixbuf">human-right.png</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="right_l">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Right Click</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
Added: trunk/data/dwell-click-applet.glade
==============================================================================
--- (empty file)
+++ trunk/data/dwell-click-applet.glade Fri Jan 11 13:34:55 2008
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.3.3 on Mon Aug 13 20:46:54 2007 -->
+<glade-interface>
+ <widget class="GtkWindow" id="horizontal">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="title" translatable="yes">Click Type Window</property>
+ <child>
+ <widget class="GtkHBox" id="box_hori">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <widget class="GtkRadioButton" id="single_click">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Single Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <child>
+ <widget class="GtkImage" id="single_click_img">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="double_click">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Double Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click</property>
+ <child>
+ <widget class="GtkImage" id="double_click_img">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="drag_click">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Drag Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click</property>
+ <child>
+ <widget class="GtkImage" id="drag_click_img">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="right_click">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Right Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click</property>
+ <child>
+ <widget class="GtkImage" id="right_click_img">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkWindow" id="vertical">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkVBox" id="box_vert">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkRadioButton" id="single_click_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Single Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="active">True</property>
+ <child>
+ <widget class="GtkImage" id="single_click_img_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="double_click_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Double Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click_v</property>
+ <child>
+ <widget class="GtkImage" id="double_click_img_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="drag_click_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Drag Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click_v</property>
+ <child>
+ <widget class="GtkImage" id="drag_click_img_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="right_click_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Right Click</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">False</property>
+ <property name="image_position">GTK_POS_TOP</property>
+ <property name="response_id">0</property>
+ <property name="group">single_click_v</property>
+ <child>
+ <widget class="GtkImage" id="right_click_img_v">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-missing-image</property>
+ <property name="icon_size">5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkAboutDialog" id="about">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="title">Info zu</property>
+ <property name="resizable">False</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="icon_name">gnome-dev-mouse-optical</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <property name="copyright">Copyright 2007 Â Gerd Kohlberger</property>
+ <property name="comments" translatable="yes">Applet to select different dwell-click types.
+Part of MouseTweaks</property>
+ <property name="authors">Gerd Kohlberger <lowfi chello at></property>
+ <property name="translator_credits">Gerd Kohlberger <lowfi chello at> - de
+Francesco Fumanti <francesco fumanti gmx net> - fr, it</property>
+ <property name="logo_icon_name">gnome-dev-mouse-optical</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
Added: trunk/data/mousetweaks.schemas
==============================================================================
--- (empty file)
+++ trunk/data/mousetweaks.schemas Fri Jan 11 13:34:55 2008
@@ -0,0 +1,149 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+ <schemalist>
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/threshold</key>
+ <applyto>/desktop/gnome/accessibility/mouse/threshold</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>10</default>
+ <locale name="C">
+ <short>Movement Threshold</short>
+ <long>Distance in pixels before movement will be recognized</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/delay_enable</key>
+ <applyto>/desktop/gnome/accessibility/mouse/delay_enable</applyto>
+ <owner>mousetweaks</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Enable Delay Click</short>
+ <long>Enable Delay Click</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/delay_time</key>
+ <applyto>/desktop/gnome/accessibility/mouse/delay_time</applyto>
+ <owner>mousetweaks</owner>
+ <type>float</type>
+ <default>1.20</default>
+ <locale name="C">
+ <short>Delay Click Time</short>
+ <long>Seconds to hold left button before the context menu opens</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_enable</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_enable</applyto>
+ <owner>mousetweaks</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Enable Dwell Click</short>
+ <long>Enable Dwell Click</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_time</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_time</applyto>
+ <owner>mousetweaks</owner>
+ <type>float</type>
+ <default>1.20</default>
+ <locale name="C">
+ <short>Dwell Click Time</short>
+ <long>Seconds before the click is exectued</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_gesture_single</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_gesture_single</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>0</default>
+ <locale name="C">
+ <short>Gesture Single Click</short>
+ <long>Direction to perform a single click (0 = Left, 1 = Right, 2 = Up, 3 = Down)</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_gesture_double</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_gesture_double</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>2</default>
+ <locale name="C">
+ <short>Gesture Double Click</short>
+ <long>Direction to perform a double click (0 = Left, 1 = Right, 2 = Up, 3 = Down)</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_gesture_drag</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_gesture_drag</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>3</default>
+ <locale name="C">
+ <short>Gesture Drag Click</short>
+ <long>Direction to perform dragging (0 = Left, 1 = Right, 2 = Up, 3 = Down)</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_gesture_secondary</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_gesture_secondary</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Gesture Secondary Click</short>
+ <long>Direction to perform a secondary click (0 = Left, 1 = Right, 2 = Up, 3 = Down)</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_mode</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_mode</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Dwell Click Mode</short>
+ <long>(0 = Gesture mode, 1 = Click Type window mode)</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/dwell_show_ctw</key>
+ <applyto>/desktop/gnome/accessibility/mouse/dwell_show_ctw</applyto>
+ <owner>mousetweaks</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Show Click Type Window</short>
+ <long>Show Click Type Window</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/desktop/gnome/accessibility/mouse/button_layout</key>
+ <applyto>/desktop/gnome/accessibility/mouse/button_layout</applyto>
+ <owner>mousetweaks</owner>
+ <type>int</type>
+ <default>2</default>
+ <locale name="C">
+ <short>Button Layout</short>
+ <long>Style of Click Type Buttons (0 = Text, 1 = Icon, 2 = Both)</long>
+ </locale>
+ </schema>
+
+ </schemalist>
+</gconfschemafile>
Added: trunk/data/pointer-capture-applet.glade
==============================================================================
--- (empty file)
+++ trunk/data/pointer-capture-applet.glade Fri Jan 11 13:34:55 2008
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.0 on Thu Nov 1 17:50:56 2007 -->
+<glade-interface>
+ <widget class="GtkAboutDialog" id="about">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="title">Info zu</property>
+ <property name="resizable">False</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="icon_name">gnome-dev-mouse-optical</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="has_separator">False</property>
+ <property name="copyright">Copyright 2007 Â Gerd Kohlberger</property>
+ <property name="comments" translatable="yes">Area to freeze the mouse pointer on the panel.
+Part of MouseTweaks</property>
+ <property name="authors">Gerd Kohlberger <lowfi chello at></property>
+ <property name="translator_credits">Gerd Kohlberger <lowfi chello at> - de
+Francesco Fumanti <francesco fumanti gmx net> - fr, it</property>
+ <property name="logo_icon_name">gnome-dev-mouse-optical</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="GtkWindow" id="capture_preferences">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">Pointer Capture Preferences</property>
+ <property name="resizable">False</property>
+ <property name="icon_name">gnome-dev-mouse-optical</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">24</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">18</property>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="top_padding">8</property>
+ <property name="left_padding">18</property>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">8</property>
+ <child>
+ <widget class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Button:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">cap_button</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Modifier:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkCheckButton" id="cap_ctrl">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">C_trl</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="cap_alt">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">_Alt</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="cap_shift">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">S_hift</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </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">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkSpinButton" id="cap_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Selecting Button 0 will capture the pointer immediately</property>
+ <property name="max_length">1</property>
+ <property name="adjustment">1 0 3 1 1 1</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_IF_VALID</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes"><b>Capture Pointer</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="top_padding">8</property>
+ <property name="left_padding">18</property>
+ <child>
+ <widget class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">8</property>
+ <child>
+ <widget class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">B_utton:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">rel_button</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Modifier:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkCheckButton" id="rel_ctrl">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">Ct_rl</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="rel_alt">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">A_lt</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkCheckButton" id="rel_shift">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">Sh_ift</property>
+ <property name="use_underline">True</property>
+ <property name="response_id">0</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </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">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkSpinButton" id="rel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">1</property>
+ <property name="adjustment">1 1 3 1 1 1</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_IF_VALID</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label21">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes"><b>Release Pointer</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="top_padding">8</property>
+ <property name="left_padding">18</property>
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">24</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Width:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">size</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkSpinButton" id="size">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="max_length">3</property>
+ <property name="adjustment">20 20 200 1 1 1</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ <property name="update_policy">GTK_UPDATE_IF_VALID</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">pixels</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes"><b>Size of Capture Area</b></property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="layout_style">GTK_BUTTONBOX_EDGE</property>
+ <child>
+ <widget class="GtkButton" id="help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">gtk-help</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="close">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
Added: trunk/data/pointer-capture-applet.schemas
==============================================================================
--- (empty file)
+++ trunk/data/pointer-capture-applet.schemas Fri Jan 11 13:34:55 2008
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+ <schemalist>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/size</key>
+ <owner>pointer-capture</owner>
+ <type>int</type>
+ <default>100</default>
+ <locale name="C">
+ <short>Size of capture area</short>
+ <long>The width in pixels of the capture area</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/capture_button</key>
+ <owner>pointer-capture</owner>
+ <type>int</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Capture button</short>
+ <long>Button to initiate pointer capturing</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/release_button</key>
+ <owner>pointer-capture</owner>
+ <type>int</type>
+ <default>1</default>
+ <locale name="C">
+ <short>Release button</short>
+ <long>Button to release the pointer</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/capture_mod_shift</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Capture modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/capture_mod_alt</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Capture modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/capture_mod_ctrl</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Capture modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/release_mod_shift</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Release modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/release_mod_alt</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Release modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/pointer-capture/release_mod_ctrl</key>
+ <owner>pointer-capture</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Release modifier</short>
+ <long>Key modifier</long>
+ </locale>
+ </schema>
+
+ </schemalist>
+</gconfschemafile>
Added: trunk/help/C/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/help/C/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,7 @@
+figdir = figures
+docname = mousetweaks
+lang = C
+omffile =
+entities = legal.xml
+include $(top_srcdir)/xmldocs.make
+dist-hook: app-dist-hook
Added: trunk/help/C/figures/mt-add-applet-to-panel-window.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-control-panel-delay-click-enabled.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-control-panel-dwell-click-enabled.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-delay-click-checkbox.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-delay-click-pause-time-slider.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-checkbox.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-click-type-applet.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-click-type-window.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-gesture-mapping.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-ignore-movement-slider.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-pause-time-slider.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-dwell-click-trigger-choice.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-pointer-capture-context-menu.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-pointer-capture-locked.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/figures/mt-pointer-capture-preferences-window.png
==============================================================================
Binary file. No diff available.
Added: trunk/help/C/legal.xml
==============================================================================
--- (empty file)
+++ trunk/help/C/legal.xml Fri Jan 11 13:34:55 2008
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<legalnotice id="legalnotice">
+ <para> Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License (GFDL), Version 1.1 or
+ any later version published by the Free Software Foundation with no
+ Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You can
+ find a copy of the GFDL at this <ulink type="http"
+ url="http://www.fsf.org/licensing/licenses/fdl.html">link</ulink> or in the
+ the top-level directory of the Mousetweaks source package.</para>
+
+ <para> This manual is part of a collection of GNOME manuals distributed
+ under the GFDL. If you want to distribute this manual separately from the
+ collection, you can do so by adding a copy of the license to the manual, as
+ described in section 6 of the license. </para>
+
+ <para> Many of the names used by companies to distinguish their products and
+ services are claimed as trademarks. Where those names appear in any GNOME
+ documentation, and the members of the GNOME Documentation Project are made
+ aware of those trademarks, then the names are in capital letters or initial
+ capital letters. </para>
+
+ <para> DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED UNDER THE
+ TERMS OF THE GNU FREE DOCUMENTATION LICENSE WITH THE FURTHER UNDERSTANDING
+ THAT: <orderedlist>
+ <listitem>
+ <para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTY OF
+ ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
+ WARRANTIES THAT THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS
+ FREE OF DEFECTS MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
+ NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY, ACCURACY, AND
+ PERFORMANCE OF THE DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS
+ WITH YOU. SHOULD ANY DOCUMENT OR MODIFIED VERSION PROVE DEFECTIVE IN
+ ANY RESPECT, YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY CONTRIBUTOR)
+ ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS
+ DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
+ NO USE OF ANY DOCUMENT OR MODIFIED VERSION OF THE DOCUMENT IS
+ AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER; AND </para>
+ </listitem>
+
+ <listitem>
+ <para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER IN
+ TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
+ INITIAL WRITER, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF THE DOCUMENT OR
+ MODIFIED VERSION OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
+ PARTIES, BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT, SPECIAL,
+ INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING,
+ WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE,
+ COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
+ LOSSES ARISING OUT OF OR RELATING TO USE OF THE DOCUMENT AND MODIFIED
+ VERSIONS OF THE DOCUMENT, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED
+ OF THE POSSIBILITY OF SUCH DAMAGES. </para>
+ </listitem>
+ </orderedlist> </para>
+</legalnotice>
\ No newline at end of file
Added: trunk/help/C/mousetweaks.xml
==============================================================================
--- (empty file)
+++ trunk/help/C/mousetweaks.xml Fri Jan 11 13:34:55 2008
@@ -0,0 +1,829 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY legal SYSTEM "legal.xml">
+<!ENTITY appversion "0.2.6">
+<!ENTITY manrevision "0.2">
+<!ENTITY date "October 2007">
+<!ENTITY app "<application>Mousetweaks</application>">
+]>
+<article id="index" lang="en">
+ <articleinfo>
+ <title><application>Mousetweaks</application> Manual</title>
+
+ <copyright>
+ <year>2007</year>
+
+ <holder>Francesco Fumanti</holder>
+ </copyright>
+
+ &legal;
+ <authorgroup>
+ <author>
+ <firstname>Francesco</firstname>
+
+ <surname>Fumanti</surname>
+
+ <affiliation>
+ <address><email>francesco fumanti gmx net</email> </address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>version 0.2</revnumber>
+
+ <date>November 2007</date>
+
+ <revdescription>
+ <para role="author">The contents of the manual have been adapted to
+ the default theme of GNOME, called Clearlooks. This version is
+ included with the release 0.2.6 of Mousetweaks. Francesco Fumanti
+ <email>francesco fumanti gmx net</email></para>
+ </revdescription>
+ </revision>
+
+ <revision>
+ <revnumber>version 0.1</revnumber>
+
+ <date>October 2007</date>
+
+ <revdescription>
+ <para role="author">First draft of the manual. Francesco Fumanti
+ <email>francesco fumanti gmx net</email></para>
+ </revdescription>
+ </revision>
+ </revhistory>
+
+ <releaseinfo>This manual describes version 0.2.6 of
+ Mousetweaks.</releaseinfo>
+
+ <contrib>To report a bug or make a suggestion regarding the Mousetweaks
+ application or this manual, please go to Launchpad.</contrib>
+
+ <legalnotice>
+ <title>Feedback</title>
+
+ <para>To report a bug or make a suggestion regarding the
+ <application>Mousetweaks</application> application or this manual,
+ please go to <ulink type="http"
+ url="https://bugs.launchpad.net/mousetweaks/">Launchpad</ulink>.</para>
+ </legalnotice>
+ </articleinfo>
+
+ <indexterm zone="index">
+ <primary>Mousetweaks</primary>
+ </indexterm>
+
+ <indexterm zone="index">
+ <primary>mousetweaks</primary>
+ </indexterm>
+
+ <sect1 id="mt-introduction">
+ <title>Introduction</title>
+
+ <para>The <application>Mousetweaks</application> application provides
+ mouse accessibility enhancements for the GNOME Desktop. Indeed, it offers
+ the following new pointer functions to the user:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>The possibility to perform a right click by holding the
+ <mousebutton>left mousebutton</mousebutton> pressed while keeping the
+ pointer motionless.</para>
+ </listitem>
+
+ <listitem>
+ <para>The possibility to perform the various clicks without pressing
+ any <hardware>hardware button</hardware>.</para>
+ </listitem>
+
+ <listitem>
+ <para>The possibility to lock the pointer in a determined area of the
+ panel until the user releases it by a predefined keystroke or mouse
+ button.</para>
+ </listitem>
+ </itemizedlist>
+ </sect1>
+
+ <sect1 id="mt-how-to-start">
+ <title>How to start the features</title>
+
+ <para>The right click feature and the buttonless click feature of
+ <application><application>Mousetweaks</application></application> depend
+ on the mousetweaks process; however the pointer capture applet depends on
+ the gnome panel. Consequently, they have to be started differently:</para>
+
+ <sect2 id="mt-start-right-click-feature">
+ <title>Starting the right click feature</title>
+
+ <para>You can start the right click feature of
+ <application>Mousetweaks</application> in two ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>from the graphical user interface</para>
+ </listitem>
+
+ <listitem>
+ <para>from the command line</para>
+ </listitem>
+ </itemizedlist>
+
+ <sect3 id="mt-start-right-click-by-menu">
+ <title>Start from the graphical user interface</title>
+
+ <para>Choose the menu <menuchoice>
+ <guimenu>Applications</guimenu>
+
+ <guisubmenu>Universal Access</guisubmenu>
+
+ <guimenuitem>Mousetweaks</guimenuitem>
+ </menuchoice> to open the control panel of Mousetweaks. You will get
+ the following window:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-control-panel-delay-click-enabled.png"
+ format="PNG" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the panel of
+ <application>Mousetweaks</application></para>
+ </textobject>
+ </mediaobject>
+
+ <para>To start the right click feature, put a checkmark into the
+ checkbox that says:</para>
+
+ <para><quote>Trigger secondary button when I hold down the primary
+ button</quote></para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-delay-click-checkbox.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the checkbox to start the right click
+ feature</para>
+ </textobject>
+ </mediaobject>
+ </sect3>
+
+ <sect3 id="mt-start-right-click-by-cli">
+ <title>Start from the command line</title>
+
+ <para>To start the right click feature from the command line, open the
+ <application>Terminal</application> and type the following:</para>
+
+ <para><command>mousetweaks <parameter>--enable
+ delay</parameter></command></para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="mt-start-buttonless-click-feature">
+ <title>Starting the buttonless click feature</title>
+
+ <para>You can start the buttonless click feature of
+ <application>Mousetweaks</application> in two ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>from the graphical user interface</para>
+ </listitem>
+
+ <listitem>
+ <para>from the command line</para>
+ </listitem>
+ </itemizedlist>
+
+ <sect3 id="mt-start-buttonless-click-by-menu">
+ <title>Start from the graphical user interface</title>
+
+ <para>Choose the menu <menuchoice>
+ <guimenu>Applications</guimenu>
+
+ <guisubmenu>Universal Access</guisubmenu>
+
+ <guimenuitem>Mousetweaks</guimenuitem>
+ </menuchoice> to open the control panel of Mousetweaks. You will get
+ the following window:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-control-panel-dwell-click-enabled.png"
+ format="PNG" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the control panel of
+ <application>Mousetweaks</application></para>
+ </textobject>
+ </mediaobject>
+
+ <para>To start the buttonless click feature, put a checkmark into the
+ checkbox that says:</para>
+
+ <para><quote>Perform different clicks without using any
+ button</quote></para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-checkbox.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the checkbox to start the buttonless click
+ feature</para>
+ </textobject>
+ </mediaobject>
+ </sect3>
+
+ <sect3 id="mt-start-buttonless-click-by-cli">
+ <title>Start from the command line</title>
+
+ <para>To start the buttonless click feature and show the click type
+ window from the command line, open the
+ <application>Terminal</application> and type the following:</para>
+
+ <para><command>mousetweaks <parameter>--enable dwell
+ --show-ctw</parameter></command></para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="mt-start-pointer-capture-feature">
+ <title>Starting the pointer capture feature</title>
+
+ <para>As the pointer capture applet comes in the from of a panel applet,
+ its starting method has to follow the rules dictated by the GNOME panel.
+ Thus, to start the pointer capture feature, you only have to install it
+ on the panel and it will automatically run, regardless of the state of
+ the other features of Mousetweaks.</para>
+
+ <para>In order to add it to the panel, proceed as you do with any panel
+ applet: right click on the panel to open its contextual menu, choose
+ <guimenuitem>Add to Panel</guimenuitem>, and you will get the window
+ showing all the applets that can be installed on the GNOME
+ panel.<mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-add-applet-to-panel-window.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the Pointer Capture applet in the Add to
+ Panel window</para>
+ </textobject>
+ </mediaobject></para>
+
+ <para>By double clicking on the Pointer Capture item in the Add to Panel
+ window, the pointer capture applet will be added to the panel, and it
+ will be working until removed.</para>
+ </sect2>
+ </sect1>
+
+ <sect1 id="mt-how-to-stop-features">
+ <title>Quitting the features</title>
+
+ <para>Similar to the starting of the features, their quitting also depends
+ on the feature that you want to quit.</para>
+
+ <sect2 id="mt-stop-right-click-feature">
+ <title>Quitting the right click feature</title>
+
+ <para>It is possible to quit the right click feature of
+ <application>Mousetweaks</application> in two ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>By removing the mark from the corresponding checkbox in the
+ control panel of <application>Mousetweaks</application>.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-delay-click-checkbox.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the checkbox to start the right click
+ feature</para>
+ </textobject>
+ </mediaobject>
+
+ <para>Please refer to <link
+ linkend="mt-start-right-click-by-menu">Starting the right click
+ feature from menu</link> to locate the checkbox.</para>
+ </listitem>
+
+ <listitem>
+ <para>By typing the following command at the command line:</para>
+
+ <para><command>mousetweaks</command>
+ <parameter>--shutdown</parameter></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="mt-stop-buttonless-click-feature">
+ <title>Quitting the buttonless click feature</title>
+
+ <para>It is possible to quit the buttonless click feature of
+ <application>Mousetweaks</application> in two ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>By removing the mark from the corresponding checkbox in the
+ control panel of <application>Mousetweaks</application>.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-checkbox.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the checkbox to start the buttonless click
+ feature</para>
+ </textobject>
+ </mediaobject>
+
+ <para>Please refer to <link
+ linkend="mt-start-buttonless-click-by-menu">Starting the buttonless
+ click feature from menu</link> to locate the checkbox.</para>
+ </listitem>
+
+ <listitem>
+ <para>By typing the following command at the command line:</para>
+
+ <para><command>mousetweaks</command>
+ <parameter>--shutdown</parameter></para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+
+ <sect2 id="mt-stop-pointer-capture-feature">
+ <title>Quitting the pointer capture feature</title>
+
+ <para>As the pointer capture feature comes in the form of a panel
+ applet, you have to quit it the same way that you do it with other
+ applets: perform a right click on the applet and choose
+ <guimenuitem>Remove From Panel</guimenuitem> from its contextual
+ menu.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-pointer-capture-context-menu.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the pointer capture area (green) with its
+ contextual menu</para>
+ </textobject>
+ </mediaobject>
+ </sect2>
+ </sect1>
+
+ <sect1 id="mt-features-description">
+ <title>Description of the features</title>
+
+ <para>The <application>Mousetweaks</application> application offers three
+ new pointer features to the user. These are: <itemizedlist>
+ <listitem>
+ <para><xref linkend="mt-delay-click" /></para>
+ </listitem>
+
+ <listitem>
+ <para><xref linkend="mt-dwell-click" /></para>
+ </listitem>
+
+ <listitem>
+ <para><xref linkend="mt-pointer-capture" /></para>
+ </listitem>
+ </itemizedlist><note>
+ <para>The manual assumes a right-handed user: consequently, left mouse
+ button indicates the primary mouse button and right mouse button
+ indicates the secondary mouse button. Of course, for a left-handed
+ user that has enabled the corresponding option in the Mouse control
+ panel, the terms left and right have to be exchanged.</para>
+ </note></para>
+
+ <sect2 id="mt-delay-click">
+ <title>Right clicking with the left button</title>
+
+ <para>When the user activates this feature, he will be able to perform
+ right clicks by using the <mousebutton>left mouse button</mousebutton>.
+ This is especially useful for users that have only one
+ <mousebutton>mouse button</mousebutton> at their disposal.</para>
+
+ <sect3 id="mt-delay-howto">
+ <title>How does it work?</title>
+
+ <para>When this feature is enabled, mousetweaks performs a right click
+ at the location of the pointer, if the user keeps the
+ <mousebutton>left mouse button</mousebutton> pressed without moving
+ the pointer for a determined time.</para>
+
+ <para>How long the user has to hold the <mousebutton>left mouse
+ button</mousebutton> pressed is determined by the slider in the
+ control panel of mousetweaks with the title:</para>
+
+ <para><quote>Time to hold primary button</quote></para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-delay-click-pause-time-slider.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the slider to set how long to hold the left
+ button for the right click to be triggered</para>
+ </textobject>
+ </mediaobject>
+ </sect3>
+
+ <sect3 id="mt-delay-characteristics">
+ <title>Differences to the normal right button click</title>
+
+ <para>As <application>Mousetweaks</application> is not able to discard
+ the <mousebutton>left mouse button down</mousebutton> gesture from the
+ <mousebutton>left button press</mousebutton> of the user, it issues a
+ left click before issuing the right click. In other words, each right
+ click performed by this feature of mousetweaks is immediately preceded
+ by a left click, and this makes it behave a bit differently to the
+ normal right click performed by the <mousebutton>right mouse
+ button</mousebutton>. For example:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>It is not possible to perform a right click on multiple
+ items because the left click issued before the right click
+ deselects the items.</para>
+ </listitem>
+
+ <listitem>
+ <para>When this type of right click is performed on the trash icon
+ on the panel, not only does the contextual menu appear, but the
+ trash folder does also open. (The former is caused by the right
+ click, the latter by the left click preceding the right
+ click.)</para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>It is not possible to provide a list of all diverging
+ behaviours, because it depends on the reaction of the application
+ receiving the right click preceded by a left click.</para>
+ </note>
+
+ <para>Some users may also be surprised by the behaviour caused by the
+ fact, that it is not possible to perform a long motionless left click
+ and hold, without also doing a right click. For example:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>When doing a motionless left click and hold on the arrow of
+ a scrollbar, the scrollbar jumps to the bottom after some time.
+ This is in fact the normal behaviour of a right click on an arrow
+ of a scrollbar.</para>
+
+ <tip>
+ <para>To work around this behaviour, simply move the pointer
+ immediately after pressing the <mousebutton>mouse
+ button</mousebutton>. This way
+ <application>Mousetweaks</application> does not issue the right
+ click.</para>
+ </tip>
+ </listitem>
+ </itemizedlist>
+ </sect3>
+ </sect2>
+
+ <sect2 id="mt-dwell-click">
+ <title>Clicking without the use of any hardware button</title>
+
+ <para>By activating this feature, users will be able to perform left
+ clicks, double clicks, drag clicks and right clicks without having to
+ press any <mousebutton>mouse button</mousebutton>.</para>
+
+ <note>
+ <para>When the buttonless click is active, the <mousebutton>mouse
+ buttons</mousebutton> remain functional and it is still possible to
+ click with the <mousebutton>mouse buttons</mousebutton>.</para>
+ </note>
+
+ <sect3 id="mt-dwell-trigger-choice">
+ <title>Click trigger and click type choice</title>
+
+ <para>The user can choose between two methods to trigger the clicks:
+ by time or by gesture. There are two radio buttons for this purpose in
+ the control panel of Mousetweaks.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-trigger-choice.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the radio buttons to select trigger
+ method</para>
+ </textobject>
+ </mediaobject>
+
+ <para>To select the trigger method, the user only needs to click on
+ the radio button that corresponds to his desired trigger
+ method.</para>
+
+ <sect4>
+ <title>Trigger by time</title>
+
+ <para>In the trigger by time method, the Mousetweaks application
+ automatically performs the click after the pointer has been
+ motionless for a determined time.</para>
+
+ <remark>See <link linkend="mt-dwell-time-setting">Time settings for
+ buttonless clicks</link> for more information about how to set the
+ time lapse that the pointer has to be motionless before performing
+ the click.</remark>
+
+ <para>The type of click performed depends on the selection in the
+ click type window or click type applet. Have a look at the following
+ picture to see the click type window and the click type
+ applet:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-click-type-window.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the click type window</para>
+ </textobject>
+ </mediaobject>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-click-type-applet.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the click type applet at the right of the
+ menus</para>
+ </textobject>
+ </mediaobject>
+
+ <para>To display the click type window on the screen, the user has
+ to put a checkmark in the corresponding checkbox <application>in the
+ control panel of Mousetweaks</application>.</para>
+
+ <para>To display the click type applet on the GNOME panel, please
+ follow the procedure you have to use in order to add any applet to
+ the GNOME panel. If you do not know how to add an applet to the
+ panel, please have a look at <link
+ linkend="mt-start-pointer-capture-feature">Starting the pointer
+ capture feature</link>.</para>
+
+ <para>The click type window and the click type applet can be used
+ simultaneously or each on its own.</para>
+
+ <tip>
+ <para>The click type applet is especially interesting for people
+ that do not want to cover their desktop with the click type
+ window.</para>
+ </tip>
+ </sect4>
+
+ <sect4>
+ <title>Trigger by gesture</title>
+
+ <para>In the trigger by gesture method, the shape of the pointer
+ changes to the gesture shape after being motionless for a determined
+ time.</para>
+
+ <remark>See <link linkend="mt-dwell-time-setting">Time settings for
+ buttonless clicks</link> for more information about how to set the
+ time lapse that the pointer has to be motionless before its shape
+ changes to the gesture shape.</remark>
+
+ <para>If the user moves the pointer while it is showing the gesture
+ shape, a click is performed. Moreover, the type of click performed
+ depends on the direction that the user moved the pointer.</para>
+
+ <para>If the user does not move the pointer while it is showing the
+ gesture shape, its shape returns to the normal pointer shape and the
+ user can again move the pointer without a click being
+ performed.</para>
+
+ <para>There is a section in the control panel of Mousetweaks for the
+ user to map click type to movement direction:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-gesture-mapping.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the configuration options to map click
+ type to movement direction</para>
+ </textobject>
+ </mediaobject>
+
+ <para>By using the <guimenu>popup</guimenu> menus, the user can set
+ what direction he wants to correspond to what click type. There is
+ also a <guimenuitem>Disabled</guimenuitem> menu item in each
+ <guimenu>popup</guimenu>, so that user can disable the click types
+ that he does not want to be performed automatically. This is
+ especially interesting for users that have problems only with
+ certain click types.</para>
+ </sect4>
+ </sect3>
+
+ <sect3>
+ <title id="mt-dwell-time-setting">Time settings for buttonless
+ clicks</title>
+
+ <para>When using the buttonless click feature, the pointer has to stay
+ motionless for a determined time before a click is automatically
+ performed or before the pointer changes its shape to the gesture
+ shape. The control panel of Mousetweaks offers the following slider to
+ set the time to wait before a click is triggered:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-pause-time-slider.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the slider to set how long the pointer has
+ to be motionless</para>
+ </textobject>
+ </mediaobject>
+
+ <para>By moving the Time to Wait slider, the user can tell
+ <application>Mousetweaks</application> how long the pointer has to be
+ motionless before a click is automatically performed or before the
+ pointer changes its shape to the gesture shape.</para>
+
+ <note>
+ <para>This function only works in the context of the buttonless
+ click.</para>
+ </note>
+ </sect3>
+
+ <sect3 id="mt-dwell-movement-tolerance">
+ <title>Movement tolerance for buttonless clicks</title>
+
+ <para>When using the buttonless click feature, the pointer has to stay
+ motionless for a determined time before a click is automatically
+ performed or before the pointer changes its shape to the gesture
+ shape. For people who have problems to keep the pointer motionless for
+ a determined time lapse, there is a slider in the control panel of
+ <application>Mousetweaks</application> to make it ignore small pointer
+ movements.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-dwell-click-ignore-movement-slider.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the slider to set the amount of pointer
+ movement to ignore</para>
+ </textobject>
+ </mediaobject>
+
+ <para>By moving this slider, the user can indicate to Mousetweaks what
+ maximum movement size it has to consider as motionless.</para>
+
+ <note>
+ <para>This function only works in the context of the buttonless
+ click.</para>
+ </note>
+ </sect3>
+ </sect2>
+
+ <sect2 id="mt-pointer-capture">
+ <title>Locking the pointer</title>
+
+ <para>There are people that have to use their pointing device not only
+ for the computer. These people would welcome a way to lock the pointer
+ into an area of the screen, so that they can use their pointing device
+ for other tasks. The <application>Mousetweaks</application> application
+ ships with an applet called Pointer Capture that creates an area on the
+ panel into which the user can lock the pointer until he releases it in a
+ determined way.</para>
+
+ <remark>Have a look at <link
+ linkend="mt-start-pointer-capture-feature">Starting the pointer capture
+ feature</link> for instructions about how to install and remove it from
+ the GNOME panel.</remark>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-pointer-capture-context-menu.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the pointer capture area (green) with its
+ contextual menu</para>
+ </textobject>
+
+ <imageobject>
+ <imagedata fileref="figures/mt-pointer-capture-locked.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture of the pointer capture area when the pointer has been
+ captured</para>
+ </textobject>
+ </mediaobject>
+
+ <para>By choosing Preferences in the contextual menu of the pointer
+ capture applet, the user gets a window with the options of the pointer
+ capture applet:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/mt-pointer-capture-preferences-window.png" />
+ </imageobject>
+
+ <textobject>
+ <para>Picture showing the preferences of the pointer capture
+ applet</para>
+ </textobject>
+ </mediaobject>
+
+ <para>The preferences window of the pointer capture applet has three
+ sections:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>In the Capture Pointer section, the user can specify under
+ what circumstances the pointer gets captured when it moves into the
+ capture area. For example: if the control modifier is checked, the
+ pointer gets captured when it is over the capture area and the user
+ presses the Control modifier key. If no modifier is checked and the
+ mouse button is set to 0, the pointer only has to move into the
+ capture area to get locked.</para>
+
+ <para>It is also possible to specify a combination of modifiers and
+ mouse button.</para>
+ </listitem>
+
+ <listitem>
+ <para>In the Release Pointer section, the user can specify what
+ modifier or mouse button releases the pointer.</para>
+
+ <para>It is also possible to specify a combination of modifiers and
+ mouse button.</para>
+ </listitem>
+
+ <listitem>
+ <para>In the Size of Capture Area section, the user can specify the
+ width of the capture area on the GNOME panel.</para>
+ </listitem>
+ </itemizedlist>
+ </sect2>
+ </sect1>
+
+ <sect1 id="mt-about">
+ <title>About <application>Mousetweaks</application></title>
+
+ <sect2>
+ <title>Authors and hosting site</title>
+
+ <para><application>Mousetweaks</application> is based on a <ulink
+ type="https"
+ url="https://wiki.ubuntu.com/Accessibility/Specs/MouseTweaks">specification</ulink>
+ hosted on Launchpad and was implemented by Gerd Kohlberger (
+ <email>lowfi chello at</email> ); Francesco Fumanti (
+ <email>francesco fumanti gmx net</email> ) helped with testing and other
+ things.</para>
+
+ <para>You can find more informations about Mousetweaks on <ulink
+ type="https"
+ url="https://launchpad.net/mousetweaks">Launchpad</ulink>.</para>
+ </sect2>
+
+ <sect2>
+ <title>Feedback</title>
+
+ <para>To report a bug or make a suggestion regarding
+ <application>Mousetweaks</application> or this manual, please use the
+ facilities provided by the <ulink type="https"
+ url="https://launchpad.net/mousetweaks">Mousetweaks' pages on
+ Launchpad</ulink> .</para>
+ </sect2>
+
+ <sect2>
+ <title>License</title>
+
+ <para>This program is distributed under the terms of the GNU General
+ Public license as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version. A copy
+ of this license can be found at this <ulink type="http"
+ url="http://www.gnu.org/licenses/gpl-3.0.txt">link</ulink>, or in the
+ file COPYING included with the source code of this program.</para>
+ </sect2>
+ </sect1>
+</article>
Added: trunk/help/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/help/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,6 @@
+include $(top_srcdir)/gnome-doc-utils.make
+dist-hook: doc-dist-hook
+
+DOC_MODULE = mousetweaks
+DOC_INCLUDES = legal.xml
+
Added: trunk/man/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/man/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,2 @@
+man_MANS = mousetweaks.1
+EXTRA_DIST = $(man_MANS)
Added: trunk/man/mousetweaks.1
==============================================================================
--- (empty file)
+++ trunk/man/mousetweaks.1 Fri Jan 11 13:34:55 2008
@@ -0,0 +1,67 @@
+.\" Macros
+.\" define indentation for suboptions
+.nr SS 5
+.de IPs
+.IP "\\$1" \n(SS
+..
+.TH "Mousetweaks" 1
+.SH NAME
+Mousetweaks \- Accessibility enhancements for the mouse
+.SH SYNOPSIS
+.B mousetweaks
+[-e|--enable=STRING] [-m|--dwell-mode=STRING]
+[-c|--show-ctw] [-x|--ctw-x=INT] [-y|--ctw-y=INT] [-s|--shutdown]
+.br
+.B mousetweaks
+[-?|--help]
+.SH DESCRIPTION
+.B mousetweaks
+is a daemon that provides various mouse features for the GNOME desktop.
+It depends on Assistve Technology.
+.SH OPTIONS
+.TP
+.B \-e, \--enable=STRING
+Enable a mousetweaks feature. Available arguments are: dwell, delay
+.RS
+.IPs DWELL
+Automatically perform mouse clicks without using a physical button
+.IPs DELAY
+Trigger the secondary mouse button when the primary button is held down
+for a specified amount of time
+.RE
+.TP
+.B \-m, \--dwell-mode=STRING
+Select a dwelling mode. Available arguments are: window, gesture
+.RS
+.IPs WINDOW
+Select the active click type from a window or a panel applet
+.IPs GESTURE
+Perform clicks by moving in different directions after the cursor changes
+to a cross
+.RE
+.TP
+.B \-c, \--show-ctw
+Show the click-type window. Only useful in combination with dwell-mode window
+.TP
+.B \-x, \--ctw-x=INT
+X Position of the click-type window on screen
+.TP
+.B \-y, \--ctw-y=INT
+Y Position of the click-type window on screen
+.TP
+.B \-s, \--shutdown
+Stop the mousetweaks daemon
+.SH FILES
+.I ~/.mousetweaks.pid
+.RS
+The daemon creates a lock file in the users home directory to keep track
+of its status.
+.SH BUGS
+See:
+.I https://bugs.launchpad.net/mousetweaks
+.SH AUTHORS
+Gerd Kohlberger <lowfi chello at>
+.SH LICENSE
+Licenced under the GNU General Public License v3 and later
+.SH SEE ALSO
+Assistive Technology Service Provider Interface (AT-SPI)
Added: trunk/pixmaps/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/pixmaps/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,8 @@
+pixdir = $(datadir)/mousetweaks
+pix_DATA = \
+ human-single.png \
+ human-double.png \
+ human-drag.png \
+ human-right.png
+
+EXTRA_DIST = $(pix_DATA)
Added: trunk/pixmaps/human-double.png
==============================================================================
Binary file. No diff available.
Added: trunk/pixmaps/human-drag.png
==============================================================================
Binary file. No diff available.
Added: trunk/pixmaps/human-right.png
==============================================================================
Binary file. No diff available.
Added: trunk/pixmaps/human-single.png
==============================================================================
Binary file. No diff available.
Added: trunk/po/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/po/LINGUAS Fri Jan 11 13:34:55 2008
@@ -0,0 +1,5 @@
+# please keep this list sorted alphabetically
+#
+de
+fr
+it
Added: trunk/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.in Fri Jan 11 13:34:55 2008
@@ -0,0 +1,10 @@
+data/dwell-click-applet.glade
+data/pointer-capture-applet.glade
+data/ctw.glade
+data/DwellClick_Factory.server.in.in
+data/PointerCapture_Factory.server.in.in
+src/mt-main.c
+src/mt-ctw.c
+src/mt-dbus.c
+src/pointer-capture-applet.c
+src/dwell-click-applet.c
Added: trunk/po/POTFILES.skip
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.skip Fri Jan 11 13:34:55 2008
@@ -0,0 +1,2 @@
+data/DwellClick_Factory.server.in
+data/PointerCapture_Factory.server.in
Added: trunk/src/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/src/Makefile.am Fri Jan 11 13:34:55 2008
@@ -0,0 +1,63 @@
+INCLUDES = \
+ $(GLADE_CFLAGS) \
+ $(PANEL_CFLAGS) \
+ $(CSPI_CFLAGS) \
+ $(DBUS_CFLAGS) \
+ $(XFIXES_CFLAGS)
+
+AM_CFLAGS = \
+ -DGLADEDIR=\"$(gladedir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DLOCALEDIR=\"$(localedir)\" \
+ -Wall -export-dynamic
+
+if BUILD_PCA
+pca_bin = pointer-capture-applet
+endif
+
+if BUILD_CTA
+cta_bin = dwell-click-applet
+endif
+
+bin_PROGRAMS = mousetweaks $(pca_bin) $(cta_bin)
+mousetweaks_SOURCES = \
+ mt-main.c \
+ mt-main.h \
+ mt-common.c \
+ mt-common.h \
+ mt-session.c \
+ mt-session.h \
+ mt-pidfile.c \
+ mt-pidfile.h \
+ mt-dbus.c \
+ mt-dbus.h \
+ mt-ctw.c \
+ mt-ctw.h \
+ mt-timer.c \
+ mt-timer.h
+
+mousetweaks_LDFLAGS = \
+ $(GLADE_LIBS) \
+ $(CSPI_LIBS) \
+ $(DBUS_LIBS) \
+ $(GNOMEUI_LIBS) \
+ $(XFIXES_LIBS)
+
+dwell_click_applet_SOURCES = \
+ dwell-click-applet.c \
+ mt-common.c \
+ mt-common.h
+
+dwell_click_applet_LDFLAGS = \
+ $(GLADE_LIBS) \
+ $(PANEL_LIBS) \
+ $(DBUS_LIBS)
+
+pointer_capture_applet_SOURCES = \
+ pointer-capture-applet.c \
+ mt-common.c \
+ mt-common.h
+
+pointer_capture_applet_LDFLAGS = \
+ $(GLADE_LIBS) \
+ $(PANEL_LIBS)
Added: trunk/src/dwell-click-applet.c
==============================================================================
--- (empty file)
+++ trunk/src/dwell-click-applet.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,540 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <panel-applet.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <libgnomeui/gnome-help.h>
+
+#include "mt-common.h"
+#include "mt-dbus.h"
+
+typedef struct _DwellData DwellData;
+struct _DwellData {
+ DBusConnection *conn;
+ GConfClient *client;
+
+ GladeXML *xml;
+ GtkWidget *box;
+ GtkWidget *button;
+ GdkPixbuf *click[4];
+
+ gint button_width;
+ gint button_height;
+ gint cct;
+ gint active;
+};
+
+static const gchar *img_widgets[] = {
+ "right_click_img",
+ "drag_click_img",
+ "double_click_img",
+ "single_click_img"
+};
+
+static const gchar *img_widgets_v[] = {
+ "right_click_img_v",
+ "drag_click_img_v",
+ "double_click_img_v",
+ "single_click_img_v"
+};
+
+static const gchar menu_xml[] =
+ "<popup name=\"button3\">\n"
+ " <menuitem name=\"Properties Item\" verb=\"PropertiesVerb\" "
+ " _label=\"_Preferences\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-properties\"/>\n"
+ " <menuitem name=\"Help Item\" verb=\"HelpVerb\" "
+ " _label=\"_Help\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-help\"/>\n"
+ " <menuitem name=\"About Item\" verb=\"AboutVerb\" _label=\"_About\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-about\"/>\n"
+ "</popup>\n";
+
+static void update_sensitivity (DwellData *dd);
+
+static void preferences_dialog (BonoboUIComponent *component,
+ gpointer data,
+ const char *cname);
+static void help_dialog (BonoboUIComponent *component,
+ gpointer data,
+ const char *cname);
+static void about_dialog (BonoboUIComponent *component,
+ gpointer data,
+ const char *cname);
+
+static const BonoboUIVerb menu_verb[] = {
+ BONOBO_UI_UNSAFE_VERB ("PropertiesVerb", preferences_dialog),
+ BONOBO_UI_UNSAFE_VERB ("HelpVerb", help_dialog),
+ BONOBO_UI_UNSAFE_VERB ("AboutVerb", about_dialog),
+ BONOBO_UI_VERB_END
+};
+
+static void
+send_dbus_signal (DBusConnection *conn, const gchar *type, gint arg)
+{
+ DBusMessage *msg;
+
+ msg = dbus_message_new_signal (MOUSETWEAKS_DBUS_PATH_MAIN,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ type);
+ dbus_message_append_args (msg,
+ DBUS_TYPE_INT32, &arg,
+ DBUS_TYPE_INVALID);
+ dbus_connection_send (conn, msg, NULL);
+ dbus_connection_flush (conn);
+ dbus_message_unref (msg);
+}
+
+static DBusHandlerResult
+receive_dbus_signal (DBusConnection *conn, DBusMessage *msg, void *data)
+{
+ DwellData *dd = (DwellData *) data;
+
+ if (dbus_message_is_signal (msg,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ CLICK_TYPE_SIGNAL)) {
+ if (dbus_message_get_args (msg,
+ NULL,
+ DBUS_TYPE_INT32,
+ &dd->cct,
+ DBUS_TYPE_INVALID)) {
+ GSList *group;
+ gpointer data;
+
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON(dd->button));
+ data = g_slist_nth_data (group, dd->cct);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(data), TRUE);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ }
+ else if (dbus_message_is_signal (msg,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ RESTORE_SIGNAL)) {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(dd->button), TRUE);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ else if (dbus_message_is_signal (msg,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ ACTIVE_SIGNAL)) {
+ if (dbus_message_get_args (msg,
+ NULL,
+ DBUS_TYPE_INT32,
+ &dd->active,
+ DBUS_TYPE_INVALID)) {
+ update_sensitivity (dd);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static gboolean
+do_not_eat (GtkWidget *widget, GdkEventButton *bev, gpointer user)
+{
+ if (bev->button != 1)
+ g_signal_stop_emission_by_name (widget, "button_press_event");
+
+ return FALSE;
+}
+
+static void
+button_cb (GtkToggleButton *button, gpointer data)
+{
+ DwellData *dd = (DwellData *) data;
+
+ if (gtk_toggle_button_get_active (button)) {
+ GSList *group;
+
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
+ dd->cct = g_slist_index (group, (gconstpointer) button);
+
+ send_dbus_signal (dd->conn, CLICK_TYPE_SIGNAL, dd->cct);
+ }
+}
+
+static void
+box_size_allocate (GtkWidget *widget, GtkAllocation *alloc, gpointer data)
+{
+ DwellData *dd = (DwellData *) data;
+ GtkWidget *w;
+ GdkPixbuf *tmp;
+ const gchar *name;
+ gint i;
+
+ if (dd->button_width == alloc->width && dd->button_height == alloc->height)
+ return;
+
+ name = glade_get_widget_name (dd->box);
+
+ if (g_str_equal (name, "box_vert"))
+ /* vertical */
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ w = glade_xml_get_widget (dd->xml, img_widgets_v[i]);
+
+ if (alloc->width < 31) {
+ tmp = gdk_pixbuf_scale_simple (dd->click[i],
+ alloc->width - 7,
+ alloc->width - 7,
+ GDK_INTERP_HYPER);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), tmp);
+ g_object_unref (tmp);
+ }
+ else
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), dd->click[i]);
+ }
+ else
+ /* horizontal */
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ w = glade_xml_get_widget (dd->xml, img_widgets[i]);
+
+ if (alloc->height < 31) {
+ tmp = gdk_pixbuf_scale_simple (dd->click[i],
+ alloc->height - 7,
+ alloc->height - 7,
+ GDK_INTERP_HYPER);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), tmp);
+ g_object_unref (tmp);
+ }
+ else
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), dd->click[i]);
+ }
+
+ dd->button_width = alloc->width;
+ dd->button_height = alloc->height;
+}
+
+static void
+fini_dwell_data (DwellData *dd)
+{
+ GtkWidget *w;
+ gint i;
+
+ w = glade_xml_get_widget (dd->xml, "box_vert");
+ g_object_unref (w);
+ w = glade_xml_get_widget (dd->xml, "box_hori");
+ g_object_unref (w);
+
+ if (dd->conn)
+ dbus_connection_unref (dd->conn);
+
+ if (dd->client)
+ g_object_unref (dd->client);
+
+ for (i = 0; i < N_CLICK_TYPES; i++)
+ g_object_unref (dd->click[i]);
+
+ g_free (dd);
+}
+
+/* applet callbacks */
+static void
+applet_orient_changed (PanelApplet *applet, guint orient, gpointer data)
+{
+ DwellData *dd = (DwellData *) data;
+
+ gtk_container_remove (GTK_CONTAINER(applet), dd->box);
+
+ switch (orient) {
+ case PANEL_APPLET_ORIENT_UP:
+ case PANEL_APPLET_ORIENT_DOWN:
+ dd->box = glade_xml_get_widget (dd->xml, "box_hori");
+ dd->button = glade_xml_get_widget (dd->xml, "single_click");
+ break;
+ case PANEL_APPLET_ORIENT_LEFT:
+ case PANEL_APPLET_ORIENT_RIGHT:
+ dd->box = glade_xml_get_widget (dd->xml, "box_vert");
+ dd->button = glade_xml_get_widget (dd->xml, "single_click_v");
+ default:
+ break;
+ }
+
+ if (dd->box->parent)
+ gtk_widget_reparent (dd->box, GTK_WIDGET(applet));
+ else
+ gtk_container_add (GTK_CONTAINER(applet), dd->box);
+}
+
+static void
+applet_unrealized (GtkWidget *widget, gpointer data)
+{
+ fini_dwell_data ((DwellData *) data);
+}
+
+static void
+preferences_dialog (BonoboUIComponent *component,
+ gpointer data,
+ const char *cname)
+{
+ g_spawn_command_line_async ("gnome-mouse-properties", NULL);
+}
+
+static void
+help_dialog (BonoboUIComponent *component, gpointer data, const char *cname)
+{
+ GError *error = NULL;
+
+ if (!gnome_help_display_desktop (NULL,
+ "mousetweaks",
+ "mousetweaks",
+ NULL,
+ &error)) {
+ mt_show_dialog (_("Couldn't display help"),
+ error->message,
+ GTK_MESSAGE_ERROR);
+ g_error_free (error);
+ }
+}
+
+static void
+about_dialog (BonoboUIComponent *component, gpointer data, const char *cname)
+{
+ DwellData *dd = (DwellData *) data;
+ GtkWidget *about;
+
+ about = glade_xml_get_widget (dd->xml, "about");
+
+ if (GTK_WIDGET_VISIBLE(about))
+ gtk_window_present (GTK_WINDOW(about));
+ else
+ gtk_widget_show (about);
+}
+
+static void
+about_response (GtkWidget *about, gint response, gpointer data)
+{
+ DwellData *dd = (DwellData *) data;
+
+ gtk_widget_hide (glade_xml_get_widget (dd->xml, "about"));
+}
+
+static inline void
+init_button (DwellData *dd, GtkWidget *button)
+{
+ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON(button), FALSE);
+ g_signal_connect (G_OBJECT(button), "button-press-event",
+ G_CALLBACK(do_not_eat), NULL);
+ g_signal_connect (G_OBJECT(button), "toggled",
+ G_CALLBACK(button_cb), dd);
+}
+
+static void
+init_horizontal_box (DwellData *dd)
+{
+ GtkWidget *w;
+ gint i;
+
+ w = glade_xml_get_widget (dd->xml, "box_hori");
+ g_object_ref (w);
+
+ w = glade_xml_get_widget (dd->xml, "single_click");
+ g_signal_connect (G_OBJECT(w), "size-allocate",
+ G_CALLBACK(box_size_allocate), dd);
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "double_click");
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "drag_click");
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "right_click");
+ init_button (dd, w);
+
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ w = glade_xml_get_widget (dd->xml, img_widgets[i]);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), dd->click[i]);
+ }
+}
+
+static void
+init_vertical_box (DwellData *dd)
+{
+ GtkWidget *w;
+ gint i;
+
+ w = glade_xml_get_widget (dd->xml, "box_vert");
+ g_object_ref (w);
+
+ w = glade_xml_get_widget (dd->xml, "single_click_v");
+ g_signal_connect (G_OBJECT(w), "size-allocate",
+ G_CALLBACK(box_size_allocate), dd);
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "double_click_v");
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "drag_click_v");
+ init_button (dd, w);
+
+ w = glade_xml_get_widget (dd->xml, "right_click_v");
+ init_button (dd, w);
+
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ w = glade_xml_get_widget (dd->xml, img_widgets_v[i]);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(w), dd->click[i]);
+ }
+}
+
+static void
+update_sensitivity (DwellData *dd)
+{
+ gint mode;
+ gboolean enabled, sensitive;
+
+ enabled = gconf_client_get_bool (dd->client, OPT_DWELL, NULL);
+ mode = gconf_client_get_int (dd->client, OPT_MODE, NULL);
+
+ sensitive = dd->active && enabled && mode == DWELL_MODE_CTW;
+ gtk_widget_set_sensitive (dd->box, sensitive);
+}
+
+static void
+gconf_value_changed (GConfClient *client,
+ const gchar *key,
+ GConfValue *value,
+ gpointer data)
+{
+ if (g_str_equal (key, OPT_MODE) || g_str_equal (key, OPT_DWELL))
+ update_sensitivity ((DwellData *) data);
+}
+
+static gboolean
+fill_applet (PanelApplet *applet)
+{
+ DwellData *dd;
+ GtkWidget *about;
+ PanelAppletOrient orient;
+
+ dd = g_new0 (DwellData, 1);
+ if (!dd)
+ return FALSE;
+
+ dd->cct = DWELL_CLICK_TYPE_SINGLE;
+
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ dd->xml = glade_xml_new (GLADEDIR "/dwell-click-applet.glade", NULL, NULL);
+ if (!dd->xml) {
+ fini_dwell_data (dd);
+ return FALSE;
+ }
+
+ /* about dialog */
+ gtk_window_set_default_icon_name (MT_ICON_NAME);
+
+ about = glade_xml_get_widget (dd->xml, "about");
+ g_object_set (about, "version", VERSION, NULL);
+
+ g_signal_connect (G_OBJECT(about), "delete-event",
+ G_CALLBACK(gtk_widget_hide_on_delete), NULL);
+ g_signal_connect (G_OBJECT(about), "response",
+ G_CALLBACK(about_response), dd);
+
+ dd->conn = dbus_bus_get (DBUS_BUS_SESSION, NULL);
+ if (!dd->conn) {
+ fini_dwell_data (dd);
+ return FALSE;
+ }
+
+ dbus_bus_add_match (dd->conn,
+ "type='signal',"
+ "sender='" MOUSETWEAKS_DBUS_SERVICE"',"
+ "interface='"MOUSETWEAKS_DBUS_INTERFACE"',"
+ "path='" MOUSETWEAKS_DBUS_PATH_APPLET"'",
+ NULL);
+ dbus_connection_add_filter (dd->conn,
+ receive_dbus_signal,
+ dd,
+ NULL);
+ dbus_connection_setup_with_g_main (dd->conn, NULL);
+
+ if (dbus_bus_name_has_owner (dd->conn, MOUSETWEAKS_DBUS_SERVICE, NULL))
+ dd->active = 1;
+
+ dd->client = gconf_client_get_default ();
+ gconf_client_add_dir (dd->client,
+ MT_GCONF_HOME,
+ GCONF_CLIENT_PRELOAD_ONELEVEL,
+ NULL);
+ g_signal_connect (G_OBJECT(dd->client), "value_changed",
+ G_CALLBACK(gconf_value_changed), dd);
+
+ dd->click[DWELL_CLICK_TYPE_SINGLE] =
+ gdk_pixbuf_new_from_file (GLADEDIR "/human-single.png", NULL);
+ dd->click[DWELL_CLICK_TYPE_DOUBLE] =
+ gdk_pixbuf_new_from_file (GLADEDIR "/human-double.png", NULL);
+ dd->click[DWELL_CLICK_TYPE_DRAG] =
+ gdk_pixbuf_new_from_file (GLADEDIR "/human-drag.png", NULL);
+ dd->click[DWELL_CLICK_TYPE_RIGHT] =
+ gdk_pixbuf_new_from_file (GLADEDIR "/human-right.png", NULL);
+
+ panel_applet_set_flags (applet,
+ PANEL_APPLET_EXPAND_MINOR |
+ PANEL_APPLET_HAS_HANDLE);
+ panel_applet_set_background_widget (applet, GTK_WIDGET(applet));
+ panel_applet_setup_menu (applet, menu_xml, menu_verb, dd);
+
+ g_signal_connect (applet, "change-orient",
+ G_CALLBACK(applet_orient_changed), dd);
+ g_signal_connect (applet, "unrealize",
+ G_CALLBACK(applet_unrealized), dd);
+
+ orient = panel_applet_get_orient (applet);
+ if (orient == PANEL_APPLET_ORIENT_UP ||
+ orient == PANEL_APPLET_ORIENT_DOWN) {
+ dd->box = glade_xml_get_widget (dd->xml, "box_hori");
+ dd->button = glade_xml_get_widget (dd->xml, "single_click");
+ }
+ else {
+ dd->box = glade_xml_get_widget (dd->xml, "box_vert");
+ dd->button = glade_xml_get_widget (dd->xml, "single_click_v");
+ }
+
+ init_horizontal_box (dd);
+ init_vertical_box (dd);
+
+ gtk_widget_reparent (dd->box, GTK_WIDGET(applet));
+ gtk_widget_show (GTK_WIDGET(applet));
+
+ update_sensitivity (dd);
+
+ return TRUE;
+}
+
+static gboolean
+applet_factory (PanelApplet *applet, const gchar *iid, gpointer data)
+{
+ if (!g_str_equal (iid, "OAFIID:DwellClickApplet"))
+ return FALSE;
+
+ return fill_applet (applet);
+}
+
+PANEL_APPLET_BONOBO_FACTORY ("OAFIID:DwellClickApplet_Factory",
+ PANEL_TYPE_APPLET,
+ "Dwell Click Factory",
+ "0",
+ applet_factory,
+ NULL);
Added: trunk/src/mt-common.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-common.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,56 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+
+#include "mt-common.h"
+
+gint
+mt_show_dialog (const gchar *primary,
+ const gchar *secondary,
+ GtkMessageType type)
+{
+ GtkWidget *dialog;
+ gint ret;
+
+ dialog = gtk_message_dialog_new (NULL,
+ GTK_DIALOG_MODAL,
+ type,
+ GTK_BUTTONS_NONE,
+ primary);
+ gtk_window_set_title (GTK_WINDOW(dialog), "Mousetweaks");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog), MT_ICON_NAME);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG(dialog),
+ secondary);
+
+ if (type == GTK_MESSAGE_QUESTION)
+ gtk_dialog_add_buttons (GTK_DIALOG(dialog),
+ GTK_STOCK_YES, GTK_RESPONSE_YES,
+ GTK_STOCK_NO, GTK_RESPONSE_NO,
+ NULL);
+ else
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_OK, GTK_RESPONSE_OK);
+
+ gtk_widget_show_all (dialog);
+ ret = gtk_dialog_run (GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+
+ return ret;
+}
Added: trunk/src/mt-common.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-common.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,75 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_COMMON_H__
+#define __MT_COMMON_H__
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gconf/gconf-client.h>
+#include <glib/gi18n.h>
+
+G_BEGIN_DECLS
+
+#define MT_ICON_NAME "gnome-dev-mouse-optical"
+
+#define MT_GCONF_HOME "/desktop/gnome/accessibility/mouse"
+#define OPT_THRESHOLD MT_GCONF_HOME "/threshold"
+#define OPT_DELAY MT_GCONF_HOME "/delay_enable"
+#define OPT_DELAY_T MT_GCONF_HOME "/delay_time"
+#define OPT_DWELL MT_GCONF_HOME "/dwell_enable"
+#define OPT_DWELL_T MT_GCONF_HOME "/dwell_time"
+#define OPT_CTW MT_GCONF_HOME "/dwell_show_ctw"
+#define OPT_MODE MT_GCONF_HOME "/dwell_mode"
+#define OPT_G_SINGLE MT_GCONF_HOME "/dwell_gesture_single"
+#define OPT_G_DOUBLE MT_GCONF_HOME "/dwell_gesture_double"
+#define OPT_G_DRAG MT_GCONF_HOME "/dwell_gesture_drag"
+#define OPT_G_RIGHT MT_GCONF_HOME "/dwell_gesture_secondary"
+#define OPT_STYLE MT_GCONF_HOME "/button_layout"
+
+enum {
+ DWELL_MODE_CTW = 0,
+ DWELL_MODE_GESTURE
+};
+
+enum {
+ DWELL_CLICK_TYPE_RIGHT = 0,
+ DWELL_CLICK_TYPE_DRAG,
+ DWELL_CLICK_TYPE_DOUBLE,
+ DWELL_CLICK_TYPE_SINGLE,
+ N_CLICK_TYPES
+};
+
+enum {
+ DIRECTION_LEFT = 0,
+ DIRECTION_RIGHT,
+ DIRECTION_UP,
+ DIRECTION_DOWN,
+ DIRECTION_DISABLE
+};
+
+gint mt_show_dialog (const gchar *primary,
+ const gchar *secondary,
+ GtkMessageType type);
+
+G_END_DECLS
+
+#endif /* __MT_COMMON_H__ */
Added: trunk/src/mt-ctw.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-ctw.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,206 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+
+#include "mt-main.h"
+#include "mt-dbus.h"
+#include "mt-common.h"
+
+enum {
+ BUTTON_STYLE_TEXT = 0,
+ BUTTON_STYLE_ICON,
+ BUTTON_STYLE_BOTH
+};
+
+static GladeXML *xml = NULL;
+
+void
+mt_ctw_set_click_type (gint ct)
+{
+ GtkWidget *button;
+ GSList *group;
+ gpointer data;
+
+ button = glade_xml_get_widget (xml, "single");
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
+ data = g_slist_nth_data (group, ct);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(data), TRUE);
+}
+
+void
+mt_ctw_update_visibility (MTClosure *mt)
+{
+ if (mt->dwell_enabled && mt->dwell_show_ctw)
+ gtk_widget_show (glade_xml_get_widget (xml, "ctw"));
+ else
+ gtk_widget_hide (glade_xml_get_widget (xml, "ctw"));
+}
+
+void
+mt_ctw_update_sensitivity (MTClosure *mt)
+{
+ gboolean sensitive;
+
+ sensitive = mt->dwell_enabled && mt->dwell_mode == DWELL_MODE_CTW;
+ gtk_widget_set_sensitive (glade_xml_get_widget (xml, "box"), sensitive);
+}
+
+void
+mt_ctw_update_style (gint style)
+{
+ GtkWidget *icon, *label;
+ const gchar *l[] = { "single_l", "double_l", "drag_l", "right_l" };
+ const gchar *img[] = { "single_i", "double_i", "drag_i", "right_i" };
+ gint i;
+
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ label = glade_xml_get_widget (xml, l[i]);
+ icon = glade_xml_get_widget (xml, img[i]);
+
+ switch (style) {
+ case BUTTON_STYLE_BOTH:
+ g_object_set (icon, "yalign", 1.0, NULL);
+ gtk_widget_show (icon);
+ g_object_set (label, "yalign", 0.0, NULL);
+ gtk_widget_show (label);
+ break;
+ case BUTTON_STYLE_TEXT:
+ gtk_widget_hide (icon);
+ g_object_set (icon, "yalign", 0.5, NULL);
+ gtk_widget_show (label);
+ g_object_set (label, "yalign", 0.5, NULL);
+ break;
+ case BUTTON_STYLE_ICON:
+ gtk_widget_show (icon);
+ g_object_set (icon, "yalign", 0.5, NULL);
+ gtk_widget_hide (label);
+ g_object_set (label, "yalign", 0.5, NULL);
+ default:
+ break;
+ }
+ }
+}
+
+static void
+ctw_button_cb (GtkToggleButton *button, gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ if (gtk_toggle_button_get_active (button)) {
+ GSList *group;
+
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
+ mt->dwell_cct = g_slist_index (group, (gconstpointer) button);
+
+ mt_dbus_send_signal (mt->conn, CLICK_TYPE_SIGNAL, mt->dwell_cct);
+ }
+}
+
+static gboolean
+ctw_context_menu (GtkWidget *widget, GdkEventButton *bev, gpointer data)
+{
+ if (bev->button == 3) {
+ gtk_menu_popup (GTK_MENU(glade_xml_get_widget (xml, "popup")),
+ 0, 0, 0, 0, bev->button, bev->time);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+ctw_menu_toggled (GtkCheckMenuItem *item, gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+ GSList *group;
+ gint index;
+
+ if (!gtk_check_menu_item_get_active (item))
+ return;
+
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM(item));
+ index = g_slist_index (group, (gconstpointer) item);
+ gconf_client_set_int (mt->client, OPT_STYLE, index, NULL);
+}
+
+static gboolean
+ctw_delete_cb (GtkWidget *win, GdkEvent *ev, gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ gconf_client_set_bool (mt->client, OPT_CTW, FALSE, NULL);
+
+ return TRUE;
+}
+
+gboolean
+mt_ctw_init (MTClosure *mt, gint x, gint y)
+{
+ GtkWidget *ctw, *button, *item;
+ const gchar *b[] = { "single", "double", "drag", "right" };
+ GSList *group;
+ gpointer data;
+ gint i;
+
+ xml = glade_xml_new (GLADEDIR "/ctw.glade", NULL, NULL);
+ if (!xml)
+ return FALSE;
+
+ ctw = glade_xml_get_widget (xml, "ctw");
+ gtk_window_stick (GTK_WINDOW(ctw));
+ gtk_window_set_keep_above (GTK_WINDOW(ctw), TRUE);
+ g_signal_connect (G_OBJECT(ctw), "delete-event",
+ G_CALLBACK(ctw_delete_cb), mt);
+
+ for (i = 0; i < N_CLICK_TYPES; i++) {
+ button = glade_xml_get_widget (xml, b[i]);
+ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON(button), FALSE);
+
+ g_signal_connect (G_OBJECT(button), "toggled",
+ G_CALLBACK(ctw_button_cb), (gpointer) mt);
+ g_signal_connect (G_OBJECT(button), "button-press-event",
+ G_CALLBACK(ctw_context_menu), NULL);
+ }
+
+ item = glade_xml_get_widget (xml, "text");
+ g_signal_connect (G_OBJECT(item), "toggled",
+ G_CALLBACK(ctw_menu_toggled), (gpointer) mt);
+ item = glade_xml_get_widget (xml, "icon");
+ g_signal_connect (G_OBJECT(item), "toggled",
+ G_CALLBACK(ctw_menu_toggled), (gpointer) mt);
+ item = glade_xml_get_widget (xml, "both");
+ g_signal_connect (G_OBJECT(item), "toggled",
+ G_CALLBACK(ctw_menu_toggled), (gpointer) mt);
+
+ group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM(item));
+ data = g_slist_nth_data (group, mt->style);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(data), TRUE);
+
+ mt_ctw_update_style (mt->style);
+ mt_ctw_update_sensitivity (mt);
+ mt_ctw_update_visibility (mt);
+
+ if (x != -1 && y != -1)
+ gtk_window_move (GTK_WINDOW(ctw), x, y);
+
+ return TRUE;
+}
Added: trunk/src/mt-ctw.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-ctw.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,34 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_CTW_H__
+#define __MT_CTW_H__
+
+G_BEGIN_DECLS
+
+gboolean mt_ctw_init (MTClosure *mt, gint x, gint y);
+void mt_ctw_set_click_type (gint ct);
+void mt_ctw_update_sensitivity (MTClosure *mt);
+void mt_ctw_update_visibility (MTClosure *mt);
+void mt_ctw_update_style (gint style);
+
+
+G_END_DECLS
+
+#endif /* __MT_CTW_H__ */
Added: trunk/src/mt-dbus.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-dbus.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,121 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+
+#include "mt-main.h"
+#include "mt-dbus.h"
+#include "mt-common.h"
+#include "mt-ctw.h"
+
+static DBusHandlerResult
+mt_dbus_filter (DBusConnection *connection,
+ DBusMessage *message,
+ gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ if (dbus_message_is_signal (message,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ CLICK_TYPE_SIGNAL)) {
+ if (dbus_message_get_args (message,
+ NULL,
+ DBUS_TYPE_INT32,
+ &mt->dwell_cct,
+ DBUS_TYPE_INVALID)) {
+ mt_ctw_set_click_type (mt->dwell_cct);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ }
+ else if (dbus_message_is_signal (message,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ ACTIVE_SIGNAL)) {
+ mt_dbus_send_signal (connection, ACTIVE_SIGNAL, 1);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+void
+mt_dbus_send_signal (DBusConnection *connection,
+ const gchar *type,
+ gint arg)
+{
+ DBusMessage *msg;
+
+ msg = dbus_message_new_signal (MOUSETWEAKS_DBUS_PATH_APPLET,
+ MOUSETWEAKS_DBUS_INTERFACE,
+ type);
+ dbus_message_append_args (msg,
+ DBUS_TYPE_INT32, &arg,
+ DBUS_TYPE_INVALID);
+ dbus_connection_send (connection, msg, NULL);
+ dbus_connection_flush (connection);
+ dbus_message_unref (msg);
+}
+
+DBusConnection *
+mt_dbus_init (gpointer data)
+{
+ DBusConnection *connection;
+ DBusError err;
+ gint ret;
+
+ dbus_error_init (&err);
+ connection = dbus_bus_get (DBUS_BUS_SESSION, &err);
+
+ if (!connection) {
+ mt_show_dialog (err.name, err.message, GTK_MESSAGE_ERROR);
+ dbus_error_free (&err);
+ return NULL;
+ }
+
+ dbus_error_free (&err);
+
+ ret = dbus_bus_request_name (connection,
+ MOUSETWEAKS_DBUS_SERVICE,
+ DBUS_NAME_FLAG_DO_NOT_QUEUE,
+ NULL);
+
+ if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
+ dbus_connection_unref (connection);
+ return NULL;
+ }
+
+ dbus_bus_add_match (connection,
+ "type='signal',"
+ "interface='"MOUSETWEAKS_DBUS_INTERFACE"',"
+ "path='" MOUSETWEAKS_DBUS_PATH_MAIN"'",
+ NULL);
+
+ dbus_connection_add_filter (connection, mt_dbus_filter, data, NULL);
+ dbus_connection_setup_with_g_main (connection, NULL);
+
+ return connection;
+}
+
+void
+mt_dbus_fini (DBusConnection *connection)
+{
+ dbus_bus_release_name (connection, MOUSETWEAKS_DBUS_SERVICE, NULL);
+ dbus_connection_unref (connection);
+}
Added: trunk/src/mt-dbus.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-dbus.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,47 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_DBUS_H__
+#define __MT_DBUS_H__
+
+#include <glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+G_BEGIN_DECLS
+
+#define MOUSETWEAKS_DBUS_SERVICE "org.freedesktop.mousetweaks"
+#define MOUSETWEAKS_DBUS_INTERFACE "org.freedesktop.mousetweaks"
+#define MOUSETWEAKS_DBUS_PATH_MAIN "/org/freedesktop/mousetweaks/main"
+#define MOUSETWEAKS_DBUS_PATH_APPLET "/org/freedesktop/mousetweaks/applet"
+
+#define CLICK_TYPE_SIGNAL "clicktype"
+#define RESTORE_SIGNAL "restore"
+#define ACTIVE_SIGNAL "active"
+
+DBusConnection * mt_dbus_init (gpointer data);
+
+void mt_dbus_fini (DBusConnection *connection);
+
+void mt_dbus_send_signal (DBusConnection *connection,
+ const gchar *type,
+ gint arg);
+
+G_END_DECLS
+
+#endif /* __MT_DBUS_H__ */
Added: trunk/src/mt-main.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-main.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,591 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+#include <math.h>
+#include <unistd.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+#include <X11/extensions/Xfixes.h>
+#include <cspi/spi.h>
+#include <libgnome/gnome-program.h>
+#include <libgnomeui/gnome-ui-init.h>
+
+#include "mt-common.h"
+#include "mt-dbus.h"
+#include "mt-main.h"
+#include "mt-session.h"
+#include "mt-pidfile.h"
+#include "mt-ctw.h"
+#include "mt-timer.h"
+
+static AccessibleDeviceListener *button_listener = NULL;
+static AccessibleEventListener *motion_listener = NULL;
+
+static int fixes_event_base = 0;
+
+static volatile gboolean shutdown = FALSE;
+
+static void
+mt_cursor_set (GdkCursorType type)
+{
+ GdkCursor *cursor;
+ GdkWindow *root;
+
+ cursor = gdk_cursor_new (type);
+ root = gdk_get_default_root_window ();
+ gdk_window_set_cursor (root, cursor);
+ gdk_cursor_unref (cursor);
+}
+
+static void
+dwell_restore_single_click (MTClosure *mt)
+{
+ if (mt->dwell_mode == DWELL_MODE_CTW) {
+ mt_ctw_set_click_type (DWELL_CLICK_TYPE_SINGLE);
+ mt_dbus_send_signal (mt->conn, RESTORE_SIGNAL, 0);
+ }
+ else
+ mt->dwell_cct = DWELL_CLICK_TYPE_SINGLE;
+}
+
+static void
+dwell_do_pointer_click (MTClosure *mt, gint x, gint y)
+{
+ switch (mt->dwell_cct) {
+ case DWELL_CLICK_TYPE_SINGLE:
+ SPI_generateMouseEvent (x, y, "b1c");
+ break;
+ case DWELL_CLICK_TYPE_DOUBLE:
+ SPI_generateMouseEvent (x, y, "b1d");
+ dwell_restore_single_click (mt);
+ break;
+ case DWELL_CLICK_TYPE_DRAG:
+ SPI_generateMouseEvent (x, y, "b1p");
+ mt->dwell_drag_started = TRUE;
+ mt_cursor_set (GDK_FLEUR);
+ break;
+ case DWELL_CLICK_TYPE_RIGHT:
+ SPI_generateMouseEvent (x, y, "b3c");
+ dwell_restore_single_click (mt);
+ default:
+ break;
+ }
+}
+
+static inline gboolean
+within_tolerance (MTClosure *mt, gint x, gint y)
+{
+ gdouble distance;
+
+ distance = sqrt(pow(x - mt->pointer_x, 2.) + pow(y - mt->pointer_y, 2.));
+
+ return distance < mt->threshold;
+}
+
+static gboolean
+analyze_direction (MTClosure *mt, gint x, gint y)
+{
+ gint gd, i, dx, dy;
+
+ dx = ABS(x - mt->pointer_x);
+ dy = ABS(y - mt->pointer_y);
+
+ if (within_tolerance (mt, x, y))
+ return FALSE;
+
+ /* find direction */
+ if (x < mt->pointer_x)
+ if (y < mt->pointer_y)
+ if (dx < dy)
+ gd = DIRECTION_UP;
+ else
+ gd = DIRECTION_LEFT;
+ else
+ if (dx < dy)
+ gd = DIRECTION_DOWN;
+ else
+ gd = DIRECTION_LEFT;
+ else
+ if (y < mt->pointer_y)
+ if (dx < dy)
+ gd = DIRECTION_UP;
+ else
+ gd = DIRECTION_RIGHT;
+ else
+ if (dx < dy)
+ gd = DIRECTION_DOWN;
+ else
+ gd = DIRECTION_RIGHT;
+
+ /* get click type for direction */
+ for (i = 0; i < N_CLICK_TYPES; i++)
+ if (mt->dwell_dirs[i] == gd) {
+ mt->dwell_cct = i;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+dwell_start_gesture (MTClosure *mt)
+{
+ if (mt->override_cursor) {
+ GdkCursor *cursor;
+
+ cursor = gdk_cursor_new (GDK_CROSS);
+ gdk_pointer_grab (gdk_get_default_root_window (),
+ FALSE,
+ GDK_POINTER_MOTION_MASK,
+ NULL,
+ cursor,
+ GDK_CURRENT_TIME);
+ gdk_cursor_unref (cursor);
+ }
+ else
+ mt_cursor_set (GDK_CROSS);
+
+ mt->dwell_gesture_started = TRUE;
+ mt_timer_start (mt->dwell_timer);
+}
+
+static void
+dwell_stop_gesture (MTClosure *mt)
+{
+ if (mt->override_cursor)
+ gdk_pointer_ungrab (GDK_CURRENT_TIME);
+ else
+ mt_cursor_set (GDK_LEFT_PTR);
+
+ mt->dwell_gesture_started = FALSE;
+ mt_timer_stop (mt->dwell_timer);
+}
+
+static void
+dwell_time_elapsed (MtTimer *timer, gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+ gint x, y;
+
+ gdk_display_get_pointer (gdk_display_get_default(), NULL, &x, &y, NULL);
+
+ /* stop active drag */
+ if (mt->dwell_drag_started) {
+ SPI_generateMouseEvent (x, y, "b1r");
+
+ mt->dwell_drag_started = FALSE;
+ mt_cursor_set (GDK_LEFT_PTR);
+ dwell_restore_single_click (mt);
+
+ return;
+ }
+
+ switch (mt->dwell_mode) {
+ case DWELL_MODE_CTW:
+ dwell_do_pointer_click (mt, x, y);
+ break;
+ case DWELL_MODE_GESTURE:
+ if (mt->dwell_gesture_started) {
+ dwell_stop_gesture (mt);
+
+ if (analyze_direction (mt, x, y))
+ dwell_do_pointer_click (mt, mt->pointer_x, mt->pointer_y);
+ }
+ else
+ dwell_start_gesture (mt);
+ default:
+ break;
+ }
+}
+
+static void
+delay_time_elapsed (MtTimer *timer, gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ SPI_generateMouseEvent (0, 0, "b1r");
+ SPI_generateMouseEvent (mt->pointer_x, mt->pointer_y, "b3c");
+}
+
+/* at-spi callbacks */
+static void
+spi_motion_event (const AccessibleEvent *event, void *data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ if (shutdown)
+ spi_shutdown ();
+
+ if (mt->dwell_enabled)
+ if (!within_tolerance (mt, event->detail1, event->detail2))
+ if (!mt->dwell_gesture_started) {
+ mt->pointer_x = (gint) event->detail1;
+ mt->pointer_y = (gint) event->detail2;
+ mt_timer_start (mt->dwell_timer);
+ }
+
+ if (mt_timer_is_running (mt->delay_timer))
+ if (!within_tolerance (mt, event->detail1, event->detail2))
+ mt_timer_stop (mt->delay_timer);
+}
+
+static SPIBoolean
+spi_button_event (const AccessibleDeviceEvent *event, void *data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ if (event->keycode != 1)
+ return FALSE;
+
+ switch (event->type) {
+ case SPI_BUTTON_PRESSED:
+ if (mt->delay_enabled) {
+ gdk_display_get_pointer (gdk_display_get_default (), NULL,
+ &mt->pointer_x, &mt->pointer_y, NULL);
+ mt_timer_start (mt->delay_timer);
+ }
+ if (mt->dwell_gesture_started)
+ dwell_stop_gesture (mt);
+ break;
+ case SPI_BUTTON_RELEASED:
+ if (mt_timer_is_running (mt->delay_timer))
+ mt_timer_stop (mt->delay_timer);
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+static GdkFilterReturn
+cursor_changed (GdkXEvent *xevent, GdkEvent *event, gpointer data)
+{
+ XEvent *xev = (XEvent *) xevent;
+
+ if (xev->type == fixes_event_base + XFixesCursorNotify) {
+ MTClosure *mt = (MTClosure *) data;
+ XFixesCursorImage *ci;
+
+ ci = XFixesGetCursorImage (GDK_DISPLAY());
+
+ if (!mt->dwell_gesture_started)
+ mt->override_cursor = !g_str_equal (ci->name, "left_ptr");
+
+ XFree (ci);
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+void
+spi_shutdown (void)
+{
+ SPI_deregisterGlobalEventListener (motion_listener, "mouse:abs");
+ AccessibleEventListener_unref (motion_listener);
+
+ SPI_deregisterDeviceEventListener (button_listener, NULL);
+ AccessibleDeviceListener_unref (button_listener);
+
+ SPI_event_quit ();
+}
+
+static void
+signal_handler (int sig)
+{
+ shutdown = TRUE;
+}
+
+static void
+mt_gconf_notify (GConfClient *client,
+ const gchar *key,
+ GConfValue *value,
+ gpointer data)
+{
+ MTClosure *mt = (MTClosure *) data;
+
+ if (g_str_equal (key, OPT_THRESHOLD))
+ mt->threshold = gconf_value_get_float (value);
+ else if (g_str_equal (key, OPT_DELAY))
+ mt->delay_enabled = gconf_value_get_bool (value);
+ else if (g_str_equal (key, OPT_DELAY_T))
+ mt_timer_set_target_time (mt->delay_timer,
+ gconf_value_get_float (value));
+ else if (g_str_equal (key, OPT_DWELL)) {
+ mt->dwell_enabled = gconf_value_get_bool (value);
+ mt_ctw_update_sensitivity (mt);
+ mt_ctw_update_visibility (mt);
+ }
+ else if (g_str_equal (key, OPT_DWELL_T))
+ mt_timer_set_target_time (mt->dwell_timer,
+ gconf_value_get_float (value));
+ else if (g_str_equal (key, OPT_CTW)) {
+ mt->dwell_show_ctw = gconf_value_get_bool (value);
+ mt_ctw_update_visibility (mt);
+ }
+ else if (g_str_equal (key, OPT_MODE)) {
+ mt->dwell_mode = gconf_value_get_int (value);
+ mt_ctw_update_sensitivity (mt);
+ }
+ else if (g_str_equal (key, OPT_STYLE)) {
+ mt->style = gconf_value_get_int (value);
+ mt_ctw_update_style (mt->style);
+ }
+ else if (g_str_equal (key, OPT_G_SINGLE))
+ mt->dwell_dirs[DWELL_CLICK_TYPE_SINGLE] = gconf_value_get_int (value);
+ else if (g_str_equal (key, OPT_G_DOUBLE))
+ mt->dwell_dirs[DWELL_CLICK_TYPE_DOUBLE] = gconf_value_get_int (value);
+ else if (g_str_equal (key, OPT_G_DRAG))
+ mt->dwell_dirs[DWELL_CLICK_TYPE_DRAG] = gconf_value_get_int (value);
+ else if (g_str_equal (key, OPT_G_RIGHT))
+ mt->dwell_dirs[DWELL_CLICK_TYPE_RIGHT] = gconf_value_get_int (value);
+}
+
+static void
+mt_gconf_read_options (MTClosure *mt)
+{
+ mt->threshold = gconf_client_get_int (mt->client, OPT_THRESHOLD, NULL);
+ mt->delay_enabled = gconf_client_get_bool (mt->client, OPT_DELAY, NULL);
+ mt->dwell_enabled = gconf_client_get_bool (mt->client, OPT_DWELL, NULL);
+ mt->dwell_show_ctw = gconf_client_get_bool (mt->client, OPT_CTW, NULL);
+ mt->dwell_mode = gconf_client_get_int (mt->client, OPT_MODE, NULL);
+ mt->style = gconf_client_get_int (mt->client, OPT_STYLE, NULL);
+
+ mt_timer_set_target_time (mt->delay_timer,
+ gconf_client_get_float (mt->client, OPT_DELAY_T, NULL));
+ mt_timer_set_target_time (mt->dwell_timer,
+ gconf_client_get_float (mt->client, OPT_DWELL_T, NULL));
+
+ mt->dwell_dirs[DWELL_CLICK_TYPE_SINGLE] = gconf_client_get_int (mt->client, OPT_G_SINGLE, NULL);
+ mt->dwell_dirs[DWELL_CLICK_TYPE_DOUBLE] = gconf_client_get_int (mt->client, OPT_G_DOUBLE, NULL);
+ mt->dwell_dirs[DWELL_CLICK_TYPE_DRAG] = gconf_client_get_int (mt->client, OPT_G_DRAG, NULL);
+ mt->dwell_dirs[DWELL_CLICK_TYPE_RIGHT] = gconf_client_get_int (mt->client, OPT_G_RIGHT, NULL);
+}
+
+static MTClosure *
+mt_closure_init (void)
+{
+ MTClosure *mt;
+
+ mt = g_try_new0 (MTClosure, 1);
+ if (!mt)
+ return NULL;
+
+ mt->client = gconf_client_get_default ();
+ mt->dwell_cct = DWELL_CLICK_TYPE_SINGLE;
+
+ mt->delay_timer = mt_timer_new ();
+ g_signal_connect (mt->delay_timer, "finished",
+ G_CALLBACK (delay_time_elapsed), mt);
+
+ mt->dwell_timer = mt_timer_new ();
+ g_signal_connect (mt->dwell_timer, "finished",
+ G_CALLBACK (dwell_time_elapsed), mt);
+
+ return mt;
+}
+
+static void
+mt_closure_free (MTClosure *mt)
+{
+ g_object_unref (mt->delay_timer);
+ g_object_unref (mt->dwell_timer);
+ g_object_unref (mt->client);
+ g_free (mt);
+}
+
+int
+main (int argc, char **argv)
+{
+ GnomeProgram *program;
+ MTClosure *mt;
+ int fixes_error_base;
+ pid_t pid;
+ gboolean shutdown = FALSE, ctw = FALSE;
+ gchar *mode = NULL, *enable = NULL;
+ gint pos_x = -1, pos_y = -1;
+ GOptionContext *context;
+ GOptionEntry entries[] = {
+ {"enable", 'e', 0, G_OPTION_ARG_STRING, &enable,
+ _("Enable mousetweaks feature"), "(dwell|delay)"},
+ {"dwell-mode", 'm', 0, G_OPTION_ARG_STRING, &mode,
+ _("Use dwell mode"), "(window|gesture)"},
+ {"show-ctw", 'c', 0, G_OPTION_ARG_NONE, &ctw,
+ _("Show click type window"), 0},
+ {"ctw-x", 'x', 0, G_OPTION_ARG_INT, &pos_x,
+ _("Window x position"), 0},
+ {"ctw-y", 'y', 0, G_OPTION_ARG_INT, &pos_y,
+ _("Window y position"), 0},
+ {"shutdown", 's', 0, G_OPTION_ARG_NONE, &shutdown,
+ _("Shutdown mousetweaks"), 0},
+ {NULL}
+ };
+
+ context = g_option_context_new ("");
+ g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+ g_option_context_add_group (context, gtk_get_option_group (FALSE));
+ g_option_context_parse (context, &argc, &argv, NULL);
+ g_option_context_free (context);
+
+ if (shutdown) {
+ int ret;
+
+ if ((ret = mt_pidfile_kill_wait (SIGINT, 5)) < 0)
+ g_print ("Shutdown failed or nothing to shut down.\n");
+ else
+ g_print ("Shutdown successful.\n");
+
+ return ret < 0 ? 1 : 0;
+ }
+
+ if ((pid = mt_pidfile_is_running()) >= 0) {
+ g_print ("Already running on PID file %u.\n", pid);
+ return 1;
+ }
+
+ g_print ("Starting daemon.\n");
+
+ if ((pid = fork ()) < 0)
+ return 1;
+ else if (pid)
+ return 0;
+ else {
+ if (mt_pidfile_create () < 0)
+ goto FINISH;
+
+ signal (SIGINT, signal_handler);
+ signal (SIGTERM, signal_handler);
+ signal (SIGQUIT, signal_handler);
+ signal (SIGHUP, signal_handler);
+
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ program = gnome_program_init (PACKAGE, VERSION,
+ LIBGNOMEUI_MODULE,
+ argc, argv,
+ GNOME_PARAM_NONE);
+
+ mt = mt_closure_init ();
+ if (!mt) {
+ g_object_unref (program);
+ goto FINISH;
+ }
+
+ if (SPI_init ()) {
+ mt_show_dialog (_("Assistive Technologies not enabled"),
+ _("Mousetweaks requires Assistive Technologies."),
+ GTK_MESSAGE_ERROR);
+
+ /* make sure we leave in a clean state */
+ gconf_client_set_bool (mt->client, OPT_DELAY, FALSE, NULL);
+ gconf_client_set_bool (mt->client, OPT_DWELL, FALSE, NULL);
+
+ mt_closure_free (mt);
+ g_object_unref (program);
+
+ goto FINISH;
+ }
+
+ mt->conn = mt_dbus_init (mt);
+ if (!mt->conn)
+ goto CLEANUP;
+
+ mt_session_init ();
+
+ /* listen for cursor changes */
+ if (XFixesQueryExtension (GDK_DISPLAY(),
+ &fixes_event_base,
+ &fixes_error_base)) {
+ XFixesSelectCursorInput (GDK_DISPLAY(),
+ GDK_ROOT_WINDOW(),
+ XFixesDisplayCursorNotifyMask);
+ gdk_window_add_filter (gdk_get_default_root_window (),
+ cursor_changed,
+ (gpointer) mt);
+ }
+
+ /* add at-spi listeners */
+ motion_listener = SPI_createAccessibleEventListener
+ (spi_motion_event, (void *) mt);
+ SPI_registerGlobalEventListener (motion_listener, "mouse:abs");
+
+ button_listener = SPI_createAccessibleDeviceListener
+ (spi_button_event, (void *) mt);
+ SPI_registerDeviceEventListener (button_listener,
+ SPI_BUTTON_PRESSED |
+ SPI_BUTTON_RELEASED,
+ NULL);
+
+ /* command-line options */
+ if (enable) {
+ if (g_str_equal (enable, "dwell")) {
+ gconf_client_set_bool (mt->client, OPT_DELAY, FALSE, NULL);
+ gconf_client_set_bool (mt->client, OPT_DWELL, TRUE, NULL);
+ }
+ if (g_str_equal (enable, "delay")) {
+ gconf_client_set_bool (mt->client, OPT_DWELL, FALSE, NULL);
+ gconf_client_set_bool (mt->client, OPT_DELAY, TRUE, NULL);
+ }
+ }
+ if (ctw)
+ gconf_client_set_bool (mt->client, OPT_CTW, TRUE, NULL);
+ if (mode) {
+ if (g_str_equal (mode, "gesture"))
+ gconf_client_set_int (mt->client, OPT_MODE, 0, NULL);
+ if (g_str_equal (mode, "window"))
+ gconf_client_set_int (mt->client, OPT_MODE, 1, NULL);
+ }
+
+ /* gconf stuff */
+ mt_gconf_read_options (mt);
+ gconf_client_add_dir (mt->client,
+ MT_GCONF_HOME,
+ GCONF_CLIENT_PRELOAD_ONELEVEL,
+ NULL);
+ g_signal_connect (G_OBJECT(mt->client), "value_changed",
+ G_CALLBACK(mt_gconf_notify), (gpointer) mt);
+
+ if (!mt_ctw_init (mt, pos_x, pos_y)) {
+ mt_dbus_fini (mt->conn);
+ goto CLEANUP;
+ }
+
+ /* tell the dwell click applet we are here */
+ mt_dbus_send_signal (mt->conn, ACTIVE_SIGNAL, 1);
+
+ SPI_event_main ();
+
+ mt_dbus_send_signal (mt->conn, ACTIVE_SIGNAL, 0);
+ mt_dbus_fini (mt->conn);
+ }
+
+CLEANUP:
+ SPI_exit ();
+ mt_closure_free (mt);
+ g_object_unref (program);
+
+FINISH:
+ mt_pidfile_remove ();
+
+ return 0;
+}
Added: trunk/src/mt-main.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-main.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,60 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_MAIN_H__
+#define __MT_MAIN_H__
+
+#include <dbus/dbus-glib-lowlevel.h>
+#include <gconf/gconf-client.h>
+
+#include "mt-timer.h"
+
+G_BEGIN_DECLS
+
+typedef struct _MTClosure MTClosure;
+struct _MTClosure {
+ DBusConnection *conn;
+ GConfClient *client;
+
+ MtTimer *delay_timer;
+ MtTimer *dwell_timer;
+ gint dwell_cct;
+ gboolean dwell_drag_started;
+ gboolean dwell_gesture_started;
+ gboolean override_cursor;
+
+ gint direction;
+ gint pointer_x;
+ gint pointer_y;
+
+ /* options */
+ gint threshold;
+ gint style;
+ gboolean delay_enabled;
+ gboolean dwell_enabled;
+ gboolean dwell_show_ctw;
+ gint dwell_mode;
+ gint dwell_dirs[4];
+};
+
+void spi_shutdown (void);
+
+G_END_DECLS
+
+#endif /* __MT_MAIN_H__ */
Added: trunk/src/mt-pidfile.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-pidfile.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,235 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified version of dpid.c -libdaemon
+ * Copyright 2003-2007 Lennart Poettering <mzqnrzba (at) 0pointer (dot) de>
+ */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <sys/select.h>
+#include <fcntl.h>
+#include <stddef.h>
+
+#include <glib.h>
+
+#ifndef ETIME
+#define ETIME ETIMEDOUT /* For FreeBSD */
+#endif
+
+static const char *
+mt_pidfile_proc (void)
+{
+ static char fn[512];
+
+ snprintf (fn, sizeof(fn), "%s/.mousetweaks.pid", g_get_home_dir ());
+ return fn;
+}
+
+static int
+lock_file (int fd, int enable)
+{
+ struct flock f;
+
+ memset(&f, 0, sizeof(f));
+ f.l_type = enable ? F_WRLCK : F_UNLCK;
+ f.l_whence = SEEK_SET;
+ f.l_start = 0;
+ f.l_len = 0;
+
+ if (fcntl(fd, F_SETLKW, &f) < 0)
+ return -1;
+
+ return 0;
+}
+
+pid_t
+mt_pidfile_is_running (void)
+{
+ const char *fn;
+ static char txt[256];
+ int fd = -1, locked = -1;
+ pid_t ret = (pid_t) -1, pid;
+ ssize_t l;
+ long lpid;
+ char *e = NULL;
+
+ if (!(fn = mt_pidfile_proc ())) {
+ errno = EINVAL;
+ goto FINISH;
+ }
+
+ if ((fd = open (fn, O_RDWR, 0644)) < 0)
+ goto FINISH;
+
+ if ((locked = lock_file (fd, 1)) < 0)
+ goto FINISH;
+
+ if ((l = read (fd, txt, sizeof(txt) - 1)) < 0) {
+ unlink(fn);
+ goto FINISH;
+ }
+
+ txt[l] = 0;
+ txt[strcspn(txt, "\r\n")] = 0;
+
+ errno = 0;
+ lpid = strtol(txt, &e, 10);
+ pid = (pid_t) lpid;
+
+ if (errno != 0 || !e || *e || (long) pid != lpid) {
+ unlink (fn);
+ errno = EINVAL;
+ goto FINISH;
+ }
+
+ if (kill (pid, 0) != 0 && errno != EPERM) {
+ int saved_errno = errno;
+ unlink (fn);
+ errno = saved_errno;
+ goto FINISH;
+ }
+
+ ret = pid;
+
+FINISH:
+ if (fd >= 0) {
+ int saved_errno = errno;
+ if (locked >= 0)
+ lock_file (fd, 0);
+ errno = saved_errno;
+ close (fd);
+ }
+
+ return ret;
+}
+
+int
+mt_pidfile_kill_wait (int signal, int sec)
+{
+ pid_t pid;
+ time_t t;
+
+ if ((pid = mt_pidfile_is_running ()) < 0)
+ return -1;
+
+ if (kill (pid, signal) < 0)
+ return -1;
+
+ t = time (NULL) + sec;
+
+ for (;;) {
+ int r;
+ struct timeval tv = { 0, 100000 };
+
+ if (time (NULL) > t) {
+ errno = ETIME;
+ return -1;
+ }
+
+ if ((r = kill (pid, 0)) < 0 && errno != ESRCH)
+ return -1;
+
+ if (r)
+ return 0;
+
+ if (select (0, NULL, NULL, NULL, &tv) < 0)
+ return -1;
+ }
+}
+
+int
+mt_pidfile_create (void)
+{
+ const char *fn;
+ int fd = -1;
+ int ret = -1;
+ int locked = -1;
+ char t[64];
+ ssize_t l;
+ mode_t u;
+
+ u = umask(022);
+
+ if (!(fn = mt_pidfile_proc ())) {
+ errno = EINVAL;
+ goto FINISH;
+ }
+
+ if ((fd = open (fn, O_CREAT|O_RDWR|O_EXCL, 0644)) < 0)
+ goto FINISH;
+
+ if ((locked = lock_file (fd, 1)) < 0) {
+ int saved_errno = errno;
+ unlink (fn);
+ errno = saved_errno;
+ goto FINISH;
+ }
+
+ snprintf (t, sizeof(t), "%lu\n", (unsigned long) getpid ());
+
+ if (write (fd, t, l = strlen(t)) != l) {
+ int saved_errno = errno;
+ unlink (fn);
+ errno = saved_errno;
+ goto FINISH;
+ }
+
+ ret = 0;
+
+FINISH:
+ if (fd >= 0) {
+ int saved_errno = errno;
+
+ if (locked >= 0)
+ lock_file (fd, 0);
+
+ close (fd);
+ errno = saved_errno;
+ }
+
+ umask(u);
+
+ return ret;
+}
+
+int
+mt_pidfile_remove (void)
+{
+ const char *fn;
+
+ if (!(fn = mt_pidfile_proc ())) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (unlink (fn) < 0)
+ return -1;
+
+ return 0;
+}
Added: trunk/src/mt-pidfile.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-pidfile.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,33 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_PIDFILE_H__
+#define __MT_PIDFILE_H__
+
+G_BEGIN_DECLS
+
+int mt_pidfile_create (void);
+pid_t mt_pidfile_is_running (void);
+int mt_pidfile_kill_wait (int signal,
+ int sec);
+int mt_pidfile_remove (void);
+
+G_END_DECLS
+
+#endif /* __MT_PIDFILE_H__ */
Added: trunk/src/mt-session.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-session.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,64 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+#include <libgnomeui/gnome-client.h>
+
+#include "mt-main.h"
+
+static gint
+session_save_yourself (GnomeClient *client,
+ gint phase,
+ GnomeSaveStyle save_style,
+ gint shutdown,
+ GnomeInteractStyle interact_style,
+ gint fast,
+ gpointer data)
+{
+ return TRUE;
+}
+
+static void
+session_die (GnomeClient *client, gpointer data)
+{
+ spi_shutdown ();
+}
+
+void
+mt_session_init (void)
+{
+ GnomeClient *client;
+ GnomeClientFlags flags;
+ gchar *argv[] = { "mousetweaks", NULL };
+
+ client = gnome_master_client ();
+ flags = gnome_client_get_flags (client);
+
+ if (!(flags & GNOME_CLIENT_IS_CONNECTED))
+ return;
+
+ gnome_client_set_restart_command (client, 1, argv);
+ gnome_client_set_restart_style (client, GNOME_RESTART_IF_RUNNING);
+ gnome_client_set_priority (client, 45);
+
+ g_signal_connect (G_OBJECT(client), "die",
+ G_CALLBACK(session_die), NULL);
+ g_signal_connect (G_OBJECT(client), "save_yourself",
+ G_CALLBACK(session_save_yourself), NULL);
+}
Added: trunk/src/mt-session.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-session.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,29 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_SESSION_H__
+#define __MT_SESSION_H__
+
+G_BEGIN_DECLS
+
+void mt_session_init (void);
+
+G_END_DECLS
+
+#endif /* __MT_SESSION_H__ */
Added: trunk/src/mt-timer.c
==============================================================================
--- (empty file)
+++ trunk/src/mt-timer.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,257 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glib.h>
+
+#include "mt-timer.h"
+
+#define MT_TIMER_GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MT_TYPE_TIMER, MtTimerPrivate))
+
+typedef struct _MtTimerPrivate MtTimerPrivate;
+struct _MtTimerPrivate {
+ GTimer *timer;
+ guint tid;
+ gdouble elapsed;
+ gdouble target;
+};
+
+enum {
+ PROP_0,
+ PROP_TARGET
+};
+
+enum {
+ FINISHED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE (MtTimer, mt_timer, G_TYPE_OBJECT)
+
+static void mt_timer_dispose (GObject *object);
+static void mt_timer_finalize (GObject *object);
+static void mt_timer_set_property (GObject *object,
+ guint property,
+ const GValue *value,
+ GParamSpec *pspec);
+static void mt_timer_get_property (GObject *object,
+ guint property,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void
+mt_timer_class_init (MtTimerClass *klass)
+{
+ GParamSpec *pspec;
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
+ gobject_class->dispose = mt_timer_dispose;
+ gobject_class->finalize = mt_timer_finalize;
+ gobject_class->set_property = mt_timer_set_property;
+ gobject_class->get_property = mt_timer_get_property;
+
+ pspec = g_param_spec_double ("target", "Target", "Target time to check for",
+ 0.5, 3.0, 1.2, G_PARAM_READWRITE);
+ g_object_class_install_property (gobject_class, PROP_TARGET, pspec);
+
+ signals[FINISHED] = g_signal_new (g_intern_static_string ("finished"),
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (MtTimerClass, finished),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_type_class_add_private (klass, sizeof (MtTimerPrivate));
+}
+
+static void
+mt_timer_init (MtTimer *timer)
+{
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(timer);
+
+ priv->timer = NULL;
+ priv->tid = 0;
+ priv->elapsed = 0.0;
+ priv->target = 1.2;
+}
+
+static void
+mt_timer_dispose (GObject *object)
+{
+ MtTimer *timer = MT_TIMER(object);
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(timer);
+
+ if (mt_timer_is_running (timer)) {
+ g_timer_stop (priv->timer);
+ priv->elapsed = 0.0;
+ }
+
+ if (priv->tid != 0) {
+ g_source_remove (priv->tid);
+ priv->tid = 0;
+ }
+
+ G_OBJECT_CLASS (mt_timer_parent_class)->dispose (object);
+}
+
+static void
+mt_timer_finalize (GObject *object)
+{
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(object);
+
+ g_timer_destroy (priv->timer);
+ priv->timer = NULL;
+
+ G_OBJECT_CLASS (mt_timer_parent_class)->finalize (object);
+}
+
+static void
+mt_timer_set_property (GObject *object,
+ guint property,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(object);
+
+ switch (property) {
+ case PROP_TARGET:
+ priv->target = g_value_get_double (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property, pspec);
+ break;
+ }
+}
+
+static void
+mt_timer_get_property (GObject *object,
+ guint property,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(object);
+
+ switch (property) {
+ case PROP_TARGET:
+ g_value_set_double (value, priv->target);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property, pspec);
+ break;
+ }
+}
+
+static gboolean
+mt_timer_check_time (gpointer data)
+{
+ MtTimer *timer = (MtTimer *) data;
+ MtTimerPrivate *priv = MT_TIMER_GET_PRIVATE(timer);
+
+ priv->elapsed = g_timer_elapsed (priv->timer, NULL);
+
+ if (priv->elapsed >= priv->target) {
+ priv->tid = 0;
+ g_timer_stop (priv->timer);
+ g_signal_emit (timer, signals[FINISHED], 0);
+ priv->elapsed = 0.0;
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+MtTimer *
+mt_timer_new (void)
+{
+ MtTimer *timer;
+ MtTimerPrivate *priv;
+
+ timer = g_object_new (MT_TYPE_TIMER, NULL);
+ priv = MT_TIMER_GET_PRIVATE(timer);
+
+ priv->timer = g_timer_new ();
+ g_timer_stop (priv->timer);
+
+ return timer;
+}
+
+void
+mt_timer_start (MtTimer *timer)
+{
+ MtTimerPrivate *priv;
+
+ g_return_if_fail (MT_IS_TIMER(timer));
+
+ priv = MT_TIMER_GET_PRIVATE(timer);
+ g_timer_start (priv->timer);
+
+ if (priv->tid == 0)
+ priv->tid = g_timeout_add (100, mt_timer_check_time, timer);
+}
+
+void
+mt_timer_stop (MtTimer *timer)
+{
+ MtTimerPrivate *priv;
+
+ g_return_if_fail (MT_IS_TIMER(timer));
+
+ priv = MT_TIMER_GET_PRIVATE(timer);
+ g_timer_stop (priv->timer);
+
+ if (priv->tid != 0) {
+ g_source_remove (priv->tid);
+ priv->tid = 0;
+ }
+}
+
+gboolean
+mt_timer_is_running (MtTimer *timer)
+{
+ MtTimerPrivate *priv;
+
+ g_return_val_if_fail (MT_IS_TIMER(timer), FALSE);
+
+ priv = MT_TIMER_GET_PRIVATE(timer);
+
+ return (priv->tid != 0);
+}
+
+gdouble
+mt_timer_elapsed (MtTimer *timer)
+{
+ g_return_val_if_fail (MT_IS_TIMER(timer), 0.0);
+
+ return MT_TIMER_GET_PRIVATE(timer)->elapsed;
+}
+
+void
+mt_timer_set_target_time (MtTimer *timer, gdouble time)
+{
+ MtTimerPrivate *priv;
+
+ g_return_if_fail (MT_IS_TIMER(timer));
+
+ priv = MT_TIMER_GET_PRIVATE(timer);
+ g_object_set (timer, "target", time, NULL);
+}
Added: trunk/src/mt-timer.h
==============================================================================
--- (empty file)
+++ trunk/src/mt-timer.h Fri Jan 11 13:34:55 2008
@@ -0,0 +1,59 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This file is part of Mousetweaks.
+ *
+ * Mousetweaks is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Mousetweaks is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MT_TIMER_H__
+#define __MT_TIMER_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define MT_TYPE_TIMER (mt_timer_get_type ())
+#define MT_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MT_TYPE_TIMER, MtTimer))
+#define MT_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MT_TYPE_TIMER, MtTimerClass))
+#define MT_IS_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MT_TYPE_TIMER))
+#define MT_IS_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MT_TYPE_TIMER))
+#define MT_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MT_TYPE_TIMER, MtTimerClass))
+
+typedef struct _MtTimer MtTimer;
+typedef struct _MtTimerClass MtTimerClass;
+
+struct _MtTimer {
+ GObject parent;
+};
+
+struct _MtTimerClass {
+ GObjectClass parent;
+
+ void (*finished) (MtTimer *timer);
+};
+
+GType mt_timer_get_type (void) G_GNUC_CONST;
+
+MtTimer * mt_timer_new (void);
+void mt_timer_start (MtTimer *timer);
+void mt_timer_stop (MtTimer *timer);
+gboolean mt_timer_is_running (MtTimer *timer);
+gdouble mt_timer_elapsed (MtTimer *timer);
+void mt_timer_set_target_time (MtTimer *timer,
+ gdouble time);
+
+G_END_DECLS
+
+#endif /* __MT_TIMER_H__ */
Added: trunk/src/pointer-capture-applet.c
==============================================================================
--- (empty file)
+++ trunk/src/pointer-capture-applet.c Fri Jan 11 13:34:55 2008
@@ -0,0 +1,669 @@
+/*
+ * Copyright  2007 Gerd Kohlberger <lowfi chello at>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <panel-applet.h>
+#include <panel-applet-gconf.h>
+#include <libgnomeui/gnome-help.h>
+
+#include "mt-common.h"
+
+#define TANGO_CHAMELEON_DARK 0.305f, 0.603f, 0.023f
+#define TANGO_SCARLETRED_DARK 0.643f, 0.000f, 0.000f
+#define TANGO_ALUMINIUM2_DARK 0.180f, 0.203f, 0.211f
+
+typedef struct _CaptureData CaptureData;
+struct _CaptureData {
+ PanelApplet *applet;
+
+ GladeXML *xml;
+ GtkWidget *area;
+ GtkWidget *prefs;
+
+ GdkCursor *null_cursor;
+ gboolean pointer_locked;
+ gint pointer_x;
+ gint pointer_y;
+ gboolean vertical;
+
+ gint size;
+ gint cap_button;
+ guint cap_mask;
+ gint rel_button;
+ guint rel_mask;
+};
+
+static const gchar menu_xml[] =
+ "<popup name=\"button3\">\n"
+ " <menuitem name=\"Properties Item\" verb=\"PropertiesVerb\" "
+ " _label=\"_Preferences\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-properties\"/>\n"
+ " <menuitem name=\"Help Item\" verb=\"HelpVerb\" "
+ " _label=\"_Help\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-help\"/>\n"
+ " <menuitem name=\"About Item\" verb=\"AboutVerb\" _label=\"_About\"\n"
+ " pixtype=\"stock\" pixname=\"gtk-about\"/>\n"
+ "</popup>\n";
+
+static void fini_capture_data (CaptureData *cd);
+
+static void
+capture_preferences (BonoboUIComponent *component,
+ gpointer data,
+ const char *cname)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ if (GTK_WIDGET_VISIBLE(cd->prefs))
+ gtk_window_present (GTK_WINDOW(cd->prefs));
+ else
+ gtk_widget_show (cd->prefs);
+}
+
+static void
+show_help (void)
+{
+ GError *error = NULL;
+
+ if (!gnome_help_display_desktop (NULL,
+ "mousetweaks",
+ "mousetweaks",
+ NULL,
+ &error)) {
+ mt_show_dialog (_("Couldn't display help"),
+ error->message,
+ GTK_MESSAGE_ERROR);
+ g_error_free (error);
+ }
+}
+
+static void
+capture_help (BonoboUIComponent *component, gpointer data, const char *cname)
+{
+ show_help ();
+}
+
+static void
+capture_about (BonoboUIComponent *component, gpointer data, const char *cname)
+{
+ CaptureData *cd = (CaptureData *) data;
+ GtkWidget *about;
+
+ about = glade_xml_get_widget (cd->xml, "about");
+
+ if (GTK_WIDGET_VISIBLE(about))
+ gtk_window_present (GTK_WINDOW(about));
+ else
+ gtk_widget_show (about);
+}
+
+static const BonoboUIVerb menu_verb[] = {
+ BONOBO_UI_UNSAFE_VERB ("PropertiesVerb", capture_preferences),
+ BONOBO_UI_UNSAFE_VERB ("HelpVerb", capture_help),
+ BONOBO_UI_UNSAFE_VERB ("AboutVerb", capture_about),
+ BONOBO_UI_VERB_END
+};
+
+/* grab pointer and update lock state */
+static gboolean
+lock_pointer (CaptureData *cd, guint32 time)
+{
+ GdkGrabStatus stat;
+
+ stat = gdk_pointer_grab (cd->area->window,
+ FALSE,
+ GDK_BUTTON_PRESS_MASK,
+ cd->area->window,
+ cd->null_cursor,
+ time);
+
+ if (stat != GDK_GRAB_SUCCESS)
+ return FALSE;
+
+ cd->pointer_locked = TRUE;
+ gtk_widget_queue_draw (cd->area);
+
+ return TRUE;
+}
+
+static void
+unlock_pointer (CaptureData *cd, guint32 time)
+{
+ /* move pointer to the position where it was locked */
+ gdk_display_warp_pointer (gdk_display_get_default (),
+ gtk_widget_get_screen (cd->area),
+ cd->pointer_x,
+ cd->pointer_y);
+
+ gdk_pointer_ungrab (time);
+
+ cd->pointer_locked = FALSE;
+ gtk_widget_queue_draw (cd->area);
+}
+
+/* lock pointer immediately if we have no button*/
+static gboolean
+area_entered (GtkWidget *widget, GdkEventCrossing *cev, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ if (cev->mode != GDK_CROSSING_NORMAL)
+ return FALSE;
+
+ if (cd->cap_button)
+ return FALSE;
+
+ cd->pointer_x = cev->x_root;
+ cd->pointer_y = cev->y_root;
+
+ return lock_pointer (cd, cev->time);
+}
+
+/* change lock states */
+static gboolean
+area_button_press (GtkWidget *widget, GdkEventButton *bev, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ if (bev->button == cd->cap_button &&
+ (bev->state & cd->cap_mask) == cd->cap_mask &&
+ !cd->pointer_locked) {
+
+ cd->pointer_x = bev->x_root;
+ cd->pointer_y = bev->y_root;
+ lock_pointer (cd, bev->time);
+ }
+ else if (bev->button == cd->rel_button &&
+ (bev->state & cd->rel_mask) == cd->rel_mask &&
+ cd->pointer_locked) {
+
+ unlock_pointer (cd, bev->time);
+ }
+ else if (!cd->pointer_locked && bev->button != 1) {
+ g_signal_stop_emission_by_name (widget, "button_press_event");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+render_text (cairo_t *cr, CaptureData *cd)
+{
+ PangoLayout *layout;
+ PangoFontDescription *desc;
+ PangoRectangle rect;
+ guint size;
+
+ layout = pango_cairo_create_layout (cr);
+
+ if (cd->size >= 60)
+ pango_layout_set_text (layout, _("Locked"), -1);
+ else
+ /* l10n: the first letter of 'Locked' */
+ pango_layout_set_text (layout, _("L"), -1);
+
+ desc = pango_font_description_new ();
+ pango_font_description_set_family (desc, "Bitstream Vera Sans");
+
+ if (cd->vertical)
+ pango_font_description_set_gravity (desc, PANGO_GRAVITY_EAST);
+
+ size = panel_applet_get_size (cd->applet) / 3;
+ pango_font_description_set_size (desc, size * PANGO_SCALE);
+
+ pango_layout_set_font_description (layout, desc);
+ pango_layout_get_pixel_extents (layout, &rect, NULL);
+
+ /* check font size */
+ while ((rect.width - 8) > cd->size) {
+ pango_font_description_set_size (desc, (--size) * PANGO_SCALE);
+ pango_layout_set_font_description (layout, desc);
+ pango_layout_get_pixel_extents (layout, &rect, NULL);
+ }
+
+ if (cd->vertical)
+ cairo_rotate (cr, -pango_gravity_to_rotation (PANGO_GRAVITY_EAST));
+
+ cairo_rel_move_to (cr,
+ -rect.x - rect.width / 2,
+ -rect.y - rect.height / 2);
+ pango_cairo_layout_path (cr, layout);
+
+ pango_font_description_free (desc);
+ g_object_unref (layout);
+}
+
+/* draw background */
+static gboolean
+area_exposed (GtkWidget *widget, GdkEventExpose *eev, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+ cairo_t *cr;
+ gdouble w, h;
+
+ w = widget->allocation.width;
+ h = widget->allocation.height;
+
+ cr = gdk_cairo_create (widget->window);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_rectangle (cr, 0.0, 0.0, w, h);
+
+ if (cd->pointer_locked)
+ cairo_set_source_rgb (cr, TANGO_SCARLETRED_DARK);
+ else
+ cairo_set_source_rgb (cr, TANGO_CHAMELEON_DARK);
+
+ cairo_paint (cr);
+ cairo_set_source_rgb (cr, TANGO_ALUMINIUM2_DARK);
+ cairo_stroke (cr);
+
+ if (cd->pointer_locked) {
+ cairo_move_to (cr, w / 2, h / 2);
+ render_text (cr, cd);
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_fill (cr);
+ }
+
+ cairo_destroy (cr);
+
+ return TRUE;
+}
+
+static void
+update_orientation (CaptureData *cd, PanelAppletOrient orient)
+{
+ switch (orient) {
+ case PANEL_APPLET_ORIENT_UP:
+ case PANEL_APPLET_ORIENT_DOWN:
+ gtk_widget_set_size_request (cd->area, cd->size, 0);
+ cd->vertical = FALSE;
+ break;
+ case PANEL_APPLET_ORIENT_LEFT:
+ case PANEL_APPLET_ORIENT_RIGHT:
+ gtk_widget_set_size_request (cd->area, 0, cd->size);
+ cd->vertical = TRUE;
+ default:
+ break;
+ }
+}
+
+/* applet callback */
+static void
+applet_unrealize (GtkWidget *widget, gpointer data)
+{
+ fini_capture_data ((CaptureData *) data);
+}
+
+static void
+applet_orient_changed (PanelApplet *applet, guint orient, gpointer data)
+{
+ update_orientation ((CaptureData *) data, orient);
+}
+
+static void
+about_response (GtkButton *button, gint response, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ gtk_widget_hide (glade_xml_get_widget (cd->xml, "about"));
+}
+
+/* preferences dialog callbacks */
+static void
+prefs_size_changed (GtkSpinButton *spin, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->size = gtk_spin_button_get_value_as_int (spin);
+ panel_applet_gconf_set_int (cd->applet, "size", cd->size, NULL);
+
+ update_orientation (cd, panel_applet_get_orient (cd->applet));
+}
+
+static void
+prefs_closed (GtkButton *button, gpointer data)
+{
+ gtk_widget_hide (((CaptureData *) data)->prefs);
+}
+
+static void
+prefs_help (GtkButton *button, gpointer data)
+{
+ show_help ();
+}
+
+static void
+prefs_cap_button (GtkSpinButton *spin, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->cap_button = gtk_spin_button_get_value_as_int (spin);
+ panel_applet_gconf_set_int (cd->applet,
+ "capture_button",
+ cd->cap_button,
+ NULL);
+}
+
+static void
+prefs_cap_alt (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->cap_mask ^= GDK_MOD1_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "capture_mod_alt",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static void
+prefs_cap_shift (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->cap_mask ^= GDK_SHIFT_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "capture_mod_shift",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static void
+prefs_cap_ctrl (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->cap_mask ^= GDK_CONTROL_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "capture_mod_ctrl",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static void
+prefs_rel_button (GtkSpinButton *spin, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->rel_button = gtk_spin_button_get_value_as_int (spin);
+ panel_applet_gconf_set_int (cd->applet,
+ "release_button",
+ cd->rel_button,
+ NULL);
+}
+
+static void
+prefs_rel_alt (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->rel_mask ^= GDK_MOD1_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "release_mod_alt",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static void
+prefs_rel_shift (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->rel_mask ^= GDK_SHIFT_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "release_mod_shift",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static void
+prefs_rel_ctrl (GtkToggleButton *toggle, gpointer data)
+{
+ CaptureData *cd = (CaptureData *) data;
+
+ cd->rel_mask ^= GDK_CONTROL_MASK;
+ panel_applet_gconf_set_bool (cd->applet,
+ "release_mod_ctrl",
+ gtk_toggle_button_get_active (toggle),
+ NULL);
+}
+
+static gboolean
+init_preferences (CaptureData *cd)
+{
+ GtkWidget *w;
+
+ cd->xml = glade_xml_new (GLADEDIR "/pointer-capture-applet.glade", NULL, NULL);
+ if (!cd->xml)
+ return FALSE;
+
+ gtk_window_set_default_icon_name (MT_ICON_NAME);
+
+ cd->prefs = glade_xml_get_widget (cd->xml, "capture_preferences");
+ g_signal_connect (G_OBJECT(cd->prefs), "delete-event",
+ G_CALLBACK(gtk_widget_hide_on_delete), NULL);
+
+ w = glade_xml_get_widget (cd->xml, "close");
+ g_signal_connect (G_OBJECT(w), "clicked",
+ G_CALLBACK(prefs_closed), cd);
+
+ w = glade_xml_get_widget (cd->xml, "help");
+ g_signal_connect (G_OBJECT(w), "clicked",
+ G_CALLBACK(prefs_help), NULL);
+
+ w = glade_xml_get_widget (cd->xml, "size");
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(w), cd->size);
+ g_signal_connect (G_OBJECT(w), "value_changed",
+ G_CALLBACK(prefs_size_changed), cd);
+
+ /* capture modifier signals */
+ w = glade_xml_get_widget (cd->xml, "cap_button");
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(w), cd->cap_button);
+ g_signal_connect (G_OBJECT(w), "value_changed",
+ G_CALLBACK(prefs_cap_button), cd);
+ w = glade_xml_get_widget (cd->xml, "cap_alt");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->cap_mask & GDK_MOD1_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_cap_alt), cd);
+ w = glade_xml_get_widget (cd->xml, "cap_shift");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->cap_mask & GDK_SHIFT_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_cap_shift), cd);
+ w = glade_xml_get_widget (cd->xml, "cap_ctrl");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->cap_mask & GDK_CONTROL_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_cap_ctrl), cd);
+
+ /* release modifier signals */
+ w = glade_xml_get_widget (cd->xml, "rel_button");
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON(w), cd->rel_button);
+ g_signal_connect (G_OBJECT(w), "value_changed",
+ G_CALLBACK(prefs_rel_button), cd);
+ w = glade_xml_get_widget (cd->xml, "rel_alt");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->rel_mask & GDK_MOD1_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_rel_alt), cd);
+ w = glade_xml_get_widget (cd->xml, "rel_shift");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->rel_mask & GDK_SHIFT_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_rel_shift), cd);
+ w = glade_xml_get_widget (cd->xml, "rel_ctrl");
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(w),
+ (cd->rel_mask & GDK_CONTROL_MASK));
+ g_signal_connect (G_OBJECT(w), "toggled",
+ G_CALLBACK(prefs_rel_ctrl), cd);
+
+ return TRUE;
+}
+
+static CaptureData *
+init_capture_data (PanelApplet *applet)
+{
+ CaptureData *cd;
+
+ cd = g_new0 (CaptureData, 1);
+ if (!cd)
+ return NULL;
+
+ cd->applet = applet;
+ cd->size = 100;
+ cd->rel_button = 1;
+
+ return cd;
+}
+
+static void
+fini_capture_data (CaptureData *cd)
+{
+ if (cd->null_cursor)
+ gdk_cursor_unref (cd->null_cursor);
+
+ g_free (cd);
+}
+
+static gboolean
+fill_applet (PanelApplet *applet)
+{
+ CaptureData *cd;
+ GtkWidget *about;
+ GdkPixmap *bmp0 = NULL;
+ gchar char0[] = { 0x0 };
+ GdkColor c0 = { 0, 0, 0, 0 };
+ AtkObject *obj;
+
+ cd = init_capture_data (applet);
+ if (!cd)
+ return FALSE;
+
+ /* invisible cursor */
+ bmp0 = gdk_bitmap_create_from_data (NULL, char0, 1, 1);
+ if (!bmp0) {
+ g_free (cd);
+ return FALSE;
+ }
+
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ cd->null_cursor = gdk_cursor_new_from_pixmap (bmp0, bmp0, &c0, &c0, 0, 0);
+ g_object_unref (bmp0);
+
+ if (!cd->null_cursor) {
+ g_free (cd);
+ return FALSE;
+ }
+
+ /* gconf settings */
+ panel_applet_add_preferences (applet,
+ "/schemas/apps/pointer-capture",
+ NULL);
+
+ cd->size = panel_applet_gconf_get_int (applet, "size", NULL);
+ cd->cap_button = panel_applet_gconf_get_int (applet,
+ "capture_button", NULL);
+ cd->rel_button = panel_applet_gconf_get_int (applet,
+ "release_button", NULL);
+ if (panel_applet_gconf_get_bool (applet, "capture_mod_shift", NULL))
+ cd->cap_mask |= GDK_SHIFT_MASK;
+ if (panel_applet_gconf_get_bool (applet, "capture_mod_ctrl", NULL))
+ cd->cap_mask |= GDK_CONTROL_MASK;
+ if (panel_applet_gconf_get_bool (applet, "capture_mod_alt", NULL))
+ cd->cap_mask |= GDK_MOD1_MASK;
+ if (panel_applet_gconf_get_bool (applet, "release_mod_shift", NULL))
+ cd->rel_mask |= GDK_SHIFT_MASK;
+ if (panel_applet_gconf_get_bool (applet, "release_mod_ctrl", NULL))
+ cd->rel_mask |= GDK_CONTROL_MASK;
+ if (panel_applet_gconf_get_bool (applet, "release_mod_alt", NULL))
+ cd->rel_mask |= GDK_MOD1_MASK;
+
+ /* preferences dialog */
+ if (!init_preferences (cd)) {
+ fini_capture_data (cd);
+ return FALSE;
+ }
+
+ /* capture area */
+ cd->area = gtk_drawing_area_new ();
+ gtk_widget_add_events (cd->area,
+ GDK_ENTER_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK);
+
+ g_signal_connect (G_OBJECT(cd->area), "enter-notify-event",
+ G_CALLBACK(area_entered), cd);
+ g_signal_connect (G_OBJECT(cd->area), "expose-event",
+ G_CALLBACK(area_exposed), cd);
+ g_signal_connect (G_OBJECT(cd->area), "button-press-event",
+ G_CALLBACK(area_button_press), cd);
+
+ update_orientation (cd, panel_applet_get_orient (applet));
+ gtk_widget_show (cd->area);
+
+ /* about dialog */
+ about = glade_xml_get_widget (cd->xml, "about");
+ g_object_set (about, "version", VERSION, NULL);
+
+ g_signal_connect (G_OBJECT(about), "delete-event",
+ G_CALLBACK(gtk_widget_hide_on_delete), NULL);
+ g_signal_connect (G_OBJECT(about), "response",
+ G_CALLBACK(about_response), cd);
+
+ /* applet initialisation */
+ panel_applet_set_flags (applet,
+ PANEL_APPLET_EXPAND_MINOR |
+ PANEL_APPLET_HAS_HANDLE);
+ panel_applet_set_background_widget (applet, GTK_WIDGET(applet));
+ panel_applet_setup_menu (applet, menu_xml, menu_verb, cd);
+
+ g_signal_connect (applet, "change-orient",
+ G_CALLBACK(applet_orient_changed), cd);
+ g_signal_connect (applet, "unrealize",
+ G_CALLBACK(applet_unrealize), cd);
+
+ obj = gtk_widget_get_accessible (GTK_WIDGET(applet));
+ atk_object_set_name (obj, _("Capture area"));
+ atk_object_set_description (obj, _("Temporarily lock the mouse pointer"));
+
+ gtk_container_add (GTK_CONTAINER(applet), cd->area);
+ gtk_container_set_border_width (GTK_CONTAINER(applet), 1);
+ gtk_widget_show (GTK_WIDGET(applet));
+
+ return TRUE;
+}
+
+static gboolean
+applet_factory (PanelApplet *applet, const gchar *iid, gpointer data)
+{
+ if (!g_str_equal (iid, "OAFIID:PointerCaptureApplet"))
+ return FALSE;
+
+ return fill_applet (applet);
+}
+
+PANEL_APPLET_BONOBO_FACTORY ("OAFIID:PointerCaptureApplet_Factory",
+ PANEL_TYPE_APPLET,
+ "Pointer Capture Factory",
+ "0",
+ applet_factory,
+ NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]