moblin-gtk-engine-1.1.1/000077500000000000000000000000001133531263600150235ustar00rootroot00000000000000moblin-gtk-engine-1.1.1/.gitignore000066400000000000000000000002571133531263600170170ustar00rootroot00000000000000*.la *.lo *.so *.swp .deps/* .libs/* INSTALL Makefile Makefile.in aclocal.m4 autom4te.cache/* config.* configure depcomp install-sh libtool ltmain.sh missing stamp-h1 TAGS *~ moblin-gtk-engine-1.1.1/AUTHORS000066400000000000000000000000441133531263600160710ustar00rootroot00000000000000Thomas Wood moblin-gtk-engine-1.1.1/COPYING.LIB000066400000000000000000000636371133531263600165020ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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! moblin-gtk-engine-1.1.1/ChangeLog000066400000000000000000000273501133531263600166040ustar00rootroot000000000000002008-08-06 Galen Wetterling reviewed by: * data/*.png: (Bugfix) Resized image files. 2008-08-06 Galen Wetterling * data/gtkrc-qvga: (Bugfix) Changed filenames to *-qvga.png 2008-08-06 Galen Wetterling * Makefile.am: * configure.ac: * data/gtkrc: * data/gtkrc-qvga: * data/gtkrc-vga: Made a qvga-specific version of gtkrc, which is used in place of the original gtkrc when --with-mode=qvga is passed as a configure option. 2008-08-06 Galen Wetterling * Makefile.am: * configure.ac: * data/titlebar-panel-applet-background-qvga.png * data/titlebar-panel-background-qvga.png Added qvga-sized images and a configure flag to use them: --with-mode=vga (default, uses original images) --with-mode=qvga (uses new images) 2008-02-22 Ross Burton * NEWS: * configure.ac: Version 0.3.1. 2008-02-22 Ross Burton * data/gtkrc: Don't change the panel applet label text colour, so that labels match the icons. 2008-02-18 Ross Burton * NEWS: * configure.ac: Version 0.3. 2008-02-18 Ross Burton * data/gtkrc: Add style for the clock applet, so its colour matches the icons. 2008-02-18 Ross Burton * data/gtkrc: Rename matchbox-applet to matchbox-applet-background, as its a background-setting hack rule. 2008-02-12 Thomas Wood * NEWS: * configure.ac: Update for 0.2 release 2008-02-12 Thomas Wood * src/sato-draw-cairo.c: (sato_draw_extension): Fix left and right active tabs in cairo version 2008-02-12 Thomas Wood * data/gtkrc: Improve "insensitive" state support 2008-02-12 Thomas Wood * data/gtkrc: * src/sato-draw.c: (sato_draw_box): Fix Progress bar and slider styles 2008-02-11 Thomas Wood * autogen.sh: Simplify and fix a problem with missing config.h.in 2008-02-11 Thomas Wood * src/sato-draw-cairo.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_check), (sato_draw_option): * src/sato-draw.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_check), (sato_draw_option): Add focus indication for draw_check, draw_option and draw_box 2008-02-08 Thomas Wood * src/sato-draw-cairo.c: (sato_draw_box): * src/sato-draw.c: (sato_draw_box): Fix prelight removal hack 2008-02-08 Thomas Wood * src/sato-draw.c: (sato_draw_option): Fix option drawing to match check box theming 2008-02-08 Thomas Wood * src/sato-draw.c: (sato_draw_check): Fix check box drawing 2008-02-08 Thomas Wood * src/sato-draw.c: (sato_draw_extension): Fix draw extension (notebook tabs) 2008-02-07 Thomas Wood * src/sato-draw-cairo.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_focus), (sato_draw_box_gap), (sato_draw_vline), (sato_draw_hline): * src/sato-draw.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_focus), (sato_draw_check), (sato_draw_option), (sato_draw_extension), (sato_draw_vline), (sato_draw_hline), (sato_draw_style_class_init): Consolidate some of the differences between cairo and GDK versions 2008-02-05 Thomas Wood * Makefile.am: * configure.ac: * data/gtkrc: * src/sato-draw-cairo.c: * src/sato-draw.c: Add optional cairo renderer (disabled by default) 2007-07-30 Thomas Wood * COPYING: Added LGPL version * README: Add README content * configure.ac: Update for 0.1 release * src/sato-draw.c: * src/sato-draw.h: * src/sato-main.c: * src/sato-style.c: * src/sato-style.h: * src/sato-utils.c: * src/sato-utils.h: Updated with LGPL copyright information 2007-07-26 Ross Burton * data/gtkrc: Change the colour for the desktop buttons from black to dark grey, and also set labels so that the groups combo is readable. 2007-07-24 Thomas Wood * data/gtkrc: Set the check/radio indicator size for menu items and add a new style for checkbuttons. Fix non-prelight toolbuttons by using the checkbox style. * src/sato-draw.c: (sato_draw_focus): Start drawing focus rings more often (sato_draw_check), (sato_draw_option): Clear the background before drawing indicator. Don't draw border colour depending on focus as this doesn't work well for check/radio boxes in treeviews. 2007-07-13 Rob Bradford * data/gtkrc: Add style for matchbox-desktop-2 arrows, setting them to black. 2007-07-13 Thomas Wood * data/gtkrc: Switch to using widget_class to match menu items 2007-07-11 Thomas Wood * data/gtkrc: Fix scrollbar troughs and menu items 2007-07-11 Thomas Wood * src/sato-draw.c: (sato_draw_box): Use text[] colours for box borders 2007-07-11 Thomas Wood * data/gtkrc: Even darker green colour, and use white for button text 2007-06-22 Thomas Wood * data/gtkrc: Use a darker green. Lighten fg insensitive colour. 2007-06-20 Ross Burton * data/index.theme: Set the icon theme too. 2007-06-19 Ross Burton * configure.ac: Remove AM_MAINTAINER_MODE. 2007-06-19 Ross Burton * Makefile.am: * data/index.theme: Install a metatheme file. 2007-06-14 Thomas Wood * data/gtkrc: Fix scrollbar/progressbar theming. Add treeview header style * src/sato-draw.c: (sato_draw_box): Add special case for treeview headers 2007-06-14 Thomas Wood * data/gtkrc: Make GtkScale sliders larger * src/sato-draw.c: (sato_draw_box): Fix trough styles 2007-06-14 Thomas Wood * src/sato-draw.c: (sato_gradient): Make gradients slightly more subtle 2007-06-13 Thomas Wood * src/sato-draw.c: (sato_draw_box), (sato_draw_shadow): Add "combined" style combo boxes and spin buttons. 2007-06-13 Thomas Wood * src/sato-draw.c: (sato_gradient), (sato_draw_box), (sato_draw_shadow), (sato_draw_focus), (sato_draw_check), (sato_draw_option), (sato_draw_box_gap), (sato_draw_extension), (sato_draw_vline), (sato_draw_hline), (sato_draw_style_class_init): Copy and alter the style each time to add 2px line width. Using realize was unreliable. 2007-06-06 Ross Burton * data/gtkrc: Theme the system tray applet background. 2007-04-16 Ross Burton * data/gtkrc: Remove the special theming for the window list applet, its not required anymore. 2007-04-16 Ross Burton * data/gtkrc: Add GtkFontButton and GtkColorButton. 2007-04-13 Ross Burton * data/gtkrc: Add explicit colours for the desktop. 2007-04-12 Thomas Wood * Makefile.am: Add data/titlebar-panel-applet-background.png to the build 2007-04-12 Thomas Wood * data/gtkrc: Fix menu border spacing 2007-04-12 Thomas Wood * Makefile.am: * data/gtkrc: * src/sato-draw.c: (sato_gradient), (sato_draw_box), (sato_draw_check), (sato_realise): - Add shading routine from gtk+ - Remove hard coded engine colours 2007-04-12 Jorn Baayen A data/titlebar-panel-applet-background.png: * data/gtkrc: Theme the window selector applet to have the same background as the panel itself. 2007-04-12 Ross Burton * data/gtkrc: Remove desktop style. 2007-04-11 Thomas Wood * src/sato-draw.c: (sato_draw_shadow), (sato_draw_box_gap): Don't draw any lines when shadow_type is GTK_SHADOW_NONE. 2007-04-11 Jorn Baayen * data/gtkrc: Set xthickness and ythickness on panel frames. 2007-04-10 Thomas Wood * data/gtkrc: Remove icons from menus and buttons 2007-04-03 Thomas Wood * data/gtkrc: Make check and radio button indicators bigger * src/sato-draw.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_focus), (sato_draw_check), (sato_draw_option): - Chance outline colour to green to indicate focus - Add spacing between check and radio indicators and border 2007-04-02 Thomas Wood * data/gtkrc: Make menubars darker * src/sato-draw.c: (sato_draw_box): Don't draw borders or gradients on paned, menu or trough widget. (sato_draw_shadow): Fix for shadows passed in with -1 as width and height 2007-04-02 Thomas Wood * data/gtkrc: Don't draw has_default borders for the moment * src/sato-draw.c: (sato_corner), (sato_draw_box): Improve corners for filled rectangles. Draw borders on troughs and don't fill. 2007-02-02 Thomas Wood * data/gtkrc: Increase scrollbar size, Apply button style properly, fix some other gtk style properties. * src/sato-draw.c: (sato_draw_box), (sato_draw_shadow), (sato_draw_focus), (sato_draw_extension), (sato_draw_vline), (sato_draw_hline), (sato_realise): - Simplify draw_box style - Temporarily use text[] colour as border colour - Use a rounded rectangle for focus indicator 2007-02-01 Ross Burton * data/gtkrc: Add basic theme for matchbox-desktop-2. 2007-01-04 Thomas Wood * data/gtkrc: Don't set font here 2006-12-23 Matthew Allum * data/titlebar-panel-background.png Fix mystery cursor on image 2006-12-22 Matthew Allum * Makefile.am: * data/gtkrc: Add image and setting for matchbox-panel-2 background. 2006-12-20 Thomas Wood * data/gtkrc: Fix colour of buttons on GtkToolbar * src/sato-draw.c: (sato_draw_box): - Don't draw gradients on menus - Don't draw boders on troughs - Use SANITIZE_SIZE to fix drawing menu borders * src/sato-draw.h: Add SANITIZE_SIZE macro * src/sato-style.c: Restore from poky-style.c and rename functions 2006-10-30 Thomas Wood * src/sato-draw.c: Fix a possible crasher 2006-10-30 Thomas Wood * data/gtkrc: Use correct engine. Add focus line options. * src/sato-draw.c: (sato_gradient), (sato_draw_box), (sato_draw_shadow), (sato_draw_option), (sato_draw_style_class_init): - Draw some fairly ugly focus and has_default markings - Draw hline and vlines - Don't draw gradient on menu and toolbars 2006-10-20 Thomas Wood * Makefile.am: * configure.ac: * src/poky-draw.c: * src/poky-draw.h: * src/poky-main.c: * src/poky-style.c: * src/poky-style.h: * src/sato-draw.c: (sato_corner), (sato_gradient), (sato_draw_box), (sato_draw_shadow), (sato_draw_check), (sato_draw_option), (sato_draw_box_gap), (sato_draw_extension): * src/sato-draw.h: * src/sato-main.c: * src/sato-style.h: Rename Poky to Sato 2006-10-20 Thomas Wood * src/poky-draw.c: (poky_corner), (poky_draw_box), (poky_draw_shadow), (poky_draw_check), (poky_draw_box_gap), (poky_draw_extension): - Move drawing corners into their own function - Simplify the rounded recatngle function - Add some special cases to the draw_box_gap function 2006-10-19 Thomas Wood * src/poky-draw.c: Fix some compiler warnings 2006-10-16 Thomas Wood * Makefile.am: * autogen.sh: * configure.ac: * data/gtkrc: * src/poky-corners.h: * src/poky-draw.c: * src/poky-draw.h: * src/poky-main.c: * src/poky-style.c: * src/poky-style.h: Initial import into svn moblin-gtk-engine-1.1.1/Makefile.am000066400000000000000000000015141133531263600170600ustar00rootroot00000000000000INCLUDES = $(GTK_CFLAGS) $(DEVELOPMENT_CFLAGS) enginedir = $(libdir)/gtk-2.0/$(GTK_VERSION)/engines engine_LTLIBRARIES = libmoblin-netbook-engine.la libmoblin_netbook_engine_la_SOURCES = \ ./src/moblin-netbook-style.c \ ./src/moblin-netbook-style.h \ ./src/moblin-netbook-rc-style.c \ ./src/moblin-netbook-rc-style.h \ ./src/moblin-netbook-main.c \ ./src/moblin-netbook-utils.c \ ./src/moblin-netbook-utils.h libmoblin_netbook_engine_la_LDFLAGS = -module -avoid-version -no-undefined -Werror libmoblin_netbook_engine_la_LIBADD = $(GTK_LIBS) themedir = $(datadir)/themes/Moblin-Netbook gtkthemedir = $(themedir)/gtk-2.0 dist_gtktheme_DATA = data/gtkrc metacitythemedir = $(themedir)/metacity-1 dist_metacitytheme_DATA = data/metacity-theme-1.xml indexthemedir = $(themedir)/ dist_indextheme_DATA = data/index.theme moblin-gtk-engine-1.1.1/NEWS000066400000000000000000000005461133531263600155270ustar00rootroot00000000000000Version 0.3.1 ============= * Revert the clock colour change Version 0.3 =========== * Colour the clock applet from the style, so the applet doesn't have to do it directly. Version 0.2 =========== * New optional cairo rendering * Refreshed visual style * Bug fixes, see ChangeLog for full details of changes Version 0.1 =========== * First release! moblin-gtk-engine-1.1.1/README000066400000000000000000000020121133531263600156760ustar00rootroot00000000000000Sato GTK+ Theme Engine ====================== Description Sato is a reference GTK+/Matchbox based environment aimed primarily at handheld devices with very high DPI displays. The Sato GTK+ Theme Engine provides the themeing for GTK+ widgets and is designed for speed and clarity on embedded hardware. Author Sato is developed by OpenedHand Ltd. For more information please contact info@openedhand.com. Reporting Bugs Please report bugs to http://bugzilla.gnome.org and file under the Sato product with gtk-engine component. Copyright Copyright © 2007 OpenedHand Ltd. 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 of the License, or (at your option) any later version. 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. moblin-gtk-engine-1.1.1/autogen.sh000077500000000000000000000001271133531263600170240ustar00rootroot00000000000000#! /bin/sh autoreconf -v --install || exit 1 ./configure --enable-maintainer-mode "$@" moblin-gtk-engine-1.1.1/configure.ac000066400000000000000000000012631133531263600173130ustar00rootroot00000000000000AC_INIT([moblin-gtk-engine], [1.1.0]) AC_CONFIG_SRCDIR([README]) AM_CONFIG_HEADER(config.h) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AM_INIT_AUTOMAKE AC_PROG_CC AM_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl Initialize libtool AM_DISABLE_STATIC AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AM_MAINTAINER_MODE PKG_PROG_PKG_CONFIG() PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,, AC_MSG_ERROR([GTK+-2.8 is required to compile moblin-netbook-engine])) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) DEVELOPMENT_CFLAGS="-Wall" AC_SUBST(DEVELOPMENT_CFLAGS) GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0` AC_SUBST(GTK_VERSION) AC_CONFIG_FILES([ Makefile ]) AC_OUTPUT moblin-gtk-engine-1.1.1/data/000077500000000000000000000000001133531263600157345ustar00rootroot00000000000000moblin-gtk-engine-1.1.1/data/gtkrc000066400000000000000000000340441133531263600167760ustar00rootroot00000000000000# Moblin Netbook GTK+ theme gtk_button_images = 0 gtk_menu_images = 0 gtk-auto-mnemonics = 1 gtk-icon-sizes = "gtk-menu=16,16:panel-menu=24,24:panel=16,16:gtk-button=16,16:gtk-large-toolbar=24,24" gtk_color_scheme = "bg_color:#fbfbfb;fg_color:#2b2b2b;text_color:#2b2b2b;base_color:#fff;selected_bg_color:#44c5e5;selected_fg_color:#fff;grey:#8d8d8d;blue:#44c5e5;toolbar_color:#f1f1f1;menubar_color:#464646;frame_color:#333333;inactive_frame_color:#414141;" style "default" { # Link colors GtkWidget::link_color = @blue GtkWidget::visited_link_color = @blue GtkWidget::cursor-color = @blue GtkWidget::secondary-cursor-color = @blue GtkHTML::link_color = @blue GtkHTML::alink_color = @blue GtkHTML::vlink_color = @blue # Spell check underline color GtkHTML::spell_error_color = @blue GtkWidget::focus-padding = 0 GtkWidget::focus-line-width = 2 GtkExpander::expander-size = 16 GtkTreeView::expander-size = 16 GtkTextView::error-underline-color = "#febf00" xthickness = 4 ythickness = 4 GtkRange::trough_border = 2 fg [NORMAL] = @fg_color fg [PRELIGHT] = @fg_color fg [ACTIVE] = @fg_color fg [INSENSITIVE] = shade (1.3, @grey) fg [SELECTED] = @selected_fg_color bg [NORMAL] = @bg_color bg [PRELIGHT] = @bg_color bg [ACTIVE] = @bg_color bg [INSENSITIVE] = "#f1f1f1" bg [SELECTED] = @blue text [NORMAL] = @text_color text [PRELIGHT] = @selected_fg_color text [SELECTED] = @selected_fg_color text [ACTIVE] = @selected_fg_color text [INSENSITIVE] = shade (1.3, @grey) base [NORMAL] = @base_color base [PRELIGHT] = @base_color base [SELECTED] = @selected_bg_color base [ACTIVE] = @selected_bg_color base [INSENSITIVE] = "#f1f1f1" engine "moblin-netbook-engine" { radius = 3 border [NORMAL] = @grey border [PRELIGHT] = @menubar_color border [SELECTED] = @menubar_color border [ACTIVE] = @menubar_color border [INSENSITIVE] = "#d7d9d4" } } class "GtkWidget" style "default" style "button" { GtkButton::default_border = {0, 0, 0, 0} # Allow for bottom shadow in buttons GtkButton::inner-border = { 0, 0, 0, 0 } bg [NORMAL] = "#ffffff" bg [PRELIGHT] = "#ffffff" bg [ACTIVE] = "#ffffff" bg [INSENSITIVE] = "#f1f1f1" GtkButton::child-displacement-x = 1 GtkButton::child-displacement-y = 1 GtkButton::displace-focus = 1 GtkButton::inner-border = { 4, 4, 4, 4 } bg [SELECTED] = shade (1.5, @blue) fg [NORMAL] = @fg_color fg [PRELIGHT] = @fg_color text [NORMAL] = @fg_color text [PRELIGHT] = @fg_color xthickness = 4 ythickness = 1 engine "moblin-netbook-engine" { radius = 3 border [PRELIGHT] = shade (0.85, @blue) border [ACTIVE] = @blue border [INSENSITIVE] = "#d7d9d4" } } widget_class "*Button*" style "button" widget_class "*InfoBar*" style "button" style "nautilus-icon-container" { base [SELECTED] = @blue NautilusIconContainer::selection_box_color = @blue NautilusIconContainer::dark_info_color = shade (0.6, @blue) NautilusIconContainer::light_info_color = shade (0.6, @blue) NautilusIconContainer::prelight_icon_color = "#ff0000" NautilusIconContainer::prelight_icon_brightness = 150 } class "NautilusIconContainer" style "nautilus-icon-container" style "checkbutton" { GtkCheckButton::indicator_size = 15 base [SELECTED] = @blue base [INSENSITIVE] = "#f1f1f1" text [INSENSITIVE] = shade (1.3, @grey) text [SELECTED] = "#fff" bg [PRELIGHT] = "#fff" engine "moblin-netbook-engine" { radius = 1 shadow = 0.0 border [PRELIGHT] = @menubar_color border [SELECTED] = shade (0.6, @blue) border [INSENSITIVE] = shade (1.3, @grey) } } widget_class "*CheckButton*" style "checkbutton" widget_class "*RadioButton*" style "checkbutton" widget_class "*ToolButton*" style "checkbutton" style "menuitem" { GtkCheckMenuItem::indicator_size = 15 GtkMenuItem::arrow-scaling = 0.4 fg [PRELIGHT] = "white" bg [PRELIGHT] = @blue fg [INSENSITIVE] = "#bbb" base [SELECTED] = @blue xthickness = 6 ythickness = 6 engine "moblin-netbook-engine" { radius = 0 } } widget_class "*MenuItem*" style "menuitem" style "progressbar" { GtkProgressBar::xspacing = 0 GtkProgressBar::yspacing = 0 xthickness = 3 ythickness = 3 bg [NORMAL] = "white" fg [NORMAL] = "blue" base [NORMAL] = "orange" bg [PRELIGHT] = @blue engine "moblin-netbook-engine" { border [PRELIGHT] = @blue radius = 3 } } class "GtkProgressBar" style "progressbar" style "scrollbar" { GtkScrollbar::slider_width = 28 GtkScrollbar::stepper_size = 28 GtkScrollbar::arrow-scaling = 0.4 GtkScrollbar::trough-border = 0 GtkScrollbar::min-slider-length = 32 fg [NORMAL] = @grey fg [INSENSITIVE] = @grey fg [PRELIGHT] = @blue fg [ACTIVE] = @blue # stepper colours bg [ACTIVE] = @bg_color bg [INSENSITIVE] = @bg_color # trough color base [ACTIVE] = "#e5e5e5" engine "moblin-netbook-engine" { radius = 3 border [PRELIGHT] = @blue border [INSENSITIVE] = @grey border [ACTIVE] = @blue } } class "GtkScrollbar" style "scrollbar" style "paned" { GtkPaned::handle-size = 8 engine "moblin-netbook-engine" { border [NORMAL] = lighter (@grey) border [PRELIGHT] = lighter (@grey) } } class "GtkPaned" style "paned" style "scale" { GtkScale::slider_length = 27 GtkScale::slider_width = 16 GtkWidget::focus-line-width = 0 # handle colour bg [NORMAL] = "#fff" bg [PRELIGHT] = @blue #trough color bg [ACTIVE] = @blue bg [SELECTED] = @blue bg [INSENSITIVE] = "#f1f1f1" engine "moblin-netbook-engine" { radius = 3 border [ACTIVE] = shade (0.8, @blue) border [PRELIGHT] = shade (0.8, @blue) border [SELECTED] = "red" } } class "GtkScale" style "scale" style "treeview_headers" { bg [NORMAL] = @bg_color fg [NORMAL] = @fg_color } widget_class "*.GtkTreeView.GtkButton*" style "treeview_headers" style "treeview" { text [SELECTED] = @selected_fg_color xthickness = 10 } widget_class "*.GtkTreeView*" style "treeview" style "menu" { bg [NORMAL] = "#fff" GtkMenu::vertical_padding = 0 xthickness = 1 ythickness = 6 engine "moblin-netbook-engine" { radius = 1 } } class "GtkMenu" style "menu" style "menu-separator" { engine "moblin-netbook-engine" { border [NORMAL] = "#dddddd" } } widget_class "*Menu*.*Sepa*" style "menu-separator" style "toolbar" { GtkToolbar::internal_padding = 2 GtkToolbar::shadow_type = GTK_SHADOW_NONE xthickness = 0 bg [NORMAL] = "#f1f1f1" engine "moblin-netbook-engine" { radius = 0 } } widget_class "*Toolbar*" style "toolbar" style "menubar" { bg [NORMAL] = @menubar_color fg [NORMAL] = "#ffffff" bg [PRELIGHT] = @blue fg [PRELIGHT] = "#ffffff" fg [INSENSITIVE] = mix(0.5, @menubar_color, "black") GtkMenuBar::shadow_type = GTK_SHADOW_NONE engine "moblin-netbook-engine" { radius = 1 border [NORMAL] = "red" } } # Strange magic, two classes needed to style everything properly widget_class "*.GtkMenuBar.*" style "menubar" class "GtkMenuBar" style "menubar" # Toolbar Handleboxes style "toolbar-handlebox" { bg [NORMAL] = @toolbar_color engine "moblin-netbook-engine" { radius = 0 border [NORMAL] = @toolbar_color } } class "GtkHandleBox" style "toolbar-handlebox" style "toolbar-arrow" { fg [NORMAL] = @blue fg [PRELIGHT] = @blue } widget_class "*.*GtkArrow*" style "toolbar-arrow" style "infobar" { bg [NORMAL] = @blue bg [NORMAL] = @blue base [NORMAL] = @blue text [NORMAL] = @blue } widget_class "GtkInfobar" style "infobar" widget_class "GtkInfoBar" style "infobar" style "toolbar-button" = "button" { fg [NORMAL] = @fg_color fg [PRELIGHT] = @fg_color fg [ACTIVE] = @fg_color fg [SELECTED] = @fg_color xthickness = 2 ythickness = 2 engine "moblin-netbook-engine" { border [PRELIGHT] = shade(0.85, @blue) border [ACTIVE] = shade(0.85, @blue) border [SELECTED] = shade(0.85, @blue) radius = 3 } } widget_class "*.*utton*" style "toolbar-button" style "nautilus-pathbar-arrow-button" = "toolbar-button" { bg [NORMAL] = mix(0.88, @toolbar_color, "white") xthickness = 2 ythickness = 2 engine "moblin-netbook-engine" { border [NORMAL] = mix(0.88, @toolbar_color, "white") border [PRELIGHT] = mix(0.88, @toolbar_color, "white") border [ACTIVE] = mix(0.88, @toolbar_color, "white") border [SELECTED] = mix(0.88, @toolbar_color, "white") radius = 3 } } widget_class "*.NautilusPathBar.GtkButton" style "nautilus-pathbar-arrow-button" style "spinbutton" = "button" { text [PRELIGHT] = @fg_color text [NORMAL] = @fg_color fg [NORMAL] = @blue fg [PRELIGHT] = @blue xthickness = 4 ythickness = 4 engine "moblin-netbook-engine" { border [NORMAL] = @grey border [PRELIGHT] = @blue border [ACTIVE] = @blue border [SELECTED] = @blue radius = 3 } } widget_class "*Spin*" style "spinbutton" style "togglebutton" = "button" { bg [NORMAL] = "#fbfbfb" bg [ACTIVE] = "#fff" engine "moblin-netbook-engine" { border [NORMAL] = "#b3b6b7" border [PRELIGHT] = shade (0.8, @blue) border [ACTIVE] = shade (0.8, @blue) border [SELECTED] = shade (0.8, @blue) radius = 3 } } widget_class "*Toggle*" style "togglebutton" style "arrow" { fg [NORMAL] = @blue } class "GtkArrow" style "arrow" style "combo-box-entry-arrow" { fg [PRELIGHT] = @blue fg [ACTIVE] = @blue fg [NORMAL] = @blue } widget_class "*.GtkComboBox*GtkArrow" style "combo-box-entry-arrow" style "notebook" { GtkNotebook::tab-overlap = 1 GtkNotebook::tab-curvature = 12 GtkNotebook::focus-line-width = 0 ythickness = 4 xthickness = 4 engine "moblin-netbook-engine" { radius = 3 border [ACTIVE] = lighter (@grey) } } class "GtkNotebook" style "notebook" style "mux-banner" { base [NORMAL] = "#eeeeec" text [NORMAL] = "#2b2b2b" } class "MuxBanner" style "mux-banner" style "mux-frame" { bg [NORMAL] = "#ffffff" } class "MuxFrame" style "mux-frame" style "mux-banner" { base [NORMAL] = "#eeeeec" text [NORMAL] = "#2b2b2b" } class "MuxBanner" style "mux-banner" style "combobox" = "button" { xthickness = 5 ythickness = 5 text [PRELIGHT] = @fg_color text [NORMAL] = @fg_color fg [NORMAL] = @blue fg [PRELIGHT] = @blue engine "moblin-netbook-engine" { border [NORMAL] = @grey border [PRELIGHT] = @blue border [ACTIVE] = @blue radius = 3 } } widget_class "*Combo*" style "combobox" style "optionbox" = "combobox" { fg [NORMAL] = @fg_color fg [PRELIGHT] = @fg_color engine "moblin-netbook-engine" { border [NORMAL] = @grey border [PRELIGHT] = @blue border [ACTIVE] = @blue radius = 3 } } widget_class "*Option*" style "optionbox" style "nautilus_location" { bg [NORMAL] = shade(1.5, @grey) text [NORMAL] = @selected_fg_color } widget "*.*nautilus-extra-view-widget" style : highest "nautilus_location" style "separator" { engine "moblin-netbook-engine" { border [NORMAL] = "#dddddd" radius = 3 } } widget_class "*Separator*" style "separator" style "toolbar-separator" { engine "moblin-netbook-engine" { border [NORMAL] = mix(0.2, @menubar_color, "white") } } widget_class "*.*eparator*" style "toolbar-separator" style "window" { bg [NORMAL] = "#f9f9f9" } widget_class "GtkWindow" style "window" style "statusbar-resize" { bg [ACTIVE] = shade (0.8, @bg_color) } class "GtkStatusbar" style "statusbar-resize" style "statusbar" { xthickness = 4 ythickness = 4 fg [NORMAL] = @fg_color fg [PRELIGHT] = @fg_color engine "moblin-netbook-engine" { radius = 3 border [NORMAL] = @bg_color } } widget_class "**" style "statusbar" style "tooltip" { xthickness = 7 ythickness = 7 text [NORMAL] = "#fff" text [PRELIGHT] = "#fff" text [SELECTED] = "#fff" text [ACTIVE] = "#fff" text [INSENSITIVE] = "#fff" bg [NORMAL] = @menubar_color fg [NORMAL] = "#fff" bg [ACTIVE] = @menubar_color fg [ACTIVE] = "#fff" bg [SELECTED] = @menubar_color fg [SELECTED] = "#fff" } widget_class "*.*tooltips*.*.GtkToggleButton" style "tooltip" widget "*.*gtk-tooltips*" style "tooltip" widget "*gtk-tooltip*" style "tooltip" # The GNOME Panel widget_class "*Panel*" style "toolbar" style "panel-button" = "toolbar-button" { xthickness = 4 ythickness = 4 } widget_class "*Panel*Button*" style "panel-button" # Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646 # Note that the work around assumes that the combobox is _not_ in # appears-as-list mode. # Similar hack also in the menuitem style. # This style does not affect GtkComboBoxEntry, it does have an effect # on comboboxes in appears-as-list mode though. style "clearlooks-text-is-fg-color-workaround" { text [NORMAL] = @fg_color text [PRELIGHT] = @fg_color text [SELECTED] = @fg_color text [ACTIVE] = @fg_color text [INSENSITIVE] = darker (@bg_color) } widget_class "*.." style "clearlooks-text-is-fg-color-workaround" style "clearlooks-menuitem-text-is-fg-color-workaround" { text [NORMAL] = @fg_color text [PRELIGHT] = @selected_fg_color text [SELECTED] = @selected_fg_color text [ACTIVE] = @fg_color text [INSENSITIVE] = darker (@bg_color) } widget "*.gtk-combobox-popup-menu.*" style "clearlooks-menuitem-text-is-fg-color-workaround" style "moblin-toolbar" { bg[NORMAL] = "#333" fg[NORMAL] = "#fff" xthickness = 6 ythickness = 6 } widget "*moblin-toolbar" style "moblin-toolbar" style "moblin-toolbar-child" { xthickness = 6 ythickness = 6 bg[NORMAL] = "#333" fg[NORMAL] = "#fff" bg[PRELIGHT] = "#666" fg[PRELIGHT] = "#fff" engine "moblin-netbook-engine" { border [NORMAL] = "#333" border [PRELIGHT] = "#666" } } widget "*moblin-toolbar.*" style "moblin-toolbar-child" style "entry" { GtkEntry::state-hint = 1 text [ACTIVE] = @text_color base [ACTIVE] = @base_color xthickness = 4 ythickness = 4 engine "moblin-netbook-engine" { radius = 3 border [ACTIVE] = @blue } } class "GtkEntry" style "entry" widget_class "*GtkEntry*" style "entry" moblin-gtk-engine-1.1.1/data/index.theme000066400000000000000000000002661133531263600200730ustar00rootroot00000000000000[X-GNOME-Metatheme] Name=Moblin Netbook Type=X-GNOME-Metatheme Comment=Theme for Moblin Netbooks Encoding=UTF-8 GtkTheme=Moblin-Netbook MetacityTheme=Moblin-Netbook IconTheme=Moblin moblin-gtk-engine-1.1.1/data/metacity-theme-1.xml000066400000000000000000000247661133531263600215520ustar00rootroot00000000000000 Moblin Netbook Intel  Intel Jan 2008 Theme for Moblin Netbooks <title color="#ffffff" x="0" y="(((height - title_height) / 2) `max` 0)"/> </draw_ops> <draw_ops name="title_text_unfocused"> <title color="#fff" x="0" y="(((height - title_height) / 2) `max` 0)"/> </draw_ops> <!-- Buttons --> <!-- we only care about a close icon --> <draw_ops name="close_button_icon"> <line color="#bbb" width="2" x1="ButtonIPad" y1="ButtonIPad" x2="width-ButtonIPad-1" y2="height - ButtonIPad-1"/> <line color="#bbb" width="1" x1="ButtonIPad" y1="ButtonIPad" x2="width-ButtonIPad" y2="height - ButtonIPad"/> <line color="#bbb" width="2" x1="ButtonIPad" y1="height - ButtonIPad-1" x2="width-ButtonIPad-1" y2="ButtonIPad"/> <line color="#bbb" width="1" x1="ButtonIPad" y1="height - ButtonIPad-1" x2="width-ButtonIPad" y2="ButtonIPad - 1"/> </draw_ops> <draw_ops name="close_button_icon_prelight"> <line color="#ffffff" width="2" x1="ButtonIPad" y1="ButtonIPad" x2="width-ButtonIPad-1" y2="height - ButtonIPad-1"/> <line color="#ffffff" width="1" x1="ButtonIPad" y1="ButtonIPad" x2="width-ButtonIPad" y2="height - ButtonIPad"/> <line color="#ffffff" width="2" x1="ButtonIPad" y1="height - ButtonIPad-1" x2="width-ButtonIPad-1" y2="ButtonIPad"/> <line color="#ffffff" width="1" x1="ButtonIPad" y1="height - ButtonIPad-1" x2="width-ButtonIPad" y2="ButtonIPad - 1"/> </draw_ops> <draw_ops name="close_button_normal"> <include name="close_button_icon"/> </draw_ops> <draw_ops name="close_button_prelight"> <include name="close_button_icon_prelight"/> </draw_ops> <draw_ops name="close_button_pressed"> <include name="close_button_icon"/> </draw_ops> <draw_ops name="close_button_unfocused"> <include name="close_button_icon"/> </draw_ops> <draw_ops name="blank"> <!-- nothing --> </draw_ops> <frame_style name="normal" geometry="normal"> <piece position="entire_background" draw_ops="title_unfocused"/> <piece position="title" draw_ops="title_text_unfocused"/> <button function="close" state="normal" draw_ops="close_button_unfocused"/> <button function="close" state="pressed" draw_ops="close_button_pressed"/> <button function="close" state="prelight" draw_ops="close_button_prelight"/> <button function="maximize" state="normal" draw_ops="blank"/> <button function="maximize" state="pressed" draw_ops="blank"/> <button function="minimize" state="normal" draw_ops="blank"/> <button function="minimize" state="pressed" draw_ops="blank"/> <button function="menu" state="normal" draw_ops="blank"/> <button function="menu" state="pressed" draw_ops="blank"/> </frame_style> <frame_style name="focused" geometry="normal" parent="normal"> <piece position="entire_background" draw_ops="title"/> <piece position="title" draw_ops="title_text"/> <button function="close" state="normal" draw_ops="close_button_normal"/> <button function="close" state="prelight" draw_ops="close_button_prelight"/> </frame_style> <frame_style name="normal_maximized" geometry="normal_maximized"> <piece position="entire_background" draw_ops="title_maximised_unfocused"/> <piece position="title" draw_ops="title_text_unfocused"/> <button function="close" state="normal" draw_ops="close_button_unfocused"/> <button function="close" state="pressed" draw_ops="close_button_pressed"/> <button function="close" state="prelight" draw_ops="close_button_prelight"/> <button function="maximize" state="normal" draw_ops="blank"/> <button function="maximize" state="pressed" draw_ops="blank"/> <button function="minimize" state="normal" draw_ops="blank"/> <button function="minimize" state="pressed" draw_ops="blank"/> <button function="menu" state="normal" draw_ops="blank"/> <button function="menu" state="pressed" draw_ops="blank"/> </frame_style> <frame_style name="focused_maximized" geometry="normal_maximized" parent="normal_maximized"> <piece position="entire_background" draw_ops="title_maximised"/> <piece position="title" draw_ops="title_text"/> <button function="close" state="normal" draw_ops="close_button_normal"/> <button function="close" state="prelight" draw_ops="close_button_prelight"/> </frame_style> <frame_style name="border" geometry="border" parent="normal"> <piece position="entire_background" draw_ops="title_unfocused"/> </frame_style> <frame_style_set name="normal"> <frame focus="yes" state="normal" resize="both" style="focused"/> <frame focus="no" state="normal" resize="both" style="normal"/> <frame focus="yes" state="maximized" style="focused_maximized"/> <frame focus="no" state="maximized" style="normal_maximized"/> <frame focus="yes" state="shaded" style="focused"/> <frame focus="no" state="shaded" style="normal"/> <frame focus="yes" state="maximized_and_shaded" style="focused_maximized"/> <frame focus="no" state="maximized_and_shaded" style="normal_maximized"/> </frame_style_set> <frame_style_set name="utility" parent="normal"> <frame focus="yes" state="normal" resize="both" style="focused"/> <frame focus="no" state="normal" resize="both" style="normal"/> <!-- this is a bunch of crack since utility windows shouldn't be maximized --> <frame focus="yes" state="maximized" style="focused"/> <frame focus="no" state="maximized" style="normal"/> <frame focus="yes" state="shaded" style="focused"/> <frame focus="no" state="shaded" style="normal"/> <frame focus="yes" state="maximized_and_shaded" style="focused"/> <frame focus="no" state="maximized_and_shaded" style="normal"/> </frame_style_set> <frame_style_set name="border"> <frame focus="yes" state="normal" resize="both" style="border"/> <frame focus="no" state="normal" resize="both" style="border"/> <frame focus="yes" state="maximized" style="border"/> <frame focus="no" state="maximized" style="border"/> <frame focus="yes" state="shaded" style="border"/> <frame focus="no" state="shaded" style="border"/> <frame focus="yes" state="maximized_and_shaded" style="border"/> <frame focus="no" state="maximized_and_shaded" style="border"/> </frame_style_set> <window type="normal" style_set="normal"/> <window type="dialog" style_set="normal"/> <window type="modal_dialog" style_set="normal"/> <window type="menu" style_set="normal"/> <window type="utility" style_set="normal"/> <window type="border" style_set="border"/> <menu_icon function="close" state="normal" draw_ops="close_button_icon"/> </metacity_theme> ����������moblin-gtk-engine-1.1.1/src/������������������������������������������������������������������������0000775�0000000�0000000�00000000000�11335312636�0015612�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-main.c���������������������������������������������������0000664�0000000�0000000�00000002367�11335312636�0021627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #include <gtk/gtk.h> #include <gmodule.h> #include <stdio.h> #include "moblin-netbook-style.h" #include "moblin-netbook-rc-style.h" G_MODULE_EXPORT void theme_init (GTypeModule *module) { _moblin_netbook_rc_style_register_type (module); _moblin_netbook_style_register_type (module); } G_MODULE_EXPORT void theme_exit(void) { } G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void) { return GTK_RC_STYLE (g_object_new (MOBLIN_NETBOOK_TYPE_RC_STYLE, NULL)); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-rc-style.c�����������������������������������������������0000664�0000000�0000000�00000015150�11335312636�0022437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #include <gtk/gtk.h> #include <stdio.h> #include "moblin-netbook-rc-style.h" #include "moblin-netbook-style.h" G_DEFINE_DYNAMIC_TYPE (MoblinNetbookRcStyle, moblin_netbook_rc_style, GTK_TYPE_RC_STYLE) enum { TOKEN_BORDER_COLOR = G_TOKEN_LAST + 1, TOKEN_RADIUS, TOKEN_SHADOW, }; static struct { gchar *name; guint token; } moblin_rc_symbols[] = { { "border", TOKEN_BORDER_COLOR }, { "radius", TOKEN_RADIUS }, { "shadow", TOKEN_SHADOW }, { NULL, 0 } }; static GtkStyle * moblin_netbook_rc_style_create_style (GtkRcStyle *rc_style) { return GTK_STYLE (g_object_new (MOBLIN_NETBOOK_TYPE_STYLE, NULL)); } static guint moblin_get_token (GScanner *scanner, guint expected) { guint token; token = g_scanner_peek_next_token (scanner); if (token != expected) { return expected; } else { g_scanner_get_next_token (scanner); return G_TOKEN_NONE; } } static guint moblin_parse_border_color (GScanner *scanner, MoblinNetbookRcStyle *rc_style) { guint token; GtkStateType state_type; GdkColor color; /* border-color */ g_scanner_get_next_token (scanner); /* [state] */ token = gtk_rc_parse_state (scanner, &state_type); if (token != G_TOKEN_NONE) return token; /* = */ token = moblin_get_token (scanner, G_TOKEN_EQUAL_SIGN); if (token != G_TOKEN_NONE) return token; token = gtk_rc_parse_color_full (scanner, (GtkRcStyle *) rc_style, &color); if (token != G_TOKEN_NONE) return token; rc_style->border_color[state_type] = color; rc_style->border_color_set[state_type] = TRUE; return G_TOKEN_NONE; } static guint moblin_netbook_rc_style_parse (GtkRcStyle *rc_style, GtkSettings *settings, GScanner *scanner) { GTokenType token; static GQuark scope_id; guint old_scope; int i; MoblinNetbookRcStyle *mb_style = MOBLIN_NETBOOK_RC_STYLE (rc_style); if (!scope_id) scope_id = g_quark_from_string ("moblin-gtk-engine"); /* set the new scope and store the old scope id */ old_scope = g_scanner_set_scope (scanner, scope_id); /* register the symbols if we haven't already done so */ if (!g_scanner_lookup_symbol (scanner, moblin_rc_symbols[0].name)) { for (i = 0; moblin_rc_symbols[i].name; i++) { g_scanner_scope_add_symbol (scanner, scope_id, moblin_rc_symbols[i].name, GINT_TO_POINTER (moblin_rc_symbols[i]. token)); } } token = g_scanner_peek_next_token (scanner); while (token != G_TOKEN_RIGHT_CURLY) { switch (token) { case TOKEN_BORDER_COLOR: token = moblin_parse_border_color (scanner, mb_style); break; case TOKEN_RADIUS: g_scanner_get_next_token (scanner); token = moblin_get_token (scanner, G_TOKEN_EQUAL_SIGN); if (token != G_TOKEN_NONE) break; token = moblin_get_token (scanner, G_TOKEN_INT); if (token != G_TOKEN_NONE) break; mb_style->radius = scanner->value.v_int; break; case TOKEN_SHADOW: g_scanner_get_next_token (scanner); token = moblin_get_token (scanner, G_TOKEN_EQUAL_SIGN); if (token != G_TOKEN_NONE) break; token = moblin_get_token (scanner, G_TOKEN_FLOAT); if (token != G_TOKEN_NONE) break; mb_style->shadow = scanner->value.v_float; mb_style->shadow_set = TRUE; break; default: g_scanner_get_next_token (scanner); token = G_TOKEN_RIGHT_CURLY; break; } if (token != G_TOKEN_NONE) { return token; } token = g_scanner_peek_next_token (scanner); } g_scanner_get_next_token (scanner); g_scanner_set_scope (scanner, old_scope); return G_TOKEN_NONE; } static void moblin_netbook_rc_style_merge (GtkRcStyle *adest, GtkRcStyle *asrc) { MoblinNetbookRcStyle *dest; MoblinNetbookRcStyle *src; gint state; /* chain up */ GTK_RC_STYLE_CLASS (moblin_netbook_rc_style_parent_class)->merge (adest, asrc); /* we can't handle merge unless both src and dest are our class */ if (!(MOBLIN_NETBOOK_IS_RC_STYLE (adest) && MOBLIN_NETBOOK_IS_RC_STYLE (asrc))) { return; } dest = (MoblinNetbookRcStyle *) adest; src = (MoblinNetbookRcStyle *) asrc; if (!dest->radius_set) { dest->radius = src->radius; dest->radius_set = 1; } for (state = 0; state < 5; state++) { if (!dest->border_color_set[state] && src->border_color_set[state]) { dest->border_color_set[state] = TRUE; dest->border_color[state] = src->border_color[state]; } } if (!dest->shadow_set && src->shadow_set) { dest->shadow = src->shadow; dest->shadow_set = TRUE; } } static void moblin_netbook_rc_style_class_init (MoblinNetbookRcStyleClass *klass) { GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass); rc_style_class->create_style = moblin_netbook_rc_style_create_style; rc_style_class->parse = moblin_netbook_rc_style_parse; rc_style_class->merge = moblin_netbook_rc_style_merge; } static void moblin_netbook_rc_style_class_finalize (MoblinNetbookRcStyleClass *rc_style) { } static void moblin_netbook_rc_style_init (MoblinNetbookRcStyle *rc_style) { /* set up defaults */ rc_style->radius = 0; rc_style->shadow = 0; rc_style->radius_set = 0; } void _moblin_netbook_rc_style_register_type (GTypeModule *module) { moblin_netbook_rc_style_register_type (module); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-rc-style.h�����������������������������������������������0000664�0000000�0000000�00000006360�11335312636�0022447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #ifndef MOBLIN_NETBOOK_RC_STYLE_H #define MOBLIN_NETBOOK_RC_STYLE_H #include <gtk/gtk.h> #include <gmodule.h> G_BEGIN_DECLS #define MOBLIN_NETBOOK_TYPE_RC_STYLE \ moblin_netbook_rc_style_get_type() #define MOBLIN_NETBOOK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST (( \ object), \ MOBLIN_NETBOOK_TYPE_RC_STYLE, \ MoblinNetbookRcStyle)) #define MOBLIN_NETBOOK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (( \ klass), \ MOBLIN_NETBOOK_TYPE_RC_STYLE, \ MoblinNetbookRcStyleClass)) #define MOBLIN_NETBOOK_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE (( \ object), \ MOBLIN_NETBOOK_TYPE_RC_STYLE)) #define MOBLIN_NETBOOK_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE (( \ klass), \ MOBLIN_NETBOOK_TYPE_RC_STYLE)) #define MOBLIN_NETBOOK_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (( \ obj), \ MOBLIN_NETBOOK_TYPE_RC_STYLE, \ MoblinNetbookRcStyleClass)) typedef struct _MoblinNetbookRcStyle MoblinNetbookRcStyle; typedef struct _MoblinNetbookRcStyleClass MoblinNetbookRcStyleClass; struct _MoblinNetbookRcStyle { GtkRcStyle parent_instance; /* engine options */ gint radius; GdkColor border_color[5]; gdouble shadow; /* flags for merge */ gboolean radius_set : 1; gboolean shadow_set : 1; gboolean border_color_set[5]; }; struct _MoblinNetbookRcStyleClass { GtkRcStyleClass parent_class; }; GType moblin_netbook_rc_style_get_type (void); void _moblin_netbook_rc_style_register_type (GTypeModule *engine); G_END_DECLS #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-style.c��������������������������������������������������0000664�0000000�0000000�00000120511�11335312636�0022033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #include "config.h" #include "moblin-netbook-style.h" #include "moblin-netbook-utils.h" #include "moblin-netbook-rc-style.h" #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> static int do_debug = 0; static void print_widget_path (GtkWidget *widget); #define DEBUG \ if (do_debug == 1) \ printf ("%s: detail = '%s'; state = %d; x:%d; y:%d; w:%d; h:%d;\n", __FUNCTION__, detail, state_type, x, y, width, height); \ else if (do_debug == 2 && widget) print_widget_path (widget); #define DETAIL(foo) (detail && strcmp (foo, detail) == 0) #define LINE_WIDTH 1 G_DEFINE_DYNAMIC_TYPE (MoblinNetbookStyle, moblin_netbook_style, GTK_TYPE_STYLE) void _moblin_netbook_style_register_type (GTypeModule *module) { moblin_netbook_style_register_type (module); } static void print_widget_path (GtkWidget *widget) { static GtkWidget *previous = NULL; gchar *path; /* prevent printing lots of duplicates */ if (previous == widget) return; previous = widget; gtk_widget_path (widget, NULL, &path, NULL); printf ("widget: %s\n", path); g_free (path); gtk_widget_class_path (widget, NULL, &path, NULL); printf ("widget_class: %s\n\n", path); g_free (path); } static cairo_t* moblin_netbook_cairo_create (GdkWindow *window, GdkRectangle *area) { cairo_t *cr; cr = gdk_cairo_create (window); if (area) { cairo_rectangle (cr, area->x, area->y, area->width, area->height); cairo_clip (cr); } return cr; } static inline void moblin_netbook_set_border_color (cairo_t *cr, GtkStyle *style, GtkStateType state) { if (MOBLIN_NETBOOK_STYLE (style)->border_color) gdk_cairo_set_source_color (cr, &(MOBLIN_NETBOOK_STYLE (style)->border_color[ state])); } static void moblin_netbook_rounded_rectangle (cairo_t *cr, gdouble x, gdouble y, gdouble width, gdouble height, gdouble radius) { if (width < 1 || height < 1) return; if (radius == 0) { cairo_rectangle (cr, x, y, width, height); return; } if (width < radius * 2) { radius = width / 2; } else if (height < radius * 2) { radius = height / 2; } cairo_move_to (cr, x, y + height - radius); cairo_arc (cr, x + radius, y + radius, radius, M_PI, M_PI * 1.5); cairo_arc (cr, x + width - radius, y + radius, radius, M_PI * 1.5, 0); cairo_arc (cr, x + width - radius, y + height - radius, radius, 0, M_PI * 0.5); cairo_arc (cr, x + radius, y + height - radius, radius, M_PI * 0.5, M_PI); } static void moblin_netbook_draw_grip (cairo_t *cr, gboolean vertical, gdouble x, gdouble y, gdouble width, gdouble height) { gdouble cx, cy; gint n_strips = 3; gint strip_w = 3; gint strip_h = 8 - strip_w; gint strip_padding = 2; gint grip_w = (n_strips * strip_w) + ((n_strips - 1) * strip_padding); gint i; cairo_save (cr); cairo_set_line_width (cr, strip_w); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); if (!vertical) { cx = x + (width / 2.0) - grip_w / 2.0 + strip_w / 2.0; cy = y + (height / 2.0) - (strip_h / 2.0); for (i = 0; i < n_strips; i++) { gdouble position; position = cx + (i * (strip_w + strip_padding)); cairo_move_to (cr, position, cy); cairo_line_to (cr, position, cy + strip_h); cairo_stroke (cr); } } else { cy = y + (height / 2.0) - grip_w / 2.0 + strip_w / 2.0; cx = x + (width / 2.0) - (strip_h / 2.0); for (i = 0; i < n_strips; i++) { gdouble position; position = cy + (i * (strip_w + strip_padding)); cairo_move_to (cr, cx, position); cairo_line_to (cr, cx + strip_h, position); cairo_stroke (cr); } } cairo_restore (cr); } static void moblin_netbook_draw_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { cairo_t *cr; MoblinNetbookStyle *mb_style = MOBLIN_NETBOOK_STYLE (style); gint radius = mb_style->radius; DEBUG; if (DETAIL ("paned") || DETAIL ("buttondefault")) return; /* we want hover and focused widgets to look the same */ if (widget && GTK_WIDGET_HAS_FOCUS (widget)) state_type = GTK_STATE_PRELIGHT; /* scrollbar troughs are a plain rectangle */ if (widget && GTK_IS_SCROLLBAR (widget) && DETAIL ("trough")) { cr = moblin_netbook_cairo_create (window, area); cairo_rectangle (cr, x, y, width, height); gdk_cairo_set_source_color (cr, &style->base[state_type]); cairo_fill (cr); cairo_destroy (cr); return; } SANITIZE_SIZE; /*** treeview headers ***/ if (widget && GTK_IS_TREE_VIEW (widget->parent)) { cr = moblin_netbook_cairo_create (window, area); cairo_rectangle (cr, x, y, width, height); gdk_cairo_set_source_color (cr, &style->bg[state_type]); cairo_fill (cr); cairo_destroy (cr); gtk_paint_vline (style, window, state_type, area, widget, detail, y + 5, y + height - 5, x + width - 1); return; } /*** spin buttons ***/ if (DETAIL ("spinbutton_down") || DETAIL ("spinbutton_up")) return; if (DETAIL ("spinbutton")) { /* FIXME: for RTL */ width += 10; x -= 10; /* always draw button as shadow out to match the entry */ shadow_type = GTK_SHADOW_OUT; /* draw the buttons with the same state type as the entry */ state_type = widget->state; } /*** combo boxes ***/ if (DETAIL ("button") && widget && GTK_IS_COMBO_BOX_ENTRY (widget->parent)) { GtkWidget *entry; entry = g_object_get_data (G_OBJECT (widget->parent), "moblin-netbook-combo-entry"); g_object_set_data (G_OBJECT (widget->parent), "moblin-netbook-combo-button", widget); /* always draw combo box entry buttons as shadow out to match the entry */ shadow_type = GTK_SHADOW_OUT; if (GTK_IS_ENTRY (entry)) { gtk_widget_queue_draw (entry); } /* FIXME: RTL */ width += 10; x -= 10; } if (widget && (DETAIL ("trough") || DETAIL ("trough-fill-level") || DETAIL ("trough-fill-level-full")) && GTK_IS_SCALE (widget)) { if (mb_style->shadow) { width--; height--; } if (width > height) { y = y + (height / 2.0 - 2); height = 4; } else { x = x + (width / 2.0 - 2); width = 4; } } /* scrollbar buttons */ if (DETAIL ("hscrollbar") || DETAIL ("vscrollbar")) { x += 2; y += 2; width -= 4; height -= 4; } /* scrollbar slider */ if (DETAIL ("slider")) { if (widget && GTK_IS_HSCROLLBAR (widget)) { y += 2; height -= 4; } else { x += 2; width -= 4; } } cr = moblin_netbook_cairo_create (window, area); cairo_set_line_width (cr, LINE_WIDTH); /* special "fill" indicator */ if (DETAIL ("trough-fill-level-full") || DETAIL ("trough-fill-level")) { gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_SELECTED]); if (width > height) cairo_rectangle (cr, x, y + 1, width, height - 2); else cairo_rectangle (cr, x + 1, y, width - 2, height); cairo_fill (cr); cairo_destroy (cr); return; } if (mb_style->shadow) { if (shadow_type == GTK_SHADOW_OUT) { /* outer shadow */ moblin_netbook_rounded_rectangle (cr, x, y, width, height, radius + 1); cairo_set_source_rgba (cr, 0, 0, 0, mb_style->shadow); cairo_fill (cr); /* reduce size for outer shadow */ height--; width--; } else if (shadow_type == GTK_SHADOW_IN) { x++; y++; width--; height--; } } /* fill */ moblin_netbook_rounded_rectangle (cr, x, y, width, height, radius); gdk_cairo_set_source_color (cr, &style->bg[state_type]); cairo_fill (cr); /* extra hilight for "button" widgets, also used as focus rectangle since * state_type is set to prelight for focused widgets (see above) */ if (state_type == GTK_STATE_PRELIGHT && DETAIL ("button") && !(widget && GTK_IS_COMBO_BOX_ENTRY (widget->parent))) { cairo_set_line_width (cr, 2.0); moblin_netbook_rounded_rectangle (cr, x + 2, y + 2, width - 4, height - 4, radius - 1); gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_SELECTED]); cairo_stroke (cr); cairo_set_line_width (cr, 1.0); } if (shadow_type != GTK_SHADOW_NONE) { /* border */ moblin_netbook_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius); moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); } /* add a grip to handles */ if (DETAIL ("light-switch-handle") || DETAIL ("hscale")) { gdk_cairo_set_source_color (cr, &style->mid[state_type]); moblin_netbook_draw_grip (cr, FALSE, x, y, width, height); } else if (DETAIL ("vscale")) { gdk_cairo_set_source_color (cr, &style->mid[state_type]); moblin_netbook_draw_grip (cr, TRUE, x, y, width, height); } cairo_destroy (cr); } static void moblin_netbook_draw_shadow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { cairo_t *cr; MoblinNetbookStyle *mb_style = MOBLIN_NETBOOK_STYLE (style); gdouble radius = mb_style->radius; DEBUG; if (shadow_type == GTK_SHADOW_NONE) return; SANITIZE_SIZE; cr = moblin_netbook_cairo_create (window, area); /* initilise the background in the corners to the colour of the widget */ if (widget) { cairo_rectangle (cr, x, y, width, height); if (mb_style->shadow) moblin_netbook_rounded_rectangle (cr, x, y, width - 1, height - 1, radius); else moblin_netbook_rounded_rectangle (cr, x, y, width, height, radius); gdk_cairo_set_source_color (cr, &widget->style->bg[state_type]); cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD); cairo_fill (cr); } /* FIXME: for RTL */ if (widget && DETAIL ("entry") && (GTK_IS_SPIN_BUTTON (widget) || GTK_IS_COMBO_BOX_ENTRY (widget->parent))) width += 10; if (widget && DETAIL ("entry") && GTK_IS_COMBO_BOX_ENTRY (widget->parent)) { GtkWidget *button; g_object_set_data (G_OBJECT (widget->parent), "moblin-netbook-combo-entry", widget); button = g_object_get_data (G_OBJECT (widget->parent), "moblin-netbook-combo-button"); if (button) { if (GTK_WIDGET_HAS_FOCUS (button)) state_type = GTK_STATE_PRELIGHT; else /* try and keep the button and entry in the same state */ gtk_widget_set_state (button, state_type); } width += 10; } cairo_translate (cr, 0.5, 0.5); width--; height--; cairo_set_line_width (cr, 1.0); if (mb_style->shadow != 0.0) { /* outer shadow */ moblin_netbook_rounded_rectangle (cr, x, y, width, height, radius + 1.0); cairo_set_source_rgba (cr, 0, 0, 0, mb_style->shadow); cairo_stroke (cr); /* reduce size for outer shadow */ height--; width--; } /* border */ moblin_netbook_rounded_rectangle (cr, x, y, width, height, radius); moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_check (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { cairo_t *cr; gint radius = MOBLIN_NETBOOK_STYLE (style)->radius; DEBUG; cr = moblin_netbook_cairo_create (window, area); cairo_set_line_width (cr, 1.0); if (shadow_type == GTK_SHADOW_IN && state_type != GTK_STATE_INSENSITIVE) { state_type = GTK_STATE_SELECTED; } /* we don't support anything other than 15x15 */ width = 15; height = 15; moblin_netbook_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1, height - 1, radius); /* fill the background */ gdk_cairo_set_source_color (cr, &style->base[state_type]); cairo_fill_preserve (cr); /* draw the border */ moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); gdk_cairo_set_source_color (cr, &style->text[state_type]); /* draw a tick when checked */ if (shadow_type == GTK_SHADOW_IN) { cairo_translate (cr, x, y); cairo_move_to (cr, 3, 6); cairo_line_to (cr, 6, 9); cairo_line_to (cr, 12, 3); cairo_line_to (cr, 12, 6); cairo_line_to (cr, 6, 12); cairo_line_to (cr, 3, 9); cairo_line_to (cr, 3, 6); cairo_fill (cr); } cairo_destroy (cr); } static void moblin_netbook_draw_option (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { cairo_t *cr; gint cx, cy, radius; DEBUG; cr = moblin_netbook_cairo_create (window, area); cairo_set_line_width (cr, 1); cairo_translate (cr, 0.5, 0.5); width--; height--; if (shadow_type == GTK_SHADOW_IN && state_type != GTK_STATE_INSENSITIVE) { state_type = GTK_STATE_SELECTED; } /* define radius and centre coordinates */ if (width % 2) width--; radius = width / 2; cx = x + radius; cy = y + radius; /* fill the background */ gdk_cairo_set_source_color (cr, &style->base[state_type]); cairo_arc (cr, cx, cy, radius, 0, M_PI * 2); cairo_fill (cr); /* draw the border */ cairo_arc (cr, cx, cy, radius, 0, M_PI * 2); moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); /*** draw check mark ***/ if (shadow_type == GTK_SHADOW_IN) { cairo_arc (cr, cx, cy, radius - 4, 0, M_PI * 2); gdk_cairo_set_source_color (cr, &style->text[state_type]); cairo_fill (cr); } cairo_destroy (cr); } static void moblin_netbook_draw_box_gap (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width) { cairo_t *cr; GdkRectangle rect = { 0, }; if (shadow_type == GTK_SHADOW_NONE) return; cr = moblin_netbook_cairo_create (window, area); cairo_set_line_width (cr, LINE_WIDTH); cairo_translate (cr, 0.5, 0.5); moblin_netbook_set_border_color (cr, style, state_type); /* start off with a rectangle... */ cairo_rectangle (cr, x, y, width -1, height -1); cairo_stroke (cr); cairo_destroy (cr); switch (gap_side) { case GTK_POS_TOP: rect.x = x + gap_x + LINE_WIDTH; rect.y = y; rect.width = gap_width - LINE_WIDTH * 2; rect.height = LINE_WIDTH; break; case GTK_POS_BOTTOM: rect.x = x + gap_x + LINE_WIDTH; rect.y = y + height - 2; rect.width = gap_width - LINE_WIDTH * 2; rect.height = 2; break; case GTK_POS_LEFT: rect.x = x; rect.y = y + gap_x + LINE_WIDTH; rect.width = 2; rect.height = gap_width - LINE_WIDTH * 2; break; case GTK_POS_RIGHT: rect.x = x + width - 2; rect.y = y + gap_x + LINE_WIDTH; rect.width = 2; rect.height = gap_width - LINE_WIDTH * 2; break; } /* and finally blank out the gap */ gtk_style_apply_default_background (style, window, TRUE, state_type, area, rect.x, rect.y, rect.width, rect.height); } static void moblin_netbook_draw_extension (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side) { cairo_t *cr; cairo_pattern_t *pattern; gint radius = MOBLIN_NETBOOK_STYLE (style)->radius; /* initialise the background */ gtk_style_apply_default_background (style, window, TRUE, state_type, area, x, y, width, height); cr = moblin_netbook_cairo_create (window, area); /* set up for line drawing */ cairo_set_line_width (cr, LINE_WIDTH); cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE); cairo_translate (cr, 0.5, 0.5); /* reduce with and height since we are using them for co-ordinate values */ width--; height--; /* tab border */ switch (gap_side) { case GTK_POS_TOP: /* bottom tab */ cairo_move_to (cr, x, y); cairo_arc_negative (cr, x + radius, y + height - radius, radius, M_PI, M_PI * 0.5); cairo_arc_negative (cr, x + width - radius, y + height - radius, radius, M_PI * 0.5, 0); cairo_line_to (cr, x + width, y); break; case GTK_POS_BOTTOM: /* top tab */ height++; /* add overlap */ if (state_type == GTK_STATE_NORMAL) cairo_arc_negative (cr, x, y + height - radius, radius, M_PI / 2.0, 0); else cairo_move_to (cr, x + radius, y + height); cairo_arc (cr, x + radius * 2, y + radius, radius, M_PI, M_PI * 1.5); cairo_arc (cr, x + width - radius * 2, y + radius, radius, M_PI * 1.5, 0); if (state_type == GTK_STATE_NORMAL) cairo_arc_negative (cr, x + width, y + height - radius, radius, M_PI, M_PI / 2.0); else cairo_line_to (cr, x + width - radius, y + height); break; case GTK_POS_LEFT: /* right tab */ cairo_move_to (cr, x, y); cairo_arc (cr, x + width - radius, y + radius, radius, M_PI * 1.5, 0); cairo_arc (cr, x + width - radius, y + height - radius, radius, 0, M_PI * 0.5); cairo_line_to (cr, x, y + height); break; case GTK_POS_RIGHT: /* left tab */ cairo_move_to (cr, x + width, y); cairo_arc_negative (cr, x + radius, y + radius, radius, M_PI * 1.5, M_PI); cairo_arc_negative (cr, x + radius, y + height - radius, radius, M_PI, M_PI * 0.5); cairo_line_to (cr, x + width, y + height); break; } if (state_type == GTK_STATE_NORMAL) { pattern = cairo_pattern_create_linear (x, y, x, y +height); cairo_pattern_add_color_stop_rgb (pattern, 0, 0xf9/255.0, 0xf9/255.0,0xf9/255.0); cairo_pattern_add_color_stop_rgb (pattern, 1, 0xe6/255.0, 0xe6/255.0,0xe6/255.0); cairo_set_source (cr, pattern); cairo_fill_preserve (cr); cairo_pattern_destroy (pattern); } moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_vline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint y1, gint y2, gint x) { cairo_t *cr; if (DETAIL ("vscale") || DETAIL ("hscale")) return; if (DETAIL ("vseparator")) return; cr = gdk_cairo_create (window); cairo_set_line_width (cr, LINE_WIDTH); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); cairo_move_to (cr, x + LINE_WIDTH / 2.0, y1); cairo_line_to (cr, x + LINE_WIDTH / 2.0, y2); moblin_netbook_set_border_color (cr, style, state_type); cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_hline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x1, gint x2, gint y) { cairo_t *cr; if (DETAIL ("vscale") || DETAIL ("hscale")) return; cr = gdk_cairo_create (window); cairo_set_line_width (cr, LINE_WIDTH); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); moblin_netbook_set_border_color (cr, style, state_type); cairo_move_to (cr, x1, y + LINE_WIDTH / 2.0); cairo_line_to (cr, x2, y + LINE_WIDTH / 2.0); cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { cairo_t *cr; gint line_width; MoblinNetbookStyle *mb_style = MOBLIN_NETBOOK_STYLE (style); /* button draws it's own focus */ if (DETAIL ("button")) return; cr = gdk_cairo_create (window); if (widget) gtk_widget_style_get (widget, "focus-line-width", &line_width, NULL); else line_width = 1; cairo_translate (cr, line_width / 2.0, line_width / 2.0); width -= line_width; height -= line_width; if (mb_style->shadow) { width -= 1; height -= 1; } moblin_netbook_rounded_rectangle (cr, x, y, width, height, line_width); cairo_set_line_width (cr, line_width); gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_SELECTED]); cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_arrow (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GtkArrowType arrow_type, gboolean fill, gint x, gint y, gint width, gint height) { cairo_t *cr; DEBUG; cr = moblin_netbook_cairo_create (window, area); cairo_set_line_width (cr, 2); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); gdk_cairo_set_source_color (cr, &style->fg[state_type]); /* add padding around scrollbar buttons */ if (DETAIL ("vscrollbar") || DETAIL ("hscrollbar")) { x += 3; width -= 4; y += 3; height -= 4; } /* ensure we have odd number of pixels for width or height to allow for * correct centering */ if (width % 2) width--; if (height % 2) height--; switch (arrow_type) { case GTK_ARROW_UP: y = y + height / 2 - (width * 0.12) - 1; height = width * 0.6; cairo_move_to (cr, x, y + height); cairo_line_to (cr, x + width / 2, y); cairo_line_to (cr, x + width, y + height); break; case GTK_ARROW_DOWN: y = y + height / 2 - (width * 0.12); height = width * 0.6; cairo_move_to (cr, x, y); cairo_line_to (cr, x + width / 2, y + height); cairo_line_to (cr, x + width, y); break; case GTK_ARROW_LEFT: x = x + width / 2 - (height * 0.12) - 1; width = height * 0.6; cairo_move_to (cr, x + width, y); cairo_line_to (cr, x, y + height / 2); cairo_line_to (cr, x + width, y + height); break; case GTK_ARROW_RIGHT: x = x + width / 2 - (height * 0.12); width = height * 0.6; cairo_move_to (cr, x, y); cairo_line_to (cr, x + width, y + height / 2); cairo_line_to (cr, x, y + height); break; case GTK_ARROW_NONE: break; } cairo_stroke (cr); cairo_destroy (cr); } static void moblin_netbook_draw_handle (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation) { cairo_t *cr; gdouble cx, cy, radius; DEBUG; cr = moblin_netbook_cairo_create (window, area); cx = x + width / 2; cy = y + height / 2; if (orientation == GTK_ORIENTATION_HORIZONTAL) { radius = height / 2 - 2; cairo_arc (cr, cx, cy, radius, 0, M_PI * 360); cairo_arc (cr, cx - radius * 3, cy, radius, 0, M_PI * 360); cairo_arc (cr, cx + radius * 3, cy, radius, 0, M_PI * 360); } else { radius = width / 2 - 2; cairo_arc (cr, cx, cy, radius, 0, M_PI * 360); cairo_arc (cr, cx, cy - radius * 3, radius, 0, M_PI * 360); cairo_arc (cr, cx, cy + radius * 3, radius, 0, M_PI * 360); } moblin_netbook_set_border_color (cr, style, state_type); cairo_fill (cr); cairo_destroy (cr); } static void moblin_netbook_draw_resize_grip (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GdkWindowEdge edge, gint x, gint y, gint width, gint height) { cairo_t *cr; gdouble cx, cy, radius, spacing; DEBUG; /* FIXME: fix other window edge types */ cr = moblin_netbook_cairo_create (window, area); radius = 2; /* bottom right */ cx = x + width - radius; cy = y + height - radius; spacing = radius * 2 + 2; gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_ACTIVE]); cairo_arc (cr, cx, cy - spacing * 2, radius, 0, M_PI * 360); cairo_fill (cr); cairo_arc (cr, cx, cy - spacing, radius, 0, M_PI * 360); cairo_fill (cr); cairo_arc (cr, cx, cy, radius, 0, M_PI * 360); cairo_fill (cr); cairo_arc (cr, cx - spacing, cy - spacing, radius, 0, M_PI * 360); cairo_fill (cr); cairo_arc (cr, cx - spacing, cy, radius, 0, M_PI * 360); cairo_fill (cr); cairo_arc (cr, cx - spacing * 2, cy, radius, 0, M_PI * 360); cairo_fill (cr); cairo_destroy (cr); } /* this function is copied from the mist gtk engine */ static void moblin_netbook_draw_layout (GtkStyle *style, GdkWindow *window, GtkStateType state_type, gboolean use_text, GdkRectangle *area, GtkWidget *widget, const char *detail, int x, int y, PangoLayout *layout) { GdkGC *gc; gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type]; if (area) { gdk_gc_set_clip_rectangle (gc, area); } if (DETAIL ("accellabel") && state_type == GTK_STATE_NORMAL) { cairo_t *cr; cr = moblin_netbook_cairo_create (window, area); cairo_set_source_rgba (cr, style->fg[state_type].red / 65535.0, style->fg[state_type].green / 65535.0, style->fg[state_type].blue / 65535.0, 0.5); cairo_move_to (cr, x, y); pango_cairo_show_layout (cr, layout); cairo_stroke (cr); cairo_destroy (cr); } else gdk_draw_layout (window, gc, x, y, layout); if (area) { gdk_gc_set_clip_rectangle (gc, NULL); } } /* this function is copied from the mist gtk engine */ static GdkPixbuf * set_transparency (const GdkPixbuf *pixbuf, gdouble alpha_percent) { GdkPixbuf *target; guchar *data, *current; guint x, y, rowstride, height, width; g_return_val_if_fail (pixbuf != NULL, NULL); g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); /* Returns a copy of pixbuf with it's non-completely-transparent pixels to have an alpha level "alpha_percent" of their original value. */ target = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0); if (alpha_percent == 1.0) return target; width = gdk_pixbuf_get_width (target); height = gdk_pixbuf_get_height (target); rowstride = gdk_pixbuf_get_rowstride (target); data = gdk_pixbuf_get_pixels (target); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { /* The "4" is the number of chars per pixel, in this case, RGBA, the 3 means "skip to the alpha" */ current = data + (y * rowstride) + (x * 4) + 3; *(current) = (guchar) (*(current) * alpha_percent); } } return target; } /* this function is copied from the mist gtk engine */ static GdkPixbuf* scale_or_ref (GdkPixbuf *src, int width, int height) { if (width == gdk_pixbuf_get_width (src) && height == gdk_pixbuf_get_height (src)) { return g_object_ref (src); } else { return gdk_pixbuf_scale_simple (src, width, height, GDK_INTERP_BILINEAR); } } /* this function is copied from the mist gtk engine */ static GdkPixbuf * moblin_netbook_render_icon (GtkStyle *style, const GtkIconSource *source, GtkTextDirection direction, GtkStateType state, GtkIconSize size, GtkWidget *widget, const char *detail) { int width = 1; int height = 1; GdkPixbuf *scaled; GdkPixbuf *stated; GdkPixbuf *base_pixbuf; GdkScreen *screen; GtkSettings *settings; /* Oddly, style can be NULL in this function, because * GtkIconSet can be used without a style and if so * it uses this function. */ base_pixbuf = gtk_icon_source_get_pixbuf (source); g_return_val_if_fail (base_pixbuf != NULL, NULL); if (widget && gtk_widget_has_screen (widget)) { screen = gtk_widget_get_screen (widget); settings = gtk_settings_get_for_screen (screen); } else if (style->colormap) { screen = gdk_colormap_get_screen (style->colormap); settings = gtk_settings_get_for_screen (screen); } else { settings = gtk_settings_get_default (); GTK_NOTE (MULTIHEAD, g_warning ("Using the default screen for gtk_default_render_icon()")); } if (size != (GtkIconSize) -1 && !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) { g_warning (G_STRLOC ": invalid icon size '%d'", size); return NULL; } /* If the size was wildcarded, and we're allowed to scale, then scale; * otherwise, leave it alone. */ if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source)) scaled = scale_or_ref (base_pixbuf, width, height); else scaled = g_object_ref (base_pixbuf); /* If the state was wildcarded, then generate a state. */ if (gtk_icon_source_get_state_wildcarded (source)) { if (state == GTK_STATE_INSENSITIVE) { stated = set_transparency (scaled, 0.3); gdk_pixbuf_saturate_and_pixelate (stated, stated, 0.1, FALSE); g_object_unref (scaled); } else if (state == GTK_STATE_PRELIGHT) { stated = gdk_pixbuf_copy (scaled); gdk_pixbuf_saturate_and_pixelate (scaled, stated, 1.2, FALSE); g_object_unref (scaled); } else { stated = scaled; } } else stated = scaled; return stated; } static void moblin_netbook_draw_expander (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, GtkExpanderStyle expander_style) { cairo_t *cr; cr = moblin_netbook_cairo_create (window, area); x -= 6; y -= 6; cairo_set_source_rgba (cr, 0.6, 0.6, 0.6, 0.6); moblin_netbook_rounded_rectangle (cr, x, y, 12, 12, 2 ); cairo_stroke_preserve (cr); if (state_type == GTK_STATE_PRELIGHT || state_type == GTK_STATE_ACTIVE) cairo_set_source_rgba (cr, 0, 0.6, 0.8, 1); else cairo_set_source_rgba (cr, 1, 1, 1, 1); cairo_fill (cr); if (state_type == GTK_STATE_PRELIGHT || state_type == GTK_STATE_ACTIVE) cairo_set_source_rgba (cr, 1, 1, 1, 1); else cairo_set_source_rgba (cr, 0, 0.6, 0.8, 1); cairo_move_to (cr, x + 2, y + 6); cairo_line_to (cr, x + 10, y + 6); cairo_stroke (cr); if (expander_style != GTK_EXPANDER_EXPANDED) { if (expander_style == GTK_EXPANDER_SEMI_COLLAPSED || expander_style == GTK_EXPANDER_SEMI_EXPANDED) { if (state_type == GTK_STATE_PRELIGHT || state_type == GTK_STATE_ACTIVE) cairo_set_source_rgba (cr, 1, 1, 1, 0.5); else cairo_set_source_rgba (cr, 0, 0.6, 0.8, 0.5); } cairo_move_to (cr, x + 6, y + 2); cairo_line_to (cr, x + 6, y + 10); cairo_stroke (cr); } cairo_destroy (cr); } static void moblin_netbook_init_from_rc (GtkStyle *style, GtkRcStyle *rc_style) { int i; MoblinNetbookStyle *mb_style; MoblinNetbookRcStyle *mb_rc_style; GTK_STYLE_CLASS (moblin_netbook_style_parent_class)->init_from_rc (style, rc_style); mb_rc_style = MOBLIN_NETBOOK_RC_STYLE (rc_style); mb_style = MOBLIN_NETBOOK_STYLE (style); mb_style->radius = mb_rc_style->radius; for (i = 0; i < 5; i++) mb_style->border_color[i] = mb_rc_style->border_color[i]; mb_style->shadow = mb_rc_style->shadow; } static void moblin_netbook_style_copy (GtkStyle *dest, GtkStyle *src) { int i; MoblinNetbookStyle *mb_dest = MOBLIN_NETBOOK_STYLE (dest); MoblinNetbookStyle *mb_src = MOBLIN_NETBOOK_STYLE (src); mb_dest->radius = mb_src->radius; for (i = 0; i < 5; i++) mb_dest->border_color[i] = mb_src->border_color[i]; mb_dest->shadow = mb_src->shadow; GTK_STYLE_CLASS (moblin_netbook_style_parent_class)->copy (dest, src); } static void moblin_netbook_style_class_init (MoblinNetbookStyleClass *klass) { GtkStyleClass *style_class = GTK_STYLE_CLASS (klass); const gchar *debug; /* Set debugging if required. We only need to do this once per instance, so * it is safe to do in the class-init */ debug = getenv ("MOBLIN_NETBOOK_ENGINE_DEBUG"); if (debug) do_debug = atoi (debug); style_class->init_from_rc = moblin_netbook_init_from_rc; style_class->copy = moblin_netbook_style_copy; style_class->draw_shadow = moblin_netbook_draw_shadow; style_class->draw_box = moblin_netbook_draw_box; style_class->draw_check = moblin_netbook_draw_check; style_class->draw_option = moblin_netbook_draw_option; style_class->draw_box_gap = moblin_netbook_draw_box_gap; style_class->draw_shadow_gap = moblin_netbook_draw_box_gap; style_class->draw_extension = moblin_netbook_draw_extension; style_class->draw_hline = moblin_netbook_draw_hline; style_class->draw_vline = moblin_netbook_draw_vline; style_class->draw_focus = moblin_netbook_draw_focus; style_class->draw_arrow = moblin_netbook_draw_arrow; style_class->draw_handle = moblin_netbook_draw_handle; style_class->draw_resize_grip = moblin_netbook_draw_resize_grip; style_class->draw_layout = moblin_netbook_draw_layout; style_class->render_icon = moblin_netbook_render_icon; style_class->draw_expander = moblin_netbook_draw_expander; } static void moblin_netbook_style_class_finalize (MoblinNetbookStyleClass *klass) { } static void moblin_netbook_style_init (MoblinNetbookStyle *style) { } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-style.h��������������������������������������������������0000664�0000000�0000000�00000007351�11335312636�0022046�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #ifndef _MOBLIN_NETBOOK_STYLE_H #define _MOBLIN_NETBOOK_STYLE_H #include <gtk/gtk.h> #define DRAW_ARGS GtkStyle *style, \ GdkWindow *window, \ GtkStateType state_type, \ GtkShadowType shadow_type, \ GdkRectangle *area, \ GtkWidget *widget, \ const gchar *detail, \ gint x, \ gint y, \ gint width, \ gint height #define SANITIZE_SIZE \ g_return_if_fail (width >= -1); \ g_return_if_fail (height >= -1); \ \ if ((width == -1) && (height == -1)) \ gdk_drawable_get_size (window, &width, &height);\ else if (width == -1) \ gdk_drawable_get_size (window, &width, NULL);\ else if (height == -1) \ gdk_drawable_get_size (window, NULL, &height); #define MOBLIN_NETBOOK_TYPE_STYLE moblin_netbook_style_get_type() #define MOBLIN_NETBOOK_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST (( \ object), \ MOBLIN_NETBOOK_TYPE_STYLE, \ MoblinNetbookStyle)) #define MOBLIN_NETBOOK_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (( \ klass), \ MOBLIN_NETBOOK_TYPE_STYLE, \ MoblinNetbookStyleClass)) #define MOBLIN_NETBOOK_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE (( \ object), \ MOBLIN_NETBOOK_TYPE_STYLE)) #define MOBLIN_NETBOOK_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE (( \ klass), \ MOBLIN_NETBOOK_TYPE_STYLE)) #define MOBLIN_NETBOOK_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (( \ obj), \ MOBLIN_NETBOOK_TYPE_STYLE, \ MoblinNetbookStyleClass)) typedef struct _MoblinNetbookStyle MoblinNetbookStyle; typedef struct _MoblinNetbookStyleClass MoblinNetbookStyleClass; struct _MoblinNetbookStyle { GtkStyle parent_instance; gint radius; GdkColor border_color[5]; gdouble shadow; }; struct _MoblinNetbookStyleClass { GtkStyleClass parent_class; }; GType moblin_netbook_style_get_type (void); void _moblin_netbook_style_register_type (GTypeModule *module); #endif /* _MOBLIN_NETBOOK_STYLE_H_ */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-utils.c��������������������������������������������������0000664�0000000�0000000�00000010261�11335312636�0022033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #include <gtk/gtk.h> /* Shading routines taken from gtkstyle.c */ static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b); static void hls_to_rgb (gdouble *r, gdouble *g, gdouble *b); void moblin_netbook_shade_colour (GdkColor *a, GdkColor *b, gdouble k) { gdouble red; gdouble green; gdouble blue; red = (gdouble) a->red / 65535.0; green = (gdouble) a->green / 65535.0; blue = (gdouble) a->blue / 65535.0; rgb_to_hls (&red, &green, &blue); green *= k; if (green > 1.0) green = 1.0; else if (green < 0.0) green = 0.0; blue *= k; if (blue > 1.0) blue = 1.0; else if (blue < 0.0) blue = 0.0; hls_to_rgb (&red, &green, &blue); b->red = red * 65535.0; b->green = green * 65535.0; b->blue = blue * 65535.0; } static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b) { gdouble min; gdouble max; gdouble red; gdouble green; gdouble blue; gdouble h, l, s; gdouble delta; red = *r; green = *g; blue = *b; if (red > green) { if (red > blue) max = red; else max = blue; if (green < blue) min = green; else min = blue; } else { if (green > blue) max = green; else max = blue; if (red < blue) min = red; else min = blue; } l = (max + min) / 2; s = 0; h = 0; if (max != min) { if (l <= 0.5) s = (max - min) / (max + min); else s = (max - min) / (2 - max - min); delta = max -min; if (red == max) h = (green - blue) / delta; else if (green == max) h = 2 + (blue - red) / delta; else if (blue == max) h = 4 + (red - green) / delta; h *= 60; if (h < 0.0) h += 360; } *r = h; *g = l; *b = s; } static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s) { gdouble hue; gdouble lightness; gdouble saturation; gdouble m1, m2; gdouble r, g, b; lightness = *l; saturation = *s; if (lightness <= 0.5) m2 = lightness * (1 + saturation); else m2 = lightness + saturation - lightness * saturation; m1 = 2 * lightness - m2; if (saturation == 0) { *h = lightness; *l = lightness; *s = lightness; } else { hue = *h + 120; while (hue > 360) hue -= 360; while (hue < 0) hue += 360; if (hue < 60) r = m1 + (m2 - m1) * hue / 60; else if (hue < 180) r = m2; else if (hue < 240) r = m1 + (m2 - m1) * (240 - hue) / 60; else r = m1; hue = *h; while (hue > 360) hue -= 360; while (hue < 0) hue += 360; if (hue < 60) g = m1 + (m2 - m1) * hue / 60; else if (hue < 180) g = m2; else if (hue < 240) g = m1 + (m2 - m1) * (240 - hue) / 60; else g = m1; hue = *h - 120; while (hue > 360) hue -= 360; while (hue < 0) hue += 360; if (hue < 60) b = m1 + (m2 - m1) * hue / 60; else if (hue < 180) b = m2; else if (hue < 240) b = m1 + (m2 - m1) * (240 - hue) / 60; else b = m1; *h = r; *l = g; *s = b; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������moblin-gtk-engine-1.1.1/src/moblin-netbook-utils.h��������������������������������������������������0000664�0000000�0000000�00000001702�11335312636�0022040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * moblin-gtk-engine - A GTK+ theme engine for Moblin * * Copyright (c) 2008, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, * version 2.1, as published by the Free Software Foundation. * * This program is distributed in the hope 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * */ #include <gtk/gtk.h> void moblin_netbook_shade_colour (GdkColor *a, GdkColor *b, gdouble k); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������