libmokoui2-0.3+bzr20080630/0000755000175000001440000000000011032075022014257 5ustar stevenuserslibmokoui2-0.3+bzr20080630/AUTHORS0000644000175000001440000000000010776321216015332 0ustar stevenuserslibmokoui2-0.3+bzr20080630/COPYING0000644000175000001440000006347610776321216015347 0ustar stevenusers GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libmokoui2-0.3+bzr20080630/ChangeLog0000644000175000001440000004075211032043231016036 0ustar stevenusers2008-04-10 Chris Lord * libmokoui/moko-finger-scroll.c (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_init): Do check event type, but don't distinguish between single click and double-click 2008-04-07 Chris Lord * libmokoui/moko-finger-scroll.c (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb): Don't bother checking the last event type when detecting infinite loops, it just causes problems with double-clicking 2008-01-29 Chris Lord * bindings/python/Makefile.am: * bindings/python/moko.override: * bindings/python/mokomodule.c: Rename 'moko' to 'mokoui' in python bindings 2008-01-22 Chris Lord Patch by: Frank Li * libmokoui/moko-finger-scroll.c: (moko_get_time_delta), (moko_finger_scroll_button_press_cb), (moko_finger_scroll_refresh), (moko_finger_scroll_timeout), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb), (parent_set_cb), (moko_finger_scroll_get_property), (moko_finger_scroll_set_property), (moko_finger_scroll_class_init), (moko_finger_scroll_mode_get_type), (moko_finger_scroll_indicator_mode_get_type): * libmokoui/moko-finger-scroll.h: * libmokoui/moko-type.h: Add indicator display modes and new 'auto' scrolling mode 2008-01-22 Chris Lord * configure.ac: python bindings disabled by default 2008-01-22 Chris Lord * libmokoui/moko-finger-scroll.c: (parent_set_cb), (moko_finger_scroll_add), (moko_finger_scroll_dispose), (moko_finger_scroll_init), (moko_finger_scroll_mode_get_type): Fix removal of widgets from a MokoFingerScroll causing crashes/weird behaviour 2008-01-22 Chris Lord Patch by: Frank Li * Makefile.am: * bindings/python/Makefile.am: * bindings/python/moko.override: * bindings/python/mokomodule.c: (initmoko): * configure.ac: * libmokoui/Makefile.am: * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_mode_get_type): Add python bindings for MokoFingerScroll 2008-01-04 Michael Lauer * bindings/vala/libmokoui2.vapi: * bindings/vala/libmokoui2.deps: * bindings/vala/Makefile.am: * configure.ac: * Makefile.am: Add Vala Bindings 2007-12-19 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_refresh), (moko_finger_scroll_dispose): Change scrollbar calculation code, as shown in bug #1073 (thanks to Renato Filho), make sure to remove *all* source functions on dispose 2007-10-19 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_motion_notify_cb): Don't call gtk_widget_get_pointer too early 2007-10-18 Thomas Wood * libmokoui/moko-hint-entry.h: Correct a macro typo * libmokoui/moko-stock.c: * libmokoui/moko-stock.h: Add MOKO_STOCK_CALL_IGNORE 2007-10-18 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_motion_notify_cb): Call gtk_widget_get_pointer in the correct place to avoid missing motion events, as spotted by Frank Li 2007-10-15 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb): Don't alter event struct, fixes weird event flooding bug 2007-10-12 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb): Add fix for when widgets grab X after a click inside MokoFingerScroll 2007-10-08 Chris Lord * libmokoui/moko-finger-scroll.c: (get_ordered_children): Fix typo g_list_prepend instead of g_list_append 2007-10-08 Chris Lord * libmokoui/moko-finger-scroll.c: (get_ordered_children), (moko_finger_scroll_get_topmost), (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb): Import window-ordering fix from libhildondesktop, fix odd event-eating bug where only 2nd click after using MokoFingerScroll outside of a MokoFingerScroll would work 2007-10-04 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_timeout), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_dispose): Really don't allow clicks after scrolling has begun, fix crash when destroying widget while scrolling timeout is active 2007-10-01 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_get_topmost), (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb): Fix sometimes missing button-release events, fix when the clicked child window is destroyed while scrolling, don't send click inside the child when the widget has scrolled 2007-10-01 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb), (moko_finger_scroll_button_release_cb): Remove active debug statements 2007-10-01 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_get_topmost), (synth_crossing), (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_add), (moko_finger_scroll_add_with_viewport): Change the way events are synthesised to enable dragging (and thus text selection) in a scroll widget 2007-09-27 Chris Lord * libmokoui/moko-hint-entry.c: (moko_hint_entry_set_text): Make sure to reset the hinting status before setting text 2007-09-27 Thomas Wood * libmokoui/moko-hint-entry.c: * libmokoui/moko-hint-entry.h: Replace moko_hint_entry_clear() with moko_hint_entry_set_text() 2007-09-26 Thomas Wood * libmokoui/moko-stock.c: (_moko_stock_add_icon): Don't create empty GtkIconSources 2007-09-26 Thomas Wood * libmokoui/moko-stock.c: (_moko_stock_add_icon): Attempt to fix a segfault in moko_stock_register() 2007-09-25 Thomas Wood * doc/reference/tmpl/moko-stock.sgml: Add stock item documentation * libmokoui/moko-finger-scroll.c: * libmokoui/moko-hint-entry.c: * libmokoui/moko-search-bar.c: * libmokoui/moko-stock.c: Add section documentation 2007-09-25 Thomas Wood * libmokoui/moko-finger-scroll.h: Remove redunent comment * libmokoui/moko-hint-entry.c: (moko_hint_entry_class_init): Add missing documentation 2007-09-25 Chris Lord * libmokoui/moko-search-bar.c: (moko_search_bar_class_init): Document signals 2007-09-25 Thomas Wood * libmokoui/moko-finger-scroll.h: * libmokoui/moko-hint-entry.h: * libmokoui/moko-search-bar.h: Document enums and structs 2007-09-25 Thomas Wood * libmokoui/moko-finger-scroll.c: * libmokoui/moko-search-bar.c: Fix some typos in the documentation 2007-09-22 Holger Hans Peter Freyther Change the header file to be parsable by h2def.py, which will reduce the manual work needed to create bindings. * libmokoui/moko-hint-entry.h: 2007-09-21 Holger 'Siddhartha' Freyther As Thomas pointed out, don't use the deprecated gtk_object_sink but use the g_object_ref_sink method instead. * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_init): 2007-09-21 Thomas Wood * libmokoui/moko-stock.c: (_moko_stock_add_icon): Start documentation for moko-stock 2007-09-21 Thomas Wood * libmokoui/moko-hint-entry.c: (moko_hint_entry_new), (moko_hint_entry_clear): Correct and complete documentation for MokoHintEntry 2007-09-21 Thomas Wood * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_init), (moko_finger_scroll_new), (moko_finger_scroll_new_full): Complete the documentation for MokoFingerScroll 2007-09-21 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_class_init), (moko_finger_scroll_init), (moko_finger_scroll_new_full): Don't ignore 'mode' in moko_finger_scroll_new_full, fix documentation for "velocity_max" property 2007-09-21 Thomas Wood * libmokoui/moko-stock.c: (_moko_stock_add_icon): Correctly load all the available sizes for additional stock icons 2007-09-20 Thomas Wood * libmokoui/moko-search-bar.c: (moko_search_bar_init), (moko_search_bar_new), (moko_search_bar_new_with_combo), (moko_search_bar_get_combo_box), (moko_search_bar_get_entry), (moko_search_bar_search_visible): Add documentation for MokoSearchBar 2007-09-20 Thomas Wood * doc/reference/libmokoui2-docs.sgml: Add title and section name 2007-09-19 Thomas Wood * doc/reference/Makefile.am: Fix incorrect use of '+=' 2007-09-19 Thomas Wood * autogen.sh: Run gtkdocize first 2007-09-19 Thomas Wood * libmokoui/moko-hint-entry.c: * libmokoui/moko-hint-entry.h: Relicense under LGPL 2007-09-19 Thomas Wood * Makefile.am: * autogen.sh: * configure.ac: * doc/reference/Makefile.am: * doc/reference/version.xml.in Add gtk-doc support * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_init), (moko_finger_scroll_new_full): Add documentation for MokoFingerScroll 2007-09-19 Chris Lord * libmokoui/moko-hint-entry.c: (update): Don't clear entry when user-entered text matches hint text 2007-09-19 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_refresh): Take the border-width property of the container into account when calculating if scroll-indicators should be visible 2007-09-17 Thomas Wood * configure.ac: * libmokoui/Makefile.am: * libmokoui/moko-hint-entry.c: * libmokoui/moko-hint-entry.h: Add MokoHintEntry based on KotoHintEntry 2007-08-31 Chris Lord,,, * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_add_with_viewport): * libmokoui/moko-finger-scroll.h: Add moko_finger_scroll_add_with_viewport * libmokoui/moko-search-bar.c: (combo_changed_cb), (moko_search_bar_get_property), (moko_search_bar_set_property), (moko_search_bar_class_init), (moko_search_bar_init), (moko_search_bar_new), (moko_search_bar_new_with_combo), (moko_search_bar_get_combo_box), (moko_search_bar_get_entry), (moko_search_bar_search_visible), (moko_search_bar_toggle): * libmokoui/moko-search-bar.h: Don't abstract things unnecessarily 2007-08-30 Chris Lord,,, * libmokoui/moko-search-bar.c: (moko_search_bar_count_categories), (moko_search_bar_clear_categories): * libmokoui/moko-search-bar.h: Add new API to count and clear categories 2007-08-30 Holger Hans Peter Freyther Change the header file to be parsable by h2def.py, which will reduce the manual work needed to create bindings. * libmokoui/moko-search-bar.h: 2007-08-29 Chris Lord,,, * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_refresh), (moko_finger_scroll_expose_event), (moko_finger_scroll_style_set), (moko_finger_scroll_class_init), (moko_finger_scroll_init): Add a style property 'indicator-width' to set the width of the scroll indicators. 2007-08-28 Chris Lord,,, * configure.ac: * libmokoui/Makefile.am: * libmokoui/moko-search-bar.[ch]: Add new widget MokoSearchBar 2007-08-22 Holger Freyther Rubberstamped by Mickey. Change the hethat way.ader to help h2def.py find GObjects. Please keep this that way. * libmokoui/moko-finger-scroll.h: 2007-08-15 Thomas Wood * libmokoui/moko-stock.c: (_moko_stock_add_icon): Add a hack to make sure we at least have a version of the icons available at each possible GtkIconSize 2007-08-03 Holger Hans Peter Freyther Change GtkAdjustment handling to be the Gtk+ way. There is gtk_widget_set_scroll_adjustments which widgets that support scrolling indirectly implement (GtkTreeView, GtkViewport, GtkLayout). This allows to embed WebKitGtkPage which only implements the Gtk+ way of scrolling but does not export the GtkAdjustment via properties. This change was tested with the feedreader and the today app. * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_scroll): Simplify (moko_finger_scroll_expose_event): Simplify (moko_finger_scroll_destroy): Unref our GtkAdjustment (moko_finger_scroll_remove_cb): Simplify (moko_finger_scroll_add): Use gtk_widget_set_scroll_adjustments (moko_finger_scroll_class_init): Register destroy of GtkObject (moko_finger_scroll_init): Create our GtkAjdustment, use g_object_ref_sink at one point. 2007-07-29 Holger Freyther Refer to version two of the library * configure.ac: * libmokoui2.pc.in: 2007-07-28 Michael Lauer * configure.ac: * libmokoui.pc.in: * libmokoui2.pc.in: * libmokoui/Makefile.am: Bump library name and version. 2007-07-27 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_get_topmost), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_add), (moko_finger_scroll_get_property), (moko_finger_scroll_set_property), (moko_finger_scroll_class_init), (moko_finger_scroll_init): Synthesise more events so that buttons and other like widgets work. Also fix a possible infinite loop. 2007-07-13 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb), (moko_finger_scroll_refresh), (moko_finger_scroll_scroll), (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_get_topmost), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_expose_event), (moko_finger_scroll_size_request), (moko_finger_scroll_class_init), (moko_finger_scroll_init): Modularise things slightly, make sure to recalculate/redraw the scroll indicators when the child adjustments change, disconnect signals properly on remove 2007-07-13 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_size_allocate_cb): Check that the widget window exists before invalidating it 2007-07-13 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_size_allocate_cb), (moko_finger_scroll_size_request_cb): Recalculate size correctly when child resizes, and redraw 2007-07-13 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_size_allocate_cb), (moko_finger_scroll_expose_event), (moko_finger_scroll_add), (moko_finger_scroll_remove): Recalculate scroll-bar size/necessity when child resizes 2007-07-12 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_scroll), (moko_finger_scroll_button_release_cb), (moko_finger_scroll_size_allocate_cb), (moko_finger_scroll_expose_event), (moko_finger_scroll_class_init), (moko_finger_scroll_init): Don't do so much unnecessary drawing 2007-07-12 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_motion_notify_cb), (moko_finger_scroll_init): Stop motion events from queueing 2007-07-12 Chris Lord * libmokoui/moko-finger-scroll.c: (moko_finger_scroll_button_press_cb), (moko_finger_scroll_init), (moko_finger_scroll_new), (moko_finger_scroll_new_full): * libmokoui/moko-finger-scroll.h: Add licence header, don't send click event when stopping a fast scroll 2007-07-12 Chris Lord * libmokoui/moko-finger-scroll.c: * libmokoui/moko-finger-scroll.h: * libmokoui/Makefile.am: Add MokoFingerScroll, bump version 2007-07-09 Neil J. Patel * COPYING: * Makefile.am: * autogen.sh: * configure.ac: * libmokoui.pc.in: * libmokoui/Makefile.am: * libmokoui/moko-stock.c: * libmokoui/moko-stock.h: * po/Makefile.in.in: Initial import from the spilt of openmoko-libs libmokoui2-0.3+bzr20080630/Makefile.am0000644000175000001440000000053510776321216016333 0ustar stevenusersSUBDIRS = libmokoui bindings/vala doc $(PYTHON_BIND_DIR) pcdata_DATA= libmokoui2.pc pcdatadir= $(libdir)/pkgconfig EXTRA_DIST= $(pcdata_DATA) # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing config.h.in libmokoui2-0.3+bzr20080630/NEWS0000644000175000001440000000000010776321216014761 0ustar stevenuserslibmokoui2-0.3+bzr20080630/README0000644000175000001440000000000010776321216015142 0ustar stevenuserslibmokoui2-0.3+bzr20080630/autogen.sh0000755000175000001440000000022410776321216016273 0ustar stevenusers#! /bin/sh gtkdocize || exit 1 autoreconf -v --install || exit 1 glib-gettextize --force --copy || exit 1 ./configure --enable-maintainer-mode "$@" libmokoui2-0.3+bzr20080630/bindings/0000755000175000001440000000000010776321216016071 5ustar stevenuserslibmokoui2-0.3+bzr20080630/bindings/python/0000755000175000001440000000000010776321216017412 5ustar stevenuserslibmokoui2-0.3+bzr20080630/bindings/python/Makefile.am0000644000175000001440000000163410776321216021452 0ustar stevenusers PY_DEFS=`pkg-config --variable=defsdir pygtk-2.0` PYTHON_INCLUDES=-I/usr/include/python${PYTHON_VERSION} CLEANFILES = \ mokoui.defs \ mokoui.c mokoui.defs: ../../libmokoui/moko-finger-scroll.h python /usr/share/pygtk/2.0/codegen/h2def.py ../../libmokoui/moko-finger-scroll.h > mokoui.defs mokoui.c: mokoui.defs mokoui.override pygtk-codegen-2.0 --prefix mokoui \ --register $(PY_DEFS)/gdk-types.defs \ --register $(PY_DEFS)/gtk-types.defs \ --override mokoui.override \ mokoui.defs > $@ pyexec_LTLIBRARIES = mokoui.la mokoui_la_SOURCES = mokoui.c mokouimodule.c # set the include path found by configure INCLUDES= $(all_includes) AM_CPPFLAGS = $(PYTHON_INCLUDES) $(GTK_CFLAGS) $(PYGDK_CFLAGS) $(PYGOB_CFLAGS) -I../../libmokoui/ # the library search path. mokoui_la_LDFLAGS = -module -avoid-version $(all_libraries) $(GTK_LIBS) $(PYGDK_LIBS) $(PYGOB_LIBS) ../../libmokoui/libmokoui2.la libmokoui2-0.3+bzr20080630/bindings/python/mokoui.override0000644000175000001440000000034010776321216022453 0ustar stevenusers%% headers #include "pygobject.h" #include "moko-finger-scroll.h" #include "moko-type.h" %% modulename mokoui %% import gtk.EventBox as PyGtkEventBox_Type import gtk.Widget as PyGtkWidget_Type %% ignore-glob *_get_type %% libmokoui2-0.3+bzr20080630/bindings/python/mokouimodule.c0000644000175000001440000000063010776321216022266 0ustar stevenusers#include void mokoui_register_classes (PyObject *d); extern PyMethodDef mokoui_functions[]; DL_EXPORT(void) initmokoui(void) { PyObject *m, *d; init_pygobject (); m = Py_InitModule ("mokoui", mokoui_functions); d = PyModule_GetDict (m); mokoui_register_classes (d); if (PyErr_Occurred ()) { Py_FatalError ("can't initialise module mokoui"); } } libmokoui2-0.3+bzr20080630/bindings/vala/0000755000175000001440000000000010776321216017014 5ustar stevenuserslibmokoui2-0.3+bzr20080630/bindings/vala/Makefile.am0000644000175000001440000000021710776321216021050 0ustar stevenusersNULL = vapidir = $(datadir)/vala/vapi dist_vapi_DATA = \ libmokoui2.vapi \ libmokoui2.deps \ $(NULL) MAINTAINERCLEANFILES = Makefile.in libmokoui2-0.3+bzr20080630/bindings/vala/libmokoui2.deps0000644000175000001440000000004110776321216021740 0ustar stevenusersgdk-2.0 gtk+-2.0 atk pango cairo libmokoui2-0.3+bzr20080630/bindings/vala/libmokoui2.vapi0000644000175000001440000000745710776321216021766 0ustar stevenusers/* libmokoui2.vapi * * Author: Michael 'Mickey' Lauer * Copyright (C) 2008 OpenMoko, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ [CCode (cprefix = "Moko", lower_case_cprefix = "moko_")] namespace Moko { [CCode (cprefix = "MOKO_FINGER_SCROLL_MODE_", cheader_filename = "libmokoui2.h")] public enum FingerScrollMode { PUSH, ACCEL, } [CCode (cheader_filename = "moko-finger-scroll.h")] public class FingerScroll : Gtk.EventBox { public weak Gtk.EventBox parent; public void add_with_viewport (Gtk.Widget child); public FingerScroll (); public FingerScroll.full (int mode, bool enabled, double vel_min, double vel_max, double decel, uint sps); } [CCode (cheader_filename = "moko-finger-scroll.h")] public class FingerScrollClass { public pointer parent_class; } [CCode (cheader_filename = "moko-hint-entry.h")] public class HintEntry : Gtk.Entry { public weak Gtk.Entry parent; public bool is_empty (); public HintEntry (string hint); public void set_text (string text); } [CCode (cheader_filename = "moko-hint-entry.h")] public class HintEntryClass { public pointer parent_class; } [CCode (cheader_filename = "moko-search-bar.h")] public class SearchBar : Gtk.HBox { public weak Gtk.HBox parent; public weak Gtk.ComboBox get_combo_box (); public weak Gtk.Entry get_entry (); public SearchBar (); public SearchBar.with_combo (Gtk.ComboBox combo); public bool search_visible (); public void toggle (); } [CCode (cheader_filename = "moko-search-bar.h")] public class SearchBarClass { public pointer parent_class; public GLib.Callback toggled; public GLib.Callback text_changed; public GLib.Callback combo_changed; } public const string STOCK_CALL_ANSWER; public const string STOCK_CALL_DIAL; public const string STOCK_CALL_DIALED; public const string STOCK_CALL_HANGUP; public const string STOCK_CALL_HISTORY; public const string STOCK_CALL_HOLD; public const string STOCK_CALL_IGNORE; public const string STOCK_CALL_IN; public const string STOCK_CALL_MISSED; public const string STOCK_CALL_REDIAL; public const string STOCK_CALL_REJECT; public const string STOCK_CONTACT_ADDRESS; public const string STOCK_CONTACT_DELETE; public const string STOCK_CONTACT_EMAIL; public const string STOCK_CONTACT_GROUPS; public const string STOCK_CONTACT_MODE; public const string STOCK_CONTACT_NEW; public const string STOCK_CONTACT_PHONE; public const string STOCK_FOLDER_DELETE; public const string STOCK_FOLDER_NEW; public const string STOCK_HANDSET; public const string STOCK_HISTORY; public const string STOCK_MAIL_DELETE; public const string STOCK_MAIL_FORWARD; public const string STOCK_MAIL_MARK_READ; public const string STOCK_MAIL_NEW; public const string STOCK_MAIL_READ; public const string STOCK_MAIL_REPLY_ALL; public const string STOCK_MAIL_REPLY_SENDER; public const string STOCK_MAIL_SEND; public const string STOCK_MAIL_SEND_RECEIVE; public const string STOCK_PHONE_BOOK; public const string STOCK_SEARCH; public const string STOCK_SMS_NEW; public const string STOCK_SPEAKER; public const string STOCK_VIEW; public static void stock_register (); } libmokoui2-0.3+bzr20080630/configure.ac0000644000175000001440000000260010776321216016560 0ustar stevenusersAC_PREREQ(2.53) AC_INIT(libmokoui2, 0.3, http://www.openmoko.org/) AM_INIT_AUTOMAKE() AC_CONFIG_SRCDIR(libmokoui/moko-stock.c) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_STDC_HEADERS AC_PROG_LIBTOOL GTK_VERSION=2.6 dnl i18n support GETTEXT_PACKAGE=libmokoui AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package]) AC_SUBST(GETTEXT_PACKAGE) AM_GLIB_GNU_GETTEXT # base deps PKG_CHECK_MODULES(DEPS, gtk+-2.0) AC_ARG_ENABLE(python, [ --enable-python enable python binding [default=no]], enable_python=$enableval, enable_python=no) if test $enable_python != no ; then AM_PATH_PYTHON(2.3.5) PKG_CHECK_MODULES(GNOME_PYTHON, gnome-python-2.0 >= 2.10.00) AC_SUBST(PYGDK_CFLAGS) AC_SUBST(PYGDK_LIBS) PKG_CHECK_MODULES(PYGOB, pygobject-2.0 >= 2.11.0) AC_SUBST(PYGOB_CFLAGS) AC_SUBST(PYGOB_LIBS) PYTHON_BIND_DIR=bindings/python AC_SUBST(PYTHON_BIND_DIR) fi if test x$MOKO_DEVEL = xon ; then AC_MSG_NOTICE([removing -O2 from CFLAGS]) CFLAGS="-g -Wall" fi LIBS="$LIBS $DEPS_LIBS" CFLAGS="$CFLAGS $DEPS_CFLAGS" AC_SUBST(LIBS) GTK_DOC_CHECK([1.4]) # output stuff AC_OUTPUT([ Makefile libmokoui2.pc libmokoui/Makefile bindings/vala/Makefile doc/Makefile doc/reference/Makefile doc/reference/version.xml bindings/python/Makefile ]) echo "CFLAGS = $CFLAGS" echo "PREFIX = $prefix" echo "LIBS = $LIBS" libmokoui2-0.3+bzr20080630/doc/0000755000175000001440000000000010776321216015041 5ustar stevenuserslibmokoui2-0.3+bzr20080630/doc/reference/0000755000175000001440000000000010776321216016777 5ustar stevenuserslibmokoui2-0.3+bzr20080630/doc/reference/tmpl/0000755000175000001440000000000010776321216017753 5ustar stevenuserslibmokoui2-0.3+bzr20080630/doc/reference/tmpl/moko-stock.sgml0000644000175000001440000000673610776321216022741 0ustar stevenusers moko-stock The "Answer" item The "Dial" item The "Dialed History" item The "Hangup" item The "Call History" item The "Hold" item The "Incoming Call" item The "Call Missed" item The "Redial" item The "Reject Call" item The "Contact Address" item The "Delete Contact" item The "Contact E-Mail" item The "Contact Groups" item The "Contact Mode" item The "New Contact" item The "Contact Phone Number" item The "Delete Folder" item The "New Folder" item The "History" item The "Delete Mail" item The "Forward Mail" item The "Mark Read" item The "New Mail" item The "Read Mail" item The "Reply to All" item The "Reply to Sender" item The "Send Mail" item The "Send and Receive" item The "Phone Book" item The "Search" item The "New SMS" item The "Speaker" item The "Handset" item The "View" item libmokoui2-0.3+bzr20080630/doc/reference/Makefile.am0000644000175000001440000000534510776321216021042 0ustar stevenusers## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libmokoui2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=../../libmokoui # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/libmokoui/*.h CFILE_GLOB=$(top_srcdir)/libmokoui/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES=-I$(top_srcdir)/src -I$(top_builddir) $(CFLAGS) GTKDOC_LIBS=$(top_srcdir)/libmokoui/libmokoui2.la $(LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = version.xml.in libmokoui2-0.3+bzr20080630/doc/reference/libmokoui2-docs.sgml0000644000175000001440000000104710776321216022667 0ustar stevenusers libmokoui Reference Manual libmokoui2 libmokoui2-0.3+bzr20080630/doc/reference/version.xml.in0000644000175000001440000000001210776321216021604 0ustar stevenusers@VERSION@ libmokoui2-0.3+bzr20080630/doc/Makefile.am0000644000175000001440000000002210776321216017067 0ustar stevenusersSUBDIRS=reference libmokoui2-0.3+bzr20080630/libmokoui/0000755000175000001440000000000011032043232016247 5ustar stevenuserslibmokoui2-0.3+bzr20080630/libmokoui/Makefile.am0000644000175000001440000000112110776321216020315 0ustar stevenuserssource_h = \ moko-stock.h \ moko-finger-scroll.h \ moko-search-bar.h \ moko-hint-entry.h \ moko-type.h source_c = \ moko-stock.c \ moko-finger-scroll.c \ moko-search-bar.c \ moko-hint-entry.c DATADIR=$(datadir) AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \ -DPKGDATADIR=\"$(pkgdatadir)\" AM_CFLAGS = -Wall -pedantic -std=c99 lib_LTLIBRARIES = libmokoui2.la libmokoui2_la_SOURCES = $(source_c) $(source_h) libmokoui2_la_LIBADD = libmokoui2_la_LDFLAGS = -version-info 0:2:0 libmokouiheadersdir = $(includedir)/libmokoui2 libmokouiheaders_DATA = $(source_h) libmokoui2-0.3+bzr20080630/libmokoui/moko-finger-scroll.c0000644000175000001440000007573311032043231022142 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by Chris Lord * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ /** * SECTION: moko-finger-scroll * @short_description: A scrolling widget designed for touch screens * @see_also: #GtkScrolledWindow * * #MokoFingerScroll implements a scrolled window designed to be used with a * touch screen interface. The user scrolls the child widget by activating the * pointing device and dragging it over the widget. * */ /* TODO: * - Scroll policies * - Delay click mode (only send synthetic clicks on mouse-up, as in previous * versions. * - 'Physical' mode for acceleration scrolling */ #include #include "moko-finger-scroll.h" G_DEFINE_TYPE (MokoFingerScroll, moko_finger_scroll, GTK_TYPE_EVENT_BOX) #define FINGER_SCROLL_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MOKO_TYPE_FINGER_SCROLL, \ MokoFingerScrollPrivate)) typedef struct _MokoFingerScrollPrivate MokoFingerScrollPrivate; struct _MokoFingerScrollPrivate { MokoFingerScrollMode mode; gdouble x; /* Used to store mouse co-ordinates of the first or */ gdouble y; /* previous events in a press-motion pair */ gdouble ex; /* Used to store mouse co-ordinates of the last */ gdouble ey; /* motion event in acceleration mode */ gboolean enabled; gboolean clicked; guint32 last_time; /* Last event time, to stop infinite loops */ gint last_type; gboolean moved; GTimeVal click_start; GTimeVal last_click; gdouble vmin; gdouble vmax; gdouble decel; guint sps; gdouble vel_x; gdouble vel_y; GdkWindow *child; gint ix; /* Initial click mouse co-ordinates */ gint iy; gint cx; /* Initial click child window mouse co-ordinates */ gint cy; guint idle_id; GtkWidget *align; gboolean hscroll; gboolean vscroll; GdkRectangle hscroll_rect; GdkRectangle vscroll_rect; guint scroll_width; GtkAdjustment *hadjust; GtkAdjustment *vadjust; gdouble click_x; gdouble click_y; guint event_mode; MokoFingerScrollIndicatorMode vindicator_mode; MokoFingerScrollIndicatorMode hindicator_mode; }; enum { PROP_ENABLED = 1, PROP_MODE, PROP_VELOCITY_MIN, PROP_VELOCITY_MAX, PROP_DECELERATION, PROP_SPS, PROP_VINDICATOR, PROP_HINDICATOR, }; static gdouble moko_get_time_delta (GTimeVal *start, GTimeVal *end) { gdouble x, y; x = start->tv_sec; x *= 1000000; x += start->tv_usec; y = end->tv_sec; y *= 1000000; y += end->tv_usec; return y-x; } /* Following function inherited from libhildondesktop */ static GList * get_ordered_children (GdkWindow *window) { Window *children, root, parent; guint i, n_children = 0; GList *ret = NULL; gdk_error_trap_push (); XQueryTree (GDK_DISPLAY (), GDK_WINDOW_XID (window), &root, &parent, &children, &n_children); if (gdk_error_trap_pop ()) return NULL; for (i = 0; i < n_children; i++) { GdkWindow *window = gdk_window_lookup (children[i]); if (window) ret = g_list_append (ret, window); } XFree (children); return ret; } static GdkWindow * moko_finger_scroll_get_topmost (GdkWindow *window, gint x, gint y, gint *tx, gint *ty) { /* Find the GdkWindow at the given point, by recursing from a given * parent GdkWindow. Optionally return the co-ordinates transformed * relative to the child window. */ gint width, height; gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height); if ((x < 0) || (x >= width) || (y < 0) || (y >= height)) return NULL; /*g_debug ("Finding window at (%d, %d) in %p", x, y, window);*/ while (window) { gint child_x = 0, child_y = 0; GList *c, *children = get_ordered_children (window); GdkWindow *old_window = window; for (c = children; c; c = c->next) { GdkWindow *child = (GdkWindow *)c->data; gint wx, wy; gdk_window_get_geometry (child, &wx, &wy, &width, &height, NULL); /*g_debug ("Child: %p, (%dx%d+%d,%d)", child, width, height, wx, wy);*/ if ((x >= wx) && (x < (wx + width)) && (y >= wy) && (y < (wy + height))) { child_x = x - wx; child_y = y - wy; window = child; } } g_list_free (children); /*g_debug ("\\|/");*/ if (window == old_window) break; x = child_x; y = child_y; } if (tx) *tx = x; if (ty) *ty = y; /*g_debug ("Returning: %p", window);*/ return window; } static void synth_crossing (GdkWindow *child, gint x, gint y, gint x_root, gint y_root, guint32 time, gboolean in) { GdkEventCrossing *crossing_event; GdkEventType type = in ? GDK_ENTER_NOTIFY : GDK_LEAVE_NOTIFY; /* Send synthetic enter event */ crossing_event = (GdkEventCrossing *)gdk_event_new (type); ((GdkEventAny *)crossing_event)->type = type; ((GdkEventAny *)crossing_event)->window = g_object_ref (child); ((GdkEventAny *)crossing_event)->send_event = FALSE; crossing_event->subwindow = g_object_ref (child); crossing_event->time = time; crossing_event->x = x; crossing_event->y = y; crossing_event->x_root = x_root; crossing_event->y_root = y_root; crossing_event->mode = GDK_CROSSING_NORMAL; crossing_event->detail = GDK_NOTIFY_UNKNOWN; crossing_event->focus = FALSE; crossing_event->state = 0; gdk_event_put ((GdkEvent *)crossing_event); gdk_event_free ((GdkEvent *)crossing_event); } static gboolean moko_finger_scroll_button_press_cb (MokoFingerScroll *scroll, GdkEventButton *event, gpointer user_data) { gint x, y; MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); if ((!priv->enabled) || (event->button != 1) || ((event->time == priv->last_time) && (priv->last_type == 1))) return TRUE; priv->last_time = event->time; priv->last_type = 1; priv->click_x = event->x; priv->click_y = event->y; if (priv->clicked && priv->child) { /* Widget stole focus on last click, send crossing-out event */ synth_crossing (priv->child, 0, 0, event->x_root, event->y_root, event->time, FALSE); } g_get_current_time (&priv->click_start); priv->x = event->x; priv->y = event->y; priv->ix = priv->x; priv->iy = priv->y; /* Don't allow a click if we're still moving fast, where fast is * defined as a quarter of our top possible speed. * TODO: Make 'fast' configurable? */ if ((ABS (priv->vel_x) < (priv->vmax * 0.25)) && (ABS (priv->vel_y) < (priv->vmax * 0.25))) priv->child = moko_finger_scroll_get_topmost ( GTK_BIN (priv->align)->child->window, event->x, event->y, &x, &y); else priv->child = NULL; priv->clicked = TRUE; /* Stop scrolling on mouse-down (so you can flick, then hold to stop) */ priv->vel_x = 0; priv->vel_y = 0; if ((priv->child) && (priv->child != GTK_BIN ( priv->align)->child->window)) { g_object_add_weak_pointer ((GObject *)priv->child, &priv->child); event = (GdkEventButton *)gdk_event_copy ((GdkEvent *)event); event->x = x; event->y = y; priv->cx = x; priv->cy = y; synth_crossing (priv->child, x, y, event->x_root, event->y_root, event->time, TRUE); /* Send synthetic click (button press/release) event */ ((GdkEventAny *)event)->window = g_object_ref (priv->child); gdk_event_put ((GdkEvent *)event); gdk_event_free ((GdkEvent *)event); } else priv->child = NULL; return TRUE; } static void moko_finger_scroll_redraw (MokoFingerScroll *scroll) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); /* Redraw scroll indicators */ if (priv->hscroll) { if (GTK_WIDGET (scroll)->window) { gdk_window_invalidate_rect (GTK_WIDGET (scroll)->window, &priv->hscroll_rect, FALSE); } } if (priv->vscroll) { if (GTK_WIDGET (scroll)->window) { gdk_window_invalidate_rect (GTK_WIDGET (scroll)->window, &priv->vscroll_rect, FALSE); } } } static void moko_finger_scroll_refresh (MokoFingerScroll *scroll) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); GtkWidget *widget = GTK_BIN (priv->align)->child; gboolean vscroll, hscroll; if (!widget) return; /* Calculate if we need scroll indicators */ gtk_widget_size_request (widget, NULL); switch (priv->hindicator_mode) { case MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW : hscroll = TRUE; break; case MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE : hscroll = FALSE; break; default : hscroll = (priv->hadjust->upper - priv->hadjust->lower > priv->hadjust->page_size) ? TRUE : FALSE; } switch (priv->vindicator_mode) { case MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW : vscroll = TRUE; break; case MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE : vscroll = FALSE; break; default : vscroll = (priv->vadjust->upper - priv->vadjust->lower > priv->vadjust->page_size) ? TRUE : FALSE; } /* TODO: Read ltr settings to decide which corner gets scroll * indicators? */ if ((priv->vscroll != vscroll) || (priv->hscroll != hscroll)) { gtk_alignment_set_padding (GTK_ALIGNMENT (priv->align), 0, hscroll ? priv->scroll_width : 0, 0, vscroll ? priv->scroll_width : 0); } /* Store the vscroll/hscroll areas for redrawing */ if (vscroll) { GtkAllocation *allocation = >K_WIDGET (scroll)->allocation; priv->vscroll_rect.x = allocation->x + allocation->width - priv->scroll_width; priv->vscroll_rect.y = allocation->y; priv->vscroll_rect.width = priv->scroll_width; priv->vscroll_rect.height = allocation->height - (hscroll ? priv->scroll_width : 0); } if (hscroll) { GtkAllocation *allocation = >K_WIDGET (scroll)->allocation; priv->hscroll_rect.y = allocation->y + allocation->height - priv->scroll_width; priv->hscroll_rect.x = allocation->x; priv->hscroll_rect.height = priv->scroll_width; priv->hscroll_rect.width = allocation->width - (vscroll ? priv->scroll_width : 0); } priv->vscroll = vscroll; priv->hscroll = hscroll; moko_finger_scroll_redraw (scroll); } static void moko_finger_scroll_scroll (MokoFingerScroll *scroll, gdouble x, gdouble y, gboolean *sx, gboolean *sy) { /* Scroll by a particular amount (in pixels). Optionally, return if * the scroll on a particular axis was successful. */ gdouble h, v; MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); if (!GTK_BIN (priv->align)->child) return; if (priv->hadjust) { h = gtk_adjustment_get_value (priv->hadjust) - x; if (h > priv->hadjust->upper - priv->hadjust->page_size) { if (sx) *sx = FALSE; h = priv->hadjust->upper - priv->hadjust->page_size; } else if (h < priv->hadjust->lower) { if (sx) *sx = FALSE; h = priv->hadjust->lower; } else if (sx) *sx = TRUE; gtk_adjustment_set_value (priv->hadjust, h); } if (priv->vadjust) { v = gtk_adjustment_get_value (priv->vadjust) - y; if (v > priv->vadjust->upper - priv->vadjust->page_size) { if (sy) *sy = FALSE; v = priv->vadjust->upper - priv->vadjust->page_size; } else if (v < priv->vadjust->lower) { if (sy) *sy = FALSE; v = priv->vadjust->lower; } else if (sy) *sy = TRUE; gtk_adjustment_set_value (priv->vadjust, v); } moko_finger_scroll_redraw (scroll); } static gboolean moko_finger_scroll_timeout (MokoFingerScroll *scroll) { gboolean sx, sy; MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); if ((!priv->enabled) || (priv->mode == MOKO_FINGER_SCROLL_MODE_PUSH)) { priv->idle_id = 0; return FALSE; } if (!priv->clicked) { /* Decelerate gradually when pointer is raised */ priv->vel_x *= priv->decel; priv->vel_y *= priv->decel; if ((ABS (priv->vel_x) < 1.0) && (ABS (priv->vel_y) < 1.0)) { priv->idle_id = 0; return FALSE; } } else if (priv->mode == MOKO_FINGER_SCROLL_MODE_AUTO) { return TRUE; } moko_finger_scroll_scroll (scroll, priv->vel_x, priv->vel_y, &sx, &sy); /* If the scroll on a particular axis wasn't succesful, reset the * initial scroll position to the new mouse co-ordinate. This means * when you get to the top of the page, dragging down works immediately. */ if (!sx) priv->x = priv->ex; if (!sy) priv->y = priv->ey; return TRUE; } static gboolean moko_finger_scroll_motion_notify_cb (MokoFingerScroll *scroll, GdkEventMotion *event, gpointer user_data) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); gint dnd_threshold; gdouble x, y; if ((!priv->enabled) || (!priv->clicked) || ((event->time == priv->last_time) && (priv->last_type == 2))) { gdk_window_get_pointer ( GTK_WIDGET (scroll)->window, NULL, NULL, 0); return TRUE; } /* Only start the scroll if the mouse cursor passes beyond the * DnD threshold for dragging. */ g_object_get (G_OBJECT (gtk_settings_get_default ()), "gtk-dnd-drag-threshold", &dnd_threshold, NULL); x = event->x - priv->x; y = event->y - priv->y; if ((!priv->moved) && ( (ABS (x) > dnd_threshold) || (ABS (y) > dnd_threshold))) { priv->moved = TRUE; if (priv->mode != MOKO_FINGER_SCROLL_MODE_PUSH) { priv->idle_id = g_timeout_add ( (gint)(1000.0/(gdouble)priv->sps), (GSourceFunc)moko_finger_scroll_timeout, scroll); } } if (priv->moved) { switch (priv->mode) { case MOKO_FINGER_SCROLL_MODE_PUSH : /* Scroll by the amount of pixels the cursor has moved * since the last motion event. */ moko_finger_scroll_scroll (scroll, x, y, NULL, NULL); priv->x = event->x; priv->y = event->y; break; case MOKO_FINGER_SCROLL_MODE_ACCEL : /* Set acceleration relative to the initial click */ priv->ex = event->x; priv->ey = event->y; priv->vel_x = ((x > 0) ? 1 : -1) * (((ABS (x) / (gdouble)GTK_WIDGET (scroll)-> allocation.width) * (priv->vmax-priv->vmin)) + priv->vmin); priv->vel_y = ((y > 0) ? 1 : -1) * (((ABS (y) / (gdouble)GTK_WIDGET (scroll)-> allocation.height) * (priv->vmax-priv->vmin)) + priv->vmin); break; case MOKO_FINGER_SCROLL_MODE_AUTO: moko_finger_scroll_scroll (scroll, x, y, NULL, NULL); priv->x = event->x; priv->y = event->y; break; default : break; } } if (priv->child) { /* Send motion notify to child */ priv->last_time = event->time; priv->last_type = 2; event = (GdkEventMotion *)gdk_event_copy ((GdkEvent *)event); event->x = priv->cx + (event->x - priv->ix); event->y = priv->cy + (event->y - priv->iy); event->window = g_object_ref (priv->child); gdk_event_put ((GdkEvent *)event); gdk_event_free ((GdkEvent *)event); } gdk_window_get_pointer (GTK_WIDGET (scroll)->window, NULL, NULL, 0); return TRUE; } static gboolean moko_finger_scroll_button_release_cb (MokoFingerScroll *scroll, GdkEventButton *event, gpointer user_data) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (scroll); GTimeVal current; gint x, y; GdkWindow *child; gdouble delta, speed_x, speed_y; if ((!priv->clicked) || (!priv->enabled) || (event->button != 1) || ((event->time == priv->last_time) && (priv->last_type == 3))) return TRUE; priv->last_time = event->time; priv->last_type = 3; g_get_current_time (¤t); priv->clicked = FALSE; if (priv->mode == MOKO_FINGER_SCROLL_MODE_AUTO) { delta = moko_get_time_delta (&priv->click_start, ¤t); speed_x = event->x - priv->click_x; speed_y = event->y - priv->click_y; speed_x = speed_x * 1000000 / delta; speed_y = speed_y * 1000000 / delta; priv->vel_x = speed_x * (gdouble)priv->sps / 1000; priv->vel_y = speed_y * (gdouble)priv->sps / 1000; /*if( ABS(priv->vel_x )<20) { priv->vel_x = 0; } if(ABS(priv->vel_y )<20) { priv->vel_y = 0; }*/ } child = moko_finger_scroll_get_topmost ( GTK_BIN (priv->align)->child->window, event->x, event->y, &x, &y); if (!priv->child) { priv->moved = FALSE; return TRUE; } event = (GdkEventButton *)gdk_event_copy ((GdkEvent *)event); event->x = x; event->y = y; /* Leave the widget if we've moved - This doesn't break selection, * but stops buttons from being clicked. */ if ((child != priv->child) || (priv->moved)) { /* Send synthetic leave event */ synth_crossing (priv->child, x, y, event->x_root, event->y_root, event->time, FALSE); /* Send synthetic button release event */ ((GdkEventAny *)event)->window = g_object_ref (priv->child); gdk_event_put ((GdkEvent *)event); } else { /* Send synthetic button release event */ ((GdkEventAny *)event)->window = g_object_ref (child); gdk_event_put ((GdkEvent *)event); /* Send synthetic leave event */ synth_crossing (priv->child, x, y, event->x_root, event->y_root, event->time, FALSE); } g_object_remove_weak_pointer ((GObject *)priv->child, &priv->child); priv->moved = FALSE; gdk_event_free ((GdkEvent *)event); return TRUE; } static gboolean moko_finger_scroll_expose_event (GtkWidget *widget, GdkEventExpose *event) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (widget); if (GTK_BIN (priv->align)->child) { if (priv->vscroll) { gint y, height; gdk_draw_rectangle (widget->window, widget->style->fg_gc[GTK_STATE_INSENSITIVE], TRUE, priv->vscroll_rect.x, priv->vscroll_rect.y, priv->vscroll_rect.width, priv->vscroll_rect.height); y = widget->allocation.y + ((priv->vadjust->value/priv->vadjust->upper)* (widget->allocation.height - (priv->hscroll ? priv->scroll_width : 0))); height = (widget->allocation.y + (((priv->vadjust->value + priv->vadjust->page_size)/ priv->vadjust->upper)* (widget->allocation.height - (priv->hscroll ? priv->scroll_width : 0)))) - y; gdk_draw_rectangle (widget->window, widget->style->base_gc[GTK_STATE_SELECTED], TRUE, priv->vscroll_rect.x, y, priv->vscroll_rect.width, height); } if (priv->hscroll) { gint x, width; gdk_draw_rectangle (widget->window, widget->style->fg_gc[GTK_STATE_INSENSITIVE], TRUE, priv->hscroll_rect.x, priv->hscroll_rect.y, priv->hscroll_rect.width, priv->hscroll_rect.height); x = widget->allocation.x + ((priv->hadjust->value/priv->hadjust->upper)* (widget->allocation.width - (priv->vscroll ? priv->scroll_width : 0))); width = (widget->allocation.x + (((priv->hadjust->value + priv->hadjust->page_size)/ priv->hadjust->upper)* (widget->allocation.width - (priv->vscroll ? priv->scroll_width : 0)))) - x; gdk_draw_rectangle (widget->window, widget->style->base_gc[GTK_STATE_SELECTED], TRUE, x, priv->hscroll_rect.y, width, priv->hscroll_rect.height); } } return GTK_WIDGET_CLASS ( moko_finger_scroll_parent_class)->expose_event (widget, event); } static void moko_finger_scroll_destroy (GtkObject *object) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (object); if (priv->hadjust) { g_object_unref (G_OBJECT (priv->hadjust)); priv->hadjust = NULL; } if (priv->vadjust) { g_object_unref (G_OBJECT (priv->vadjust)); priv->vadjust = NULL; } GTK_OBJECT_CLASS (moko_finger_scroll_parent_class)->destroy (object); } static void parent_set_cb (GtkWidget *widget, GtkObject *parent, MokoFingerScroll *scroll) { if (!parent) { g_signal_handlers_disconnect_by_func (widget, moko_finger_scroll_refresh, scroll); g_signal_handlers_disconnect_by_func (widget, gtk_widget_queue_resize, scroll); g_signal_handlers_disconnect_by_func (widget, parent_set_cb, scroll); gtk_widget_set_scroll_adjustments (widget, NULL, NULL); } } static void moko_finger_scroll_add (GtkContainer *container, GtkWidget *child) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (container); gtk_container_add (GTK_CONTAINER (priv->align), child); g_signal_connect_swapped (child, "size-allocate", G_CALLBACK (moko_finger_scroll_refresh), container); g_signal_connect_swapped (child, "size-request", G_CALLBACK (gtk_widget_queue_resize), container); g_signal_connect (child, "parent-set", G_CALLBACK (parent_set_cb), container); if (!gtk_widget_set_scroll_adjustments ( child, priv->hadjust, priv->vadjust)) g_warning("%s: cannot add non scrollable widget, " "wrap it in a viewport", __FUNCTION__); } static void moko_finger_scroll_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (object); switch (property_id) { case PROP_ENABLED : g_value_set_boolean (value, priv->enabled); break; case PROP_MODE : g_value_set_enum (value, priv->mode); break; case PROP_VELOCITY_MIN : g_value_set_double (value, priv->vmin); break; case PROP_VELOCITY_MAX : g_value_set_double (value, priv->vmax); break; case PROP_DECELERATION : g_value_set_double (value, priv->decel); break; case PROP_SPS : g_value_set_uint (value, priv->sps); break; case PROP_VINDICATOR: g_value_set_enum (value, priv->vindicator_mode); break; case PROP_HINDICATOR: g_value_set_enum (value, priv->hindicator_mode); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_finger_scroll_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (object); switch (property_id) { case PROP_ENABLED : priv->enabled = g_value_get_boolean (value); gtk_event_box_set_above_child ( GTK_EVENT_BOX (object), priv->enabled); break; case PROP_MODE : priv->mode = g_value_get_enum (value); break; case PROP_VELOCITY_MIN : priv->vmin = g_value_get_double (value); break; case PROP_VELOCITY_MAX : priv->vmax = g_value_get_double (value); break; case PROP_DECELERATION : priv->decel = g_value_get_double (value); break; case PROP_SPS : priv->sps = g_value_get_uint (value); break; case PROP_VINDICATOR: priv->vindicator_mode = g_value_get_enum (value); break; case PROP_HINDICATOR: priv->hindicator_mode = g_value_get_enum (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_finger_scroll_dispose (GObject * object) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (object); if (priv->hadjust) { g_object_unref (priv->hadjust); priv->hadjust = NULL; } if (priv->vadjust) { g_object_unref (priv->vadjust); priv->vadjust = NULL; } if (G_OBJECT_CLASS (moko_finger_scroll_parent_class)->dispose) G_OBJECT_CLASS (moko_finger_scroll_parent_class)-> dispose (object); } static void moko_finger_scroll_finalize (GObject * object) { G_OBJECT_CLASS (moko_finger_scroll_parent_class)->finalize (object); } static void moko_finger_scroll_size_request (GtkWidget *widget, GtkRequisition *requisition) { /* Request tiny size, seeing as we have no decoration of our own. */ requisition->width = 32; requisition->height = 32; } static void moko_finger_scroll_style_set (GtkWidget *widget, GtkStyle *previous_style) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (widget); GTK_WIDGET_CLASS (moko_finger_scroll_parent_class)-> style_set (widget, previous_style); gtk_widget_style_get (widget, "indicator-width", &priv->scroll_width, NULL); } static void moko_finger_scroll_class_init (MokoFingerScrollClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); g_type_class_add_private (klass, sizeof (MokoFingerScrollPrivate)); object_class->get_property = moko_finger_scroll_get_property; object_class->set_property = moko_finger_scroll_set_property; object_class->dispose = moko_finger_scroll_dispose; object_class->finalize = moko_finger_scroll_finalize; gtkobject_class->destroy = moko_finger_scroll_destroy; widget_class->size_request = moko_finger_scroll_size_request; widget_class->expose_event = moko_finger_scroll_expose_event; widget_class->style_set = moko_finger_scroll_style_set; container_class->add = moko_finger_scroll_add; g_object_class_install_property ( object_class, PROP_ENABLED, g_param_spec_boolean ( "enabled", "Enabled", "Enable or disable finger-scroll.", TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_VINDICATOR, g_param_spec_enum ( "vindicator_mode", "vindicator mode", "Mode of the vertical scrolling indicator", MOKO_TYPE_FINGER_SCROLL_INDICATOR_MODE, MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_HINDICATOR, g_param_spec_enum ( "hindicator_mode", "hindicator mode", "Mode of the horizontal scrolling indicator", MOKO_TYPE_FINGER_SCROLL_INDICATOR_MODE, MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_MODE, g_param_spec_enum ( "mode", "Scroll mode", "Change the finger-scrolling mode.", MOKO_TYPE_FINGER_SCROLL_MODE, MOKO_FINGER_SCROLL_MODE_ACCEL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_VELOCITY_MIN, g_param_spec_double ( "velocity_min", "Minimum scroll velocity", "Minimum distance the child widget should scroll " "per 'frame', in pixels.", 0, G_MAXDOUBLE, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_VELOCITY_MAX, g_param_spec_double ( "velocity_max", "Maximum scroll velocity", "Maximum distance the child widget should scroll " "per 'frame', in pixels.", 0, G_MAXDOUBLE, 48, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_DECELERATION, g_param_spec_double ( "deceleration", "Deceleration multiplier", "The multiplier used when decelerating when in " "acceleration scrolling mode.", 0, 1.0, 0.95, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property ( object_class, PROP_SPS, g_param_spec_uint ( "sps", "Scrolls per second", "Amount of scroll events to generate per second.", 0, G_MAXUINT, 15, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); gtk_widget_class_install_style_property ( widget_class, g_param_spec_uint ( "indicator-width", "Width of the scroll indicators", "Pixel width used to draw the scroll indicators.", 0, G_MAXUINT, 6, G_PARAM_READWRITE)); } static void moko_finger_scroll_init (MokoFingerScroll * self) { MokoFingerScrollPrivate *priv = FINGER_SCROLL_PRIVATE (self); priv->moved = FALSE; priv->clicked = FALSE; priv->last_time = 0; priv->last_type = 0; priv->vscroll = TRUE; priv->hscroll = TRUE; priv->scroll_width = 6; gtk_event_box_set_above_child (GTK_EVENT_BOX (self), TRUE); gtk_event_box_set_visible_window (GTK_EVENT_BOX (self), FALSE); priv->align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); GTK_CONTAINER_CLASS (moko_finger_scroll_parent_class)->add ( GTK_CONTAINER (self), priv->align); gtk_alignment_set_padding (GTK_ALIGNMENT (priv->align), 0, priv->scroll_width, 0, priv->scroll_width); gtk_widget_show (priv->align); gtk_widget_add_events (GTK_WIDGET (self), GDK_POINTER_MOTION_HINT_MASK); priv->hadjust = GTK_ADJUSTMENT ( gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); priv->vadjust = GTK_ADJUSTMENT ( gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); g_object_ref_sink (G_OBJECT (priv->hadjust)); g_object_ref_sink (G_OBJECT (priv->vadjust)); g_signal_connect (G_OBJECT (self), "button-press-event", G_CALLBACK (moko_finger_scroll_button_press_cb), NULL); g_signal_connect (G_OBJECT (self), "button-release-event", G_CALLBACK (moko_finger_scroll_button_release_cb), NULL); g_signal_connect (G_OBJECT (self), "motion-notify-event", G_CALLBACK (moko_finger_scroll_motion_notify_cb), NULL); g_signal_connect_swapped (G_OBJECT (priv->hadjust), "changed", G_CALLBACK (moko_finger_scroll_refresh), self); g_signal_connect_swapped (G_OBJECT (priv->vadjust), "changed", G_CALLBACK (moko_finger_scroll_refresh), self); g_signal_connect_swapped (G_OBJECT (priv->hadjust), "value-changed", G_CALLBACK (moko_finger_scroll_redraw), self); g_signal_connect_swapped (G_OBJECT (priv->vadjust), "value-changed", G_CALLBACK (moko_finger_scroll_redraw), self); } /** * moko_finger_scroll_new: * * Create a new finger scroll widget * * Returns: the newly created #MokoFingerScroll */ GtkWidget * moko_finger_scroll_new (void) { return g_object_new (MOKO_TYPE_FINGER_SCROLL, NULL); } /** * moko_finger_scroll_new_full: * @mode: #MokoFingerScrollMode * @enabled: Value for the enabled property * @vel_min: Value for the velocity-min property * @vel_max: Value for the velocity-max property * @decel: Value for the deceleration property * @sps: Value for the sps property * * Create a new #MokoFingerScroll widget and set various properties * * returns: the newly create #MokoFingerScrull */ GtkWidget * moko_finger_scroll_new_full (gint mode, gboolean enabled, gdouble vel_min, gdouble vel_max, gdouble decel, guint sps) { return g_object_new (MOKO_TYPE_FINGER_SCROLL, "mode", mode, "enabled", enabled, "velocity_min", vel_min, "velocity_max", vel_max, "deceleration", decel, "sps", sps, NULL); } /** * moko_finger_scroll_add_with_viewport: * @scroll: A #MokoFingerScroll * @child: Child widget to add to the viewport * * Convenience function used to add a child to a #GtkViewport, and add the * viewport to the scrolled window. */ void moko_finger_scroll_add_with_viewport (MokoFingerScroll *scroll, GtkWidget *child) { GtkWidget *viewport = gtk_viewport_new (NULL, NULL); gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE); gtk_container_add (GTK_CONTAINER (viewport), child); gtk_widget_show (viewport); gtk_container_add (GTK_CONTAINER (scroll), viewport); } GType moko_finger_scroll_mode_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { MOKO_FINGER_SCROLL_MODE_PUSH, "MOKO_FINGER_SCROLL_MODE_PUSH", "" }, { MOKO_FINGER_SCROLL_MODE_ACCEL, "MOKO_FINGER_SCROLL_MODE_ACCEL", "" }, { MOKO_FINGER_SCROLL_MODE_AUTO, "MOKO_FINGER_SCROLL_MODE_AUTO", "" }, { 0, NULL, NULL } }; etype = g_enum_register_static ( g_intern_static_string ("MokoFingerScrollMode"), values); } return etype; } GType moko_finger_scroll_indicator_mode_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO, "MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO", "" }, { MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW, "MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW", "" }, { MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE, "MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE", "" }, { 0, NULL, NULL } }; etype = g_enum_register_static (g_intern_static_string ( "MokoFingerScrollIndicatorMode"), values); } return etype; } libmokoui2-0.3+bzr20080630/libmokoui/moko-finger-scroll.h0000644000175000001440000000535210776321216022155 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by Chris Lord * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ #ifndef _MOKO_FINGER_SCROLL #define _MOKO_FINGER_SCROLL #include #include #include "moko-type.h" G_BEGIN_DECLS #define MOKO_TYPE_FINGER_SCROLL moko_finger_scroll_get_type() #define MOKO_FINGER_SCROLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ MOKO_TYPE_FINGER_SCROLL, MokoFingerScroll)) #define MOKO_FINGER_SCROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \ MOKO_TYPE_FINGER_SCROLL, MokoFingerScrollClass)) #define MOKO_IS_FINGER_SCROLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ MOKO_TYPE_FINGER_SCROLL)) #define MOKO_IS_FINGER_SCROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ MOKO_TYPE_FINGER_SCROLL)) #define MOKO_FINGER_SCROLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ MOKO_TYPE_FINGER_SCROLL, MokoFingerScrollClass)) /** * MokoFingerScroll: * * MokoFingerScroll has no publicly accessible fields */ typedef struct _MokoFingerScroll MokoFingerScroll; typedef struct _MokoFingerScrollClass MokoFingerScrollClass; struct _MokoFingerScroll { GtkEventBox parent; }; struct _MokoFingerScrollClass { GtkEventBoxClass parent_class; }; /** * MokoFingerScrollMode: * @MOKO_FINGER_SCROLL_MODE_PUSH: Scrolling follows pointer * @MOKO_FINGER_SCROLL_MODE_ACCEL: Scrolling uses physics to "spin" the widget * @MOKO_FINGER_SCROLL_MODE_AUTO: Automatically chooses between push and accel * modes, depending on input. * * Used to change the behaviour of the finger scrolling */ typedef enum { MOKO_FINGER_SCROLL_MODE_PUSH, MOKO_FINGER_SCROLL_MODE_ACCEL, MOKO_FINGER_SCROLL_MODE_AUTO } MokoFingerScrollMode; typedef enum { MOKO_FINGER_SCROLL_INDICATOR_MODE_AUTO, MOKO_FINGER_SCROLL_INDICATOR_MODE_SHOW, MOKO_FINGER_SCROLL_INDICATOR_MODE_HIDE } MokoFingerScrollIndicatorMode; GType moko_finger_scroll_get_type (void); GtkWidget* moko_finger_scroll_new (void); GtkWidget* moko_finger_scroll_new_full (gint mode, gboolean enabled, gdouble vel_min, gdouble vel_max, gdouble decel, guint sps); void moko_finger_scroll_add_with_viewport (MokoFingerScroll *scroll, GtkWidget *child); G_END_DECLS #endif /* _MOKO_FINGER_SCROLL */ libmokoui2-0.3+bzr20080630/libmokoui/moko-hint-entry.c0000644000175000001440000001532110776321216021500 0ustar stevenusers/* * moko-hint-entry.c - taken from koto-hint-entry.c * * * Copyright (C) 2007 OpenedHand Ltd * * Relicensed with permission from GPL version 2 to LGPL version 2.1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: moko-hint-entry * @short_description: An entry widget with an additional "hint" when no value * is entered. * @see_also: #GtkEntry * * #MokoHintEntry is a simple #GtkEntry subclass that displays "hint" text if * the user has not entered a value. This is useful when there is not enough * space in the user interface to add a label next to the entry. However, it * should only be used where the meaning and context of the user entered value * is obvious without a label. */ #include #include #include #include "moko-hint-entry.h" G_DEFINE_TYPE (MokoHintEntry, moko_hint_entry, GTK_TYPE_ENTRY) #define GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MOKO_TYPE_HINT_ENTRY, MokoHintEntryPrivate)) typedef enum { STATE_HINTING, STATE_ENTRY, } EntryState; typedef struct { EntryState state; char *hint; } MokoHintEntryPrivate; /* * Private methods. */ static void update (MokoHintEntry *entry) { MokoHintEntryPrivate *priv; GtkWidget *widget; const char *text; g_assert (MOKO_IS_HINT_ENTRY (entry)); priv = GET_PRIVATE (entry); widget = GTK_WIDGET (entry); text = gtk_entry_get_text (GTK_ENTRY (entry)); if (GTK_WIDGET_HAS_FOCUS (entry)) { if (priv->state == STATE_HINTING) { priv->state = STATE_ENTRY; gtk_widget_modify_text (widget, GTK_STATE_NORMAL, NULL); gtk_entry_set_text (GTK_ENTRY (entry), ""); } } else { if (text == NULL || text[0] == '\0') { priv->state = STATE_HINTING; gtk_entry_set_text (GTK_ENTRY (entry), priv->hint); gtk_widget_modify_text (widget, GTK_STATE_NORMAL, >k_widget_get_style (widget)->text[GTK_STATE_INSENSITIVE]); } else { priv->state = STATE_ENTRY; } } } /* * Object methods. */ enum { PROP_0, PROP_HINT, }; static gboolean focus_in_event (GtkWidget *widget, GdkEventFocus *event) { update (MOKO_HINT_ENTRY (widget)); GTK_WIDGET_CLASS (moko_hint_entry_parent_class)->focus_in_event (widget, event); return FALSE; } static gboolean focus_out_event (GtkWidget *widget, GdkEventFocus *event) { update (MOKO_HINT_ENTRY (widget)); GTK_WIDGET_CLASS (moko_hint_entry_parent_class)->focus_out_event (widget, event); return FALSE; } static void moko_hint_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { MokoHintEntryPrivate *priv = GET_PRIVATE (object); switch (property_id) { case PROP_HINT: g_value_set_string (value, priv->hint); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_hint_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { MokoHintEntryPrivate *priv = GET_PRIVATE (object); switch (property_id) { case PROP_HINT: if (priv->hint) { g_free (priv->hint); } priv->hint = g_value_dup_string (value); update (MOKO_HINT_ENTRY (object)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_hint_entry_finalize (GObject *object) { MokoHintEntryPrivate *priv = GET_PRIVATE (object); g_free (priv->hint); if (G_OBJECT_CLASS (moko_hint_entry_parent_class)->finalize) G_OBJECT_CLASS (moko_hint_entry_parent_class)->finalize (object); } static void moko_hint_entry_class_init (MokoHintEntryClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); g_type_class_add_private (klass, sizeof (MokoHintEntryPrivate)); object_class->set_property = moko_hint_entry_set_property; object_class->get_property = moko_hint_entry_get_property; object_class->finalize = moko_hint_entry_finalize; widget_class->focus_in_event = focus_in_event; widget_class->focus_out_event = focus_out_event; g_object_class_install_property (object_class, PROP_HINT, g_param_spec_string ("hint", "hint", "Text to display when the entry is empty", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); } static void moko_hint_entry_init (MokoHintEntry *self) { } /* * Public methods. */ /** * moko_hint_entry_new: * @hint: The hint to display when the widget is not focused * * Create a new #MokoHintEntry widget with the specified hint. * * Returns: a newly created #MokoHintEntry */ GtkWidget * moko_hint_entry_new (const char *hint) { return g_object_new (MOKO_TYPE_HINT_ENTRY, "hint", hint, NULL); } /** * moko_hint_entry_set_text: * @entry: a #MokoHintEntry * @text: the next text * * Clear the text in the entry and if the widget is not focused, display the * hint text. */ void moko_hint_entry_set_text (MokoHintEntry *entry, const gchar *text) { MokoHintEntryPrivate *priv; g_return_if_fail (MOKO_IS_HINT_ENTRY (entry)); priv = GET_PRIVATE (entry); if (priv->state == STATE_HINTING) { priv->state = STATE_ENTRY; gtk_widget_modify_text (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL); } gtk_entry_set_text (GTK_ENTRY (entry), text); update (entry); } /** * moko_hint_entry_is_empty: * @entry: a #MokoHintyEntry * * Check if the entry has a user entered value. * * returns: TRUE if the hint is currently displayed. FALSE if the user has * entered a value */ gboolean moko_hint_entry_is_empty (MokoHintEntry *entry) { MokoHintEntryPrivate *priv; g_return_val_if_fail (MOKO_IS_HINT_ENTRY (entry), TRUE); priv = GET_PRIVATE (entry); if (priv->state == STATE_HINTING) return TRUE; return strlen (gtk_entry_get_text (GTK_ENTRY (entry))) == 0; } libmokoui2-0.3+bzr20080630/libmokoui/moko-hint-entry.h0000644000175000001440000000435310776321216021510 0ustar stevenusers/* * * moko-hint-history.c - taken from koto-hint-history.h * * * Copyright (C) 2007 OpenedHand Ltd * * Relicensed with permission from GPL version 2 to LGPL version 2.1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _MOKO_HINT_ENTRY #define _MOKO_HINT_ENTRY #include G_BEGIN_DECLS #define MOKO_TYPE_HINT_ENTRY moko_hint_entry_get_type() #define MOKO_HINT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOKO_TYPE_HINT_ENTRY, MokoHintEntry)) #define MOKO_HINT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOKO_TYPE_HINT_ENTRY, MokoHintEntryClass)) #define MOKO_IS_HINT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOKO_TYPE_HINT_ENTRY)) #define MOKO_IS_HINT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOKO_TYPE_HINT_ENTRY)) #define MOKO_HINT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOKO_TYPE_HINT_ENTRY, MokoHintEntryClass)) /** * MokoHintEntry: * * MokoHintEntry has no publicly accessible fields */ typedef struct _MokoHintEntry MokoHintEntry; typedef struct _MokoHintEntryClass MokoHintEntryClass; struct _MokoHintEntry { GtkEntry parent; }; struct _MokoHintEntryClass { GtkEntryClass parent_class; }; GType moko_hint_entry_get_type (void); GtkWidget* moko_hint_entry_new (const char *hint); void moko_hint_entry_set_text (MokoHintEntry *entry, const gchar* text); gboolean moko_hint_entry_is_empty (MokoHintEntry *entry); G_END_DECLS #endif /* _MOKO_HINT_ENTRY */ libmokoui2-0.3+bzr20080630/libmokoui/moko-search-bar.c0000644000175000001440000002227410776321216021413 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by Chris Lord * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ /** * SECTION: moko-search-bar * @short_description: An implementation of the OpenMoko "Search Bar" * user interface * @see_also: #GtkEntry, #GtkComboBox * * The #MokoSearchBar is a composite widget that implements the "Search Bar" * user interface from OpenMoko. It comprises of a #GtkEntry, a #GtkComboBox * and a #GtkToggleButton that toggles the visibility of the entry and combo box. * */ #include "moko-search-bar.h" G_DEFINE_TYPE (MokoSearchBar, moko_search_bar, GTK_TYPE_HBOX) #define SEARCH_BAR_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MOKO_TYPE_SEARCH_BAR, \ MokoSearchBarPrivate)) typedef struct _MokoSearchBarPrivate MokoSearchBarPrivate; struct _MokoSearchBarPrivate { GtkWidget *toggle; GtkWidget *entry; GtkWidget *combo; }; enum { PROP_COMBO = 1, PROP_ENTRY, }; enum { TOGGLED, TEXT_CHANGED, COMBO_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; static void combo_changed_cb (GtkComboBox *combo, MokoSearchBar *self) { g_signal_emit (self, signals[COMBO_CHANGED], 0, combo); } static void moko_search_bar_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (object); switch (property_id) { case PROP_COMBO : g_value_set_object (value, priv->combo); break; case PROP_ENTRY : g_value_set_object (value, priv->entry); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_search_bar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (object); switch (property_id) { case PROP_COMBO : priv->combo = g_value_get_object (value); gtk_box_pack_start (GTK_BOX (object), priv->combo, TRUE, TRUE, 0); gtk_widget_show (priv->combo); g_signal_connect (G_OBJECT (priv->combo), "changed", G_CALLBACK (combo_changed_cb), object); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void moko_search_bar_dispose (GObject *object) { if (G_OBJECT_CLASS (moko_search_bar_parent_class)->dispose) G_OBJECT_CLASS (moko_search_bar_parent_class)->dispose (object); } static void moko_search_bar_finalize (GObject *object) { G_OBJECT_CLASS (moko_search_bar_parent_class)->finalize (object); } static void moko_search_bar_class_init (MokoSearchBarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (MokoSearchBarPrivate)); object_class->get_property = moko_search_bar_get_property; object_class->set_property = moko_search_bar_set_property; object_class->dispose = moko_search_bar_dispose; object_class->finalize = moko_search_bar_finalize; g_object_class_install_property ( object_class, PROP_COMBO, g_param_spec_object ( "combo", "GtkComboBox *", "The GtkComboBox to place inside the widget.", GTK_TYPE_COMBO_BOX, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property ( object_class, PROP_ENTRY, g_param_spec_object ( "entry", "GtkEntry *", "The GtkEntry created for this widget.", GTK_TYPE_ENTRY, G_PARAM_READABLE)); /** * MokoSearchBar::toggled: * @searchbar: The #MokoSearchBar that received the signal * @search_visible: %TRUE if the search entry is visible, %FALSE * otherwise * @user_data: User data set when the signal handler was connected. * * The ::toggled signal is emitted each time the search button is * pressed. */ signals[TOGGLED] = g_signal_new ("toggled", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (MokoSearchBarClass, toggled), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * MokoSearchBar::text-changed: * @searchbar: The #MokoSearchBar that received the signal * @editable: The underlying #GtkEditable that received the ::changed * signal. * @user_data: User data set when the signal handler was connected. * * The ::text-changed signal is emitted each time the underlying * #GtkEditable receives its ::changed signal. */ signals[TEXT_CHANGED] = g_signal_new ("text-changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (MokoSearchBarClass, text_changed), NULL, NULL, g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); /** * MokoSearchBar::combo-changed: * @searchbar: The #MokoSearchBar that received the signal * @combo: The underlying #GtkComboBox that received the ::changed * signal. * @user_data: User data set when the signal handler was connected. * * The ::combo-changed signal is emitted each time the underlying * #GtkComboBox receives its ::changed signal. */ signals[COMBO_CHANGED] = g_signal_new ("combo-changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (MokoSearchBarClass, combo_changed), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_COMBO_BOX); } static void toggled_cb (GtkWidget *button, MokoSearchBar *self) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (self); g_object_set (G_OBJECT (priv->entry), "visible", !GTK_WIDGET_VISIBLE (priv->entry), NULL); g_object_set (G_OBJECT (priv->combo), "visible", !GTK_WIDGET_VISIBLE (priv->combo), NULL); if (GTK_WIDGET_VISIBLE (priv->entry)) gtk_widget_grab_focus (priv->entry); g_signal_emit (self, signals[TOGGLED], 0, GTK_WIDGET_VISIBLE (priv->entry)); } static void entry_changed_cb (GtkEditable *editable, MokoSearchBar *self) { g_signal_emit (self, signals[TEXT_CHANGED], 0, editable); } static void moko_search_bar_init (MokoSearchBar *self) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (self); /* Create toggle button */ priv->toggle = gtk_toggle_button_new (); gtk_widget_set_name (priv->toggle, "mokosearchbutton"); gtk_button_set_image (GTK_BUTTON (priv->toggle), gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR)); gtk_box_pack_start (GTK_BOX (self), priv->toggle, FALSE, FALSE, 0); gtk_widget_show_all (priv->toggle); /* Create entry */ priv->entry = gtk_entry_new (); gtk_widget_set_name (priv->entry, "mokosearchentry"); g_object_set (G_OBJECT (priv->entry), "no-show-all", TRUE, NULL); gtk_box_pack_start (GTK_BOX (self), priv->entry, TRUE, TRUE, 0); /* Connect up signals */ g_signal_connect (G_OBJECT (priv->toggle), "toggled", G_CALLBACK (toggled_cb), self); g_signal_connect (G_OBJECT (priv->entry), "changed", G_CALLBACK (entry_changed_cb), self); } /** * moko_search_bar_new: * * Create a new MokoSearBar widget * * returns: The newly created MokoSearchBar */ GtkWidget * moko_search_bar_new (void) { return GTK_WIDGET (g_object_new (MOKO_TYPE_SEARCH_BAR, "combo", gtk_combo_box_new (), NULL)); } /** * moko_search_bar_new_with_combo: * @combo: a GtkComboBox to use as the combobox * * Creates a MokoSearchBar with the specified combo box * * returns: the newly created MokoSearchBar */ GtkWidget * moko_search_bar_new_with_combo (GtkComboBox *combo) { return GTK_WIDGET (g_object_new (MOKO_TYPE_SEARCH_BAR, "combo", combo, NULL)); } /** * moko_search_bar_get_combo_box: * @self: a MokoSearchBar * * Get a pointer to the GtkComboBox being used in the MokoSearchBar * * returns: the GtkComboBox */ GtkComboBox * moko_search_bar_get_combo_box (MokoSearchBar *self) { GtkComboBox *combo; g_object_get (G_OBJECT (self), "combo", &combo, NULL); return combo; } /** * moko_search_bar_get_entry: * @self: a MokoSearchBar * * Retrieve the GtkEntry widget being used in the MokoSearchBar * * returns: the GtkEntry */ GtkEntry * moko_search_bar_get_entry (MokoSearchBar *self) { GtkEntry *entry; g_object_get (G_OBJECT (self), "entry", &entry, NULL); return entry; } /** * moko_search_bar_search_visible: * @self: a MokoSaerchBar * * Determine the visibility of the search entry. * * returns: TRUE if the search entry is visible */ gboolean moko_search_bar_search_visible (MokoSearchBar *self) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (self); return GTK_WIDGET_VISIBLE (priv->entry); } /** * moko_search_bar_toggle: * @self: a MokoSearchBar * * Toggle the search button on the MokoSearchBar. * This toggles the visibility of the combo box and entry widgets. */ void moko_search_bar_toggle (MokoSearchBar *self) { MokoSearchBarPrivate *priv = SEARCH_BAR_PRIVATE (self); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->toggle), !gtk_toggle_button_get_active ( GTK_TOGGLE_BUTTON (priv->toggle))); } libmokoui2-0.3+bzr20080630/libmokoui/moko-search-bar.h0000644000175000001440000000447310776321216021421 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by Chris Lord * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ #ifndef _MOKO_SEARCH_BAR #define _MOKO_SEARCH_BAR #include #include G_BEGIN_DECLS #define MOKO_TYPE_SEARCH_BAR moko_search_bar_get_type() #define MOKO_SEARCH_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOKO_TYPE_SEARCH_BAR, MokoSearchBar)) #define MOKO_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOKO_TYPE_SEARCH_BAR, MokoSearchBarClass)) #define MOKO_IS_SEARCH_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOKO_TYPE_SEARCH_BAR)) #define MOKO_IS_SEARCH_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOKO_TYPE_SEARCH_BAR)) #define MOKO_SEARCH_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOKO_TYPE_SEARCH_BAR, MokoSearchBarClass)) /** * MokoSearchBar: * * MokoSearchBar has no publicly accessible fields */ typedef struct _MokoSearchBar MokoSearchBar; typedef struct _MokoSearchBarClass MokoSearchBarClass; struct _MokoSearchBar { GtkHBox parent; }; struct _MokoSearchBarClass { GtkHBoxClass parent_class; /* Signals */ void (*toggled) (MokoSearchBar *self, gboolean search_visible); void (*text_changed) (MokoSearchBar *self, GtkEditable *editable); void (*combo_changed) (MokoSearchBar *self, GtkComboBox *combo_box); }; GType moko_search_bar_get_type (void); GtkWidget * moko_search_bar_new (); GtkWidget * moko_search_bar_new_with_combo (GtkComboBox *combo); GtkComboBox * moko_search_bar_get_combo_box (MokoSearchBar *self); GtkEntry * moko_search_bar_get_entry (MokoSearchBar *self); gboolean moko_search_bar_search_visible (MokoSearchBar *self); void moko_search_bar_toggle (MokoSearchBar *self); G_END_DECLS #endif /* _MOKO_SEARCH_BAR */ libmokoui2-0.3+bzr20080630/libmokoui/moko-stock.c0000644000175000001440000001160210776321216020520 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by OpenedHand Ltd * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ /** * SECTION: moko-stock * @short_description: Stock items for OpenMoko * * Stock items for use with OpenMoko */ #include #include #include #include static const GtkStockItem moko_items [] = { { MOKO_STOCK_CALL_ANSWER, N_("Answer"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_DIAL, N_("Dial"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_DIALED, N_("Dialed Calls"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_HANGUP, N_("Hang Up"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_HISTORY, N_("History"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_HOLD, N_("Hold"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_IGNORE, N_("Ignore"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_IN, N_("Received Calls"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_MISSED, N_("Missed Calls"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_REDIAL, N_("Redial"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CALL_REJECT, N_("Reject"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_ADDRESS, N_("Address"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_DELETE, N_("Delete Contact"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_EMAIL, N_("E-Mail"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_GROUPS, N_("Groups"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_NEW, N_("New Contact"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_CONTACT_PHONE, N_("Phone"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_FOLDER_DELETE, N_("Delete Folder"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_FOLDER_NEW, N_("New Folder"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_HISTORY, N_("History"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_DELETE, N_("Delete"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_FORWARD, N_("Forward"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_MARK_READ, N_("Mark as Read"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_NEW, N_("New Mail"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_READ, N_("Read Mail"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_REPLY_ALL, N_("Reply to All"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_REPLY_SENDER, N_("Reply to Sender"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_SEND, N_("Send"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_MAIL_SEND_RECEIVE, N_("Send/Receive"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_PHONE_BOOK, N_("Phone Book"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_SEARCH, N_("Search"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_SMS_NEW, N_("New SMS"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_SPEAKER, N_("Speaker"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_HANDSET, N_("Handset"), 0, 0, GETTEXT_PACKAGE }, { MOKO_STOCK_VIEW, N_("View"), 0, 0, GETTEXT_PACKAGE }, }; static gboolean registered = FALSE; static void _moko_stock_add_icon (GtkIconFactory *factory, const GtkStockItem *item) { static GtkIconTheme *theme = NULL; GtkIconSource *source; GtkIconSet *set = NULL; GdkPixbuf *pixbuf = NULL; int i; if (theme == NULL) theme = gtk_icon_theme_get_default (); set = gtk_icon_set_new (); for (i = GTK_ICON_SIZE_MENU; i <= GTK_ICON_SIZE_DIALOG; i++) { gint width, height; gtk_icon_size_lookup (i, &width, &height); pixbuf = gtk_icon_theme_load_icon (theme, item->stock_id, width, 0, NULL); if (!pixbuf) continue; source = gtk_icon_source_new (); gtk_icon_source_set_size (source, i); gtk_icon_source_set_size_wildcarded (source, FALSE); gtk_icon_source_set_pixbuf (source, pixbuf); gtk_icon_set_add_source (set, source); gtk_icon_source_free (source); g_object_unref (G_OBJECT (pixbuf)); } gtk_icon_factory_add (factory, item->stock_id, set); gtk_icon_set_unref (set); } /** * moko_stock_register: * * Register the OpenMoko stock icons for use with stock icon functions. * */ void moko_stock_register () { gint i = 0; static GtkIconFactory *moko_icon_factory = NULL; /* make sure we never register the icons twice */ if (registered) return; moko_icon_factory = gtk_icon_factory_new (); for (i = 0; i < G_N_ELEMENTS (moko_items); i++) { _moko_stock_add_icon (moko_icon_factory, &moko_items[i]); } gtk_icon_factory_add_default (moko_icon_factory); gtk_stock_add_static (moko_items, G_N_ELEMENTS (moko_items)); registered = TRUE; } libmokoui2-0.3+bzr20080630/libmokoui/moko-stock.h0000644000175000001440000000557410776321216020540 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Authored by OpenedHand Ltd * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ /* * OpenMoko Stock Items * * Some of these correspond to icon names from the Freedesktop.org Icon Naming * Specification: * http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html * * Names that start with "moko-" are currently specific to libmokoui * * The stock items are named by context, then action. Please keep the list in * alphabetical order. * */ #ifndef _MOKO_STOCK_H_ #define _MOKO_STOCK_H_ #define MOKO_STOCK_CALL_ANSWER "moko-call-answer" #define MOKO_STOCK_CALL_DIAL "moko-call-dial" #define MOKO_STOCK_CALL_DIALED "moko-history-call-out" #define MOKO_STOCK_CALL_HANGUP "moko-call-hangup" #define MOKO_STOCK_CALL_HISTORY "moko-call-history" #define MOKO_STOCK_CALL_HOLD "moko-call-hold" #define MOKO_STOCK_CALL_IGNORE "moko-call-ignore" #define MOKO_STOCK_CALL_IN "moko-history-call-in" #define MOKO_STOCK_CALL_MISSED "moko-history-call-missed" #define MOKO_STOCK_CALL_REDIAL "moko-call-redial" #define MOKO_STOCK_CALL_REJECT "moko-call-reject" #define MOKO_STOCK_CONTACT_ADDRESS "moko-contact-address" #define MOKO_STOCK_CONTACT_DELETE "moko-contact-delete" #define MOKO_STOCK_CONTACT_EMAIL "moko-contact-email" #define MOKO_STOCK_CONTACT_GROUPS "moko-contact-groups" #define MOKO_STOCK_CONTACT_MODE "contact-mode" #define MOKO_STOCK_CONTACT_NEW "contact-new" #define MOKO_STOCK_CONTACT_PHONE "moko-contact-phone" #define MOKO_STOCK_FOLDER_DELETE "moko-folder-delete" #define MOKO_STOCK_FOLDER_NEW "moko-folder-new" #define MOKO_STOCK_HISTORY "moko-history" #define MOKO_STOCK_MAIL_DELETE "mail-delete" #define MOKO_STOCK_MAIL_FORWARD "mail-forward" #define MOKO_STOCK_MAIL_MARK_READ "mail-mark-read" #define MOKO_STOCK_MAIL_NEW "mail-message-new" #define MOKO_STOCK_MAIL_READ "mail-read" #define MOKO_STOCK_MAIL_REPLY_ALL "mail-reply-all" #define MOKO_STOCK_MAIL_REPLY_SENDER "mail-reply-sender" #define MOKO_STOCK_MAIL_SEND "mail-send" #define MOKO_STOCK_MAIL_SEND_RECEIVE "mail-send-receive" #define MOKO_STOCK_PHONE_BOOK "moko-phone-book" #define MOKO_STOCK_SEARCH "system-search" #define MOKO_STOCK_SMS_NEW "moko-sms-new" #define MOKO_STOCK_SPEAKER "moko-speaker" #define MOKO_STOCK_HANDSET "moko-handset" #define MOKO_STOCK_VIEW "moko-view" void moko_stock_register (); #endif /* _MOKO_STOCK_H_ */ libmokoui2-0.3+bzr20080630/libmokoui/moko-type.h0000644000175000001440000000200510776321216020360 0ustar stevenusers/* * libmokoui -- OpenMoko Application Framework UI Library * * Copyright (C) 2006-2007 OpenMoko Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; version 2 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * Current Version: $Rev$ ($Date$) [$Author$] */ #ifndef MOKO_TYPE_H #define MOKO_TYPE_H #include G_BEGIN_DECLS GType moko_finger_scroll_mode_get_type (void) G_GNUC_CONST; #define MOKO_TYPE_FINGER_SCROLL_MODE (moko_finger_scroll_mode_get_type()) GType moko_finger_scroll_indicator_mode_get_type (void) G_GNUC_CONST; #define MOKO_TYPE_FINGER_SCROLL_INDICATOR_MODE \ (moko_finger_scroll_indicator_mode_get_type()) G_END_DECLS #endif libmokoui2-0.3+bzr20080630/libmokoui2.pc.in0000644000175000001440000000041410776321216017300 0ustar stevenusersprefix=@prefix@ exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/libmokoui2 Name: libmokoui Description: OpenMoko User Interface Development Library Version: @VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lmokoui2 Requires: gtk+-2.0 libmokoui2-0.3+bzr20080630/po/0000755000175000001440000000000010776321216014712 5ustar stevenuserslibmokoui2-0.3+bzr20080630/po/Makefile.in.in0000644000175000001440000001771410776321216017376 0ustar stevenusers# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale gettextsrcdir = $(datadir)/glib-2.0/gettext/po subdir = po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ $(POFILES) $(GMOFILES) $(SOURCES) POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ INSTOBJEXT = @INSTOBJEXT@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && $(GENCAT) $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ --add-comments --keyword=_ --keyword=N_ \ --flag=g_strdup_printf:1:c-format \ --flag=g_string_printf:2:c-format \ --flag=g_string_append_printf:2:c-format \ --flag=g_error_new:3:c-format \ --flag=g_set_error:4:c-format \ --flag=g_markup_printf_escaped:1:c-format \ --flag=g_log:3:c-format \ --flag=g_print:1:c-format \ --flag=g_printerr:1:c-format \ --flag=g_printf:1:c-format \ --flag=g_fprintf:2:c-format \ --flag=g_sprintf:2:c-format \ --flag=g_snprintf:3:c-format \ --flag=g_scanner_error:2:c-format \ --flag=g_scanner_warn:2:c-format \ --files-from=$(srcdir)/POTFILES.in \ && test ! -f $(GETTEXT_PACKAGE).po \ || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ *.gmo) destdir=$(gnulocaledir);; \ *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $$dir; \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ fi; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ fi; \ if test -r $$cat.m; then \ $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ if test -r $(srcdir)/$$cat.m ; then \ $(INSTALL_DATA) $(srcdir)/$$cat.m \ $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ true; \ fi; \ fi; \ done if test "$(PACKAGE)" = "glib"; then \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ done if test "$(PACKAGE)" = "glib"; then \ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ fi check: all dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) dist distdir: update-po $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done # POTFILES is created from POTFILES.in by stripping comments, empty lines # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them POTFILES: POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ && (sed -e '/^#/d' \ -e "s/^\[.*\] +//" \ -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) Makefile: Makefile.in.in ../config.status POTFILES cd .. \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: