diff options
71 files changed, 7 insertions, 9426 deletions
diff --git a/COPYING.LIB.LGPL.2.1 b/COPYING.LIB.LGPL.2.1 deleted file mode 100644 index 2d2d780..0000000 --- a/COPYING.LIB.LGPL.2.1 +++ /dev/null @@ -1,510 +0,0 @@ - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations -below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it -becomes a de-facto standard. To achieve this, non-free programs must -be allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control -compilation and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at least - three years, to give the same user the materials specified in - Subsection 6a, above, for a charge no more than the cost of - performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply, and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License -may add an explicit geographical distribution limitation excluding those -countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms -of the ordinary General Public License). - - To apply these terms, attach the following notices to the library. -It is safest to attach them to the start of each source file to most -effectively convey the exclusion of warranty; and each file should -have at least the "copyright" line and a pointer to where the full -notice is found. - - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or -your school, if any, to sign a "copyright disclaimer" for the library, -if necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James - Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/COPYING.LIB.LGPL.3 b/COPYING.LIB.LGPL.3 deleted file mode 100644 index fc8a5de..0000000 --- a/COPYING.LIB.LGPL.3 +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - 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. diff --git a/Makefile.am b/Makefile.am index 072e8df..ae85ded 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,26 +1,7 @@ SUBDIRS = \ - src \ - src-sus \ - libindicate \ - libindicate-gtk \ - libindicator \ - examples \ - tests \ - data \ - po \ - docs - -EXTRA_DIST = \ - COPYING.LIB.LGPL.2.1 \ - COPYING.LIB.LGPL.3 \ - gtk-doc.make \ - omf.make \ - xmldocs.make - -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-scrollkeeper + libindicator DISTCLEANFILES = \ - indicator-applet-*.tar.gz \ - gtk-doc.make + libindicator-*.tar.gz @@ -1,6 +1,6 @@ #!/bin/sh -PKG_NAME="indicator-applet" +PKG_NAME="libindicator" which gnome-autogen.sh || { echo "You need gnome-common from GNOME SVN" @@ -8,5 +8,4 @@ which gnome-autogen.sh || { } USE_GNOME2_MACROS=1 \ -USE_COMMON_DOC_BUILD=yes \ -gnome-autogen.sh --enable-gtk-doc +gnome-autogen.sh diff --git a/configure.ac b/configure.ac index 58b4739..266f433 100644 --- a/configure.ac +++ b/configure.ac @@ -1,15 +1,14 @@ -AC_INIT(src/applet-main.c) +AC_INIT(libindicator, 0.2.0dev, ted@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-applet, 0.2.0dev) +AM_INIT_AUTOMAKE(libindicator, 0.2.0dev) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) -IT_PROG_INTLTOOL([0.35.0]) AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O @@ -19,104 +18,6 @@ AC_PROG_LIBTOOL AC_SUBST(VERSION) AC_CONFIG_MACRO_DIR([m4]) -########################### -# Libindicate versioning -########################### - -LIBINDICATE_CURRENT=2 -LIBINDICATE_REVISION=0 -LIBINDICATE_AGE=0 - -AC_SUBST(LIBINDICATE_CURRENT) -AC_SUBST(LIBINDICATE_REVISION) -AC_SUBST(LIBINDICATE_AGE) - -########################### -# Libindicate versioning -########################### - -LIBINDICATEGTK_CURRENT=0 -LIBINDICATEGTK_REVISION=0 -LIBINDICATEGTK_AGE=0 - -AC_SUBST(LIBINDICATEGTK_CURRENT) -AC_SUBST(LIBINDICATEGTK_REVISION) -AC_SUBST(LIBINDICATEGTK_AGE) - -########################### -# Dependencies -########################### - -GTK_REQUIRED_VERSION=2.12 -PANEL_REQUIRED_VERSION=2.0.0 -DBUS_REQUIRED_VERSION=0.76 - -PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION - libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION - libgnomeui-2.0) -AC_SUBST(APPLET_CFLAGS) -AC_SUBST(APPLET_LIBS) - -AC_PATH_PROG(GCONFTOOL, gconftool-2) -AM_GCONF_SOURCE_2 - -GLIB_REQUIRED_VERSION=2.18 -GIO_REQUIRED_VERSION=2.18 -XML_REQUIRED_VERSION=2.6 - -PKG_CHECK_MODULES(LIBINDICATE, glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION - dbus-glib-1 >= $DBUS_REQUIRED_VERSION - libxml-2.0 >= $XML_REQUIRED_VERSION) -AC_SUBST(LIBINDICATE_CFLAGS) -AC_SUBST(LIBINDICATE_LIBS) - -GDK_PIXBUF_REQUIRED_VERSION=2.12 - -PKG_CHECK_MODULES(LIBINDICATEGTK, glib-2.0 >= $GLIB_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION - gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION - gtk+-2.0 >= $GTK_REQUIRED_VERSION - dbus-glib-1 >= $DBUS_REQUIRED_VERSION) -AC_SUBST(LIBINDICATEGTK_CFLAGS) -AC_SUBST(LIBINDICATEGTK_LIBS) - -########################### -# GObject Introspection -########################### - -AC_ARG_ENABLE(gobject-introspection, AC_HELP_STRING([--enable-gobject-introspection], [enable building the gobject-introspection files]), [enable_gir=$enableval], [enable_gir=yes]) - -if test "x$enable_gir" = "xyes"; then - PKG_CHECK_MODULES(GOBJECT_INTROSPECTION, [gobject-introspection-1.0 >= 0.6], gir_ok=yes, gir_ok=no) - - if test "x$gir_ok" = "xyes"; then - G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` - AC_SUBST(G_IR_SCANNER) - G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` - AC_SUBST(G_IR_COMPILER) - G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` - AC_SUBST(G_IR_GENERATE) - - GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` - AC_SUBST(GIRDIR) - TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" - AC_SUBST(TYPELIBDIR) - fi -else - gir_ok=no -fi - -AM_CONDITIONAL(USE_GIR, test "x$gir_ok" = "xyes") - -########################### -# GTK Doc -########################### - -GTK_DOC_CHECK([1.4]) -GNOME_DOC_INIT -GNOME_COMPILE_WARNINGS - ############################## # Custom Junk ############################## @@ -133,17 +34,6 @@ AC_DEFUN([AC_DEFINE_PATH], [ AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3)) ]) -########################### -# Internationalization -########################### - -GETTEXT_PACKAGE=indicator-applet -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default gettext domain]) -AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory]) - -AM_GLIB_GNU_GETTEXT - ############################## # ./configure Flags messings ############################## @@ -179,21 +69,8 @@ AC_DEFINE_PATH(LIBDIR, "${libdir}", [system configuration dir]) AC_OUTPUT([ Makefile -src/Makefile -src-sus/Makefile -libindicate/Makefile -libindicate/indicate.pc -libindicate-gtk/Makefile -libindicate-gtk/indicate-gtk.pc libindicator/Makefile libindicator/indicator.pc -examples/Makefile -tests/Makefile -data/Makefile -po/Makefile.in -docs/Makefile -docs/reference/Makefile -docs/reference/version.xml ]) ########################### @@ -202,8 +79,7 @@ docs/reference/version.xml AC_MSG_NOTICE([ -Indicator Applet Configuration: +Libindicator Configuration: Prefix: $prefix - GObject Introspection: $gir_ok ]) diff --git a/data/GNOME_FastUserSwitchApplet.server.in.in b/data/GNOME_FastUserSwitchApplet.server.in.in deleted file mode 100644 index 388713b..0000000 --- a/data/GNOME_FastUserSwitchApplet.server.in.in +++ /dev/null @@ -1,28 +0,0 @@ -<oaf_info> - <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet_Factory" type="exe" - location="@LIBEXECDIR@/indicator-applet-sus"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Bonobo/GenericFactory:1.0"/> - <item value="IDL:Bonobo/Unknown:1.0"/> - </oaf_attribute> - <oaf_attribute name="name" type="string" value="Indicator Applet Factory"/> - <oaf_attribute name="description" type="string" value="Indicator Applet Factory"/> - <oaf_attribute name="bonobo:environment" type="stringv"> - <item value="DBUS_SESSION_BUS_ADDRESS"/> - </oaf_attribute> - </oaf_server> - - <oaf_server iid="OAFIID:GNOME_FastUserSwitchApplet" type="factory" - location="OAFIID:GNOME_FastUserSwitchApplet_Factory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/> - <item value="IDL:Bonobo/Control:1.0"/> - <item value="IDL:Bonobo/Unknown:1.0"/> - </oaf_attribute> - <oaf_attribute name="name" type="string" _value="Indicator Applet SUS"/> - <oaf_attribute name="description" type="string" _value="A place to adjust your status, change users or exit your session."/> - <oaf_attribute name="panel:icon" type="string" value="indicator-applet"/> - </oaf_server> -</oaf_info> diff --git a/data/GNOME_IndicatorApplet.server.in.in b/data/GNOME_IndicatorApplet.server.in.in deleted file mode 100644 index c576246..0000000 --- a/data/GNOME_IndicatorApplet.server.in.in +++ /dev/null @@ -1,28 +0,0 @@ -<oaf_info> - <oaf_server iid="OAFIID:GNOME_IndicatorApplet_Factory" type="exe" - location="@LIBEXECDIR@/indicator-applet"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Bonobo/GenericFactory:1.0"/> - <item value="IDL:Bonobo/Unknown:1.0"/> - </oaf_attribute> - <oaf_attribute name="name" type="string" value="Indicator Applet Factory"/> - <oaf_attribute name="description" type="string" value="Indicator Applet Factory"/> - <oaf_attribute name="bonobo:environment" type="stringv"> - <item value="DBUS_SESSION_BUS_ADDRESS"/> - </oaf_attribute> - </oaf_server> - - <oaf_server iid="OAFIID:GNOME_IndicatorApplet" type="factory" - location="OAFIID:GNOME_IndicatorApplet_Factory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/> - <item value="IDL:Bonobo/Control:1.0"/> - <item value="IDL:Bonobo/Unknown:1.0"/> - </oaf_attribute> - <oaf_attribute name="name" type="string" _value="Indicator Applet"/> - <oaf_attribute name="description" type="string" _value="An indicator of something that needs your attention on the desktop"/> - <oaf_attribute name="panel:icon" type="string" value="indicator-applet"/> - </oaf_server> -</oaf_info> diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index 0908bb0..0000000 --- a/data/Makefile.am +++ /dev/null @@ -1,86 +0,0 @@ -# This file will be processed with automake to create Makefile.in - -############################## -# Bonobo .server -############################## - -serverdir = \ - $(libdir)/bonobo/servers -server_in_files = \ - GNOME_IndicatorApplet.server.in \ - GNOME_FastUserSwitchApplet.server.in -server_DATA = \ - $(server_in_files:.server.in=.server) - -%.server.in: %.server.in.in - sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" -e "s|\@VERSION\@|$(VERSION)|" $< > $@ - -@INTLTOOL_SERVER_RULE@ - - -############################## -# GConf Schema -############################## - -schemadir = \ - $(GCONF_SCHEMA_FILE_DIR) - -schema_in_files = \ - indicator-applet.schemas.in - -schema_DATA = \ - $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - -############################## -# Icons -############################## - -iconsdir = $(datadir)/icons/hicolor/scalable/apps - -icons_DATA = indicator-applet.svg - -gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor - -install-data-hook: update-icon-cache -uninstall-hook: update-icon-cache -update-icon-cache: - @-if test -z "$(DESTDIR)"; then \ - echo "Updating Gtk icon cache."; \ - $(gtk_update_icon_cache); \ - else \ - echo "*** Icon cache not updated. After (un)install, run this:"; \ - echo "*** $(gtk_update_icon_cache)"; \ - fi - - -############################## -# Autojunk -############################## - -CLEANFILES = \ - $(server_in_files) \ - $(server_DATA) \ - $(schema_DATA) \ - *.bak - -EXTRA_DIST = \ - $(icons_DATA) \ - GNOME_IndicatorApplet.server.in.in \ - GNOME_FastUserSwitchApplet.server.in.in \ - $(schema_in_files) - -MAINTAINERCLEANFILES = \ - Makefile.in - -if GCONF_SCHEMAS_INSTALL -install-data-local: - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - gconftool-2 --makefile-install-rule $(schema_DATA) -else -install-data-local: -endif - - - diff --git a/data/indicator-applet.schemas.in b/data/indicator-applet.schemas.in deleted file mode 100644 index 30172cd..0000000 --- a/data/indicator-applet.schemas.in +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/indicator-applet/dummy_value</key> - <applyto>/apps/indicator-applet/dummy_value</applyto> - <owner>indicator-applet</owner> - <type>bool</type> - <default>FALSE</default> - <locale name="C"> - <short>Setting up basic GConf</short> - <long>Building up install directories. Need a dummy value.</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> diff --git a/data/indicator-applet.svg b/data/indicator-applet.svg deleted file mode 100644 index 5e9beed..0000000 --- a/data/indicator-applet.svg +++ /dev/null @@ -1,203 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="32px" - height="32px" - id="svg3499" - sodipodi:version="0.32" - inkscape:version="0.46" - sodipodi:docname="add-notification-applet.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> - <defs - id="defs3501"> - <linearGradient - id="linearGradient3547"> - <stop - style="stop-color:#cfcfcf;stop-opacity:1;" - offset="0" - id="stop3549" /> - <stop - id="stop3553" - offset="0.46295282" - style="stop-color:#8e8e92;stop-opacity:1;" /> - <stop - style="stop-color:#f5f5f5;stop-opacity:1;" - offset="1" - id="stop3557" /> - </linearGradient> - <linearGradient - id="linearGradient3245"> - <stop - style="stop-color:#414141;stop-opacity:1;" - offset="0" - id="stop3247" /> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="1" - id="stop3249" /> - </linearGradient> - <filter - inkscape:collect="always" - id="filter3374" - x="-0.21687568" - width="1.4337514" - y="-0.10843168" - height="1.2168634"> - <feGaussianBlur - inkscape:collect="always" - stdDeviation="0.99401352" - id="feGaussianBlur3376" /> - </filter> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient3547" - id="linearGradient3565" - gradientUnits="userSpaceOnUse" - gradientTransform="translate(0,39)" - x1="-230.10732" - y1="54" - x2="-229.75377" - y2="-2" /> - <filter - inkscape:collect="always" - id="filter4144"> - <feGaussianBlur - inkscape:collect="always" - stdDeviation="0.7" - id="feGaussianBlur4146" /> - </filter> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient3245" - id="linearGradient4153" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7000187,0,0,0.7000187,-65.177182,5.3745318)" - x1="119.7433" - y1="17.315649" - x2="111.59486" - y2="12.926581" /> - <filter - inkscape:collect="always" - id="filter4158" - x="-0.24" - width="1.48" - y="-0.24" - height="1.48"> - <feGaussianBlur - inkscape:collect="always" - stdDeviation="0.66262488" - id="feGaussianBlur4160" /> - </filter> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1" - inkscape:cx="15.532905" - inkscape:cy="14.679277" - inkscape:current-layer="layer1" - showgrid="false" - inkscape:grid-bbox="true" - inkscape:document-units="px" - showborder="false"> - <inkscape:grid - type="xygrid" - id="grid3605" - visible="true" - enabled="true" /> - </sodipodi:namedview> - <metadata - id="metadata3504"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - id="layer1" - inkscape:label="Layer 1" - inkscape:groupmode="layer"> - <path - style="opacity:0.4;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4144);enable-background:accumulate" - d="M 16.000005,2 C 8.2720052,2 2.0000052,8.271999 2.0000052,16 C 2.0000052,23.728 8.2720062,30 16.000005,30 C 23.728005,30 30.000006,23.727999 30.000005,16 C 30.000005,8.272 23.728006,2.000001 16.000005,2 z M 16.000005,3 C 23.176003,3.000002 29.000005,8.824 29.000005,16 C 29.000005,23.175999 23.176003,29 16.000005,29 C 8.8240062,29 3.0000052,23.176 3.0000052,16 C 3.0000052,8.824 8.8240072,3 16.000005,3 z" - id="path4138" /> - <path - sodipodi:type="arc" - style="opacity:1;fill:url(#linearGradient3565);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - id="path3539" - sodipodi:cx="-227" - sodipodi:cy="65" - sodipodi:rx="28" - sodipodi:ry="28" - d="M -199,65 A 28,28 0 1 1 -255,65 A 28,28 0 1 1 -199,65 z" - transform="matrix(0.5,0,0,0.5,129.5,-16.499999)" /> - <path - style="opacity:0.22999998;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 16.000005,2 C 8.2720052,2 2.0000052,8.271999 2.0000052,16 C 2.0000052,23.728 8.2720062,30 16.000005,30 C 23.728005,30 30.000006,23.727999 30.000005,16 C 30.000005,8.272 23.728006,2.000001 16.000005,2 z M 16.000005,3 C 23.176003,3.000002 29.000005,8.824 29.000005,16 C 29.000005,23.175999 23.176003,29 16.000005,29 C 8.8240062,29 3.0000052,23.176 3.0000052,16 C 3.0000052,8.824 8.8240072,3 16.000005,3 z" - id="path3541" /> - <path - style="opacity:1;fill:#ffffff;fill-opacity:0.53731346;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 16.000005,3 C 8.8240072,3 3.0000052,8.824 3.0000052,16 C 3.0000052,16.167008 3.0250052,16.334513 3.0312552,16.5 C 3.2936652,9.554839 8.9910152,4 16.000005,4 C 23.008995,4.000002 28.706345,9.554839 28.968755,16.5 C 28.975008,16.334513 29.000005,16.167008 29.000005,16 C 29.000005,8.824 23.176003,3.000002 16.000005,3 z" - id="path3543" /> - <path - style="opacity:1;fill:#ffffff;fill-opacity:0.34199135;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 16.000005,29 C 8.8240072,29 3.0000052,23.176 3.0000052,16 C 3.0000052,15.832992 3.0250052,15.665487 3.0312552,15.5 C 3.2936652,22.445161 8.9910152,28 16.000005,28 C 23.008995,27.999998 28.706345,22.445161 28.968755,15.5 C 28.975008,15.665487 29.000005,15.832992 29.000005,16 C 29.000005,23.176 23.176003,28.999998 16.000005,29 z" - id="path3545" /> - <path - style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4158);enable-background:accumulate" - d="M -109,4 C -110.656,4 -112,5.344 -112,7 C -112,7.0538767 -112.00281,7.1030693 -112,7.15625 C -112.00255,7.2095519 -112,7.2585695 -112,7.3125 C -112,9.1410001 -110.516,10.625 -108.6875,10.625 C -106.859,10.625 -105.375,9.1410003 -105.375,7.3125 C -105.375,5.4839999 -106.859,4.0000001 -108.6875,4 C -108.74143,4 -108.79045,3.9974473 -108.84375,4 C -108.89693,3.9971904 -108.94612,4 -109,4 z" - id="path3549" - transform="matrix(0.7000187,0,0,0.7000187,92.327025,5.3745318)" /> - <path - style="opacity:0.67346939;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter3374);enable-background:accumulate" - d="M -114,12 L -114,14 L -114,14.5 C -113.99997,14.776131 -113.77613,14.999972 -113.5,15 L -112,15 L -112,23 L -114,23 L -114,25 L -114,25.5 C -113.99997,25.776131 -113.77613,25.999972 -113.5,26 L -103.5,26 C -103.22387,25.999972 -103.00003,25.776131 -103,25.5 L -103,23.5 C -103.00003,23.223869 -103.22387,23.000028 -103.5,23 L -104,23 L -105,23 L -105,14.5 L -105,12.5 C -105.00003,12.223869 -105.22387,12.000028 -105.5,12 L -106,12 L -114,12 z" - id="path3551" - transform="matrix(0.7000187,0,0,0.7000187,92.327025,5.3745318)" /> - <path - style="opacity:0.15;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 12.809276,13.774756 C 12.641943,13.806685 12.52189,13.95444 12.524893,14.124766 L 12.524893,15.524803 C 12.524914,15.7181 12.681606,15.874793 12.874903,15.874812 L 13.924931,15.874812 L 13.924931,21.474962 L 12.874903,21.474962 C 12.681606,21.474982 12.524914,21.631674 12.524893,21.824971 L 12.524893,23.225009 C 12.524914,23.418306 12.681606,23.574998 12.874903,23.575018 L 19.87509,23.575018 C 20.068386,23.574998 20.225078,23.418306 20.225099,23.225009 L 20.225099,21.824971 C 20.225078,21.631674 20.068386,21.474982 19.87509,21.474962 L 18.825062,21.474962 L 18.825062,15.524803 L 18.825062,14.124766 C 18.82504,13.931469 18.668348,13.774776 18.475052,13.774756 L 12.874903,13.774756 C 12.853076,13.772701 12.831102,13.772701 12.809276,13.774756 z" - id="path3553" /> - <path - style="fill:url(#linearGradient4153);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.33333337;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 12.524893,13.774756 L 12.524893,15.174794 L 13.924931,15.174794 L 13.924931,21.474962 L 12.524893,21.474962 L 12.524893,22.874999 L 19.52508,22.874999 L 19.52508,21.474962 L 18.125043,21.474962 L 18.125043,15.174794 L 18.125043,13.774756 L 12.524893,13.774756 z" - id="path3555" /> - <path - style="opacity:0.56734691;fill:#606060;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 13.224912,14.49665 L 18.125043,14.49665 L 18.125043,15.546679 L 18.125043,21.846847 C 18.125064,22.040144 18.281756,22.196837 18.475052,22.196856 L 19.52508,22.196856 L 19.52508,22.896875 L 13.224912,22.896875 L 13.224912,22.196856 L 14.27494,22.196856 C 14.468236,22.196837 14.624928,22.040144 14.624949,21.846847 L 14.624949,15.546679 C 14.624928,15.353382 14.468236,15.196689 14.27494,15.196669 L 13.224912,15.196669 L 13.224912,14.49665 z" - id="path3557" /> - <path - sodipodi:type="arc" - style="opacity:0.43000004;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - id="path3559" - sodipodi:cx="116.5" - sodipodi:cy="7.5" - sodipodi:rx="3.5" - sodipodi:ry="3.5" - d="M 120,7.5 A 3.5,3.5 0 1 1 113,7.5 A 3.5,3.5 0 1 1 120,7.5 z" - transform="matrix(0.6625177,0,0,0.6625177,-60.93957,5.5245358)" /> - <path - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.33333337;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 16.024987,8.1746066 C 14.865756,8.1746066 13.924931,9.1154317 13.924931,10.274663 C 13.924931,11.433894 14.865756,12.374719 16.024987,12.374719 C 17.184218,12.374719 18.125043,11.433894 18.125043,10.274663 C 18.125043,9.1154317 17.184218,8.1746066 16.024987,8.1746066 z" - id="path3561" /> - <path - style="opacity:0.56734691;fill:#606060;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - d="M 16.19353,8.6818428 C 15.19564,8.6818428 14.38576,9.4917224 14.38576,10.48961 C 14.38576,11.487497 15.19564,12.297377 16.19353,12.297377 C 17.191414,12.297377 18.001293,11.487497 18.001293,10.48961 C 18.001293,9.4917224 17.191414,8.6818428 16.19353,8.6818428 z" - id="path3563" /> - </g> -</svg> diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index f3ddc22..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = reference diff --git a/docs/indicator-dbus.txt b/docs/indicator-dbus.txt deleted file mode 100644 index 7e655b5..0000000 --- a/docs/indicator-dbus.txt +++ /dev/null @@ -1,39 +0,0 @@ -Thoughts on Indicators - -There are two ways to think about how applications interact with users. One is to tell the user that something is happening right now, the other is to flag the user that more information is available if they'd like to work. These can be combined, leaving a temporal instantaneous notification and a perennial marker of the event happening. Together, these allow for applications that are not currently in the user's focus to provide information and also notify the user that they require attention. - -Due to the nature of notifications being constant until the user interacts with the application, I think that the interface between the indicators on the panel and the application should mirror this. The application would then provide an interface over DBus that would provide access to it's notifications and signals for when they change. - - -Methods - -• GetDesktop -> string -- returns the path to the desktop file that represents this application. This is used for getting information like the name and icon of the application to display in notifications. -• GetIndicatorCount -> uint -- returns the number of indicators that are currently shown by the application. -• GetIndicatorCountByType (type) -> uint -- allows a caller to only notice indicators of a particular type. For instance to separate out mail and calendar notifications in a PIM. -• GetIndicatorList -> int[] -- an array of all the indicator IDs that are currently displayed by the application. -• GetIndicatorListByType (type) -> int[] -- an array of all the indicator IDs that are currently displayed filtered by type. -• GetIndicatorProperty (id, property) -> string -- indicators can have properties that describe them. There is a set of required and optional properties for specific types. -• GetIndicatorPropertyGroup (id, property[]) -> string[] -- same as GetIndicatorProperty, but with lots of properties in one call. -• GetIndicatorProperties (id) -> string[] -- A list of the properties that are on this indicator. -• ShowIndicatorToUser(id) -- calling this function is an indication to the application that the user has indicated that they would like more information on this indicator. If this is something like an e-mail message the message should be shown. If it is a conversation, the window with the conversation in it should be shown. - - -Signals - -• IndicatorAdded (id, type) -- signaled when a new indicator is added -• IndicatorRemoved (id, type) -- signaled when an indicator is deleted -• IndicatorModified (id, property) -- thrown when an indicator's properties change - - -Types - -• "message" -- a user level message. This includes e-mail, IM and SMS messages. -• "system" -- a software update or other notification about the system state. -• "media" -- a notification related media the user is listening to in the background - - -Properties - -• "subject" -- "message" (optional) -- This is the subject line of an e-mail or message. -• "sender" -- "message" (required) -- The person who sent the message -• "body" -- "message" (required) -- The body of the message sent to the user diff --git a/docs/indicator-panel.svg b/docs/indicator-panel.svg deleted file mode 100644 index fbf8462..0000000 --- a/docs/indicator-panel.svg +++ /dev/null @@ -1,1326 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="744.09448819" - height="1052.3622047" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.46+devel" - sodipodi:docname="indicator-panel.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - gridtolerance="10000" - guidetolerance="10" - objecttolerance="10" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.60598682" - inkscape:cx="464.35397" - inkscape:cy="598.25624" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - showguides="true" - inkscape:guide-bbox="true" - inkscape:window-width="1440" - inkscape:window-height="852" - inkscape:window-x="0" - inkscape:window-y="25" - showborder="false" /> - <defs - id="defs4"> - <inkscape:path-effect - id="path-effect6103" - effect="spiro" /> - <marker - style="overflow:visible;" - id="Arrow1Mend" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Mend"> - <path - transform="scale(0.4) rotate(180) translate(10,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path4194" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Mstart" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Mstart"> - <path - transform="scale(0.4) translate(10,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path4191" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Lstart" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lstart"> - <path - transform="scale(0.8) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path4185" /> - </marker> - <inkscape:path-effect - id="path-effect4180" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4152" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4148" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4144" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4140" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4136" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4132" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4128" - effect="spiro" /> - <inkscape:path-effect - id="path-effect4124" - effect="spiro" /> - <inkscape:path-effect - id="path-effect3915" - effect="spiro" /> - <inkscape:path-effect - id="path-effect3911" - effect="spiro" /> - <inkscape:path-effect - id="path-effect3681" - effect="spiro" /> - <inkscape:path-effect - id="path-effect3677" - effect="spiro" /> - <inkscape:path-effect - id="path-effect3673" - effect="spiro" /> - <inkscape:perspective - id="perspective10" - inkscape:persp3d-origin="372.04724 : 350.78739 : 1" - inkscape:vp_z="744.09448 : 526.18109 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 526.18109 : 1" - sodipodi:type="inkscape:persp3d" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3358" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3384" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3405" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3405-6" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3436" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3464" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3511" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3584" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3584-4" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3712" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3836" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3926" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3926-0" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3926-6" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3926-2" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective3982" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4013" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4065" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4065-0" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4065-5" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4065-52" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4065-2" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective4161" /> - <inkscape:path-effect - id="path-effect4152-0" - effect="spiro" - is_visible="true" - deactivate_knotholder="false" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective5570" /> - <marker - style="overflow:visible" - id="Arrow1Mstart-4" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mstart"> - <path - transform="matrix(0.4,0,0,0.4,4,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path4191-9" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Mend-7" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mend"> - <path - transform="matrix(-0.4,0,0,-0.4,-4,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path4194-3" /> - </marker> - <inkscape:path-effect - id="path-effect4180-9" - effect="spiro" - is_visible="true" - deactivate_knotholder="false" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective5797" /> - <marker - style="overflow:visible" - id="Arrow1Mstart-8" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mstart"> - <path - transform="matrix(0.4,0,0,0.4,4,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path4191-0" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Mend-8" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mend"> - <path - transform="matrix(-0.4,0,0,-0.4,-4,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path4194-5" /> - </marker> - <inkscape:path-effect - id="path-effect4180-8" - effect="spiro" - is_visible="true" - deactivate_knotholder="false" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective6048" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective6078" /> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - id="perspective6128" /> - <inkscape:path-effect - id="path-effect6103-0" - effect="spiro" - is_visible="true" - deactivate_knotholder="false" /> - <marker - style="overflow:visible;" - id="Arrow1Mendu" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Mendu"> - <path - transform="scale(0.4) rotate(180) translate(10,0)" - style="marker-start:none;stroke:#717171;stroke-width:1.0pt;fill:#717171;fill-rule:evenodd" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path6301" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Mstartm" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Mstartm"> - <path - transform="scale(0.4) translate(10,0)" - style="marker-start:none;stroke:#717171;stroke-width:1.0pt;fill:#717171;fill-rule:evenodd" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path6304" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1MstartA" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1MstartA"> - <path - transform="scale(0.4) translate(10,0)" - style="marker-start:none;stroke:#717171;stroke-width:1.0pt;fill:#717171;fill-rule:evenodd" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path6307" /> - </marker> - <marker - style="overflow:visible;" - id="Arrow1Mendq" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Mendq"> - <path - transform="scale(0.4) rotate(180) translate(10,0)" - style="marker-start:none;stroke:#717171;stroke-width:1.0pt;fill:#717171;fill-rule:evenodd" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path6310" /> - </marker> - <inkscape:perspective - id="perspective2822" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 0.5 : 1" - sodipodi:type="inkscape:persp3d" /> - <marker - style="overflow:visible" - id="Arrow1Mstartm-1" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mstartm"> - <path - transform="matrix(0.4,0,0,0.4,4,0)" - style="fill:#717171;fill-rule:evenodd;stroke:#717171;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path6304-5" /> - </marker> - <inkscape:path-effect - id="path-effect4180-8-9" - effect="spiro" - is_visible="true" - deactivate_knotholder="false" /> - <marker - style="overflow:visible" - id="Arrow1MstartA-4" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1MstartA"> - <path - transform="matrix(0.4,0,0,0.4,4,0)" - style="fill:#717171;fill-rule:evenodd;stroke:#717171;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path6307-9" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Mendq-0" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Mendq"> - <path - transform="matrix(-0.4,0,0,-0.4,-4,0)" - style="fill:#717171;fill-rule:evenodd;stroke:#717171;stroke-width:1pt;marker-start:none" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 z" - id="path6310-9" /> - </marker> - <inkscape:path-effect - deactivate_knotholder="false" - is_visible="true" - id="path-effect4180-1" - effect="spiro" /> - <inkscape:path-effect - deactivate_knotholder="false" - is_visible="true" - id="path-effect4152-7" - effect="spiro" /> - <inkscape:perspective - id="perspective4357" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 0.5 : 1" - sodipodi:type="inkscape:persp3d" /> - <inkscape:perspective - id="perspective4381" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 0.5 : 1" - sodipodi:type="inkscape:persp3d" /> - <inkscape:perspective - id="perspective4405" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 0.5 : 1" - sodipodi:type="inkscape:persp3d" /> - <inkscape:perspective - id="perspective4435" - inkscape:persp3d-origin="0.5 : 0.33333333 : 1" - inkscape:vp_z="1 : 0.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_x="0 : 0.5 : 1" - sodipodi:type="inkscape:persp3d" /> - </defs> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - id="layer1" - inkscape:groupmode="layer" - inkscape:label="Layer 1"> - <g - transform="translate(-36,-148)" - id="g3789"> - <rect - style="opacity:1;color:#000000;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.93299997;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - id="rect2571" - width="505.07626" - height="17.67767" - x="118.18782" - y="328.58786" /> - <text - xml:space="preserve" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - x="578.8783" - y="341.71985" - id="text3343"><tspan - sodipodi:role="line" - id="tspan3345" - x="578.8783" - y="341.71985">Ted</tspan></text> - <text - xml:space="preserve" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - x="458.36044" - y="341.71985" - id="text3347"><tspan - sodipodi:role="line" - id="tspan3349" - x="458.36044" - y="341.71985">Jan 1st, 11:00 pm</tspan></text> - <g - id="g3480" - transform="translate(-6,0)"> - <rect - y="331.63229" - x="447.70059" - height="11.56345" - width="2.9384971" - id="rect3373" - style="opacity:1;color:#000000;fill:none;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="334.52225" - x="442.5972" - height="8.5811357" - width="2.7329977" - id="rect3373-2" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="337.8125" - x="437.69925" - height="5.2914724" - width="2.5275443" - id="rect3373-2-1" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - </g> - <g - id="g3487" - transform="translate(-7.6915415,0.41127796)"> - <path - transform="translate(2.7761261,0.8325159)" - d="m 426.90651,332.67719 c 0,0.53918 -2.07284,0.97678 -4.62688,0.97678 -2.55403,0 -4.62687,-0.4376 -4.62687,-0.97678 0,-0.53919 2.07284,-0.97679 4.62687,-0.97679 2.55404,0 4.62688,0.4376 4.62688,0.97679 z" - sodipodi:ry="0.97678512" - sodipodi:rx="4.6268768" - sodipodi:cy="332.67719" - sodipodi:cx="422.27963" - id="path3427" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - sodipodi:type="arc" /> - <path - transform="translate(2.7296944,8.9967079)" - d="m 426.90651,332.67719 c 0,0.53918 -2.07284,0.97678 -4.62688,0.97678 -2.55403,0 -4.62687,-0.4376 -4.62687,-0.97678 0,-0.53919 2.07284,-0.97679 4.62687,-0.97679 2.55404,0 4.62688,0.4376 4.62688,0.97679 z" - sodipodi:ry="0.97678512" - sodipodi:rx="4.6268768" - sodipodi:cy="332.67719" - sodipodi:cx="422.27963" - id="path3427-4" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - sodipodi:type="arc" /> - <path - sodipodi:nodetypes="cc" - id="path3453" - d="m 420.32606,341.46825 0,-7.9171" - style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - id="path3455" - d="m 429.68263,341.57107 0,-8.12274" - style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - transform="translate(2.77612,4.8325126)" - d="m 426.90651,332.67719 c 0,0.53918 -2.07284,0.97678 -4.62688,0.97678 -2.55403,0 -4.62687,-0.4376 -4.62687,-0.97678 0,-0.53919 2.07284,-0.97679 4.62687,-0.97679 2.55404,0 4.62688,0.4376 4.62688,0.97679 z" - sodipodi:ry="0.97678512" - sodipodi:rx="4.6268768" - sodipodi:cy="332.67719" - sodipodi:cx="422.27963" - id="path3427-0" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - sodipodi:type="arc" /> - <rect - y="337.41846" - x="420.42889" - height="3.8043318" - width="9.2537127" - id="rect3478" - style="opacity:1;color:#000000;fill:#ffffff;fill-opacity:0.43478262;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="330.77499" - x="423.61624" - height="2.2620289" - width="2.6733065" - id="rect3485" - style="opacity:1;color:#000000;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - </g> - <g - id="g3525" - transform="translate(-2.205638,-0.10281953)"> - <rect - y="336.01883" - x="393.07889" - height="3.7015016" - width="3.7015016" - id="rect3496" - style="opacity:1;color:#000000;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <path - id="path3498" - d="m 396.67758,336.07024 3.59868,-3.59868 0,10.79604 -3.59868,-4.00996 0,-3.1874 z" - style="fill:none;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - transform="translate(-6,-0.64583659)" - sodipodi:open="true" - sodipodi:end="7.4450738" - sodipodi:start="5.1692224" - d="m 407.71536,335.90276 c 1.42622,0.701 2.0148,2.42743 1.3138,3.85365 -0.31465,0.64016 -0.78454,1.08805 -1.43904,1.37166" - sodipodi:ry="2.8789456" - sodipodi:rx="2.8789456" - sodipodi:cy="338.48648" - sodipodi:cx="406.44543" - id="path3500" - style="opacity:1;color:#000000;fill:#333333;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - sodipodi:type="arc" /> - <path - transform="matrix(1.6644738,0,0,1.6644738,-276.586,-225.58046)" - sodipodi:open="true" - sodipodi:end="7.4450738" - sodipodi:start="5.1692224" - d="m 407.71536,335.90276 c 1.42622,0.701 2.0148,2.42743 1.3138,3.85365 -0.31465,0.64016 -0.78454,1.08805 -1.43904,1.37166" - sodipodi:ry="2.8789456" - sodipodi:rx="2.8789456" - sodipodi:cy="338.48648" - sodipodi:cx="406.44543" - id="path3500-3" - style="opacity:1;color:#000000;fill:none;stroke:#ffffff;stroke-width:0.30039525;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - sodipodi:type="arc" /> - </g> - <path - sodipodi:type="arc" - style="opacity:1;color:#000000;fill:#29f151;fill-opacity:0.43478262;stroke:none;stroke-width:0.5;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" - id="path3533" - sodipodi:cx="613.63129" - sodipodi:cy="315.82388" - sodipodi:rx="4.3543258" - sodipodi:ry="4.3543258" - d="m 617.98561,315.82388 c 0,2.40359 -1.95074,4.35433 -4.35432,4.35433 -2.40359,0 -4.35433,-1.95074 -4.35433,-4.35433 0,-2.40358 1.95074,-4.35432 4.35433,-4.35432 2.40358,0 4.35432,1.95074 4.35432,4.35432 z" - transform="translate(-6.5725673,21.525157)" /> - </g> - <text - id="text3555" - y="282.59735" - x="73.75" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - style="font-weight:bold" - y="282.59735" - x="73.75" - id="tspan3557" - sodipodi:role="line">Audio User Daemon</tspan></text> - <flowRoot - transform="translate(-36,-144)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot3559" - xml:space="preserve"><flowRegion - id="flowRegion3561"><rect - style="font-size:12px" - y="437.82715" - x="109.76187" - height="145.25374" - width="149.85454" - id="rect3563" /></flowRegion><flowPara - id="flowPara3565">Indicator</flowPara><flowPara - id="flowPara3567">* Main audio level</flowPara><flowPara - id="flowPara3569" /><flowPara - id="flowPara3571">Menus</flowPara><flowPara - id="flowPara3573">* Slider to adjust</flowPara><flowPara - id="flowPara3575">* Preferences... (mixer)</flowPara><flowPara - id="flowPara3691" /><flowPara - id="flowPara3693">Notifications</flowPara><flowPara - id="flowPara3695">* Audio level change</flowPara></flowRoot> <text - id="text3555-5" - y="472.33295" - x="134.42328" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - style="font-weight:bold" - y="472.33295" - x="134.42328" - id="tspan3557-1" - sodipodi:role="line">Power User Daemon</tspan></text> - <flowRoot - transform="translate(24.67328,45.73562)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot3559-9" - xml:space="preserve"><flowRegion - id="flowRegion3561-9"><rect - style="font-size:12px" - y="437.82715" - x="109.76187" - height="196.37631" - width="151.71355" - id="rect3563-3" /></flowRegion><flowPara - id="flowPara3565-9">Indicator</flowPara><flowPara - id="flowPara3567-0">* Main battery level</flowPara><flowPara - id="flowPara3628">* Individual bat.</flowPara><flowPara - id="flowPara3569-4" /><flowPara - id="flowPara3571-1">Menus</flowPara><flowPara - id="flowPara3573-5">* Individual bat. entries</flowPara><flowPara - id="flowPara3575-2">* Preferences...</flowPara><flowPara - id="flowPara3683" /><flowPara - id="flowPara3685">Notifications</flowPara><flowPara - id="flowPara3687">* Battery status</flowPara><flowPara - id="flowPara3689">* Power change AC/Bat</flowPara></flowRoot> <text - id="text3555-9" - y="283.28479" - x="312.55984" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - style="font-weight:bold" - y="283.28479" - x="312.55984" - id="tspan3557-2" - sodipodi:role="line">Network User Daemon</tspan></text> - <flowRoot - transform="translate(202.80984,-143.31254)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot3559-5" - xml:space="preserve"><flowRegion - id="flowRegion3561-2"><rect - style="font-size:12px" - y="437.82715" - x="109.76187" - height="235.7263" - width="152.75581" - id="rect3563-6" /></flowRegion><flowPara - id="flowPara3565-8">Indicator</flowPara><flowPara - id="flowPara3567-6">* Connected AP signal</flowPara><flowPara - id="flowPara3661"> level</flowPara><flowPara - id="flowPara3665">* Other APs sig. level</flowPara><flowPara - id="flowPara3667">* Network status</flowPara><flowPara - id="flowPara3569-0" /><flowPara - id="flowPara3571-0">Menus</flowPara><flowPara - id="flowPara3573-0">* APs level</flowPara><flowPara - id="flowPara3669">* Network interfaces</flowPara><flowPara - id="flowPara3575-4">* Preferences...</flowPara><flowPara - id="flowPara3697" /><flowPara - id="flowPara3699">Notifications</flowPara><flowPara - id="flowPara3701">* Network status change</flowPara><flowPara - id="flowPara3703">* New AP available?</flowPara></flowRoot> <path - sodipodi:nodetypes="czzz" - inkscape:original-d="m 358.75608,205.37716 c -11.46385,6.81634 -7.43601,17.04086 -34.39155,20.44903 -26.95554,3.40817 -96.51322,-6.66143 -127.34168,0 -30.82846,6.66143 -38.41939,26.64571 -57.62909,39.96856" - inkscape:path-effect="#path-effect3673" - id="path3671" - d="m 358.75608,205.37716 c -9.53843,9.51785 -21.47382,16.61457 -34.39155,20.44903 -20.47791,6.07861 -42.39574,3.9057 -63.59222,1.25925 -21.19647,-2.64646 -42.85472,-5.69816 -63.74946,-1.25925 -23.47933,4.98799 -44.72953,19.72602 -57.62909,39.96856" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czzzz" - inkscape:original-d="m 381.6281,207.23616 c 0,0 -23.79665,40.04823 -35.60304,46.47507 -11.8064,6.42685 -27.39046,2.89031 -45.87176,6.00193 -18.4813,3.11161 9.05401,15.4885 -12.68683,33.03713 -21.74084,17.54863 -35.94071,108.27659 -58.55858,159.39916" - inkscape:path-effect="#path-effect3677" - id="path3675" - d="m 381.6281,207.23616 c 1.26421,10.72166 -1.80526,21.89205 -8.37061,30.46225 -6.56535,8.5702 -16.55138,14.44204 -27.23243,16.01282 -7.77174,1.14293 -15.67731,0.0896 -23.53253,0.0495 -3.92762,-0.0201 -7.87756,0.21727 -11.70467,1.10031 -3.82711,0.88304 -7.54043,2.43286 -10.63456,4.85214 -4.77786,3.73578 -7.81223,9.33218 -9.57416,15.13559 -1.76193,5.80341 -2.36829,11.88242 -3.11267,17.90154 -7.00852,56.67121 -27.21298,111.66868 -58.55858,159.39916" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czz" - inkscape:original-d="m 402.72464,210.02467 c -0.30983,11.15402 -1.83116,23.54737 -4.9295,33.46205 -3.09834,9.91468 -11.77369,17.35069 -17.66053,26.02604" - inkscape:path-effect="#path-effect3681" - id="path3679" - d="m 402.72464,210.02467 c 0.98875,11.33426 -0.71425,22.89442 -4.9295,33.46205 -3.91488,9.8146 -9.98652,18.76228 -17.66053,26.02604" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - id="text3555-9-2" - y="282.94501" - x="536.32922" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - style="font-weight:bold" - y="282.94501" - x="536.32922" - id="tspan3557-2-5" - sodipodi:role="line">Session User Daemon</tspan></text> - <flowRoot - transform="translate(426.57924,-143.65234)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot3559-5-0" - xml:space="preserve"><flowRegion - id="flowRegion3561-2-0"><rect - style="font-size:12px" - y="437.82715" - x="109.76187" - height="235.7263" - width="152.75581" - id="rect3563-6-1" /></flowRegion><flowPara - id="flowPara3565-8-0">Indicator</flowPara><flowPara - id="flowPara3667-6">* IM Status</flowPara><flowPara - id="flowPara3821">* Logged in users</flowPara><flowPara - id="flowPara3569-0-1" /><flowPara - id="flowPara3571-0-8">Menus</flowPara><flowPara - id="flowPara3575-4-0">* Status change</flowPara><flowPara - id="flowPara3819">* User switch</flowPara><flowPara - id="flowPara3823">* Guest session</flowPara><flowPara - id="flowPara3825">* Session management</flowPara><flowPara - id="flowPara3697-7" /><flowPara - id="flowPara3699-4">Notifications</flowPara><flowPara - id="flowPara3703-7">* IM Account failed</flowPara></flowRoot> <text - id="text3555-9-2-8" - y="514.5188" - x="452.29672" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - style="font-weight:bold" - y="514.5188" - x="452.29672" - id="tspan3557-2-5-0" - sodipodi:role="line">Date-time User Daemon</tspan></text> - <flowRoot - transform="translate(342.54676,87.92146)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot3559-5-0-8" - xml:space="preserve"><flowRegion - id="flowRegion3561-2-0-0"><rect - style="font-size:12px" - y="437.82715" - x="109.76187" - height="235.7263" - width="152.75581" - id="rect3563-6-1-3" /></flowRegion><flowPara - id="flowPara3565-8-0-3">Indicator</flowPara><flowPara - id="flowPara3821-9">* Active appointments</flowPara><flowPara - id="flowPara3569-0-1-3" /><flowPara - id="flowPara3571-0-8-9">Menus</flowPara><flowPara - id="flowPara3825-7">* Complex, start app?</flowPara><flowPara - id="flowPara3697-7-0" /><flowPara - id="flowPara3699-4-9">Notifications</flowPara><flowPara - id="flowPara3703-7-6">* New appointment</flowPara></flowRoot> <path - sodipodi:nodetypes="czzz" - inkscape:original-d="m 468.71924,206.30666 c 0,0 11.88976,31.23621 17.66053,42.75707 5.77077,11.52086 -16.61419,29.27165 1.859,61.34709 18.47318,32.07544 14.56219,113.39916 21.37853,183.11176" - inkscape:path-effect="#path-effect3911" - id="path3909" - d="m 468.71924,206.30666 c 8.66621,12.88005 14.71135,27.51564 17.66053,42.75707 3.89529,20.13094 2.39937,40.84987 1.859,61.34709 -1.62499,61.63913 5.5979,123.50475 21.37853,183.11176" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czz" - inkscape:original-d="m 564.45787,207.23617 c 2.78851,12.39335 13.6327,12.70318 18.59004,22.30803 4.95734,9.60484 4.02784,28.5047 11.15401,35.32105" - inkscape:path-effect="#path-effect3915" - id="path3913" - d="m 564.45787,207.23617 c 7.40495,6.30665 13.72209,13.88721 18.59004,22.30803 6.22863,10.77458 10.0651,22.92341 11.15401,35.32105" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <rect - y="710.25787" - x="43.491863" - height="59.153103" - width="115.67719" - id="rect3917" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="710.25787" - x="223.49187" - height="59.153103" - width="115.67719" - id="rect3917-2" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="710.25787" - x="403.49188" - height="59.153103" - width="115.67719" - id="rect3917-8" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="710.25787" - x="583.49188" - height="59.153103" - width="115.67719" - id="rect3917-4" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="808.25787" - x="137.49187" - height="59.153103" - width="115.67719" - id="rect3917-7" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="808.25787" - x="317.49188" - height="59.153103" - width="115.67719" - id="rect3917-2-7" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - y="808.25787" - x="497.49188" - height="59.153103" - width="115.67719" - id="rect3917-8-2" - style="opacity:1;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <text - id="text4002" - y="744.30804" - x="66.297256" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="744.30804" - x="66.297256" - id="tspan4004" - sodipodi:role="line">Pulse Audio</tspan></text> - <text - id="text4002-7" - y="833.64496" - x="374.74747" - style="font-size:12px;font-style:normal;font-weight:normal;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="833.64496" - x="374.74747" - id="tspan4004-7" - sodipodi:role="line">Network</tspan><tspan - id="tspan4030" - y="848.64496" - x="374.74747" - sodipodi:role="line">Manager</tspan></text> - <text - id="text4032" - y="735.53949" - x="280.99942" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:center;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:middle;opacity:1;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="735.53949" - x="280.99942" - id="tspan4034" - sodipodi:role="line">GNOME Power</tspan><tspan - id="tspan4036" - y="750.53949" - x="280.99942" - sodipodi:role="line">Manager</tspan></text> - <text - id="text4038" - y="834.80804" - x="194.88808" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:center;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:middle;opacity:1;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="834.80804" - x="194.88808" - id="tspan4040" - sodipodi:role="line">DevKit</tspan><tspan - id="tspan4042" - y="849.80804" - x="194.88808" - sodipodi:role="line">Power</tspan></text> - <text - id="text4044" - y="744.20258" - x="461.07559" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:center;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:middle;opacity:1;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="744.20258" - x="461.07559" - id="tspan4046" - sodipodi:role="line">EDS</tspan></text> - <text - id="text4048" - y="736.70258" - x="641.38324" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:center;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:middle;opacity:1;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="736.70258" - x="641.38324" - id="tspan4050" - sodipodi:role="line">GNOME</tspan><tspan - id="tspan4052" - y="751.70258" - x="641.38324" - sodipodi:role="line">Session</tspan></text> - <text - id="text4054" - y="841.14496" - x="555.52679" - style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:center;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:middle;opacity:1;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="841.14496" - x="555.52679" - id="tspan4056" - sodipodi:role="line">Telepathy</tspan></text> - <path - sodipodi:nodetypes="czzz" - inkscape:original-d="m 671.71636,482.84708 c 7.01074,21.03222 17.74594,33.73918 21.03222,63.09665 3.28628,29.35747 -8.76343,67.69744 -17.08868,93.33045 -8.32525,25.63301 -16.6505,46.88431 -32.86283,60.46762" - inkscape:path-effect="#path-effect4124" - id="path4122" - d="m 671.71636,482.84708 c 11.76705,19.02543 19.03059,40.81607 21.03222,63.09665 2.85756,31.80822 -4.92648,63.80064 -17.08868,93.33045 -8.75299,21.25226 -19.79115,41.56247 -32.86283,60.46762" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czzzzz" - inkscape:original-d="m 637.53901,489.41965 c 6.57257,29.35747 21.90855,61.34396 19.7177,88.0724 -2.19085,26.72844 -17.96501,54.55231 -32.86283,72.29824 -14.89782,17.74593 -44.0362,15.11691 -56.52408,34.17735 -12.48788,19.06044 -15.33599,62.22029 -18.40319,80.18531 -3.0672,17.96502 0,18.40319 0,27.60479" - inkscape:path-effect="#path-effect4128" - id="path4126" - d="m 637.53901,489.41965 c 14.5902,26.75872 21.50548,57.64697 19.7177,88.0724 -0.80091,13.63033 -3.34202,27.25252 -8.62989,39.84085 -5.28787,12.58832 -13.41313,24.12917 -24.23294,32.45739 -8.764,6.74583 -19.01332,11.22316 -28.97557,16.02603 -9.96226,4.80287 -19.93028,10.13405 -27.54851,18.15132 -9.70604,10.21444 -14.83102,24.07114 -17.00031,37.99364 -2.16928,13.92251 -1.62154,28.10288 -1.40288,42.19167 0.1428,9.20086 0.1428,18.40393 0,27.60479" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czz" - inkscape:original-d="m 475.85386,658.99188 c -4.81988,7.44891 -12.2688,15.33599 -14.45965,22.34673 -2.19086,7.01074 0.87635,13.14513 1.31452,19.7177" - inkscape:path-effect="#path-effect4132" - id="path4130" - d="m 475.85386,658.99188 c -7.35059,5.32615 -12.61311,13.45914 -14.45965,22.34673 -1.35657,6.5293 -0.89677,13.42626 1.31452,19.7177" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:original-d="m 362.80571,520.96797 6.57256,273.41879" - inkscape:path-effect="#path-effect4136" - id="path4134" - d="m 362.80571,520.96797 6.57256,273.41879" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czzz" - inkscape:original-d="m 230.03985,662.93542 c 4.81988,7.44891 5.91531,18.62227 14.45965,22.34673 8.54434,3.72446 29.13837,-2.84811 36.80637,0 7.668,2.84811 6.1344,11.39245 9.2016,17.08867" - inkscape:path-effect="#path-effect4140" - id="path4138" - d="m 230.03985,662.93542 c -0.81821,4.80307 0.2297,9.89958 2.87656,13.99018 2.64686,4.09061 6.86649,7.13483 11.58309,8.35655 6.01975,1.55927 12.35428,0.20081 18.4796,-0.87121 3.06266,-0.53601 6.15336,-1.00054 9.26254,-0.98625 3.10918,0.0143 6.2555,0.52396 9.06423,1.85746 3.12722,1.48471 5.76074,3.98802 7.40197,7.03601 1.64122,3.04799 2.28151,6.62459 1.79963,10.05266" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:original-d="m 191.91896,657.67737 2.62903,135.39488" - inkscape:path-effect="#path-effect4144" - id="path4142" - d="m 191.91896,657.67737 2.62903,135.39488" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="czzz" - inkscape:original-d="m 80.185319,439.46814 c -9.639765,26.72844 -23.661241,45.5698 -28.919295,80.18532 -5.258054,34.61552 12.926049,96.17857 21.032215,126.19329 8.106166,30.01472 10.516107,36.3682 27.604781,53.89505" - inkscape:path-effect="#path-effect4148" - id="path4146" - d="m 80.185319,439.46814 c -15.532342,24.08422 -25.503398,51.73124 -28.919295,80.18532 -5.139432,42.81096 4.519328,86.36219 21.032215,126.19329 7.738285,18.66569 16.979501,36.70806 27.604781,53.89505" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:original-d="m 780.78114,225.10599 252.82436,0" - inkscape:path-effect="#path-effect4152" - id="path4150" - d="m 780.78114,225.10599 252.82436,0" - style="fill:none;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - inkscape:original-d="m 780.78114,681.10599 252.82436,0" - inkscape:path-effect="#path-effect4152-0" - id="path4150-3" - d="m 780.78114,681.10599 252.82436,0" - style="fill:none;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - inkscape:original-d="m 816.10219,628.78174 0,-351.35151" - inkscape:path-effect="#path-effect4180" - id="path4178" - d="m 816.10219,628.78174 0,-351.35151" - style="stroke-linejoin:miter;marker-end:url(#Arrow1Mendq);stroke-opacity:1;marker-start:url(#Arrow1MstartA);stroke:#717171;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-width:8;marker-mid:none;fill:none" /> - <path - sodipodi:nodetypes="cc" - inkscape:original-d="m 816.10219,876.7817 0,-135.35147" - inkscape:path-effect="#path-effect4180-9" - id="path4178-9" - d="m 816.10219,876.7817 0,-135.35147" - style="stroke-linejoin:miter;marker-end:url(#Arrow1Mendu);stroke-opacity:1;marker-start:none;stroke:#717171;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-width:8;marker-mid:none;fill:none" /> - <path - sodipodi:nodetypes="cc" - inkscape:original-d="m 816.10219,162.78174 0,-131.35151" - inkscape:path-effect="#path-effect4180-8" - id="path4178-2" - d="m 816.10219,162.78174 0,-131.35151" - style="stroke-linejoin:miter;marker-end:none;stroke-opacity:1;marker-start:url(#Arrow1Mstartm);stroke:#717171;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-width:8;marker-mid:none;fill:none" /> - <text - id="text6021" - y="799.53784" - x="873.73126" - style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="799.53784" - x="873.73126" - id="tspan6023" - sodipodi:role="line">System</tspan></text> - <text - id="text6025" - y="407.28827" - x="873.73126" - style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="407.28827" - x="873.73126" - id="tspan6027" - sodipodi:role="line">Python</tspan></text> - <text - id="text6029" - y="81.962761" - x="873.73126" - style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="81.962761" - x="873.73126" - id="tspan6031" - sodipodi:role="line">C</tspan></text> - <flowRoot - transform="translate(-4,-8)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6033" - xml:space="preserve"><flowRegion - id="flowRegion6035"><rect - style="font-size:12px" - y="823.70483" - x="879.30829" - height="72.501106" - width="152.43822" - id="rect6037" /></flowRegion><flowPara - id="flowPara6039">We don't care that much about how it's implemented, as long as it works.</flowPara></flowRoot> <flowRoot - transform="translate(-4,-400)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6033-6" - xml:space="preserve"><flowRegion - id="flowRegion6035-6"><rect - style="font-size:12px" - y="823.70483" - x="879.30829" - height="115.25817" - width="150.57921" - id="rect6037-8" /></flowRegion><flowPara - id="flowPara6039-9">Can have complex state that is difficult to implement in a lower level language. Less verifiable, but also more dynamic.</flowPara></flowRoot> <flowRoot - transform="translate(-4,-728)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6033-6-4" - xml:space="preserve"><flowRegion - id="flowRegion6035-6-4"><rect - style="font-size:12px" - y="823.70483" - x="879.30829" - height="115.25817" - width="150.57921" - id="rect6037-8-8" /></flowRegion><flowPara - id="flowPara6039-9-1">Needs to be fast light and small. Also verifiable and simple.</flowPara></flowRoot> <path - sodipodi:nodetypes="ccc" - inkscape:original-d="m 1109.8246,270.17107 -61.3471,-46.9241 59.9111,-47.79612" - inkscape:path-effect="#path-effect6103" - id="path6101" - d="m 1109.8246,270.17107 -61.3471,-46.9241 59.9111,-47.79612" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - id="text6105" - y="193.48985" - x="1114.559" - style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="193.48985" - x="1114.559" - id="tspan6107" - sodipodi:role="line">Async DBus</tspan></text> - <flowRoot - transform="translate(-12,34)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6109" - xml:space="preserve"><flowRegion - id="flowRegion6111"><rect - style="font-size:12px" - y="173.67316" - x="1127.5721" - height="107.38783" - width="138.1183" - id="rect6113" /></flowRegion><flowPara - id="flowPara6115">* Indicators Spec</flowPara><flowPara - id="flowPara6117">* Application Menu</flowPara><flowPara - id="flowPara6119"> Spec</flowPara></flowRoot> <path - sodipodi:nodetypes="ccc" - inkscape:original-d="m 1109.8246,728.17107 -61.3471,-46.9241 59.9111,-47.79612" - inkscape:path-effect="#path-effect6103-0" - id="path6101-1" - d="m 1109.8246,728.17107 -61.3471,-46.9241 59.9111,-47.79612" - style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - id="text6105-1" - y="651.48987" - x="1114.559" - style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="651.48987" - x="1114.559" - id="tspan6107-9" - sodipodi:role="line">System Specific</tspan></text> - <flowRoot - transform="translate(-12,492)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6109-9" - xml:space="preserve"><flowRegion - id="flowRegion6111-6"><rect - style="font-size:12px" - y="173.67316" - x="1127.5721" - height="107.38783" - width="143.84921" - id="rect6113-5" /></flowRegion><flowPara - id="flowPara6119-1">Many of these are DBus but others are less specified. They can be system specific.</flowPara></flowRoot> <path - inkscape:original-d="m -267.21886,225.10594 252.82436,0" - inkscape:path-effect="#path-effect4152-7" - id="path4150-1" - d="m -267.21886,225.10594 252.82436,0" - style="fill:none;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> - <path - inkscape:original-d="m -59.89781,628.78169 0,-351.35151" - inkscape:path-effect="#path-effect4180-1" - id="path4178-1" - d="m -59.89781,628.78169 0,-351.35151" - style="fill:none;stroke:#717171;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-mid:none;marker-end:url(#Arrow1Mendq)" /> - <path - sodipodi:nodetypes="cc" - inkscape:original-d="m -59.89781,162.78169 0,-131.351507" - inkscape:path-effect="#path-effect4180-8-9" - id="path4178-2-5" - d="m -59.89781,162.78169 0,-131.351507" - style="fill:none;stroke:#717171;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:url(#Arrow1Mstartm);marker-mid:none;marker-end:none" /> - <text - id="text6029-2" - y="198.33095" - x="-346.05609" - style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="198.33095" - x="-346.05609" - id="tspan6031-4" - sodipodi:role="line">User Side</tspan></text> - <text - id="text6029-2-6" - y="282.89386" - x="-346.05609" - style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - xml:space="preserve"><tspan - y="282.89386" - x="-346.05609" - id="tspan6031-4-0" - sodipodi:role="line">Service Side</tspan></text> - <flowRoot - transform="translate(-1185.1789,-772.6624)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6033-6-6" - xml:space="preserve"><flowRegion - id="flowRegion6035-6-1"><rect - style="font-size:12px" - y="823.70483" - x="879.30829" - height="115.25817" - width="150.57921" - id="rect6037-8-87" /></flowRegion><flowPara - id="flowPara6039-9-0">This is the amount of code that actually interacts with the user and handles user input but also displaying information to the user.</flowPara></flowRoot> <flowRoot - transform="translate(-1185.1789,-514.6624)" - style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans" - id="flowRoot6033-6-6-9" - xml:space="preserve"><flowRegion - id="flowRegion6035-6-1-1"><rect - style="font-size:12px" - y="823.70483" - x="879.30829" - height="133.95276" - width="154.54472" - id="rect6037-8-87-7" /></flowRegion><flowPara - id="flowPara6039-9-0-7">These are the different components that gather information and bubbling it up to the level of the user. They can do this with the interfaces on the other side of the diagram.</flowPara></flowRoot> </g> -</svg> diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am deleted file mode 100644 index 2589179..0000000 --- a/docs/reference/Makefile.am +++ /dev/null @@ -1,87 +0,0 @@ -## 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=libindicate - -# 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=../../libindicate - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS=--nogtkinit --type-init-func="g_type_init()" - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -MKDB_OPTIONS=--sgml-mode --output-format=xml - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS= - -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS= - -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB=$(top_srcdir)/libindicate/*.h -CFILE_GLOB=$(top_srcdir)/libindicate/*.c - -# Header files to ignore when scanning. -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h -IGNORE_HFILES=dbus-indicate-client.h dbus-indicate-server.h dbus-listener-client.h dbus-listener-server.h listener-marshal.h - -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES= - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files=version.xml - -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files= - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -INCLUDES=-I$(top_srcdir) $(LIBINDICATE_CFLAGS) -GTKDOC_LIBS=$(top_builddir)/libindicate/libindicate.la - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += version.xml.in - -# 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) - diff --git a/docs/reference/libindicate-docs.sgml b/docs/reference/libindicate-docs.sgml deleted file mode 100644 index c3038d3..0000000 --- a/docs/reference/libindicate-docs.sgml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> -<book id="libindicatebook" xmlns:xi="http://www.w3.org/2003/XInclude"> - - <bookinfo> - <title>libindicate Reference Manual</title> - </bookinfo> - -<part id="base"> - <title>Base Classes for Applications</title> - <xi:include href="xml/indicator.xml" /> - <xi:include href="xml/server.xml" /> -</part> - -<part id="subclass"> - <title>Subclasses for specific indicators</title> - <xi:include href="xml/indicator-message.xml" /> -</part> - -<part id="listeners"> - <title>Classes for Listeners</title> - <xi:include href="xml/listener.xml" /> -</part> - -<part id="index"> - <index> - <title>Index of all Symbols</title> - </index> -</part> - -</book> diff --git a/docs/reference/libindicate-sections.txt b/docs/reference/libindicate-sections.txt deleted file mode 100644 index 6e2a8cd..0000000 --- a/docs/reference/libindicate-sections.txt +++ /dev/null @@ -1,63 +0,0 @@ -<INCLUDE>indicator.h</INCLUDE> - -<SECTION> -<FILE>indicator</FILE> -<TITLE>IndicateIndicator</TITLE> -IndicateIndicator -IndicateIndicatorClass -indicate_indicator_get_id -indicate_indicator_get_indicator_type -indicate_indicator_get_property -indicate_indicator_hide -indicate_indicator_is_visible -indicate_indicator_list_properties -indicate_indicator_new -indicate_indicator_set_property -indicate_indicator_set_property_icon -indicate_indicator_set_property_time -indicate_indicator_show -indicate_indicator_user_display -</SECTION> - -<SECTION> -<FILE>indicator-message</FILE> -<TITLE>IndicateIndicatorMessage</TITLE> -IndicateIndicatorMessage -IndicateIndicatorMessageClass -indicate_indicator_message_new -</SECTION> - -<SECTION> -<FILE>server</FILE> -<TITLE>IndicateServer</TITLE> -IndicateServer -IndicateServerClass -indicate_server_add_indicator -indicate_server_check_interest -indicate_server_emit_indicator_added -indicate_server_emit_indicator_modified -indicate_server_emit_indicator_removed -indicate_server_emit_server_display -indicate_server_get_next_id -indicate_server_hide -indicate_server_ref_default -indicate_server_remove_indicator -indicate_server_set_default -indicate_server_set_desktop_file -indicate_server_set_type -indicate_server_show -</SECTION> - -<SECTION> -<FILE>listener</FILE> -<TITLE>IndicateListener</TITLE> -IndicateListener -IndicateListenerClass -IndicateListenerIndicator -IndicateListenerServer -indicate_listener_display -indicate_listener_get_property -indicate_listener_get_property_cb -indicate_listener_new -</SECTION> - diff --git a/docs/reference/libindicate.types b/docs/reference/libindicate.types deleted file mode 100644 index d96055f..0000000 --- a/docs/reference/libindicate.types +++ /dev/null @@ -1,9 +0,0 @@ -#include <libindicate/indicator.h> -#include <libindicate/indicator-message.h> -#include <libindicate/server.h> -#include <libindicate/listener.h> - -indicate_indicator_get_type -indicate_indicator_message_get_type -indicate_server_get_type -indicate_listener_get_type diff --git a/docs/reference/tmpl/libindicate-unused.sgml b/docs/reference/tmpl/libindicate-unused.sgml deleted file mode 100644 index 83a53a7..0000000 --- a/docs/reference/tmpl/libindicate-unused.sgml +++ /dev/null @@ -1,23 +0,0 @@ -<!-- ##### FUNCTION indicate_indicator_set_property_icon ##### --> -<para> - -</para> - -@indicator: -@key: -@data: - -<!-- ##### FUNCTION indicate_server_new ##### --> -<para> - -</para> - -@Returns: - -<!-- ##### FUNCTION indicate_server_set_dbus_object ##### --> -<para> - -</para> - -@obj: - diff --git a/docs/reference/version.xml.in b/docs/reference/version.xml.in deleted file mode 100644 index d78bda9..0000000 --- a/docs/reference/version.xml.in +++ /dev/null @@ -1 +0,0 @@ -@VERSION@ diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index d6b74c6..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,78 +0,0 @@ - -libexec_PROGRAMS = \ - indicate-and-crash \ - indicate-alot \ - listen-and-print \ - im-client \ - show-hide-server - -indicate_and_crash_SOURCES = \ - indicate-and-crash.c - -indicate_and_crash_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATE_CFLAGS) - -indicate_and_crash_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -indicate_alot_SOURCES = \ - indicate-alot.c - -indicate_alot_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATE_CFLAGS) - -indicate_alot_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -listen_and_print_SOURCES = \ - listen-and-print.c - -listen_and_print_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATE_CFLAGS) \ - $(LIBINDICATEGTK_CFLAGS) - -listen_and_print_LDADD = \ - ../libindicate/libindicate.la \ - ../libindicate-gtk/libindicate-gtk.la \ - $(LIBINDICATE_LIBS) \ - $(LIBINDICATEGTK_LIBS) - -im_client_SOURCES = \ - im-client.c - -im_client_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATE_CFLAGS) \ - $(LIBINDICATEGTK_CFLAGS) - -im_client_LDADD = \ - ../libindicate/libindicate.la \ - ../libindicate-gtk/libindicate-gtk.la \ - $(LIBINDICATE_LIBS) \ - $(LIBINDICATEGTK_LIBS) - -show_hide_server_SOURCES = \ - show-hide-server.c - -show_hide_server_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATE_CFLAGS) - -show_hide_server_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -examplesdir = $(docdir)/examples/ - -examples_DATA = \ - $(indicate_and_crash_SOURCES) \ - $(indicate_alot_SOURCES) \ - $(listen_and_print_SOURCES) \ - $(im_client_SOURCES) - -EXTRA_DIST = $(examples_DATA) diff --git a/examples/im-client.c b/examples/im-client.c deleted file mode 100644 index 502484d..0000000 --- a/examples/im-client.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -A test for libindicate to ensure its quality. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <glib.h> -#include "libindicate/server.h" -#include "libindicate/indicator-message.h" -#include "libindicate-gtk/indicator.h" - -gchar * patha = "/usr/share/icons/hicolor/16x16/apps/empathy.png"; -gchar * pathb = "/usr/share/icons/hicolor/22x22/apps/empathy.png"; -gchar * lastpath = NULL; - -static gboolean -timeout_cb (gpointer data) -{ - g_debug("Modifying properties"); - - IndicateIndicator * indicator = INDICATE_INDICATOR(data); - - GTimeVal time; - g_get_current_time(&time); - indicate_indicator_set_property_time(INDICATE_INDICATOR(indicator), "time", &time); - - if (lastpath == patha) { - lastpath = pathb; - } else { - lastpath = patha; - } - - GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file(lastpath, NULL); - g_return_val_if_fail(pixbuf != NULL, TRUE); - - indicate_indicator_set_property_icon(INDICATE_INDICATOR(indicator), "icon", pixbuf); - g_object_unref(G_OBJECT(pixbuf)); - - return TRUE; -} - -static void -display (IndicateIndicator * indicator, gpointer data) -{ - g_debug("Ah, my indicator has been displayed"); -} - -static void -server_display (IndicateServer * server, gpointer data) -{ - g_debug("Ah, my server has been displayed"); -} - -static void -interest_added (IndicateServer * server, IndicateInterests interest) -{ - g_debug("Oh, someone is interested in my for: %d", interest); -} - -void -interest_removed (IndicateServer * server, IndicateInterests interest) -{ - g_debug("Someone is no longer interested in my for: %d", interest); -} - -int -main (int argc, char ** argv) -{ - g_type_init(); - - IndicateServer * server = indicate_server_ref_default(); - indicate_server_set_type(server, "message.im"); - indicate_server_set_desktop_file(server, "/usr/share/applications/empathy.desktop"); - g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_SERVER_DISPLAY, G_CALLBACK(server_display), NULL); - g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_INTEREST_ADDED, G_CALLBACK(interest_added), NULL); - g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_INTEREST_REMOVED, G_CALLBACK(interest_removed), NULL); - - IndicateIndicatorMessage * indicator; - - indicator = indicate_indicator_message_new(); - indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "subtype", "im"); - indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "sender", "IM Client Test"); - GTimeVal time; g_get_current_time(&time); - indicate_indicator_set_property_time(INDICATE_INDICATOR(indicator), "time", &time); - indicate_indicator_show(INDICATE_INDICATOR(indicator)); - - g_get_current_time(&time); - indicate_indicator_set_property_time(INDICATE_INDICATOR(indicator), "time", &time); - - g_signal_connect(G_OBJECT(indicator), INDICATE_INDICATOR_SIGNAL_DISPLAY, G_CALLBACK(display), NULL); - - g_timeout_add_seconds(180, timeout_cb, indicator); - - g_main_loop_run(g_main_loop_new(NULL, FALSE)); - - return 0; -} diff --git a/examples/indicate-alot.c b/examples/indicate-alot.c deleted file mode 100644 index 479040b..0000000 --- a/examples/indicate-alot.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -A test for libindicate to ensure its quality. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - - -#include <glib.h> -#include "libindicate/indicator.h" - -#define ALOT 30 - - -int -main (int argc, char ** argv) -{ - g_type_init(); - - IndicateIndicator * indicators[ALOT]; - int i; - - for (i = 0; i < ALOT; i++) { - indicators[i] = indicate_indicator_new(); - indicate_indicator_show(indicators[i]); - } - - g_main_loop_run(g_main_loop_new(NULL, FALSE)); - - return 0; -} diff --git a/examples/indicate-and-crash.c b/examples/indicate-and-crash.c deleted file mode 100644 index c002a54..0000000 --- a/examples/indicate-and-crash.c +++ /dev/null @@ -1,41 +0,0 @@ -/* -A test for libindicate to ensure its quality. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - - -#include <glib.h> -#include "libindicate/indicator.h" - -gboolean crashfunc (gpointer data) { *(int *)data = 5; return FALSE;} - -int -main (int argc, char ** argv) -{ - g_type_init(); - - IndicateIndicator * indicator = indicate_indicator_new(); - indicate_indicator_show(indicator); - - g_timeout_add_seconds(15, crashfunc, NULL); - - g_main_loop_run(g_main_loop_new(NULL, FALSE)); - - return 0; -} diff --git a/examples/listen-and-print.c b/examples/listen-and-print.c deleted file mode 100644 index 57cb7be..0000000 --- a/examples/listen-and-print.c +++ /dev/null @@ -1,144 +0,0 @@ -/* -A test for libindicate to ensure its quality. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <glib.h> -#include "libindicate/listener.h" -#include "libindicate-gtk/listener.h" - -static void -show_property_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data) -{ - g_debug("Indicator Property: %s %d %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, propertydata); - return; -} - -static void -show_property_time_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GTimeVal * propertydata, gpointer data) -{ - time_t timet; - struct tm * structtm; - - timet = propertydata->tv_sec; - structtm = localtime(&timet); - - gchar timestring[80]; - strftime(timestring, 80, "%I:%M", structtm); - - g_debug("Indicator Property: %s %d %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, timestring); - return; -} - -static void -show_property_icon_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GdkPixbuf * propertydata, gpointer data) -{ - g_debug("Indicator Property: %s %d %s %dx%d", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), property, gdk_pixbuf_get_width(propertydata), gdk_pixbuf_get_height(propertydata)); - g_object_unref(G_OBJECT(propertydata)); - return; -} - -static void -show_property (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property) -{ - if (!strcmp(property, "icon")) { - indicate_listener_get_property_icon(listener, server, indicator, property, show_property_icon_cb, NULL); - } else if (!strcmp(property, "time")) { - indicate_listener_get_property_time(listener, server, indicator, property, show_property_time_cb, NULL); - } else { - indicate_listener_get_property(listener, server, indicator, property, show_property_cb, NULL); - } - - return; -} - -static void -get_properties (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator) -{ - //TODO: Not in API yet. -} - -static void -indicator_added (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data) -{ - g_debug("Indicator Added: %s %d %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), type); - get_properties(listener, server, indicator); -} - -static void -indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data) -{ - g_debug("Indicator Removed: %s %d %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), type); -} - -static void -indicator_modified (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gchar * property, gpointer data) -{ - g_debug("Indicator Modified: %s %d %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), type, property); - show_property(listener, server, indicator, property); -} - -static void -type_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * value, gpointer data) -{ - g_debug("Indicator Server Type: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), value); -} - -static void -desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * value, gpointer data) -{ - g_debug("Indicator Server Desktop: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), value); -} - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - indicate_listener_server_get_type(listener, server, type_cb, NULL); - indicate_listener_server_get_desktop(listener, server, desktop_cb, NULL); - - indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY); - indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_DISPLAY); - - return; -} - -static void -server_removed (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Removed: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); -} - -int -main (int argc, char ** argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), NULL); - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed), NULL); - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, G_CALLBACK(indicator_modified), NULL); - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), NULL); - - g_main_loop_run(g_main_loop_new(NULL, FALSE)); - - return 0; -} diff --git a/examples/show-hide-server.c b/examples/show-hide-server.c deleted file mode 100644 index 23c1ea1..0000000 --- a/examples/show-hide-server.c +++ /dev/null @@ -1,44 +0,0 @@ -/* From LP: #351537 */ - -#include <glib.h> -#include "libindicate/server.h" -#include "libindicate/indicator-message.h" - -gboolean hidden = TRUE; - -static gboolean -timeout_cb (gpointer data) -{ - IndicateServer * server = INDICATE_SERVER(data); - - if (hidden) { - printf("showing... "); - indicate_server_show(server); - printf("ok\n"); - hidden = FALSE; - } else { - printf("hiding... "); - indicate_server_hide(server); - printf("ok\n"); - hidden = TRUE; - } - - return TRUE; -} - - -int -main (int argc, char ** argv) -{ - g_type_init(); - - IndicateServer * server = indicate_server_ref_default(); - indicate_server_set_type(server, "message.im"); - indicate_server_set_desktop_file(server, "/usr/share/applications/empathy.desktop"); - g_timeout_add_seconds(1, timeout_cb, server); - - g_main_loop_run(g_main_loop_new(NULL, FALSE)); - - return 0; -} - diff --git a/examples/test.js b/examples/test.js deleted file mode 100755 index 45b0d05..0000000 --- a/examples/test.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/local/bin/seed -Seed.import_namespace("Indicate"); - -var indicator = new Indicate.Indicator(); - -indicator.show(); diff --git a/libindicate-gtk/Makefile.am b/libindicate-gtk/Makefile.am deleted file mode 100644 index 2085b47..0000000 --- a/libindicate-gtk/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ - -INCLUDES= \ - -DG_LOG_DOMAIN=\"libindicate-gtk\" - -EXTRA_DIST = \ - indicate-gtk.pc.in - -lib_LTLIBRARIES = \ - libindicate-gtk.la - -libindicate_gtkincludedir=$(includedir)/libindicate-0.1/libindicate-gtk - -indicate_gtk_headers = \ - indicator.h \ - listener.h - -libindicate_gtkinclude_HEADERS = \ - $(indicate_gtk_headers) - -libindicate_gtk_la_SOURCES = \ - $(indicate_gtk_headers) \ - indicator.c \ - listener.c - -libindicate_gtk_la_LDFLAGS = \ - -version-info $(LIBINDICATEGTK_CURRENT):$(LIBINDICATEGTK_REVISION):$(LIBINDICATEGTK_AGE) \ - -no-undefined \ - -export-symbols-regex "^[^_d].*" - -libindicate_gtk_la_CFLAGS = \ - -I $(srcdir)/.. \ - $(LIBINDICATEGTK_CFLAGS) - -libindicate_gtk_la_LIBADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATEGTK_LIBS) - -pkgconfig_DATA = indicate-gtk.pc -pkgconfigdir = $(libdir)/pkgconfig - -if USE_GIR - -gobjectintrospection_gir_DATA = \ - Indicate-gtk-0.1.gir -gobjectintrospection_girdir = $(datadir)/gir - -gobjectintrospection_type_DATA = \ - Indicate-gtk-0.1.typelib -gobjectintrospection_typedir = $(libdir)/girepository - -irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers)) -Indicate-gtk-0.1.gir: $(irscanner_headers) - $(G_IR_SCANNER) \ - -v --namespace IndicateGtk \ - --nsversion=0.1 \ - --add-include-path=$(srcdir) \ - --include=GObject-2.0 \ - --include=GLib-2.0 \ - --include=GdkPixbuf-2.0 \ - --library=indicate --pkg indicate \ - --output Indicate-gtk-0.1.gir $(irscanner_headers) - -Indicate-gtk-0.1.typelib: Indicate-gtk-0.1.gir - $(G_IR_COMPILER) \ - --includedir=$(srcdir) Indicate-gtk-0.1.gir \ - -o Indicate-gtk-0.1.typelib - -DISTCLEANFILES = \ - Indicate-gtk-0.1.gir \ - Indicate-gtk-0.1.typelib - -endif diff --git a/libindicate-gtk/indicate-gtk.pc.in b/libindicate-gtk/indicate-gtk.pc.in deleted file mode 100644 index 28e3c81..0000000 --- a/libindicate-gtk/indicate-gtk.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -includedir=@includedir@ - -Cflags: -I${includedir}/libindicate-0.1 -Requires: gtk+-2.0 indicate -Libs: -L${libdir} -lindicate-gtk - -Name: libindicate-gtk -Description: libindicate GTK stuff. -Version: @VERSION@ - diff --git a/libindicate-gtk/indicator.c b/libindicate-gtk/indicator.c deleted file mode 100644 index a575849..0000000 --- a/libindicate-gtk/indicator.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#include "indicator.h" - -/** - indicate_indicator_set_property_icon: - @indicator: a #IndicateIndicator to act on - @key: name of the property - @data: icon to set property with - - This is a helper function that wraps around #indicate_indicator_set_property - but takes an #GdkPixbuf parameter. It then takes the @data - parameter, turns it into a PNG, base64 encodes it and then - uses that data to call #indicate_indicator_set_property. -*/ -void -indicate_indicator_set_property_icon (IndicateIndicator * indicator, const gchar * key, const GdkPixbuf * data) -{ - if (!GDK_IS_PIXBUF(data)) { - g_warning("Invalide GdkPixbuf"); - return; - } - - GError * error = NULL; - gchar * png_data; - gsize png_data_len; - - if (!gdk_pixbuf_save_to_buffer((GdkPixbuf *)data, &png_data, &png_data_len, "png", &error, NULL)) { - if (error == NULL) { - g_warning("Unable to create pixbuf data stream: %d", png_data_len); - } else { - g_warning("Unable to create pixbuf data stream: %s", error->message); - g_error_free(error); - error = NULL; - } - - return; - } - - gchar * prop_str = g_base64_encode((guchar *)png_data, png_data_len); - indicate_indicator_set_property(indicator, key, prop_str); - - g_free(prop_str); - g_free(png_data); - - return; -} diff --git a/libindicate-gtk/indicator.h b/libindicate-gtk/indicator.h deleted file mode 100644 index 43e264f..0000000 --- a/libindicate-gtk/indicator.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_GTK_INDICATOR_H_INCLUDED__ -#define INDICATE_GTK_INDICATOR_H_INCLUDED__ 1 - -#include <glib.h> -#include <gdk-pixbuf/gdk-pixbuf.h> -#include "libindicate/indicator.h" - -G_BEGIN_DECLS - -/* Properties handling */ -void indicate_indicator_set_property_icon (IndicateIndicator * indicator, const gchar * key, const GdkPixbuf * data); - -G_END_DECLS - -#endif /* INDICATE_GTK_INDICATOR_H_INCLUDED__ */ diff --git a/libindicate-gtk/listener.c b/libindicate-gtk/listener.c deleted file mode 100644 index dceb05b..0000000 --- a/libindicate-gtk/listener.c +++ /dev/null @@ -1,148 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#include "listener.h" -#include <dbus/dbus-glib-bindings.h> - -#include "../libindicate/dbus-indicate-client.h" -#include "../libindicate/listener-private.h" - -typedef enum _get_property_type get_property_type; -enum _get_property_type { - PROPERTY_TYPE_STRING, - PROPERTY_TYPE_TIME, - PROPERTY_TYPE_ICON -}; - -typedef struct _get_property_t get_property_t; -struct _get_property_t { - GCallback cb; - gpointer data; - IndicateListener * listener; - IndicateListenerServer * server; - IndicateListenerIndicator * indicator; - gchar * property; - get_property_type type; -}; - -static void -get_property_cb (DBusGProxy *proxy, char * OUT_value, GError *error, gpointer userdata) -{ - get_property_t * get_property_data = (get_property_t *)userdata; - - if (error != NULL) { - g_warning("Unable to get property data: %s", error->message); - g_error_free(error); - return; - } - - switch (get_property_data->type) { - case PROPERTY_TYPE_STRING: { - indicate_listener_get_property_cb cb = (indicate_listener_get_property_cb)get_property_data->cb; - cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, OUT_value, get_property_data->data); - break; - } - case PROPERTY_TYPE_ICON: { - indicate_listener_get_property_icon_cb cb = (indicate_listener_get_property_icon_cb)get_property_data->cb; - - /* There is no icon */ - if (OUT_value == NULL || OUT_value[0] == '\0') { - break; - } - - gsize length = 0; - guchar * icondata = g_base64_decode(OUT_value, &length); - - GInputStream * input = g_memory_input_stream_new_from_data(icondata, length, NULL); - if (input == NULL) { - g_warning("Cound not create input stream from icon property data"); - g_free(icondata); - break; - } - - GError * error = NULL; - GdkPixbuf * icon = gdk_pixbuf_new_from_stream(input, NULL, &error); - if (icon != NULL) { - cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, icon, get_property_data->data); - } - - if (error != NULL) { - g_warning("Unable to build Pixbuf from icon data: %s", error->message); - g_error_free(error); - } - - error = NULL; - g_input_stream_close(input, NULL, &error); - if (error != NULL) { - g_warning("Unable to close input stream: %s", error->message); - g_error_free(error); - } - g_free(icondata); - break; - } - case PROPERTY_TYPE_TIME: { - indicate_listener_get_property_time_cb cb = (indicate_listener_get_property_time_cb)get_property_data->cb; - GTimeVal time; - if (g_time_val_from_iso8601(OUT_value, &time)) { - cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, &time, get_property_data->data); - } - break; - } - } - - g_free(get_property_data->property); - g_free(get_property_data); - - return; -}; - -static void -get_property_helper (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GCallback callback, gpointer data, get_property_type prop_type) -{ - /* g_debug("get_property_helper: %s %d", property, prop_type); */ - /* TODO: Do we need to somehow refcount the server/indicator while we're waiting on this? */ - get_property_t * get_property_data = g_new(get_property_t, 1); - get_property_data->cb = callback; - get_property_data->data = data; - get_property_data->listener = listener; - get_property_data->server = server; - get_property_data->indicator = indicator; - get_property_data->property = g_strdup(property); - get_property_data->type = prop_type; - - org_freedesktop_indicator_get_indicator_property_async (server->proxy , INDICATE_LISTENER_INDICATOR_ID(indicator), property, get_property_cb, get_property_data); - return; -} - -void -indicate_listener_get_property_icon (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, indicate_listener_get_property_icon_cb callback, gpointer data) -{ - return get_property_helper(listener, server, indicator, property, G_CALLBACK(callback), data, PROPERTY_TYPE_ICON); -} - diff --git a/libindicate-gtk/listener.h b/libindicate-gtk/listener.h deleted file mode 100644 index cedc9a3..0000000 --- a/libindicate-gtk/listener.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_GTK_LISTENER_H_INCLUDED__ -#define INDICATE_GTK_LISTENER_H_INCLUDED__ 1 - -#include <glib.h> -#include <gdk-pixbuf/gdk-pixbuf.h> - -#include "libindicate/listener.h" - -G_BEGIN_DECLS - -typedef void (*indicate_listener_get_property_icon_cb) (IndicateListener * listener, - IndicateListenerServer * server, - IndicateListenerIndicator * indicator, - gchar * property, - GdkPixbuf * propertydata, - gpointer data); - -void indicate_listener_get_property_icon (IndicateListener * listener, - IndicateListenerServer * server, - IndicateListenerIndicator * indicator, - gchar * property, - indicate_listener_get_property_icon_cb callback, - gpointer data); - -G_END_DECLS - -#endif /* INDICATE_GTK_LISTENER_H_INCLUDED__ */ - diff --git a/libindicate/Makefile.am b/libindicate/Makefile.am deleted file mode 100644 index d4746fb..0000000 --- a/libindicate/Makefile.am +++ /dev/null @@ -1,187 +0,0 @@ -MARSHAL_PREFIX = indicate_marshal -MARSHAL_FILE = indicate-marshal -ENUM_FILE = indicate-enum-types - -INCLUDES= \ - -DG_LOG_DOMAIN=\"libindicate\" - -EXTRA_DIST = \ - indicate-interface.xml \ - indicate-listener.xml \ - listener-marshal.list \ - server-marshal.list \ - indicate.pc.in - -BUILT_SOURCES = \ - dbus-indicate-server.h \ - dbus-indicate-client.h \ - dbus-listener-server.h \ - dbus-listener-client.h \ - listener-marshal.c \ - listener-marshal.h \ - server-marshal.c \ - server-marshal.h \ - $(ENUM_FILE).h \ - $(ENUM_FILE).c - -lib_LTLIBRARIES = \ - libindicate.la - -libindicateincludedir=$(includedir)/libindicate-0.1/libindicate - -indicate_headers = \ - indicator.h \ - indicator-message.h \ - listener.h \ - server.h \ - interests.h \ - $(ENUM_FILE).h - -libindicateinclude_HEADERS = \ - $(indicate_headers) - -libindicate_la_SOURCES = \ - $(indicate_headers) \ - dbus-indicate-server.h \ - dbus-indicate-client.h \ - dbus-listener-server.h \ - dbus-listener-client.h \ - indicate-enum-types.c \ - server.c \ - server-marshal.c \ - server-marshal.h \ - listener.c \ - listener-marshal.c \ - listener-marshal.h \ - listener-private.h \ - indicator.c \ - indicator-message.c \ - interests-priv.h - -libindicate_la_LDFLAGS = \ - -version-info $(LIBINDICATE_CURRENT):$(LIBINDICATE_REVISION):$(LIBINDICATE_AGE) \ - -no-undefined \ - -export-symbols-regex "^[^_d].*" - -libindicate_la_CFLAGS = \ - $(LIBINDICATE_CFLAGS) - -libindicate_la_LIBADD = \ - $(LIBINDICATE_LIBS) - -dbus-indicate-server.h: indicate-interface.xml - dbus-binding-tool \ - --prefix=_indicate_server \ - --mode=glib-server \ - --output=dbus-indicate-server.h \ - $(srcdir)/indicate-interface.xml - -dbus-indicate-client.h: indicate-interface.xml - dbus-binding-tool \ - --prefix=_indicate_client \ - --mode=glib-client \ - --output=dbus-indicate-client.h \ - $(srcdir)/indicate-interface.xml - -dbus-listener-server.h: indicate-listener.xml - dbus-binding-tool \ - --prefix=_indicate_listener \ - --mode=glib-server \ - --output=dbus-listener-server.h \ - $(srcdir)/indicate-listener.xml - -dbus-listener-client.h: indicate-listener.xml - dbus-binding-tool \ - --prefix=_indicate_listener \ - --mode=glib-client \ - --output=dbus-listener-client.h \ - $(srcdir)/indicate-listener.xml - -listener-marshal.h: $(srcdir)/listener-marshal.list - glib-genmarshal --header \ - --prefix=_indicate_listener_marshal $(srcdir)/listener-marshal.list \ - > listener-marshal.h - -listener-marshal.c: $(srcdir)/listener-marshal.list - glib-genmarshal --body \ - --prefix=_indicate_listener_marshal $(srcdir)/listener-marshal.list \ - > listener-marshal.c - -server-marshal.h: $(srcdir)/server-marshal.list - glib-genmarshal --header \ - --prefix=_indicate_server_marshal $(srcdir)/server-marshal.list \ - > server-marshal.h - -server-marshal.c: $(srcdir)/server-marshal.list - glib-genmarshal --body \ - --prefix=_indicate_server_marshal $(srcdir)/server-marshal.list \ - > server-marshal.c - -pkgconfig_DATA = indicate.pc -pkgconfigdir = $(libdir)/pkgconfig - -$(ENUM_FILE).h: s-enum-types-h - @true -s-enum-types-h: $(indicate_headers) Makefile - ( cd $(srcdir) && glib-mkenums \ - --fhead "#ifndef _INDICATE_ENUM_TYPES_H_\n#define _INDICATE_ENUM_TYPES_H_\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \ - --fprod "/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type(void);\n#define INDICATE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* _INDICATE_ENUM_TYPES_H_ */" \ - interests.h ) > tmp-$(ENUM_FILE).h \ - && (cmp -s tmp-$(ENUM_FILE).h $(ENUM_FILE).h || cp tmp-$(ENUM_FILE).h $(ENUM_FILE).h ) \ - && rm -f tmp-$(ENUM_FILE).h \ - && echo timestamp > $(@F) - -$(ENUM_FILE).c: s-enum-types-c - @true -s-enum-types-c: $(indicate_headers) Makefile - ( cd $(srcdir) && glib-mkenums \ - --fhead "#include \"interests.h\"\n#include <glib-object.h>" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ - interests.h ) > tmp-$(ENUM_FILE).c \ - && (cmp -s tmp-$(ENUM_FILE).c $(ENUM_FILE).c || cp tmp-$(ENUM_FILE).c $(ENUM_FILE).c ) \ - && rm -f tmp-$(ENUM_FILE).c \ - && echo timestamp > $(@F) - -CLEANFILES = \ - $(ENUM_FILE).c \ - $(ENUM_FILE).h \ - s-enum-types-c \ - s-enum-types-h - -if USE_GIR - -gobjectintrospection_gir_DATA = \ - Indicate-0.1.gir -gobjectintrospection_girdir = $(datadir)/gir - -gobjectintrospection_type_DATA = \ - Indicate-0.1.typelib -gobjectintrospection_typedir = $(libdir)/girepository - -irscanner_headers = $(patsubst %,$(srcdir)/%,$(indicate_headers)) -Indicate-0.1.gir: $(irscanner_headers) - $(G_IR_SCANNER) \ - -v --namespace Indicate \ - --nsversion=0.1 \ - --add-include-path=$(srcdir) \ - --include=GObject-2.0 \ - --include=GLib-2.0 \ - --include=GdkPixbuf-2.0 \ - --library=indicate --pkg indicate \ - --output Indicate-0.1.gir $(irscanner_headers) - -Indicate-0.1.typelib: Indicate-0.1.gir - $(G_IR_COMPILER) \ - --includedir=$(srcdir) Indicate-0.1.gir \ - -o Indicate-0.1.typelib - -DISTCLEANFILES = \ - Indicate-0.1.gir \ - Indicate-0.1.typelib - -endif diff --git a/libindicate/indicate-interface.xml b/libindicate/indicate-interface.xml deleted file mode 100644 index 900b336..0000000 --- a/libindicate/indicate-interface.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> ---> -<node name="/"> - <interface name="org.freedesktop.indicator"> - -<!-- Properties --> - <property name="desktop" type="s" access="read"/> - <property name="type" type="s" access="read"/> - -<!-- Functions --> - <method name="GetIndicatorCount"> - <arg type="u" name="indicator_count" direction="out" /> - </method> - <method name="GetIndicatorCountByType"> - <arg type="s" name="type" direction="in" /> - <arg type="u" name="indicator_count" direction="out" /> - </method> - <method name="GetIndicatorList"> - <arg type="ai" name="indicators" direction="out" /> - </method> - <method name="GetIndicatorListByType"> - <arg type="s" name="type" direction="in" /> - <arg type="ai" name="indicators" direction="out" /> - </method> - <method name="GetIndicatorProperty"> - <arg type="u" name="id" direction="in" /> - <arg type="s" name="property" direction="in" /> - <arg type="s" name="value" direction="out" /> - </method> - <method name="GetIndicatorPropertyGroup"> - <arg type="u" name="id" direction="in" /> - <arg type="as" name="properties" direction="in" /> - <arg type="as" name="values" direction="out" /> - </method> - <method name="GetIndicatorProperties"> - <arg type="u" name="id" direction="in" /> - <arg type="as" name="properties" direction="out" /> - </method> - <method name="ShowIndicatorToUser"> - <arg type="u" name="id" direction="in" /> - </method> - <method name="ShowInterest"> - <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> - <arg type="s" name="interest" direction="in" /> - </method> - <method name="RemoveInterest"> - <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> - <arg type="s" name="interest" direction="in" /> - </method> - - -<!-- Signals --> - <signal name="IndicatorAdded"> - <arg type="u" name="id" direction="out" /> - <arg type="s" name="type" direction="out" /> - </signal> - <signal name="IndicatorRemoved"> - <arg type="u" name="id" direction="out" /> - <arg type="s" name="type" direction="out" /> - </signal> - <signal name="IndicatorModified"> - <arg type="u" name="id" direction="out" /> - <arg type="s" name="property" direction="out" /> - </signal> - <signal name="ServerShow"> - <arg type="s" name="type" direction="out" /> - </signal> - <signal name="ServerHide"> - <arg type="s" name="type" direction="out" /> - </signal> - - -<!-- End of interesting stuff --> - - </interface> -</node> diff --git a/libindicate/indicate-listener.xml b/libindicate/indicate-listener.xml deleted file mode 100644 index c834489..0000000 --- a/libindicate/indicate-listener.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> ---> -<node name="/"> - <interface name="org.freedesktop.indicator.listener"> - -<!-- Functions --> - <method name="GetIndicatorServers"> - <arg type="as" name="server_ids" direction="out" /> - </method> - -<!-- End of interesting stuff --> - - </interface> -</node> diff --git a/libindicate/indicate.pc.in b/libindicate/indicate.pc.in deleted file mode 100644 index ff17ecb..0000000 --- a/libindicate/indicate.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -includedir=@includedir@ - -Cflags: -I${includedir}/libindicate-0.1 -Requires: gobject-2.0 glib-2.0 dbus-glib-1 -Libs: -L${libdir} -lindicate - -Name: libindicate -Description: libindicate. -Version: @VERSION@ - diff --git a/libindicate/indicator-message.c b/libindicate/indicator-message.c deleted file mode 100644 index 9cd735a..0000000 --- a/libindicate/indicator-message.c +++ /dev/null @@ -1,105 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "indicator-message.h" - -typedef struct _IndicateIndicatorMessagePrivate IndicateIndicatorMessagePrivate; - -struct _IndicateIndicatorMessagePrivate -{ - gchar * subtype; -}; - -#define INDICATE_INDICATOR_MESSAGE_GET_PRIVATE(o) \ -(G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATE_INDICATOR_MESSAGE_TYPE, IndicateIndicatorMessagePrivate)) - -static void indicate_indicator_message_class_init (IndicateIndicatorMessageClass *klass); -static void indicate_indicator_message_init (IndicateIndicatorMessage *self); -static void indicate_indicator_message_dispose (GObject *object); -static void indicate_indicator_message_finalize (GObject *object); -static const gchar * get_indicator_type (IndicateIndicator * indicator); - -G_DEFINE_TYPE (IndicateIndicatorMessage, indicate_indicator_message, INDICATE_TYPE_INDICATOR); - -static void -indicate_indicator_message_class_init (IndicateIndicatorMessageClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - g_type_class_add_private (klass, sizeof (IndicateIndicatorMessagePrivate)); - - object_class->dispose = indicate_indicator_message_dispose; - object_class->finalize = indicate_indicator_message_finalize; - - IndicateIndicatorClass * indicator_class = INDICATE_INDICATOR_CLASS(klass); - - indicator_class->get_type = get_indicator_type; - - return; -} - -static void -indicate_indicator_message_init (IndicateIndicatorMessage *self) -{ -} - -static void -indicate_indicator_message_dispose (GObject *object) -{ -G_OBJECT_CLASS (indicate_indicator_message_parent_class)->dispose (object); -} - -static void -indicate_indicator_message_finalize (GObject *object) -{ -G_OBJECT_CLASS (indicate_indicator_message_parent_class)->finalize (object); -} - -/** - indicate_indicator_message_new: - - Builds a new indicator message object using #g_object_new. - - Return value: A pointer to a new #IndicateIndicatorMessage object. -*/ -static const gchar * -get_indicator_type (IndicateIndicator * indicator) -{ - return "message"; -} - -IndicateIndicatorMessage * -indicate_indicator_message_new (void) -{ - return g_object_new(INDICATE_TYPE_INDICATOR_MESSAGE, NULL); -} diff --git a/libindicate/indicator-message.h b/libindicate/indicator-message.h deleted file mode 100644 index 76273c6..0000000 --- a/libindicate/indicator-message.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef __INDICATE_INDICATOR_MESSAGE_H__ -#define __INDICATE_INDICATOR_MESSAGE_H__ - -#include <glib.h> -#include <glib-object.h> - -#include "indicator.h" - -G_BEGIN_DECLS - -#define INDICATE_TYPE_INDICATOR_MESSAGE (indicate_indicator_message_get_type ()) -#define INDICATE_INDICATOR_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATE_TYPE_INDICATOR_MESSAGE, IndicateIndicatorMessage)) -#define INDICATE_INDICATOR_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATE_TYPE_INDICATOR_MESSAGE, IndicateIndicatorMessageClass)) -#define INDICATE_IS_INDICATOR_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATE_TYPE_INDICATOR_MESSAGE)) -#define INDICATE_IS_INDICATOR_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATE_TYPE_INDICATOR_MESSAGE)) -#define INDICATE_INDICATOR_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATE_TYPE_INDICATOR_MESSAGE, IndicateIndicatorMessageClass)) - -typedef struct _IndicateIndicatorMessage IndicateIndicatorMessage; -typedef struct _IndicateIndicatorMessageClass IndicateIndicatorMessageClass; - -/** - IndicateIndicatorMessageClass: - @parent_class: Parent Class - - Subclass of #IndicateIndicator with no new functions or signals. -*/ -struct _IndicateIndicatorMessageClass { - IndicateIndicatorClass parent_class; -}; - -/** - IndicateIndicatorMessage: - - A class to represent indicators who's 'type' is "message". These - are basically indicators that represent messages from humans to - humans via computers. Things like instance messages, micro blogging - entries or e-mails. All of these qualify as messages. - - TODO: This should include a list of properties that are supported. -*/ -struct _IndicateIndicatorMessage { - IndicateIndicator parent; -}; - -GType indicate_indicator_message_get_type (void); -IndicateIndicatorMessage * indicate_indicator_message_new (void); - -/** - SECTION:indicator-message - @short_description: A representation of human generated messages - @stability: Unstable - @include: libindicate/indicator-message.h - - The message indicators represent messages that come from humans - to humans using computers. They come in all different forms with - various different interaction protocols, but they all want the human - at the computer to interact back with the human that sent the - message. -*/ - -G_END_DECLS - -#endif diff --git a/libindicate/indicator.c b/libindicate/indicator.c deleted file mode 100644 index 18cdc4a..0000000 --- a/libindicate/indicator.c +++ /dev/null @@ -1,528 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#include "glib.h" -#include "glib/gmessages.h" -#include "indicator.h" -#include "server.h" - -/* Signals */ -enum { - HIDE, - SHOW, - USER_DISPLAY, - MODIFIED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -typedef struct _IndicateIndicatorPrivate IndicateIndicatorPrivate; -struct _IndicateIndicatorPrivate -{ - guint id; - gboolean is_visible; - IndicateServer * server; - GHashTable * properties; -}; - -#define INDICATE_INDICATOR_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATE_TYPE_INDICATOR, IndicateIndicatorPrivate)) - -G_DEFINE_TYPE (IndicateIndicator, indicate_indicator, G_TYPE_OBJECT); - -static void indicate_indicator_finalize (GObject * object); -static void set_property (IndicateIndicator * indicator, const gchar * key, const gchar * data); -static const gchar * get_property (IndicateIndicator * indicator, const gchar * key); -static GPtrArray * list_properties (IndicateIndicator * indicator); - - -/* Functions */ -static void -indicate_indicator_class_init (IndicateIndicatorClass * class) -{ - /* g_debug("Indicator Class Initialized."); */ - - GObjectClass * gobj; - gobj = G_OBJECT_CLASS(class); - - g_type_class_add_private (class, sizeof (IndicateIndicatorPrivate)); - - gobj->finalize = indicate_indicator_finalize; - - /** - IndicateIndicator::display: - @arg0: The #IndicateIndicator object - - Emitted when the user has clicked on this indicator. In the - messaging indicator this would be when someone clicks on the - menu item for the indicator. - */ - signals[USER_DISPLAY] = g_signal_new(INDICATE_INDICATOR_SIGNAL_DISPLAY, - G_TYPE_FROM_CLASS(class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(IndicateIndicatorClass, user_display), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - IndicateIndicator::hide: - @arg0: The #IndicateIndicator object - - Emitted every time this indicator is hidden. This - is mostly used by #IndicateServer. - - Typically this results in an emition of #IndicateServer::indicator-removed. - */ - signals[HIDE] = g_signal_new(INDICATE_INDICATOR_SIGNAL_HIDE, - G_TYPE_FROM_CLASS(class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(IndicateIndicatorClass, hide), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - IndicateIndicator::show: - @arg0: The #IndicateIndicator object - - Emitted every time this indicator is shown. This - is mostly used by #IndicateServer. - - Typically this results in an emition of #IndicateServer::indicator-added. - */ - signals[SHOW] = g_signal_new(INDICATE_INDICATOR_SIGNAL_SHOW, - G_TYPE_FROM_CLASS(class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(IndicateIndicatorClass, show), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - IndicateIndicator::modified: - @arg0: The #IndicateIndicator object - @arg1: The name of the property that changed. - - Emitted every time an indicator property is changed. - This is mostly used by #IndicateServer. - - Typically this results in an emition of #IndicateServer::indicator-modified. - */ - signals[MODIFIED] = g_signal_new(INDICATE_INDICATOR_SIGNAL_MODIFIED, - G_TYPE_FROM_CLASS(class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(IndicateIndicatorClass, modified), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - - class->get_type = NULL; - class->set_property = set_property; - class->get_property = get_property; - class->list_properties = list_properties; - - return; -} - -static void -indicate_indicator_init (IndicateIndicator * indicator) -{ - /* g_debug("Indicator Object Initialized."); */ - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - priv->is_visible = FALSE; - - priv->properties = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - - priv->server = indicate_server_ref_default(); - priv->id = indicate_server_get_next_id(priv->server); - - indicate_server_add_indicator(priv->server, indicator); - - return; -} - -static void -indicate_indicator_finalize (GObject * obj) -{ - IndicateIndicator * indicator = INDICATE_INDICATOR(obj); - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - indicate_server_remove_indicator(priv->server, indicator); - g_object_unref(priv->server); - priv->server = NULL; - - G_OBJECT_CLASS (indicate_indicator_parent_class)->finalize (obj); - return; -} - -/** - indicate_indicator_get_type: - - Gets a unique #GType for the #IndicateIndicator objects. - - Return value: A unique #GType value. -*/ - -/** - indicate_indicator_new: - - Builds a new indicator object using g_object_new(). - - Return value: A pointer to a new #IndicateIndicator object. -*/ -IndicateIndicator * -indicate_indicator_new (void) -{ - IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL); - return indicator; -} - -/** - indicate_indicator_new_with_server: - @server: The server that should be associated with this indicator. - - Builds a new indicator object using g_object_new() and sets - the server to the specified server. Also, adds a reference - to the server. - - Return value: A pointer to a new #IndicateIndicator object. -*/ -IndicateIndicator * -indicate_indicator_new_with_server (IndicateServer * server) -{ - g_return_val_if_fail(server != NULL, NULL); - - IndicateIndicator * indicator = g_object_new(INDICATE_TYPE_INDICATOR, NULL); - - indicate_indicator_set_server (indicator, server); - - return indicator; -} - -/** - indicate_indicator_set_server: - @indicator: a #IndicateIndicator to act on - @server: the #IndicateServer which should be associated with @indicator - - Defines which server this indicator must be associated to. Also, adds a - reference to the server. -*/ -void -indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server) -{ - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - if (server != NULL) { - g_object_ref(server); - } - - if (priv->server != NULL) { - indicate_server_remove_indicator (priv->server, indicator); - g_object_unref(priv->server); - } - - priv->server = server; - if (server != NULL) { - indicate_server_add_indicator (server, indicator); - } - - return; -} - - -/** - indicate_indicator_show: - @indicator: a #IndicateIndicator to act on - - Shows this indicator on the bus. If the #IndicateServer that it's - connected to is not shown itself this function will show the server - as well using #indicate_server_show. -*/ -void -indicate_indicator_show (IndicateIndicator * indicator) -{ - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - if (priv->is_visible) { - return; - } - - if (priv->server) { - indicate_server_show(priv->server); - } - - priv->is_visible = TRUE; - g_signal_emit(indicator, signals[SHOW], 0, TRUE); - - return; -} - -/** - indicate_indicator_hide: - @indicator: a #IndicateIndicator to act on - - Hides the indicator from the bus. Does not effect the - indicator's #IndicateServer in any way. -*/ -void -indicate_indicator_hide (IndicateIndicator * indicator) -{ - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - if (!priv->is_visible) { - return; - } - - priv->is_visible = FALSE; - g_signal_emit(indicator, signals[HIDE], 0, TRUE); - - return; -} - -/** - indicate_indicator_is_visible: - @indicator: a #IndicateIndicator to act on - - Checkes the visibility status of @indicator. - - Return value: %TRUE if the indicator is visible else %FALSE. -*/ -gboolean -indicate_indicator_is_visible (IndicateIndicator * indicator) -{ - g_return_val_if_fail(INDICATE_IS_INDICATOR(indicator), FALSE); - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - return priv->is_visible; -} - -/** - indicate_indicator_get_id: - @indicator: a #IndicateIndicator to act on - - Gets the ID value of the @indicator. - - Return value: The ID of the indicator. Can not be zero. - Zero represents an error. -*/ -guint -indicate_indicator_get_id (IndicateIndicator * indicator) -{ - g_return_val_if_fail(INDICATE_IS_INDICATOR(indicator), 0); - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - return priv->id; -} - -/** - indicate_indicator_get_indicator_type: - @indicator: a #IndicateIndicator to act on - - Returns the type of @indicator. This is largely set by the subclass - that the indicator was built with and should not be free'd. - - Return value: A string defining the type or NULL for no type. -*/ -const gchar * -indicate_indicator_get_indicator_type (IndicateIndicator * indicator) -{ - g_return_val_if_fail(INDICATE_IS_INDICATOR(indicator), NULL); - IndicateIndicatorClass * class = INDICATE_INDICATOR_GET_CLASS(indicator); - - if (class->get_type != NULL) { - return INDICATE_INDICATOR_GET_CLASS(indicator)->get_type(indicator); - } - - return NULL; -} - -/** - indicate_indicator_user_display: - @indicator: a #IndicateIndicator to act on - - Emits the #IndicateIndicator::user-display signal simliar to a user - clicking on @indicator over the bus. Signal will not be sent if the - @indicator is not visible. -*/ -void -indicate_indicator_user_display (IndicateIndicator * indicator) -{ - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - if (!priv->is_visible) { - return; - } - - g_signal_emit(indicator, signals[USER_DISPLAY], 0, TRUE); - return; -} - -/** - indicate_indicator_set_property: - @indicator: a #IndicateIndicator to act on - @key: name of the property - @data: value of the property - - Sets a simple string property on @indicator. If the property - had previously been set it will replace it with the new value, - otherwise it will create the property. This will include an - emition of #IndicateIndicator::modified if the property value - was changed. -*/ -void -indicate_indicator_set_property (IndicateIndicator * indicator, const gchar * key, const gchar * data) -{ - IndicateIndicatorClass * class = INDICATE_INDICATOR_GET_CLASS(indicator); - if (class->set_property == NULL) { - return; - } - - return class->set_property(indicator, key, data); -} - -/** - indicate_indicator_set_property_time: - @indicator: a #IndicateIndicator to act on - @key: name of the property - @time: time to set property with - - This is a helper function that wraps around #indicate_indicator_set_property - but takes an #GTimeVal parameter. It then takes the @data - parameter converts it to an ISO 8601 time string and - uses that data to call #indicate_indicator_set_property. -*/ -void -indicate_indicator_set_property_time (IndicateIndicator * indicator, const gchar * key, GTimeVal * time) -{ - gchar * timestr = g_time_val_to_iso8601(time); - if (timestr != NULL) { - indicate_indicator_set_property(indicator, key, timestr); - g_free(timestr); - } - return; -} - -/** - indicate_indicator_get_property: - @indicator: a #IndicateIndicator to act on - @key: name of the property - - Returns the value that is set for a property or %NULL if that - property is not set. - - Return value: A constant string or NULL. -*/ -const gchar * -indicate_indicator_get_property (IndicateIndicator * indicator, const gchar * key) -{ - IndicateIndicatorClass * class = INDICATE_INDICATOR_GET_CLASS(indicator); - if (class->get_property == NULL) { - return NULL; - } - - return class->get_property(indicator, key); -} - -/** - indicate_indicator_list_properties: - @indicator: a #IndicateIndicator to act on - - This function gets a list of all the properties that exist - on a @indicator. The array may have zero entries but almost - always at least has 'type' in it. - - Return value: An array of strings that is the keys of all - the properties on this indicator. -*/ -GPtrArray * -indicate_indicator_list_properties (IndicateIndicator * indicator) -{ - IndicateIndicatorClass * class = INDICATE_INDICATOR_GET_CLASS(indicator); - if (class->list_properties == NULL) { - return g_ptr_array_new(); - } - - return class->list_properties(indicator); -} - -static void -set_property (IndicateIndicator * indicator, const gchar * key, const gchar * data) -{ - g_return_if_fail(INDICATE_IS_INDICATOR(indicator)); - - if (key != NULL && !g_strcmp0(key, "type")) { - g_warning("Trying to set the 'type' of an indicator which should be done through subclassing."); - return; - } - - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - gchar * current = g_hash_table_lookup(priv->properties, key); - if (current == NULL || g_strcmp0(current, data)) { - /* If the value has changed or there is no value */ - gchar * newkey = g_strdup(key); - /* g_debug("What is newkey? %s", newkey); */ - g_hash_table_insert(priv->properties, newkey, g_strdup(data)); - if (indicate_indicator_is_visible(indicator)) { - /* g_debug("Indicator property modified: %s %s", key, data); */ - g_signal_emit(indicator, signals[MODIFIED], 0, key, TRUE); - } - } - - return; -} - -static const gchar * -get_property (IndicateIndicator * indicator, const gchar * key) -{ - g_return_val_if_fail(INDICATE_IS_INDICATOR(indicator), NULL); - - if (key != NULL && !g_strcmp0(key, "type")) { - return indicate_indicator_get_indicator_type(indicator); - } - - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - // TODO: Think about whether we should be strdup'ing this. Seems like overkill, but might not be. - return (const gchar *)g_hash_table_lookup(priv->properties, key); -} - -static GPtrArray * -list_properties (IndicateIndicator * indicator) -{ - g_return_val_if_fail(INDICATE_IS_INDICATOR(indicator), g_ptr_array_new()); - IndicateIndicatorPrivate * priv = INDICATE_INDICATOR_GET_PRIVATE(indicator); - - GList * keys = g_hash_table_get_keys(priv->properties); - GPtrArray * properties = g_ptr_array_sized_new(g_list_length(keys) + 1); - - g_ptr_array_add(properties, g_strdup("type")); - for (; keys != NULL; keys = keys->next) { - g_ptr_array_add(properties, g_strdup(keys->data)); - } - - return properties; -} diff --git a/libindicate/indicator.h b/libindicate/indicator.h deleted file mode 100644 index b2e33c0..0000000 --- a/libindicate/indicator.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_INDICATOR_H_INCLUDED__ -#define INDICATE_INDICATOR_H_INCLUDED__ 1 - -#include <glib.h> -#include <glib-object.h> - -G_BEGIN_DECLS - -/* Boilerplate */ -#define INDICATE_TYPE_INDICATOR (indicate_indicator_get_type ()) -#define INDICATE_INDICATOR(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_INDICATOR, IndicateIndicator)) -#define INDICATE_IS_INDICATOR(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_INDICATOR)) -#define INDICATE_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_INDICATOR, IndicateIndicatorClass)) -#define INDICATE_IS_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_INDICATOR)) -#define INDICATE_INDICATOR_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_INDICATOR, IndicateIndicatorClass)) - -/* This is a signal that signals to the indicator that the user - * has done an action where they'd like this indicator to be - * displayed. */ -#define INDICATE_INDICATOR_SIGNAL_HIDE "hide" -#define INDICATE_INDICATOR_SIGNAL_SHOW "show" -#define INDICATE_INDICATOR_SIGNAL_DISPLAY "user-display" -#define INDICATE_INDICATOR_SIGNAL_MODIFIED "modified" - -typedef struct _IndicateIndicator IndicateIndicator; -typedef struct _IndicateIndicatorClass IndicateIndicatorClass; - -/** - IndicateIndicator: - - The indicator object represents a single item that is shared over the - indicator bus. This could be something like one IM, one e-mail or - a single system update. It should be accessed only through its - accessors. -*/ -struct _IndicateIndicator { - GObject parent; -}; - -#include "server.h" - -/** - IndicateIndicatorClass: - @parent_class: Parent class #GObjectClass. - @hide: Slot for #IndicateIndicator::hide. - @show: Slot for #IndicateIndicator::show. - @user_display: Slot for #IndicateIndicator::user-display. - @modified: Slot for #IndicateIndicator::modified. - @get_type: Returns a constant string for the type of this indicator. - Typically gets overridden by subclasses and defines the type of - the indicator. Is called by indicate_indicator_get_indicator_type(). - @set_property: Called when indicate_indicator_set_property() is called - and should set the value. While typically it is overridden by - subclasses they usually handle special properties themselves and - then call the superclass for storage. - @get_property: Called when indicate_indicator_get_property() is called - and should return the value requested. Many times this is left alone. - @list_properties: Called when indicate_indicator_list_properties() is called - and returns a list of the properties available. Again this can be - overridden by subclasses to handle special properties. - - All of the functions that are used to modify or change data that is - in the indicator. Typically gets subclassed by other types of - indicators, for example #IndicateIndicatorMessages. - -*/ -struct _IndicateIndicatorClass { - GObjectClass parent_class; - - void (*hide) (IndicateIndicator * indicator, gpointer data); - void (*show) (IndicateIndicator * indicator, gpointer data); - void (*user_display) (IndicateIndicator * indicator, gpointer data); - void (*modified) (IndicateIndicator * indicator, gchar * property, gpointer data); - - const gchar * (*get_type) (IndicateIndicator * indicator); - void (*set_property) (IndicateIndicator * indicator, const gchar * key, const gchar * data); - const gchar * (*get_property) (IndicateIndicator * indicator, const gchar * key); - GPtrArray * (*list_properties) (IndicateIndicator * indicator); -}; - -GType indicate_indicator_get_type(void) G_GNUC_CONST; - -/* New Indicator Functions */ -IndicateIndicator * indicate_indicator_new (void); -IndicateIndicator * indicate_indicator_new_with_server (IndicateServer * server); - -/* Show and hide this indicator */ -void indicate_indicator_show (IndicateIndicator * indicator); -void indicate_indicator_hide (IndicateIndicator * indicator); - -gboolean indicate_indicator_is_visible (IndicateIndicator * indicator); - -/* Define this indicator server */ -void indicate_indicator_set_server (IndicateIndicator * indicator, IndicateServer * server); - -/* Every entry has an ID, here's how to get it */ -guint indicate_indicator_get_id (IndicateIndicator * indicator); - -/* Every entry has a type. This should be created by the - * subclass and exported through this pretty function */ -const gchar * indicate_indicator_get_indicator_type (IndicateIndicator * indicator); - -void indicate_indicator_user_display (IndicateIndicator * indicator); - -/* Properties handling */ -void indicate_indicator_set_property (IndicateIndicator * indicator, const gchar * key, const gchar * data); -void indicate_indicator_set_property_time (IndicateIndicator * indicator, const gchar * key, GTimeVal * time); -const gchar * indicate_indicator_get_property (IndicateIndicator * indicator, const gchar * key); -GPtrArray * indicate_indicator_list_properties (IndicateIndicator * indicator); - -/** - SECTION:indicator - @short_description: A representation of state for applications - @stability: Unstable - @include: libindicate/indicator.h - - An indicator is designed to represent a single instance of something - in your application. So this might be an IM or Email using #IndicateIndicatorMessage - or any other thing that is a small unit of information to pass on - to the user. - - Indicators make no promises about how they are preceived by the - user, it's up to the listener to represent them in an intutive and - visually appealling way. But, what we can do is provide information - on the indicator to provide enough information for the listener - to do that. - - Mostly this is done through properties. The only property that is - defined for the base indicator is the 'type' property. And this - is only available to set by creating a subclass of the - #IndicateIndicator object. It is assumed that you can look at the - definitions of the various subtypes to determine which properties - they support. - - It may be that some users don't want to create objects for every - indicator as it could be a lot of overhead if there are large numbers - and there is already a data structure representing them all. In that - case it is recommended that you ignore the #IndicateIndicator object - tree in general and move to subclassing #IndicateServer directly. -*/ - -G_END_DECLS - -#endif /* INDICATE_INDICATOR_H_INCLUDED__ */ diff --git a/libindicate/interests-priv.h b/libindicate/interests-priv.h deleted file mode 100644 index eb4e791..0000000 --- a/libindicate/interests-priv.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_INTERESTS_PRIV_H_INCLUDED__ -#define INDICATE_INTERESTS_PRIV_H_INCLUDED__ 1 - -#include <glib.h> - -G_BEGIN_DECLS - -#define INDICATE_INTEREST_STRING_SERVER_DISPLAY "server-display" -#define INDICATE_INTEREST_STRING_SERVER_SIGNAL "server-signal" -#define INDICATE_INTEREST_STRING_INDICATOR_DISPLAY "indicator-display" -#define INDICATE_INTEREST_STRING_INDICATOR_SIGNAL "indicator-signal" -#define INDICATE_INTEREST_STRING_INDICATOR_COUNT "indicator-count" - -G_END_DECLS - -#endif /* INDICATE_INTERESTS_PRIV_H_INCLUDED__ */ - diff --git a/libindicate/interests.h b/libindicate/interests.h deleted file mode 100644 index 1c6215a..0000000 --- a/libindicate/interests.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_INTERESTS_H_INCLUDED__ -#define INDICATE_INTERESTS_H_INCLUDED__ 1 - -#include <glib.h> - -G_BEGIN_DECLS - -typedef enum { - INDICATE_INTEREST_NONE, /**< We're of no interest */ - INDICATE_INTEREST_SERVER_DISPLAY, /**< Displays the server's existance to the user */ - INDICATE_INTEREST_SERVER_SIGNAL, /**< Will send signals to the server to be displayed */ - INDICATE_INTEREST_INDICATOR_DISPLAY, /**< Displays indicators to the user */ - INDICATE_INTEREST_INDICATOR_SIGNAL, /**< Will return signals based on individual indicators being responded to */ - INDICATE_INTEREST_INDICATOR_COUNT, /**< Only displays a count of the indicators */ - INDICATE_INTEREST_LAST /**< Makes merges and counting easier */ -} IndicateInterests; - -G_END_DECLS - -#endif /* INDICATE_INTERESTS_H_INCLUDED__ */ - diff --git a/libindicate/listener-marshal.list b/libindicate/listener-marshal.list deleted file mode 100644 index a3d20a9..0000000 --- a/libindicate/listener-marshal.list +++ /dev/null @@ -1,35 +0,0 @@ -# A library to allow applictions to provide simple indications of -# information to be displayed to users of the application through the -# interface shell. -# -# Copyright 2009 Canonical Ltd. -# -# Authors: -# Ted Gould <ted@canonical.com> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of either or both of the following licenses: -# -# 1) the GNU Lesser General Public License version 3, as published by the -# Free Software Foundation; and/or -# 2) the GNU Lesser General Public License version 2.1, as published by -# the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the applicable version of the GNU Lesser General Public -# License for more details. -# -# You should have received a copy of both the GNU Lesser General Public -# License version 3 and version 2.1 along with this program. If not, see -# <http://www.gnu.org/licenses/> -# -# IndicatorAdded, IndicatorRemoved, IndicatorModified -VOID:UINT,STRING -# Local indicator_added, indicator_removed -VOID:POINTER,POINTER,STRING -# Local indicator_modified -VOID:POINTER,POINTER,STRING,STRING -# Local server_added and server_removed -VOID:POINTER,STRING diff --git a/libindicate/listener-private.h b/libindicate/listener-private.h deleted file mode 100644 index ea1b108..0000000 --- a/libindicate/listener-private.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_LISTENER_PRIVATE_H__ -#define INDICATE_LISTENER_PRIVATE_H__ 1 - -struct _IndicateListenerServer { - gchar * name; - DBusGProxy * proxy; - DBusGConnection * connection; - gboolean interests[INDICATE_INTEREST_LAST]; -}; - -struct _IndicateListenerIndicator { - guint id; -}; - -typedef struct _IndicateListenerPrivate IndicateListenerPrivate; -struct _IndicateListenerPrivate -{ - DBusGConnection * session_bus; - DBusGConnection * system_bus; - - DBusGProxy * dbus_proxy_session; - DBusGProxy * dbus_proxy_system; - - GList * proxies_working; - GList * proxies_possible; - - GArray * proxy_todo; - guint todo_idle; -}; - -#define INDICATE_LISTENER_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATE_TYPE_LISTENER, IndicateListenerPrivate)) - -#endif /* INDICATE_LISTENER_PRIVATE_H__ */ diff --git a/libindicate/listener.c b/libindicate/listener.c deleted file mode 100644 index 48ad616..0000000 --- a/libindicate/listener.c +++ /dev/null @@ -1,1084 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#include <libxml/parser.h> -#include <libxml/tree.h> - -#include "listener.h" -#include "listener-marshal.h" -#include <dbus/dbus-glib-bindings.h> -#include "dbus-indicate-client.h" -#include "dbus-listener-client.h" -#include "interests-priv.h" - -/* Errors */ -enum { - LAST_ERROR -}; - -/* Signals */ -enum { - INDICATOR_ADDED, - INDICATOR_REMOVED, - INDICATOR_MODIFIED, - SERVER_ADDED, - SERVER_REMOVED, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -#include "listener-private.h" - -typedef struct { - DBusGProxy * proxy; - DBusGProxy * property_proxy; - DBusGConnection * connection; - gchar * name; - gchar * type; - IndicateListener * listener; - GHashTable * indicators; - guint introspect_level; - - IndicateListenerServer server; -} proxy_t; - -static gint -proxy_t_equal (gconstpointer pa, gconstpointer pb) -{ - proxy_t * a = (proxy_t *)pa; proxy_t * b = (proxy_t *)pb; - - if (a->connection == b->connection) { - return g_strcmp0(a->name, b->name); - } else { - /* we're only using this for equal, not sorting */ - return 1; - } -} - -typedef struct { - DBusGConnection * bus; - gchar * name; - gboolean startup; -} proxy_todo_t; - -G_DEFINE_TYPE (IndicateListener, indicate_listener, G_TYPE_OBJECT); - -/* Prototypes */ -static void indicate_listener_finalize (GObject * obj); -static void dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateListener * listener); -static void proxy_struct_destroy (gpointer data); -static void build_todo_list_cb (DBusGProxy * proxy, char ** names, GError * error, void * data); -static void todo_list_add (const gchar * name, DBusGProxy * proxy, IndicateListener * listener, gboolean startup); -static gboolean todo_idle (gpointer data); -static void get_type_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data); -static void proxy_server_added (DBusGProxy * proxy, const gchar * type, proxy_t * proxyt); -static void proxy_indicator_added (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt); -static void proxy_indicator_removed (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt); -static void proxy_indicator_modified (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt); -static void proxy_get_indicator_list (DBusGProxy * proxy, GArray * indicators, GError * error, gpointer data); -static void proxy_get_indicator_type (DBusGProxy * proxy, gchar * type, GError * error, gpointer data); -static void proxy_indicators_free (gpointer data); -static void introspect_this (DBusGProxy * proxy, char * OUT_data, GError * error, gpointer data); - -/* DBus interface */ -gboolean _indicate_listener_get_indicator_servers (IndicateListener * listener, GList * servers); - -/* Need the above prototypes */ -#include "dbus-listener-server.h" - -/* Code */ -static void -indicate_listener_class_init (IndicateListenerClass * class) -{ - /* g_debug("Listener Class Initialized"); */ - GObjectClass * gobj; - gobj = G_OBJECT_CLASS(class); - - g_type_class_add_private (class, sizeof (IndicateListenerPrivate)); - - gobj->finalize = indicate_listener_finalize; - - signals[INDICATOR_ADDED] = g_signal_new(INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateListenerClass, indicator_added), - NULL, NULL, - _indicate_listener_marshal_VOID__POINTER_POINTER_STRING, - G_TYPE_NONE, 3, INDICATE_TYPE_LISTENER_SERVER, INDICATE_TYPE_LISTENER_INDICATOR, G_TYPE_STRING); - signals[INDICATOR_REMOVED] = g_signal_new(INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateListenerClass, indicator_removed), - NULL, NULL, - _indicate_listener_marshal_VOID__POINTER_POINTER_STRING, - G_TYPE_NONE, 3, INDICATE_TYPE_LISTENER_SERVER, INDICATE_TYPE_LISTENER_INDICATOR, G_TYPE_STRING); - signals[INDICATOR_MODIFIED] = g_signal_new(INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateListenerClass, indicator_modified), - NULL, NULL, - _indicate_listener_marshal_VOID__POINTER_POINTER_STRING_STRING, - G_TYPE_NONE, 4, INDICATE_TYPE_LISTENER_SERVER, INDICATE_TYPE_LISTENER_INDICATOR, G_TYPE_STRING, G_TYPE_STRING); - signals[SERVER_ADDED] = g_signal_new(INDICATE_LISTENER_SIGNAL_SERVER_ADDED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateListenerClass, server_added), - NULL, NULL, - _indicate_listener_marshal_VOID__POINTER_STRING, - G_TYPE_NONE, 2, INDICATE_TYPE_LISTENER_SERVER, G_TYPE_STRING); - signals[SERVER_REMOVED] = g_signal_new(INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateListenerClass, server_removed), - NULL, NULL, - _indicate_listener_marshal_VOID__POINTER_STRING, - G_TYPE_NONE, 2, INDICATE_TYPE_LISTENER_SERVER, G_TYPE_STRING); - - dbus_g_object_register_marshaller(_indicate_listener_marshal_VOID__UINT_STRING, - G_TYPE_NONE, - G_TYPE_UINT, - G_TYPE_STRING, - G_TYPE_INVALID); - - return; -} - -static void -indicate_listener_init (IndicateListener * listener) -{ - /* g_debug("Listener Object Initialized"); */ - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - GError *error = NULL; - - /* Get the buses */ - priv->session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); - if (error != NULL) { - g_error("Unable to get session bus: %s", error->message); - g_error_free(error); - return; - } - - priv->system_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); - if (error != NULL) { - g_error("Unable to get system bus: %s", error->message); - g_error_free(error); - return; - } - - /* Set up the DBUS service proxies */ - priv->dbus_proxy_session = dbus_g_proxy_new_for_name_owner (priv->session_bus, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - &error); - if (error != NULL) { - g_error("Unable to get dbus proxy on session bus: %s", error->message); - g_error_free(error); - return; - } - - priv->dbus_proxy_system = dbus_g_proxy_new_for_name_owner (priv->system_bus, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - &error); - if (error != NULL) { - g_error("Unable to get dbus proxy on system bus: %s", error->message); - g_error_free(error); - return; - } - - /* Set up name change signals */ - dbus_g_proxy_add_signal(priv->dbus_proxy_session, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(priv->dbus_proxy_session, "NameOwnerChanged", - G_CALLBACK(dbus_owner_change), listener, NULL); - dbus_g_proxy_add_signal(priv->dbus_proxy_system, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(priv->dbus_proxy_system, "NameOwnerChanged", - G_CALLBACK(dbus_owner_change), listener, NULL); - - /* Initialize Data structures */ - priv->proxies_working = NULL; - priv->proxies_possible = NULL; - - /* TODO: Look at some common scenarios and find out how to make this sized */ - priv->proxy_todo = g_array_new(FALSE, TRUE, sizeof(proxy_todo_t)); - priv->todo_idle = 0; - - /* WARNING */ - /* Starting massive asynchronisity */ - /* */ - - /* Build todo list */ - org_freedesktop_DBus_list_names_async (priv->dbus_proxy_session, build_todo_list_cb, listener); - org_freedesktop_DBus_list_names_async (priv->dbus_proxy_system, build_todo_list_cb, listener); - - return; -} - -static void -indicate_listener_finalize (GObject * obj) -{ - IndicateListener * listener = INDICATE_LISTENER(obj); - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - - if (priv->todo_idle != 0) { - g_idle_remove_by_data(obj); - } - /* Hack: proxy_struct_destroy() lacks a user_data parameter, but since the - * caller is responsible for handling params on the stack, it works - */ - g_list_foreach(priv->proxies_possible, (GFunc)proxy_struct_destroy, NULL); - g_list_free(priv->proxies_possible); - g_list_foreach(priv->proxies_working, (GFunc)proxy_struct_destroy, NULL); - g_list_free(priv->proxies_working); - G_OBJECT_CLASS (indicate_listener_parent_class)->finalize (obj); - return; -} - -IndicateListener * -indicate_listener_new (void) -{ - IndicateListener * listener; - listener = g_object_new(INDICATE_TYPE_LISTENER, NULL); - return listener; -} - -static IndicateListener * default_indicate_listener = NULL; - -IndicateListener * -indicate_listener_ref_default (void) -{ - if (default_indicate_listener != NULL) { - g_object_ref(default_indicate_listener); - } else { - default_indicate_listener = g_object_new(INDICATE_TYPE_LISTENER, NULL); - g_object_add_weak_pointer(G_OBJECT(default_indicate_listener), - (gpointer *)&default_indicate_listener); - } - - return default_indicate_listener; -} - -static void -dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateListener * listener) -{ - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - - DBusGConnection * bus; - gchar * bus_name; - if (proxy == priv->dbus_proxy_system) { - bus = priv->system_bus; - bus_name = "system"; - } else { - bus = priv->session_bus; - bus_name = "session"; - } - - /* g_debug("Name change on %s bus: '%s' from '%s' to '%s'", bus_name, name, prev, new); */ - - if (prev != NULL && prev[0] == '\0') { - todo_list_add(name, proxy, listener, FALSE); - } - if (new != NULL && new[0] == '\0') { - proxy_t searchitem; - searchitem.connection = bus; - searchitem.name = (gchar *)name; /* Droping const, not that it isn't, but to remove the warning */ - - GList * proxyt_item; - proxyt_item = g_list_find_custom(priv->proxies_working, &searchitem, proxy_t_equal); - if (proxyt_item != NULL) { - proxy_struct_destroy((proxy_t *)proxyt_item->data); - priv->proxies_working = g_list_remove(priv->proxies_working, proxyt_item->data); - } - proxyt_item = g_list_find_custom(priv->proxies_possible, &searchitem, proxy_t_equal); - if (proxyt_item != NULL) { - proxy_struct_destroy((proxy_t *)proxyt_item->data); - priv->proxies_possible = g_list_remove(priv->proxies_possible, proxyt_item->data); - } - } - - return; -} - -static void -proxy_struct_destroy_indicators (gpointer key, gpointer value, gpointer data) -{ - gchar * type = (gchar *)key; - GHashTable * indicators = (GHashTable *)value; - proxy_t * proxy_data = data; - - GList * keys = g_hash_table_get_keys(indicators); - GList * indicator; - for (indicator = keys; indicator != NULL; indicator = indicator->next) { - guint id = (guint)indicator->data; - g_signal_emit(proxy_data->listener, signals[INDICATOR_REMOVED], 0, &proxy_data->server, GUINT_TO_POINTER(id), type, TRUE); - } - g_list_free(keys); - - g_hash_table_remove_all(indicators); - return; -} - -static void -proxy_struct_destroy (gpointer data) -{ - proxy_t * proxy_data = data; - - /* TODO: Clear the indicators by signaling */ - if (proxy_data->indicators != NULL) { - g_hash_table_foreach(proxy_data->indicators, - proxy_struct_destroy_indicators, - proxy_data); - g_hash_table_remove_all(proxy_data->indicators); - - g_signal_emit(proxy_data->listener, signals[SERVER_REMOVED], 0, &proxy_data->server, proxy_data->type, TRUE); - proxy_data->indicators = NULL; - } - - if (DBUS_IS_G_PROXY(proxy_data->property_proxy)) { - g_object_unref(G_OBJECT(proxy_data->property_proxy)); - } - - if (DBUS_IS_G_PROXY(proxy_data->proxy)) { - g_object_unref(G_OBJECT(proxy_data->proxy)); - } - - g_free(proxy_data->name); - if (proxy_data->type != NULL) { - g_free(proxy_data->type); - } - g_free(proxy_data); - - return; -} - -static void -build_todo_list_cb (DBusGProxy * proxy, char ** names, GError * error, void * data) -{ - IndicateListener * listener = INDICATE_LISTENER(data); - - if (error != NULL) { - g_warning("Unable to get names: %s", error->message); - return; - } - - guint i = 0; - for (i = 0; names[i] != NULL; i++) { - todo_list_add(names[i], proxy, listener, TRUE); - } - - return; -} - -static void -todo_list_add (const gchar * name, DBusGProxy * proxy, IndicateListener * listener, gboolean startup) -{ - if (name == NULL || name[0] != ':') { - return; - } - - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - - DBusGConnection * bus; - gchar * bus_name; - if (proxy == priv->dbus_proxy_system) { - bus = priv->system_bus; - bus_name = "system"; - } else { - bus = priv->session_bus; - bus_name = "session"; - } - /* g_debug ("Adding on %s bus: %s", bus_name, name); */ - - proxy_todo_t todo; - todo.name = g_strdup(name); - todo.bus = bus; - todo.startup = startup; - - g_array_append_val(priv->proxy_todo, todo); - - if (priv->todo_idle == 0) { - priv->todo_idle = g_idle_add(todo_idle, listener); - } - - return; -} - -gboolean -todo_idle (gpointer data) -{ - IndicateListener * listener = INDICATE_LISTENER(data); - if (listener == NULL) { - g_error("Listener got lost in todo_idle"); - return FALSE; - } - - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - - if (priv->proxy_todo->len == 0) { - /* Basically if we have no todo, we need to stop running. This - * is done this way to make the function error handling simpler - * and results in an extra run */ - priv->todo_idle = 0; - return FALSE; - } - - proxy_todo_t * todo = &g_array_index(priv->proxy_todo, proxy_todo_t, priv->proxy_todo->len - 1); - - proxy_t * proxyt = g_new0(proxy_t, 1); - proxyt->name = todo->name; - proxyt->type = NULL; - proxyt->proxy = dbus_g_proxy_new_for_name(todo->bus, - proxyt->name, - "/org/freedesktop/indicate", - "org.freedesktop.indicator"); - proxyt->property_proxy = NULL; - proxyt->listener = listener; - proxyt->indicators = NULL; - proxyt->connection = todo->bus; - proxyt->server.name = todo->name; - proxyt->server.proxy = proxyt->proxy; - proxyt->server.connection = proxyt->connection; - - priv->proxy_todo = g_array_remove_index(priv->proxy_todo, priv->proxy_todo->len - 1); - - if (proxyt->proxy == NULL) { - g_warning("Unable to create proxy for %s", proxyt->name); - return TRUE; - } - - dbus_g_proxy_add_signal(proxyt->proxy, "ServerShow", - G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(proxyt->proxy, "ServerShow", - G_CALLBACK(proxy_server_added), proxyt, NULL); - - priv->proxies_possible = g_list_prepend(priv->proxies_possible, proxyt); - - /* Look through the introspection data to see if this - is already a server */ - introspect_this (NULL, NULL, NULL, proxyt); - - return TRUE; -} - -static void -get_type_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - if (type == NULL) { - /* This is usually caused by an error getting the type, - * which would mean that this isn't an indicator server */ - return; - } - - proxy_t * proxyt = (proxy_t *)data; - - proxy_server_added (proxyt->proxy, type, proxyt); - org_freedesktop_indicator_get_indicator_list_async(proxyt->proxy, proxy_get_indicator_list, proxyt); - - return; -} - -typedef struct { - guint id; - proxy_t * proxyt; -} indicator_type_t; - -static void -proxy_get_indicator_list (DBusGProxy * proxy, GArray * indicators, GError * error, gpointer data) -{ - if (error != NULL) { - return; - } - - proxy_t * proxyt = (proxy_t *)data; - - int i; - for (i = 0; i < indicators->len; i++) { - indicator_type_t * itt = g_new(indicator_type_t, 1); - itt->id = g_array_index(indicators, guint, i); - itt->proxyt = proxyt; - - org_freedesktop_indicator_get_indicator_property_async(proxyt->proxy, itt->id, "type", proxy_get_indicator_type, itt); - } - - return; -} - -static void -proxy_get_indicator_type (DBusGProxy * proxy, gchar * type, GError * error, gpointer data) -{ - if (error != NULL) { - g_warning("Get Indicator Type returned error: %s", error->message); - return; - } - - indicator_type_t * itt = (indicator_type_t *)data; - guint id = itt->id; - proxy_t * proxyt = itt->proxyt; - - g_free(itt); - - return proxy_indicator_added(proxy, id, type, proxyt); -} - -static void -proxy_server_added (DBusGProxy * proxy, const gchar * type, proxy_t * proxyt) -{ - if (proxyt->indicators == NULL) { - proxyt->indicators = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, proxy_indicators_free); - /* Elevate to working */ - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(proxyt->listener); - - GList * proxyt_item; - proxyt_item = g_list_find_custom(priv->proxies_possible, proxyt, proxy_t_equal); - if (proxyt_item != NULL) { - priv->proxies_possible = g_list_remove(priv->proxies_possible, proxyt_item->data); - } - priv->proxies_working = g_list_prepend(priv->proxies_working, proxyt); - - dbus_g_proxy_add_signal(proxyt->proxy, "IndicatorAdded", - G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(proxyt->proxy, "IndicatorAdded", - G_CALLBACK(proxy_indicator_added), proxyt, NULL); - dbus_g_proxy_add_signal(proxyt->proxy, "IndicatorRemoved", - G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(proxyt->proxy, "IndicatorRemoved", - G_CALLBACK(proxy_indicator_removed), proxyt, NULL); - dbus_g_proxy_add_signal(proxyt->proxy, "IndicatorModified", - G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal(proxyt->proxy, "IndicatorModified", - G_CALLBACK(proxy_indicator_modified), proxyt, NULL); - - if (type != NULL) { - if (proxyt->type != NULL) { - g_free(proxyt->type); - } - proxyt->type = g_strdup(type); - } - - g_signal_emit(proxyt->listener, signals[SERVER_ADDED], 0, &proxyt->server, proxyt->type, TRUE); - } - - return; -} - -static void -proxy_indicator_added (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt) -{ - if (proxyt->indicators == NULL) { - proxy_server_added (proxy, NULL, proxyt); - } - - GHashTable * indicators = g_hash_table_lookup(proxyt->indicators, type); - - if (indicators == NULL) { - indicators = g_hash_table_new(g_direct_hash, g_direct_equal); - g_hash_table_insert(proxyt->indicators, g_strdup(type), indicators); - } - - if (!g_hash_table_lookup(indicators, (gpointer)id)) { - g_hash_table_insert(indicators, (gpointer)id, (gpointer)TRUE); - g_signal_emit(proxyt->listener, signals[INDICATOR_ADDED], 0, &proxyt->server, GUINT_TO_POINTER(id), type, TRUE); - } - - return; -} - -static void -proxy_indicator_removed (DBusGProxy * proxy, guint id, const gchar * type, proxy_t * proxyt) -{ - if (proxyt->indicators == NULL) { - g_warning("Oddly we had an indicator removed from an interface that we didn't think had indicators."); - return; - } - - GHashTable * indicators = g_hash_table_lookup(proxyt->indicators, type); - if (indicators == NULL) { - g_warning("Can not remove indicator %d of type '%s' as there are no indicators of that type on %s.", id, type, proxyt->name); - return; - } - - if (!g_hash_table_lookup(indicators, (gpointer)id)) { - g_warning("No indicator %d of type '%s' on '%s'.", id, type, proxyt->name); - return; - } - - g_hash_table_remove(indicators, (gpointer)id); - g_signal_emit(proxyt->listener, signals[INDICATOR_REMOVED], 0, &proxyt->server, GUINT_TO_POINTER(id), type, TRUE); - - return; -} - -static void -proxy_indicator_modified (DBusGProxy * proxy, guint id, const gchar * property, proxy_t * proxyt) -{ - if (proxyt->indicators == NULL) { - g_warning("Oddly we had an indicator modified from an interface that we didn't think had indicators."); - return; - } - - GList * keys = g_hash_table_get_keys(proxyt->indicators); - GList * inc = NULL; - gchar * type; - - for (inc = g_list_first(keys); inc != NULL; inc = g_list_next(inc)) { - type = (gchar *)inc->data; - - GHashTable * indicators = g_hash_table_lookup(proxyt->indicators, type); - if (indicators == NULL) continue; /* no indicators for this type? Odd, but not an error */ - - if (g_hash_table_lookup(indicators, (gpointer)id)) { - break; - } - } - - if (inc == NULL) { - g_warning("Can not modify indicator %d with property '%s' as there are no indicators with that id on %s.", id, property, proxyt->name); - return; - } - - g_signal_emit(proxyt->listener, signals[INDICATOR_MODIFIED], 0, &proxyt->server, GUINT_TO_POINTER(id), type, property, TRUE); - - return; -} - -static void -proxy_indicators_free (gpointer data) -{ - GHashTable * table = (GHashTable *)data; - - if (g_hash_table_size(table) != 0) { - g_warning("Clearning a set of indicators that wasn't signaled!"); - } - - g_hash_table_unref(table); - return; -} - -typedef enum _get_property_type get_property_type; -enum _get_property_type { - PROPERTY_TYPE_STRING, - PROPERTY_TYPE_TIME -}; - -typedef struct _get_property_t get_property_t; -struct _get_property_t { - GCallback cb; - gpointer data; - IndicateListener * listener; - IndicateListenerServer * server; - IndicateListenerIndicator * indicator; - gchar * property; - get_property_type type; -}; - -static void -get_property_cb (DBusGProxy *proxy, char * OUT_value, GError *error, gpointer userdata) -{ - get_property_t * get_property_data = (get_property_t *)userdata; - - if (error != NULL) { - g_warning("Unable to get property data: %s", error->message); - g_error_free(error); - return; - } - - switch (get_property_data->type) { - case PROPERTY_TYPE_STRING: { - indicate_listener_get_property_cb cb = (indicate_listener_get_property_cb)get_property_data->cb; - cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, OUT_value, get_property_data->data); - break; - } - case PROPERTY_TYPE_TIME: { - indicate_listener_get_property_time_cb cb = (indicate_listener_get_property_time_cb)get_property_data->cb; - GTimeVal time; - if (g_time_val_from_iso8601(OUT_value, &time)) { - cb(get_property_data->listener, get_property_data->server, get_property_data->indicator, get_property_data->property, &time, get_property_data->data); - } - break; - } - } - - g_free(get_property_data->property); - g_free(get_property_data); - - return; -}; - -static void -get_property_helper (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GCallback callback, gpointer data, get_property_type prop_type) -{ - /* g_debug("get_property_helper: %s %d", property, prop_type); */ - /* TODO: Do we need to somehow refcount the server/indicator while we're waiting on this? */ - get_property_t * get_property_data = g_new(get_property_t, 1); - get_property_data->cb = callback; - get_property_data->data = data; - get_property_data->listener = listener; - get_property_data->server = server; - get_property_data->indicator = indicator; - get_property_data->property = g_strdup(property); - get_property_data->type = prop_type; - - org_freedesktop_indicator_get_indicator_property_async (server->proxy , INDICATE_LISTENER_INDICATOR_ID(indicator), property, get_property_cb, get_property_data); - return; -} - -void -indicate_listener_get_property (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, indicate_listener_get_property_cb callback, gpointer data) -{ - return get_property_helper(listener, server, indicator, property, G_CALLBACK(callback), data, PROPERTY_TYPE_STRING); -} - -void -indicate_listener_get_property_time (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, indicate_listener_get_property_time_cb callback, gpointer data) -{ - return get_property_helper(listener, server, indicator, property, G_CALLBACK(callback), data, PROPERTY_TYPE_TIME); -} - -gboolean -_indicate_listener_get_indicator_servers (IndicateListener * listener, GList * servers) -{ - - return TRUE; -} - -static void -listener_display_cb (DBusGProxy *proxy, GError *error, gpointer userdata) -{ - if (error != NULL) { - g_warning("Listener display caused an error: %s", error->message); - } - return; -} - -void -indicate_listener_display (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator) -{ - org_freedesktop_indicator_show_indicator_to_user_async (server->proxy, INDICATE_LISTENER_INDICATOR_ID(indicator), listener_display_cb, NULL); - - return; -} - -typedef struct { - IndicateListener * listener; - IndicateListenerServer * server; - indicate_listener_get_server_property_cb cb; - gpointer data; -} property_cb_t; - -static void -property_cb (DBusGProxy * proxy, DBusGProxyCall * call, void * data) -{ - /* g_debug("Callback for property %s %s %s", dbus_g_proxy_get_bus_name(proxy), dbus_g_proxy_get_path(proxy), dbus_g_proxy_get_interface(proxy)); */ - property_cb_t * propertyt = data; - GError * error = NULL; - - GValue property = {0}; - - dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_VALUE, &property, G_TYPE_INVALID); - if (error != NULL) { - /* g_warning("Unable to get property: %s", error->message); */ - g_error_free(error); - g_free(propertyt); - return; - } - - if (!G_VALUE_HOLDS_STRING(&property)) { - g_warning("Property returned is not a string!"); - g_free(propertyt); - return; - } - - IndicateListener * listener = propertyt->listener; - IndicateListenerServer * server = propertyt->server; - indicate_listener_get_server_property_cb cb = propertyt->cb; - gpointer cb_data = propertyt->data; - - g_free(propertyt); - - gchar * propstr = g_value_dup_string(&property); - - /* g_debug("\tProperty value: %s", propstr); */ - - return cb(listener, server, propstr, cb_data); -} - -static void -get_server_property (IndicateListener * listener, IndicateListenerServer * server, indicate_listener_get_server_property_cb callback, const gchar * property_name, gpointer data) -{ - /* g_debug("Setting up callback for property %s on %s", property_name, INDICATE_LISTENER_SERVER_DBUS_NAME(server)); */ - IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener); - - proxy_t searchitem; - searchitem.name = server->name; - searchitem.connection = server->connection; - - GList * proxyitem = g_list_find_custom(priv->proxies_possible, &searchitem, proxy_t_equal); - if (proxyitem == NULL) { - proxyitem = g_list_find_custom(priv->proxies_working, &searchitem, proxy_t_equal); - } - - if (proxyitem == NULL) { - g_warning("Can not find a proxy for the server at all."); - return; - } - - proxy_t * proxyt = (proxy_t *)proxyitem->data; - - if (proxyt->property_proxy == NULL) { - proxyt->property_proxy = dbus_g_proxy_new_for_name(proxyt->connection, - proxyt->name, - "/org/freedesktop/indicate", - DBUS_INTERFACE_PROPERTIES); - } - - property_cb_t * localdata = g_new(property_cb_t, 1); - localdata->listener = listener; - localdata->server = server; - localdata->cb = callback; - localdata->data = data; - - dbus_g_proxy_begin_call (proxyt->property_proxy, - "Get", - property_cb, - localdata, - NULL, - G_TYPE_STRING, "org.freedesktop.indicator", - G_TYPE_STRING, property_name, - G_TYPE_INVALID, G_TYPE_VALUE, G_TYPE_INVALID); - - return; -} - -void -indicate_listener_server_get_type (IndicateListener * listener, IndicateListenerServer * server, indicate_listener_get_server_property_cb callback, gpointer data) -{ - return get_server_property(listener, server, callback, "type", data); -} - -void -indicate_listener_server_get_desktop (IndicateListener * listener, IndicateListenerServer * server, indicate_listener_get_server_property_cb callback, gpointer data) -{ - return get_server_property(listener, server, callback, "desktop", data); -} - -const gchar * -indicate_listener_server_get_dbusname (IndicateListenerServer * server) -{ - if (server == NULL) return NULL; - return server->name; -} - -guint -indicate_listener_indicator_get_id (IndicateListenerIndicator * indicator) -{ - return GPOINTER_TO_UINT(indicator); -} - -static const gchar * -interest_to_string (IndicateInterests interest) -{ - switch (interest) { - case INDICATE_INTEREST_SERVER_DISPLAY: - return INDICATE_INTEREST_STRING_SERVER_DISPLAY; - case INDICATE_INTEREST_SERVER_SIGNAL: - return INDICATE_INTEREST_STRING_SERVER_SIGNAL; - case INDICATE_INTEREST_INDICATOR_DISPLAY: - return INDICATE_INTEREST_STRING_INDICATOR_DISPLAY; - case INDICATE_INTEREST_INDICATOR_SIGNAL: - return INDICATE_INTEREST_STRING_INDICATOR_SIGNAL; - case INDICATE_INTEREST_INDICATOR_COUNT: - return INDICATE_INTEREST_STRING_INDICATOR_COUNT; - default: - return ""; - } -} - -static void -interest_cb (DBusGProxy *proxy, GError *error, gpointer userdata) -{ - if (error != NULL) { - g_warning("Unable to configure interest."); - } - - return; -} - -void -indicate_listener_server_show_interest (IndicateListener * listener, IndicateListenerServer * server, IndicateInterests interest) -{ - if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) { - return; - } - - if (!server->interests[interest]) { - org_freedesktop_indicator_show_interest_async (server->proxy, interest_to_string(interest), interest_cb, server); - server->interests[interest] = TRUE; - } - return; -} - -void -indicate_listener_server_remove_interest (IndicateListener * listener, IndicateListenerServer * server, IndicateInterests interest) -{ - if (server->interests[interest]) { - org_freedesktop_indicator_remove_interest_async (server->proxy, interest_to_string(interest), interest_cb, server); - server->interests[interest] = FALSE; - } - return; -} - -gboolean -indicate_listener_server_check_interest (IndicateListener * listener, IndicateListenerServer * server, IndicateInterests interest) -{ - return server->interests[interest]; -} - -GType -indicate_listener_server_get_gtype (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_pointer_type_register_static ("IndicateListenerServer"); - - return our_type; -} - -GType -indicate_listener_indicator_get_gtype (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_pointer_type_register_static ("IndicateListenerIndicator"); - - return our_type; -} - -static const gchar * _introspector_path[] = {"", "org", "freedesktop", "indicate", NULL}; -static const gchar * _introspector_fullpath[] = {"/", "/org", "/org/freedesktop", "/org/freedesktop/indicate", NULL}; -static const gchar * _introspector_interface = "org.freedesktop.indicator"; - -static void -introspect_this (DBusGProxy * proxy, char * OUT_data, GError * error, gpointer data) -{ - /* g_debug("Introspect this:\n%s", OUT_data); */ - proxy_t * server = (proxy_t *)data; - if (proxy != NULL) { - g_object_unref(proxy); - } - if (error != NULL) { - /* We probably couldn't introspect that far up. That's - life, it happens. Or there's a timeout, that happens - too, I guess some apps are too busy for us. */ - /* g_debug("Introspection error on %s object %s: %s", server->name, _introspector_fullpath[server->introspect_level], error->message); */ - return; - } - - if (OUT_data != NULL) { - xmlDocPtr xmldoc; - /* Parse the XML */ - xmldoc = xmlReadMemory(OUT_data, g_utf8_strlen(OUT_data, 16*1024), "introspection.xml", NULL, 0); - - /* Check for root being "node" */ - xmlNodePtr root = xmlDocGetRootElement(xmldoc); - if (g_strcmp0(root->name, "node") != 0) { - xmlFreeDoc(xmldoc); - g_warning("Introspection data from %s is not valid: %s", server->name, OUT_data); - return; - } - - server->introspect_level += 1; - const gchar * nodename = NULL; - const gchar * nameval = NULL; - if (_introspector_path[server->introspect_level] == NULL) { - /* We're looking for our interface */ - nodename = "interface"; - nameval = _introspector_interface; - } else { - /* We're looking for our next node */ - nodename = "node"; - nameval = _introspector_path[server->introspect_level]; - } - - gboolean found = FALSE; - xmlNodePtr children; - for (children = root->children; children != NULL; children = children->next) { - gchar * xmlnameval = NULL; - if (g_strcmp0(children->name, nodename) == 0) { - xmlAttrPtr attrib; - for (attrib = children->properties; attrib != NULL; attrib = attrib->next) { - if (g_strcmp0(attrib->name, "name") == 0) { - if (attrib->children != NULL) { - xmlnameval = attrib->children->content; - } - break; - } - } - - if (!g_strcmp0(nameval, xmlnameval)) { - found = TRUE; - break; - } - } - } - - xmlFreeDoc(xmldoc); - - if (!found) { - /* Ah, nothing we're interested in */ - return; - } - - if (_introspector_path[server->introspect_level] == NULL) { - /* If we've found the interface at the end of the tree, whoo! hoo! */ - /* Now we know it's safe to get the type on it */ - indicate_listener_server_get_type(server->listener, &server->server, get_type_cb, server); - return; - } - } else { - server->introspect_level = 0; - } - - DBusGProxy * newproxy = dbus_g_proxy_new_for_name(server->connection, - server->name, - _introspector_fullpath[server->introspect_level], - DBUS_INTERFACE_INTROSPECTABLE); - - org_freedesktop_DBus_Introspectable_introspect_async(newproxy, introspect_this, server); - - return; -} diff --git a/libindicate/listener.h b/libindicate/listener.h deleted file mode 100644 index 37cda03..0000000 --- a/libindicate/listener.h +++ /dev/null @@ -1,132 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_LISTENER_H_INCLUDED__ -#define INDICATE_LISTENER_H_INCLUDED__ 1 - -#include <glib.h> -#include <glib-object.h> - -#include "indicator.h" -#include "server.h" -#include "interests.h" - -G_BEGIN_DECLS - -/* Boilerplate */ -#define INDICATE_TYPE_LISTENER (indicate_listener_get_type ()) -#define INDICATE_LISTENER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_LISTENER, IndicateListener)) -#define INDICATE_IS_LISTENER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_LISTENER)) -#define INDICATE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_LISTENER, IndicateListenerClass)) -#define INDICATE_IS_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_LISTENER)) -#define INDICATE_LISTENER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_LISTENER, IndicateListenerClass)) - -#define INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED "indicator-added" -#define INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED "indicator-removed" -#define INDICATE_LISTENER_SIGNAL_INDICATOR_MODIFIED "indicator-modified" -#define INDICATE_LISTENER_SIGNAL_SERVER_ADDED "server-added" -#define INDICATE_LISTENER_SIGNAL_SERVER_REMOVED "server-removed" - -#define INDICATE_LISTENER_SERVER_DBUS_NAME(server) (indicate_listener_server_get_dbusname(server)) -#define INDICATE_LISTENER_INDICATOR_ID(indicator) (indicate_listener_indicator_get_id(indicator)) - -typedef struct _IndicateListenerServer IndicateListenerServer; -#define INDICATE_TYPE_LISTENER_SERVER (indicate_listener_server_get_gtype ()) -GType indicate_listener_server_get_gtype (void) G_GNUC_CONST; - -typedef struct _IndicateListenerIndicator IndicateListenerIndicator; -#define INDICATE_TYPE_LISTENER_INDICATOR (indicate_listener_indicator_get_gtype ()) -GType indicate_listener_indicator_get_gtype (void) G_GNUC_CONST; - -typedef struct _IndicateListener IndicateListener; -struct _IndicateListener { - GObject parent; -}; - -typedef struct _IndicateListenerClass IndicateListenerClass; -struct _IndicateListenerClass { - GObjectClass parent; - - /* Signals */ - void (* indicator_added) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type); - void (* indicator_removed) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type); - void (* indicator_modified) (IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gchar * property); - - void (* server_added) (IndicateListenerServer * server, gchar * type); - void (* server_removed) (IndicateListenerServer * server, gchar * type); -}; - -GType indicate_listener_get_type (void) G_GNUC_CONST; - -typedef void (*indicate_listener_get_property_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, gchar * propertydata, gpointer data); -typedef void (*indicate_listener_get_property_time_cb) (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, GTimeVal * propertydata, gpointer data); -typedef void (*indicate_listener_get_server_property_cb) (IndicateListener * listener, IndicateListenerServer * server, gchar * value, gpointer data); - -/* Create a new listener */ -IndicateListener * indicate_listener_new (void); -IndicateListener * indicate_listener_ref_default (void); -void indicate_listener_get_property (IndicateListener * listener, - IndicateListenerServer * server, - IndicateListenerIndicator * indicator, - gchar * property, - indicate_listener_get_property_cb callback, - gpointer data); -void indicate_listener_get_property_time (IndicateListener * listener, - IndicateListenerServer * server, - IndicateListenerIndicator * indicator, - gchar * property, - indicate_listener_get_property_time_cb callback, - gpointer data); -void indicate_listener_display (IndicateListener * listener, - IndicateListenerServer * server, - IndicateListenerIndicator * indicator); -void indicate_listener_server_get_type (IndicateListener * listener, - IndicateListenerServer * server, - indicate_listener_get_server_property_cb callback, - gpointer data); -void indicate_listener_server_get_desktop (IndicateListener * listener, - IndicateListenerServer * server, - indicate_listener_get_server_property_cb callback, - gpointer data); -const gchar * indicate_listener_server_get_dbusname (IndicateListenerServer * server); -guint indicate_listener_indicator_get_id (IndicateListenerIndicator * indicator); -void indicate_listener_server_show_interest (IndicateListener * listener, - IndicateListenerServer * server, - IndicateInterests interest); -void indicate_listener_server_remove_interest (IndicateListener * listener, - IndicateListenerServer * server, - IndicateInterests interest); -gboolean indicate_listener_server_check_interest (IndicateListener * listener, - IndicateListenerServer * server, - IndicateInterests interest); - -G_END_DECLS - -#endif /* INDICATE_LISTENER_H_INCLUDED__ */ - diff --git a/libindicate/server-marshal.list b/libindicate/server-marshal.list deleted file mode 100644 index 540f0fe..0000000 --- a/libindicate/server-marshal.list +++ /dev/null @@ -1,29 +0,0 @@ -# A library to allow applictions to provide simple indications of -# information to be displayed to users of the application through the -# interface shell. -# -# Copyright 2009 Canonical Ltd. -# -# Authors: -# Ted Gould <ted@canonical.com> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of either or both of the following licenses: -# -# 1) the GNU Lesser General Public License version 3, as published by the -# Free Software Foundation; and/or -# 2) the GNU Lesser General Public License version 2.1, as published by -# the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranties of -# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the applicable version of the GNU Lesser General Public -# License for more details. -# -# You should have received a copy of both the GNU Lesser General Public -# License version 3 and version 2.1 along with this program. If not, see -# <http://www.gnu.org/licenses/> -# -# IndicatorAdded -VOID:UINT,STRING diff --git a/libindicate/server.c b/libindicate/server.c deleted file mode 100644 index e1e3479..0000000 --- a/libindicate/server.c +++ /dev/null @@ -1,1516 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#include "server.h" -#include "interests-priv.h" -#include "server-marshal.h" -#include <dbus/dbus-glib.h> -#include <dbus/dbus-glib-lowlevel.h> - -/* Errors */ -enum { - NO_GET_DESKTOP, - NO_GET_INDICATOR_COUNT, - NO_GET_INDICATOR_COUNT_BY_TYPE, - NO_GET_INDICATOR_LIST, - NO_GET_INDICATOR_LIST_BY_TYPE, - NO_GET_INDICATOR_PROPERTY, - NO_GET_INDICATOR_PROPERTY_GROUP, - NO_GET_INDICATOR_PROPERTIES, - NO_SHOW_INDICATOR_TO_USER, - INVALID_INDICATOR_ID, - NO_SHOW_INTEREST, - NO_REMOVE_INTEREST, - SHOW_INTEREST_FAILED, - REMOVE_INTEREST_FAILED, - LAST_ERROR -}; - -/* Signals */ -enum { - INDICATOR_ADDED, - INDICATOR_REMOVED, - INDICATOR_MODIFIED, - SERVER_SHOW, - SERVER_HIDE, - SERVER_DISPLAY, - INTEREST_ADDED, - INTEREST_REMOVED, - LAST_SIGNAL -}; - -/* Properties */ -enum { - PROP_0, - PROP_DESKTOP, - PROP_TYPE -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -/* Private area */ -typedef struct _IndicateServerPrivate IndicateServerPrivate; -struct _IndicateServerPrivate -{ - DBusGConnection *connection; - DBusGProxy * dbus_proxy; - - gchar * path; - GSList * indicators; - gboolean visible; - guint current_id; - gboolean registered; - - gchar * desktop; - gchar * type; - - // TODO: Should have a more robust way to track this, but this'll work for now - guint num_hidden; - - gboolean interests[INDICATE_INTEREST_LAST]; - GList * interestedfolks; -}; - -#define INDICATE_SERVER_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATE_TYPE_SERVER, IndicateServerPrivate)) - -typedef struct _IndicateServerInterestedFolk IndicateServerInterestedFolk; -struct _IndicateServerInterestedFolk { - gchar * sender; - gboolean interests[INDICATE_INTEREST_LAST]; -}; - - -/* Define Type */ -G_DEFINE_TYPE (IndicateServer, indicate_server, G_TYPE_OBJECT); - -/* Prototypes */ -static void indicate_server_finalize (GObject * obj); -static gboolean get_indicator_count (IndicateServer * server, guint * count, GError **error); -static gboolean get_indicator_count_by_type (IndicateServer * server, gchar * type, guint * count, GError **error); -static gboolean get_indicator_list (IndicateServer * server, GArray ** indicators, GError ** error); -static gboolean get_indicator_list_by_type (IndicateServer * server, gchar * type, GArray ** indicators, GError ** error); -static gboolean get_indicator_property (IndicateServer * server, guint id, gchar * property, gchar ** value, GError **error); -static gboolean get_indicator_property_group (IndicateServer * server, guint id, GPtrArray * properties, gchar *** value, GError **error); -static gboolean get_indicator_properties (IndicateServer * server, guint id, gchar *** properties, GError **error); -static gboolean show_indicator_to_user (IndicateServer * server, guint id, GError ** error); -static void dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateServer * server); -static guint get_next_id (IndicateServer * server); -static void set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec); -static void get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec); -static gboolean show_interest (IndicateServer * server, gchar * sender, IndicateInterests interest); -static gboolean remove_interest (IndicateServer * server, gchar * sender, IndicateInterests interest); -static gboolean check_interest (IndicateServer * server, IndicateInterests intrest); -static gint indicate_server_interested_folks_equal (gconstpointer a, gconstpointer b); -static void indicate_server_interested_folks_init (IndicateServerInterestedFolk * folk, gchar * sender); -static void indicate_server_interested_folks_set (IndicateServerInterestedFolk * folk, IndicateInterests interest, gboolean value); -static void indicate_server_interested_folks_copy (IndicateServerInterestedFolk * folk, gboolean * interests); -static void indicate_server_interested_folks_destroy(IndicateServerInterestedFolk * folk); - -/* DBus API */ -gboolean _indicate_server_get_indicator_count (IndicateServer * server, guint * count, GError **error); -gboolean _indicate_server_get_indicator_count_by_type (IndicateServer * server, gchar * type, guint * count, GError **error); -gboolean _indicate_server_get_indicator_list (IndicateServer * server, GArray ** indicators, GError ** error); -gboolean _indicate_server_get_indicator_list_by_type (IndicateServer * server, gchar * type, GArray ** indicators, GError ** error); -gboolean _indicate_server_get_indicator_property (IndicateServer * server, guint id, gchar * property, gchar ** value, GError **error); -gboolean _indicate_server_get_indicator_property_group (IndicateServer * server, guint id, GPtrArray * properties, gchar *** value, GError **error); -gboolean _indicate_server_get_indicator_properties (IndicateServer * server, guint id, gchar *** properties, GError **error); -gboolean _indicate_server_show_indicator_to_user (IndicateServer * server, guint id, GError ** error); -gboolean _indicate_server_show_interest (IndicateServer * server, gchar * interest, DBusGMethodInvocation * method); -gboolean _indicate_server_remove_interest (IndicateServer * server, gchar * interest, DBusGMethodInvocation * method); - -/* Has to be after the dbus prototypes */ -#include "dbus-indicate-server.h" - - - -/* Code */ -static void -indicate_server_class_init (IndicateServerClass * class) -{ - /* g_debug("Server Class Initialized"); */ - GObjectClass * gobj; - gobj = G_OBJECT_CLASS(class); - - g_type_class_add_private (class, sizeof (IndicateServerPrivate)); - - gobj->finalize = indicate_server_finalize; - gobj->set_property = set_property; - gobj->get_property = get_property; - - /** - IndicateServer::indicator-added: - @arg0: The #IndicateServer object - @arg1: The #IndicateIndicator ID number - @arg2: The type of the indicator - - Emitted every time that a new indicator is made visible to - the world. This results in a signal on DBus. - - Can be emitted by subclasses using indicate_server_emit_indicator_added() - */ - signals[INDICATOR_ADDED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_ADDED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, indicator_added), - NULL, NULL, - _indicate_server_marshal_VOID__UINT_STRING, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - /** - IndicateServer::indicator-removed: - @arg0: The #IndicateServer object - @arg1: The #IndicateIndicator ID number - @arg2: The type of the indicator - - Emitted every time that a new indicator is made invisible to - the world. This results in a signal on DBus. - - Can be emitted by subclasses using indicate_server_emit_indicator_removed() - */ - signals[INDICATOR_REMOVED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, indicator_removed), - NULL, NULL, - _indicate_server_marshal_VOID__UINT_STRING, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - /** - IndicateServer::indicator-modified: - @arg0: The #IndicateServer object - @arg1: The #IndicateIndicator ID number - @arg2: The name of the property modified - - Emitted every time that a property on an indicator changes - and it is visible to the world. This results in a signal on DBus. - - Can be emitted by subclasses using indicate_server_emit_indicator_modified() - */ - signals[INDICATOR_MODIFIED] = g_signal_new(INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, indicator_modified), - NULL, NULL, - _indicate_server_marshal_VOID__UINT_STRING, - G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); - /** - IndicateServer::server-show: - @arg0: The #IndicateServer object - @arg1: The type of the server - - Emitted when a server comes onto DBus by being shown. This - is typically when listeners start reacting to the application's - indicators. This results in a signal on DBus. - */ - signals[SERVER_SHOW] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_SHOW, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, server_show), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - /** - IndicateServer::server-hide: - @arg0: The #IndicateServer object - @arg1: The type of the server - - Emitted when a server removes itself from DBus. This results - in a signal on DBus. - */ - signals[SERVER_HIDE] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_HIDE, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, server_hide), - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - /** - IndicateServer::server-display: - @arg0: The #IndicateServer object - - Emitted when a listener signals that the server itself should be - displayed. This signal is caused by a user clicking on the application - item in the Messaging Menu. This signal is emitted by DBus. - - Can be emitted by subclasses using indicate_server_emit_server_display() - */ - signals[SERVER_DISPLAY] = g_signal_new(INDICATE_SERVER_SIGNAL_SERVER_DISPLAY, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, server_display), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** - IndicateServer::interest-added: - @arg0: The #IndicateServer object - @arg1: The interest that was added from #IndicateInterests - - Emitted when a listener signals that they are interested in - this server for a particular reason. This signal is emitted by DBus. - */ - signals[INTEREST_ADDED] = g_signal_new(INDICATE_SERVER_SIGNAL_INTEREST_ADDED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, interest_added), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - /** - IndicateServer::interest-removed: - @arg0: The #IndicateServer object - @arg1: The interest that was removed from #IndicateInterests - - Emitted when a listener signals that they are no longer interested in - this server for a particular reason. This signal is emitted by DBus. - */ - signals[INTEREST_REMOVED] = g_signal_new(INDICATE_SERVER_SIGNAL_INTEREST_REMOVED, - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (IndicateServerClass, interest_removed), - NULL, NULL, - g_cclosure_marshal_VOID__UINT, - G_TYPE_NONE, 1, G_TYPE_UINT); - - g_object_class_install_property (gobj, PROP_DESKTOP, - g_param_spec_string("desktop", "Desktop File", - "The desktop file representing this server", - "", - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobj, PROP_TYPE, - g_param_spec_string("type", "Server Type", - "The type of indicators that this server will provide", - "", - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - dbus_g_object_type_install_info(INDICATE_TYPE_SERVER, - &dbus_glib__indicate_server_object_info); - - class->get_indicator_count = get_indicator_count; - class->get_indicator_count_by_type = get_indicator_count_by_type; - class->get_indicator_list = get_indicator_list; - class->get_indicator_list_by_type = get_indicator_list_by_type; - class->get_indicator_property = get_indicator_property; - class->get_indicator_property_group = get_indicator_property_group; - class->get_indicator_properties = get_indicator_properties; - class->show_indicator_to_user = show_indicator_to_user; - class->get_next_id = get_next_id; - class->show_interest = show_interest; - class->remove_interest = remove_interest; - class->check_interest = check_interest; - - return; -} - -static void -indicate_server_init (IndicateServer * server) -{ - /* g_debug("Server Object Initialized"); */ - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - priv->path = g_strdup("/org/freedesktop/indicate"); - priv->indicators = NULL; - priv->num_hidden = 0; - priv->visible = FALSE; - priv->registered = FALSE; - priv->current_id = 0; - priv->type = NULL; - priv->desktop = NULL; - - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - priv->interests[i] = FALSE; - } - priv->interestedfolks = NULL; - - - return; -} - -static void -indicate_server_finalize (GObject * obj) -{ - IndicateServer * server = INDICATE_SERVER(obj); - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - /* TODO: This probably shouldn't be as far down as finalize, but it's fine here. */ - if (priv->visible) { - g_signal_emit(server, signals[SERVER_HIDE], 0, priv->type ? priv->type : "", TRUE); - } - - if (priv->path) { - g_free(priv->path); - } - if (priv->desktop) { - g_free(priv->desktop); - } - if (priv->type) { - g_free(priv->type); - } - - G_OBJECT_CLASS (indicate_server_parent_class)->finalize (obj); - - return; -} - -static void -set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) -{ - g_return_if_fail(G_VALUE_HOLDS_STRING(value)); - g_return_if_fail(id == PROP_DESKTOP || id == PROP_TYPE); - - gchar ** outstr; - gchar * tempstr = NULL; - outstr = &tempstr; - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(obj); - switch (id) { - case PROP_DESKTOP: - outstr = &(priv->desktop); - break; - case PROP_TYPE: - outstr = &(priv->type); - break; - } - - if (*outstr != NULL) { - g_free(*outstr); - } - - *outstr = g_strdup(g_value_get_string(value)); - - return; -} - -static void -get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) -{ - g_return_if_fail(id == PROP_DESKTOP || id == PROP_TYPE); - - gchar * outstr = NULL; - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(obj); - switch (id) { - case PROP_DESKTOP: - outstr = priv->desktop; - break; - case PROP_TYPE: - outstr = priv->type; - break; - } - - if (outstr != NULL) { - g_value_set_string(value, outstr); - } else { - g_value_set_static_string(value, ""); - } - - return; -} - -static GQuark -indicate_server_error_quark (void) -{ - static GQuark quark = 0; - if (quark == 0) { - quark = g_quark_from_static_string (G_LOG_DOMAIN); - } - return quark; -} - -/** - indicate_server_show: - @server: The #IndicateServer to be shown - - This function exports the object onto DBus and shows it - to the world. This will be the start of it receiving external - signals from DBus. It is likely that, if there are listeners - running, there will several #IndicateServer::interest-added - signals coming shortly after this function. This function - emits the #IndicateServer::server-added signal across the bus. -*/ -void -indicate_server_show (IndicateServer * server) -{ - g_return_if_fail(INDICATE_IS_SERVER(server)); - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - if (priv->visible) - return; - - priv->connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - - if (!priv->registered) { - dbus_g_connection_register_g_object(priv->connection, - priv->path, - G_OBJECT(server)); - priv->registered = TRUE; - } - - priv->visible = TRUE; - - g_signal_emit(server, signals[SERVER_SHOW], 0, priv->type ? priv->type : "", TRUE); - - priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (priv->connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - NULL); - dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", - G_CALLBACK(dbus_owner_change), server, NULL); - - return; -} - -/** - indicate_server_hide: - @server: The #IndicateServer to hide. - - This function hides the server from DBus so that it does - not get signals anymore. This causes the signal #IndicateServer::server-hide - to be sent across the bus for all listeners. Also internally - it will signal #IndicateServer::interest-removed for all the - interests that were currently set for this server. -*/ -void -indicate_server_hide (IndicateServer * server) -{ - g_return_if_fail(INDICATE_IS_SERVER(server)); - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - if (!priv->visible) - return; - - priv->visible = FALSE; - - /* Delete interested parties */ - g_list_foreach(priv->interestedfolks, (GFunc)indicate_server_interested_folks_destroy, NULL); - g_list_free(priv->interestedfolks); - priv->interestedfolks = NULL; - - /* Signal the lack of interest */ - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - if (priv->interests[i]) { - g_signal_emit(G_OBJECT(server), signals[INTEREST_REMOVED], 0, i, TRUE); - } - priv->interests[i] = FALSE; - } - - g_signal_emit(server, signals[SERVER_HIDE], 0, priv->type ? priv->type : "", TRUE); - - if (priv->dbus_proxy != NULL) { - g_object_unref(G_OBJECT(priv->dbus_proxy)); - priv->dbus_proxy = NULL; - } - - if (priv->connection != NULL) { - dbus_g_connection_unref (priv->connection); - priv->connection = NULL; - } - - return; -} - -static void -dbus_owner_change (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, IndicateServer * server) -{ - /* g_debug("DBus Owner change (%s, %s, %s)", name, prev, new); */ - if (prev == NULL || prev[0] == '\0') { - /* We only care about people leaving the bus */ - return; - } - - /* g_debug("\tBeing removed, interesting"); */ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - IndicateServerInterestedFolk searchitem; - searchitem.sender = (gchar *)name; - GList * entry = g_list_find_custom(priv->interestedfolks, &searchitem, indicate_server_interested_folks_equal); - - if (entry == NULL) { - /* g_debug("\tWe don't have it, not interesting"); */ - return; - } - - IndicateServerInterestedFolk * folk = (IndicateServerInterestedFolk *)entry->data; - priv->interestedfolks = g_list_remove(priv->interestedfolks, entry->data); - - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - priv->interests[i] = FALSE; - } - - GList * listi = NULL; - for (listi = priv->interestedfolks ; listi != NULL ; listi = listi->next) { - IndicateServerInterestedFolk * folkpointer = (IndicateServerInterestedFolk *)listi->data; - /* g_debug("\tRebuild list from folk: %s", folkpointer->sender); */ - indicate_server_interested_folks_copy(folkpointer, priv->interests); - } - - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - /* g_debug("\tComparing interests. Interest: %d Folk: %d Everyone: %d", i, folk->interests[i], priv->interests[i]); */ - if (folk->interests[i] && !priv->interests[i]) { - /* We can only remove interest here. Think about it for a - moment and I think you'll be cool with it. */ - /* g_debug("\tOh, and it was interested in %d. Not anymore.", i); */ - g_signal_emit(G_OBJECT(server), signals[INTEREST_REMOVED], 0, i, TRUE); - } - } - - g_free(folk); - - return; -} - -static guint -get_next_id (IndicateServer * server) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - priv->current_id++; - return priv->current_id; -} - -static gboolean -show_interest (IndicateServer * server, gchar * sender, IndicateInterests interest) -{ - if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) { - return FALSE; - } - - /* g_debug("Someone is showing interest. %s in %d", sender, interest); */ - IndicateServerInterestedFolk localfolk; - localfolk.sender = sender; - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - GList * entry = g_list_find_custom(priv->interestedfolks, &localfolk, indicate_server_interested_folks_equal); - IndicateServerInterestedFolk * folkpointer = NULL; - if (entry == NULL) { - folkpointer = g_new(IndicateServerInterestedFolk, 1); - indicate_server_interested_folks_init(folkpointer, sender); - priv->interestedfolks = g_list_append(priv->interestedfolks, folkpointer); - } else { - folkpointer = (IndicateServerInterestedFolk *)entry->data; - } - - indicate_server_interested_folks_set(folkpointer, interest, TRUE); - if (!priv->interests[interest]) { - g_signal_emit(G_OBJECT(server), signals[INTEREST_ADDED], 0, interest, TRUE); - priv->interests[interest] = TRUE; - } - - return TRUE; -} - -static gboolean -remove_interest (IndicateServer * server, gchar * sender, IndicateInterests interest) -{ - if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) { - return FALSE; - } - - IndicateServerInterestedFolk localfolk; - localfolk.sender = sender; - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - GList * entry = g_list_find_custom(priv->interestedfolks, &localfolk, indicate_server_interested_folks_equal); - IndicateServerInterestedFolk * folkpointer = NULL; - if (entry == NULL) { - folkpointer = g_new(IndicateServerInterestedFolk, 1); - indicate_server_interested_folks_init(folkpointer, sender); - priv->interestedfolks = g_list_append(priv->interestedfolks, folkpointer); - } else { - folkpointer = (IndicateServerInterestedFolk *)entry->data; - } - - indicate_server_interested_folks_set(folkpointer, interest, FALSE); - - if (priv->interests[interest]) { - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - priv->interests[i] = FALSE; - } - - GList * listi = NULL; - for (listi = priv->interestedfolks ; listi != NULL ; listi = listi->next) { - folkpointer = (IndicateServerInterestedFolk *)listi->data; - indicate_server_interested_folks_copy(folkpointer, priv->interests); - } - - if (!priv->interests[interest]) { - g_signal_emit(G_OBJECT(server), signals[INTEREST_REMOVED], 0, interest, TRUE); - } - } - - return TRUE; -} - -static gboolean -check_interest (IndicateServer * server, IndicateInterests interest) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - return priv->interests[interest]; -} - -static void -indicator_show_cb (IndicateIndicator * indicator, IndicateServer * server) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - priv->num_hidden--; - g_signal_emit(server, signals[INDICATOR_ADDED], 0, indicate_indicator_get_id(indicator), indicate_indicator_get_indicator_type(indicator), TRUE); - return; -} - -static void -indicator_hide_cb (IndicateIndicator * indicator, IndicateServer * server) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - priv->num_hidden++; - g_signal_emit(server, signals[INDICATOR_REMOVED], 0, indicate_indicator_get_id(indicator), indicate_indicator_get_indicator_type(indicator), TRUE); - return; -} - -static void -indicator_modified_cb (IndicateIndicator * indicator, gchar * property, IndicateServer * server) -{ - /* g_debug("Indicator Modified: %d %s", indicate_indicator_get_id(indicator), property); */ - g_signal_emit(server, signals[INDICATOR_MODIFIED], 0, indicate_indicator_get_id(indicator), property, TRUE); -} - -/** - indicate_server_add_indicator: - @server: The #IndicateServer to add the #IndicateIndictor to. - @indicator: The #IndicateIndicator to add. - - This function adds an indicator @indicator to the list that are - watched by the server @server. This means that signals that are - emitted by the indicator will be picked up and passed via DBus onto - listeners of the application. -*/ -void -indicate_server_add_indicator (IndicateServer * server, IndicateIndicator * indicator) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - if (g_slist_find (priv->indicators, indicator) != NULL) - return; - - priv->indicators = g_slist_prepend(priv->indicators, indicator); - - if (!indicate_indicator_is_visible(indicator)) { - priv->num_hidden++; - } else { - g_signal_emit(server, signals[INDICATOR_ADDED], 0, indicate_indicator_get_id(indicator), indicate_indicator_get_indicator_type(indicator), TRUE); - } - - g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_SHOW, G_CALLBACK(indicator_show_cb), server); - g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_HIDE, G_CALLBACK(indicator_hide_cb), server); - g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_MODIFIED, G_CALLBACK(indicator_modified_cb), server); - - return; -} - -/** - indicate_server_remove_indicator: - @server: The #IndicateServer to remove the #IndicateIndictor from. - @indicator: The #IndicateIndicator to remove. - - Removes an indicator @indicator from being watched by the server @server - so it's signals are no longer watched and set over DBus. -*/ -void -indicate_server_remove_indicator (IndicateServer * server, IndicateIndicator * indicator) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - if (g_slist_find (priv->indicators, indicator) == NULL) - return; - - priv->indicators = g_slist_remove(priv->indicators, indicator); - if (indicate_indicator_is_visible(indicator)) { - g_signal_emit(server, signals[INDICATOR_REMOVED], 0, indicate_indicator_get_id(indicator), indicate_indicator_get_indicator_type(indicator), TRUE); - } else { - priv->num_hidden--; - } - - g_signal_handlers_disconnect_by_func(indicator, indicator_show_cb, server); - g_signal_handlers_disconnect_by_func(indicator, indicator_hide_cb, server); - g_signal_handlers_disconnect_by_func(indicator, indicator_modified_cb, server); - - return; -} - -void -indicate_server_set_dbus_object (const gchar * obj) -{ - /* TODO */ - - return; -} - -/** - indicate_server_set_desktop_file: - @server: The #IndicateServer to set the type of - @path: The new desktop file representing the server - - This is a convience function to set the #IndicateServer:desktop - property of the @server object. The property can also be set - via traditional means, but this one is easier to read. -*/ -void -indicate_server_set_desktop_file (IndicateServer * server, const gchar * path) -{ - GValue value = {0}; - g_value_init(&value, G_TYPE_STRING); - g_value_set_string(&value, path); - g_object_set_property(G_OBJECT(server), "desktop", &value); - return; -} - -/** - indicate_server_set_type: - @server: The #IndicateServer to set the type of - @type: The new type of the server - - This is a convience function to set the #IndicateServer:type - property of the @server object. The property can also be set - via traditional means, but this one is easier to read. -*/ -void -indicate_server_set_type (IndicateServer * server, const gchar * type) -{ - GValue value = {0}; - g_value_init(&value, G_TYPE_STRING); - g_value_set_string(&value, type); - g_object_set_property(G_OBJECT(server), "type", &value); - return; -} - -static IndicateServer * default_indicate_server = NULL; - -/** - indicate_server_ref_default: - - This function will return a reference to the default #IndicateServer - reference if there is one, or it will create one if one had not - previously been created. It is recommended that all applications - use this function to create a #IndicateServer as it ensure that there - is only one per application. - - Return value: A reference to the default #IndicateServer instance. -*/ -IndicateServer * -indicate_server_ref_default (void) -{ - if (default_indicate_server != NULL) { - g_object_ref(default_indicate_server); - } else { - default_indicate_server = g_object_new(INDICATE_TYPE_SERVER, NULL); - g_object_add_weak_pointer(G_OBJECT(default_indicate_server), - (gpointer *)&default_indicate_server); - } - - return default_indicate_server; -} - -/** - indicate_server_set_default: - @server: The #IndicateServer that should be used - - This function is used to set the default #IndicateServer that will - be used when creating #IndicateIndicators or for anyone else that - calls indicate_server_ref_default(). Typically this is just an - instance of #IndicateServer but applications that create a subclass - of #IndicateServer should set this as well. -*/ -void -indicate_server_set_default (IndicateServer * server) -{ - if (default_indicate_server != NULL) { - g_warning("Setting a default Indicator Server when one has already been created. I'm not going to destroy that one, but let it live. This may create some odd results if you don't know what you're doing."); - } - - if (server != NULL) { - default_indicate_server = server; - g_object_add_weak_pointer(G_OBJECT(default_indicate_server), - (gpointer *)&default_indicate_server); - } - - return; -} - -static gboolean -get_indicator_count (IndicateServer * server, guint * count, GError **error) -{ - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - guint lstcnt = g_slist_length(priv->indicators); - - g_return_val_if_fail(priv->num_hidden < lstcnt, TRUE); - - *count = lstcnt - priv->num_hidden; - - return TRUE; -} - -typedef struct { - gchar * type; - guint count; -} count_by_t; - -static void -count_by_type (IndicateIndicator * indicator, count_by_t * cbt) -{ - g_return_if_fail(INDICATE_IS_INDICATOR(indicator)); - if (!indicate_indicator_is_visible(indicator)) { - return; - } - - const gchar * type = indicate_indicator_get_indicator_type(indicator); - /* g_debug("Looking for indicator of type '%s' and have type '%s'", cbt->type, type); */ - - if (type == NULL && cbt->type == NULL) { - cbt->count++; - } else if (type == NULL || cbt->type == NULL) { - } else if (!g_strcmp0(type, cbt->type)) { - cbt->count++; - } - - return; -} - -static gboolean -get_indicator_count_by_type (IndicateServer * server, gchar * type, guint * count, GError **error) -{ - /* g_debug("get_indicator_count_by_type: '%s'", type); */ - count_by_t cbt; - cbt.type = type; - cbt.count = 0; - - /* Handle the NULL string case as NULL itself, we're a big - boy language; we have pointers. */ - if (cbt.type != NULL && cbt.type[0] == '\0') { - cbt.type = NULL; - } - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - g_slist_foreach(priv->indicators, (GFunc)count_by_type, &cbt); - *count = cbt.count; - - return TRUE; -} - -static gboolean -get_indicator_list (IndicateServer * server, GArray ** indicators, GError ** error) -{ - g_return_val_if_fail(INDICATE_IS_SERVER(server), TRUE); - - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - g_return_val_if_fail(class->get_indicator_count != NULL, TRUE); - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - *indicators = g_array_sized_new(FALSE, FALSE, sizeof(guint), g_slist_length(priv->indicators) - priv->num_hidden); - - GSList * iter; - int i; - for (iter = priv->indicators, i = 0; iter != NULL; iter = iter->next) { - IndicateIndicator * indicator = INDICATE_INDICATOR(iter->data); - if (indicate_indicator_is_visible(indicator)) { - guint id = indicate_indicator_get_id(indicator); - g_array_insert_val(*indicators, i++, id); - } - } - - return TRUE; -} - -static gboolean -get_indicator_list_by_type (IndicateServer * server, gchar * type, GArray ** indicators, GError ** error) -{ - g_return_val_if_fail(INDICATE_IS_SERVER(server), TRUE); - - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - g_return_val_if_fail(class->get_indicator_count != NULL, TRUE); - - if (type != NULL && type[0] == '\0') { - type = NULL; - } - - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - /* Can't be larger than this and it's not worth the reallocation - for the small number we have. The memory isn't worth the time. */ - *indicators = g_array_sized_new(FALSE, FALSE, sizeof(guint), g_slist_length(priv->indicators) - priv->num_hidden); - - GSList * iter; - int i; - for (iter = priv->indicators, i = 0; iter != NULL; iter = iter->next) { - IndicateIndicator * indicator = INDICATE_INDICATOR(iter->data); - if (indicate_indicator_is_visible(indicator)) { - const gchar * itype = indicate_indicator_get_indicator_type(indicator); - guint id = indicate_indicator_get_id(indicator); - - if (type == NULL && itype == NULL) { - g_array_insert_val(*indicators, i++, id); - } else if (type == NULL || itype == NULL) { - } else if (!g_strcmp0(type, itype)) { - g_array_insert_val(*indicators, i++, id); - } - } - } - - return TRUE; -} - -static IndicateIndicator * -get_indicator (IndicateServer * server, guint id, GError **error) -{ - g_return_val_if_fail(INDICATE_IS_SERVER(server), NULL); - IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); - - GSList * iter; - for (iter = priv->indicators; iter != NULL; iter = iter->next) { - IndicateIndicator * indicator = INDICATE_INDICATOR(iter->data); - if (indicate_indicator_get_id(indicator) == id) { - return indicator; - } - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - INVALID_INDICATOR_ID, - "Invalid Indicator ID: %d", - id); - } - return NULL; -} - -static gboolean -get_indicator_property (IndicateServer * server, guint id, gchar * property, gchar ** value, GError **error) -{ - IndicateIndicator * indicator = get_indicator(server, id, error); - if (indicator == NULL) { - return FALSE; - } - - *value = g_strdup(indicate_indicator_get_property(indicator, property)); - return TRUE; -} - -static gboolean -get_indicator_property_group (IndicateServer * server, guint id, GPtrArray * properties, gchar *** value, GError **error) -{ - IndicateIndicator * indicator = get_indicator(server, id, error); - if (indicator == NULL) { - return FALSE; - } - - GPtrArray * array = g_ptr_array_new(); - int i; - for (i = 0; i < properties->len; i++) { - const gchar * val = indicate_indicator_get_property(indicator, g_ptr_array_index(properties, i)); - if (val != NULL) { - g_ptr_array_add(array, g_strdup(val)); - } else { - g_ptr_array_add(array, g_strdup("")); - } - } - g_ptr_array_add(array, NULL); - *value = (gchar **)g_ptr_array_free(array, FALSE); - - return TRUE; -} - -static gboolean -get_indicator_properties (IndicateServer * server, guint id, gchar *** properties, GError **error) -{ - IndicateIndicator * indicator = get_indicator(server, id, error); - if (indicator == NULL) { - return FALSE; - } - - GPtrArray * array = indicate_indicator_list_properties(indicator); - g_ptr_array_add(array, NULL); - - *properties = (gchar **)g_ptr_array_free(array, FALSE); - - return TRUE; -} - -static gboolean -show_indicator_to_user (IndicateServer * server, guint id, GError ** error) -{ - if (id == INDICATE_SERVER_INDICATOR_NULL) { - g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE); - return TRUE; - } - - IndicateIndicator * indicator = get_indicator(server, id, error); - if (indicator == NULL) { - return FALSE; - } - - indicate_indicator_user_display(indicator); - return TRUE; -} - - -/* Virtual Functions */ -gboolean -_indicate_server_get_indicator_count (IndicateServer * server, guint * count, GError **error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_count != NULL) { - return class->get_indicator_count (server, count, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_COUNT, - "get_indicator_count function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_count_by_type (IndicateServer * server, gchar * type, guint * count, GError **error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_count_by_type != NULL) { - return class->get_indicator_count_by_type (server, type, count, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_COUNT_BY_TYPE, - "get_indicator_count_by_type function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_list (IndicateServer * server, GArray ** indicators, GError ** error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_list != NULL) { - return class->get_indicator_list (server, indicators, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_LIST, - "get_indicator_list function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_list_by_type (IndicateServer * server, gchar * type, GArray ** indicators, GError ** error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_list_by_type != NULL) { - return class->get_indicator_list_by_type (server, type, indicators, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_LIST_BY_TYPE, - "get_indicator_list_by_type function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_property (IndicateServer * server, guint id, gchar * property, gchar ** value, GError **error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_property != NULL) { - return class->get_indicator_property (server, id, property, value, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_PROPERTY, - "get_indicator_property function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_property_group (IndicateServer * server, guint id, GPtrArray * properties, gchar *** value, GError **error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_property_group != NULL) { - return class->get_indicator_property_group (server, id, properties, value, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_PROPERTY_GROUP, - "get_indicator_property_group function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_get_indicator_properties (IndicateServer * server, guint id, gchar *** properties, GError **error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_indicator_properties != NULL) { - return class->get_indicator_properties (server, id, properties, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_GET_INDICATOR_PROPERTIES, - "get_indicator_properties function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -gboolean -_indicate_server_show_indicator_to_user (IndicateServer * server, guint id, GError ** error) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->show_indicator_to_user != NULL) { - return class->show_indicator_to_user (server, id, error); - } - - if (error) { - g_set_error(error, - indicate_server_error_quark(), - NO_SHOW_INDICATOR_TO_USER, - "show_indicator_to_user function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - return FALSE; - } - - return TRUE; -} - -/** - indicate_server_get_next_id: - @server: The #IndicateServer the ID will be on - - Returns the next available unused ID that an indicator - can have. - - Return value: A valid indicator ID. -*/ -guint -indicate_server_get_next_id (IndicateServer * server) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->get_next_id != NULL) { - return class->get_next_id (server); - } - - return 0; -} - -static IndicateInterests -interest_string_to_enum (gchar * interest_string) -{ - if (!g_strcmp0(interest_string, INDICATE_INTEREST_STRING_SERVER_DISPLAY)) { - return INDICATE_INTEREST_SERVER_DISPLAY; - } - - if (!g_strcmp0(interest_string, INDICATE_INTEREST_STRING_SERVER_SIGNAL)) { - return INDICATE_INTEREST_SERVER_SIGNAL; - } - - if (!g_strcmp0(interest_string, INDICATE_INTEREST_STRING_INDICATOR_DISPLAY)) { - return INDICATE_INTEREST_INDICATOR_DISPLAY; - } - - if (!g_strcmp0(interest_string, INDICATE_INTEREST_STRING_INDICATOR_SIGNAL)) { - return INDICATE_INTEREST_INDICATOR_SIGNAL; - } - - if (!g_strcmp0(interest_string, INDICATE_INTEREST_STRING_INDICATOR_COUNT)) { - return INDICATE_INTEREST_INDICATOR_COUNT; - } - - return INDICATE_INTEREST_NONE; -} - -gboolean -_indicate_server_show_interest (IndicateServer * server, gchar * interest, DBusGMethodInvocation * method) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->show_interest != NULL) { - if (class->show_interest (server, dbus_g_method_get_sender(method), interest_string_to_enum(interest))){ - dbus_g_method_return(method); - return TRUE; - } else { - GError * error; - g_set_error(&error, - indicate_server_error_quark(), - SHOW_INTEREST_FAILED, - "Unable to show interest: %s", - interest); - dbus_g_method_return_error(method, error); - g_error_free(error); - return FALSE; - } - } - - GError * error; - g_set_error(&error, - indicate_server_error_quark(), - NO_SHOW_INTEREST, - "show_interest function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - dbus_g_method_return_error(method, error); - g_error_free(error); - return FALSE; -} - -gboolean -_indicate_server_remove_interest (IndicateServer * server, gchar * interest, DBusGMethodInvocation * method) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->remove_interest != NULL) { - if (class->remove_interest (server, dbus_g_method_get_sender(method), interest_string_to_enum(interest))){ - dbus_g_method_return(method); - return TRUE; - } else { - GError * error; - g_set_error(&error, - indicate_server_error_quark(), - REMOVE_INTEREST_FAILED, - "Unable to remove interest: %s", - interest); - dbus_g_method_return_error(method, error); - g_error_free(error); - return FALSE; - } - } - - GError * error; - g_set_error(&error, - indicate_server_error_quark(), - NO_REMOVE_INTEREST, - "remove_interest function doesn't exist for this server class: %s", - G_OBJECT_TYPE_NAME(server)); - dbus_g_method_return_error(method, error); - g_error_free(error); - return FALSE; -} - -/** - indicate_server_check_interest: - @server: The #IndicateServer being checked - @interest: Which interest type we're checking for - - This function looks at all the interest that various listeners - have specified that they have for this server and returns whether - there is a listener that has the interest specified in @interest. - - Return value: %TRUE if a listener as the interest otherwise %FALSE -*/ -gboolean -indicate_server_check_interest (IndicateServer * server, IndicateInterests interest) -{ - IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server); - - if (class != NULL && class->check_interest != NULL) { - return class->check_interest (server, interest); - } - - g_warning("check_interest function not implemented in this server class: %s", G_OBJECT_TYPE_NAME(server)); - return FALSE; -} - -/* Signal emission functions for sub-classes of the server */ - -/** - indicate_server_emit_indicator_added: - @server: The #IndicateServer being represented - @id: The ID of the indicator being added - @type: The type of the indicator - - This function emits the #IndicateServer::indicator-added signal and is - used by subclasses. -*/ -void -indicate_server_emit_indicator_added (IndicateServer *server, guint id, const gchar *type) -{ - g_return_if_fail (INDICATE_IS_SERVER (server)); - g_return_if_fail (type); - - g_signal_emit(server, signals[INDICATOR_ADDED], 0, id, type); -} - -/** - indicate_server_emit_indicator_removed: - @server: The #IndicateServer being represented - @id: The ID of the indicator being removed - @type: The type of the indicator - - This function emits the #IndicateServer::indicator-removed signal and is - used by subclasses. -*/ -void -indicate_server_emit_indicator_removed (IndicateServer *server, guint id, const gchar *type) -{ - g_return_if_fail (INDICATE_IS_SERVER (server)); - g_return_if_fail (type); - - g_signal_emit(server, signals[INDICATOR_REMOVED], 0, id, type); -} - -/** - indicate_server_emit_indicator_modified: - @server: The #IndicateServer being represented - @id: The ID of the indicator with the modified property - @property: The name of the property being modified - - This function emits the #IndicateServer::indicator-modified signal and is - used by subclasses. -*/ -void -indicate_server_emit_indicator_modified (IndicateServer *server, guint id, const gchar *property) -{ - g_return_if_fail (INDICATE_IS_SERVER (server)); - g_return_if_fail (property); - - g_signal_emit(server, signals[INDICATOR_MODIFIED], 0, id, property); -} - -/** - indicate_server_emit_server_display: - @server: The #IndicateServer being displayed - - This function emits the #IndicateServer::server-display signal and is - used by subclasses. -*/ -void -indicate_server_emit_server_display (IndicateServer *server) -{ - g_return_if_fail (INDICATE_IS_SERVER (server)); - - g_signal_emit(server, signals[SERVER_DISPLAY], 0, TRUE); -} - -/* *** Folks stuff *** */ - -static gint -indicate_server_interested_folks_equal (gconstpointer a, gconstpointer b) -{ - return g_strcmp0(((IndicateServerInterestedFolk *)a)->sender,((IndicateServerInterestedFolk *)b)->sender); -} - -static void -indicate_server_interested_folks_init (IndicateServerInterestedFolk * folk, gchar * sender) -{ - folk->sender = g_strdup(sender); - - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - folk->interests[i] = FALSE; - } - - return; -} - -static void -indicate_server_interested_folks_set (IndicateServerInterestedFolk * folk, IndicateInterests interest, gboolean value) -{ - folk->interests[interest] = value; - return; -} - -static void -indicate_server_interested_folks_copy (IndicateServerInterestedFolk * folk, gboolean * interests) -{ - guint i; - for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) { - if (folk->interests[i]) { - interests[i] = TRUE; - } - } - - return; -} - -static void -indicate_server_interested_folks_destroy(IndicateServerInterestedFolk * folk) -{ - g_free(folk->sender); - g_free(folk); - return; -} -/* *** End Folks *** */ diff --git a/libindicate/server.h b/libindicate/server.h deleted file mode 100644 index cff76c4..0000000 --- a/libindicate/server.h +++ /dev/null @@ -1,219 +0,0 @@ -/* -A library to allow applictions to provide simple indications of -information to be displayed to users of the application through the -interface shell. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see -<http://www.gnu.org/licenses/> -*/ - -#ifndef INDICATE_SERVER_H_INCLUDED__ -#define INDICATE_SERVER_H_INCLUDED__ 1 - -#include <glib.h> -#include <glib-object.h> - -#include "interests.h" - -G_BEGIN_DECLS - -/* Boilerplate */ -#define INDICATE_TYPE_SERVER (indicate_server_get_type ()) -#define INDICATE_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_SERVER, IndicateServer)) -#define INDICATE_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_SERVER)) -#define INDICATE_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_SERVER, IndicateServerClass)) -#define INDICATE_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_SERVER)) -#define INDICATE_SERVER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_SERVER, IndicateServerClass)) - -#define INDICATE_SERVER_INDICATOR_NULL (0) - -#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED "indicator-added" -#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED "indicator-removed" -#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED "indicator-modified" -#define INDICATE_SERVER_SIGNAL_SERVER_SHOW "server-show" -#define INDICATE_SERVER_SIGNAL_SERVER_HIDE "server-hide" -#define INDICATE_SERVER_SIGNAL_SERVER_DISPLAY "server-display" -#define INDICATE_SERVER_SIGNAL_INTEREST_ADDED "interest-added" -#define INDICATE_SERVER_SIGNAL_INTEREST_REMOVED "interest-removed" - -/** - IndicateServer: - - This is the object that represents the overall connection - between this application and DBus. It acts as the proxy for - incomming DBus calls and also sends the appropriate signals - on DBus for events happening on other objects locally. It - provides some settings that effection how the application as - a whole is perceived by listeners of the indicator protocol. -*/ -typedef struct _IndicateServer IndicateServer; -struct _IndicateServer { - GObject parent; -}; - -#include "indicator.h" - -/** - IndicateServerClass: - @parent: Parent Class - @indicator_added: Slot for #IndicateServer::indicator-added. - @indicator_removed: Slot for #IndicateServer::indicator-removed. - @indicator_modified: Slot for #IndicateServer::indicator-modified. - @server_show: Slot for #IndicateServer::server-show. - @server_hide: Slot for #IndicateServer::server-hide. - @server_display: Slot for #IndicateServer::server-display. - @interest_added: Slot for #IndicateServer::interest-added. - @interest_removed: Slot for #IndicateServer::interest-removed. - @get_indicator_count: Returns the number of indicators that are visible - on the bus. Hidden indicators should not be counted. - @get_indicator_count_by_type: Returns the number of indicators that are - of a given type and visible on the bus. - @get_indicator_list: List all of the indicators that are visible. - @get_indicator_list_by_type: List all of the indicators of a given - type that are visible. - @get_indicator_property: Get a property from a particular indicator. - @get_indicator_property_group: Get the values for a set of properties - as an array of entries, returning an array as well. - @get_indicator_properties: Get a list of all the properties that are - on a particular indicator. - @show_indicator_to_user: Respond to someone on the bus asking to show - a particular indicator to the user. - @get_next_id: Get the next unused indicator ID. - @show_interest: React to someone signifying that they are interested - in this server. - @remove_interest: Someone on the bus is no longer interest in this - server, remove it's interest. - @check_interest: Check to see if anyone on the bus is interested in this - server for a particular feature. - @indicate_server_reserved1: Reserved for future use - @indicate_server_reserved2: Reserved for future use - @indicate_server_reserved3: Reserved for future use - @indicate_server_reserved4: Reserved for future use - - All of the functions and signals that make up the server class - including those that are public API to the application and those - that are public API to all of DBus. Subclasses may need to - implement a large portion of these. -*/ -typedef struct _IndicateServerClass IndicateServerClass; -struct _IndicateServerClass { - GObjectClass parent; - - /* Signals */ - void (* indicator_added) (IndicateServer * server, guint id, gchar * type); - void (* indicator_removed) (IndicateServer * server, guint id, gchar * type); - void (* indicator_modified) (IndicateServer * server, guint id, gchar * property); - void (* server_show) (IndicateServer * server, gchar * type); - void (* server_hide) (IndicateServer * server, gchar * type); - void (* server_display) (IndicateServer * server); - void (* interest_added) (IndicateServer * server, IndicateInterests interest); - void (* interest_removed) (IndicateServer * server, IndicateInterests interest); - - /* Virtual Functions */ - gboolean (*get_indicator_count) (IndicateServer * server, guint * count, GError **error); - gboolean (*get_indicator_count_by_type) (IndicateServer * server, gchar * type, guint * count, GError **error); - gboolean (*get_indicator_list) (IndicateServer * server, GArray ** indicators, GError ** error); - gboolean (*get_indicator_list_by_type) (IndicateServer * server, gchar * type, GArray ** indicators, GError ** error); - gboolean (*get_indicator_property) (IndicateServer * server, guint id, gchar * property, gchar ** value, GError **error); - gboolean (*get_indicator_property_group) (IndicateServer * server, guint id, GPtrArray * properties, gchar *** value, GError **error); - gboolean (*get_indicator_properties) (IndicateServer * server, guint id, gchar *** properties, GError **error); - gboolean (*show_indicator_to_user) (IndicateServer * server, guint id, GError ** error); - guint (*get_next_id) (IndicateServer * server); - gboolean (*show_interest) (IndicateServer * server, gchar * sender, IndicateInterests interest); - gboolean (*remove_interest) (IndicateServer * server, gchar * sender, IndicateInterests interest); - gboolean (*check_interest) (IndicateServer * server, IndicateInterests interest); - - /* Reserver for future use */ - void (*indicate_server_reserved1)(void); - void (*indicate_server_reserved2)(void); - void (*indicate_server_reserved3)(void); - void (*indicate_server_reserved4)(void); -}; - -GType indicate_server_get_type (void) G_GNUC_CONST; - -/* Sets the object. By default this is /org/freedesktop/indicators */ -void indicate_server_set_dbus_object (const gchar * obj); - -/* Sets the desktop file to get data like name and description - * out of */ -void indicate_server_set_desktop_file (IndicateServer * server, const gchar * path); -void indicate_server_set_type (IndicateServer * server, const gchar * type); - -/* Show and hide the server on DBus, this allows for the server to - * be created, change the object, and then shown. If for some - * reason the app wanted to hide all it's indicators, this is a - * sure fire way to do so. No idea why, but I'm sure I'll learn. */ -void indicate_server_show (IndicateServer * server); -void indicate_server_hide (IndicateServer * server); - -guint indicate_server_get_next_id (IndicateServer * server); -void indicate_server_add_indicator (IndicateServer * server, IndicateIndicator * indicator); -void indicate_server_remove_indicator (IndicateServer * server, IndicateIndicator * indicator); - -IndicateServer * indicate_server_ref_default (void); -void indicate_server_set_default (IndicateServer * server); - -/* Check to see if there is someone, out there, who likes this */ -gboolean indicate_server_check_interest (IndicateServer * server, IndicateInterests interest); - - -/* Signal emission functions for sub-classes of the server */ -void indicate_server_emit_indicator_added (IndicateServer *server, guint id, const gchar *type); -void indicate_server_emit_indicator_removed (IndicateServer *server, guint id, const gchar *type); -void indicate_server_emit_indicator_modified (IndicateServer *server, guint id, const gchar *property); -void indicate_server_emit_server_display (IndicateServer *server); - -/** - SECTION:server - @short_description: The representation of the application on DBus. - @stability: Unstable - @include: libindicate/server.h - - The server object is the object that provides the functions on - to DBus for other applications to call. It does this by implementing - the DBus indicator spec, but it also allows for subclassing so that - subclasses don't have to worry about the DBus-isms as much as - the functionality that they're trying to express. - - For simple applications there is limited need to set anything - more than the desktop file and the type of the server using - indicate_server_set_desktop_file() and indicate_server_set_type(). - Each of these function sets the respective value and expresses - it in a way that other applications on the bus can read it. - - More advanced applications might find the need to subclass the - #IndicateServer object and make their own. This is likely the - case where applications have complex data stores that they don't - want to turn into a large set of #GObjects that can take up a - significant amount of memory in the program. - - In general, it is recommended that application authors go with - the high memory path first, and then optimize by implementing - their server on a second pass. -*/ - -G_END_DECLS - -#endif /* INDICATE_SERVER_H_INCLUDED__ */ - diff --git a/po/POTFILES.in b/po/POTFILES.in deleted file mode 100644 index 2d4cb1d..0000000 --- a/po/POTFILES.in +++ /dev/null @@ -1,5 +0,0 @@ -[encoding: UTF-8] -data/GNOME_IndicatorApplet.server.in.in -data/GNOME_IndicatorAppletSUS.server.in.in -data/indicator-applet.schemas.in -src/applet-main.c diff --git a/po/POTFILES.skip b/po/POTFILES.skip deleted file mode 100644 index ee347ff..0000000 --- a/po/POTFILES.skip +++ /dev/null @@ -1 +0,0 @@ -data/GNOME_IndicatorApplet.server.in diff --git a/src-sus/Makefile.am b/src-sus/Makefile.am deleted file mode 100644 index 4a043ca..0000000 --- a/src-sus/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -libexec_PROGRAMS = \ - indicator-applet-sus - -indicator_applet_sus_CFLAGS = \ - -DG_LOG_DOMAIN=\""Indicator-Applet"\" \ - -DDATADIR=\""$(datadir)"\" \ - -DINDICATOR_DIR=\""$(libdir)/indicators/2"\" \ - -I$(srcdir)/.. \ - $(APPLET_CFLAGS) - -indicator_applet_sus_SOURCES = \ - applet-main.c - -indicator_applet_sus_LDADD = \ - $(APPLET_LIBS) diff --git a/src-sus/applet-main.c b/src-sus/applet-main.c deleted file mode 100644 index 0e43923..0000000 --- a/src-sus/applet-main.c +++ /dev/null @@ -1,352 +0,0 @@ -/* -A small wrapper utility to load indicators and put them as menu items -into the gnome-panel using it's applet interface. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <config.h> -#include <panel-applet.h> -#include <libgnomeui/gnome-ui-init.h> - -#include "libindicator/indicator.h" - -#define ICONS_DIR (DATADIR G_DIR_SEPARATOR_S "indicator-applet" G_DIR_SEPARATOR_S "icons") - -static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data); - - -static void cw_panel_background_changed (PanelApplet *applet, - PanelAppletBackgroundType type, - GdkColor *colour, - GdkPixmap *pixmap, - GtkWidget *menubar); - -/* ****************** * - * Global Variables * - * ****************** */ - -static GnomeProgram *program = NULL; - - -/************* - * main - * ***********/ - -PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_FastUserSwitchApplet_Factory", - PANEL_TYPE_APPLET, - "indicator-applet-sus", "0", - applet_fill_cb, NULL); - -/************* - * init function - * ***********/ -static gboolean -load_module (const gchar * name, GtkWidget * menu) -{ - g_debug("Looking at Module: %s", name); - g_return_val_if_fail(name != NULL, FALSE); - - if (!g_str_has_suffix(name, G_MODULE_SUFFIX)) { - return FALSE; - } - - g_debug("Loading Module: %s", name); - - gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL); - GModule * module = g_module_open(fullpath, - G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - g_free(fullpath); - g_return_val_if_fail(module != NULL, FALSE); - - get_version_t lget_version = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE); - if (!INDICATOR_VERSION_CHECK(lget_version())) { - g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION); - return FALSE; - } - - get_label_t lget_label = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE); - g_return_val_if_fail(lget_label != NULL, FALSE); - GtkLabel * label = lget_label(); - - get_icon_t lget_icon = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE); - g_return_val_if_fail(lget_icon != NULL, FALSE); - GtkImage * icon = lget_icon(); - - get_menu_t lget_menu = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE); - g_return_val_if_fail(lget_menu != NULL, FALSE); - GtkMenu * lmenu = lget_menu(); - - if (label == NULL && icon == NULL) { - /* This is the case where there is nothing to display, - kinda odd that we'd have a module with nothing. */ - g_warning("No label or icon. Odd."); - return FALSE; - } - - GtkWidget * menuitem = gtk_menu_item_new(); - GtkWidget * hbox = gtk_hbox_new(FALSE, 3); - if (icon != NULL) { - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0); - } - if (label != NULL) { - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - gtk_container_add(GTK_CONTAINER(menuitem), hbox); - gtk_widget_show(hbox); - - if (lmenu != NULL) { - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu)); - } - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - gtk_widget_show(menuitem); - - return TRUE; -} - -static gboolean -menubar_press (GtkWidget * widget, - GdkEventButton *event, - gpointer data) -{ - if (event->button != 1) { - g_signal_stop_emission_by_name(widget, "button-press-event"); - } - - return FALSE; -} - -static gboolean -menubar_on_expose (GtkWidget * widget, - GdkEventExpose *event, - GtkWidget * menubar) -{ - if (GTK_WIDGET_HAS_FOCUS(menubar)) - gtk_paint_focus(widget->style, widget->window, GTK_WIDGET_STATE(menubar), - NULL, widget, "menubar-applet", 0, 0, -1, -1); - - return FALSE; -} - -static void -about_cb (BonoboUIComponent *ui_container, - gpointer data, - const gchar *cname) -{ - static const gchar *authors[] = { - "Ted Gould <ted@canonical.com>", - NULL - }; - - static gchar *license[] = { - N_("This program is free software: you can redistribute it and/or modify it " - "under the terms of the GNU General Public License version 3, as published " - "by the Free Software Foundation."), - N_("This program is distributed in the hope that it will be useful, but " - "WITHOUT ANY WARRANTY; without even the implied warranties of " - "MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR " - "PURPOSE. See the GNU General Public License for more details."), - N_("You should have received a copy of the GNU General Public License along " - "with this program. If not, see <http://www.gnu.org/licenses/>."), - NULL - }; - gchar *license_i18n; - - license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL); - - gtk_show_about_dialog(NULL, - "version", "0.1", - "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.", - "comments", _("An applet to hold all of the system indicators."), - "authors", authors, - "license", license_i18n, - "wrap-license", TRUE, - "translator-credits", _("translator-credits"), - "logo-icon-name", "indicator-applet", - "icon-name", "indicator-applet", - "website", "http://launchpad.net/indicator-applet", - "website-label", _("Indicator Applet Website"), - NULL - ); - - g_free (license_i18n); - - return; -} - -#ifdef N_ -#undef N_ -#endif -#define N_(x) x - -static gboolean -applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) -{ - static const BonoboUIVerb menu_verbs[] = { - BONOBO_UI_VERB ("IndicatorAppletAbout", about_cb), - BONOBO_UI_VERB_END - }; - static const gchar * menu_xml = - "<popup name=\"button3\">" - "<menuitem name=\"About Item\" verb=\"IndicatorAppletAbout\" _label=\"" N_("_About") "\" pixtype=\"stock\" pixname=\"gtk-about\"/>" - "</popup>"; - - GtkWidget *menubar; - gint i; - gint indicators_loaded = 0; - static gboolean first_time = FALSE; - - if (!first_time) - { - gint argc = 1; - gchar *argv[2] = { "indicator-applet-sus", NULL}; - - first_time = TRUE; - program = gnome_program_init ("indicator-applet-sus", "0.1", - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL); - } - - /* Set panel options */ - gtk_container_set_border_width(GTK_CONTAINER (applet), 0); - panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR); - panel_applet_setup_menu(applet, menu_xml, menu_verbs, NULL); - atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)), - "indicator-applet-sus"); - - /* Init some theme/icon stuff */ - gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), - ICONS_DIR); - /* g_debug("Icons directory: %s", ICONS_DIR); */ - gtk_rc_parse_string ( - "style \"indicator-applet-style\"\n" - "{\n" - " GtkMenuBar::shadow-type = none\n" - " GtkMenuBar::internal-padding = 0\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - "}\n" - "style \"indicator-applet-menubar-style\"\n" - "{\n" - " GtkMenuBar::shadow-type = none\n" - " GtkMenuBar::internal-padding = 0\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - " GtkMenuItem::horizontal-padding = 0\n" - "}\n" - "style \"indicator-applet-menuitem-style\"\n" - "{\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - " GtkMenuItem::horizontal-padding = 0\n" - "}\n" - "widget \"*.fast-user-switch-applet\" style \"indicator-applet-style\"" - "widget \"*.fast-user-switch-menuitem\" style \"indicator-applet-menuitem-style\"" - "widget \"*.fast-user-switch-menubar\" style \"indicator-applet-menubar-style\""); - //gtk_widget_set_name(GTK_WIDGET (applet), "indicator-applet-menubar"); - gtk_widget_set_name(GTK_WIDGET (applet), "fast-user-switch-applet"); - - /* Build menubar */ - menubar = gtk_menu_bar_new(); - GTK_WIDGET_SET_FLAGS (menubar, GTK_WIDGET_FLAGS(menubar) | GTK_CAN_FOCUS); - gtk_widget_set_name(GTK_WIDGET (menubar), "fast-user-switch-menubar"); - g_signal_connect(menubar, "button-press-event", G_CALLBACK(menubar_press), NULL); - g_signal_connect_after(menubar, "expose-event", G_CALLBACK(menubar_on_expose), menubar); - gtk_container_set_border_width(GTK_CONTAINER(menubar), 0); - - /* load 'em */ - if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { - GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL); - - const gchar * name; - while ((name = g_dir_read_name(dir)) != NULL) { - if (g_strcmp0(name, "libstatus-users-session.so")) { - continue; - } - if (load_module(name, menubar)) { - indicators_loaded++; - } - } - g_dir_close (dir); - } - - if (indicators_loaded == 0) { - /* A label to allow for click through */ - GtkWidget * item = gtk_label_new(_("No Indicators")); - gtk_container_add(GTK_CONTAINER(applet), item); - gtk_widget_show(item); - } else { - gtk_container_add(GTK_CONTAINER(applet), menubar); - panel_applet_set_background_widget(applet, menubar); - gtk_widget_show(menubar); - } - - /* Background of applet */ - g_signal_connect(applet, "change-background", - G_CALLBACK(cw_panel_background_changed), menubar); - - gtk_widget_show(GTK_WIDGET(applet)); - - return TRUE; -} - -static void -cw_panel_background_changed (PanelApplet *applet, - PanelAppletBackgroundType type, - GdkColor *colour, - GdkPixmap *pixmap, - GtkWidget *menubar) -{ - GtkRcStyle *rc_style; - GtkStyle *style; - - /* reset style */ - gtk_widget_set_style(GTK_WIDGET (applet), NULL); - gtk_widget_set_style(menubar, NULL); - rc_style = gtk_rc_style_new (); - gtk_widget_modify_style(GTK_WIDGET (applet), rc_style); - gtk_widget_modify_style(menubar, rc_style); - gtk_rc_style_unref(rc_style); - - switch (type) - { - case PANEL_NO_BACKGROUND: - break; - case PANEL_COLOR_BACKGROUND: - gtk_widget_modify_bg(GTK_WIDGET (applet), GTK_STATE_NORMAL, colour); - gtk_widget_modify_bg(menubar, GTK_STATE_NORMAL, colour); - break; - - case PANEL_PIXMAP_BACKGROUND: - style = gtk_style_copy(GTK_WIDGET (applet)->style); - if (style->bg_pixmap[GTK_STATE_NORMAL]) - g_object_unref(style->bg_pixmap[GTK_STATE_NORMAL]); - style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap); - gtk_widget_set_style(GTK_WIDGET (applet), style); - gtk_widget_set_style(GTK_WIDGET (menubar), style); - g_object_unref(style); - break; - } -} - diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 97af739..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -libexec_PROGRAMS = \ - indicator-applet - -indicator_applet_CFLAGS = \ - -DG_LOG_DOMAIN=\""Indicator-Applet"\" \ - -DDATADIR=\""$(datadir)"\" \ - -DINDICATOR_DIR=\""$(libdir)/indicators/2"\" \ - -I$(srcdir)/.. \ - $(APPLET_CFLAGS) - -indicator_applet_SOURCES = \ - applet-main.c - -indicator_applet_LDADD = \ - $(APPLET_LIBS) diff --git a/src/applet-main.c b/src/applet-main.c deleted file mode 100644 index 3048e83..0000000 --- a/src/applet-main.c +++ /dev/null @@ -1,352 +0,0 @@ -/* -A small wrapper utility to load indicators and put them as menu items -into the gnome-panel using it's applet interface. - -Copyright 2009 Canonical Ltd. - -Authors: - Ted Gould <ted@canonical.com> - -This program is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License version 3, as published -by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR -PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <config.h> -#include <panel-applet.h> -#include <libgnomeui/gnome-ui-init.h> - -#include "libindicator/indicator.h" - -#define ICONS_DIR (DATADIR G_DIR_SEPARATOR_S "indicator-applet" G_DIR_SEPARATOR_S "icons") - -static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data); - - -static void cw_panel_background_changed (PanelApplet *applet, - PanelAppletBackgroundType type, - GdkColor *colour, - GdkPixmap *pixmap, - GtkWidget *menubar); - -/* ****************** * - * Global Variables * - * ****************** */ - -static GnomeProgram *program = NULL; - - -/************* - * main - * ***********/ - -PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorApplet_Factory", - PANEL_TYPE_APPLET, - "indicator-applet", "0", - applet_fill_cb, NULL); - -/************* - * init function - * ***********/ -static gboolean -load_module (const gchar * name, GtkWidget * menu) -{ - g_debug("Looking at Module: %s", name); - g_return_val_if_fail(name != NULL, FALSE); - - if (!g_str_has_suffix(name, G_MODULE_SUFFIX)) { - return FALSE; - } - - g_debug("Loading Module: %s", name); - - gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL); - GModule * module = g_module_open(fullpath, - G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - g_free(fullpath); - g_return_val_if_fail(module != NULL, FALSE); - - get_version_t lget_version = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE); - if (!INDICATOR_VERSION_CHECK(lget_version())) { - g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION); - return FALSE; - } - - get_label_t lget_label = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_LABEL_S, (gpointer *)(&lget_label)), FALSE); - g_return_val_if_fail(lget_label != NULL, FALSE); - GtkLabel * label = lget_label(); - - get_icon_t lget_icon = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_ICON_S, (gpointer *)(&lget_icon)), FALSE); - g_return_val_if_fail(lget_icon != NULL, FALSE); - GtkImage * icon = lget_icon(); - - get_menu_t lget_menu = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_MENU_S, (gpointer *)(&lget_menu)), FALSE); - g_return_val_if_fail(lget_menu != NULL, FALSE); - GtkMenu * lmenu = lget_menu(); - - if (label == NULL && icon == NULL) { - /* This is the case where there is nothing to display, - kinda odd that we'd have a module with nothing. */ - g_warning("No label or icon. Odd."); - return FALSE; - } - - GtkWidget * menuitem = gtk_menu_item_new(); - GtkWidget * hbox = gtk_hbox_new(FALSE, 3); - if (icon != NULL) { - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(icon), FALSE, FALSE, 0); - } - if (label != NULL) { - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0); - } - gtk_container_add(GTK_CONTAINER(menuitem), hbox); - gtk_widget_show(hbox); - - if (lmenu != NULL) { - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(lmenu)); - } - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); - gtk_widget_show(menuitem); - - return TRUE; -} - -static gboolean -menubar_press (GtkWidget * widget, - GdkEventButton *event, - gpointer data) -{ - if (event->button != 1) { - g_signal_stop_emission_by_name(widget, "button-press-event"); - } - - return FALSE; -} - -static gboolean -menubar_on_expose (GtkWidget * widget, - GdkEventExpose *event, - GtkWidget * menubar) -{ - if (GTK_WIDGET_HAS_FOCUS(menubar)) - gtk_paint_focus(widget->style, widget->window, GTK_WIDGET_STATE(menubar), - NULL, widget, "menubar-applet", 0, 0, -1, -1); - - return FALSE; -} - -static void -about_cb (BonoboUIComponent *ui_container, - gpointer data, - const gchar *cname) -{ - static const gchar *authors[] = { - "Ted Gould <ted@canonical.com>", - NULL - }; - - static gchar *license[] = { - N_("This program is free software: you can redistribute it and/or modify it " - "under the terms of the GNU General Public License version 3, as published " - "by the Free Software Foundation."), - N_("This program is distributed in the hope that it will be useful, but " - "WITHOUT ANY WARRANTY; without even the implied warranties of " - "MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR " - "PURPOSE. See the GNU General Public License for more details."), - N_("You should have received a copy of the GNU General Public License along " - "with this program. If not, see <http://www.gnu.org/licenses/>."), - NULL - }; - gchar *license_i18n; - - license_i18n = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n", _(license[2]), NULL); - - gtk_show_about_dialog(NULL, - "version", "0.1", - "copyright", "Copyright \xc2\xa9 2009 Canonical, Ltd.", - "comments", _("An applet to hold all of the system indicators."), - "authors", authors, - "license", license_i18n, - "wrap-license", TRUE, - "translator-credits", _("translator-credits"), - "logo-icon-name", "indicator-applet", - "icon-name", "indicator-applet", - "website", "http://launchpad.net/indicator-applet", - "website-label", _("Indicator Applet Website"), - NULL - ); - - g_free (license_i18n); - - return; -} - -#ifdef N_ -#undef N_ -#endif -#define N_(x) x - -static gboolean -applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) -{ - static const BonoboUIVerb menu_verbs[] = { - BONOBO_UI_VERB ("IndicatorAppletAbout", about_cb), - BONOBO_UI_VERB_END - }; - static const gchar * menu_xml = - "<popup name=\"button3\">" - "<menuitem name=\"About Item\" verb=\"IndicatorAppletAbout\" _label=\"" N_("_About") "\" pixtype=\"stock\" pixname=\"gtk-about\"/>" - "</popup>"; - - GtkWidget *menubar; - gint i; - gint indicators_loaded = 0; - static gboolean first_time = FALSE; - - if (!first_time) - { - gint argc = 1; - gchar *argv[2] = { "indicator-applet", NULL}; - - first_time = TRUE; - program = gnome_program_init ("indicator-applet", "0.1", - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL); - } - - /* Set panel options */ - gtk_container_set_border_width(GTK_CONTAINER (applet), 0); - panel_applet_set_flags(applet, PANEL_APPLET_EXPAND_MINOR); - panel_applet_setup_menu(applet, menu_xml, menu_verbs, NULL); - atk_object_set_name (gtk_widget_get_accessible (GTK_WIDGET (applet)), - "indicator-applet"); - - /* Init some theme/icon stuff */ - gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), - ICONS_DIR); - /* g_debug("Icons directory: %s", ICONS_DIR); */ - gtk_rc_parse_string ( - "style \"indicator-applet-style\"\n" - "{\n" - " GtkMenuBar::shadow-type = none\n" - " GtkMenuBar::internal-padding = 0\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - "}\n" - "style \"indicator-applet-menubar-style\"\n" - "{\n" - " GtkMenuBar::shadow-type = none\n" - " GtkMenuBar::internal-padding = 0\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - " GtkMenuItem::horizontal-padding = 0\n" - "}\n" - "style \"indicator-applet-menuitem-style\"\n" - "{\n" - " GtkWidget::focus-line-width = 0\n" - " GtkWidget::focus-padding = 0\n" - " GtkMenuItem::horizontal-padding = 0\n" - "}\n" - "widget \"*.fast-user-switch-applet\" style \"indicator-applet-style\"" - "widget \"*.fast-user-switch-menuitem\" style \"indicator-applet-menuitem-style\"" - "widget \"*.fast-user-switch-menubar\" style \"indicator-applet-menubar-style\""); - //gtk_widget_set_name(GTK_WIDGET (applet), "indicator-applet-menubar"); - gtk_widget_set_name(GTK_WIDGET (applet), "fast-user-switch-applet"); - - /* Build menubar */ - menubar = gtk_menu_bar_new(); - GTK_WIDGET_SET_FLAGS (menubar, GTK_WIDGET_FLAGS(menubar) | GTK_CAN_FOCUS); - gtk_widget_set_name(GTK_WIDGET (menubar), "fast-user-switch-menubar"); - g_signal_connect(menubar, "button-press-event", G_CALLBACK(menubar_press), NULL); - g_signal_connect_after(menubar, "expose-event", G_CALLBACK(menubar_on_expose), menubar); - gtk_container_set_border_width(GTK_CONTAINER(menubar), 0); - - /* load 'em */ - if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { - GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL); - - const gchar * name; - while ((name = g_dir_read_name(dir)) != NULL) { - if (!g_strcmp0(name, "libstatus-users-session.so")) { - continue; - } - if (load_module(name, menubar)) { - indicators_loaded++; - } - } - g_dir_close (dir); - } - - if (indicators_loaded == 0) { - /* A label to allow for click through */ - GtkWidget * item = gtk_label_new(_("No Indicators")); - gtk_container_add(GTK_CONTAINER(applet), item); - gtk_widget_show(item); - } else { - gtk_container_add(GTK_CONTAINER(applet), menubar); - panel_applet_set_background_widget(applet, menubar); - gtk_widget_show(menubar); - } - - /* Background of applet */ - g_signal_connect(applet, "change-background", - G_CALLBACK(cw_panel_background_changed), menubar); - - gtk_widget_show(GTK_WIDGET(applet)); - - return TRUE; -} - -static void -cw_panel_background_changed (PanelApplet *applet, - PanelAppletBackgroundType type, - GdkColor *colour, - GdkPixmap *pixmap, - GtkWidget *menubar) -{ - GtkRcStyle *rc_style; - GtkStyle *style; - - /* reset style */ - gtk_widget_set_style(GTK_WIDGET (applet), NULL); - gtk_widget_set_style(menubar, NULL); - rc_style = gtk_rc_style_new (); - gtk_widget_modify_style(GTK_WIDGET (applet), rc_style); - gtk_widget_modify_style(menubar, rc_style); - gtk_rc_style_unref(rc_style); - - switch (type) - { - case PANEL_NO_BACKGROUND: - break; - case PANEL_COLOR_BACKGROUND: - gtk_widget_modify_bg(GTK_WIDGET (applet), GTK_STATE_NORMAL, colour); - gtk_widget_modify_bg(menubar, GTK_STATE_NORMAL, colour); - break; - - case PANEL_PIXMAP_BACKGROUND: - style = gtk_style_copy(GTK_WIDGET (applet)->style); - if (style->bg_pixmap[GTK_STATE_NORMAL]) - g_object_unref(style->bg_pixmap[GTK_STATE_NORMAL]); - style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (pixmap); - gtk_widget_set_style(GTK_WIDGET (applet), style); - gtk_widget_set_style(GTK_WIDGET (menubar), style); - g_object_unref(style); - break; - } -} - diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 03bd980..0000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,141 +0,0 @@ - -TESTS = \ - test_simple \ - test_interests \ - test_interests_multi \ - test_thousand_indicators - -libexec_PROGRAMS = \ - test-interests-client \ - test-interests-server \ - test-interests-server1 \ - test-interests-server2 \ - test-interests-server3 \ - test-interests-server4 \ - test-interests-server5 \ - test-thousand-indicators-client \ - test-thousand-indicators-server \ - test-simple-client \ - test-simple-server - -EXTRA_DIST = \ - $(TESTS) - -test_simple: test-simple-client test-simple-server - -test_simple_client_SOURCES = \ - test-simple-client.c - -test_simple_client_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_simple_client_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_simple_server_SOURCES = \ - test-simple-server.c - -test_simple_server_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_simple_server_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests: test-interests-client test-interests-server - -test_interests_client_SOURCES = \ - test-interests-client.c - -test_interests_client_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_client_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_server_SOURCES = \ - test-interests-server.c - -test_interests_server_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_multi: test-interests-client test-interests-server1 test-interests-server2 test-interests-server3 test-interests-server4 test-interests-server5 - -test_interests_server1_SOURCES = \ - test-interests-server1.c - -test_interests_server1_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server1_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_server2_SOURCES = \ - test-interests-server2.c - -test_interests_server2_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server2_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_server3_SOURCES = \ - test-interests-server3.c - -test_interests_server3_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server3_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_server4_SOURCES = \ - test-interests-server4.c - -test_interests_server4_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server4_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_interests_server5_SOURCES = \ - test-interests-server5.c - -test_interests_server5_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_interests_server5_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_thousand_indicators: test-thousand-indicators-client test-thousand-indicators-server - -test_thousand_indicators_client_SOURCES = \ - test-thousand-indicators-client.c - -test_thousand_indicators_client_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_thousand_indicators_client_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - -test_thousand_indicators_server_SOURCES = \ - test-thousand-indicators-server.c - -test_thousand_indicators_server_CFLAGS = \ - $(LIBINDICATE_CFLAGS) -I$(srcdir)/.. - -test_thousand_indicators_server_LDADD = \ - ../libindicate/libindicate.la \ - $(LIBINDICATE_LIBS) - diff --git a/tests/test-interests-client.c b/tests/test-interests-client.c deleted file mode 100644 index bde3b26..0000000 --- a/tests/test-interests-client.c +++ /dev/null @@ -1,63 +0,0 @@ - -#include <glib.h> -#include "libindicate/indicator.h" -#include "libindicate/server.h" -#include "libindicate/interests.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; -static gboolean interests[INDICATE_INTEREST_LAST] = {0}; - -static gboolean -check_interests (void) -{ - guint i; - for (i = INDICATE_INTEREST_NONE + 1; i < INDICATE_INTEREST_LAST; i++) { - if (!interests[i]) { - return FALSE; - } - } - - return TRUE; -} - -static void -interest_added (IndicateServer * server, IndicateInterests interest) -{ - g_debug("Oh, someone is interested in my for: %d", interest); - interests[interest] = TRUE; - - if (check_interests()) { - g_main_loop_quit(mainloop); - } - - return; -} - -static gboolean -done_timeout_cb (gpointer data) -{ - g_debug("All interests not set"); - passed = FALSE; - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateIndicator * indicator = indicate_indicator_new(); - indicate_indicator_show(indicator); - - IndicateServer * server = indicate_server_ref_default(); - g_signal_connect(G_OBJECT(server), INDICATE_SERVER_SIGNAL_INTEREST_ADDED, G_CALLBACK(interest_added), NULL); - - g_timeout_add_seconds(2, done_timeout_cb, indicator); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server.c b/tests/test-interests-server.c deleted file mode 100644 index e1433d8..0000000 --- a/tests/test-interests-server.c +++ /dev/null @@ -1,45 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - - gint i; - for (i = INDICATE_INTEREST_NONE - 2; i < INDICATE_INTEREST_LAST + 2; i++) { - g_debug("Indicating Interests: %d", i); - indicate_listener_server_show_interest(listener, server, i); - } - - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server1.c b/tests/test-interests-server1.c deleted file mode 100644 index e0d77f3..0000000 --- a/tests/test-interests-server1.c +++ /dev/null @@ -1,41 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - #define INTEREST 1 - g_debug("Setting Interest: %d", INTEREST); - indicate_listener_server_show_interest(listener, server, INTEREST); - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server2.c b/tests/test-interests-server2.c deleted file mode 100644 index 0416c21..0000000 --- a/tests/test-interests-server2.c +++ /dev/null @@ -1,41 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - #define INTEREST 2 - g_debug("Setting Interest: %d", INTEREST); - indicate_listener_server_show_interest(listener, server, INTEREST); - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server3.c b/tests/test-interests-server3.c deleted file mode 100644 index 7d889b1..0000000 --- a/tests/test-interests-server3.c +++ /dev/null @@ -1,41 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - #define INTEREST 3 - g_debug("Setting Interest: %d", INTEREST); - indicate_listener_server_show_interest(listener, server, INTEREST); - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server4.c b/tests/test-interests-server4.c deleted file mode 100644 index 50e6db1..0000000 --- a/tests/test-interests-server4.c +++ /dev/null @@ -1,41 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - #define INTEREST 4 - g_debug("Setting Interest: %d", INTEREST); - indicate_listener_server_show_interest(listener, server, INTEREST); - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-interests-server5.c b/tests/test-interests-server5.c deleted file mode 100644 index d415716..0000000 --- a/tests/test-interests-server5.c +++ /dev/null @@ -1,41 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - #define INTEREST 5 - g_debug("Setting Interest: %d", INTEREST); - indicate_listener_server_show_interest(listener, server, INTEREST); - return; -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Done indicatating interest"); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(2, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-simple-client.c b/tests/test-simple-client.c deleted file mode 100644 index f8db55a..0000000 --- a/tests/test-simple-client.c +++ /dev/null @@ -1,30 +0,0 @@ - -#include <glib.h> -#include "libindicate/indicator.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static gboolean -done_timeout_cb (gpointer data) -{ - g_debug("All done."); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateIndicator * indicator = indicate_indicator_new(); - indicate_indicator_show(indicator); - - g_timeout_add_seconds(2, done_timeout_cb, indicator); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-simple-server.c b/tests/test-simple-server.c deleted file mode 100644 index 0a04e85..0000000 --- a/tests/test-simple-server.c +++ /dev/null @@ -1,39 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static void -server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) -{ - g_debug("Indicator Server Added: %s %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), type); - g_main_loop_quit(mainloop); -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Failed to get a server in 5 seconds."); - passed = FALSE; - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), NULL); - - g_timeout_add_seconds(5, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-thousand-indicators-client.c b/tests/test-thousand-indicators-client.c deleted file mode 100644 index 0ac7305..0000000 --- a/tests/test-thousand-indicators-client.c +++ /dev/null @@ -1,34 +0,0 @@ - -#include <glib.h> -#include "libindicate/indicator.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; - -static gboolean -done_timeout_cb (gpointer data) -{ - g_debug("All done."); - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - int i; - for (i = 0; i < 1000; i++) { - /* Memory leak :) */ - IndicateIndicator * indicator = indicate_indicator_new(); - indicate_indicator_show(indicator); - } - - g_timeout_add_seconds(2, done_timeout_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test-thousand-indicators-server.c b/tests/test-thousand-indicators-server.c deleted file mode 100644 index 285e56b..0000000 --- a/tests/test-thousand-indicators-server.c +++ /dev/null @@ -1,43 +0,0 @@ - -#include <glib.h> -#include "libindicate/listener.h" - -static gboolean passed = TRUE; -static GMainLoop * mainloop = NULL; -static guint indicator_count = 0; - -static void -indicator_added (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data) -{ - g_debug("Indicator Added: %s %d %s", INDICATE_LISTENER_SERVER_DBUS_NAME(server), INDICATE_LISTENER_INDICATOR_ID(indicator), type); - indicator_count++; - if (indicator_count == 1000) { - g_main_loop_quit(mainloop); - } -} - -static gboolean -failed_cb (gpointer data) -{ - g_debug("Failed to get a server in 5 seconds."); - passed = FALSE; - g_main_loop_quit(mainloop); - return FALSE; -} - -int -main (int argc, char * argv) -{ - g_type_init(); - - IndicateListener * listener = indicate_listener_ref_default(); - - g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), NULL); - - g_timeout_add_seconds(5, failed_cb, NULL); - - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); - - return !passed; -} diff --git a/tests/test_interests b/tests/test_interests deleted file mode 100755 index 750a789..0000000 --- a/tests/test_interests +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -DBUS_RUNNER="dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf" - -${DBUS_RUNNER} --task ./test-interests-client --task-name Client --task ./test-interests-server --task-name Server diff --git a/tests/test_interests_multi b/tests/test_interests_multi deleted file mode 100755 index 4dbdee8..0000000 --- a/tests/test_interests_multi +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -DBUS_RUNNER="dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf" - -${DBUS_RUNNER} --task ./test-interests-client --task-name Client --task ./test-interests-server1 --task-name Server1 --task ./test-interests-server2 --task-name Server2 --task ./test-interests-server3 --task-name Server3 --task ./test-interests-server4 --task-name Server4 --task ./test-interests-server5 --task-name Server5 diff --git a/tests/test_simple b/tests/test_simple deleted file mode 100755 index 1b0dc4c..0000000 --- a/tests/test_simple +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -DBUS_RUNNER="dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf" - -${DBUS_RUNNER} --task ./test-simple-client --task-name Client --task ./test-simple-server --task-name Server diff --git a/tests/test_thousand_indicators b/tests/test_thousand_indicators deleted file mode 100755 index fb1079d..0000000 --- a/tests/test_thousand_indicators +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -DBUS_RUNNER="dbus-test-runner --dbus-config /usr/share/dbus-test-runner/session.conf" - -${DBUS_RUNNER} --task ./test-thousand-indicators-client --task-name Client --task ./test-thousand-indicators-server --task-name Server |