libunity-misc-4.0.5+14.04.20140115/0000755000015000001560000000000012265474646016656 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/COPYING.GPL0000644000015000001560000004310312265474522020324 0ustar pbuserpbgroup00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. libunity-misc-4.0.5+14.04.20140115/vapi/0000755000015000001560000000000012265474646017615 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/vapi/unity-misc.metadata0000644000015000001560000000006112265474522023406 0ustar pbuserpbgroup00000000000000Unity cheader_filename="unity-misc/unity-misc.h" libunity-misc-4.0.5+14.04.20140115/vapi/unity-misc.vapi0000644000015000001560000000106712265474522022574 0ustar pbuserpbgroup00000000000000/* unity-misc.vapi generated by vapigen, do not modify. */ [CCode (cprefix = "Unity", lower_case_cprefix = "unity_")] namespace Unity { [CCode (cheader_filename = "unity-misc/unity-misc.h")] public class TrayManager : GLib.Object { [CCode (has_construct_function = false)] public TrayManager (); public void manage_stage (Clutter.Stage stage); [NoAccessorMethod] public Clutter.Color bg_color { get; construct; } public virtual signal void tray_icon_added (Clutter.Actor icon); public virtual signal void tray_icon_removed (Clutter.Actor icon); } } libunity-misc-4.0.5+14.04.20140115/vapi/unity-misc.files0000644000015000001560000000005012265474522022726 0ustar pbuserpbgroup00000000000000include/unity-misc lib/libunity-misc.so libunity-misc-4.0.5+14.04.20140115/vapi/unity-misc.deps0000644000015000001560000000004112265474522022557 0ustar pbuserpbgroup00000000000000glib-2.0 gobject-2.0 clutter-1.0 libunity-misc-4.0.5+14.04.20140115/vapi/unity-misc.namespace0000644000015000001560000000000612265474522023561 0ustar pbuserpbgroup00000000000000Unity libunity-misc-4.0.5+14.04.20140115/vapi/generate_vapi0000755000015000001560000000055412265474522022351 0ustar pbuserpbgroup00000000000000#!/bin/sh # Just issues the commands to create the vapi file # Would be nice to get autotools to make this at some point, but it sort # of requires the package to be installed (and called from pkg-config) first # so its a little messy vala-gen-introspect unity-misc . vapigen --pkg gobject-2.0 --pkg glib-2.0 --pkg clutter-1.0 --library unity-misc unity-misc.gi libunity-misc-4.0.5+14.04.20140115/COPYING.LGPL-20000644000015000001560000006130412265474522020602 0ustar pbuserpbgroup00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 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 library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. 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 to 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 Library 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 Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 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! libunity-misc-4.0.5+14.04.20140115/README0000644000015000001560000000000112265474522017516 0ustar pbuserpbgroup00000000000000 libunity-misc-4.0.5+14.04.20140115/INSTALL0000644000015000001560000002713612265474522017711 0ustar pbuserpbgroup00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *Note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libunity-misc-4.0.5+14.04.20140115/NEWS0000644000015000001560000000000012265474522017334 0ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/doc/0000755000015000001560000000000012265474646017423 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/doc/reference/0000755000015000001560000000000012265474646021361 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/doc/reference/libunity-misc/0000755000015000001560000000000012265474646024151 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/doc/reference/libunity-misc/libunity-misc-docs.sgml0000644000015000001560000000206112265474522030543 0ustar pbuserpbgroup00000000000000 ]> libunity-misc Reference Manual for libunity-misc 0.1 The latest version of this documentation can be found on-line at http://[SERVER]/libunity-misc/. Unity Misc Object Hierarchy API Index libunity-misc-4.0.5+14.04.20140115/doc/reference/libunity-misc/Makefile.am0000644000015000001560000000627212265474522026205 0ustar pbuserpbgroup00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libunity-misc # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=../../../unity-misc # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/unity-misc/*.h CFILE_GLOB=$(top_srcdir)/unity-misc/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(UNITY_MISC_CFLAGS) GTKDOC_LIBS=$(top_builddir)/unity-misc/libunity-misc.la $(UNITY_MISC_LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) libunity-misc-4.0.5+14.04.20140115/doc/reference/Makefile.am0000644000015000001560000000002612265474522023404 0ustar pbuserpbgroup00000000000000SUBDIRS=libunity-misc libunity-misc-4.0.5+14.04.20140115/doc/Makefile.am0000644000015000001560000000002212265474522021442 0ustar pbuserpbgroup00000000000000SUBDIRS=reference libunity-misc-4.0.5+14.04.20140115/unity-misc.pc.in0000644000015000001560000000046412265474522021705 0ustar pbuserpbgroup00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libunity-misc Description: A library to build misc for Unity Version: @VERSION@ Libs: -L${libdir} -lunity-misc Cflags: -I${includedir}/unity-misc Requires: glib-2.0 gthread-2.0 gobject-2.0 gio-2.0 gio-unix-2.0 gtk+-3.0 libunity-misc-4.0.5+14.04.20140115/configure.ac0000644000015000001560000000505112265474522021136 0ustar pbuserpbgroup00000000000000AC_PREREQ(2.59) AC_INIT([libunity-misc], [4.0.4], [https://bugs.launchpad.net/avani]) AC_CONFIG_SRCDIR([unity-misc/na-tray.h]) AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([1.9]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Before making a release, the UNITY_MISC_LT_VERSION string should be updated. # The string is of the form C:R:A. # - If interfaces have been changed or added, but binary compatibility has # been preserved, change to C+1:0:A+1 # - If binary compatibility has been broken (eg removed or changed interfaces) # change to C+1:0:0 # - If the interface is the same as the previous version, change to C:R+1:A UNITY_MISC_LT_CURRENT=5 UNITY_MISC_LT_REV=0 UNITY_MISC_LT_AGE=1 UNITY_MISC_LT_VERSION="$UNITY_MISC_LT_CURRENT:$UNITY_MISC_LT_REV:$UNITY_MISC_LT_AGE" UNITY_MISC_LT_LDFLAGS="-version-info $UNITY_MISC_LT_VERSION" AC_SUBST(UNITY_MISC_LT_VERSION) AC_SUBST(UNITY_MISC_LT_LDFLAGS) dnl =========================================================================== # Checks for programs AC_PROG_CC AM_PROG_CC_C_O AC_DISABLE_STATIC AC_PROG_LIBTOOL # Checks for header files AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) # Checks for typedefs, structures and compiler charecteristics AC_C_CONST # Checks for library functions AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([memset munmap strcasecmp strdup]) PKG_CHECK_MODULES(UNITY_MISC, glib-2.0 >= 2.22 gobject-2.0 >= 2.22 gdk-x11-3.0 >= 3.0 gtk+-3.0 >= 3.0 gtk+-x11-3.0 >= 3.0 x11 ) AC_SUBST(UNITY_MISC_CFLAGS) AC_SUBST(UNITY_MISC_LIBS) dnl =========================================================================== if test "x$GCC" = "xyes"; then GCC_FLAGS="-g -Wall" fi AC_SUBST(GCC_FLAGS) MAINTAINER_CFLAGS="-Werror -Wno-error=deprecated-declarations -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self" AC_SUBST(MAINTAINER_CFLAGS) dnl = GTK Doc Check =========================================================== GTK_DOC_CHECK([1.8]) dnl =========================================================================== AC_CONFIG_FILES([ Makefile unity-misc/Makefile doc/Makefile doc/reference/Makefile doc/reference/libunity-misc/Makefile examples/Makefile unity-misc.pc ]) AC_OUTPUT echo "" echo " Libunity-misc $VERSION" echo " ===============================" echo "" echo " Prefix : ${prefix}" echo "" echo " Documentation : ${enable_gtk_doc}" echo "" libunity-misc-4.0.5+14.04.20140115/unity-misc/0000755000015000001560000000000012265474646020757 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray-child.c0000644000015000001560000003727712265474522023570 0ustar pbuserpbgroup00000000000000/* na-tray-child.c * Copyright (C) 2002 Anders Carlsson * Copyright (C) 2003-2006 Vincent Untz * Copyright (C) 2008 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include #include #include "na-tray-child.h" #include #include #include G_DEFINE_TYPE (NaTrayChild, na_tray_child, GTK_TYPE_SOCKET) static void na_tray_child_finalize (GObject *object) { G_OBJECT_CLASS (na_tray_child_parent_class)->finalize (object); } static void na_tray_child_realize (GtkWidget *widget) { NaTrayChild *child = NA_TRAY_CHILD (widget); GdkVisual *visual = gtk_widget_get_visual (widget); GdkWindow *window; GTK_WIDGET_CLASS (na_tray_child_parent_class)->realize (widget); window = gtk_widget_get_window (widget); if (child->has_alpha) { /* We have real transparency with an ARGB visual and the Composite * extension. */ /* Set a transparent background */ cairo_pattern_t *transparent = cairo_pattern_create_rgba (0, 0, 0, 0); gdk_window_set_background_pattern (window, transparent); gdk_window_set_composited (window, TRUE); cairo_pattern_destroy (transparent); child->parent_relative_bg = FALSE; } else if (visual == gdk_window_get_visual (gdk_window_get_parent (window))) { /* Otherwise, if the visual matches the visual of the parent window, we * can use a parent-relative background and fake transparency. */ gdk_window_set_background_pattern (window, NULL); child->parent_relative_bg = TRUE; } else { /* Nothing to do; the icon will sit on top of an ugly gray box */ child->parent_relative_bg = FALSE; } gdk_window_set_composited (window, child->composited); gtk_widget_set_app_paintable (GTK_WIDGET (child), child->parent_relative_bg || child->has_alpha); /* Double-buffering will interfere with the parent-relative-background fake * transparency, since the double-buffer code doesn't know how to fill in the * background of the double-buffer correctly. */ gtk_widget_set_double_buffered (GTK_WIDGET (child), child->parent_relative_bg); } static void na_tray_child_style_set (GtkWidget *widget, GtkStyle *previous_style) { /* The default handler resets the background according to the new style. * We either use a transparent background or a parent-relative background * and ignore the style background. So, just don't chain up. */ } #if 0 /* This is adapted from code that was commented out in na-tray-manager.c; the * code in na-tray-manager.c wouldn't have worked reliably, this will. So maybe * it can be reenabled. On other hand, things seem to be working fine without * it. * * If reenabling, you need to hook it up in na_tray_child_class_init(). */ static void na_tray_child_size_request (GtkWidget *widget, GtkRequisition *request) { GTK_WIDGET_CLASS (na_tray_child_parent_class)->size_request (widget, request); /* * Make sure the icons have a meaningful size .. */ if ((request->width < 16) || (request->height < 16)) { gint nw = MAX (24, request->width); gint nh = MAX (24, request->height); g_warning ("Tray icon has requested a size of (%ix%i), resizing to (%ix%i)", req.width, req.height, nw, nh); request->width = nw; request->height = nh; } } #endif static void na_tray_child_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { NaTrayChild *child = NA_TRAY_CHILD (widget); GtkAllocation widget_allocation; gboolean moved, resized; gtk_widget_get_allocation (widget, &widget_allocation); moved = (allocation->x != widget_allocation.x || allocation->y != widget_allocation.y); resized = (allocation->width != widget_allocation.width || allocation->height != widget_allocation.height); /* When we are allocating the widget while mapped we need special handling * for both real and fake transparency. * * Real transparency: we need to invalidate and trigger a redraw of the old * and new areas. (GDK really should handle this for us, but doesn't as of * GTK+-2.14) * * Fake transparency: if the widget moved, we need to force the contents to * be redrawn with the new offset for the parent-relative background. */ if ((moved || resized) && gtk_widget_get_mapped (widget)) { if (na_tray_child_has_alpha (child)) gdk_window_invalidate_rect (gdk_window_get_parent (gtk_widget_get_window (widget)), &widget_allocation, FALSE); } GTK_WIDGET_CLASS (na_tray_child_parent_class)->size_allocate (widget, allocation); if ((moved || resized) && gtk_widget_get_mapped (widget)) { if (na_tray_child_has_alpha (NA_TRAY_CHILD (widget))) gdk_window_invalidate_rect (gdk_window_get_parent (gtk_widget_get_window (widget)), &widget_allocation, FALSE); else if (moved && child->parent_relative_bg) na_tray_child_force_redraw (child); } } /* The plug window should completely occupy the area of the child, so we won't * get a draw event. But in case we do (the plug unmaps itself, say), this * draw handler draws with real or fake transparency. */ static gboolean na_tray_child_draw (GtkWidget *widget, cairo_t *cr) { NaTrayChild *child = NA_TRAY_CHILD (widget); if (na_tray_child_has_alpha (child)) { /* Clear to transparent */ cairo_set_source_rgba (cr, 0, 0, 0, 0); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); cairo_paint (cr); } else if (child->parent_relative_bg) { GdkWindow *window; cairo_surface_t *target; GdkRectangle clip_rect; window = gtk_widget_get_window (widget); target = cairo_get_group_target (cr); gdk_cairo_get_clip_rectangle (cr, &clip_rect); /* Clear to parent-relative pixmap * We need to use direct X access here because GDK doesn't know about * the parent relative pixmap. */ cairo_surface_flush (target); XClearArea (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), clip_rect.x, clip_rect.y, clip_rect.width, clip_rect.height, False); cairo_surface_mark_dirty_rectangle (target, clip_rect.x, clip_rect.y, clip_rect.width, clip_rect.height); } return FALSE; } static void na_tray_child_get_preferred_width (GtkWidget* widget, gint *mwidth, gint *nwidth) { *mwidth = *nwidth = 22; } static void na_tray_child_get_preferred_height (GtkWidget *widget, gint *mheight, gint *nheight) { *mheight = *nheight = 22; } static void na_tray_child_init (NaTrayChild *child) { } static void na_tray_child_class_init (NaTrayChildClass *klass) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; gobject_class = (GObjectClass *)klass; widget_class = (GtkWidgetClass *)klass; gobject_class->finalize = na_tray_child_finalize; widget_class->style_set = na_tray_child_style_set; widget_class->realize = na_tray_child_realize; widget_class->size_allocate = na_tray_child_size_allocate; widget_class->draw = na_tray_child_draw; widget_class->get_preferred_width = na_tray_child_get_preferred_width; widget_class->get_preferred_height = na_tray_child_get_preferred_height; } GtkWidget * na_tray_child_new (GdkScreen *screen, Window icon_window) { XWindowAttributes window_attributes; Display *xdisplay; NaTrayChild *child; GdkVisual *visual; gboolean visual_has_alpha; int red_prec, green_prec, blue_prec, depth; int result; g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); g_return_val_if_fail (icon_window != None, NULL); xdisplay = GDK_SCREEN_XDISPLAY (screen); /* We need to determine the visual of the window we are embedding and create * the socket in the same visual. */ gdk_error_trap_push (); result = XGetWindowAttributes (xdisplay, icon_window, &window_attributes); gdk_error_trap_pop_ignored (); if (!result) /* Window already gone */ return NULL; visual = gdk_x11_screen_lookup_visual (screen, window_attributes.visual->visualid); if (!visual) /* Icon window is on another screen? */ return NULL; child = g_object_new (NA_TYPE_TRAY_CHILD, NULL); child->icon_window = icon_window; gtk_widget_set_visual (GTK_WIDGET (child), visual); /* We have alpha if the visual has something other than red, green, * and blue */ gdk_visual_get_red_pixel_details (visual, NULL, NULL, &red_prec); gdk_visual_get_green_pixel_details (visual, NULL, NULL, &green_prec); gdk_visual_get_blue_pixel_details (visual, NULL, NULL, &blue_prec); depth = gdk_visual_get_depth (visual); visual_has_alpha = red_prec + blue_prec + green_prec < depth; child->has_alpha = (visual_has_alpha && gdk_display_supports_composite (gdk_screen_get_display (screen))); child->composited = child->has_alpha; return GTK_WIDGET (child); } char * na_tray_child_get_title (NaTrayChild *child) { char *retval = NULL; GdkDisplay *display; Atom utf8_string, atom, type; int result; int format; gulong nitems; gulong bytes_after; gchar *val; g_return_val_if_fail (NA_IS_TRAY_CHILD (child), NULL); display = gtk_widget_get_display (GTK_WIDGET (child)); utf8_string = gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"); atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_NAME"); gdk_error_trap_push (); result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), child->icon_window, atom, 0, G_MAXLONG, False, utf8_string, &type, &format, &nitems, &bytes_after, (guchar **)&val); if (gdk_error_trap_pop () || result != Success) return NULL; if (type != utf8_string || format != 8 || nitems == 0) { if (val) XFree (val); return NULL; } if (!g_utf8_validate (val, nitems, NULL)) { XFree (val); return NULL; } retval = g_strndup (val, nitems); XFree (val); return retval; } /** * na_tray_child_has_alpha; * @child: a #NaTrayChild * * Checks if the child has an ARGB visual and real alpha transparence. * (as opposed to faked alpha transparency with an parent-relative * background) * * Return value: %TRUE if the child has an alpha transparency */ gboolean na_tray_child_has_alpha (NaTrayChild *child) { g_return_val_if_fail (NA_IS_TRAY_CHILD (child), FALSE); return child->has_alpha; } /** * na_tray_child_set_composited; * @child: a #NaTrayChild * @composited: %TRUE if the child's window should be redirected * * Sets whether the #GdkWindow of the child should be set redirected * using gdk_window_set_composited(). By default this is based off of * na_tray_child_has_alpha(), but it may be useful to override it in * certain circumstances; for example, if the #NaTrayChild is added * to a parent window and that parent window is composited against the * background. */ void na_tray_child_set_composited (NaTrayChild *child, gboolean composited) { g_return_if_fail (NA_IS_TRAY_CHILD (child)); if (child->composited == composited) return; child->composited = composited; if (gtk_widget_get_realized (GTK_WIDGET (child))) gdk_window_set_composited (gtk_widget_get_window (GTK_WIDGET (child)), composited); } /* If we are faking transparency with a window-relative background, force a * redraw of the icon. This should be called if the background changes or if * the child is shifted with respect to the background. */ void na_tray_child_force_redraw (NaTrayChild *child) { GtkWidget *widget = GTK_WIDGET (child); if (gtk_widget_get_mapped (widget) && child->parent_relative_bg) { #if 1 /* Sending an ExposeEvent might cause redraw problems if the * icon is expecting the server to clear-to-background before * the redraw. It should be ok for GtkStatusIcon or EggTrayIcon. */ Display *xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget)); XEvent xev; GdkWindow *plug_window; GtkAllocation allocation; plug_window = gtk_socket_get_plug_window (GTK_SOCKET (child)); gtk_widget_get_allocation (widget, &allocation); xev.xexpose.type = Expose; xev.xexpose.window = GDK_WINDOW_XID (plug_window); xev.xexpose.x = 0; xev.xexpose.y = 0; xev.xexpose.width = allocation.width; xev.xexpose.height = allocation.height; xev.xexpose.count = 0; gdk_error_trap_push (); XSendEvent (xdisplay, xev.xexpose.window, False, ExposureMask, &xev); gdk_error_trap_pop_ignored (); #else /* Hiding and showing is the safe way to do it, but can result in more * flickering. */ gdk_window_hide (widget->window); gdk_window_show (widget->window); #endif } } /* from libwnck/xutils.c, comes as LGPLv2+ */ static char * latin1_to_utf8 (const char *latin1) { GString *str; const char *p; str = g_string_new (NULL); p = latin1; while (*p) { g_string_append_unichar (str, (gunichar) *p); ++p; } return g_string_free (str, FALSE); } /* derived from libwnck/xutils.c, comes as LGPLv2+ */ static void _get_wmclass (Display *xdisplay, Window xwindow, char **res_class, char **res_name) { XClassHint ch; ch.res_name = NULL; ch.res_class = NULL; gdk_error_trap_push (); XGetClassHint (xdisplay, xwindow, &ch); gdk_error_trap_pop_ignored (); if (res_class) *res_class = NULL; if (res_name) *res_name = NULL; if (ch.res_name) { if (res_name) *res_name = latin1_to_utf8 (ch.res_name); XFree (ch.res_name); } if (ch.res_class) { if (res_class) *res_class = latin1_to_utf8 (ch.res_class); XFree (ch.res_class); } } /** * na_tray_child_get_wm_class; * @child: a #NaTrayChild * @res_name: return location for a string containing the application name of * @child, or %NULL * @res_class: return location for a string containing the application class of * @child, or %NULL * * Fetches the resource associated with @child. */ void na_tray_child_get_wm_class (NaTrayChild *child, char **res_name, char **res_class) { GdkDisplay *display; g_return_if_fail (NA_IS_TRAY_CHILD (child)); display = gtk_widget_get_display (GTK_WIDGET (child)); _get_wmclass (GDK_DISPLAY_XDISPLAY (display), child->icon_window, res_class, res_name); } libunity-misc-4.0.5+14.04.20140115/unity-misc/fixedtip.h0000644000015000001560000000433512265474522022742 0ustar pbuserpbgroup00000000000000/* Fixed tooltip routine */ /* * Copyright (C) 2001 Havoc Pennington, 2002 Red Hat Inc. * Copyright (C) 2003-2006 Vincent Untz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #ifndef FIXED_TIP_H #define FIXED_TIP_H #include G_BEGIN_DECLS #define NA_TYPE_FIXED_TIP (na_fixed_tip_get_type ()) #define NA_FIXED_TIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_FIXED_TIP, NaFixedTip)) #define NA_FIXED_TIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_FIXED_TIP, NaFixedTipClass)) #define NA_IS_FIXED_TIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_FIXED_TIP)) #define NA_IS_FIXED_TIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_FIXED_TIP)) #define NA_FIXED_TIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_FIXED_TIP, NaFixedTipClass)) typedef struct _NaFixedTip NaFixedTip; typedef struct _NaFixedTipPrivate NaFixedTipPrivate; typedef struct _NaFixedTipClass NaFixedTipClass; struct _NaFixedTip { GtkWindow parent_instance; NaFixedTipPrivate *priv; }; struct _NaFixedTipClass { GtkWindowClass parent_class; void (* clicked) (NaFixedTip *fixedtip); }; GType na_fixed_tip_get_type (void); GtkWidget *na_fixed_tip_new (GtkWidget *parent, GtkOrientation orientation); void na_fixed_tip_set_markup (GtkWidget *widget, const char *markup_text); void na_fixed_tip_set_orientation (GtkWidget *widget, GtkOrientation orientation); G_END_DECLS #endif /* FIXED_TIP_H */ libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray.c0000644000015000001560000005444412265474522022502 0ustar pbuserpbgroup00000000000000/* * Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2003-2006 Vincent Untz * Copyright (C) 2007 Christian Persch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #include #include #include #include "fixedtip.h" #include "na-tray.h" #define ICON_SPACING 1 #define MIN_BOX_SIZE 3 typedef struct { NaTrayManager *tray_manager; GSList *all_trays; GHashTable *icon_table; GHashTable *tip_table; } TraysScreen; struct _NaTrayPrivate { GdkScreen *screen; TraysScreen *trays_screen; GtkWidget *box; GtkWidget *frame; guint idle_redraw_id; GtkOrientation orientation; NaTrayFilterCallback cb; gpointer data; }; typedef struct { char *text; glong id; glong timeout; } IconTipBuffer; typedef struct { NaTray *tray; /* tray containing the tray icon */ GtkWidget *icon; /* tray icon sending the message */ GtkWidget *fixedtip; guint source_id; glong id; /* id of the current message */ GSList *buffer; /* buffered messages */ } IconTip; enum { PROP_0, PROP_ORIENTATION, PROP_SCREEN }; static gboolean initialized = FALSE; static TraysScreen *trays_screens = NULL; static void icon_tip_show_next (IconTip *icontip); /* NaTray */ G_DEFINE_TYPE (NaTray, na_tray, GTK_TYPE_BIN) static NaTray * get_tray (TraysScreen *trays_screen) { if (trays_screen->all_trays == NULL) return NULL; return trays_screen->all_trays->data; } const char *ordered_roles[] = { "keyboard", "volume", "bluetooth", "network", "battery", NULL }; const char *wmclass_roles[] = { "Bluetooth-applet", "bluetooth", "Gnome-volume-control-applet", "volume", "Nm-applet", "network", "Gnome-power-manager", "battery", "keyboard", "keyboard", NULL, }; static const char * find_role (const char *wmclass) { int i; for (i = 0; wmclass_roles[i]; i += 2) { if (strcmp (wmclass, wmclass_roles[i]) == 0) return wmclass_roles[i + 1]; } return NULL; } static int find_role_position (const char *role) { int i; for (i = 0; ordered_roles[i]; i++) { if (strcmp (role, ordered_roles[i]) == 0) break; } return i + 1; } static int find_icon_position (NaTray *tray, GtkWidget *icon) { NaTrayPrivate *priv; int position; char *class_a; const char *role; int role_position; GList *l, *children; /* We insert the icons with a known roles in a specific order (the one * defined by ordered_roles), and all other icons at the beginning of the box * (left in LTR). */ priv = tray->priv; position = 0; class_a = NULL; na_tray_child_get_wm_class (NA_TRAY_CHILD (icon), NULL, &class_a); if (!class_a) return position; role = find_role (class_a); g_free (class_a); if (!role) return position; role_position = find_role_position (role); g_object_set_data (G_OBJECT (icon), "role-position", GINT_TO_POINTER (role_position)); children = gtk_container_get_children (GTK_CONTAINER (priv->box)); for (l = g_list_last (children); l; l = l->prev) { GtkWidget *child = l->data; int rp; rp = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (child), "role-position")); if (rp == 0 || rp < role_position) { position = g_list_index (children, child) + 1; break; } } g_list_free (children); /* should never happen, but it doesn't hurt to be on the safe side */ if (position < 0) position = 0; return position; } static void tray_added (NaTrayManager *manager, GtkWidget *icon, TraysScreen *trays_screen) { NaTray *tray; NaTrayPrivate *priv; int position; tray = get_tray (trays_screen); if (tray == NULL) return; priv = tray->priv; g_assert (priv->trays_screen == trays_screen); if (priv->cb && !priv->cb (tray, icon, priv->data)) { return; } g_hash_table_insert (trays_screen->icon_table, icon, tray); position = find_icon_position (tray, icon); gtk_box_pack_start (GTK_BOX (priv->box), icon, FALSE, FALSE, 0); gtk_box_reorder_child (GTK_BOX (priv->box), icon, position); gtk_widget_show (icon); } static void tray_removed (NaTrayManager *manager, GtkWidget *icon, TraysScreen *trays_screen) { NaTray *tray; NaTrayPrivate *priv; tray = g_hash_table_lookup (trays_screen->icon_table, icon); if (tray == NULL) return; priv = tray->priv; g_assert (tray->priv->trays_screen == trays_screen); gtk_container_remove (GTK_CONTAINER (priv->box), icon); g_hash_table_remove (trays_screen->icon_table, icon); /* this will also destroy the tip associated to this icon */ g_hash_table_remove (trays_screen->tip_table, icon); } static void icon_tip_buffer_free (gpointer data, gpointer userdata) { IconTipBuffer *buffer; buffer = data; g_free (buffer->text); buffer->text = NULL; g_free (buffer); } static void icon_tip_free (gpointer data) { IconTip *icontip; if (data == NULL) return; icontip = data; if (icontip->fixedtip != NULL) gtk_widget_destroy (GTK_WIDGET (icontip->fixedtip)); icontip->fixedtip = NULL; if (icontip->source_id != 0) g_source_remove (icontip->source_id); icontip->source_id = 0; if (icontip->buffer != NULL) { g_slist_foreach (icontip->buffer, icon_tip_buffer_free, NULL); g_slist_free (icontip->buffer); } icontip->buffer = NULL; g_free (icontip); } static int icon_tip_buffer_compare (gconstpointer a, gconstpointer b) { const IconTipBuffer *buffer_a = a; const IconTipBuffer *buffer_b = b; if (buffer_a == NULL || buffer_b == NULL) return !(buffer_a == buffer_b); return buffer_a->id - buffer_b->id; } static void icon_tip_show_next_clicked (GtkWidget *widget, gpointer data) { icon_tip_show_next ((IconTip *) data); } static gboolean icon_tip_show_next_timeout (gpointer data) { IconTip *icontip = (IconTip *) data; icon_tip_show_next (icontip); return FALSE; } static void icon_tip_show_next (IconTip *icontip) { IconTipBuffer *buffer; if (icontip->buffer == NULL) { /* this will also destroy the tip window */ g_hash_table_remove (icontip->tray->priv->trays_screen->tip_table, icontip->icon); return; } if (icontip->source_id != 0) g_source_remove (icontip->source_id); icontip->source_id = 0; buffer = icontip->buffer->data; icontip->buffer = g_slist_remove (icontip->buffer, buffer); if (icontip->fixedtip == NULL) { icontip->fixedtip = na_fixed_tip_new (icontip->icon, na_tray_get_orientation (icontip->tray)); g_signal_connect (icontip->fixedtip, "clicked", G_CALLBACK (icon_tip_show_next_clicked), icontip); } na_fixed_tip_set_markup (icontip->fixedtip, buffer->text); if (!gtk_widget_get_mapped (icontip->fixedtip)) gtk_widget_show (icontip->fixedtip); icontip->id = buffer->id; if (buffer->timeout > 0) icontip->source_id = g_timeout_add_seconds (buffer->timeout, icon_tip_show_next_timeout, icontip); icon_tip_buffer_free (buffer, NULL); } static void message_sent (NaTrayManager *manager, GtkWidget *icon, const char *text, glong id, glong timeout, TraysScreen *trays_screen) { IconTip *icontip; IconTipBuffer find_buffer; IconTipBuffer *buffer; gboolean show_now; icontip = g_hash_table_lookup (trays_screen->tip_table, icon); find_buffer.id = id; if (icontip && (icontip->id == id || g_slist_find_custom (icontip->buffer, &find_buffer, icon_tip_buffer_compare) != NULL)) /* we already have this message, so ignore it */ /* FIXME: in an ideal world, we'd remember all the past ids and ignore them * too */ return; show_now = FALSE; if (icontip == NULL) { NaTray *tray; tray = g_hash_table_lookup (trays_screen->icon_table, icon); if (tray == NULL) { /* We don't know about the icon sending the message, so ignore it. * But this should never happen since NaTrayManager shouldn't send * us the message if there's no socket for it. */ g_critical ("Ignoring a message sent by a tray icon " "we don't know: \"%s\".\n", text); return; } icontip = g_new0 (IconTip, 1); icontip->tray = tray; icontip->icon = icon; g_hash_table_insert (trays_screen->tip_table, icon, icontip); show_now = TRUE; } buffer = g_new0 (IconTipBuffer, 1); buffer->text = g_strdup (text); buffer->id = id; buffer->timeout = timeout; icontip->buffer = g_slist_append (icontip->buffer, buffer); if (show_now) icon_tip_show_next (icontip); } static void message_cancelled (NaTrayManager *manager, GtkWidget *icon, glong id, TraysScreen *trays_screen) { IconTip *icontip; IconTipBuffer find_buffer; GSList *cancel_buffer_l; IconTipBuffer *cancel_buffer; icontip = g_hash_table_lookup (trays_screen->tip_table, icon); if (icontip == NULL) return; if (icontip->id == id) { icon_tip_show_next (icontip); return; } find_buffer.id = id; cancel_buffer_l = g_slist_find_custom (icontip->buffer, &find_buffer, icon_tip_buffer_compare); if (cancel_buffer_l == NULL) return; cancel_buffer = cancel_buffer_l->data; icon_tip_buffer_free (cancel_buffer, NULL); icontip->buffer = g_slist_remove_link (icontip->buffer, cancel_buffer_l); g_slist_free_1 (cancel_buffer_l); } static void update_orientation_for_messages (gpointer key, gpointer value, gpointer data) { NaTray *tray; IconTip *icontip; if (value == NULL) return; icontip = value; tray = data; if (icontip->tray != tray) return; if (icontip->fixedtip) na_fixed_tip_set_orientation (icontip->fixedtip, tray->priv->orientation); } static void update_size_and_orientation (NaTray *tray) { NaTrayPrivate *priv = tray->priv; gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation); /* This only happens when setting the property during object construction */ if (!priv->trays_screen) return; g_hash_table_foreach (priv->trays_screen->tip_table, update_orientation_for_messages, tray); if (get_tray (priv->trays_screen) == tray) na_tray_manager_set_orientation (priv->trays_screen->tray_manager, priv->orientation); /* note, you want this larger if the frame has non-NONE relief by default. */ switch (priv->orientation) { case GTK_ORIENTATION_VERTICAL: /* Give box a min size so the frame doesn't look dumb */ gtk_widget_set_size_request (priv->box, MIN_BOX_SIZE, -1); break; case GTK_ORIENTATION_HORIZONTAL: gtk_widget_set_size_request (priv->box, -1, MIN_BOX_SIZE); break; } } /* Children with alpha channels have been set to be composited by calling * gdk_window_set_composited(). We need to paint these children ourselves. */ static void na_tray_draw_icon (GtkWidget *widget, gpointer data) { cairo_t *cr = (cairo_t *) data; if (na_tray_child_has_alpha (NA_TRAY_CHILD (widget))) { GtkAllocation allocation; gtk_widget_get_allocation (widget, &allocation); cairo_save (cr); gdk_cairo_set_source_window (cr, gtk_widget_get_window (widget), allocation.x, allocation.y); cairo_rectangle (cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip (cr); cairo_paint (cr); cairo_restore (cr); } } static void na_tray_draw_box (GtkWidget *box, cairo_t *cr) { gtk_container_foreach (GTK_CONTAINER (box), na_tray_draw_icon, cr); } static void na_tray_init (NaTray *tray) { NaTrayPrivate *priv; priv = tray->priv = G_TYPE_INSTANCE_GET_PRIVATE (tray, NA_TYPE_TRAY, NaTrayPrivate); priv->screen = NULL; priv->orientation = GTK_ORIENTATION_HORIZONTAL; priv->frame = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); gtk_container_add (GTK_CONTAINER (tray), priv->frame); gtk_widget_show (priv->frame); priv->box = gtk_box_new (priv->orientation, ICON_SPACING); g_signal_connect (priv->box, "draw", G_CALLBACK (na_tray_draw_box), NULL); gtk_container_add (GTK_CONTAINER (priv->frame), priv->box); gtk_widget_show (priv->box); } static GObject * na_tray_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params) { GObject *object; NaTray *tray; NaTrayPrivate *priv; int screen_number; object = G_OBJECT_CLASS (na_tray_parent_class)->constructor (type, n_construct_properties, construct_params); tray = NA_TRAY (object); priv = tray->priv; g_assert (priv->screen != NULL); if (!initialized) { GdkDisplay *display; int n_screens; display = gdk_display_get_default (); n_screens = gdk_display_get_n_screens (display); trays_screens = g_new0 (TraysScreen, n_screens); initialized = TRUE; } screen_number = gdk_screen_get_number (priv->screen); if (trays_screens [screen_number].tray_manager == NULL) { NaTrayManager *tray_manager; tray_manager = na_tray_manager_new (); if (na_tray_manager_manage_screen (tray_manager, priv->screen)) { trays_screens [screen_number].tray_manager = tray_manager; g_signal_connect (tray_manager, "tray_icon_added", G_CALLBACK (tray_added), &trays_screens [screen_number]); g_signal_connect (tray_manager, "tray_icon_removed", G_CALLBACK (tray_removed), &trays_screens [screen_number]); g_signal_connect (tray_manager, "message_sent", G_CALLBACK (message_sent), &trays_screens [screen_number]); g_signal_connect (tray_manager, "message_cancelled", G_CALLBACK (message_cancelled), &trays_screens [screen_number]); trays_screens [screen_number].icon_table = g_hash_table_new (NULL, NULL); trays_screens [screen_number].tip_table = g_hash_table_new_full ( NULL, NULL, NULL, icon_tip_free); } else { g_printerr ("System tray didn't get the system tray manager selection for screen %d\n", screen_number); g_object_unref (tray_manager); } } priv->trays_screen = &trays_screens [screen_number]; trays_screens [screen_number].all_trays = g_slist_append (trays_screens [screen_number].all_trays, tray); update_size_and_orientation (tray); return object; } static void na_tray_dispose (GObject *object) { NaTray *tray = NA_TRAY (object); NaTrayPrivate *priv = tray->priv; TraysScreen *trays_screen = priv->trays_screen; if (trays_screen != NULL) { trays_screen->all_trays = g_slist_remove (trays_screen->all_trays, tray); if (trays_screen->all_trays == NULL) { /* Make sure we drop the manager selection */ g_object_unref (trays_screen->tray_manager); trays_screen->tray_manager = NULL; g_hash_table_destroy (trays_screen->icon_table); trays_screen->icon_table = NULL; g_hash_table_destroy (trays_screen->tip_table); trays_screen->tip_table = NULL; } else { NaTray *new_tray; new_tray = get_tray (trays_screen); if (new_tray != NULL) na_tray_manager_set_orientation (trays_screen->tray_manager, na_tray_get_orientation (new_tray)); } } priv->trays_screen = NULL; if (priv->idle_redraw_id != 0) { g_source_remove (priv->idle_redraw_id); priv->idle_redraw_id = 0; } G_OBJECT_CLASS (na_tray_parent_class)->dispose (object); } static void na_tray_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NaTray *tray = NA_TRAY (object); NaTrayPrivate *priv = tray->priv; switch (prop_id) { case PROP_ORIENTATION: na_tray_set_orientation (tray, g_value_get_enum (value)); break; case PROP_SCREEN: priv->screen = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void na_tray_get_preferred_width (GtkWidget *widget, gint *minimal_width, gint *natural_width) { gtk_widget_get_preferred_width (gtk_bin_get_child (GTK_BIN (widget)), minimal_width, natural_width); } static void na_tray_get_preferred_height (GtkWidget *widget, gint *minimal_height, gint *natural_height) { gtk_widget_get_preferred_height (gtk_bin_get_child (GTK_BIN (widget)), minimal_height, natural_height); } static void na_tray_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), allocation); gtk_widget_set_allocation (widget, allocation); } static void na_tray_class_init (NaTrayClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); gobject_class->constructor = na_tray_constructor; gobject_class->set_property = na_tray_set_property; gobject_class->dispose = na_tray_dispose; widget_class->get_preferred_width = na_tray_get_preferred_width; widget_class->get_preferred_height = na_tray_get_preferred_height; widget_class->size_allocate = na_tray_size_allocate; g_object_class_install_property (gobject_class, PROP_ORIENTATION, g_param_spec_enum ("orientation", "orientation", "orientation", GTK_TYPE_ORIENTATION, GTK_ORIENTATION_HORIZONTAL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_object_class_install_property (gobject_class, PROP_SCREEN, g_param_spec_object ("screen", "screen", "screen", GDK_TYPE_SCREEN, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); g_type_class_add_private (gobject_class, sizeof (NaTrayPrivate)); } NaTray * na_tray_new_for_screen (GdkScreen *screen, GtkOrientation orientation, NaTrayFilterCallback cb, gpointer data) { NaTray *tray; tray = g_object_new (NA_TYPE_TRAY, "screen", screen, "orientation", orientation, NULL); tray->priv->cb = cb; tray->priv->data = data; return tray; } void na_tray_set_orientation (NaTray *tray, GtkOrientation orientation) { NaTrayPrivate *priv = tray->priv; if (orientation == priv->orientation) return; priv->orientation = orientation; update_size_and_orientation (tray); } GtkOrientation na_tray_get_orientation (NaTray *tray) { return tray->priv->orientation; } static gboolean idle_redraw_cb (NaTray *tray) { NaTrayPrivate *priv = tray->priv; gtk_container_foreach (GTK_CONTAINER (priv->box), (GtkCallback)na_tray_child_force_redraw, tray); priv->idle_redraw_id = 0; return FALSE; } void na_tray_set_padding (NaTray *tray, gint padding) { NaTrayPrivate *priv = tray->priv; if (get_tray (priv->trays_screen) == tray) na_tray_manager_set_padding (priv->trays_screen->tray_manager, padding); } void na_tray_set_icon_size (NaTray *tray, gint size) { NaTrayPrivate *priv = tray->priv; if (get_tray (priv->trays_screen) == tray) na_tray_manager_set_icon_size (priv->trays_screen->tray_manager, size); } void na_tray_set_colors (NaTray *tray, GdkColor *fg, GdkColor *error, GdkColor *warning, GdkColor *success) { NaTrayPrivate *priv = tray->priv; if (get_tray (priv->trays_screen) == tray) na_tray_manager_set_colors (priv->trays_screen->tray_manager, fg, error, warning, success); } void na_tray_force_redraw (NaTray *tray) { NaTrayPrivate *priv = tray->priv; /* Force the icons to redraw their backgrounds. */ if (priv->idle_redraw_id == 0) priv->idle_redraw_id = g_idle_add ((GSourceFunc) idle_redraw_cb, tray); } NaTrayManager * na_tray_get_manager (NaTray *tray) { return trays_screens [gdk_screen_get_number (tray->priv->screen)].tray_manager; } libunity-misc-4.0.5+14.04.20140115/unity-misc/na-marshal.list0000644000015000001560000000010112265474522023660 0ustar pbuserpbgroup00000000000000VOID:OBJECT,OBJECT VOID:OBJECT,STRING,LONG,LONG VOID:OBJECT,LONG libunity-misc-4.0.5+14.04.20140115/unity-misc/fixedtip.c0000644000015000001560000001712612265474522022737 0ustar pbuserpbgroup00000000000000/* Metacity fixed tooltip routine */ /* * Copyright (C) 2001 Havoc Pennington * Copyright (C) 2003-2006 Vincent Untz * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #include "fixedtip.h" /* Signals */ enum { CLICKED, LAST_SIGNAL }; static guint fixedtip_signals[LAST_SIGNAL] = { 0 }; struct _NaFixedTipPrivate { GtkWidget *parent; GtkWidget *label; GtkOrientation orientation; }; G_DEFINE_TYPE (NaFixedTip, na_fixed_tip, GTK_TYPE_WINDOW) static gboolean button_press_handler (GtkWidget *fixedtip, GdkEventButton *event, gpointer data) { if (event->button == 1 && event->type == GDK_BUTTON_PRESS) g_signal_emit (fixedtip, fixedtip_signals[CLICKED], 0); return FALSE; } static gboolean na_fixed_tip_draw (GtkWidget *widget, cairo_t *cr) { GtkStyleContext *context; GtkStateFlags state; int width, height; width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); state = gtk_widget_get_state_flags (widget); context = gtk_widget_get_style_context (widget); gtk_style_context_save (context); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP); gtk_style_context_set_state (context, state); cairo_save (cr); gtk_render_background (context, cr, 0., 0., (gdouble)width, (gdouble)height); cairo_restore (cr); gtk_style_context_restore (context); return FALSE; } static void na_fixed_tip_class_init (NaFixedTipClass *class) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); widget_class->draw = na_fixed_tip_draw; fixedtip_signals[CLICKED] = g_signal_new ("clicked", G_OBJECT_CLASS_TYPE (class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaFixedTipClass, clicked), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_type_class_add_private (class, sizeof (NaFixedTipPrivate)); } /* Did you already see this code? Yes, it's gtk_tooltips_ force_window() ;-) */ static void na_fixed_tip_init (NaFixedTip *fixedtip) { GtkWidget *label; fixedtip->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixedtip, NA_TYPE_FIXED_TIP, NaFixedTipPrivate); gtk_window_set_type_hint (GTK_WINDOW (fixedtip), GDK_WINDOW_TYPE_HINT_TOOLTIP); gtk_widget_set_app_paintable (GTK_WIDGET (fixedtip), TRUE); gtk_window_set_resizable (GTK_WINDOW (fixedtip), FALSE); gtk_widget_set_name (GTK_WIDGET (fixedtip), "gtk-tooltips"); gtk_container_set_border_width (GTK_CONTAINER (fixedtip), 4); label = gtk_label_new (NULL); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); gtk_widget_show (label); gtk_container_add (GTK_CONTAINER (fixedtip), label); fixedtip->priv->label = label; gtk_widget_add_events (GTK_WIDGET (fixedtip), GDK_BUTTON_PRESS_MASK); g_signal_connect (fixedtip, "button_press_event", G_CALLBACK (button_press_handler), NULL); fixedtip->priv->orientation = GTK_ORIENTATION_HORIZONTAL; } static void na_fixed_tip_position (NaFixedTip *fixedtip) { GdkScreen *screen; GdkWindow *parent_window; GtkRequisition req; int root_x; int root_y; int parent_width; int parent_height; int screen_width; int screen_height; screen = gtk_widget_get_screen (fixedtip->priv->parent); parent_window = gtk_widget_get_window (fixedtip->priv->parent); gtk_window_set_screen (GTK_WINDOW (fixedtip), screen); gtk_widget_get_preferred_size (GTK_WIDGET (fixedtip), &req, NULL); gdk_window_get_origin (parent_window, &root_x, &root_y); parent_width = gdk_window_get_width (parent_window); parent_height = gdk_window_get_height (parent_window); screen_width = gdk_screen_get_width (screen); screen_height = gdk_screen_get_height (screen); /* pad between panel and message window */ #define PAD 5 if (fixedtip->priv->orientation == GTK_ORIENTATION_VERTICAL) { if (root_x <= screen_width / 2) root_x += parent_width + PAD; else root_x -= req.width + PAD; } else { if (root_y <= screen_height / 2) root_y += parent_height + PAD; else root_y -= req.height + PAD; } /* Push onscreen */ if ((root_x + req.width) > screen_width) root_x = screen_width - req.width; if ((root_y + req.height) > screen_height) root_y = screen_height - req.height; gtk_window_move (GTK_WINDOW (fixedtip), root_x, root_y); } static void na_fixed_tip_parent_size_allocated (GtkWidget *parent, GtkAllocation *allocation, NaFixedTip *fixedtip) { na_fixed_tip_position (fixedtip); } static void na_fixed_tip_parent_screen_changed (GtkWidget *parent, GdkScreen *new_screen, NaFixedTip *fixedtip) { na_fixed_tip_position (fixedtip); } GtkWidget * na_fixed_tip_new (GtkWidget *parent, GtkOrientation orientation) { NaFixedTip *fixedtip; g_return_val_if_fail (parent != NULL, NULL); fixedtip = g_object_new (NA_TYPE_FIXED_TIP, "type", GTK_WINDOW_POPUP, NULL); fixedtip->priv->parent = parent; #if 0 //FIXME: would be nice to be able to get the toplevel for the tip, but this //doesn't work GtkWidget *toplevel; toplevel = gtk_widget_get_toplevel (parent); /* if (toplevel && gtk_widget_is_toplevel (toplevel) && GTK_IS_WINDOW (toplevel)) gtk_window_set_transient_for (GTK_WINDOW (fixedtip), GTK_WINDOW (toplevel)); */ #endif fixedtip->priv->orientation = orientation; //FIXME: would be nice to move the tip when the notification area moves g_signal_connect_object (parent, "size-allocate", G_CALLBACK (na_fixed_tip_parent_size_allocated), fixedtip, 0); g_signal_connect_object (parent, "screen-changed", G_CALLBACK (na_fixed_tip_parent_screen_changed), fixedtip, 0); na_fixed_tip_position (fixedtip); return GTK_WIDGET (fixedtip); } void na_fixed_tip_set_markup (GtkWidget *widget, const char *markup_text) { NaFixedTip *fixedtip; g_return_if_fail (NA_IS_FIXED_TIP (widget)); fixedtip = NA_FIXED_TIP (widget); gtk_label_set_markup (GTK_LABEL (fixedtip->priv->label), markup_text); na_fixed_tip_position (fixedtip); } void na_fixed_tip_set_orientation (GtkWidget *widget, GtkOrientation orientation) { NaFixedTip *fixedtip; g_return_if_fail (NA_IS_FIXED_TIP (widget)); fixedtip = NA_FIXED_TIP (widget); if (orientation == fixedtip->priv->orientation) return; fixedtip->priv->orientation = orientation; na_fixed_tip_position (fixedtip); } libunity-misc-4.0.5+14.04.20140115/unity-misc/gnome-bg-slideshow.c0000644000015000001560000002466512265474522024623 0ustar pbuserpbgroup00000000000000/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- gnomebg.c: Object for the desktop background. Copyright (C) 2000 Eazel, Inc. Copyright (C) 2007-2008 Red Hat, Inc. Copyright (C) 2011 Canonical Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Derived from eel-background.c and eel-gdk-pixbuf-extensions.c by Darin Adler and Ramiro Estrugo Authors: Soren Sandmann Gordon Allott */ /* Basically ripped apart gnome-bg so i can get access to the slideshow * data, so i can sync with gnome-bg's transitions without using gnome-bg's * transitions */ #include #include #include #include #include #include #include #include "gnome-bg-slideshow.h" static double now (void) { GTimeVal tv; g_get_current_time (&tv); return (double)tv.tv_sec + (tv.tv_usec / 1000000.0); } Slide * get_current_slide (SlideShow *show, double *alpha) { double delta = fmod (now() - show->start_time, show->total_duration); GList *list; double elapsed; int i; if (delta < 0) delta += show->total_duration; elapsed = 0; i = 0; for (list = show->slides->head; list != NULL; list = list->next) { Slide *slide = list->data; if (elapsed + slide->duration > delta) { if (alpha) *alpha = (delta - elapsed) / (double)slide->duration; return slide; } i++; elapsed += slide->duration; } /* this should never happen since we have slides and we should always * find a current slide for the elapsed time since beginning -- we're * looping with fmod() */ g_assert_not_reached (); return NULL; } double get_slide_timeout (Slide *slide) { double timeout; if (slide->fixed) { timeout = slide->duration; } else { /* Maybe the number of steps should be configurable? */ /* In the worst case we will do a fade from 0 to 256, which mean * we will never use more than 255 steps, however in most cases * the first and last value are similar and users can't percieve * changes in pixel values as small as 1/255th. So, lets not waste * CPU cycles on transitioning to often. * * 64 steps is enough for each step to be just detectable in a 16bit * color mode in the worst case, so we'll use this as an approximation * of whats detectable. */ timeout = slide->duration / 64.0; } return timeout; } static gboolean stack_is (SlideShow *parser, const char *s1, ...); /* Parser for fading background */ static void handle_start_element (GMarkupParseContext *context, const gchar *name, const gchar **attr_names, const gchar **attr_values, gpointer user_data, GError **err) { SlideShow *parser = user_data; gint i; if (strcmp (name, "static") == 0 || strcmp (name, "transition") == 0) { Slide *slide = g_new0 (Slide, 1); if (strcmp (name, "static") == 0) slide->fixed = TRUE; g_queue_push_tail (parser->slides, slide); } else if (strcmp (name, "size") == 0) { Slide *slide = parser->slides->tail->data; FileSize *size = g_new0 (FileSize, 1); for (i = 0; attr_names[i]; i++) { if (strcmp (attr_names[i], "width") == 0) size->width = atoi (attr_values[i]); else if (strcmp (attr_names[i], "height") == 0) size->height = atoi (attr_values[i]); } if (parser->stack->tail && (strcmp (parser->stack->tail->data, "file") == 0 || strcmp (parser->stack->tail->data, "from") == 0)) { slide->file1 = g_slist_prepend (slide->file1, size); } else if (parser->stack->tail && strcmp (parser->stack->tail->data, "to") == 0) { slide->file2 = g_slist_prepend (slide->file2, size); } } g_queue_push_tail (parser->stack, g_strdup (name)); } static void handle_end_element (GMarkupParseContext *context, const gchar *name, gpointer user_data, GError **err) { SlideShow *parser = user_data; g_free (g_queue_pop_tail (parser->stack)); } static gboolean stack_is (SlideShow *parser, const char *s1, ...) { GList *stack = NULL; const char *s; GList *l1, *l2; va_list args; stack = g_list_prepend (stack, (gpointer)s1); va_start (args, s1); s = va_arg (args, const char *); while (s) { stack = g_list_prepend (stack, (gpointer)s); s = va_arg (args, const char *); } l1 = stack; l2 = parser->stack->head; while (l1 && l2) { if (strcmp (l1->data, l2->data) != 0) { g_list_free (stack); return FALSE; } l1 = l1->next; l2 = l2->next; } g_list_free (stack); return (!l1 && !l2); } static int parse_int (const char *text) { return strtol (text, NULL, 0); } static void handle_text (GMarkupParseContext *context, const gchar *text, gsize text_len, gpointer user_data, GError **err) { SlideShow *parser = user_data; Slide *slide = parser->slides->tail? parser->slides->tail->data : NULL; FileSize *fs; gint i; if (stack_is (parser, "year", "starttime", "background", NULL)) { parser->start_tm.tm_year = parse_int (text) - 1900; } else if (stack_is (parser, "month", "starttime", "background", NULL)) { parser->start_tm.tm_mon = parse_int (text) - 1; } else if (stack_is (parser, "day", "starttime", "background", NULL)) { parser->start_tm.tm_mday = parse_int (text); } else if (stack_is (parser, "hour", "starttime", "background", NULL)) { parser->start_tm.tm_hour = parse_int (text) - 1; } else if (stack_is (parser, "minute", "starttime", "background", NULL)) { parser->start_tm.tm_min = parse_int (text); } else if (stack_is (parser, "second", "starttime", "background", NULL)) { parser->start_tm.tm_sec = parse_int (text); } else if (stack_is (parser, "duration", "static", "background", NULL) || stack_is (parser, "duration", "transition", "background", NULL)) { slide->duration = g_strtod (text, NULL); parser->total_duration += slide->duration; } else if (stack_is (parser, "file", "static", "background", NULL) || stack_is (parser, "from", "transition", "background", NULL)) { for (i = 0; text[i]; i++) { if (!g_ascii_isspace (text[i])) break; } if (text[i] == 0) return; fs = g_new (FileSize, 1); fs->width = -1; fs->height = -1; fs->file = g_strdup (text); slide->file1 = g_slist_prepend (slide->file1, fs); if (slide->file1->next != NULL) parser->has_multiple_sizes = TRUE; } else if (stack_is (parser, "size", "file", "static", "background", NULL) || stack_is (parser, "size", "from", "transition", "background", NULL)) { fs = slide->file1->data; fs->file = g_strdup (text); if (slide->file1->next != NULL) parser->has_multiple_sizes = TRUE; } else if (stack_is (parser, "to", "transition", "background", NULL)) { for (i = 0; text[i]; i++) { if (!g_ascii_isspace (text[i])) break; } if (text[i] == 0) return; fs = g_new (FileSize, 1); fs->width = -1; fs->height = -1; fs->file = g_strdup (text); slide->file2 = g_slist_prepend (slide->file2, fs); if (slide->file2->next != NULL) parser->has_multiple_sizes = TRUE; } else if (stack_is (parser, "size", "to", "transition", "background", NULL)) { fs = slide->file2->data; fs->file = g_strdup (text); if (slide->file2->next != NULL) parser->has_multiple_sizes = TRUE; } } SlideShow * slideshow_ref (SlideShow *show) { show->ref_count++; return show; } void slideshow_unref (SlideShow *show) { GList *list; GSList *slist; FileSize *size; show->ref_count--; if (show->ref_count > 0) return; for (list = show->slides->head; list != NULL; list = list->next) { Slide *slide = list->data; for (slist = slide->file1; slist != NULL; slist = slist->next) { size = slist->data; g_free (size->file); g_free (size); } g_slist_free (slide->file1); for (slist = slide->file2; slist != NULL; slist = slist->next) { size = slist->data; g_free (size->file); g_free (size); } g_slist_free (slide->file2); g_free (slide); } g_queue_free (show->slides); g_list_foreach (show->stack->head, (GFunc) g_free, NULL); g_queue_free (show->stack); g_free (show); } static void threadsafe_localtime (time_t threadsafe_time, struct tm *tm) { struct tm *res; G_LOCK_DEFINE_STATIC (localtime_mutex); G_LOCK (localtime_mutex); res = localtime (&threadsafe_time); if (tm) { *tm = *res; } G_UNLOCK (localtime_mutex); } SlideShow * read_slideshow_file (const char *filename, GError **err) { GMarkupParser parser = { handle_start_element, handle_end_element, handle_text, NULL, /* passthrough */ NULL, /* error */ }; GFile *file; char *contents = NULL; gsize len; SlideShow *show = NULL; GMarkupParseContext *context = NULL; time_t t; if (!filename) return NULL; file = g_file_new_for_path (filename); if (!g_file_load_contents (file, NULL, &contents, &len, NULL, NULL)) { g_object_unref (file); return NULL; } g_object_unref (file); show = g_new0 (SlideShow, 1); show->ref_count = 1; threadsafe_localtime ((time_t)0, &show->start_tm); show->stack = g_queue_new (); show->slides = g_queue_new (); context = g_markup_parse_context_new (&parser, 0, show, NULL); if (!g_markup_parse_context_parse (context, contents, len, err)) { slideshow_unref (show); show = NULL; } if (show) { if (!g_markup_parse_context_end_parse (context, err)) { slideshow_unref (show); show = NULL; } } g_markup_parse_context_free (context); if (show) { int show_len; t = mktime (&show->start_tm); show->start_time = (double)t; show_len = g_queue_get_length (show->slides); /* no slides, that's not a slideshow */ if (show_len == 0) { slideshow_unref (show); show = NULL; /* one slide, there's no transition */ } else if (show_len == 1) { Slide *slide = show->slides->head->data; slide->duration = G_MAXUINT; } } g_free (contents); return show; } libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray-child.h0000644000015000001560000000526412265474522023564 0ustar pbuserpbgroup00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* na-tray-child.h * Copyright (C) 2002 Anders Carlsson * Copyright (C) 2003-2006 Vincent Untz * Copyright (C) 2008 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __NA_TRAY_CHILD_H__ #define __NA_TRAY_CHILD_H__ #include #include G_BEGIN_DECLS #define NA_TYPE_TRAY_CHILD (na_tray_child_get_type ()) #define NA_TRAY_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_TRAY_CHILD, NaTrayChild)) #define NA_TRAY_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_TRAY_CHILD, NaTrayChildClass)) #define NA_IS_TRAY_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_TRAY_CHILD)) #define NA_IS_TRAY_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_TRAY_CHILD)) #define NA_TRAY_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_TRAY_CHILD, NaTrayChildClass)) typedef struct _NaTrayChild NaTrayChild; typedef struct _NaTrayChildClass NaTrayChildClass; typedef struct _NaTrayChildChild NaTrayChildChild; struct _NaTrayChild { GtkSocket parent_instance; Window icon_window; guint has_alpha : 1; guint composited : 1; guint parent_relative_bg : 1; }; struct _NaTrayChildClass { GtkSocketClass parent_class; }; GType na_tray_child_get_type (void); GtkWidget *na_tray_child_new (GdkScreen *screen, Window icon_window); char *na_tray_child_get_title (NaTrayChild *child); gboolean na_tray_child_has_alpha (NaTrayChild *child); void na_tray_child_set_composited (NaTrayChild *child, gboolean composited); void na_tray_child_force_redraw (NaTrayChild *child); void na_tray_child_get_wm_class (NaTrayChild *child, char **res_name, char **res_class); G_END_DECLS #endif /* __NA_TRAY_CHILD_H__ */ libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray-manager.c0000644000015000001560000006651012265474522024107 0ustar pbuserpbgroup00000000000000/* na-tray-manager.c * Copyright (C) 2002 Anders Carlsson * Copyright (C) 2003-2006 Vincent Untz * * 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. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Used to be: eggtraymanager.c */ #include #include #include #include "na-tray-manager.h" #if defined (GDK_WINDOWING_X11) #include #include #elif defined (GDK_WINDOWING_WIN32) #include #endif #include #include "na-marshal.h" /* Signals */ enum { TRAY_ICON_ADDED, TRAY_ICON_REMOVED, MESSAGE_SENT, MESSAGE_CANCELLED, LOST_SELECTION, LAST_SIGNAL }; enum { PROP_0, PROP_ORIENTATION }; typedef struct { long id, len; long remaining_len; long timeout; char *str; #ifdef GDK_WINDOWING_X11 Window window; #endif } PendingMessage; static guint manager_signals[LAST_SIGNAL]; #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 #define SYSTEM_TRAY_ORIENTATION_HORZ 0 #define SYSTEM_TRAY_ORIENTATION_VERT 1 #ifdef GDK_WINDOWING_X11 static gboolean na_tray_manager_check_running_screen_x11 (GdkScreen *screen); #endif static void na_tray_manager_finalize (GObject *object); static void na_tray_manager_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void na_tray_manager_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void na_tray_manager_unmanage (NaTrayManager *manager); G_DEFINE_TYPE (NaTrayManager, na_tray_manager, G_TYPE_OBJECT) static void na_tray_manager_init (NaTrayManager *manager) { manager->invisible = NULL; manager->socket_table = g_hash_table_new (NULL, NULL); manager->padding = 0; manager->icon_size = 0; manager->fg.red = 0; manager->fg.green = 0; manager->fg.blue = 0; manager->error.red = 0xffff; manager->error.green = 0; manager->error.blue = 0; manager->warning.red = 0xffff; manager->warning.green = 0xffff; manager->warning.blue = 0; manager->success.red = 0; manager->success.green = 0xffff; manager->success.blue = 0; } static void na_tray_manager_class_init (NaTrayManagerClass *klass) { GObjectClass *gobject_class; gobject_class = (GObjectClass *)klass; gobject_class->finalize = na_tray_manager_finalize; gobject_class->set_property = na_tray_manager_set_property; gobject_class->get_property = na_tray_manager_get_property; g_object_class_install_property (gobject_class, PROP_ORIENTATION, g_param_spec_enum ("orientation", "orientation", "orientation", GTK_TYPE_ORIENTATION, GTK_ORIENTATION_HORIZONTAL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)); manager_signals[TRAY_ICON_ADDED] = g_signal_new ("tray_icon_added", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaTrayManagerClass, tray_icon_added), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_SOCKET); manager_signals[TRAY_ICON_REMOVED] = g_signal_new ("tray_icon_removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaTrayManagerClass, tray_icon_removed), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_SOCKET); manager_signals[MESSAGE_SENT] = g_signal_new ("message_sent", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaTrayManagerClass, message_sent), NULL, NULL, _na_marshal_VOID__OBJECT_STRING_LONG_LONG, G_TYPE_NONE, 4, GTK_TYPE_SOCKET, G_TYPE_STRING, G_TYPE_LONG, G_TYPE_LONG); manager_signals[MESSAGE_CANCELLED] = g_signal_new ("message_cancelled", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaTrayManagerClass, message_cancelled), NULL, NULL, _na_marshal_VOID__OBJECT_LONG, G_TYPE_NONE, 2, GTK_TYPE_SOCKET, G_TYPE_LONG); manager_signals[LOST_SELECTION] = g_signal_new ("lost_selection", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NaTrayManagerClass, lost_selection), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); #if defined (GDK_WINDOWING_X11) /* Nothing */ #elif defined (GDK_WINDOWING_WIN32) g_warning ("Port NaTrayManager to Win32"); #else g_warning ("Port NaTrayManager to this GTK+ backend"); #endif } static void na_tray_manager_finalize (GObject *object) { NaTrayManager *manager; manager = NA_TRAY_MANAGER (object); na_tray_manager_unmanage (manager); g_list_free (manager->messages); g_hash_table_destroy (manager->socket_table); G_OBJECT_CLASS (na_tray_manager_parent_class)->finalize (object); } static void na_tray_manager_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NaTrayManager *manager = NA_TRAY_MANAGER (object); switch (prop_id) { case PROP_ORIENTATION: na_tray_manager_set_orientation (manager, g_value_get_enum (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void na_tray_manager_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { NaTrayManager *manager = NA_TRAY_MANAGER (object); switch (prop_id) { case PROP_ORIENTATION: g_value_set_enum (value, manager->orientation); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } NaTrayManager * na_tray_manager_new (void) { NaTrayManager *manager; manager = g_object_new (NA_TYPE_TRAY_MANAGER, NULL); return manager; } #ifdef GDK_WINDOWING_X11 static gboolean na_tray_manager_plug_removed (GtkSocket *socket, NaTrayManager *manager) { NaTrayChild *child = NA_TRAY_CHILD (socket); g_hash_table_remove (manager->socket_table, GINT_TO_POINTER (child->icon_window)); g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child); /* This destroys the socket. */ return FALSE; } static void na_tray_manager_handle_dock_request (NaTrayManager *manager, XClientMessageEvent *xevent) { Window icon_window = xevent->data.l[2]; GtkWidget *child; if (g_hash_table_lookup (manager->socket_table, GINT_TO_POINTER (icon_window))) { /* We already got this notification earlier, ignore this one */ return; } child = na_tray_child_new (manager->screen, icon_window); if (child == NULL) /* already gone or other error */ return; g_signal_emit (manager, manager_signals[TRAY_ICON_ADDED], 0, child); /* If the child wasn't attached, then destroy it */ if (!GTK_IS_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (child)))) { gtk_widget_destroy (child); return; } g_signal_connect (child, "plug_removed", G_CALLBACK (na_tray_manager_plug_removed), manager); gtk_socket_add_id (GTK_SOCKET (child), icon_window); if (!gtk_socket_get_plug_window (GTK_SOCKET (child))) { /* Embedding failed, we won't get a plug-removed signal */ /* This signal destroys the socket */ g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child); return; } g_hash_table_insert (manager->socket_table, GINT_TO_POINTER (icon_window), child); gtk_widget_show (child); } static void pending_message_free (PendingMessage *message) { g_free (message->str); g_free (message); } static void na_tray_manager_handle_message_data (NaTrayManager *manager, XClientMessageEvent *xevent) { GList *p; int len; /* Try to see if we can find the pending message in the list */ for (p = manager->messages; p; p = p->next) { PendingMessage *msg = p->data; if (xevent->window == msg->window) { /* Append the message */ len = MIN (msg->remaining_len, 20); memcpy ((msg->str + msg->len - msg->remaining_len), &xevent->data, len); msg->remaining_len -= len; if (msg->remaining_len == 0) { GtkSocket *socket; socket = g_hash_table_lookup (manager->socket_table, GINT_TO_POINTER (msg->window)); if (socket) g_signal_emit (manager, manager_signals[MESSAGE_SENT], 0, socket, msg->str, msg->id, msg->timeout); pending_message_free (msg); manager->messages = g_list_remove_link (manager->messages, p); g_list_free_1 (p); } break; } } } static void na_tray_manager_handle_begin_message (NaTrayManager *manager, XClientMessageEvent *xevent) { GtkSocket *socket; GList *p; PendingMessage *msg; long timeout; long len; long id; socket = g_hash_table_lookup (manager->socket_table, GINT_TO_POINTER (xevent->window)); /* we don't know about this tray icon, so ignore the message */ if (!socket) return; timeout = xevent->data.l[2]; len = xevent->data.l[3]; id = xevent->data.l[4]; /* Check if the same message is already in the queue and remove it if so */ for (p = manager->messages; p; p = p->next) { PendingMessage *pmsg = p->data; if (xevent->window == pmsg->window && id == pmsg->id) { /* Hmm, we found it, now remove it */ pending_message_free (pmsg); manager->messages = g_list_remove_link (manager->messages, p); g_list_free_1 (p); break; } } if (len == 0) { g_signal_emit (manager, manager_signals[MESSAGE_SENT], 0, socket, "", id, timeout); } else { /* Now add the new message to the queue */ msg = g_new0 (PendingMessage, 1); msg->window = xevent->window; msg->timeout = timeout; msg->len = len; msg->id = id; msg->remaining_len = msg->len; msg->str = g_malloc (msg->len + 1); msg->str[msg->len] = '\0'; manager->messages = g_list_prepend (manager->messages, msg); } } static void na_tray_manager_handle_cancel_message (NaTrayManager *manager, XClientMessageEvent *xevent) { GList *p; GtkSocket *socket; long id; id = xevent->data.l[2]; /* Check if the message is in the queue and remove it if so */ for (p = manager->messages; p; p = p->next) { PendingMessage *msg = p->data; if (xevent->window == msg->window && id == msg->id) { pending_message_free (msg); manager->messages = g_list_remove_link (manager->messages, p); g_list_free_1 (p); break; } } socket = g_hash_table_lookup (manager->socket_table, GINT_TO_POINTER (xevent->window)); if (socket) { g_signal_emit (manager, manager_signals[MESSAGE_CANCELLED], 0, socket, xevent->data.l[2]); } } static GdkFilterReturn na_tray_manager_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data) { XEvent *xevent = (GdkXEvent *)xev; NaTrayManager *manager = data; if (xevent->type == ClientMessage) { /* _NET_SYSTEM_TRAY_OPCODE: SYSTEM_TRAY_REQUEST_DOCK */ if (xevent->xclient.message_type == manager->opcode_atom && xevent->xclient.data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { na_tray_manager_handle_dock_request (manager, (XClientMessageEvent *) xevent); return GDK_FILTER_REMOVE; } /* _NET_SYSTEM_TRAY_OPCODE: SYSTEM_TRAY_BEGIN_MESSAGE */ else if (xevent->xclient.message_type == manager->opcode_atom && xevent->xclient.data.l[1] == SYSTEM_TRAY_BEGIN_MESSAGE) { na_tray_manager_handle_begin_message (manager, (XClientMessageEvent *) event); return GDK_FILTER_REMOVE; } /* _NET_SYSTEM_TRAY_OPCODE: SYSTEM_TRAY_CANCEL_MESSAGE */ else if (xevent->xclient.message_type == manager->opcode_atom && xevent->xclient.data.l[1] == SYSTEM_TRAY_CANCEL_MESSAGE) { na_tray_manager_handle_cancel_message (manager, (XClientMessageEvent *) event); return GDK_FILTER_REMOVE; } /* _NET_SYSTEM_TRAY_MESSAGE_DATA */ else if (xevent->xclient.message_type == manager->message_data_atom) { na_tray_manager_handle_message_data (manager, (XClientMessageEvent *) event); return GDK_FILTER_REMOVE; } } else if (xevent->type == SelectionClear) { g_signal_emit (manager, manager_signals[LOST_SELECTION], 0); na_tray_manager_unmanage (manager); } return GDK_FILTER_CONTINUE; } #if 0 //FIXME investigate why this doesn't work static gboolean na_tray_manager_selection_clear_event (GtkWidget *widget, GdkEventSelection *event, NaTrayManager *manager) { g_signal_emit (manager, manager_signals[LOST_SELECTION], 0); na_tray_manager_unmanage (manager); return FALSE; } #endif #endif static void na_tray_manager_unmanage (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkDisplay *display; guint32 timestamp; GtkWidget *invisible; GdkWindow *window; if (manager->invisible == NULL) return; invisible = manager->invisible; window = gtk_widget_get_window (invisible); g_assert (GTK_IS_INVISIBLE (invisible)); g_assert (gtk_widget_get_realized (invisible)); g_assert (GDK_IS_WINDOW (window)); display = gtk_widget_get_display (invisible); if (gdk_selection_owner_get_for_display (display, manager->selection_atom) == window) { timestamp = gdk_x11_get_server_time (window); gdk_selection_owner_set_for_display (display, NULL, manager->selection_atom, timestamp, TRUE); } gdk_window_remove_filter (window, na_tray_manager_window_filter, manager); manager->invisible = NULL; /* prior to destroy for reentrancy paranoia */ gtk_widget_destroy (invisible); g_object_unref (G_OBJECT (invisible)); #endif } static void na_tray_manager_set_orientation_property (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkWindow *window; GdkDisplay *display; Atom orientation_atom; gulong data[1]; g_return_if_fail (manager->invisible != NULL); window = gtk_widget_get_window (manager->invisible); g_return_if_fail (window != NULL); display = gtk_widget_get_display (manager->invisible); orientation_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_SYSTEM_TRAY_ORIENTATION"); data[0] = manager->orientation == GTK_ORIENTATION_HORIZONTAL ? SYSTEM_TRAY_ORIENTATION_HORZ : SYSTEM_TRAY_ORIENTATION_VERT; XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), orientation_atom, XA_CARDINAL, 32, PropModeReplace, (guchar *) &data, 1); #endif } static void na_tray_manager_set_visual_property (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkWindow *window; GdkDisplay *display; Visual *xvisual; Atom visual_atom; gulong data[1]; g_return_if_fail (manager->invisible != NULL); window = gtk_widget_get_window (manager->invisible); g_return_if_fail (window != NULL); /* The visual property is a hint to the tray icons as to what visual they * should use for their windows. If the X server has RGBA colormaps, then * we tell the tray icons to use a RGBA colormap and we'll composite the * icon onto its parents with real transparency. Otherwise, we just tell * the icon to use our colormap, and we'll do some hacks with parent * relative backgrounds to simulate transparency. */ display = gtk_widget_get_display (manager->invisible); visual_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_SYSTEM_TRAY_VISUAL"); if (gdk_screen_get_rgba_visual (manager->screen) != NULL && gdk_display_supports_composite (display)) xvisual = GDK_VISUAL_XVISUAL (gdk_screen_get_rgba_visual (manager->screen)); else { /* We actually want the visual of the tray where the icons will * be embedded. In almost all cases, this will be the same as the visual * of the screen. */ xvisual = GDK_VISUAL_XVISUAL (gdk_screen_get_system_visual (manager->screen)); } data[0] = XVisualIDFromVisual (xvisual); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), visual_atom, XA_VISUALID, 32, PropModeReplace, (guchar *) &data, 1); #endif } static void na_tray_manager_set_padding_property (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkWindow *window; GdkDisplay *display; Atom atom; gulong data[1]; g_return_if_fail (manager->invisible != NULL); window = gtk_widget_get_window (manager->invisible); g_return_if_fail (window != NULL); display = gtk_widget_get_display (manager->invisible); atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_SYSTEM_TRAY_PADDING"); data[0] = manager->padding; XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), atom, XA_CARDINAL, 32, PropModeReplace, (guchar *) &data, 1); #endif } static void na_tray_manager_set_icon_size_property (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkWindow *window; GdkDisplay *display; Atom atom; gulong data[1]; g_return_if_fail (manager->invisible != NULL); window = gtk_widget_get_window (manager->invisible); g_return_if_fail (window != NULL); display = gtk_widget_get_display (manager->invisible); atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_SYSTEM_TRAY_ICON_SIZE"); data[0] = manager->icon_size; XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), atom, XA_CARDINAL, 32, PropModeReplace, (guchar *) &data, 1); #endif } static void na_tray_manager_set_colors_property (NaTrayManager *manager) { #ifdef GDK_WINDOWING_X11 GdkWindow *window; GdkDisplay *display; Atom atom; gulong data[12]; g_return_if_fail (manager->invisible != NULL); window = gtk_widget_get_window (manager->invisible); g_return_if_fail (window != NULL); display = gtk_widget_get_display (manager->invisible); atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_SYSTEM_TRAY_COLORS"); data[0] = manager->fg.red; data[1] = manager->fg.green; data[2] = manager->fg.blue; data[3] = manager->error.red; data[4] = manager->error.green; data[5] = manager->error.blue; data[6] = manager->warning.red; data[7] = manager->warning.green; data[8] = manager->warning.blue; data[9] = manager->success.red; data[10] = manager->success.green; data[11] = manager->success.blue; XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), atom, XA_CARDINAL, 32, PropModeReplace, (guchar *) &data, 12); #endif } #ifdef GDK_WINDOWING_X11 static gboolean na_tray_manager_manage_screen_x11 (NaTrayManager *manager, GdkScreen *screen) { GdkDisplay *display; Screen *xscreen; GtkWidget *invisible; GdkWindow *window; char *selection_atom_name; guint32 timestamp; g_return_val_if_fail (NA_IS_TRAY_MANAGER (manager), FALSE); g_return_val_if_fail (manager->screen == NULL, FALSE); /* If there's already a manager running on the screen * we can't create another one. */ #if 0 if (na_tray_manager_check_running_screen_x11 (screen)) return FALSE; #endif manager->screen = screen; display = gdk_screen_get_display (screen); xscreen = GDK_SCREEN_XSCREEN (screen); invisible = gtk_invisible_new_for_screen (screen); gtk_widget_realize (invisible); gtk_widget_add_events (invisible, GDK_PROPERTY_CHANGE_MASK | GDK_STRUCTURE_MASK); selection_atom_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d", gdk_screen_get_number (screen)); manager->selection_atom = gdk_atom_intern (selection_atom_name, FALSE); g_free (selection_atom_name); manager->invisible = invisible; g_object_ref (G_OBJECT (manager->invisible)); na_tray_manager_set_orientation_property (manager); na_tray_manager_set_visual_property (manager); na_tray_manager_set_padding_property (manager); na_tray_manager_set_icon_size_property (manager); na_tray_manager_set_colors_property (manager); window = gtk_widget_get_window (invisible); timestamp = gdk_x11_get_server_time (window); /* Check if we could set the selection owner successfully */ if (gdk_selection_owner_set_for_display (display, window, manager->selection_atom, timestamp, TRUE)) { XClientMessageEvent xev; GdkAtom opcode_atom; GdkAtom message_data_atom; xev.type = ClientMessage; xev.window = RootWindowOfScreen (xscreen); xev.message_type = gdk_x11_get_xatom_by_name_for_display (display, "MANAGER"); xev.format = 32; xev.data.l[0] = timestamp; xev.data.l[1] = gdk_x11_atom_to_xatom_for_display (display, manager->selection_atom); xev.data.l[2] = GDK_WINDOW_XID (window); xev.data.l[3] = 0; /* manager specific data */ xev.data.l[4] = 0; /* manager specific data */ XSendEvent (GDK_DISPLAY_XDISPLAY (display), RootWindowOfScreen (xscreen), False, StructureNotifyMask, (XEvent *)&xev); opcode_atom = gdk_atom_intern ("_NET_SYSTEM_TRAY_OPCODE", FALSE); manager->opcode_atom = gdk_x11_atom_to_xatom_for_display (display, opcode_atom); message_data_atom = gdk_atom_intern ("_NET_SYSTEM_TRAY_MESSAGE_DATA", FALSE); manager->message_data_atom = gdk_x11_atom_to_xatom_for_display (display, message_data_atom); /* Add a window filter */ #if 0 /* This is for when we lose the selection of _NET_SYSTEM_TRAY_Sx */ g_signal_connect (invisible, "selection-clear-event", G_CALLBACK (na_tray_manager_selection_clear_event), manager); #endif gdk_window_add_filter (window, na_tray_manager_window_filter, manager); return TRUE; } else { gtk_widget_destroy (invisible); g_object_unref (invisible); manager->invisible = NULL; manager->screen = NULL; return FALSE; } } #endif gboolean na_tray_manager_manage_screen (NaTrayManager *manager, GdkScreen *screen) { g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); g_return_val_if_fail (manager->screen == NULL, FALSE); #ifdef GDK_WINDOWING_X11 return na_tray_manager_manage_screen_x11 (manager, screen); #else return FALSE; #endif } #ifdef GDK_WINDOWING_X11 static gboolean na_tray_manager_check_running_screen_x11 (GdkScreen *screen) { GdkDisplay *display; Atom selection_atom; char *selection_atom_name; display = gdk_screen_get_display (screen); selection_atom_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d", gdk_screen_get_number (screen)); selection_atom = gdk_x11_get_xatom_by_name_for_display (display, selection_atom_name); g_free (selection_atom_name); if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), selection_atom) != None) return TRUE; else return FALSE; } #endif gboolean na_tray_manager_check_running (GdkScreen *screen) { g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); #ifdef GDK_WINDOWING_X11 return na_tray_manager_check_running_screen_x11 (screen); #else return FALSE; #endif } void na_tray_manager_set_orientation (NaTrayManager *manager, GtkOrientation orientation) { g_return_if_fail (NA_IS_TRAY_MANAGER (manager)); if (manager->orientation != orientation) { manager->orientation = orientation; na_tray_manager_set_orientation_property (manager); g_object_notify (G_OBJECT (manager), "orientation"); } } void na_tray_manager_set_padding (NaTrayManager *manager, gint padding) { g_return_if_fail (NA_IS_TRAY_MANAGER (manager)); if (manager->padding != padding) { manager->padding = padding; na_tray_manager_set_padding_property (manager); } } void na_tray_manager_set_icon_size (NaTrayManager *manager, gint icon_size) { g_return_if_fail (NA_IS_TRAY_MANAGER (manager)); if (manager->icon_size != icon_size) { manager->icon_size = icon_size; na_tray_manager_set_icon_size_property (manager); } } void na_tray_manager_set_colors (NaTrayManager *manager, GdkColor *fg, GdkColor *error, GdkColor *warning, GdkColor *success) { g_return_if_fail (NA_IS_TRAY_MANAGER (manager)); if (!gdk_color_equal (&manager->fg, fg) || !gdk_color_equal (&manager->error, error) || !gdk_color_equal (&manager->warning, warning) || !gdk_color_equal (&manager->success, success)) { manager->fg = *fg; manager->error = *error; manager->warning = *warning; manager->success = *success; na_tray_manager_set_colors_property (manager); } } GtkOrientation na_tray_manager_get_orientation (NaTrayManager *manager) { g_return_val_if_fail (NA_IS_TRAY_MANAGER (manager), GTK_ORIENTATION_HORIZONTAL); return manager->orientation; } libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray-manager.h0000644000015000001560000000750312265474522024111 0ustar pbuserpbgroup00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* na-tray-manager.h * Copyright (C) 2002 Anders Carlsson * Copyright (C) 2003-2006 Vincent Untz * * 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. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Used to be: eggtraymanager.h */ #ifndef __NA_TRAY_MANAGER_H__ #define __NA_TRAY_MANAGER_H__ #ifdef GDK_WINDOWING_X11 #include #endif #include #include "na-tray-child.h" G_BEGIN_DECLS #define NA_TYPE_TRAY_MANAGER (na_tray_manager_get_type ()) #define NA_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_TRAY_MANAGER, NaTrayManager)) #define NA_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_TRAY_MANAGER, NaTrayManagerClass)) #define NA_IS_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_TRAY_MANAGER)) #define NA_IS_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_TRAY_MANAGER)) #define NA_TRAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_TRAY_MANAGER, NaTrayManagerClass)) typedef struct _NaTrayManager NaTrayManager; typedef struct _NaTrayManagerClass NaTrayManagerClass; struct _NaTrayManager { GObject parent_instance; #ifdef GDK_WINDOWING_X11 GdkAtom selection_atom; Atom opcode_atom; Atom message_data_atom; #endif GtkWidget *invisible; GdkScreen *screen; GtkOrientation orientation; gint padding; gint icon_size; GdkColor fg; GdkColor error; GdkColor warning; GdkColor success; GList *messages; GHashTable *socket_table; }; struct _NaTrayManagerClass { GObjectClass parent_class; void (* tray_icon_added) (NaTrayManager *manager, NaTrayChild *child); void (* tray_icon_removed) (NaTrayManager *manager, NaTrayChild *child); void (* message_sent) (NaTrayManager *manager, NaTrayChild *child, const gchar *message, glong id, glong timeout); void (* message_cancelled) (NaTrayManager *manager, NaTrayChild *child, glong id); void (* lost_selection) (NaTrayManager *manager); }; GType na_tray_manager_get_type (void); gboolean na_tray_manager_check_running (GdkScreen *screen); NaTrayManager *na_tray_manager_new (void); gboolean na_tray_manager_manage_screen (NaTrayManager *manager, GdkScreen *screen); void na_tray_manager_set_orientation (NaTrayManager *manager, GtkOrientation orientation); GtkOrientation na_tray_manager_get_orientation (NaTrayManager *manager); void na_tray_manager_set_padding (NaTrayManager *manager, gint padding); void na_tray_manager_set_icon_size (NaTrayManager *manager, gint padding); void na_tray_manager_set_colors (NaTrayManager *manager, GdkColor *fg, GdkColor *error, GdkColor *warning, GdkColor *success); G_END_DECLS #endif /* __NA_TRAY_MANAGER_H__ */ libunity-misc-4.0.5+14.04.20140115/unity-misc/na-tray.h0000644000015000001560000000555512265474522022506 0ustar pbuserpbgroup00000000000000/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* na-tray-tray.h * Copyright (C) 2002 Anders Carlsson * Copyright (C) 2003-2006 Vincent Untz * * 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. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Used to be: eggtraytray.h */ #ifndef __NA_TRAY_H__ #define __NA_TRAY_H__ #ifdef GDK_WINDOWING_X11 #include #endif #include #include "na-tray-manager.h" G_BEGIN_DECLS #define NA_TYPE_TRAY (na_tray_get_type ()) #define NA_TRAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_TRAY, NaTray)) #define NA_TRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_TRAY, NaTrayClass)) #define NA_IS_TRAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_TRAY)) #define NA_IS_TRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_TRAY)) #define NA_TRAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_TRAY, NaTrayClass)) typedef struct _NaTray NaTray; typedef struct _NaTrayPrivate NaTrayPrivate; typedef struct _NaTrayClass NaTrayClass; typedef gboolean (*NaTrayFilterCallback) (NaTray *tray, GtkWidget *icon, gpointer data); struct _NaTray { GtkBin parent_instance; NaTrayPrivate *priv; }; struct _NaTrayClass { GtkBinClass parent_class; }; GType na_tray_get_type (void); NaTray *na_tray_new_for_screen (GdkScreen *screen, GtkOrientation orientation, NaTrayFilterCallback cb, gpointer data); void na_tray_set_orientation (NaTray *tray, GtkOrientation orientation); GtkOrientation na_tray_get_orientation (NaTray *tray); void na_tray_set_padding (NaTray *tray, gint padding); void na_tray_set_icon_size (NaTray *tray, gint icon_size); void na_tray_set_colors (NaTray *tray, GdkColor *fg, GdkColor *error, GdkColor *warning, GdkColor *success); void na_tray_force_redraw (NaTray *tray); NaTrayManager * na_tray_get_manager (NaTray *tray); G_END_DECLS #endif /* __NA_TRAY_H__ */ libunity-misc-4.0.5+14.04.20140115/unity-misc/Makefile.am0000644000015000001560000000240112265474522023001 0ustar pbuserpbgroup00000000000000BUILT_SOURCES = CLEANFILES = EXTRA_DIST = miscincludedir = $(includedir)/unity-misc/unity-misc misc_headers = \ gnome-bg-slideshow.h \ na-marshal.h \ na-tray-child.h \ na-tray-manager.h \ na-tray.h miscinclude_HEADERS = \ $(misc_headers) lib_LTLIBRARIES = libunity-misc.la libunity_misc_la_SOURCES = \ gnome-bg-slideshow.c \ gnome-bg-slideshow.h \ fixedtip.c \ fixedtip.h \ na-marshal.c \ na-marshal.h \ na-tray-child.c \ na-tray-child.h \ na-tray-manager.c \ na-tray-manager.h \ na-tray.c \ na-tray.h libunity_misc_la_LIBADD = \ $(UNITY_MISC_LIBS) libunity_misc_la_LDFLAGS = \ $(UNITY_MISC_LT_LDFLAGS) libunity_misc_la_CPPFLAGS = \ -I$(srcdir) \ -I$(top_srcdir) \ -DG_LOG_DOMAIN=\"libunity-misc\" \ -DPREFIX=\""$(prefix)"\" \ -DLIBDIR=\""$(libdir)"\" \ -DG_DISABLE_DEPRECATED \ $(GCC_FLAGS) \ $(UNITY_MISC_CFLAGS) \ $(MAINTAINER_CFLAGS) ## # Signal Marshallers ## na-marshal.h: $(srcdir)/na-marshal.list glib-genmarshal --header \ --prefix=_na_marshal $(srcdir)/na-marshal.list \ > na-marshal.h na-marshal.c: $(srcdir)/na-marshal.list glib-genmarshal --body \ --prefix=_na_marshal $(srcdir)/na-marshal.list \ > na-marshal.c BUILT_SOURCES += \ na-marshal.c \ na-marshal.h EXTRA_DIST += na-marshal.list libunity-misc-4.0.5+14.04.20140115/unity-misc/gnome-bg-slideshow.h0000644000015000001560000000346312265474522024621 0ustar pbuserpbgroup00000000000000/* gnome-bg.h - Copyright 2007, Red Hat, Inc. This file is part of the Gnome Library. The Gnome Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Gnome 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the Gnome Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Author: Soren Sandmann */ #ifndef __GNOME_BG_SLIDESHOW__ #define __GNOME_BG_SLIDESHOW__ #include G_BEGIN_DECLS typedef struct _SlideShow SlideShow; typedef struct _Slide Slide; typedef struct _FileSize FileSize; struct _FileSize { gint width; gint height; char *file; }; struct _Slide { double duration; /* in seconds */ gboolean fixed; GSList *file1; GSList *file2; /* NULL if fixed is TRUE */ }; struct _SlideShow { gint ref_count; double start_time; double total_duration; GQueue *slides; gboolean has_multiple_sizes; /* used during parsing */ struct tm start_tm; GQueue *stack; }; Slide *get_current_slide (SlideShow *show, double *alpha); SlideShow *read_slideshow_file (const char *filename, GError **err); SlideShow *slideshow_ref (SlideShow *show); void slideshow_unref (SlideShow *show); G_END_DECLS #endif libunity-misc-4.0.5+14.04.20140115/autogen.sh0000755000015000001560000000024212265474522020646 0ustar pbuserpbgroup00000000000000#!/bin/sh PKG_NAME="libunity-misc" which gnome-autogen.sh || { echo "You need gnome-common from GNOME SVN" exit 1 } USE_GNOME2_MACROS=1 \ . gnome-autogen.sh libunity-misc-4.0.5+14.04.20140115/TODO0000644000015000001560000000073712265474522017346 0ustar pbuserpbgroup00000000000000* Add favourites support * Favourites could be places/mounted voulmes as well * New applications (installed through apt/synaptic), should be automatically to the favourites category, with a 'new' tag, so they are easy to find. * Right-click/edit mode * Add new favourites? - D&D url/folder/document to the 'home' applet in the panel? * Consolidate timelines in the icon class * Add clutter_texture_new_from_path, to get rid of lots of code * Add drop shadow under the panel libunity-misc-4.0.5+14.04.20140115/COPYING0000644000015000001560000001672712265474522017717 0ustar pbuserpbgroup00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. 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 that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. libunity-misc-4.0.5+14.04.20140115/ChangeLog0000644000015000001560000000000112265474522020410 0ustar pbuserpbgroup00000000000000 libunity-misc-4.0.5+14.04.20140115/AUTHORS0000644000015000001560000000005612265474522017720 0ustar pbuserpbgroup00000000000000Neil Jagdish Patel libunity-misc-4.0.5+14.04.20140115/examples/0000755000015000001560000000000012265474646020474 5ustar pbuserpbgroup00000000000000libunity-misc-4.0.5+14.04.20140115/examples/systray.c0000644000015000001560000000333312265474522022351 0ustar pbuserpbgroup00000000000000// gpl v2 // (C) Neil Jagdish Patel #include #include #include #include static gboolean on_window_expose (GtkWidget *window, cairo_t *cr) { GtkAllocation alloc; gtk_widget_get_allocation (window, &alloc); cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); cairo_paint (cr); cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_set_source_rgba (cr, 0.0f, 0.0f, 0.0f, 0.0f); cairo_rectangle (cr, 0, 0, alloc.width, alloc.height); cairo_fill (cr); gtk_container_propagate_draw (GTK_CONTAINER (window), gtk_bin_get_child (GTK_BIN (window)), cr); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window; GtkWidget *tray; gtk_init (&argc, &argv); if (na_tray_manager_check_running (gdk_screen_get_default ())) g_error ("Another tray manager is running"); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_resize (GTK_WINDOW (window), 100, 24); gtk_widget_set_name (window, "UnityPanelApplet"); gtk_widget_set_visual (window, gdk_screen_get_rgba_visual (gdk_screen_get_default ())); gtk_widget_realize (window); gtk_widget_set_app_paintable (window, TRUE); g_signal_connect (window, "draw", G_CALLBACK (on_window_expose), NULL); tray = (GtkWidget *)na_tray_new_for_screen (gdk_screen_get_default (), GTK_ORIENTATION_HORIZONTAL, NULL, NULL); gtk_container_add (GTK_CONTAINER (window), tray); gtk_widget_show (tray); gtk_widget_show_all (window); gtk_main (); return 0; } libunity-misc-4.0.5+14.04.20140115/examples/Makefile.am0000644000015000001560000000041312265474522022517 0ustar pbuserpbgroup00000000000000noinst_PROGRAMS = \ systray AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/unity-misc \ $(GCC_FLAGS) \ $(UNITY_MISC_CFLAGS) \ $(MAINTAINER_CFLAGS) systray_SOURCES = systray.c systray_LDADD = $(top_builddir)/unity-misc/libunity-misc.la $(UNITY_MISC_LIBS) libunity-misc-4.0.5+14.04.20140115/Makefile.am0000644000015000001560000000042312265474522020702 0ustar pbuserpbgroup00000000000000SUBDIRS = unity-misc doc examples pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = unity-misc.pc CLEANFILES = unity-misc.pc DISTCLEANFILES = unity-misc.pc EXTRA_DIST = \ unity-misc.pc.in \ COPYING.GPL \ COPYING.LGPL-2 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc