zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #04658
[Merge] lp:~rainct/zeitgeist/update-ontology-feb2012 into lp:zeitgeist
Siegfried Gevatter has proposed merging lp:~rainct/zeitgeist/update-ontology-feb2012 into lp:zeitgeist.
Requested reviews:
Zeitgeist Framework Team (zeitgeist)
For more details, see:
https://code.launchpad.net/~rainct/zeitgeist/update-ontology-feb2012/+merge/91256
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~rainct/zeitgeist/update-ontology-feb2012/+merge/91256
Your team Zeitgeist Framework Team is requested to review the proposed merge of lp:~rainct/zeitgeist/update-ontology-feb2012 into lp:zeitgeist.
=== added file 'AUTHORS'
--- AUTHORS 1970-01-01 00:00:00 +0000
+++ AUTHORS 2012-02-02 12:33:19 +0000
@@ -0,0 +1,3 @@
+Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+Jason Smith <jason.smith@xxxxxxxxxxxxx>
+Michal Hruby <michal.mhr@xxxxxxxxx>
\ No newline at end of file
=== renamed file 'AUTHORS' => 'AUTHORS.moved'
=== added file 'COPYING'
--- COPYING 1970-01-01 00:00:00 +0000
+++ COPYING 2012-02-02 12:33:19 +0000
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
\ No newline at end of file
=== added file 'COPYING.GPL'
--- COPYING.GPL 1970-01-01 00:00:00 +0000
+++ COPYING.GPL 2012-02-02 12:33:19 +0000
@@ -0,0 +1,676 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
=== renamed file 'COPYING.GPL' => 'COPYING.GPL.moved'
=== renamed file 'COPYING' => 'COPYING.moved'
=== added file 'ChangeLog'
--- ChangeLog 1970-01-01 00:00:00 +0000
+++ ChangeLog 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1560 @@
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-timestamp.c:
+ * src/zeitgeist-timestamp.h:
+ * tests/test-timestamp.c:
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.namespace:
+ * bindings/zeitgeist-1.0.vapi:
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/Makefile.am:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+ * src/zeitgeist.h:
+ * tests/Makefile.am:
+
+ Merge lp:~libzeitgeist-developers/libzeitgeist/timestamps. WARNING: This causes an API break.
+
+ Add a new namespace Zeitgeist.TimeStamp/zeitgeist_timestamp with convenience functions and constants for dealing with timestamps.
+
+ The following macros have been changed:
+
+ - ZEITGEIST_TIMESTAMP_TO_GTIMEVAL is now zeitgeist_timestamp_to_timeval
+ - ZEITGEIST_GTIMEVAL_TO_TIMESTAMP is now zeitgeist_timestamp_from_timeval
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.namespace:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Vala: The Zeitgeist.Timestamp namespace should still include zeitgeist.h not zeitgeist-1.0-custom.h
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Update VAPI with new Zeitgeist.Timestamp bindings and remove timestamp_to_timeval() and timeval_to_timestamp()
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-result-set.h:
+
+ Sync with trunk
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-timestamp.c:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-timestamp.c:
+ * src/zeitgeist-timestamp.h:
+ * tests/Makefile.am:
+
+ Add some tests for timestamp handling
+
+ Fix rounding errors where gint64 conversions where used
+
+ Add the methods zeitgeist_timestamp_to_date, zeitgeist_timestamp_from_dmy, and zeitgeist_timestamp_from_date
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-timestamp.c:
+
+ Hook up gtk-docs for the new zeitgeist-timestamp APIs
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+ * src/zeitgeist-timestamp.c:
+ * src/zeitgeist-timestamp.h:
+
+ API BREAK: Implement initial stab add convenience functions for dealing with timestamps
+
+ The following macros have been changed:
+
+ - ZEITGEIST_TIMESTAMP_TO_GTIMEVAL is now zeitgeist_timestamp_to_timeval
+ - ZEITGEIST_GTIMEVAL_TO_TIMESTAMP is now zeitgeist_timestamp_from_timeval
+
+2010-06-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-timestamp.c:
+ * src/zeitgeist-timestamp.h:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+
+ Import stub source files to hold the timestamp code and wire it up in the build system
+
+2010-06-17 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-result-set.h:
+
+ Vala: Patch from Michal Hruby to not ref the Events when iterating over a ResultSet with foreach
+
+2010-06-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.metadata:
+
+ Mark the Cancellable argument for Zeitgeist.Index.search() as nullable in the VAPI metadata
+
+2010-06-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-timerange.h:
+
+ Doc typo
+
+2010-06-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * configure.ac:
+
+ Bump version to 0.1.2
+
+2010-06-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events-alt.vala:
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-result-set.h:
+
+ Vala: Make Zeitgeist.ResultSet work with the foreach() iterator protocol - so you can do 'foreach (var event in result_set) { bleh; }'
+
+2010-06-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.vapi:
+
+ Make the GCancellable argument to Zeitgeist.Index.search() nullable in the ZG VAPI
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * NEWS:
+ * configure.ac:
+
+ Release libzeitgeist-0.1.1
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * NEWS:
+
+ Release 0.1.0
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/search-events.c:
+ * src/zeitgeist-index.c:
+ * src/zeitgeist-index.h:
+ * src/zeitgeist-result-set.c:
+ * src/zeitgeist-result-set.h:
+ * src/zeitgeist-simple-result-set.c:
+ * src/zeitgeist-simple-result-set.h:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * configure.ac:
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * doc/reference/zeitgeist-1.0.types:
+ * examples/Makefile.am:
+ * examples/find-events.c:
+ * examples/monitor-events.c:
+ * src/Makefile.am:
+ * src/marshal.list:
+ * src/org.gnome.zeitgeist.Log.xml:
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist.h:
+ * tests/Makefile.am:
+ * tests/test-event.c:
+ * tests/test-log.c:
+
+ Merge lp:~libzeitgeist-developers/libzeitgeist/fts-api
+
+ * Brings in new API to talk to Zeitgeist's FTS extension
+ * New interface ZeitgeistResultSet
+ * API+ABI BREAK: zeitgeist_log_find_events(), zeitgeist_log_get_events(), and the signal ZeitgeistMonitor::events-inserted have changed to pass a ZeitgeistResultSet where they passed a GPtrArray of events before
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/monitor-events.c:
+
+ Remove unsused var
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.vapi:
+
+ Fix from Michal Hruby to the Zeitgeist VAPI
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * configure.ac:
+ * tests/Makefile.am:
+ * tests/test-event.c:
+
+ Patch from Michal Hruby to include and link against gio-unix-2.0 in the test-event.c test suite (since it uses GDesktopAppInfos)
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-event.c:
+
+ Update VAPI to reflect API changes with regards to ZeitgeistResultSet and add support for ZeitgeistIndex
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-index.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-monitor.c:
+
+ Fix compile time warning because of missing include of "zeitgeist-simple-result-set.h"
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/monitor-events.c:
+ * src/marshal.list:
+ * src/zeitgeist-monitor.c:
+
+ API CHANGE: Make the signal ZeitgeistMonitor::events-inserted use a ZeitgeistResultSet in stead of a GPtrArray
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/search-events.c:
+ * examples/Makefile.am:
+ * examples/find-events.c:
+ * examples/monitor-events.c:
+ * src/zeitgeist-index.c:
+ * src/zeitgeist-index.h:
+ * src/zeitgeist-result-set.c:
+
+ API CHANGE: zeitgeist_index_search_finish() now returns a ZeitgeistResultSet instead of a GPtrArray
+
+ Add new example using the ZeitgeistIndex API to do full text searches
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-log.c:
+
+ Tighten the tests in test-log.c for the new ZeitgeistResultSet class
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-simple-result-set.c:
+ * tests/test-log.c:
+
+ API CHANGE: zeitgeist_log_get_events_finish() and zeitgeist_log_find_events_finish() now return a ZeitgeistResultSet.
+
+ Ported unit tests and examples accordingly.
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-result-set.c:
+ * src/zeitgeist-simple-result-set.c:
+
+ Add doc strings to undocumented methods on ZeitgeistResultSet.
+
+2010-06-10 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-result-set.c:
+ * src/zeitgeist-result-set.h:
+ * src/zeitgeist-simple-result-set.c:
+
+ Add methods ZeitgeistResultSet.tell() and peek()
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-simple-result-set.c:
+ * src/zeitgeist-simple-result-set.h:
+ * src/Makefile.am:
+
+ Add ZeitgeistSimpleResultSet into the build
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-result-set.c:
+ * src/zeitgeist-result-set.h:
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+
+ Add interface for result sets. We are going to need that for zeitgeist_index_search() and we might as well use it for zeitgeist_log_find_events() and zeitgeist_log_get_events()
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-index.c:
+
+ Add doc strings for new ZeitgeistIndex API and describe the query language
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * doc/reference/zeitgeist-1.0.types:
+ * src/zeitgeist-index.c:
+ * src/zeitgeist-index.h:
+
+ Stub API docs for ZeitgeistIndex
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-index.c:
+ * src/zeitgeist-index.h:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+
+ Initial UNTESTED impl of ZeitgeistIndex for accessing the Zeitgeist FTS extension
+
+2010-06-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Add EggDBus and automake hooks to generate interfaces for the Zeitgeist FTS extension org.gnome.zeitgeist.Index
+
+2010-06-01 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-mimetypes.c:
+
+ Map the text/html mimetype to ZEITGEIST_NFO_HTML_DOCUMENT instead of ZEITGEIST_NFO_SOURCE_CODE
+
+2010-06-01 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-mimetypes.c:
+
+ Add https URI scheme for pre-loaded manifestations
+
+2010-05-28 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+
+ Make ZeitgeistLog observe when/if the Zeitgeist daemon leave/enters the bus. When it enters the bus all active monitors are reinstated. This fixes bug #578743: "ZeitgeistMonitor stops working on ZG restart".
+
+2010-05-28 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/Makefile.am:
+
+ In check-headless also launch a fake X server because dbus-launch requires that (we're using Xvfb)
+
+2010-05-28 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.am:
+
+ Let the 'check-headless' target be available from the top level dir
+
+2010-05-28 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/Makefile.am:
+
+ Add a new target 'check-headless' that sets up a private bus and a Zeitgeist instance that only uses a memory backedd DB
+
+2010-05-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * src/zeitgeist-eggdbusconversions.c:
+
+ Merge Michal Hruby's branch, lp:~mhr3/libzeitgeist/various-fixes, fixing a memleak in _zeitgeist_event_to_egg_zeitgeist_event
+
+2010-05-09 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * src/zeitgeist-eggdbusconversions.c:
+
+ Fix leak in ZeitgeistEvent -> EggZeitgeistEvent conversion
+
+2010-05-04 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-eggdbusconversions.c:
+ * tests/test-eggdbusconversions.c:
+
+ Merge Michal Hruby's branch lp:~mhr3/libzeitgeist/various-fixes which fixes dbus marshalling of events with empty subjects.
+
+ Added a unit test that catches this case.
+
+2010-04-30 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * src/zeitgeist-eggdbusconversions.c:
+
+ Fix subject marshalling
+
+2010-04-30 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * src/zeitgeist-monitor.c:
+
+ Merged trunk
+
+2010-04-29 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * doc/reference/zeitgeist-1.0.types:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-monitor.c:
+
+ Merge trunk
+
+2010-04-29 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+
+ Doh... Props needs to be readwrite AND construct only...
+
+2010-04-29 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+
+ Improve docs for ZeitgeistMonitor and make the event-templates and time-range properties read-only.
+
+2010-04-29 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * configure.ac:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+
+ Merge Michal Hruby's branch lp:~mhr3/libzeitgeist/various-fixes into trunk. This fixes ZeitgeistMonitor's Vala API and makes the method signature of zeitgeist_log_insert_events_from_ptrarray() be in line with those of GIO async methods.
+
+ Also lower EggDBus requirements to 0.5 (from 0.6)
+
+2010-04-29 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ insert_events_from_ptrarray: cancellable should be 3rd param
+ Regenerate vapi
+
+2010-04-28 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-monitor.c:
+
+ Specialize Monitor signal definition
+
+2010-04-28 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ Swap parameter order for insert_events_from_ptrarray
+
+2010-04-28 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+
+ More fixes to the bindings
+
+2010-04-27 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Fix find_related_uris binding
+
+2010-04-27 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * src/zeitgeist-mimetypes.c:
+ * src/zeitgeist-mimetypes.h:
+ * tests/test-mimetypes.c:
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+ * tests/Makefile.am:
+
+ Merge trunk
+
+2010-04-27 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+
+ Fix typo
+
+2010-04-27 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-monitor.c:
+
+ Fix Vala binding of ZeitgeistMonitor
+
+2010-04-23 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-monitor.h:
+
+ Add missing get_type for Monitor class - fixes generated bindings
+
+2010-04-23 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * tests/test.desktop:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * tests/Makefile.am:
+ * tests/test-event.c:
+
+ Merge trunk
+
+2010-04-23 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * AUTHORS:
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * configure.ac:
+ * examples/find-events.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * tests/test-log.c:
+
+ Merge trunk
+
+2010-04-29 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-sections.txt:
+
+ Fix ref to egg_zeitgeist_storage_state_get_type in docs. Should be zeitgeist_storage_state_get_type
+
+2010-04-29 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0.types:
+
+ Add zeitgeist-1.0.types to doc generation. This makes gtk-doc include properties and signals for the classes
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/Makefile.am:
+ * src/zeitgeist-mimetypes.c:
+ * src/zeitgeist-mimetypes.h:
+ * src/zeitgeist.h:
+ * tests/test-mimetypes.c:
+
+ Complete impl of mimetype and URI scheme mapping. Document it and add it to the public headers since it's quite nifty.
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-mimetypes.c:
+
+ Add some image types
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-mimetypes.c:
+ * tests/test-mimetypes.c:
+
+ Start adding a tonne of mimetype mappings and add some more tests for these
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-mimetypes.c:
+
+ Add a few more tests for the mime/uri scheme mapping
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-mimetypes.c:
+ * src/zeitgeist-mimetypes.h:
+ * tests/test-mimetypes.c:
+ * src/Makefile.am:
+ * tests/Makefile.am:
+
+ Start adding convenience functions to guess interpretation types from mimetypes and manifestations types from URI schemes. Unfinished.
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Add new method to VAPI Event.set_actor_from_app_info()
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test.desktop:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * tests/Makefile.am:
+ * tests/test-event.c:
+
+ Add new method zeitgeist_event_set_actor_from_app_info(), and add unit tests for this
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * AUTHORS:
+
+ Add Michal in AUTHORS
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Update Vala bindings to new _finish() API, where we return the actual return value from the _finish() functions, but no longer as an our-arg
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * tests/test-log.c:
+
+ Convert all zeitgeist_log_*_finish() functions to the standard GIO signature (ZeitgeistLog *self, GAsyncResult *res, GError **error) and return the method result in the return value instead of an out-arg. This should also improve Vala async integration.
+
+2010-04-23 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.defines:
+ * bindings/zeitgeist-1.0.excludes:
+ * bindings/Makefile.am:
+ * bindings/generate_vapi:
+ * bindings/zeitgeist-1.0.deps:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+ * tests/test-log.c:
+
+ Merge Michal Hruby's branch lp:~mhr3/libzeitgeist/various-fixes containing a set of improvements for Vala support. Please see https://code.launchpad.net/~mhr3/libzeitgeist/various-fixes/+merge/23927 for review comments.
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Few more Vala ownership fixes
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * tests/test-log.c:
+
+ Tag the Vala bindings as async to make our lives easier.
+ Vala requires the AsyncResult parameter to be always second, to let's not fight it.
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/Makefile.am:
+
+ Add new files to Makefile
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Regenerate Vala bindings
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * bindings/zeitgeist-1.0-custom.vala:
+ * bindings/zeitgeist-1.0.defines:
+ * bindings/zeitgeist-1.0.excludes:
+ * bindings/Makefile.am:
+ * bindings/generate_vapi:
+ * bindings/zeitgeist-1.0.deps:
+
+ Fix Vala binding generation
+
+2010-04-22 Michal Hruby <michal.mhr@xxxxxxxxx>
+
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+
+ Use pointers in timestamp macros
+
+2010-04-21 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-ontology-manifestations.h:
+
+ Add missing file zeitgeist-ontology-manifestations.h
+
+2010-04-21 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * COPYING.GPL:
+ * Makefile.am:
+ * README:
+ * examples/find-events.c:
+ * examples/insert-event.vala:
+ * examples/monitor-events.c:
+
+ Add missing GPL licensing headers to examples. Include a copy of the GPL3
+
+2010-04-21 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/org.gnome.zeitgeist.Log.xml:
+ * src/zeitgeist-enums.h:
+
+ Add the new ResultTypes introduced in Zeitgeist 0.3.3.
+
+2010-04-20 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/zeitgeist-monitor.c:
+
+ Rename the prefix for our closure marshallers to have a _ prefix. Eg _zeitgeist_cclosure_marshal. This way we can strip these symbols out of the final .so with our export-symbols-regex
+
+2010-04-20 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-enumtypes.h.template:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-monitor.h:
+ * src/zeitgeist-ontology-interpretations.h:
+ * src/zeitgeist-subject.h:
+ * src/zeitgeist-timerange.h:
+ * src/zeitgeist.h:
+ * tests/Makefile.am:
+
+ Enforce single header includes. Programs can only include zeitgeist.h now, not any of the zeitgeist-*.h files
+
+2010-04-20 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * configure.ac:
+
+ Add silent rules to build
+
+2010-04-20 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.metadata:
+
+ Vala: Transfer ownership of ptrarray in zeitgeist_log_insert_events_from_ptrarray
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.vapi:
+ * examples/insert-event.vala:
+
+ Nudge about trying to get the Vala bindings to work
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ Implement zeitgeist_log_insert_events_no_reply()
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/insert-event.vala:
+
+ Include preliminary Vala example... Still can't compile, but I should be something like: valac --pkg glib-2.0 --pkg gio-2.0 --pkg zeitgeist-1.0 --vapidir=/opt/share/vala/vapi insert-event.vala
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.vapi:
+
+ Update VAPI with new API for Log.insert_events()
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.am:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-eggdbusconversions.h:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * tests/test-log.c:
+
+ Make zeitgeist_log_insert_events() a varargs function and introduce to new variants of it _valist() and _from_ptrarray()
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * bindings:
+ * bindings/Makefile.am:
+ * bindings/generate_vapi:
+ * bindings/zeitgeist-1.0.deps:
+ * bindings/zeitgeist-1.0.files:
+ * bindings/zeitgeist-1.0.gi:
+ * bindings/zeitgeist-1.0.metadata:
+ * bindings/zeitgeist-1.0.namespace:
+ * bindings/zeitgeist-1.0.vapi:
+ * Makefile.am:
+ * configure.ac:
+
+ Import Vala VAPI
+
+2010-04-19 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Include the ontology headers in the installed development headers
+
+2010-04-18 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/monitor-events.c:
+ * src/zeitgeist-monitor.c:
+
+ Fix emission of events-deleted signal from ZeitgeistMonitor. We did a premature free of some memory we needed.
+
+ Make monitor-events.c example monitor events for any timestamp
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-event.c:
+ * src/zeitgeist-subject.c:
+ * tests/Makefile.am:
+
+ Add unit tests for ZeitgeistEvent (and subject) constructors
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+
+ Add some convenience constructors to ZeitgeistEvent and ZeitgeistSubject
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+ * tools/onto2c.py:
+ * src/zeitgeist-ontology.h:
+ * src/zeitgeist-ontology-interpretations.h:
+
+ Split up ontology in an 'interpretations' and 'manifestations' part
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-ontology.h:
+ * tools/onto2c.py:
+
+ w00t. External links to Nepomuk ontolgies work inside the gtk-doc now
+
+ Also list the children of each symbol of the ontology in the gtk-doc
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+
+ Include the ontology macros in the generated API docs
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-ontology.h:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+
+ Include autogenerated ontology macros generated via a magic script using the lp:~zeitgeist/zeitgeist/ontology_definition branch of Zeitgeist
+
+2010-04-16 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tools:
+ * tools/onto2c.py:
+
+ Import tool to transcode the Zeitgeist ontology into a set of C macros
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ w00t. distcheck works again
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.am:
+
+ Desperately try and fix distcheck now that I added gtk-doc
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+
+ Complete docs for ZeitgeistEvent
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-event.c:
+
+ More doc-work
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc/reference/zeitgeist-1.0-docs.sgml:
+ * doc/reference/zeitgeist-1.0-sections.txt:
+ * Makefile.am:
+ * configure.ac:
+ * doc/reference/Makefile.am:
+
+ The docs are not completely wacked now... :-)
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * doc:
+ * doc/Makefile.am:
+ * doc/reference:
+ * doc/reference/Makefile.am:
+
+ Start adding gtk-doc
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Makefile.am shuffling to fix distcheck
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+
+ Rename ZEITGEIST_GTIMEVAL_TO_SYSTEM_TIME -> ZEITGEIST_GTIMEVAL_TO_TIMESTAMP
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-eggdbusconversions.c:
+ * tests/test-eggdbusconversions.c:
+
+ Fix nasty rounding/casting error clipping timestamps when passed over the wire
+
+2010-04-15 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/Makefile.am:
+ * src/Makefile.am:
+ * src/zeitgeist.h:
+ * tests/Makefile.am:
+ * zeitgeist-1.0.pc.in:
+
+ Rename libs and pkg package name to zeitgeist-1.0 (so we can have parallel installs if we ever need to break API/ABI)
+
+ Install development headers on make install
+
+2010-04-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * examples/monitor-events.c:
+
+ Clean up includes in the examples
+
+2010-04-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+
+ Doc twiddling...
+
+2010-04-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/monitor-events.c:
+ * src/marshal.list:
+ * src/zeitgeist-monitor.c:
+
+ Fix crasher: ZeitgeistMonitor::events-inserted is not VOID__OBJECT_OBJECT, but VOID__OBJECT_BOXED. Signal emiisions from ZeitgeistMonitor works in example/monitor-events now
+
+2010-04-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-eggdbusconversions.c:
+ * tests/test-log.c:
+ * tests/test-monitor.c:
+ * tests/test-timerange.c:
+
+ Fix test headers to correctly ref me as the author
+
+2010-04-14 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/marshal.list:
+ * configure.ac:
+ * src/Makefile.am:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+
+ Implement signal emissions on ZeitgeistMonitor
+
+ Add needed glib-genmarshal magic for signal emissions
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+
+ Clarify a FIXME about missing signals for the monitors
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/monitor-events.c:
+ * examples/Makefile.am:
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-monitor.c:
+ * tests/test-eggdbusconversions.c:
+
+ Add small example program that listens for events via a ZeitgeistMonitor
+
+ Fix how we convert 0 timestamps and event ids to wire format. Hint: They are empty strings not "0". This fixes event matching for the match-all-monitor
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+
+ All methods in ZeitgeistLog API implemented (but many of them untested). This round implements the install/remove_monitor() calls
+
+ Make ZeitgeistMonitor no longer subclass GInitiallyUnowned - that was inconvenient when they export a service
+
+ Start hooking up the ZeitgeistMonitor class as an eggdbus service. Mostly done. Primarily missing is emitting some nice GObject signals when events are received
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ Implement ZeitgeistLog.find_related_uris()
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Fix distcheck
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-timerange.h:
+ * tests/Makefile.am:
+
+ Now that we strip the main lib from stray symbols we need to add some helper files to our test cases
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Add -export-symbols-regex '^zeitgeist_.*' to LDFLAGS to limit the symbols exported
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.h:
+
+ Outcomment un-implemented parts of the zeitgeist-log.h
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Add EggZeitgeist magic to generate the org.gnome.zeitgeist.{Blacklist,Monitor} interfaces
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+
+ Implement path allocation and some convenience getters for ZeitgeistMonitor
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+
+ Implement delete_log() and quit() methods on ZeitgeistLog
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ Refactor some of the internal dbus dispatching so that we can reduce some code duplication internally... Also implement find_event_ids()
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-log.c:
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+ * tests/Makefile.am:
+
+ zeitgeist_log_{insert,get,delete}_events() now work and is unit tested
+
+ Fix slight API-oddity in ZeitgeistEvent where get/set_timestamp() worked with glong and not gint64
+
+ Removed some debug statements
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+
+ Plug some leaks in zeitgeist_log_find_events() and add stub impl of zeitgeist_log_insert_events
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-log.c:
+ * tests/test-eggdbusconversions.c:
+
+ Don't expose the subjects of an event as a GPtrArray. This is unhandy for the caller and not flexible for the implementation
+
+2010-04-13 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+
+ Print out subject URIs of looked up recent events
+
+2010-04-09 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+
+ Fixes a range of important issues:
+
+ * Premature finalization of ZeitgeistLog objects in case you passed them to a method without holding a ref yourself. This was caused by ZeitgeistLog being a GInitiallyUnowned. That is no longer the case. It is now a normal GObject
+
+ * The timestamps for ZeitgeistTimeRange where truncated to 32 bits since I assumed that glong was 8 bits - it's only 4... Now we use gint64 everywhere and everything is dandy
+
+ * Added some formatting methods and convenience macros to ZeitgeistTimeRange
+
+2010-04-08 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples/find-events.c:
+ * src/zeitgeist-eggdbusconversions.c:
+
+ Fix _egg_zeitgeist_events_to_zeitgeist_events() which didn't fill in the GPtrArray of Events
+
+2010-04-08 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * examples:
+ * examples/Makefile.am:
+ * examples/find-events.c:
+ * src/zeitgeist.h:
+ * Makefile.am:
+ * configure.ac:
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-eggdbusconversions.h:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+
+ Add global header file zeitgeist.h
+
+ Add example program querying for some events (it crashes currently)
+
+2010-04-08 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-eggdbusconversions.c:
+
+ EggDBus <-> Zeitgeist conversion funcs pretty well tested by now
+
+2010-04-08 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-subject.h:
+ * tests/test-eggdbusconversions.c:
+
+ Export *_get_type() functions for ZeitgeistEvent and ZeitgeistSubject
+
+ Add some more tests to test-eggdbusconversions
+
+2010-04-08 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-eggdbusconversions.c:
+ * src/zeitgeist-eggdbusconversions.h:
+ * tests/test-eggdbusconversions.c:
+ * src/Makefile.am:
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+ * tests/Makefile.am:
+
+ Start implementing conversion functions eggzeitgeist <-> proper zeitgeist GObjects.
+
+ Add a first (and passing) test case for said functionality
+
+2010-04-07 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Add some more of the eggdbus generated docbook files to the autofoo knowledge pool
+
+2010-04-07 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-enums.h:
+ * src/zeitgeist-enumtypes.c.template:
+ * src/zeitgeist-enumtypes.h.template:
+ * src/Makefile.am:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-subject.c:
+ * tests/test-monitor.c:
+ * tests/test-timerange.c:
+
+ Include all needed source files in the build and fix any compile time errors they had
+
+ Generate enum types for ZeitgeistStorageState and ZeitgeistResultType
+
+ Impl start of what is to be ZeitgeistLog. It can look up the right EggDBus interface at least now. Now we just have to write the proxy calls and marshallers to hide the EggDBus types
+
+2010-04-07 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-monitor.c:
+ * src/Makefile.am:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+ * tests/Makefile.am:
+
+ Impl of ZeitgeistMonitor mostly working. Added a test suite for said class
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+
+ Start implementing ZeitgeistMonitor
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * tests/test-timerange.c:
+
+ Implement an actually meaningful test of timerange construction
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.decl:
+ * tests:
+ * tests/Makefile.am:
+ * tests/test-timerange.c:
+ * Makefile.am:
+ * configure.ac:
+
+ Import stub for test harness
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.h:
+
+ Add GObject boilerplate to ZeitgeistLog
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+
+ Nudge about with the decl of the private structures for Zeitgest{Event,Subject}
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+
+ Implement ZeitgeistTimeRange
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-log.c:
+ * src/zeitgeist-log.h:
+ * src/zeitgeist-monitor.c:
+ * src/zeitgeist-monitor.h:
+ * src/zeitgeist-timerange.c:
+ * src/zeitgeist-timerange.h:
+ * src/zeitgeist-proxy.c:
+ * src/zeitgeist-proxy.h:
+ * src/zeitgeist-subject.c:
+
+ Write the core ZeigeistLog API (abstracting out DBus and thus EggDBus entirely)
+
+ Include stub files for the objects we need to write
+
+ Remove obsolete class ZeitgeistProxy
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Shuffle about the declaration of RemoveMonitor to make generated EggDBus code more sane
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+
+ Don't expose "private parts" in public
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-subject.c:
+
+ Introduce enums that define the offsets of the individual fields of the zeitgeist events' and subjects' wire format
+
+ Rename event.application -> event.actor
+
+ Clean up Event finalizer
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+
+ Make ZeitgeistSubject subclass of GInitiallyUnowned
+
+ Prettify zeitgeist-subject.h
+
+2010-04-06 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.am:
+
+ Fix leftover from gtx copy-paste of Makefile.am
+
+2010-03-26 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+
+ Huzzah! Make distcheck passes!
+
+2010-03-25 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+
+ Make ZeitgeistEvent a subclass of GInitiallyUnowned
+
+2010-03-25 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/Makefile.am:
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Generate enumerations for the data offsets of event- and subject arrays
+
+2010-03-25 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Add a name to the out arg of InsertEvents. That makes the generated EggDBus sources nicer
+
+2010-03-24 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * AUTHORS:
+ * MAINTAINERS:
+
+ Shamelessly promote myself to maintainer
+
+2010-03-24 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * MAINTAINERS:
+ * configure.ac:
+ * src/Makefile.am:
+
+ Autotools build is working! Party time!
+
+2010-03-24 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * AUTHORS:
+ * COPYING:
+ * ChangeLog:
+ * NEWS:
+ * README:
+ * configure.ac:
+ * src/Makefile.am:
+
+ Autofoo almost working
+
+2010-03-24 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * Makefile.am:
+ * autogen.sh:
+ * configure.ac:
+ * src/Makefile.am:
+ * zeitgeist-1.0.pc.in:
+ * src/zeitgeist-template.c:
+ * src/zeitgeist-template.h:
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Start integrating eggdbus <-> autotools. The generated EggDBus bindings for Zeitgeist looks mighty nice
+
+2010-03-24 Mikkel Kamstrup Erlandsen <kamstrup@hardback>
+
+ * src/zeitgeist-gen.xml:
+ * src/org.gnome.zeitgeist.Log.xml:
+
+ Fill in all of the DBus introspection data and write all EggDBus Enums and Struct types into the introspection as well
+
+2009-12-07 Jason Smith <jason@t500>
+
+ * src/zeitgeist-proxy.c:
+
+ Remove stray line
+
+2009-12-07 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-gen.xml:
+ * src/zeitgeist-proxy.c:
+ * src/zeitgeist-proxy.h:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-template.c:
+
+ modified:
+ src/zeitgeist-event.c : typo
+ src/zeitgeist-gen.xml : Update to match ZG API
+ src/zeitgeist-proxy.c : Actually pass a folder in where needed
+ Ensure we use gint64 for timestamps
+ src/zeitgeist-proxy.h
+ src/zeitgeist-subject.c : typo
+ src/zeitgeist-template.c : typo
+
+2009-12-07 Jason Smith <jason@t500>
+
+ * src/zeitgeist-gen.xml:
+ * src/zeitgeist-proxy.c:
+
+ Add xml file with which bindings can be generated with dbus-glib-tool
+ Add some more work to proxy
+
+2009-12-07 Jason Smith <jason@t500>
+
+ * src/zeitgeist-proxy.c:
+ * src/zeitgeist-proxy.h:
+
+ Further progress on proxy class
+
+2009-12-07 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-proxy.c:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-template.c:
+
+ Add blank proxy class
+
+2009-12-06 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-proxy.h:
+ * src/zeitgeist-subject.h:
+ * src/zeitgeist-template.h:
+
+ More copy and paste showing
+
+2009-12-04 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+
+ modified:
+ src/zeitgeist-event.c : change variable names
+
+2009-12-04 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-template.c:
+
+ modified: Oops my copy and paste was showing
+ src/zeitgeist-event.c
+ src/zeitgeist-subject.c
+ src/zeitgeist-template.c
+
+2009-12-04 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+
+ modified:
+ src/zeitgeist-event.c : Minor changes
+ src/zeitgeist-subject.c : Initial implementation
+ src/zeitgeist-subject.h : Minor changes
+
+2009-12-04 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-template.c:
+ * src/zeitgeist-template.h:
+
+ Some minor changes to template (use const, use strdup)
+ Initial implementation of event, should look a LOT like template...
+
+2009-12-04 Jason Smith <jason@t500>
+
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-template.c:
+
+ modified:
+ src/zeitgeist-event.c : Start implementation
+ src/zeitgeist-template.c : Finish initial implementation
+
+2009-12-03 Jason Smith <jason@t500>
+
+ * src:
+ * src/zeitgeist-event.c:
+ * src/zeitgeist-event.h:
+ * src/zeitgeist-proxy.c:
+ * src/zeitgeist-proxy.h:
+ * src/zeitgeist-subject.c:
+ * src/zeitgeist-subject.h:
+ * src/zeitgeist-template.c:
+ * src/zeitgeist-template.h:
+
+ Initial import, includes headers as defined by initial API documentation. *nothing* works yet.
+
=== renamed file 'ChangeLog' => 'ChangeLog.moved'
=== added file 'MAINTAINERS'
--- MAINTAINERS 1970-01-01 00:00:00 +0000
+++ MAINTAINERS 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1 @@
+Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
\ No newline at end of file
=== renamed file 'MAINTAINERS' => 'MAINTAINERS.moved'
=== added file 'Makefile.am'
--- Makefile.am 1970-01-01 00:00:00 +0000
+++ Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,33 @@
+SUBDIRS = \
+ src \
+ bindings \
+ doc \
+ examples \
+ tests
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = zeitgeist-1.0.pc
+
+zeitgeistdocdir = $(datadir)/doc/libzeitgeist
+
+zeitgeistdoc_DATA = \
+ README \
+ COPYING \
+ AUTHORS \
+ INSTALL \
+ MAINTAINERS
+
+EXTRA_DIST = \
+ autogen.sh \
+ zeitgeist-1.0.pc.in \
+ COPYING.GPL \
+ tools/onto2c.py \
+ $(zeitgeistdoc_DATA)
+
+DISTCLEANFILES =
+
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+check-headless:
+ cd tests; \
+ make check-headless
=== renamed file 'Makefile.am' => 'Makefile.am.moved'
=== added file 'Makefile.decl'
--- Makefile.decl 1970-01-01 00:00:00 +0000
+++ Makefile.decl 2012-02-02 12:33:19 +0000
@@ -0,0 +1,60 @@
+# GLIB - Library of useful C routines
+#
+# This file is copied almost verbatim from the GLib-2.0 distribution
+#
+
+GTESTER = gtester # for non-GLIB packages
+GTESTER_REPORT = $(top_builddir)/test/gtester-report # for the GLIB package
+
+# initialize variables for unconditional += appending
+EXTRA_DIST =
+TEST_PROGS =
+
+### testing rules
+
+# test: run all tests in cwd and subdirs
+test: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
+ @ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done
+# test-report: run tests in subdirs and generate report
+# perf-report: run tests in subdirs with -m perf and generate report
+# full-report: like test-report: with -m perf and -m slow
+test-report perf-report full-report: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || { \
+ case $@ in \
+ test-report) test_options="-k";; \
+ perf-report) test_options="-k -m=perf";; \
+ full-report) test_options="-k -m=perf -m=slow";; \
+ esac ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
+ elif test -n "${TEST_PROGS}" ; then \
+ ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
+ fi ; \
+ }
+ @ ignore_logdir=true ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
+ ignore_logdir=false ; \
+ fi ; \
+ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done ; \
+ $$ignore_logdir || { \
+ echo '<?xml version="1.0"?>' > $@.xml ; \
+ echo '<report-collection>' >> $@.xml ; \
+ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
+ sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
+ done ; \
+ echo >> $@.xml ; \
+ echo '</report-collection>' >> $@.xml ; \
+ rm -rf "$$GTESTER_LOGDIR"/ ; \
+ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
+ }
+.PHONY: test test-report perf-report full-report
+# run make test as part of make check
+check-local: test
=== added file 'NEWS'
--- NEWS 1970-01-01 00:00:00 +0000
+++ NEWS 2012-02-02 12:33:19 +0000
@@ -0,0 +1,52 @@
+2010-08-05: libzeitgeist 0.2.4 "Hemlock"
+
+ * New ResultTypes to sort by subject origin as supported by Zeitgeist 0.5.0
+
+ * Fix nasty bug lp:559350 causing an integer overflow in Zeitgeist
+ (Michal Hruby)
+
+2010-07-29: libzeitgeist 0.2.3 "Delphinium"
+
+ * New API to talk to the Data Source Registry extension of Zeitgeist
+ (Michal Hruby)
+
+ * A new "connected" property on ZeitgeistLog telling you whether or
+ not the Zeitgeist daemon is running (Michal Hruby)
+
+ * Fix a crasher when finalizing a ZeitgeistLog with active monitors
+ installed (Michal Hruby)
+
+2010-06-23: libzeitgeist 0.2.2 "Deadly Nightshade"
+
+ * New API: zeitgeist_timestamp_prev_midnight() and
+ zeitgeist_timestamp_next_midnight().
+
+ * API refinement: The functions zeitgeist_timestamp_from_date() and
+ zeitgeist_timestamp_from_dmy() now returns timestamps rounded off to
+ the midnight of the given date
+
+2010-06-18: libzeitgeist 0.2.1
+
+ * Fix nasty truncation/overflow of timestamps used in ZeitgeistTimeRange's
+ constructors casued by a missing include of zeitgeist-timestamp.h in
+ zeitgeist-timerange.c making all function return types default to int for
+ unknown symbols
+
+2010-06-17: libzeitgeist 0.2.0
+
+ * New suite of convenience functions in zeitgeist_timestamp_* and in the
+ Zeitgeist.Timestamp namespace if you are using Vala.
+
+ * The macros ZEITGEIST_TIMESTAMP_TO_GTIMEVAL and ZEITGEIST_GTIMEVAL_TO_TIMESTAMP
+ has been removed in favour of the new timestamp API
+
+ * Vala: Zeitgeist.ResultSet supports foreach now
+
+2010-06-10: libzeitgeist 0.1.1
+
+ * Doh. Rename tarball to libzeitgeist-$VERSION.at.gz to avoid
+ name clashes with the actuak Zeitgeist project :-)
+
+2010-06-10: libzeitgeist 0.1.0
+
+ * Initial release
=== renamed file 'NEWS' => 'NEWS.moved'
=== added file 'README'
--- README 1970-01-01 00:00:00 +0000
+++ README 2012-02-02 12:33:19 +0000
@@ -0,0 +1,7 @@
+Client library for interacting with the Zeitgeist daemon.
+
+Developed by Canonical Ltd in April 2010. The library is licensed
+under the GNU LGPL version 2.1, or (at your option) any later version.
+
+The unit tests and examples found in the tarball are all
+under the GNU GPL version 3.
=== renamed file 'README' => 'README.moved'
=== added file 'autogen.sh'
--- autogen.sh 1970-01-01 00:00:00 +0000
+++ autogen.sh 2012-02-02 12:33:19 +0000
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+
+PKG_NAME="zeitgeist"
+
+which gnome-autogen.sh || {
+ echo "You need gnome-common from the GNOME Git repository"
+ exit 1
+}
+
+USE_GNOME2_MACROS=1 \
+. gnome-autogen.sh
=== renamed file 'autogen.sh' => 'autogen.sh.moved'
=== added directory 'bindings'
=== added file 'bindings/Makefile.am'
--- bindings/Makefile.am 1970-01-01 00:00:00 +0000
+++ bindings/Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,22 @@
+NULL =
+
+vapidir = $(datadir)/vala/vapi
+
+dist_vapi_DATA = \
+ zeitgeist-1.0.deps \
+ zeitgeist-1.0.vapi \
+ $(NULL)
+
+dist_noinst_DATA = \
+ zeitgeist-1.0-custom.vala \
+ zeitgeist-1.0.defines \
+ zeitgeist-1.0.excludes \
+ zeitgeist-1.0.files \
+ zeitgeist-1.0.gi \
+ zeitgeist-1.0.metadata \
+ zeitgeist-1.0.namespace \
+ $(NULL)
+
+EXTRA_DIST = \
+ generate_vapi \
+ $(NULL)
=== added file 'bindings/generate_vapi'
--- bindings/generate_vapi 1970-01-01 00:00:00 +0000
+++ bindings/generate_vapi 2012-02-02 12:33:19 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Just issues the commands to create the vapi file
+# Would be nice to get autotools to make this at some point, but it sort
+# of requires the package to be installed (and called from pkg-config) first
+# so its a little messy
+
+cd $(dirname $0)
+vala-gen-introspect zeitgeist-1.0 .
+vapigen --pkg gobject-2.0 --pkg glib-2.0 --pkg gio-2.0 --library zeitgeist-1.0 zeitgeist-1.0.gi zeitgeist-1.0-custom.vala
+# nasty hack to force usage of PtrArray in recent versions of vapigen
+sed -i 's/GenericArray/PtrArray/g' zeitgeist-1.0.vapi
=== added file 'bindings/zeitgeist-1.0-custom.vala'
--- bindings/zeitgeist-1.0-custom.vala 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0-custom.vala 2012-02-02 12:33:19 +0000
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Michal Hruby <michal.mhr@xxxxxxxxx>
+ */
+
+namespace Zeitgeist
+{
+ public interface EggZeitgeistMonitor: GLib.Object
+ {
+ }
+
+ public interface ResultSet: GLib.Object
+ {
+ [CCode (cname = "_vala_zeitgeist_result_set_next_value")]
+ public unowned Event? next_value ();
+ [CCode (cname = "_vala_zeitgeist_result_set_iterator")]
+ public ResultSet iterator ();
+ }
+}
+
+namespace Zeitgeist.Timestamp
+{
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_SECOND", cheader_filename = "zeitgeist.h")]
+ public int64 SECOND;
+
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_MINUTE", cheader_filename = "zeitgeist.h")]
+ public int64 MINUTE;
+
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_HOUR", cheader_filename = "zeitgeist.h")]
+ public int64 HOUR;
+
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_DAY", cheader_filename = "zeitgeist.h")]
+ public int64 DAY;
+
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_WEEK", cheader_filename = "zeitgeist.h")]
+ public int64 WEEK;
+
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_YEAR", cheader_filename = "zeitgeist.h")]
+ public int64 YEAR;
+}
+
+// vim:et:ai:cindent:ts=2 sts=2 sw=2:
=== added file 'bindings/zeitgeist-1.0.defines'
--- bindings/zeitgeist-1.0.defines 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.defines 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1 @@
+-D_ZEITGEIST_H_INSIDE_
=== added file 'bindings/zeitgeist-1.0.deps'
--- bindings/zeitgeist-1.0.deps 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.deps 2012-02-02 12:33:19 +0000
@@ -0,0 +1,2 @@
+glib-2.0
+gio-2.0
=== added file 'bindings/zeitgeist-1.0.excludes'
--- bindings/zeitgeist-1.0.excludes 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.excludes 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1 @@
+include/zeitgeist-1.0/zeitgeist.h
=== added file 'bindings/zeitgeist-1.0.files'
--- bindings/zeitgeist-1.0.files 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.files 2012-02-02 12:33:19 +0000
@@ -0,0 +1,2 @@
+include/zeitgeist-1.0
+lib/libzeitgeist-1.0.so
=== added file 'bindings/zeitgeist-1.0.gi'
--- bindings/zeitgeist-1.0.gi 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.gi 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1142 @@
+<?xml version="1.0"?>
+<api version="1.0">
+ <namespace name="Zeitgeist">
+ <function name="data_sources_from_variant" symbol="zeitgeist_data_sources_from_variant">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="sources" type="GVariant*"/>
+ </parameters>
+ </function>
+ <function name="data_sources_to_variant" symbol="zeitgeist_data_sources_to_variant">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="sources" type="GPtrArray*"/>
+ </parameters>
+ </function>
+ <function name="events_from_valist" symbol="zeitgeist_events_from_valist">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="events" type="va_list"/>
+ </parameters>
+ </function>
+ <function name="events_from_variant" symbol="zeitgeist_events_from_variant">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="events" type="GVariant*"/>
+ </parameters>
+ </function>
+ <function name="events_to_variant" symbol="zeitgeist_events_to_variant">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="events" type="GPtrArray*"/>
+ </parameters>
+ </function>
+ <function name="interpretation_for_mimetype" symbol="zeitgeist_interpretation_for_mimetype">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="mimetype" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="manifestation_for_uri" symbol="zeitgeist_manifestation_for_uri">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="uri" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="register_mimetype" symbol="zeitgeist_register_mimetype">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="mimetype" type="gchar*"/>
+ <parameter name="interpretation_uri" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="register_mimetype_regex" symbol="zeitgeist_register_mimetype_regex">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="mimetype_regex" type="gchar*"/>
+ <parameter name="interpretation_uri" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="register_uri_scheme" symbol="zeitgeist_register_uri_scheme">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="uri_scheme" type="gchar*"/>
+ <parameter name="manifestation_type" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="symbol_get_all_children" symbol="zeitgeist_symbol_get_all_children">
+ <return-type type="GList*"/>
+ <parameters>
+ <parameter name="symbol" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="symbol_get_children" symbol="zeitgeist_symbol_get_children">
+ <return-type type="GList*"/>
+ <parameters>
+ <parameter name="symbol" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="symbol_get_parents" symbol="zeitgeist_symbol_get_parents">
+ <return-type type="GList*"/>
+ <parameters>
+ <parameter name="symbol" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="symbol_is_a" symbol="zeitgeist_symbol_is_a">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="symbol" type="gchar*"/>
+ <parameter name="parent" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="timestamp_for_now" symbol="zeitgeist_timestamp_for_now">
+ <return-type type="gint64"/>
+ </function>
+ <function name="timestamp_from_date" symbol="zeitgeist_timestamp_from_date">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="date" type="GDate*"/>
+ </parameters>
+ </function>
+ <function name="timestamp_from_dmy" symbol="zeitgeist_timestamp_from_dmy">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="day" type="GDateDay"/>
+ <parameter name="month" type="GDateMonth"/>
+ <parameter name="year" type="GDateYear"/>
+ </parameters>
+ </function>
+ <function name="timestamp_from_iso8601" symbol="zeitgeist_timestamp_from_iso8601">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="datetime" type="gchar*"/>
+ </parameters>
+ </function>
+ <function name="timestamp_from_timeval" symbol="zeitgeist_timestamp_from_timeval">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="tv" type="GTimeVal*"/>
+ </parameters>
+ </function>
+ <function name="timestamp_next_midnight" symbol="zeitgeist_timestamp_next_midnight">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="timestamp" type="gint64"/>
+ </parameters>
+ </function>
+ <function name="timestamp_prev_midnight" symbol="zeitgeist_timestamp_prev_midnight">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="timestamp" type="gint64"/>
+ </parameters>
+ </function>
+ <function name="timestamp_to_date" symbol="zeitgeist_timestamp_to_date">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="timestamp" type="gint64"/>
+ <parameter name="date" type="GDate*"/>
+ </parameters>
+ </function>
+ <function name="timestamp_to_iso8601" symbol="zeitgeist_timestamp_to_iso8601">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="timestamp" type="gint64"/>
+ </parameters>
+ </function>
+ <function name="timestamp_to_timeval" symbol="zeitgeist_timestamp_to_timeval">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="timestamp" type="gint64"/>
+ <parameter name="tv" type="GTimeVal*"/>
+ </parameters>
+ </function>
+ <enum name="ZeitgeistResultType" type-name="ZeitgeistResultType" get-type="zeitgeist_result_type_get_type">
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS" value="0"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS" value="1"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS" value="2"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS" value="3"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS" value="4"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS" value="5"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ACTOR" value="6"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ACTOR" value="7"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_ACTOR" value="8"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ACTOR" value="9"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN" value="10"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ORIGIN" value="11"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN" value="12"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN" value="13"/>
+ <member name="ZEITGEIST_RESULT_TYPE_OLDEST_ACTOR" value="14"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECT_INTERPRETATION" value="15"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECT_INTERPRETATION" value="16"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECT_INTERPRETATION" value="17"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECT_INTERPRETATION" value="18"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_RECENT_MIMETYPE" value="19"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_RECENT_MIMETYPE" value="20"/>
+ <member name="ZEITGEIST_RESULT_TYPE_MOST_POPULAR_MIMETYPE" value="21"/>
+ <member name="ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_MIMETYPE" value="22"/>
+ <member name="ZEITGEIST_RESULT_TYPE_RELEVANCY" value="100"/>
+ </enum>
+ <enum name="ZeitgeistStorageState" type-name="ZeitgeistStorageState" get-type="zeitgeist_storage_state_get_type">
+ <member name="ZEITGEIST_STORAGE_STATE_NOT_AVAILABLE" value="0"/>
+ <member name="ZEITGEIST_STORAGE_STATE_AVAILABLE" value="1"/>
+ <member name="ZEITGEIST_STORAGE_STATE_ANY" value="2"/>
+ </enum>
+ <object name="ZeitgeistDataSource" parent="GInitiallyUnowned" type-name="ZeitgeistDataSource" get-type="zeitgeist_data_source_get_type">
+ <method name="get_description" symbol="zeitgeist_data_source_get_description">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="get_event_templates" symbol="zeitgeist_data_source_get_event_templates">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="get_name" symbol="zeitgeist_data_source_get_name">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="get_timestamp" symbol="zeitgeist_data_source_get_timestamp">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="get_unique_id" symbol="zeitgeist_data_source_get_unique_id">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="is_enabled" symbol="zeitgeist_data_source_is_enabled">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="is_running" symbol="zeitgeist_data_source_is_running">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_data_source_new">
+ <return-type type="ZeitgeistDataSource*"/>
+ </constructor>
+ <constructor name="new_from_variant" symbol="zeitgeist_data_source_new_from_variant">
+ <return-type type="ZeitgeistDataSource*"/>
+ <parameters>
+ <parameter name="src" type="GVariant*"/>
+ </parameters>
+ </constructor>
+ <constructor name="new_full" symbol="zeitgeist_data_source_new_full">
+ <return-type type="ZeitgeistDataSource*"/>
+ <parameters>
+ <parameter name="id" type="gchar*"/>
+ <parameter name="name" type="gchar*"/>
+ <parameter name="desc" type="gchar*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ </parameters>
+ </constructor>
+ <method name="set_description" symbol="zeitgeist_data_source_set_description">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="description" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_enabled" symbol="zeitgeist_data_source_set_enabled">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="enabled" type="gboolean"/>
+ </parameters>
+ </method>
+ <method name="set_event_templates" symbol="zeitgeist_data_source_set_event_templates">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ </parameters>
+ </method>
+ <method name="set_name" symbol="zeitgeist_data_source_set_name">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="name" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_running" symbol="zeitgeist_data_source_set_running">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="running" type="gboolean"/>
+ </parameters>
+ </method>
+ <method name="set_timestamp" symbol="zeitgeist_data_source_set_timestamp">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="timestamp" type="gint64"/>
+ </parameters>
+ </method>
+ <method name="set_unique_id" symbol="zeitgeist_data_source_set_unique_id">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ <parameter name="unique_id" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="to_variant" symbol="zeitgeist_data_source_to_variant">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ <method name="to_variant_full" symbol="zeitgeist_data_source_to_variant_full">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="src" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </method>
+ </object>
+ <object name="ZeitgeistDataSourceRegistry" parent="GObject" type-name="ZeitgeistDataSourceRegistry" get-type="zeitgeist_data_source_registry_get_type">
+ <method name="get_data_sources" symbol="zeitgeist_data_source_registry_get_data_sources">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="get_data_sources_finish" symbol="zeitgeist_data_source_registry_get_data_sources_finish">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_data_source_registry_new">
+ <return-type type="ZeitgeistDataSourceRegistry*"/>
+ </constructor>
+ <method name="register_data_source" symbol="zeitgeist_data_source_registry_register_data_source">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="source" type="ZeitgeistDataSource*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="register_data_source_finish" symbol="zeitgeist_data_source_registry_register_data_source_finish">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="set_data_source_enabled" symbol="zeitgeist_data_source_registry_set_data_source_enabled">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="unique_id" type="gchar*"/>
+ <parameter name="enabled" type="gboolean"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="set_data_source_enabled_finish" symbol="zeitgeist_data_source_registry_set_data_source_enabled_finish">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <signal name="source-disconnected" when="FIRST">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="registry" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="source" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </signal>
+ <signal name="source-enabled" when="FIRST">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="registry" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="unique_id" type="char*"/>
+ <parameter name="enabled" type="gboolean"/>
+ </parameters>
+ </signal>
+ <signal name="source-registered" when="FIRST">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="registry" type="ZeitgeistDataSourceRegistry*"/>
+ <parameter name="source" type="ZeitgeistDataSource*"/>
+ </parameters>
+ </signal>
+ </object>
+ <object name="ZeitgeistEvent" parent="GInitiallyUnowned" type-name="ZeitgeistEvent" get-type="zeitgeist_event_get_type">
+ <method name="add_subject" symbol="zeitgeist_event_add_subject">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_actor" symbol="zeitgeist_event_get_actor">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="get_id" symbol="zeitgeist_event_get_id">
+ <return-type type="guint32"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="get_interpretation" symbol="zeitgeist_event_get_interpretation">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="get_manifestation" symbol="zeitgeist_event_get_manifestation">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="get_payload" symbol="zeitgeist_event_get_payload">
+ <return-type type="GByteArray*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="get_subject" symbol="zeitgeist_event_get_subject">
+ <return-type type="ZeitgeistSubject*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="index" type="gint"/>
+ </parameters>
+ </method>
+ <method name="get_timestamp" symbol="zeitgeist_event_get_timestamp">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_event_new">
+ <return-type type="ZeitgeistEvent*"/>
+ </constructor>
+ <constructor name="new_from_variant" symbol="zeitgeist_event_new_from_variant">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="event" type="GVariant*"/>
+ </parameters>
+ </constructor>
+ <constructor name="new_full" symbol="zeitgeist_event_new_full">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="interpretation" type="gchar*"/>
+ <parameter name="manifestation" type="gchar*"/>
+ <parameter name="actor" type="gchar*"/>
+ </parameters>
+ </constructor>
+ <constructor name="new_full_valist" symbol="zeitgeist_event_new_full_valist">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="interpretation" type="gchar*"/>
+ <parameter name="manifestation" type="gchar*"/>
+ <parameter name="actor" type="gchar*"/>
+ <parameter name="args" type="va_list"/>
+ </parameters>
+ </constructor>
+ <method name="num_subjects" symbol="zeitgeist_event_num_subjects">
+ <return-type type="gint"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ <method name="set_actor" symbol="zeitgeist_event_set_actor">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="actor" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_actor_from_app_info" symbol="zeitgeist_event_set_actor_from_app_info">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="appinfo" type="GAppInfo*"/>
+ </parameters>
+ </method>
+ <method name="set_id" symbol="zeitgeist_event_set_id">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="id" type="guint32"/>
+ </parameters>
+ </method>
+ <method name="set_interpretation" symbol="zeitgeist_event_set_interpretation">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="interpretation" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_manifestation" symbol="zeitgeist_event_set_manifestation">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="manifestation" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_payload" symbol="zeitgeist_event_set_payload">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="payload" type="GByteArray*"/>
+ </parameters>
+ </method>
+ <method name="set_timestamp" symbol="zeitgeist_event_set_timestamp">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ <parameter name="timestamp" type="gint64"/>
+ </parameters>
+ </method>
+ <method name="to_variant" symbol="zeitgeist_event_to_variant">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="event" type="ZeitgeistEvent*"/>
+ </parameters>
+ </method>
+ </object>
+ <object name="ZeitgeistIndex" parent="GObject" type-name="ZeitgeistIndex" get-type="zeitgeist_index_get_type">
+ <constructor name="new" symbol="zeitgeist_index_new">
+ <return-type type="ZeitgeistIndex*"/>
+ </constructor>
+ <method name="search" symbol="zeitgeist_index_search">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistIndex*"/>
+ <parameter name="query" type="gchar*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ <parameter name="offset" type="guint32"/>
+ <parameter name="num_events" type="guint32"/>
+ <parameter name="result_type" type="ZeitgeistResultType"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="search_finish" symbol="zeitgeist_index_search_finish">
+ <return-type type="ZeitgeistResultSet*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistIndex*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ </object>
+ <object name="ZeitgeistLog" parent="GObject" type-name="ZeitgeistLog" get-type="zeitgeist_log_get_type">
+ <method name="delete_events" symbol="zeitgeist_log_delete_events">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="event_ids" type="GArray*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="delete_events_finish" symbol="zeitgeist_log_delete_events_finish">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="delete_log" symbol="zeitgeist_log_delete_log">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="delete_log_finish" symbol="zeitgeist_log_delete_log_finish">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="find_event_ids" symbol="zeitgeist_log_find_event_ids">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ <parameter name="storage_state" type="ZeitgeistStorageState"/>
+ <parameter name="num_events" type="guint32"/>
+ <parameter name="result_type" type="ZeitgeistResultType"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="find_event_ids_finish" symbol="zeitgeist_log_find_event_ids_finish">
+ <return-type type="GArray*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="find_events" symbol="zeitgeist_log_find_events">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ <parameter name="storage_state" type="ZeitgeistStorageState"/>
+ <parameter name="num_events" type="guint32"/>
+ <parameter name="result_type" type="ZeitgeistResultType"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="find_events_finish" symbol="zeitgeist_log_find_events_finish">
+ <return-type type="ZeitgeistResultSet*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="find_related_uris" symbol="zeitgeist_log_find_related_uris">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ <parameter name="result_event_templates" type="GPtrArray*"/>
+ <parameter name="storage_state" type="ZeitgeistStorageState"/>
+ <parameter name="num_events" type="guint32"/>
+ <parameter name="result_type" type="ZeitgeistResultType"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="find_related_uris_finish" symbol="zeitgeist_log_find_related_uris_finish">
+ <return-type type="gchar**"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="get_events" symbol="zeitgeist_log_get_events">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="event_ids" type="GArray*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="get_events_finish" symbol="zeitgeist_log_get_events_finish">
+ <return-type type="ZeitgeistResultSet*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="insert_events" symbol="zeitgeist_log_insert_events">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="insert_events_finish" symbol="zeitgeist_log_insert_events_finish">
+ <return-type type="GArray*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="insert_events_from_ptrarray" symbol="zeitgeist_log_insert_events_from_ptrarray">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="events" type="GPtrArray*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="insert_events_no_reply" symbol="zeitgeist_log_insert_events_no_reply">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ </parameters>
+ </method>
+ <method name="insert_events_valist" symbol="zeitgeist_log_insert_events_valist">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ <parameter name="events" type="va_list"/>
+ </parameters>
+ </method>
+ <method name="install_monitor" symbol="zeitgeist_log_install_monitor">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="monitor" type="ZeitgeistMonitor*"/>
+ </parameters>
+ </method>
+ <method name="is_connected" symbol="zeitgeist_log_is_connected">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_log_new">
+ <return-type type="ZeitgeistLog*"/>
+ </constructor>
+ <method name="quit" symbol="zeitgeist_log_quit">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="cancellable" type="GCancellable*"/>
+ <parameter name="callback" type="GAsyncReadyCallback"/>
+ <parameter name="user_data" type="gpointer"/>
+ </parameters>
+ </method>
+ <method name="quit_finish" symbol="zeitgeist_log_quit_finish">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="res" type="GAsyncResult*"/>
+ <parameter name="error" type="GError**"/>
+ </parameters>
+ </method>
+ <method name="remove_monitor" symbol="zeitgeist_log_remove_monitor">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistLog*"/>
+ <parameter name="monitor" type="ZeitgeistMonitor*"/>
+ </parameters>
+ </method>
+ <property name="connected" type="gboolean" readable="1" writable="0" construct="0" construct-only="0"/>
+ </object>
+ <object name="ZeitgeistMonitor" parent="GObject" type-name="ZeitgeistMonitor" get-type="zeitgeist_monitor_get_type">
+ <method name="get_path" symbol="zeitgeist_monitor_get_path">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistMonitor*"/>
+ </parameters>
+ </method>
+ <method name="get_templates" symbol="zeitgeist_monitor_get_templates">
+ <return-type type="GPtrArray*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistMonitor*"/>
+ </parameters>
+ </method>
+ <method name="get_time_range" symbol="zeitgeist_monitor_get_time_range">
+ <return-type type="ZeitgeistTimeRange*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistMonitor*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_monitor_new">
+ <return-type type="ZeitgeistMonitor*"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_templates" type="GPtrArray*"/>
+ </parameters>
+ </constructor>
+ <property name="event-templates" type="GPtrArray*" readable="1" writable="1" construct="0" construct-only="1"/>
+ <property name="time-range" type="ZeitgeistTimeRange*" readable="1" writable="1" construct="0" construct-only="1"/>
+ <signal name="events-deleted" when="LAST">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistMonitor*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="event_ids" type="GArray*"/>
+ </parameters>
+ </signal>
+ <signal name="events-inserted" when="LAST">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistMonitor*"/>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ <parameter name="events" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </signal>
+ </object>
+ <object name="ZeitgeistSubject" parent="GInitiallyUnowned" type-name="ZeitgeistSubject" get-type="zeitgeist_subject_get_type">
+ <method name="get_interpretation" symbol="zeitgeist_subject_get_interpretation">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_manifestation" symbol="zeitgeist_subject_get_manifestation">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_mimetype" symbol="zeitgeist_subject_get_mimetype">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_origin" symbol="zeitgeist_subject_get_origin">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_storage" symbol="zeitgeist_subject_get_storage">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_text" symbol="zeitgeist_subject_get_text">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <method name="get_uri" symbol="zeitgeist_subject_get_uri">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_subject_new">
+ <return-type type="ZeitgeistSubject*"/>
+ </constructor>
+ <constructor name="new_full" symbol="zeitgeist_subject_new_full">
+ <return-type type="ZeitgeistSubject*"/>
+ <parameters>
+ <parameter name="uri" type="gchar*"/>
+ <parameter name="interpretation" type="gchar*"/>
+ <parameter name="manifestation" type="gchar*"/>
+ <parameter name="mimetype" type="gchar*"/>
+ <parameter name="origin" type="gchar*"/>
+ <parameter name="text" type="gchar*"/>
+ <parameter name="storage" type="gchar*"/>
+ </parameters>
+ </constructor>
+ <method name="set_interpretation" symbol="zeitgeist_subject_set_interpretation">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="interpretation" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_manifestation" symbol="zeitgeist_subject_set_manifestation">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="manifestation" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_mimetype" symbol="zeitgeist_subject_set_mimetype">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="mimetype" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_origin" symbol="zeitgeist_subject_set_origin">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="origin" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_storage" symbol="zeitgeist_subject_set_storage">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="storage" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_text" symbol="zeitgeist_subject_set_text">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="text" type="gchar*"/>
+ </parameters>
+ </method>
+ <method name="set_uri" symbol="zeitgeist_subject_set_uri">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="subject" type="ZeitgeistSubject*"/>
+ <parameter name="uri" type="gchar*"/>
+ </parameters>
+ </method>
+ </object>
+ <object name="ZeitgeistTimeRange" parent="GInitiallyUnowned" type-name="ZeitgeistTimeRange" get-type="zeitgeist_time_range_get_type">
+ <method name="get_end" symbol="zeitgeist_time_range_get_end">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ </parameters>
+ </method>
+ <method name="get_end_iso8601" symbol="zeitgeist_time_range_get_end_iso8601">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ </parameters>
+ </method>
+ <method name="get_start" symbol="zeitgeist_time_range_get_start">
+ <return-type type="gint64"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ </parameters>
+ </method>
+ <method name="get_start_iso8601" symbol="zeitgeist_time_range_get_start_iso8601">
+ <return-type type="gchar*"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ </parameters>
+ </method>
+ <constructor name="new" symbol="zeitgeist_time_range_new">
+ <return-type type="ZeitgeistTimeRange*"/>
+ <parameters>
+ <parameter name="start_msec" type="gint64"/>
+ <parameter name="end_msec" type="gint64"/>
+ </parameters>
+ </constructor>
+ <constructor name="new_anytime" symbol="zeitgeist_time_range_new_anytime">
+ <return-type type="ZeitgeistTimeRange*"/>
+ </constructor>
+ <constructor name="new_from_now" symbol="zeitgeist_time_range_new_from_now">
+ <return-type type="ZeitgeistTimeRange*"/>
+ </constructor>
+ <constructor name="new_from_variant" symbol="zeitgeist_time_range_new_from_variant">
+ <return-type type="ZeitgeistTimeRange*"/>
+ <parameters>
+ <parameter name="time_range" type="GVariant*"/>
+ </parameters>
+ </constructor>
+ <constructor name="new_to_now" symbol="zeitgeist_time_range_new_to_now">
+ <return-type type="ZeitgeistTimeRange*"/>
+ </constructor>
+ <method name="to_variant" symbol="zeitgeist_time_range_to_variant">
+ <return-type type="GVariant*"/>
+ <parameters>
+ <parameter name="time_range" type="ZeitgeistTimeRange*"/>
+ </parameters>
+ </method>
+ </object>
+ <interface name="ZeitgeistResultSet" type-name="ZeitgeistResultSet" get-type="zeitgeist_result_set_get_type">
+ <requires>
+ <interface name="GObject"/>
+ </requires>
+ <method name="estimated_matches" symbol="zeitgeist_result_set_estimated_matches">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <method name="has_next" symbol="zeitgeist_result_set_has_next">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <method name="next" symbol="zeitgeist_result_set_next">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <method name="peek" symbol="zeitgeist_result_set_peek">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <method name="seek" symbol="zeitgeist_result_set_seek">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ <parameter name="pos" type="guint"/>
+ </parameters>
+ </method>
+ <method name="size" symbol="zeitgeist_result_set_size">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <method name="tell" symbol="zeitgeist_result_set_tell">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </method>
+ <vfunc name="estimated_matches">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="has_next">
+ <return-type type="gboolean"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="next">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="peek">
+ <return-type type="ZeitgeistEvent*"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="seek">
+ <return-type type="void"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ <parameter name="pos" type="guint"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="size">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ <vfunc name="tell">
+ <return-type type="guint"/>
+ <parameters>
+ <parameter name="self" type="ZeitgeistResultSet*"/>
+ </parameters>
+ </vfunc>
+ </interface>
+ <constant name="ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE" type="char*" value="(sssa(asaasay))"/>
+ <constant name="ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE" type="char*" value="(sssa(asaasay)bxb)"/>
+ <constant name="ZEITGEIST_EVENT_VARIANT_SIGNATURE" type="char*" value="(asaasay)"/>
+ <constant name="ZEITGEIST_NCAL_ALARM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm"/>
+ <constant name="ZEITGEIST_NCAL_ATTACHMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment"/>
+ <constant name="ZEITGEIST_NCAL_CALENDAR" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar"/>
+ <constant name="ZEITGEIST_NCAL_CALENDAR_DATA_OBJECT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject"/>
+ <constant name="ZEITGEIST_NCAL_EVENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event"/>
+ <constant name="ZEITGEIST_NCAL_FREEBUSY" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy"/>
+ <constant name="ZEITGEIST_NCAL_JOURNAL" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal"/>
+ <constant name="ZEITGEIST_NCAL_TIMEZONE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone"/>
+ <constant name="ZEITGEIST_NCAL_TODO" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo"/>
+ <constant name="ZEITGEIST_NFO_APPLICATION" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application"/>
+ <constant name="ZEITGEIST_NFO_ARCHIVE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive"/>
+ <constant name="ZEITGEIST_NFO_ARCHIVE_ITEM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem"/>
+ <constant name="ZEITGEIST_NFO_ATTACHMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Attachment"/>
+ <constant name="ZEITGEIST_NFO_AUDIO" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"/>
+ <constant name="ZEITGEIST_NFO_BOOKMARK" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"/>
+ <constant name="ZEITGEIST_NFO_BOOKMARK_FOLDER" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder"/>
+ <constant name="ZEITGEIST_NFO_CURSOR" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor"/>
+ <constant name="ZEITGEIST_NFO_DATA_CONTAINER" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer"/>
+ <constant name="ZEITGEIST_NFO_DELETED_RESOURCE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource"/>
+ <constant name="ZEITGEIST_NFO_DOCUMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"/>
+ <constant name="ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject"/>
+ <constant name="ZEITGEIST_NFO_EXECUTABLE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"/>
+ <constant name="ZEITGEIST_NFO_FILESYSTEM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem"/>
+ <constant name="ZEITGEIST_NFO_FILESYSTEM_IMAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage"/>
+ <constant name="ZEITGEIST_NFO_FILE_DATA_OBJECT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject"/>
+ <constant name="ZEITGEIST_NFO_FOLDER" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"/>
+ <constant name="ZEITGEIST_NFO_FONT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"/>
+ <constant name="ZEITGEIST_NFO_HARD_DISK_PARTITION" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition"/>
+ <constant name="ZEITGEIST_NFO_HTML_DOCUMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument"/>
+ <constant name="ZEITGEIST_NFO_ICON" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon"/>
+ <constant name="ZEITGEIST_NFO_IMAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"/>
+ <constant name="ZEITGEIST_NFO_MEDIA" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media"/>
+ <constant name="ZEITGEIST_NFO_MEDIA_LIST" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList"/>
+ <constant name="ZEITGEIST_NFO_MEDIA_STREAM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream"/>
+ <constant name="ZEITGEIST_NFO_MIND_MAP" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap"/>
+ <constant name="ZEITGEIST_NFO_OPERATING_SYSTEM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem"/>
+ <constant name="ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument"/>
+ <constant name="ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument"/>
+ <constant name="ZEITGEIST_NFO_PRESENTATION" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"/>
+ <constant name="ZEITGEIST_NFO_RASTER_IMAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage"/>
+ <constant name="ZEITGEIST_NFO_REMOTE_DATA_OBJECT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject"/>
+ <constant name="ZEITGEIST_NFO_REMOTE_PORT_ADDRESS" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress"/>
+ <constant name="ZEITGEIST_NFO_SOFTWARE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"/>
+ <constant name="ZEITGEIST_NFO_SOFTWARE_ITEM" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem"/>
+ <constant name="ZEITGEIST_NFO_SOFTWARE_SERVICE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService"/>
+ <constant name="ZEITGEIST_NFO_SOURCE_CODE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"/>
+ <constant name="ZEITGEIST_NFO_SPREADSHEET" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet"/>
+ <constant name="ZEITGEIST_NFO_TEXT_DOCUMENT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"/>
+ <constant name="ZEITGEIST_NFO_TRASH" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash"/>
+ <constant name="ZEITGEIST_NFO_VECTOR_IMAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage"/>
+ <constant name="ZEITGEIST_NFO_VIDEO" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"/>
+ <constant name="ZEITGEIST_NFO_VISUAL" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual"/>
+ <constant name="ZEITGEIST_NFO_WEBSITE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website"/>
+ <constant name="ZEITGEIST_NMM_MOVIE" type="char*" value="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie"/>
+ <constant name="ZEITGEIST_NMM_MUSIC_ALBUM" type="char*" value="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum"/>
+ <constant name="ZEITGEIST_NMM_MUSIC_PIECE" type="char*" value="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece"/>
+ <constant name="ZEITGEIST_NMM_TVSERIES" type="char*" value="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries"/>
+ <constant name="ZEITGEIST_NMM_TVSHOW" type="char*" value="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow"/>
+ <constant name="ZEITGEIST_NMO_EMAIL" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"/>
+ <constant name="ZEITGEIST_NMO_IMMESSAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage"/>
+ <constant name="ZEITGEIST_NMO_MAILBOX" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox"/>
+ <constant name="ZEITGEIST_NMO_MAILBOX_DATA_OBJECT" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject"/>
+ <constant name="ZEITGEIST_NMO_MESSAGE" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message"/>
+ <constant name="ZEITGEIST_NMO_MIME_ENTITY" type="char*" value="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity"/>
+ <constant name="ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE" type="char*" value="(xx)"/>
+ <constant name="ZEITGEIST_ZG_ACCESS_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent"/>
+ <constant name="ZEITGEIST_ZG_CREATE_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent"/>
+ <constant name="ZEITGEIST_ZG_DELETE_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent"/>
+ <constant name="ZEITGEIST_ZG_EVENT_INTERPRETATION" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation"/>
+ <constant name="ZEITGEIST_ZG_EVENT_MANIFESTATION" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation"/>
+ <constant name="ZEITGEIST_ZG_HEURISTIC_ACTIVITY" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity"/>
+ <constant name="ZEITGEIST_ZG_LEAVE_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent"/>
+ <constant name="ZEITGEIST_ZG_MODIFY_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent"/>
+ <constant name="ZEITGEIST_ZG_RECEIVE_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent"/>
+ <constant name="ZEITGEIST_ZG_SCHEDULED_ACTIVITY" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity"/>
+ <constant name="ZEITGEIST_ZG_SEND_EVENT" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent"/>
+ <constant name="ZEITGEIST_ZG_SYSTEM_NOTIFICATION" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification"/>
+ <constant name="ZEITGEIST_ZG_USER_ACTIVITY" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity"/>
+ <constant name="ZEITGEIST_ZG_WORLD_ACTIVITY" type="char*" value="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity"/>
+ </namespace>
+</api>
=== added file 'bindings/zeitgeist-1.0.metadata'
--- bindings/zeitgeist-1.0.metadata 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.metadata 2012-02-02 12:33:19 +0000
@@ -0,0 +1,58 @@
+Zeitgeist cheader_filename="zeitgeist.h"
+Zeitgeist.Timestamp cheader_filename="zeitgeist.h"
+zeitgeist_data_source_new_full.event_templates transfer_ownership="1"
+zeitgeist_data_source_set_event_templates.event_templates transfer_ownership="1"
+zeitgeist_data_source_registry_get_data_sources async="1"
+zeitgeist_data_source_registry_get_data_sources_finish transfer_ownership="1"
+zeitgeist_data_source_registry_register_data_source async="1"
+zeitgeist_data_source_registry_register_data_source.source transfer_ownership="1"
+zeitgeist_data_source_registry_set_data_source_enabled async="1"
+zeitgeist_index_search async="1"
+zeitgeist_index_search.event_templates transfer_ownership="1"
+zeitgeist_index_search_finish transfer_ownership="1"
+zeitgeist_log_new transfer_ownership="1"
+zeitgeist_log_insert_events ellipsis="1" async="1"
+zeitgeist_log_insert_events_from_ptrarray async="1" finish_name="zeitgeist_log_insert_events_finish"
+zeitgeist_log_insert_events_from_ptrarray.events transfer_ownership="1"
+zeitgeist_log_insert_events_valist hidden="1"
+zeitgeist_log_insert_events_no_reply ellipsis="1"
+zeitgeist_log_insert_events_finish transfer_ownership="1"
+zeitgeist_log_find_events async="1"
+zeitgeist_log_find_events.event_templates transfer_ownership="1"
+zeitgeist_log_find_events_finish transfer_ownership="1"
+zeitgeist_log_find_event_ids async="1"
+zeitgeist_log_find_event_ids.event_templates transfer_ownership="1"
+zeitgeist_log_find_event_ids_finish transfer_ownership="1"
+zeitgeist_log_get_events async="1"
+zeitgeist_log_get_events.event_ids transfer_ownership="1"
+zeitgeist_log_get_events_finish transfer_ownership="1"
+zeitgeist_log_find_related_uris async="1"
+zeitgeist_log_find_related_uris.event_templates transfer_ownership="1"
+zeitgeist_log_find_related_uris.result_event_templates transfer_ownership="1"
+zeitgeist_log_find_related_uris_finish is_array="1" no_array_length="1" array_null_terminated="1" transfer_ownership="1"
+zeitgeist_log_delete_events async="1"
+zeitgeist_log_delete_events.event_ids transfer_ownership="1"
+zeitgeist_log_delete_log async="1"
+zeitgeist_log_quit async="1"
+zeitgeist_log_install_monitor
+zeitgeist_log_remove_monitor
+zeitgeist_event_new_full ellipsis="1"
+zeitgeist_event_set_payload.payload transfer_ownership="1"
+zeitgeist_monitor_new.event_templates transfer_ownership="1"
+#zeitgeist_monitor_get_templates type_name="GLib.PtrArray"
+#ZeitgeistMonitor:event-templates type_name="GLib.PtrArray"
+
+Zeitgeist.Symbol cheader_filename="zeitgeist.h"
+zeitgeist_symbol_get* parent="Symbol" transfer_ownership="1" type_arguments="unowned string"
+zeitgeist_symbol_is_a parent="Symbol"
+
+zeitgeist_data_source_registry_*.cancellable nullable="1"
+zeitgeist_log_*.cancellable nullable="1"
+zeitgeist_index_*.cancellable nullable="1"
+
+Zeitgeist.Timestamp cheader_filename="zeitgeist.h"
+zeitgeist_timestamp_* parent="Timestamp"
+zeitgeist_timestamp_for_now parent="Timestamp" name="now"
+zeitgeist_timestamp_to_date.date is_out="1"
+zeitgeist_timestamp_to_iso8601 parent="Timestamp" transfer_ownership="1"
+zeitgeist_timestamp_to_timeval.tv is_out="1"
=== added file 'bindings/zeitgeist-1.0.namespace'
--- bindings/zeitgeist-1.0.namespace 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.namespace 2012-02-02 12:33:19 +0000
@@ -0,0 +1,2 @@
+Zeitgeist
+Zeitgeist.Timestamp
=== added file 'bindings/zeitgeist-1.0.vapi'
--- bindings/zeitgeist-1.0.vapi 1970-01-01 00:00:00 +0000
+++ bindings/zeitgeist-1.0.vapi 2012-02-02 12:33:19 +0000
@@ -0,0 +1,429 @@
+/* zeitgeist-1.0.vapi generated by vapigen, do not modify. */
+
+[CCode (cprefix = "Zeitgeist", lower_case_cprefix = "zeitgeist_")]
+namespace Zeitgeist {
+ [CCode (cprefix = "ZeitgeistSymbol", lower_case_cprefix = "zeitgeist_symbol_")]
+ namespace Symbol {
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static GLib.List<weak string> get_all_children (string symbol);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static GLib.List<weak string> get_children (string symbol);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static GLib.List<weak string> get_parents (string symbol);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static bool is_a (string symbol, string parent);
+ }
+ [CCode (cprefix = "ZeitgeistTimestamp", lower_case_cprefix = "zeitgeist_timestamp_")]
+ namespace Timestamp {
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_DAY", cheader_filename = "zeitgeist.h")]
+ public static int64 DAY;
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_HOUR", cheader_filename = "zeitgeist.h")]
+ public static int64 HOUR;
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_MINUTE", cheader_filename = "zeitgeist.h")]
+ public static int64 MINUTE;
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_SECOND", cheader_filename = "zeitgeist.h")]
+ public static int64 SECOND;
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_WEEK", cheader_filename = "zeitgeist.h")]
+ public static int64 WEEK;
+ [CCode (cname = "ZEITGEIST_TIMESTAMP_YEAR", cheader_filename = "zeitgeist.h")]
+ public static int64 YEAR;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 from_date (GLib.Date date);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 from_dmy (GLib.DateDay day, GLib.DateMonth month, GLib.DateYear year);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 from_iso8601 (string datetime);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 from_timeval (GLib.TimeVal tv);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 next_midnight (int64 timestamp);
+ [CCode (cname = "zeitgeist_timestamp_for_now", cheader_filename = "zeitgeist.h")]
+ public static int64 now ();
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static int64 prev_midnight (int64 timestamp);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static void to_date (int64 timestamp, out GLib.Date date);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static string to_iso8601 (int64 timestamp);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static void to_timeval (int64 timestamp, out GLib.TimeVal tv);
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class DataSource : GLib.InitiallyUnowned {
+ [CCode (has_construct_function = false)]
+ public DataSource ();
+ [CCode (has_construct_function = false)]
+ public DataSource.from_variant (GLib.Variant src);
+ [CCode (has_construct_function = false)]
+ public DataSource.full (string id, string name, string desc, owned GLib.PtrArray event_templates);
+ public unowned string get_description ();
+ public unowned GLib.PtrArray get_event_templates ();
+ public unowned string get_name ();
+ public int64 get_timestamp ();
+ public unowned string get_unique_id ();
+ public bool is_enabled ();
+ public bool is_running ();
+ public void set_description (string description);
+ public void set_enabled (bool enabled);
+ public void set_event_templates (owned GLib.PtrArray event_templates);
+ public void set_name (string name);
+ public void set_running (bool running);
+ public void set_timestamp (int64 timestamp);
+ public void set_unique_id (string unique_id);
+ public unowned GLib.Variant to_variant ();
+ public unowned GLib.Variant to_variant_full ();
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class DataSourceRegistry : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public DataSourceRegistry ();
+ public async GLib.PtrArray get_data_sources (GLib.Cancellable? cancellable) throws GLib.Error;
+ public async bool register_data_source (owned Zeitgeist.DataSource source, GLib.Cancellable? cancellable) throws GLib.Error;
+ public async bool set_data_source_enabled (string unique_id, bool enabled, GLib.Cancellable? cancellable) throws GLib.Error;
+ public virtual signal void source_disconnected (Zeitgeist.DataSource source);
+ public virtual signal void source_enabled (string unique_id, bool enabled);
+ public virtual signal void source_registered (Zeitgeist.DataSource source);
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class Event : GLib.InitiallyUnowned {
+ [CCode (has_construct_function = false)]
+ public Event ();
+ public void add_subject (Zeitgeist.Subject subject);
+ [CCode (has_construct_function = false)]
+ public Event.from_variant (GLib.Variant event);
+ [CCode (has_construct_function = false)]
+ public Event.full (string interpretation, string manifestation, string actor, ...);
+ [CCode (has_construct_function = false)]
+ public Event.full_valist (string interpretation, string manifestation, string actor, void* args);
+ public unowned string get_actor ();
+ public uint32 get_id ();
+ public unowned string get_interpretation ();
+ public unowned string get_manifestation ();
+ public unowned GLib.ByteArray get_payload ();
+ public unowned Zeitgeist.Subject get_subject (int index);
+ public int64 get_timestamp ();
+ public int num_subjects ();
+ public void set_actor (string actor);
+ public void set_actor_from_app_info (GLib.AppInfo appinfo);
+ public void set_id (uint32 id);
+ public void set_interpretation (string interpretation);
+ public void set_manifestation (string manifestation);
+ public void set_payload (owned GLib.ByteArray payload);
+ public void set_timestamp (int64 timestamp);
+ public unowned GLib.Variant to_variant ();
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class Index : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Index ();
+ public async Zeitgeist.ResultSet search (string query, Zeitgeist.TimeRange time_range, owned GLib.PtrArray event_templates, uint32 offset, uint32 num_events, Zeitgeist.ResultType result_type, GLib.Cancellable? cancellable) throws GLib.Error;
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class Log : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Log ();
+ public async bool delete_events (owned GLib.Array event_ids, GLib.Cancellable? cancellable) throws GLib.Error;
+ public async bool delete_log (GLib.Cancellable? cancellable) throws GLib.Error;
+ public async GLib.Array find_event_ids (Zeitgeist.TimeRange time_range, owned GLib.PtrArray event_templates, Zeitgeist.StorageState storage_state, uint32 num_events, Zeitgeist.ResultType result_type, GLib.Cancellable? cancellable) throws GLib.Error;
+ public async Zeitgeist.ResultSet find_events (Zeitgeist.TimeRange time_range, owned GLib.PtrArray event_templates, Zeitgeist.StorageState storage_state, uint32 num_events, Zeitgeist.ResultType result_type, GLib.Cancellable? cancellable) throws GLib.Error;
+ [CCode (array_length = false, array_null_terminated = true)]
+ public async string[] find_related_uris (Zeitgeist.TimeRange time_range, owned GLib.PtrArray event_templates, owned GLib.PtrArray result_event_templates, Zeitgeist.StorageState storage_state, uint32 num_events, Zeitgeist.ResultType result_type, GLib.Cancellable? cancellable) throws GLib.Error;
+ public async Zeitgeist.ResultSet get_events (owned GLib.Array event_ids, GLib.Cancellable? cancellable) throws GLib.Error;
+ public async GLib.Array insert_events (GLib.Cancellable? cancellable, ...) throws GLib.Error;
+ [CCode (finish_name = "zeitgeist_log_insert_events_finish")]
+ public async GLib.Array insert_events_from_ptrarray (owned GLib.PtrArray events, GLib.Cancellable? cancellable) throws GLib.Error;
+ public void insert_events_no_reply (...);
+ public void install_monitor (Zeitgeist.Monitor monitor);
+ public bool is_connected ();
+ public async bool quit (GLib.Cancellable? cancellable) throws GLib.Error;
+ public void remove_monitor (Zeitgeist.Monitor monitor);
+ [NoAccessorMethod]
+ public bool connected { get; }
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class Monitor : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Monitor (Zeitgeist.TimeRange time_range, owned GLib.PtrArray event_templates);
+ public unowned string get_path ();
+ public unowned GLib.PtrArray get_templates ();
+ public unowned Zeitgeist.TimeRange get_time_range ();
+ [NoAccessorMethod]
+ public GLib.PtrArray event_templates { owned get; construct; }
+ public Zeitgeist.TimeRange time_range { get; construct; }
+ public virtual signal void events_deleted (Zeitgeist.TimeRange time_range, GLib.Array event_ids);
+ public virtual signal void events_inserted (Zeitgeist.TimeRange time_range, Zeitgeist.ResultSet events);
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class Subject : GLib.InitiallyUnowned {
+ [CCode (has_construct_function = false)]
+ public Subject ();
+ [CCode (has_construct_function = false)]
+ public Subject.full (string uri, string interpretation, string manifestation, string mimetype, string origin, string text, string storage);
+ public unowned string get_interpretation ();
+ public unowned string get_manifestation ();
+ public unowned string get_mimetype ();
+ public unowned string get_origin ();
+ public unowned string get_storage ();
+ public unowned string get_text ();
+ public unowned string get_uri ();
+ public void set_interpretation (string interpretation);
+ public void set_manifestation (string manifestation);
+ public void set_mimetype (string mimetype);
+ public void set_origin (string origin);
+ public void set_storage (string storage);
+ public void set_text (string text);
+ public void set_uri (string uri);
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public class TimeRange : GLib.InitiallyUnowned {
+ [CCode (has_construct_function = false)]
+ public TimeRange (int64 start_msec, int64 end_msec);
+ [CCode (has_construct_function = false)]
+ public TimeRange.anytime ();
+ [CCode (has_construct_function = false)]
+ public TimeRange.from_now ();
+ [CCode (has_construct_function = false)]
+ public TimeRange.from_variant (GLib.Variant time_range);
+ public int64 get_end ();
+ public unowned string get_end_iso8601 ();
+ public int64 get_start ();
+ public unowned string get_start_iso8601 ();
+ [CCode (has_construct_function = false)]
+ public TimeRange.to_now ();
+ public unowned GLib.Variant to_variant ();
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public interface EggZeitgeistMonitor : GLib.Object {
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public interface ResultSet : GLib.Object {
+ public abstract uint estimated_matches ();
+ public abstract bool has_next ();
+ [CCode (cname = "_vala_zeitgeist_result_set_iterator")]
+ public Zeitgeist.ResultSet iterator ();
+ public abstract unowned Zeitgeist.Event next ();
+ [CCode (cname = "_vala_zeitgeist_result_set_next_value")]
+ public unowned Zeitgeist.Event? next_value ();
+ public abstract unowned Zeitgeist.Event peek ();
+ public abstract void seek (uint pos);
+ public abstract uint size ();
+ public abstract uint tell ();
+ }
+ [CCode (cprefix = "ZEITGEIST_RESULT_TYPE_", cheader_filename = "zeitgeist.h")]
+ public enum ResultType {
+ MOST_RECENT_EVENTS,
+ LEAST_RECENT_EVENTS,
+ MOST_RECENT_SUBJECTS,
+ LEAST_RECENT_SUBJECTS,
+ MOST_POPULAR_SUBJECTS,
+ LEAST_POPULAR_SUBJECTS,
+ MOST_POPULAR_ACTOR,
+ LEAST_POPULAR_ACTOR,
+ MOST_RECENT_ACTOR,
+ LEAST_RECENT_ACTOR,
+ MOST_RECENT_ORIGIN,
+ LEAST_RECENT_ORIGIN,
+ MOST_POPULAR_ORIGIN,
+ LEAST_POPULAR_ORIGIN,
+ OLDEST_ACTOR,
+ MOST_RECENT_SUBJECT_INTERPRETATION,
+ LEAST_RECENT_SUBJECT_INTERPRETATION,
+ MOST_POPULAR_SUBJECT_INTERPRETATION,
+ LEAST_POPULAR_SUBJECT_INTERPRETATION,
+ MOST_RECENT_MIMETYPE,
+ LEAST_RECENT_MIMETYPE,
+ MOST_POPULAR_MIMETYPE,
+ LEAST_POPULAR_MIMETYPE,
+ RELEVANCY
+ }
+ [CCode (cprefix = "ZEITGEIST_STORAGE_STATE_", cheader_filename = "zeitgeist.h")]
+ public enum StorageState {
+ NOT_AVAILABLE,
+ AVAILABLE,
+ ANY
+ }
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string DATA_SOURCE_VARIANT_SIGNATURE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string EVENT_VARIANT_SIGNATURE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_ALARM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_ATTACHMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_CALENDAR;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_CALENDAR_DATA_OBJECT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_FREEBUSY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_JOURNAL;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_TIMEZONE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NCAL_TODO;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_APPLICATION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_ARCHIVE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_ARCHIVE_ITEM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_ATTACHMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_AUDIO;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_BOOKMARK;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_BOOKMARK_FOLDER;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_CURSOR;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_DATA_CONTAINER;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_DELETED_RESOURCE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_DOCUMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_EMBEDDED_FILE_DATA_OBJECT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_EXECUTABLE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_FILESYSTEM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_FILESYSTEM_IMAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_FILE_DATA_OBJECT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_FOLDER;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_FONT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_HARD_DISK_PARTITION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_HTML_DOCUMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_ICON;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_IMAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_MEDIA;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_MEDIA_LIST;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_MEDIA_STREAM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_MIND_MAP;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_OPERATING_SYSTEM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_PAGINATED_TEXT_DOCUMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_PLAIN_TEXT_DOCUMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_PRESENTATION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_RASTER_IMAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_REMOTE_DATA_OBJECT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_REMOTE_PORT_ADDRESS;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_SOFTWARE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_SOFTWARE_ITEM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_SOFTWARE_SERVICE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_SOURCE_CODE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_SPREADSHEET;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_TEXT_DOCUMENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_TRASH;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_VECTOR_IMAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_VIDEO;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_VISUAL;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NFO_WEBSITE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMM_MOVIE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMM_MUSIC_ALBUM;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMM_MUSIC_PIECE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMM_TVSERIES;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMM_TVSHOW;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_EMAIL;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_IMMESSAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_MAILBOX;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_MAILBOX_DATA_OBJECT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_MESSAGE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string NMO_MIME_ENTITY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string TIME_RANGE_VARIANT_SIGNATURE;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_ACCESS_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_CREATE_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_DELETE_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_EVENT_INTERPRETATION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_EVENT_MANIFESTATION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_HEURISTIC_ACTIVITY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_LEAVE_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_MODIFY_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_RECEIVE_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_SCHEDULED_ACTIVITY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_SEND_EVENT;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_SYSTEM_NOTIFICATION;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_USER_ACTIVITY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public const string ZG_WORLD_ACTIVITY;
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned GLib.PtrArray data_sources_from_variant (GLib.Variant sources);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned GLib.Variant data_sources_to_variant (GLib.PtrArray sources);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned GLib.PtrArray events_from_valist (void* events);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned GLib.PtrArray events_from_variant (GLib.Variant events);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned GLib.Variant events_to_variant (GLib.PtrArray events);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned string interpretation_for_mimetype (string mimetype);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static unowned string manifestation_for_uri (string uri);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static void register_mimetype (string mimetype, string interpretation_uri);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static void register_mimetype_regex (string mimetype_regex, string interpretation_uri);
+ [CCode (cheader_filename = "zeitgeist.h")]
+ public static void register_uri_scheme (string uri_scheme, string manifestation_type);
+}
=== added file 'configure.ac'
--- configure.ac 1970-01-01 00:00:00 +0000
+++ configure.ac 2012-02-02 12:33:19 +0000
@@ -0,0 +1,113 @@
+# When releasing also remember to update the soname as instructed below
+AC_INIT(libzeitgeist, 0.3.13)
+
+AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+CFLAGS="$CFLAGS"
+
+# Before making a release, the ZEITGEIST_LT_VERSION string should be updated.
+# The string is of the form C:R:A.
+# - If interfaces have been changed or added, but binary compatibility has
+# been preserved, change to C+1:0:A+1
+# - If binary compatibility has been broken (eg removed or changed interfaces)
+# change to C+1:0:0
+# - If the interface is the same as the previous version, change to C:R+1:A
+ZEITGEIST_LT_CURRENT=1
+ZEITGEIST_LT_REV=4
+ZEITGEIST_LT_AGE=0
+ZEITGEIST_LT_VERSION="$ZEITGEIST_LT_CURRENT:$ZEITGEIST_LT_REV:$ZEITGEIST_LT_AGE"
+ZEITGEIST_LT_LDFLAGS="-version-info $ZEITGEIST_LT_VERSION -export-symbols-regex '^zeitgeist_.*'"
+
+AC_SUBST(ZEITGEIST_LT_VERSION)
+AC_SUBST(ZEITGEIST_LT_LDFLAGS)
+
+###################################################################
+# Check essential build programs
+###################################################################
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AM_PROG_LIBTOOL
+
+
+####################################################################
+# Compiler generate debug code
+####################################################################
+AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug], [build with debug symbols]),,
+ [enable_debug=no])
+
+if test "x$enable_debug" = "xyes"; then
+ CFLAGS="-g $CFLAGS"
+ AC_DEFINE(ENABLE_DEBUG, 1, [build with extra debug information])
+fi
+
+AM_CONDITIONAL(ENABLE_DEBUG, test "$enable_debug" = "yes")
+
+
+
+####################################################################
+# Maintainer C flags
+####################################################################
+m4_define([maintainer_flags_default], [no])
+AC_ARG_ENABLE([maintainer-flags],
+ [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],[Use strict compiler flags @<:@default=no@:>@])],
+ [],
+ [enable_maintainer_flags=maintainer_flags_default])
+AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
+ [
+ MAINTAINER_CFLAGS="-g -Werror -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
+ ]
+)
+AC_SUBST(MAINTAINER_CFLAGS)
+
+####################################################################
+# Check library deps
+####################################################################
+GLIB_REQUIRED=2.26
+PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= $GLIB_REQUIRED ])
+PKG_CHECK_MODULES(GOBJECT2, [gobject-2.0 >= $GLIB_REQUIRED ])
+PKG_CHECK_MODULES(GIO2, [gio-2.0 >= $GLIB_REQUIRED ])
+PKG_CHECK_MODULES(GIO_UNIX2, [gio-unix-2.0])
+
+ZEITGEIST_CFLAGS="$GLIB2_CFLAGS $GOBJECT2_CFLAGS $GIO2_CFLAGS $GIO_UNIX2_CFLAGS"
+ZEITGEIST_LIBS="$GLIB2_LIBS $GOBJECT2_LIBS $GIO2_LIBS $GIO_UNIX2_LIBS"
+AC_SUBST(ZEITGEIST_CFLAGS)
+AC_SUBST(ZEITGEIST_LIBS)
+
+GTK_DOC_CHECK(1.0)
+
+AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
+AC_SUBST(GLIB_MKENUMS)
+
+AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+AC_SUBST(GLIB_GENMARSHAL)
+
+AC_OUTPUT([
+zeitgeist-1.0.pc
+Makefile
+bindings/Makefile
+doc/Makefile
+doc/reference/Makefile
+examples/Makefile
+src/Makefile
+tests/Makefile
+])
+
+AC_MSG_NOTICE([
+
+ LibZeitgeist $VERSION
+ ------------------
+
+ Prefix : ${prefix}
+
+ Build API docs : ${enable_gtk_doc}
+
+ Extra CFlags : ${CPPFLAGS} $MAINTAINER_CFLAGS
+])
+
=== renamed file 'configure.ac' => 'configure.ac.moved'
=== added directory 'doc'
=== renamed directory 'doc' => 'doc.moved'
=== added file 'doc/Makefile.am'
--- doc/Makefile.am 1970-01-01 00:00:00 +0000
+++ doc/Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1 @@
+SUBDIRS = reference
=== added directory 'doc/reference'
=== added file 'doc/reference/Makefile.am'
--- doc/reference/Makefile.am 1970-01-01 00:00:00 +0000
+++ doc/reference/Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,56 @@
+## Process this file with automake to produce Makefile.in
+
+# automake requirements
+AUTOMAKE_OPTIONS = 1.7
+
+# The name of the module
+DOC_MODULE=zeitgeist-1.0
+
+# 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).
+DOC_SOURCE_DIR = ../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS =
+
+# Extra options to supply to gtkdoc-scan.
+# Fx --rebuild-types --rebuild-sections
+SCAN_OPTIONS =
+
+# Extra options to supply to gtkdoc-mkdb.
+MKDB_OPTIONS = --sgml-mode --output-format=xml --ignore-files=trio
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+FIXXREF_OPTIONS =
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+HFILE_GLOB = $(top_srcdir)/src/zeitgeist-*.h
+CFILE_GLOB = $(top_srcdir)/src/zeitgeist-*.c
+
+# Header files to ignore when scanning.
+IGNORE_HFILES = \
+ zeitgeist-eggdbusconversions.h
+
+# Images to copy into HTML directory.
+HTML_IMAGES =
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+content_files =
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+INCLUDES= \
+ -I$(top_srcdir)/src \
+ $(ZEITGEIST_CFLAGS)
+
+GTKDOC_LIBS = \
+ $(ZEITGEIST_LIBS) \
+ $(top_builddir)/src/libzeitgeist-1.0.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 +=
=== added file 'doc/reference/zeitgeist-1.0-docs.sgml'
--- doc/reference/zeitgeist-1.0-docs.sgml 1970-01-01 00:00:00 +0000
+++ doc/reference/zeitgeist-1.0-docs.sgml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+ <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+]>
+<book id="index">
+ <bookinfo>
+ <title>API Documentation for the Zeitgeist Client Library</title>
+ </bookinfo>
+
+ <chapter>
+ <title>Classes</title>
+ <xi:include href="xml/zeitgeist-event.xml"/>
+ <xi:include href="xml/zeitgeist-log.xml"/>
+ <xi:include href="xml/zeitgeist-monitor.xml"/>
+ <xi:include href="xml/zeitgeist-result-set.xml"/>
+ <xi:include href="xml/zeitgeist-subject.xml"/>
+ <xi:include href="xml/zeitgeist-timerange.xml"/>
+ </chapter>
+
+ <chapter>
+ <title>Utility Functions</title>
+ <xi:include href="xml/zeitgeist-mimetypes.xml"/>
+ <xi:include href="xml/zeitgeist-timestamp.xml"/>
+ <xi:include href="xml/zeitgeist-symbols.xml"/>
+ </chapter>
+
+ <chapter>
+ <title>Enumerations and Macros</title>
+ <xi:include href="xml/zeitgeist-enums.xml"/>
+ <xi:include href="xml/zeitgeist-ontology-interpretations.xml"/>
+ <xi:include href="xml/zeitgeist-ontology-manifestations.xml"/>
+ </chapter>
+
+ <chapter>
+ <title>API for Zeitgeist Extensions</title>
+ <xi:include href="xml/zeitgeist-index.xml"/>
+ <xi:include href="xml/zeitgeist-data-source.xml"/>
+ <xi:include href="xml/zeitgeist-data-source-registry.xml"/>
+ </chapter>
+
+ <chapter id="object-tree">
+ <title>Object Hierarchy</title>
+ <xi:include href="xml/tree_index.sgml"/>
+ </chapter>
+
+ <index id="api-index-full">
+ <title>API Index</title>
+ <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
+ </index>
+
+ <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+</book>
=== added file 'doc/reference/zeitgeist-1.0-sections.txt'
--- doc/reference/zeitgeist-1.0-sections.txt 1970-01-01 00:00:00 +0000
+++ doc/reference/zeitgeist-1.0-sections.txt 2012-02-02 12:33:19 +0000
@@ -0,0 +1,397 @@
+<SECTION>
+<FILE>zeitgeist-data-source</FILE>
+<TITLE>ZeitgeistDataSource</TITLE>
+ZeitgeistDataSource
+ZeitgeistDataSourceClass
+zeitgeist_data_source_new
+zeitgeist_data_source_new_full
+zeitgeist_data_source_new_from_variant
+zeitgeist_data_source_get_unique_id
+zeitgeist_data_source_set_unique_id
+zeitgeist_data_source_get_name
+zeitgeist_data_source_set_name
+zeitgeist_data_source_get_description
+zeitgeist_data_source_set_description
+zeitgeist_data_source_get_event_templates
+zeitgeist_data_source_set_event_templates
+zeitgeist_data_source_is_running
+zeitgeist_data_source_set_running
+zeitgeist_data_source_get_timestamp
+zeitgeist_data_source_set_timestamp
+zeitgeist_data_source_is_enabled
+zeitgeist_data_source_set_enabled
+zeitgeist_data_source_to_variant
+zeitgeist_data_sources_to_variant
+zeitgeist_data_sources_from_variant
+ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE
+ZEITGEIST_DATA_SOURCE_VARIANT_TYPE
+<SUBSECTION Standard>
+ZEITGEIST_DATA_SOURCE
+ZEITGEIST_IS_DATA_SOURCE
+ZEITGEIST_TYPE_DATA_SOURCE
+zeitgeist_data_source_get_type
+ZEITGEIST_DATA_SOURCE_CLASS
+ZEITGEIST_IS_DATA_SOURCE_CLASS
+ZEITGEIST_DATA_SOURCE_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-subject</FILE>
+<TITLE>ZeitgeistSubject</TITLE>
+ZeitgeistSubject
+ZeitgeistSubjectClass
+zeitgeist_subject_new
+zeitgeist_subject_new_full
+zeitgeist_subject_get_uri
+zeitgeist_subject_set_uri
+zeitgeist_subject_get_interpretation
+zeitgeist_subject_set_interpretation
+zeitgeist_subject_get_manifestation
+zeitgeist_subject_set_manifestation
+zeitgeist_subject_get_mimetype
+zeitgeist_subject_set_mimetype
+zeitgeist_subject_get_origin
+zeitgeist_subject_set_origin
+zeitgeist_subject_get_text
+zeitgeist_subject_set_text
+zeitgeist_subject_get_storage
+zeitgeist_subject_set_storage
+<SUBSECTION Standard>
+ZEITGEIST_SUBJECT
+ZEITGEIST_IS_SUBJECT
+ZEITGEIST_TYPE_SUBJECT
+zeitgeist_subject_get_type
+ZEITGEIST_SUBJECT_CLASS
+ZEITGEIST_IS_SUBJECT_CLASS
+ZEITGEIST_SUBJECT_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-timerange</FILE>
+<TITLE>ZeitgeistTimeRange</TITLE>
+ZeitgeistTimeRange
+ZeitgeistTimeRangeClass
+zeitgeist_time_range_new
+zeitgeist_time_range_new_from_variant
+zeitgeist_time_range_new_from_now
+zeitgeist_time_range_new_to_now
+zeitgeist_time_range_new_anytime
+zeitgeist_time_range_get_start
+zeitgeist_time_range_get_end
+zeitgeist_time_range_get_start_iso8601
+zeitgeist_time_range_get_end_iso8601
+zeitgeist_time_range_to_variant
+ZEITGEIST_TIME_RANGE_VARIANT_SIGNATURE
+ZEITGEIST_TIME_RANGE_VARIANT_TYPE
+<SUBSECTION Standard>
+ZEITGEIST_TIME_RANGE
+ZEITGEIST_IS_TIME_RANGE
+ZEITGEIST_TYPE_TIME_RANGE
+zeitgeist_time_range_get_type
+ZEITGEIST_TIME_RANGE_CLASS
+ZEITGEIST_IS_TIME_RANGE_CLASS
+ZEITGEIST_TIME_RANGE_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-index</FILE>
+<TITLE>ZeitgeistIndex</TITLE>
+ZeitgeistIndex
+ZeitgeistIndexClass
+zeitgeist_index_new
+zeitgeist_index_search
+zeitgeist_index_search_finish
+<SUBSECTION Standard>
+ZEITGEIST_INDEX
+ZEITGEIST_IS_INDEX
+ZEITGEIST_TYPE_INDEX
+zeitgeist_index_get_type
+ZEITGEIST_INDEX_CLASS
+ZEITGEIST_IS_INDEX_CLASS
+ZEITGEIST_INDEX_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-result-set</FILE>
+<TITLE>ZeitgeistResultSet</TITLE>
+ZeitgeistResultSetIface
+ZeitgeistResultSet
+zeitgeist_result_set_size
+zeitgeist_result_set_estimated_matches
+zeitgeist_result_set_next
+zeitgeist_result_set_has_next
+zeitgeist_result_set_peek
+zeitgeist_result_set_seek
+zeitgeist_result_set_tell
+<SUBSECTION Standard>
+ZEITGEIST_RESULT_SET
+ZEITGEIST_IS_RESULT_SET
+ZEITGEIST_TYPE_RESULT_SET
+zeitgeist_result_set_get_type
+ZEITGEIST_RESULT_SET_GET_IFACE
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-event</FILE>
+<TITLE>ZeitgeistEvent</TITLE>
+ZeitgeistEvent
+ZeitgeistEventClass
+zeitgeist_event_new
+zeitgeist_event_new_full
+zeitgeist_event_new_full_valist
+zeitgeist_event_new_from_variant
+zeitgeist_event_get_id
+zeitgeist_event_set_id
+zeitgeist_event_get_timestamp
+zeitgeist_event_set_timestamp
+zeitgeist_event_get_interpretation
+zeitgeist_event_set_interpretation
+zeitgeist_event_get_manifestation
+zeitgeist_event_set_manifestation
+zeitgeist_event_get_actor
+zeitgeist_event_set_actor
+zeitgeist_event_set_actor_from_app_info
+zeitgeist_event_get_subject
+zeitgeist_event_num_subjects
+zeitgeist_event_add_subject
+zeitgeist_event_get_payload
+zeitgeist_event_set_payload
+zeitgeist_events_from_variant
+zeitgeist_events_to_variant
+ZEITGEIST_EVENT_VARIANT_SIGNATURE
+ZEITGEIST_EVENT_VARIANT_TYPE
+<SUBSECTION Standard>
+ZEITGEIST_EVENT
+ZEITGEIST_IS_EVENT
+ZEITGEIST_TYPE_EVENT
+zeitgeist_event_get_type
+ZEITGEIST_EVENT_CLASS
+ZEITGEIST_IS_EVENT_CLASS
+ZEITGEIST_EVENT_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-data-source-registry</FILE>
+<TITLE>ZeitgeistDataSourceRegistry</TITLE>
+ZeitgeistDataSourceRegistry
+ZeitgeistDataSourceRegistryClass
+zeitgeist_data_source_registry_new
+zeitgeist_data_source_registry_get_data_sources
+zeitgeist_data_source_registry_get_data_sources_finish
+zeitgeist_data_source_registry_register_data_source
+zeitgeist_data_source_registry_register_data_source_finish
+zeitgeist_data_source_registry_set_data_source_enabled
+zeitgeist_data_source_registry_set_data_source_enabled_finish
+<SUBSECTION Standard>
+ZEITGEIST_DATA_SOURCE_REGISTRY
+ZEITGEIST_IS_DATA_SOURCE_REGISTRY
+ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY
+zeitgeist_data_source_registry_get_type
+ZEITGEIST_DATA_SOURCE_REGISTRY_CLASS
+ZEITGEIST_IS_DATA_SOURCE_REGISTRY_CLASS
+ZEITGEIST_DATA_SOURCE_REGISTRY_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-monitor</FILE>
+<TITLE>ZeitgeistMonitor</TITLE>
+ZeitgeistMonitor
+ZeitgeistMonitorClass
+zeitgeist_monitor_new
+zeitgeist_monitor_get_time_range
+zeitgeist_monitor_get_templates
+zeitgeist_monitor_get_path
+<SUBSECTION Standard>
+ZEITGEIST_MONITOR
+ZEITGEIST_IS_MONITOR
+ZEITGEIST_TYPE_MONITOR
+zeitgeist_monitor_get_type
+ZEITGEIST_MONITOR_CLASS
+ZEITGEIST_IS_MONITOR_CLASS
+ZEITGEIST_MONITOR_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-log</FILE>
+<TITLE>ZeitgeistLog</TITLE>
+ZeitgeistLog
+ZeitgeistLogClass
+zeitgeist_log_new
+zeitgeist_log_insert_events
+zeitgeist_log_insert_events_no_reply
+zeitgeist_log_insert_events_valist
+zeitgeist_log_insert_events_from_ptrarray
+zeitgeist_log_insert_events_finish
+zeitgeist_log_find_events
+zeitgeist_log_find_events_finish
+zeitgeist_log_find_event_ids
+zeitgeist_log_find_event_ids_finish
+zeitgeist_log_get_events
+zeitgeist_log_get_events_finish
+zeitgeist_log_find_related_uris
+zeitgeist_log_find_related_uris_finish
+zeitgeist_log_delete_events
+zeitgeist_log_delete_events_finish
+zeitgeist_log_delete_log
+zeitgeist_log_delete_log_finish
+zeitgeist_log_quit
+zeitgeist_log_quit_finish
+zeitgeist_log_install_monitor
+zeitgeist_log_remove_monitor
+<SUBSECTION Standard>
+ZEITGEIST_LOG
+ZEITGEIST_IS_LOG
+ZEITGEIST_TYPE_LOG
+zeitgeist_log_get_type
+ZEITGEIST_LOG_CLASS
+ZEITGEIST_IS_LOG_CLASS
+ZEITGEIST_LOG_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-enumtypes</FILE>
+zeitgeist_result_type_get_type
+ZEITGEIST_TYPE_RESULT_TYPE
+zeitgeist_storage_state_get_type
+ZEITGEIST_TYPE_STORAGE_STATE
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-enums</FILE>
+<TITLE>Enumerations</TITLE>
+zeitgeist_result_type_get_type
+ZEITGEIST_TYPE_RESULT_TYPE
+ZeitgeistResultType
+zeitgeist_storage_state_get_type
+ZEITGEIST_TYPE_STORAGE_STATE
+ZeitgeistStorageState
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-mimetypes</FILE>
+<TITLE>Mimetype mapping and URI comprehension</TITLE>
+zeitgeist_register_mimetype
+zeitgeist_register_mimetype_regex
+zeitgeist_interpretation_for_mimetype
+zeitgeist_register_uri_scheme
+zeitgeist_manifestation_for_uri
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-symbols</FILE>
+<TITLE>Symbol comprehension</TITLE>
+zeitgeist_symbol_get_parents
+zeitgeist_symbol_get_children
+zeitgeist_symbol_get_all_children
+zeitgeist_symbol_is_a
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-ontology-interpretations</FILE>
+<TITLE>Interpretation Ontology</TITLE>
+ZEITGEIST_NCAL_ALARM
+ZEITGEIST_NCAL_CALENDAR
+ZEITGEIST_NCAL_EVENT
+ZEITGEIST_NCAL_FREEBUSY
+ZEITGEIST_NCAL_JOURNAL
+ZEITGEIST_NCAL_TIMEZONE
+ZEITGEIST_NCAL_TODO
+ZEITGEIST_NFO_APPLICATION
+ZEITGEIST_NFO_ARCHIVE
+ZEITGEIST_NFO_AUDIO
+ZEITGEIST_NFO_BOOKMARK
+ZEITGEIST_NFO_BOOKMARK_FOLDER
+ZEITGEIST_NFO_CURSOR
+ZEITGEIST_NFO_DATA_CONTAINER
+ZEITGEIST_NFO_DOCUMENT
+ZEITGEIST_NFO_EXECUTABLE
+ZEITGEIST_NFO_FILESYSTEM
+ZEITGEIST_NFO_FILESYSTEM_IMAGE
+ZEITGEIST_NFO_FOLDER
+ZEITGEIST_NFO_FONT
+ZEITGEIST_NFO_HTML_DOCUMENT
+ZEITGEIST_NFO_ICON
+ZEITGEIST_NFO_IMAGE
+ZEITGEIST_NFO_MEDIA
+ZEITGEIST_NFO_MEDIA_LIST
+ZEITGEIST_NFO_MIND_MAP
+ZEITGEIST_NFO_OPERATING_SYSTEM
+ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT
+ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT
+ZEITGEIST_NFO_PRESENTATION
+ZEITGEIST_NFO_RASTER_IMAGE
+ZEITGEIST_NFO_SOFTWARE
+ZEITGEIST_NFO_SOURCE_CODE
+ZEITGEIST_NFO_SPREADSHEET
+ZEITGEIST_NFO_TEXT_DOCUMENT
+ZEITGEIST_NFO_TRASH
+ZEITGEIST_NFO_VECTOR_IMAGE
+ZEITGEIST_NFO_VIDEO
+ZEITGEIST_NFO_VISUAL
+ZEITGEIST_NFO_WEBSITE
+ZEITGEIST_NMM_MOVIE
+ZEITGEIST_NMM_MUSIC_ALBUM
+ZEITGEIST_NMM_MUSIC_PIECE
+ZEITGEIST_NMM_TVSERIES
+ZEITGEIST_NMM_TVSHOW
+ZEITGEIST_NMO_EMAIL
+ZEITGEIST_NMO_IMMESSAGE
+ZEITGEIST_NMO_MAILBOX
+ZEITGEIST_NMO_MESSAGE
+ZEITGEIST_NMO_MIME_ENTITY
+ZEITGEIST_ZG_ACCESS_EVENT
+ZEITGEIST_ZG_CREATE_EVENT
+ZEITGEIST_ZG_DELETE_EVENT
+ZEITGEIST_ZG_EVENT_INTERPRETATION
+ZEITGEIST_ZG_LEAVE_EVENT
+ZEITGEIST_ZG_MODIFY_EVENT
+ZEITGEIST_ZG_RECEIVE_EVENT
+ZEITGEIST_ZG_SEND_EVENT
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-ontology-manifestations</FILE>
+<TITLE>Manifestation Ontology</TITLE>
+ZEITGEIST_NCAL_ATTACHMENT
+ZEITGEIST_NCAL_CALENDAR_DATA_OBJECT
+ZEITGEIST_NFO_ARCHIVE_ITEM
+ZEITGEIST_NFO_ATTACHMENT
+ZEITGEIST_NFO_DELETED_RESOURCE
+ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT
+ZEITGEIST_NFO_FILE_DATA_OBJECT
+ZEITGEIST_NFO_HARD_DISK_PARTITION
+ZEITGEIST_NFO_MEDIA_STREAM
+ZEITGEIST_NFO_REMOTE_DATA_OBJECT
+ZEITGEIST_NFO_REMOTE_PORT_ADDRESS
+ZEITGEIST_NFO_SOFTWARE_ITEM
+ZEITGEIST_NFO_SOFTWARE_SERVICE
+ZEITGEIST_NMO_MAILBOX_DATA_OBJECT
+ZEITGEIST_ZG_EVENT_MANIFESTATION
+ZEITGEIST_ZG_HEURISTIC_ACTIVITY
+ZEITGEIST_ZG_SCHEDULED_ACTIVITY
+ZEITGEIST_ZG_SYSTEM_NOTIFICATION
+ZEITGEIST_ZG_USER_ACTIVITY
+ZEITGEIST_ZG_WORLD_ACTIVITY
+</SECTION>
+
+<SECTION>
+<FILE>zeitgeist-timestamp</FILE>
+<TITLE>Timestamp handling</TITLE>
+ZEITGEIST_TIMESTAMP_SECOND
+ZEITGEIST_TIMESTAMP_MINUTE
+ZEITGEIST_TIMESTAMP_HOUR
+ZEITGEIST_TIMESTAMP_DAY
+ZEITGEIST_TIMESTAMP_WEEK
+ZEITGEIST_TIMESTAMP_YEAR
+zeitgeist_timestamp_for_now
+zeitgeist_timestamp_from_timeval
+zeitgeist_timestamp_to_timeval
+zeitgeist_timestamp_from_iso8601
+zeitgeist_timestamp_to_iso8601
+zeitgeist_timestamp_from_date
+zeitgeist_timestamp_from_dmy
+zeitgeist_timestamp_to_date
+zeitgeist_timestamp_next_midnight
+zeitgeist_timestamp_prev_midnight
+</SECTION>
+
=== added file 'doc/reference/zeitgeist-1.0.types'
--- doc/reference/zeitgeist-1.0.types 1970-01-01 00:00:00 +0000
+++ doc/reference/zeitgeist-1.0.types 2012-02-02 12:33:19 +0000
@@ -0,0 +1,11 @@
+zeitgeist_data_source_get_type
+zeitgeist_data_source_registry_get_type
+zeitgeist_event_get_type
+zeitgeist_index_get_type
+zeitgeist_log_get_type
+zeitgeist_monitor_get_type
+zeitgeist_result_set_get_type
+zeitgeist_result_type_get_type
+zeitgeist_storage_state_get_type
+zeitgeist_subject_get_type
+zeitgeist_time_range_get_type
=== added directory 'examples'
=== added file 'examples/Makefile.am'
--- examples/Makefile.am 1970-01-01 00:00:00 +0000
+++ examples/Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,28 @@
+INCLUDES = \
+ -I$(top_srcdir)/src -I$(top_builddir)/src \
+ $(ZEITGEIST_CFLAGS)
+
+AM_CFLAGS = \
+ -Wall \
+ -g
+
+zeitgeist_libs = $(top_builddir)/src/libzeitgeist-1.0.la $(ZEITGEIST_LIBS)
+
+noinst_PROGRAMS = \
+ find-events \
+ monitor-events \
+ search-events
+
+EXTRA_DIST = \
+ find-events-alt.vala \
+ insert-event.vala
+
+
+find_events_SOURCES = find-events.c
+find_events_LDADD = $(zeitgeist_libs)
+
+monitor_events_SOURCES = monitor-events.c
+monitor_events_LDADD = $(zeitgeist_libs)
+
+search_events_SOURCES = search-events.c
+search_events_LDADD = $(zeitgeist_libs)
=== added file 'examples/find-events-alt.vala'
--- examples/find-events-alt.vala 1970-01-01 00:00:00 +0000
+++ examples/find-events-alt.vala 2012-02-02 12:33:19 +0000
@@ -0,0 +1,38 @@
+using Zeitgeist;
+
+namespace ZeitgeistExample
+{
+
+ public async void find_events (Zeitgeist.Log zg)
+ {
+ Event ev = new Event.full (Zeitgeist.ZG_ACCESS_EVENT,
+ Zeitgeist.ZG_USER_ACTIVITY,
+ "");
+
+ PtrArray events = new PtrArray();
+ events.add ((ev as Object).ref());
+
+ var results = yield zg.find_events (new TimeRange.anytime(),
+ (owned)events,
+ StorageState.ANY,
+ 10,
+ ResultType.MOST_POPULAR_SUBJECTS,
+ null);
+ foreach (var e in results)
+ {
+ print (" * %s\n", e.get_subject(0).get_uri());
+ }
+ }
+
+ public static int main (string[] args)
+ {
+ var zg = new Zeitgeist.Log();
+ find_events.begin (zg);
+
+ MainLoop mainloop = new MainLoop(null, false);
+ mainloop.run();
+
+ return 0;
+ }
+
+}
=== added file 'examples/find-events.c'
--- examples/find-events.c 1970-01-01 00:00:00 +0000
+++ examples/find-events.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2010 Canonical Ltd
+ *
+ * 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 warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ *
+ */
+
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <glib-object.h>
+#include <zeitgeist.h>
+
+static void
+on_events_received (ZeitgeistLog *log,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistResultSet *events;
+ ZeitgeistEvent *event;
+ ZeitgeistSubject *subject;
+ GError *error;
+ GMainLoop *mainloop = (GMainLoop*) user_data;
+ gint i;
+
+ error = NULL;
+ events = zeitgeist_log_find_events_finish (log, res, &error);
+
+ if (error)
+ {
+ g_warning ("Error reading results: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ g_message ("Got %i events:", zeitgeist_result_set_size (events));
+
+ while (zeitgeist_result_set_has_next (events))
+ {
+ event = zeitgeist_result_set_next (events);
+ for (i = 0; i < zeitgeist_event_num_subjects (event); i++)
+ {
+ subject = zeitgeist_event_get_subject (event, i);
+ g_printf ("%s\n", zeitgeist_subject_get_uri (subject));
+ }
+ }
+
+ g_object_unref (events);
+
+ g_main_loop_quit (mainloop);
+}
+
+gint
+main (gint argc,
+ gchar *argv[])
+{
+ GMainLoop *mainloop;
+ ZeitgeistLog *log;
+ GPtrArray *templates;
+
+ g_type_init ();
+
+ mainloop = g_main_loop_new (NULL, FALSE);
+ log = g_object_new (ZEITGEIST_TYPE_LOG, NULL);
+
+ templates = g_ptr_array_new ();
+ g_ptr_array_add (templates, zeitgeist_event_new ());
+
+ zeitgeist_log_find_events (log,
+ zeitgeist_time_range_new_to_now (),
+ templates,
+ ZEITGEIST_STORAGE_STATE_ANY,
+ 10,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS,
+ NULL,
+ (GAsyncReadyCallback)on_events_received,
+ mainloop);
+
+ g_main_loop_run (mainloop);
+
+ return 0;
+}
\ No newline at end of file
=== added file 'examples/insert-event.vala'
--- examples/insert-event.vala 1970-01-01 00:00:00 +0000
+++ examples/insert-event.vala 2012-02-02 12:33:19 +0000
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Canonical Ltd
+ *
+ * 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 warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ *
+ */
+
+using Zeitgeist;
+using GLib;
+
+public class Logger
+{
+ public static int main (string[] args)
+ {
+ Zeitgeist.Log zg = new Zeitgeist.Log();
+ Event ev = new Event.full (Zeitgeist.ZG_ACCESS_EVENT,
+ Zeitgeist.ZG_USER_ACTIVITY,
+ "app://gedit.desktop",
+ new Subject.full("file:///tmp/foo.txt",
+ Zeitgeist.NFO_TEXT_DOCUMENT,
+ Zeitgeist.NFO_FILE_DATA_OBJECT,
+ "text/plain",
+ "file:///tmp",
+ "foo.txt",
+ "UUID=a9a17ad2-af3a-49af-ae50-5053053535cf"));
+ zg.insert_events_no_reply(ev);
+
+ MainLoop mainloop = new MainLoop(null, false);
+ mainloop.run();
+
+ return 0;
+ }
+}
\ No newline at end of file
=== added file 'examples/monitor-events.c'
--- examples/monitor-events.c 1970-01-01 00:00:00 +0000
+++ examples/monitor-events.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2010 Canonical Ltd
+ *
+ * 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 warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ *
+ */
+
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <glib-object.h>
+#include <zeitgeist.h>
+
+static void
+on_events_inserted (ZeitgeistMonitor *mon,
+ ZeitgeistTimeRange *time_range,
+ ZeitgeistResultSet *events,
+ gpointer user_data)
+{
+ ZeitgeistEvent *event;
+ ZeitgeistSubject *subject;
+ gint j;
+
+ g_message ("%i events inserted", zeitgeist_result_set_size (events));
+
+ while (zeitgeist_result_set_has_next (events))
+ {
+ event = zeitgeist_result_set_next (events);
+ for (j = 0; j < zeitgeist_event_num_subjects (event); j++)
+ {
+ subject = zeitgeist_event_get_subject (event, j);
+ g_message (" * %s", zeitgeist_subject_get_uri (subject));
+ }
+ }
+}
+
+static void
+on_events_deleted (ZeitgeistMonitor *mon,
+ ZeitgeistTimeRange *time_range,
+ GArray *event_ids,
+ gpointer user_data)
+{
+ g_message ("%i events deleted", event_ids->len);
+}
+
+gint
+main (gint argc,
+ gchar *argv[])
+{
+ GMainLoop *mainloop;
+ ZeitgeistLog *log;
+ ZeitgeistMonitor *monitor;
+ GPtrArray *templates;
+
+ g_type_init ();
+
+ mainloop = g_main_loop_new (NULL, FALSE);
+ log = g_object_new (ZEITGEIST_TYPE_LOG, NULL);
+
+ /* Templates matching anything */
+ templates = g_ptr_array_new ();
+ g_ptr_array_add (templates, zeitgeist_event_new ());
+
+ monitor = zeitgeist_monitor_new (zeitgeist_time_range_new_anytime (),
+ templates);
+
+
+ g_signal_connect (monitor, "events-inserted",
+ G_CALLBACK (on_events_inserted), NULL);
+ g_signal_connect (monitor, "events-deleted",
+ G_CALLBACK (on_events_deleted), NULL);
+
+ zeitgeist_log_install_monitor (log, monitor);
+
+ g_main_loop_run (mainloop);
+
+ return 0;
+}
=== added file 'examples/search-events.c'
--- examples/search-events.c 1970-01-01 00:00:00 +0000
+++ examples/search-events.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2010 Canonical Ltd
+ *
+ * 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 warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ *
+ */
+
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <glib-object.h>
+#include <zeitgeist.h>
+
+static void
+on_events_received (ZeitgeistIndex *index,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistResultSet *events;
+ ZeitgeistEvent *event;
+ ZeitgeistSubject *subject;
+ GError *error;
+ GMainLoop *mainloop = (GMainLoop*) user_data;
+ gint i;
+
+ error = NULL;
+ events = zeitgeist_index_search_finish (index, res, &error);
+
+ if (error)
+ {
+ g_warning ("Error reading results: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ g_message ("Got %u/%u events:",
+ zeitgeist_result_set_size (events),
+ zeitgeist_result_set_estimated_matches (events));
+
+ while (zeitgeist_result_set_has_next (events))
+ {
+ event = zeitgeist_result_set_next (events);
+ for (i = 0; i < zeitgeist_event_num_subjects (event); i++)
+ {
+ subject = zeitgeist_event_get_subject (event, i);
+ g_printf ("%s\n", zeitgeist_subject_get_uri (subject));
+ }
+ }
+
+ g_object_unref (events);
+
+ g_main_loop_quit (mainloop);
+}
+
+gint
+main (gint argc,
+ gchar *argv[])
+{
+ GMainLoop *mainloop;
+ ZeitgeistIndex *index;
+ gchar **queryv;
+ gchar *query;
+
+ g_type_init ();
+
+ if (argc <= 1)
+ {
+ g_printf ("Please specify a string to search for.\n");
+ return 1;
+ }
+
+ /* Construct query string by concatenating the command line args
+ * except the first one */
+ queryv = argv;
+ queryv++;
+ query = g_strjoinv (" ", queryv);
+
+ mainloop = g_main_loop_new (NULL, FALSE);
+ index = zeitgeist_index_new ();
+
+ g_printf ("Searching for '%s':\n", query);
+
+ zeitgeist_index_search (index,
+ query,
+ zeitgeist_time_range_new_anytime (),
+ g_ptr_array_new (),
+ 0,
+ 10,
+ ZEITGEIST_RESULT_TYPE_RELEVANCY,
+ NULL,
+ (GAsyncReadyCallback)on_events_received,
+ mainloop);
+
+ g_main_loop_run (mainloop);
+
+ return 0;
+}
\ No newline at end of file
=== added directory 'src'
=== renamed directory 'src' => 'src.moved'
=== added file 'src/Makefile.am'
--- src/Makefile.am 1970-01-01 00:00:00 +0000
+++ src/Makefile.am 2012-02-02 12:33:19 +0000
@@ -0,0 +1,134 @@
+NULL =
+
+# create a .h file containing the introspection data in a variable for gdbus
+%-xml.h : dbus/%.xml
+ name=`basename $< | sed -e 's/[-\.]/_/g' -e 's/.xml/_xml/g'`; \
+ echo "static const gchar $$name[] = " > $@; \
+ cat $< | tr \" \' | sed 's/^/\"/g' | sed 's/$$/\"/g' >> $@; \
+ echo ";" >> $@;
+
+zeitgeist-marshal.h : marshal.list
+ $(GLIB_GENMARSHAL) $< --prefix=_zeitgeist_cclosure_marshal --header > $@
+
+zeitgeist-marshal.c : marshal.list zeitgeist-marshal.h
+ $(GLIB_GENMARSHAL) $< --prefix=_zeitgeist_cclosure_marshal --body > $@
+
+zeitgeist-enumtypes.h: $(enum_headers) zeitgeist-enumtypes.h.template
+ ( top_builddir=`cd $(top_builddir) && pwd`; \
+ cd $(srcdir) && glib-mkenums --template $@.template $(enum_headers) ) > \
+ $@.tmp && mv $@.tmp $@
+
+zeitgeist-enumtypes.c: $(enum_headers) zeitgeist-enumtypes.c.template
+ ( top_builddir=`cd $(top_builddir) && pwd`; \
+ cd $(srcdir) && glib-mkenums --template $@.template $(enum_headers) ) > \
+ $@.tmp && mv $@.tmp $@
+
+enum_headers = \
+ zeitgeist-enums.h \
+ $(NULL)
+
+BUILT_SOURCES = \
+ zeitgeist-enumtypes.h \
+ zeitgeist-enumtypes.c \
+ zeitgeist-marshal.h \
+ zeitgeist-marshal.c \
+ org.gnome.zeitgeist.Blacklist-xml.h \
+ org.gnome.zeitgeist.DataSourceRegistry-xml.h \
+ org.gnome.zeitgeist.Index-xml.h \
+ org.gnome.zeitgeist.Log-xml.h \
+ org.gnome.zeitgeist.Monitor-xml.h \
+ $(NULL)
+
+AM_CPPFLAGS = \
+ $(ZEITGEIST_CFLAGS) \
+ -include $(CONFIG_HEADER) \
+ -DZEITGEIST_COMPILATION \
+ -DG_LOG_DOMAIN=\"LibZeitgeist\" \
+ $(MAINTAINER_CFLAGS) \
+ $(NULL)
+
+lib_LTLIBRARIES = libzeitgeist-1.0.la
+
+libzeitgeist_1_0_la_SOURCES = \
+ zeitgeist-data-source.h \
+ zeitgeist-data-source.c \
+ zeitgeist-data-source-registry.h \
+ zeitgeist-data-source-registry.c \
+ zeitgeist-enums.h \
+ zeitgeist-enumtypes.h \
+ zeitgeist-enumtypes.c \
+ zeitgeist-event.c \
+ zeitgeist-event.h \
+ zeitgeist-index.c \
+ zeitgeist-index.h \
+ zeitgeist-log.c \
+ zeitgeist-log.h \
+ zeitgeist-marshal.c \
+ zeitgeist-marshal.h \
+ zeitgeist-mimetypes.c \
+ zeitgeist-mimetypes.h \
+ zeitgeist-monitor.c \
+ zeitgeist-monitor.h \
+ zeitgeist-ontology-interpretations.h \
+ zeitgeist-ontology-manifestations.h \
+ zeitgeist-result-set.h \
+ zeitgeist-simple-result-set.c \
+ zeitgeist-simple-result-set.h \
+ zeitgeist-result-set.c \
+ zeitgeist-subject.c \
+ zeitgeist-subject.h \
+ zeitgeist-symbols.c \
+ zeitgeist-symbols.h \
+ zeitgeist-timerange.c \
+ zeitgeist-timerange.h \
+ zeitgeist-timestamp.c \
+ zeitgeist-timestamp.h \
+ zeitgeist.h \
+ org.gnome.zeitgeist.Monitor-xml.h \
+ $(NULL)
+
+libzeitgeist_1_0_la_LIBADD = \
+ $(ZEITGEIST_LIBS) \
+ $(NULL)
+
+libzeitgeist_1_0_la_LDFLAGS = \
+ $(ZEITGEIST_LT_LDFLAGS)
+
+devel_headersdir = $(includedir)/zeitgeist-1.0
+
+devel_headers = \
+ zeitgeist-data-source.h \
+ zeitgeist-data-source-registry.h \
+ zeitgeist-enums.h \
+ zeitgeist-enumtypes.h \
+ zeitgeist-event.h \
+ zeitgeist-index.h \
+ zeitgeist-log.h \
+ zeitgeist-mimetypes.h \
+ zeitgeist-monitor.h \
+ zeitgeist-ontology-interpretations.h \
+ zeitgeist-ontology-manifestations.h \
+ zeitgeist-result-set.h \
+ zeitgeist-subject.h \
+ zeitgeist-symbols.h \
+ zeitgeist-timerange.h \
+ zeitgeist-timestamp.h \
+ zeitgeist.h
+
+devel_headers_HEADERS = \
+ $(devel_headers)
+
+EXTRA_DIST = \
+ marshal.list \
+ zeitgeist-enumtypes.c.template \
+ zeitgeist-enumtypes.h.template \
+ dbus/org.gnome.zeitgeist.Blacklist.xml \
+ dbus/org.gnome.zeitgeist.DataSourceRegistry.xml \
+ dbus/org.gnome.zeitgeist.Index.xml \
+ dbus/org.gnome.zeitgeist.Log.xml \
+ dbus/org.gnome.zeitgeist.Monitor.xml \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(BUILT_SOURCES)
+ $(NULL)
=== added directory 'src/dbus'
=== added file 'src/dbus/org.gnome.zeitgeist.Blacklist.xml'
--- src/dbus/org.gnome.zeitgeist.Blacklist.xml 1970-01-01 00:00:00 +0000
+++ src/dbus/org.gnome.zeitgeist.Blacklist.xml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node>
+
+ <interface name="org.gnome.zeitgeist.Blacklist">
+
+ <!-- Events matching the blacklisted templates will not be inserted into the log -->
+ <method name="SetBlacklist">
+ <!-- List of event templates to blacklist -->
+ <arg direction="in" type="a(asaasay)" name="events" />
+ </method>
+
+ <method name="GetBlacklist">
+ <!-- List of event templates to blacklist -->
+ <arg direction="out" type="a(asaasay)" name="events" />
+ </method>
+
+ </interface>
+
+</node>
=== added file 'src/dbus/org.gnome.zeitgeist.DataSourceRegistry.xml'
--- src/dbus/org.gnome.zeitgeist.DataSourceRegistry.xml 1970-01-01 00:00:00 +0000
+++ src/dbus/org.gnome.zeitgeist.DataSourceRegistry.xml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node>
+
+ <interface name="org.gnome.zeitgeist.DataSourceRegistry">
+ <!-- An extension which allows you to registers data sources in a central repository.
+ This allows for example to disable some data sources -->
+
+ <method name="RegisterDataSource">
+ <arg direction="in" type="s" name="unique_id"/>
+ <arg direction="in" type="s" name="name"/>
+ <arg direction="in" type="s" name="description"/>
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ <arg direction="out" type="b" name="result"/>
+ </method>
+
+ <method name="SetDataSourceEnabled">
+ <arg direction="in" type="s" name="unique_id"/>
+ <arg direction="in" type="b" name="enabled"/>
+ </method>
+
+ <method name="GetDataSources">
+ <arg direction="out" type="a(sssa(asaasay)bxb)" />
+ </method>
+
+ <signal name="DataSourceRegistered">
+ <arg type="(sssa(asaasay)bxb)" />
+ </signal>
+
+ <signal name="DataSourceDisconnected">
+ <arg type="(sssa(asaasay)bxb)" />
+ </signal>
+
+ <signal name="DataSourceEnabled">
+ <arg type="s" name="unique_id"/>
+ <arg type="b" name="enabled"/>
+ </signal>
+
+ </interface>
+
+</node>
=== added file 'src/dbus/org.gnome.zeitgeist.Index.xml'
--- src/dbus/org.gnome.zeitgeist.Index.xml 1970-01-01 00:00:00 +0000
+++ src/dbus/org.gnome.zeitgeist.Index.xml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node>
+
+ <interface name="org.gnome.zeitgeist.Index">
+
+ <method name="Search">
+ <!-- Do a full text search against the Zeitgeist FTS Extension.
+ The time range and event templates are only used to filter
+ the results and will not affect the relevancy ranking -->
+ <arg direction="in" type="s" name="query"/>
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ <arg direction="in" type="u" name="offset"/>
+ <arg direction="in" type="u" name="num_events" />
+ <arg direction="in" type="u" name="result_type" />
+ <arg direction="out" type="a(asaasay)" name="events" />
+ <arg direction="out" type="u" name="hit_count"/>
+ </method>
+
+ </interface>
+
+
+</node>
=== added file 'src/dbus/org.gnome.zeitgeist.Log.xml'
--- src/dbus/org.gnome.zeitgeist.Log.xml 1970-01-01 00:00:00 +0000
+++ src/dbus/org.gnome.zeitgeist.Log.xml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node>
+
+ <interface name="org.gnome.zeitgeist.Log">
+
+ <!-- Primary DBus interface for querying and updating
+ the Zeitgeist activity log-->
+
+ <method name="InsertEvents">
+ <arg direction="in" type="a(asaasay)" name="events" />
+ <arg direction="out" type="au" name="event_ids"/>
+ </method>
+
+ <method name="DeleteLog">
+ </method>
+
+ <method name="FindRelatedUris">
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ <arg direction="in" type="a(asaasay)" name="result_event_templates" />
+ <arg direction="in" type="u" name="storage_state" />
+ <arg direction="in" type="u" name="num_events" />
+ <arg direction="in" type="u" name="result_type" />
+ <arg direction="out" type="as" name="subject_uris" />
+ </method>
+
+ <method name="FindEvents">
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ <arg direction="in" type="u" name="storage_state" />
+ <arg direction="in" type="u" name="num_events" />
+ <arg direction="in" type="u" name="result_type"/>
+ <arg direction="out" type="a(asaasay)" name="events" />
+ </method>
+
+ <method name="FindEventIds">
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ <arg direction="in" type="u" name="storage_state" />
+ <arg direction="in" type="u" name="num_events" />
+ <arg direction="in" type="u" name="result_type" />
+ <arg direction="out" type="au" name="event_ids" />
+ </method>
+
+ <method name="DeleteEvents">
+ <arg direction="in" type="au" name="event_ids" />
+ </method>
+
+ <method name="Quit">
+ </method>
+
+ <method name="GetEvents">
+ <!-- Get a set of events given their event ids -->
+ <arg direction="in" type="au" name="event_ids" />
+ <arg direction="out" type="a(asaasay)" name="events" />
+ </method>
+
+ <method name="InstallMonitor">
+ <arg direction="in" type="o" name="monitor_path" />
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="event_templates" />
+ </method>
+
+ <method name="RemoveMonitor">
+ <arg direction="in" type="o" name="monitor_path" />
+ </method>
+
+ </interface>
+
+</node>
=== added file 'src/dbus/org.gnome.zeitgeist.Monitor.xml'
--- src/dbus/org.gnome.zeitgeist.Monitor.xml 1970-01-01 00:00:00 +0000
+++ src/dbus/org.gnome.zeitgeist.Monitor.xml 2012-02-02 12:33:19 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<node>
+
+ <interface name="org.gnome.zeitgeist.Monitor">
+
+ <!-- Client side monitor installed on the engine with
+ org.gnome.zeitgeist.Log.InstallMonitor() -->
+
+ <method name="NotifyInsert">
+ <!-- Events matching the templates has been inserted into the log -->
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="a(asaasay)" name="events" />
+ </method>
+
+ <method name="NotifyDelete">
+ <!-- Events matching the templates has been deleted from the log -->
+ <arg direction="in" type="(xx)" name="time_range" />
+ <arg direction="in" type="au" name="event_ids" />
+ </method>
+
+ </interface>
+
+</node>
=== added file 'src/marshal.list'
--- src/marshal.list 1970-01-01 00:00:00 +0000
+++ src/marshal.list 2012-02-02 12:33:19 +0000
@@ -0,0 +1,9 @@
+# ZeitgeistMonitor::events-inserted
+VOID:OBJECT,OBJECT
+
+# ZeitgeistMonitor::events-deleted
+VOID:OBJECT,BOXED
+
+# ZeitgeistDataSourceRegistry::source-enabled
+VOID:STRING,BOOLEAN
+
=== added file 'src/zeitgeist-data-source-registry.c'
--- src/zeitgeist-data-source-registry.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-data-source-registry.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,607 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by: Michal Hruby <michal.mhr@xxxxxxxxx>
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-data-source-registry.h"
+#include "zeitgeist-marshal.h"
+
+/**
+ * SECTION:zeitgeist-data-source-registry
+ * @short_description: Query the Zeitgeist Data Source Registry extension
+ * @include: zeitgeist.h
+ *
+ * The Zeitgeist engine maintains a publicly available list of recognized
+ * data-sources (components inserting information into Zeitgeist).
+ * #ZeitgeistDataSourceRegistry is used to register new data sources,
+ * get information about them and gives the ability to enable or disable
+ * the data sources.
+ */
+
+G_DEFINE_TYPE (ZeitgeistDataSourceRegistry,
+ zeitgeist_data_source_registry,
+ G_TYPE_OBJECT);
+#define ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, \
+ ZeitgeistDataSourceRegistryPrivate))
+
+typedef struct
+{
+ /* Our connection to the bus */
+ GDBusConnection *connection;
+
+ /* The connection to the ZG daemon.
+ * If index != NULL it means we have a connection */
+ GDBusProxy *registry;
+
+ /* Method calls queued up while waiting for a proxy */
+ GSList *method_dispatch_queue;
+
+ /* DBus signal handlers */
+ guint dbus_signals_id;
+
+} ZeitgeistDataSourceRegistryPrivate;
+
+/* Property ids */
+enum
+{
+ PROP_0,
+
+ LAST_PROPERTY
+};
+
+enum
+{
+ SOURCE_REGISTERED,
+ SOURCE_ENABLED,
+ SOURCE_DISCONNECTED,
+
+ LAST_SIGNAL
+};
+
+static guint _registry_signals[LAST_SIGNAL] = { 0 };
+
+typedef struct
+{
+ ZeitgeistDataSourceRegistry *self;
+ const gchar *method_name;
+ GVariant *params;
+ GCancellable *cancellable;
+ GAsyncReadyCallback cb;
+ gpointer user_data;
+} MethodDispatchContext;
+
+static void on_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void dispatch_method (MethodDispatchContext *ctx);
+
+static void dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void
+zeitgeist_data_source_registry_init (ZeitgeistDataSourceRegistry *self)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ /* Set up the connection to the ZG daemon */
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.gnome.zeitgeist.Engine",
+ "/org/gnome/zeitgeist/data_source_registry",
+ "org.gnome.zeitgeist.DataSourceRegistry",
+ NULL,
+ on_proxy_acquired,
+ g_object_ref (self));
+}
+
+static void
+zeitgeist_data_source_registry_finalize (GObject *object)
+{
+ ZeitgeistDataSourceRegistry *registry;
+ ZeitgeistDataSourceRegistryPrivate *priv;
+
+ registry = ZEITGEIST_DATA_SOURCE_REGISTRY (object);
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (registry);
+
+ if (priv->dbus_signals_id)
+ {
+ g_dbus_connection_signal_unsubscribe (priv->connection,
+ priv->dbus_signals_id);
+ priv->dbus_signals_id = 0;
+ }
+
+ if (priv->registry)
+ {
+ g_object_unref (priv->registry);
+ priv->registry = NULL;
+ }
+
+ if (priv->connection)
+ {
+ g_object_unref (priv->connection);
+ priv->connection = NULL;
+ }
+
+
+
+ G_OBJECT_CLASS (zeitgeist_data_source_registry_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_data_source_registry_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+zeitgeist_data_source_registry_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+on_dbus_signal_received (GDBusConnection *connection,
+ const gchar *sender_name,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
+{
+ ZeitgeistDataSourceRegistry *self;
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ ZeitgeistDataSource *src;
+ gchar *unique_id;
+ gboolean enabled;
+ GVariant *vsrc;
+
+ self = ZEITGEIST_DATA_SOURCE_REGISTRY (user_data);
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ if (g_strcmp0 (signal_name, "DataSourceRegistered") == 0)
+ {
+ vsrc = g_variant_get_child_value (parameters, 0);
+ src = zeitgeist_data_source_new_from_variant (vsrc);
+ g_signal_emit (self, _registry_signals[SOURCE_REGISTERED], 0, src);
+ g_variant_unref (vsrc);
+ g_object_unref (src);
+ }
+ else if (g_strcmp0 (signal_name, "DataSourceDisconnected") == 0)
+ {
+ vsrc = g_variant_get_child_value (parameters, 0);
+ src = zeitgeist_data_source_new_from_variant (vsrc);
+ g_signal_emit (self, _registry_signals[SOURCE_DISCONNECTED], 0, src);
+ g_variant_unref (vsrc);
+ g_object_unref (src);
+ }
+ else if (g_strcmp0 (signal_name, "DataSourceEnabled") == 0)
+ {
+ g_variant_get (parameters, "(sb)", &unique_id, &enabled); // FIXME: unref?
+ g_signal_emit (self, _registry_signals[SOURCE_ENABLED],
+ 0, unique_id, enabled);
+ g_free (unique_id);
+ }
+ else
+ g_warning ("Unknown signal from Zeitgeist Data Source Registry: %s",
+ signal_name);
+}
+
+static void
+zeitgeist_data_source_registry_class_init (ZeitgeistDataSourceRegistryClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
+ object_class->finalize = zeitgeist_data_source_registry_finalize;
+ object_class->get_property = zeitgeist_data_source_registry_get_property;
+ object_class->set_property = zeitgeist_data_source_registry_set_property;
+
+ _registry_signals[SOURCE_REGISTERED] =
+ g_signal_new ("source-registered",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ZeitgeistDataSourceRegistryClass, source_registered),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, ZEITGEIST_TYPE_DATA_SOURCE);
+
+ _registry_signals[SOURCE_DISCONNECTED] =
+ g_signal_new ("source-disconnected",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ZeitgeistDataSourceRegistryClass, source_disconnected),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1, ZEITGEIST_TYPE_DATA_SOURCE);
+
+ // FIXME: This signal should really be "source-toggled" and give ZgDataSrc as only arg
+ _registry_signals[SOURCE_ENABLED] =
+ g_signal_new ("source-enabled",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ZeitgeistDataSourceRegistryClass, source_enabled),
+ NULL, NULL,
+ _zeitgeist_cclosure_marshal_VOID__STRING_BOOLEAN,
+ G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN);
+
+ g_type_class_add_private (object_class,
+ sizeof (ZeitgeistDataSourceRegistryPrivate));
+}
+
+/*
+ * API BELOW HERE
+ */
+
+/**
+ * zeitgeist_data_source_registry_new:
+ *
+ * Create a new data source registry instance.
+ *
+ * DataSourceRegistry instances are not overly expensive for neither
+ * client or the Zeitgeist daemon so there's no need to go to lengths
+ * to keep singleton instances around.
+ *
+ * Returns: A reference to a newly allocated registry.
+ */
+ZeitgeistDataSourceRegistry*
+zeitgeist_data_source_registry_new (void)
+{
+ ZeitgeistDataSourceRegistry *registry;
+
+ registry = (ZeitgeistDataSourceRegistry*)
+ g_object_new (ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, NULL);
+
+ return registry;
+}
+
+void
+zeitgeist_data_source_registry_get_data_sources (
+ ZeitgeistDataSourceRegistry *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self));
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "GetDataSources";
+ ctx->params = g_variant_new ("()");
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+/**
+ * zeitgeist_data_source_registry_get_data_sources_finish:
+ * @self: Instance of #ZeitgeistDataSourceRegistry.
+ * @res: a #GAsyncResult.
+ * @error: a #GError or #NULL.
+ *
+ * Returns: Newly created #GPtrArray containing #ZeitgeistDataSource<!-- -->(s)
+ * registered in Zeitgeist. Free using g_ptr_array_unref() once
+ * you're done using it.
+ */
+GPtrArray*
+zeitgeist_data_source_registry_get_data_sources_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ GVariant *val, *vsources;
+ GPtrArray *sources;
+
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ val = g_dbus_proxy_call_finish (priv->registry, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ vsources = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ sources = zeitgeist_data_sources_from_variant (vsources);
+ g_variant_unref (vsources);
+
+ return sources;
+}
+
+/**
+ * zeitgeist_data_source_registry_register_data_source:
+ * @self: Instance of #ZeitgeistDataSourceRegistry.
+ * @source: Data source to register. If this is a
+ * floating reference it will be consumed
+ * @cancellable: a #GCancellable or #NULL.
+ * @callback: a GAsyncReadyCallback to call when the request is finished.
+ * @user_data: the data to pass to callback function.
+ *
+ * Registers new data source in the registry, the @source parameter needs to
+ * have unique-id, name, description and optionally event_templates set,
+ * therefore it is useful to pass #ZeitgeistDataSource instance created using
+ * zeitgeist_data_source_new_full(). The registry will assume its ownership.
+ */
+void
+zeitgeist_data_source_registry_register_data_source (
+ ZeitgeistDataSourceRegistry *self,
+ ZeitgeistDataSource *source,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ MethodDispatchContext *ctx;
+ GVariant *vsource;
+
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self));
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (source));
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ vsource = zeitgeist_data_source_to_variant (source); // sinks ref
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "RegisterDataSource";
+ ctx->params = vsource;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+/**
+ * zeitgeist_data_source_registry_register_data_source_finish:
+ * @self: Instance of #ZeitgeistDataSourceRegistry.
+ * @res: Result of the asynchronous operation.
+ * @error: a #GError or NULL.
+ *
+ * Returns: If error is unset, returns whether this data source is enabled.
+ */
+gboolean
+zeitgeist_data_source_registry_register_data_source_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ GVariant *val;
+
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->registry, res, error);
+
+ if (val == NULL)
+ return FALSE;
+
+ g_variant_unref (val);
+ return TRUE;
+}
+
+void
+zeitgeist_data_source_registry_set_data_source_enabled (
+ ZeitgeistDataSourceRegistry *self,
+ const gchar *unique_id,
+ gboolean enabled,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ MethodDispatchContext *ctx;
+ GVariant *params;
+ GVariantBuilder b;
+
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self));
+ g_return_if_fail (unique_id != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(sb)"));
+ g_variant_builder_add (&b, "s", unique_id);
+ g_variant_builder_add (&b, "b", enabled);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "SetDataSourceEnabled";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+gboolean
+zeitgeist_data_source_registry_set_data_source_enabled_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ GVariant *val;
+
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE_REGISTRY (self), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->registry, res, error);
+
+ if (val == NULL)
+ return FALSE;
+
+ g_variant_unref (val);
+ return TRUE;
+}
+
+static void
+on_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistDataSourceRegistry *self;
+ ZeitgeistDataSourceRegistryPrivate *priv;
+ GError *error;
+
+ self = ZEITGEIST_DATA_SOURCE_REGISTRY (user_data);
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (self);
+
+ error = NULL;
+ priv->registry = g_dbus_proxy_new_finish (res, &error);
+
+ if (error != NULL)
+ {
+ g_critical ("Unable to connect to Zeitgeist daemon: %s",
+ error->message);
+ g_error_free (error);
+ }
+ else
+ {
+ /* Dispatch all method calls queued while waiting for the proxy */
+ priv->method_dispatch_queue = g_slist_reverse (priv->method_dispatch_queue);
+ g_slist_foreach (priv->method_dispatch_queue, (GFunc) dispatch_method, NULL);
+ g_slist_free (priv->method_dispatch_queue);
+ priv->method_dispatch_queue = NULL;
+ }
+
+ /* Grab a ref on the GDBusConnection as well */
+ priv->connection = G_DBUS_CONNECTION (g_object_ref (g_dbus_proxy_get_connection (priv->registry)));
+
+ /* Connect to all DBus signals from the data source registry */
+ priv->dbus_signals_id = g_dbus_connection_signal_subscribe (
+ priv->connection,
+ "org.gnome.zeitgeist.Engine",
+ "org.gnome.zeitgeist.DataSourceRegistry",
+ NULL, /* Listen for any signal on this interface */
+ "/org/gnome/zeitgeist/data_source_registry",
+ NULL,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ on_dbus_signal_received,
+ self, NULL);
+
+ /* Release ref we held during async op */
+ g_object_unref (self);
+}
+
+/* Send off the DBus method call, or queue it if we don't
+ * have a proxy at this point */
+static void
+dispatch_method (MethodDispatchContext *ctx)
+{
+ ZeitgeistDataSourceRegistryPrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_REGISTRY_GET_PRIVATE (ctx->self);
+
+ if (priv->registry)
+ {
+ g_dbus_proxy_call (priv->registry,
+ ctx->method_name,
+ ctx->params,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ ctx->cancellable,
+ dispatch_async_callback,
+ ctx);
+ }
+ else
+ priv->method_dispatch_queue = g_slist_prepend (priv->method_dispatch_queue,
+ ctx);
+}
+
+/* Used to marshal the async callbacks from GDBus into ones
+ * coming from this ZeitgeistIndex instance */
+static void
+dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GVariant *var;
+ MethodDispatchContext *ctx = (MethodDispatchContext*) user_data;
+
+ if (ctx->cb != NULL)
+ ctx->cb (G_OBJECT (ctx->self), res, ctx->user_data);
+ else
+ {
+ /* Caller ignores response - finish the call our selves */
+ var = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, NULL);
+ if (var != NULL)
+ g_variant_unref (var);
+ }
+
+ g_object_unref (ctx->self);
+ g_free (ctx);
+}
=== added file 'src/zeitgeist-data-source-registry.h'
--- src/zeitgeist-data-source-registry.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-data-source-registry.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by: Michal Hruby <michal.mhr@xxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_DATA_SOURCE_REGISTRY_H_
+#define _ZEITGEIST_DATA_SOURCE_REGISTRY_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <zeitgeist-event.h>
+#include <zeitgeist-enums.h>
+#include <zeitgeist-data-source.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY (zeitgeist_data_source_registry_get_type())
+#define ZEITGEIST_DATA_SOURCE_REGISTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistry))
+#define ZEITGEIST_DATA_SOURCE_REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistryClass))
+#define ZEITGEIST_DATA_SOURCE_REGISTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY, ZeitgeistDataSourceRegistryClass))
+#define ZEITGEIST_IS_DATA_SOURCE_REGISTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY))
+#define ZEITGEIST_IS_DATA_SOURCE_REGISTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ZEITGEIST_TYPE_DATA_SOURCE_REGISTRY))
+
+typedef struct _ZeitgeistDataSourceRegistry ZeitgeistDataSourceRegistry;
+typedef struct _ZeitgeistDataSourceRegistryClass ZeitgeistDataSourceRegistryClass;
+
+struct _ZeitgeistDataSourceRegistryClass
+{
+ GObjectClass parent_class;
+
+ void (*source_registered) (ZeitgeistDataSourceRegistry *registry,
+ ZeitgeistDataSource *source);
+ void (*source_disconnected) (ZeitgeistDataSourceRegistry *registry,
+ ZeitgeistDataSource *source);
+ void (*source_enabled) (ZeitgeistDataSourceRegistry *registry,
+ gchar *unique_id,
+ gboolean enabled);
+};
+
+
+struct _ZeitgeistDataSourceRegistry
+{
+ GObject parent_instance;
+};
+
+GType zeitgeist_data_source_registry_get_type (void);
+
+ZeitgeistDataSourceRegistry* zeitgeist_data_source_registry_new (void);
+
+void zeitgeist_data_source_registry_get_data_sources (
+ ZeitgeistDataSourceRegistry *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GPtrArray* zeitgeist_data_source_registry_get_data_sources_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_data_source_registry_register_data_source (
+ ZeitgeistDataSourceRegistry *self,
+ ZeitgeistDataSource *source,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean zeitgeist_data_source_registry_register_data_source_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_data_source_registry_set_data_source_enabled (
+ ZeitgeistDataSourceRegistry *self,
+ const gchar *unique_id,
+ gboolean enabled,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean zeitgeist_data_source_registry_set_data_source_enabled_finish (
+ ZeitgeistDataSourceRegistry *self,
+ GAsyncResult *res,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_DATA_SOURCE_REGISTRY_H_ */
+
=== added file 'src/zeitgeist-data-source.c'
--- src/zeitgeist-data-source.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-data-source.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,582 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by: Michal Hruby <michal.mhr@xxxxxxxxx>
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+/**
+ * SECTION:zeitgeist-data-source
+ * @short_description: Abstracts data sources used by
+ * the #ZeitgeistDataSourceRegistry extension
+ * @include: zeitgeist.h
+ *
+ * #ZeitgeistDataSource represents a data source used to insert events into
+ * Zeitgeist. The data sources are identified using the unique_id property,
+ * and when querying the data source registry you get other interesting
+ * information like timestamp of the last action of the data source, flag
+ * whether it is currently running etc.
+ */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-data-source.h"
+#include "zeitgeist-event.h"
+
+G_DEFINE_TYPE (ZeitgeistDataSource, zeitgeist_data_source, G_TYPE_INITIALLY_UNOWNED);
+#define ZEITGEIST_DATA_SOURCE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_DATA_SOURCE, ZeitgeistDataSourcePrivate))
+
+typedef struct
+{
+ gchar *unique_id;
+ gchar *name;
+ gchar *description;
+ GPtrArray *templates;
+ gboolean running;
+ gint64 timestamp;
+ gboolean enabled;
+} ZeitgeistDataSourcePrivate;
+
+/**
+ * zeitgeist_data_source_new:
+ *
+ * Create a new empty data source structure.
+ *
+ * Returns: A new instance of #ZeitgeistDataSource. The returned source will
+ * have a floating reference which will be consumed if you pass the
+ * data source to any of the methods provided by this library (like
+ * registering the data source). If you do not do that then you
+ * must free the data source yourself with g_object_unref().
+ */
+ZeitgeistDataSource*
+zeitgeist_data_source_new (void)
+{
+ return g_object_new (ZEITGEIST_TYPE_DATA_SOURCE, NULL);
+}
+
+/**
+ * zeitgeist_data_source_new_full:
+ * @id: Unique ID for the data source.
+ * @name: Name of the data source (may be translated).
+ * @desc: Data source description.
+ * @event_templates: A #GPtrArray of #ZeitgeistEvent<!-- -->s. This parameter
+ * is optional and purely informational to let data-source
+ * management applications and other data-sources know what
+ * sort of information the data source logs.
+ * The data source will assume ownership of the events and
+ * the pointer array.
+ * If you want to keep a reference for yourself you must do a
+ * g_ptr_array_ref() on @event_templates as well as reffing
+ * the events held by it before calling this method.
+ *
+ * Creates a new instance of DataSource with the given ID, name and
+ * description.
+ *
+ * Returns: New instance of #ZeitgeistDataSource with floating reference,
+ * if you do not pass the instance to method like
+ * zeitgeist_data_source_registry_register_data_source(), then you
+ * have to free the data source yourself using g_object_unref().
+ */
+ZeitgeistDataSource*
+zeitgeist_data_source_new_full (const gchar *id,
+ const gchar *name,
+ const gchar *desc,
+ GPtrArray *templates)
+{
+ ZeitgeistDataSource* src = zeitgeist_data_source_new ();
+
+ zeitgeist_data_source_set_unique_id (src, id);
+ zeitgeist_data_source_set_name (src, name);
+ zeitgeist_data_source_set_description (src, desc);
+ zeitgeist_data_source_set_event_templates (src, templates);
+
+ return src;
+}
+
+/**
+ * zeitgeist_data_source_new_from_variant:
+ * @event: A #GVariant with signature defined in
+ * #ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE.
+ * If @src is a floating reference the floating reference
+ * will be consumed.
+ *
+ * Parse the data in a #GVariant and build a #ZeitgeistDataSource from it.
+ * The reverse operation of this is zeitgeist_data_source_to_variant_full().
+ *
+ * Returns: A newly allocated #ZeitgeistDataSource filled with the metadata and
+ * event templates described by @src. The returned data source will
+ * have a floating reference which will be consumed if you pass the
+ * data source to any of the methods provided by this library. If you
+ * do not do that then you must free the data source yourself with
+ * g_object_unref()
+ */
+ZeitgeistDataSource*
+zeitgeist_data_source_new_from_variant (GVariant *src)
+{
+ ZeitgeistDataSource *result;
+ gchar *unique_id, *name, *description;
+ GVariant *event_templates_data;
+ GPtrArray *event_templates;
+ gboolean running, enabled;
+ gint64 timestamp;
+
+ g_return_val_if_fail (src != NULL, NULL);
+
+ /* Parse the variant */
+ g_variant_ref_sink (src);
+ g_variant_get (src, ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE,
+ &unique_id, &name, &description,
+ NULL, &running, ×tamp, &enabled);
+
+ event_templates_data = g_variant_get_child_value (src, 3);
+ event_templates = zeitgeist_events_from_variant (event_templates_data);
+ g_variant_unref (event_templates_data);
+
+ /* Build the ZeitgeistDataSource */
+ result = zeitgeist_data_source_new_full (unique_id, name, description,
+ event_templates); // own ref
+
+ zeitgeist_data_source_set_running (result, running);
+ zeitgeist_data_source_set_timestamp (result, timestamp);
+ zeitgeist_data_source_set_enabled (result, enabled);
+
+ /* Clean up */
+ g_free (unique_id);
+ g_free (name);
+ g_free (description);
+ g_variant_unref (src);
+
+ return result;
+}
+
+const gchar*
+zeitgeist_data_source_get_unique_id (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->unique_id;
+}
+
+void
+zeitgeist_data_source_set_unique_id (ZeitgeistDataSource *src,
+ const gchar* unique_id)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ if (priv->unique_id)
+ {
+ g_free (priv->unique_id);
+ }
+
+ priv->unique_id = g_strdup (unique_id);
+}
+
+const gchar*
+zeitgeist_data_source_get_name (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->name;
+}
+
+void
+zeitgeist_data_source_set_name (ZeitgeistDataSource *src,
+ const gchar *name)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ if (priv->name)
+ {
+ g_free (priv->name);
+ }
+
+ priv->name = g_strdup (name);
+}
+
+const gchar*
+zeitgeist_data_source_get_description (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->description;
+}
+
+void
+zeitgeist_data_source_set_description (ZeitgeistDataSource *src,
+ const gchar *description)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ if (priv->description)
+ {
+ g_free (priv->description);
+ }
+
+ priv->description = g_strdup (description);
+}
+
+GPtrArray*
+zeitgeist_data_source_get_event_templates (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->templates;
+}
+
+/**
+ * zeitgeist_data_source_set_event_templates:
+ * @src: Instance of #ZeitgeistDataSource.
+ * @event_templates: A #GPtrArray which contains elements of type
+ * #ZeitgeistEvent.
+ * The data source will assume ownership of the events and
+ * the pointer array.
+ * If you want to keep a reference for yourself you must do a
+ * g_ptr_array_ref() on @templates as well as reffing
+ * the events held by it before calling this method.
+ *
+ * Sets event templates which are logged by this #ZeitgeistDataSource
+ * instance.
+ */
+void
+zeitgeist_data_source_set_event_templates (ZeitgeistDataSource *src,
+ GPtrArray *event_templates)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ if (priv->templates)
+ {
+ g_ptr_array_unref (priv->templates);
+ }
+
+ if (event_templates)
+ {
+ g_ptr_array_foreach (event_templates, (GFunc) g_object_ref_sink, NULL);
+ g_ptr_array_set_free_func (event_templates, g_object_unref);
+ }
+
+ priv->templates = event_templates;
+}
+
+gboolean
+zeitgeist_data_source_is_running (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), FALSE);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->running;
+}
+
+void
+zeitgeist_data_source_set_running (ZeitgeistDataSource *src,
+ gboolean running)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ priv->running = running;
+}
+
+gint64
+zeitgeist_data_source_get_timestamp (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), 0);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->timestamp;
+}
+
+void
+zeitgeist_data_source_set_timestamp (ZeitgeistDataSource *src,
+ gint64 timestamp)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ priv->timestamp = timestamp;
+}
+
+gboolean
+zeitgeist_data_source_is_enabled (ZeitgeistDataSource *src)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), FALSE);
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ return priv->enabled;
+}
+
+void
+zeitgeist_data_source_set_enabled (ZeitgeistDataSource *src,
+ gboolean enabled)
+{
+ ZeitgeistDataSourcePrivate *priv;
+ g_return_if_fail (ZEITGEIST_IS_DATA_SOURCE (src));
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ priv->enabled = enabled;
+}
+
+static void
+zeitgeist_data_source_init (ZeitgeistDataSource *object)
+{
+ ZeitgeistDataSourcePrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (object);
+ priv->unique_id = NULL;
+ priv->name = NULL;
+ priv->description = NULL;
+ priv->templates = NULL;
+ priv->running = FALSE;
+ priv->timestamp = 0;
+ priv->enabled = TRUE;
+}
+
+static void
+zeitgeist_data_source_finalize (GObject *object)
+{
+ ZeitgeistDataSource *src = ZEITGEIST_DATA_SOURCE (object);
+ ZeitgeistDataSourcePrivate *priv;
+
+ priv = ZEITGEIST_DATA_SOURCE_GET_PRIVATE (src);
+
+ zeitgeist_data_source_set_unique_id (src, NULL);
+ zeitgeist_data_source_set_name (src, NULL);
+ zeitgeist_data_source_set_description (src, NULL);
+ zeitgeist_data_source_set_event_templates (src, NULL);
+
+ G_OBJECT_CLASS (zeitgeist_data_source_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_data_source_class_init (ZeitgeistDataSourceClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = zeitgeist_data_source_finalize;
+
+ g_type_class_add_private (object_class, sizeof (ZeitgeistDataSourcePrivate));
+}
+
+/**
+ * zeitgeist_data_source_to_variant_full:
+ * @events: A #ZeitgeistDataSource. If this is a
+ * floating reference it will be consumed
+ *
+ * Convert a #ZeitgeistDataSource to a #GVariant with signature
+ * #ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE.
+ *
+ * Returns: A floating reference to a #GVariant as described above. Unless the
+ * floating reference is consumed somewhere you must free it with
+ * g_variant_unref().
+ */
+GVariant*
+zeitgeist_data_source_to_variant_full (ZeitgeistDataSource *src)
+{
+ GVariantBuilder b;
+ GPtrArray *event_templates;
+ GVariant *vevent_templates;
+ const gchar *str;
+
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ g_object_ref_sink (src);
+ g_variant_builder_init (&b, ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_TYPE);
+
+ /* Add static metadata */
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_unique_id(src), str ? str : ""));
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_name(src), str ? str : ""));
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_description(src), str ? str : ""));
+
+ /* Add event templates */
+ event_templates = g_ptr_array_ref (
+ zeitgeist_data_source_get_event_templates (src));
+ vevent_templates = zeitgeist_events_to_variant (event_templates);
+ g_variant_builder_add_value (&b, vevent_templates /* own ref */);
+
+ /* Add volatile metadata */
+ g_variant_builder_add (&b, "b", zeitgeist_data_source_is_running(src));
+ g_variant_builder_add (&b, "x", zeitgeist_data_source_get_timestamp(src));
+ g_variant_builder_add (&b, "b", zeitgeist_data_source_is_enabled(src));
+
+ /* Clean up */
+ g_object_unref (src);
+
+ return g_variant_builder_end (&b);
+}
+
+/**
+ * zeitgeist_data_source_to_variant:
+ * @events: A #ZeitgeistDataSource. If this is a
+ * floating reference it will be consumed
+ *
+ * Convert a #ZeitgeistDataSource to a #GVariant with signature
+ * #ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE.
+ *
+ * Returns: A floating reference to a #GVariant as described above. Unless the
+ * floating reference is consumed somewhere you must free it with
+ * g_variant_unref().
+ */
+GVariant*
+zeitgeist_data_source_to_variant (ZeitgeistDataSource *src)
+{
+ GVariantBuilder b;
+ GPtrArray *event_templates;
+ GVariant *vevent_templates;
+ const gchar *str;
+
+ g_return_val_if_fail (ZEITGEIST_IS_DATA_SOURCE (src), NULL);
+
+ g_object_ref_sink (src);
+ g_variant_builder_init (&b, ZEITGEIST_DATA_SOURCE_VARIANT_TYPE);
+
+ /* Add static metadata */
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_unique_id(src), str ? str : ""));
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_name(src), str ? str : ""));
+ g_variant_builder_add (&b, "s", (str = zeitgeist_data_source_get_description(src), str ? str : ""));
+
+ /* Add event templates */
+ event_templates = g_ptr_array_ref (
+ zeitgeist_data_source_get_event_templates (src));
+ vevent_templates = zeitgeist_events_to_variant (event_templates);
+ g_variant_builder_add_value (&b, vevent_templates /* own ref */);
+
+ /* Clean up */
+ g_object_unref (src);
+
+ return g_variant_builder_end (&b);
+}
+
+/**
+ * zeitgeist_data_sources_to_variant:
+ * @events: A #GPtrArray of #ZeitgeistDataSource<!-- -->s. If the sources has
+ * floating references they will be consumed. Furthermore the
+ * reference on the #GPtrArray itself will also be stolen and its
+ * @free_func set to %NULL
+ *
+ * Convert a set of #ZeitgeistDataSource<-- -->s to a #GVariant with signature
+ * as an array of #ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE.
+ *
+ * Returns: A floating reference to a #GVariant as described above. Unless the
+ * floating reference is consumed somewhere you must free it with
+ * g_variant_unref().
+ */
+GVariant*
+zeitgeist_data_sources_to_variant (GPtrArray *sources)
+{
+ GVariantBuilder b;
+ ZeitgeistDataSource *src;
+ GVariant *vsrc;
+ int i;
+
+ g_return_val_if_fail (sources != NULL, NULL);
+
+ g_variant_builder_init (&b,
+ G_VARIANT_TYPE ("a"ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE));
+
+ for (i = 0; i < sources->len; i++)
+ {
+ src = ZEITGEIST_DATA_SOURCE (g_ptr_array_index (sources, i));
+ g_object_ref_sink (src);
+ vsrc = zeitgeist_data_source_to_variant_full (src);
+ g_variant_builder_add_value (&b, vsrc);
+ g_object_unref (src);
+ }
+
+ /* We need to unset the free func because we can't risk double unreffing
+ * the data sources held in it, quite ugly but there is no other way */
+ g_ptr_array_set_free_func (sources, NULL);
+ g_ptr_array_unref (sources);
+
+ return g_variant_builder_end (&b);
+}
+
+/**
+ * zeitgeist_data_sources_from_variant:
+ * @sources: A #GVariant with signature as an array of
+ * #ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE.
+ * If @sources is floating this method will consume
+ * the floating reference.
+ *
+ * Returns: A reference to a #GPtrArray of #ZeitgeistDataSource<!-- -->s.
+ * All the events will be floating references, and the
+ * #GPtrArray<!-- -->'s @free_func will be set to g_object_unref().
+ */
+GPtrArray*
+zeitgeist_data_sources_from_variant (GVariant *sources)
+{
+ GPtrArray *result;
+ GVariant *vsrc;
+ ZeitgeistDataSource *src;
+ int i, n_sources;
+
+ g_return_val_if_fail (sources != NULL, NULL);
+
+ g_variant_ref_sink (sources);
+
+ n_sources = g_variant_n_children (sources);
+ result = g_ptr_array_sized_new (n_sources);
+ g_ptr_array_set_free_func (result, (GDestroyNotify) g_object_unref);
+
+ for (i = 0; i < n_sources; i++)
+ {
+ vsrc = g_variant_get_child_value (sources, i);
+ src = zeitgeist_data_source_new_from_variant (vsrc);
+ g_variant_unref (vsrc);
+ g_ptr_array_add (result, src);
+ }
+
+ g_variant_unref (sources);
+
+ return result;
+}
+
=== added file 'src/zeitgeist-data-source.h'
--- src/zeitgeist-data-source.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-data-source.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by: Michal Hruby <michal.mhr@xxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_DATA_SOURCE_H_
+#define _ZEITGEIST_DATA_SOURCE_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_DATA_SOURCE (zeitgeist_data_source_get_type ())
+
+#define ZEITGEIST_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ ZEITGEIST_TYPE_DATA_SOURCE, ZeitgeistDataSource))
+
+#define ZEITGEIST_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ ZEITGEIST_TYPE_DATA_SOURCE, ZeitgeistDataSourceClass))
+
+#define ZEITGEIST_IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ ZEITGEIST_TYPE_DATA_SOURCE))
+
+#define ZEITGEIST_IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ ZEITGEIST_TYPE_DATA_SOURCE))
+
+#define ZEITGEIST_DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ ZEITGEIST_TYPE_DATA_SOURCE, ZeitgeistDataSourceClass))
+
+typedef struct _ZeitgeistDataSource ZeitgeistDataSource;
+typedef struct _ZeitgeistDataSourceClass ZeitgeistDataSourceClass;
+
+struct _ZeitgeistDataSourceClass
+{
+ GInitiallyUnownedClass parent_class;
+};
+
+
+struct _ZeitgeistDataSource
+{
+ GInitiallyUnowned parent_instance;
+};
+
+GType zeitgeist_data_source_get_type (void);
+
+ZeitgeistDataSource* zeitgeist_data_source_new (void);
+ZeitgeistDataSource* zeitgeist_data_source_new_full (const gchar *id,
+ const gchar *name,
+ const gchar *desc,
+ GPtrArray *event_templates);
+
+ZeitgeistDataSource* zeitgeist_data_source_new_from_variant (GVariant *src);
+
+const gchar* zeitgeist_data_source_get_unique_id (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_unique_id (ZeitgeistDataSource *src,
+ const gchar* unique_id);
+
+const gchar* zeitgeist_data_source_get_name (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_name (ZeitgeistDataSource *src,
+ const gchar *name);
+
+const gchar* zeitgeist_data_source_get_description (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_description (ZeitgeistDataSource *src,
+ const gchar *description);
+
+GPtrArray* zeitgeist_data_source_get_event_templates (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_event_templates (ZeitgeistDataSource *src,
+ GPtrArray *event_templates);
+
+gboolean zeitgeist_data_source_is_running (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_running (ZeitgeistDataSource *src,
+ gboolean running);
+
+gint64 zeitgeist_data_source_get_timestamp (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_timestamp (ZeitgeistDataSource *src,
+ gint64 timestamp);
+
+gboolean zeitgeist_data_source_is_enabled (ZeitgeistDataSource *src);
+void zeitgeist_data_source_set_enabled (ZeitgeistDataSource *src,
+ gboolean enabled);
+
+GVariant* zeitgeist_data_source_to_variant (ZeitgeistDataSource *src);
+GVariant* zeitgeist_data_source_to_variant_full (ZeitgeistDataSource *src);
+
+GVariant* zeitgeist_data_sources_to_variant (GPtrArray *sources);
+
+GPtrArray* zeitgeist_data_sources_from_variant (GVariant *sources);
+
+/**
+ * ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE:
+ *
+ * The #GVariant signature for a serialized #ZeitgeistDataSource
+ */
+#define ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE "(sssa(asaasay))"
+
+/**
+ * ZEITGEIST_DATA_SOURCE_VARIANT_TYPE:
+ *
+ * The #GVariantType of #ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE
+ */
+#define ZEITGEIST_DATA_SOURCE_VARIANT_TYPE G_VARIANT_TYPE(ZEITGEIST_DATA_SOURCE_VARIANT_SIGNATURE)
+
+/**
+ * ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE:
+ *
+ * The #GVariant signature for a serialized #ZeitgeistDataSource
+ */
+#define ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE "(sssa(asaasay)bxb)"
+
+/**
+ * ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_TYPE:
+ *
+ * The #GVariantType of #ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE
+ */
+#define ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_TYPE G_VARIANT_TYPE(ZEITGEIST_DATA_SOURCE_WITH_INFO_VARIANT_SIGNATURE)
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_DATA_SOURCE_H_ */
=== added file 'src/zeitgeist-enums.h'
--- src/zeitgeist-enums.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-enums.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_ENUMS_H_
+#define _ZEITGEIST_ENUMS_H_
+
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <zeitgeist-enumtypes.h>
+
+/**
+ * SECTION:zeitgeist-enums
+ * @short_description: Enumerations used in the Zeitgeist API
+ * @include: zeitgeist.h
+ */
+
+G_BEGIN_DECLS
+
+/**
+ * ZeitgeistResultType:
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS: All events with the most recent events first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS: All events with the oldest ones first
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS: One event for each subject only, ordered with the most recent events first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS: One event for each subject only, ordered with oldest events first
+ * @ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS: One event for each subject only, ordered by the popularity of the subject
+ * @ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS: One event for each subject only, ordered ascendingly by popularity
+ * @ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ACTOR: The last event of each different actor, ordered with the most popular actor first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ACTOR: The last event of each different actor, ordered with the least popular actor first
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_ACTOR: One event for each different actor, with the actor that has been used most recently first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ACTOR: One event for each different actor, with the actor that has been used least recently first
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN: The last event of each different origin ordered with the most recent event first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ORIGIN: The first event of each different origin ordered with the least recent event first
+ * @ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN: The last event of each different origin, ordered by the popularity of the origin
+ * @ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN: The last event of each different origin, ordered ascendingly by the popularity of the origin
+ * @ZEITGEIST_RESULT_TYPE_OLDEST_ACTOR: The first event of each different actor
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECT_INTERPRETATION: One event for each subject interpretation only ordered with the most recent events first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECT_INTERPRETATION: One event for each subject interpretation only ordered with the least recent events first
+ * @ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECT_INTERPRETATION: One event for each subject interpretation only, ordered by the popularity of the subject interpretation
+ * @ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECT_INTERPRETATION: One event for each subject interpretation only, ordered ascendingly by popularity of the subject interpretation
+ * @ZEITGEIST_RESULT_TYPE_MOST_RECENT_MIMETYPE: One event for each mimetype only, ordered with the most recent events first
+ * @ZEITGEIST_RESULT_TYPE_LEAST_RECENT_MIMETYPE: One event for each mimetype only, ordered with the least recent events first
+ * @ZEITGEIST_RESULT_TYPE_MOST_POPULAR_MIMETYPE: One event for each mimetype only, ordered by the popularity of the mimetype
+ * @ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_MIMETYPE: One event for each mimetype only, ordered ascendingly by popularity of the mimetype
+ * @ZEITGEIST_RESULT_TYPE_RELEVANCY: Only allowed on zeitgeist_index_search(). Events are sorted by query relevancy
+ *
+ * Used to control how the query results are grouped and sorted.
+ * See zeitgeist_log_find_events(), zeitgeist_log_find_event_ids(), and
+ * zeitgeist_index_search().
+ */
+typedef enum
+{
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS = 0,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS = 1,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS = 2,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECTS = 3,
+ ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECTS = 4,
+ ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECTS = 5,
+ ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ACTOR = 6,
+ ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ACTOR = 7,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_ACTOR = 8,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ACTOR = 9,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN = 10,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_ORIGIN = 11,
+ ZEITGEIST_RESULT_TYPE_MOST_POPULAR_ORIGIN = 12,
+ ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_ORIGIN = 13,
+ ZEITGEIST_RESULT_TYPE_OLDEST_ACTOR = 14,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECT_INTERPRETATION = 15,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_SUBJECT_INTERPRETATION = 16,
+ ZEITGEIST_RESULT_TYPE_MOST_POPULAR_SUBJECT_INTERPRETATION = 17,
+ ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_SUBJECT_INTERPRETATION = 18,
+ ZEITGEIST_RESULT_TYPE_MOST_RECENT_MIMETYPE = 19,
+ ZEITGEIST_RESULT_TYPE_LEAST_RECENT_MIMETYPE = 20,
+ ZEITGEIST_RESULT_TYPE_MOST_POPULAR_MIMETYPE = 21,
+ ZEITGEIST_RESULT_TYPE_LEAST_POPULAR_MIMETYPE = 22,
+ ZEITGEIST_RESULT_TYPE_RELEVANCY = 100,
+} ZeitgeistResultType;
+
+/**
+ * ZeitgeistStorageState:
+ * @ZEITGEIST_STORAGE_STATE_NOT_AVAILABLE: The subject is not available right now
+ * @ZEITGEIST_STORAGE_STATE_AVAILABLE: The subject is available
+ * @ZEITGEIST_STORAGE_STATE_ANY: The availability of the subject is irrelevant
+ *
+ * Used to restrict queries to only available subjects.
+ * See zeitgeist_log_find_events() and zeitgeist_log_find_event_ids().
+ */
+typedef enum
+{
+ ZEITGEIST_STORAGE_STATE_NOT_AVAILABLE = 0,
+ ZEITGEIST_STORAGE_STATE_AVAILABLE = 1,
+ ZEITGEIST_STORAGE_STATE_ANY = 2,
+} ZeitgeistStorageState;
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_ENUMS_H_ */
=== added file 'src/zeitgeist-enumtypes.c.template'
--- src/zeitgeist-enumtypes.c.template 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-enumtypes.c.template 2012-02-02 12:33:19 +0000
@@ -0,0 +1,36 @@
+/*** BEGIN file-header ***/
+#include "zeitgeist-enums.h"
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+
+ if (g_once_init_enter (&g_define_type_id__volatile))
+ {
+ static const G@Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id =
+ g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+
+ return g_define_type_id__volatile;
+}
+
+/*** END value-tail ***/
\ No newline at end of file
=== added file 'src/zeitgeist-enumtypes.h.template'
--- src/zeitgeist-enumtypes.h.template 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-enumtypes.h.template 2012-02-02 12:33:19 +0000
@@ -0,0 +1,28 @@
+/*** BEGIN file-header ***/
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_ENUM_TYPES_H_
+#define _ZEITGEIST_ENUM_TYPES_H_
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* _ZEITGEIST_ENUM_TYPES_H_ */
+/*** END file-tail ***/
\ No newline at end of file
=== added file 'src/zeitgeist-event.c'
--- src/zeitgeist-event.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-event.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1008 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ * Jason Smith <jason.smith@xxxxxxxxxxxxx>
+ */
+
+/**
+ * SECTION:zeitgeist-event
+ * @short_description: #ZetigeistEvent objects abstract events returned from Zeitgeist queries
+ * @include: zeitgeist.h
+ *
+ * The #ZeitgeistEvent class is one of the primary elements for communicating
+ * with the Zeitgeist daemon. #ZeitgeistEvent<!-- -->s serve two purposes.
+ * Unsurprisingly they represent events that have happened, but they also
+ * can act as <emphasis>templates</emphasis>. See also #ZeitgeistSubject.
+ *
+ * An event in the Zeitgeist world is characterized by two main properties.
+ * "What happened" also called the <emphasis>interpretation</emphasis>,
+ * and "How did it happen" also called the
+ * <emphasis>manifestation</emphasis>. Besides these properties and event
+ * also has an <emphasis>actor</emphasis> which identifies the party responsible
+ * for triggering the event which in most cases will be an application.
+ * Lastly there is an event <emphasis>timestamp</emphasis> and
+ * <emphasis>event id</emphasis>. The timestamp is calculated as the number
+ * of milliseconds since the Unix epoch and the event id is a serial number
+ * assigned to the event by the Zeitgeist engine when it's logged. These
+ * five properties are collectively known as the
+ * <emphasis>event metadata</emphasis>.
+ *
+ * An event must also describe what it happened to. This is called the event
+ * <emphasis>subjects</emphasis>. Most events have one subject, but they are
+ * allowed to have zero or many too. The metadata of the subjects are
+ * recorded at the time of logging, and are encapsulated by the
+ * #ZeitgeistSubject class. It's important to understand that it's just the
+ * subject metadata at the time of logging, not necessarily the subject metadata
+ * as it exists right now.
+ *
+ * In addition to the listed properties events may also carry a free form binary
+ * <emphasis>payload</emphasis>. The usage of this is is application specific
+ * and is generally useless unless you have some contextual information to
+ * figure out what's in it.
+ *
+ * A large part of the Zeitgeist query and monitoring API revolves around a
+ * concept of template matching. A query is simply a list of event templates
+ * that you want to look for in the log.
+ * An unset property on an event template indicates that anything is allowed
+ * in that field. If the property is set it indicates that the property
+ * must be an exact match.
+ */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gio/gdesktopappinfo.h>
+
+#include "zeitgeist-event.h"
+
+G_DEFINE_TYPE (ZeitgeistEvent, zeitgeist_event, G_TYPE_INITIALLY_UNOWNED);
+#define ZEITGEIST_EVENT_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_EVENT, ZeitgeistEventPrivate))
+
+typedef enum
+{
+ ZEITGEIST_EVENT_ID,
+ ZEITGEIST_EVENT_TIMESTAMP,
+ ZEITGEIST_EVENT_INTERPRETATION,
+ ZEITGEIST_EVENT_MANIFESTATION,
+ ZEITGEIST_EVENT_ACTOR,
+ ZEITGEIST_EVENT_ORIGIN,
+} ZeitgeistEventDataOffset;
+
+typedef struct
+{
+ guint32 id;
+ gint64 timestamp;
+ gchar *interpretation;
+ gchar *manifestation;
+ gchar *actor;
+ gchar *origin;
+ GPtrArray *subjects;
+ GByteArray *payload;
+} ZeitgeistEventPrivate;
+
+/**
+ * zeitgeist_event_get_id:
+ * @event: The event to get the event id for
+ *
+ * Get the event id as assigned by the Zeitgeist engine.
+ *
+ * Returns: The event id or 0 if it's unset. An event retrieved from the
+ * Zeitgeist engine will always have an event id.
+ */
+guint32
+zeitgeist_event_get_id (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), 0);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->id;
+}
+
+/**
+ * zeitgeist_event_set_id:
+ * @event: The event to get the event id for
+ * @event_id: The event id to assign to @event
+ *
+ * Set the event id of an event. Note that it is an error to send an event
+ * with a pre set event id to zeitgest_log_insert_events().
+ */
+void
+zeitgeist_event_set_id (ZeitgeistEvent *event, guint32 id)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ priv->id = id;
+}
+
+/**
+ * zeitgeist_event_get_timestamp:
+ * @event: The event to get the timestamp for
+ *
+ * Get the event timestamp. The timestamp is in milliseconds since the
+ * Unix epoch. There are a few helpers available for converting to and
+ * from other time representations such a #GTimeVal. See for example
+ * zeitgeist_timestamp_to_timeval() and zeitgeist_timestamp_from_timeval().
+ *
+ * Returns: The event timestamp. Note that 0 is ambiguous as it denotes both
+ * an unset timestamp and the time of the Unix Epoch.
+ */
+gint64
+zeitgeist_event_get_timestamp (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), 0);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->timestamp;
+}
+
+/**
+ * zeitgeist_event_set_timestamp:
+ * @event: The event to set the timestamp for
+ *
+ * Set the event timestamp. The timestamp is in milliseconds since the
+ * Unix epoch. There are a few helpers available for converting to and
+ * from other time representations such a #GTimeVal. See for example
+ * zeitgeist_timestamp_to_timeval() and zeitgeist_timestamp_from_timeval().
+ *
+ * Note that the if you insert events into the Zeitgeist log without a
+ * timestamp set the Zeiteist daemon will automatically assign the timestamp
+ * of the logging time to the event.
+ */
+void
+zeitgeist_event_set_timestamp (ZeitgeistEvent *event, gint64 timestamp)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ priv->timestamp = timestamp;
+}
+
+/**
+ * zeitgeist_event_get_interpretation:
+ * @event: The event to get the interpretation of
+ *
+ * The event interpretation represents "what happened". It is encoded
+ * as URI defined by the Zeitgeist Event Ontology.
+ * Examples could be "something was opened" or
+ * "something was modified".
+ *
+ * FIXME: Needs link to ontology and some defines to help coding
+ *
+ * Returns: The event interpretation as a URI or %NULL if unset
+ */
+const gchar*
+zeitgeist_event_get_interpretation (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->interpretation;
+}
+
+/**
+ * zeitgeist_event_set_interpretation:
+ * @event: The event to set the interpretation of
+ * @interpretation: URI designating the interpretation type of the event
+ *
+ * The event interpretation represents "what happened". It is encoded
+ * as URI defined by the Zeitgeist Event Ontology.
+ *
+ * FIXME: Needs link to ontology and some defines to help coding
+ */
+void
+zeitgeist_event_set_interpretation (ZeitgeistEvent *event,
+ const gchar *interpretation)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ gchar* copy = g_strdup (interpretation);
+
+ if (priv->interpretation)
+ {
+ g_free (priv->interpretation);
+ }
+
+ priv->interpretation = copy;
+}
+
+/**
+ * zeitgeist_event_get_manifestation:
+ * @event: The event to get the manifestation of
+ *
+ * The event manifestation represents "how did it happen".
+ * It is encoded as URI defined by the Zeitgeist Event Ontology. Examples
+ * could be "the user did it" or
+ * "the system send a notification".
+ *
+ * FIXME: Needs link to ontology and some defines to help coding
+ *
+ * Returns: The event interpretation as a URI or %NULL if unset
+ */
+const gchar*
+zeitgeist_event_get_manifestation (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->manifestation;
+}
+
+/**
+ * zeitgeist_event_set_manifestation:
+ * @event: The event to set the manifestation of
+ * @interpretation: URI designating the manifestation type of the event
+ *
+ * The event manifestation represents "how did it happen".
+ * It is encoded as URI defined by the Zeitgeist Event Ontology.
+ *
+ * FIXME: Needs link to ontology and some defines to help coding
+ */
+void
+zeitgeist_event_set_manifestation (ZeitgeistEvent *event,
+ const gchar *manifestation)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ gchar* copy = g_strdup (manifestation);
+
+ if (priv->manifestation)
+ {
+ g_free (priv->manifestation);
+ }
+
+ priv->manifestation = copy;
+}
+
+/**
+ * zeitgeist_event_get_actor:
+ * @event: The event to set the actor for
+ *
+ * Get the event actor. The actor represents the party responsible for
+ * triggering the event. When the actor is an application
+ * (which it almost always is) the actor is encoded in the
+ * <emphasis>application://</emphasis> URI scheme with the base name of the .desktop
+ * file for the application appended. Eg. <emphasis>application://firefox.desktop</emphasis>
+ *
+ * Returns: A URI designating the actor of the event
+ */
+const gchar*
+zeitgeist_event_get_actor (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->actor;
+}
+
+/**
+ * zeitgeist_event_set_actor:
+ * @event: The event to set the actor for
+ * @actor: URI designating the actor triggering the event.
+ * Fx. <emphasis>application://firefox.desktop</emphasis>
+ *
+ * Get the event actor. The actor represents the party responsible for
+ * triggering the event. When the actor is an application
+ * (which it almost always is) the actor is encoded in the
+ * <emphasis>application://</emphasis> URI scheme with the base name of the .desktop
+ * file for the application appended. Eg. <emphasis>application://firefox.desktop</emphasis>
+ */
+void
+zeitgeist_event_set_actor (ZeitgeistEvent *event,
+ const gchar *actor)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ gchar* copy = g_strdup (actor);
+
+ if (priv->actor)
+ {
+ g_free (priv->actor);
+ }
+
+ priv->actor = copy;
+}
+
+void
+zeitgeist_event_set_actor_from_app_info (ZeitgeistEvent *event,
+ GAppInfo *appinfo)
+{
+ const gchar *app_id;
+ gchar *copy;
+
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+ g_return_if_fail (G_IS_APP_INFO (appinfo));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ copy = NULL;
+ app_id = g_app_info_get_id (appinfo);
+
+ if (app_id != NULL)
+ {
+ copy = g_strconcat ("application://", app_id, NULL);
+ }
+ else if (G_IS_DESKTOP_APP_INFO (appinfo) &&
+ g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (appinfo)))
+ {
+ const gchar *path = g_desktop_app_info_get_filename (
+ G_DESKTOP_APP_INFO (appinfo));
+ gchar *_app_id = g_path_get_basename (path);
+ copy = g_strconcat ("application://", _app_id, NULL);
+ g_free (_app_id);
+ }
+ else
+ {
+ /* Sometimes the name is set, but not the id... So try that */
+ app_id = g_app_info_get_name (appinfo);
+ if (app_id != NULL)
+ {
+ copy = g_strconcat ("application://", app_id, ".desktop", NULL);
+ }
+ }
+
+ if (priv->actor)
+ {
+ g_free (priv->actor);
+ }
+ priv->actor = copy;
+}
+
+/**
+ * zeitgeist_event_get_subject:
+ * @event: The event to get a subject for
+ * @index: The 0-based offset of the subject
+ *
+ * Get the n'th subject of this event. You can find the number of subjects
+ * by calling zeitgeist_event_num_subjects().
+ *
+ * Returns: The subject at position @index. Do not free. If you want to
+ * keep the subject around you need to g_object_ref() it.
+ */
+ZeitgeistSubject*
+zeitgeist_event_get_subject (ZeitgeistEvent *event,
+ gint index)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate *priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ g_return_val_if_fail (index < priv->subjects->len, NULL);
+ return ZEITGEIST_SUBJECT (g_ptr_array_index (priv->subjects, index));
+}
+
+/**
+ * zeitgeist_event_num_subjects:
+ * @event: The event to get the number of subjects for
+ *
+ * Get the number of subjects for an event. This is a constant time operation.
+ *
+ * Returns: The number of subjects for this event.
+ */
+gint
+zeitgeist_event_num_subjects (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), 0);
+
+ ZeitgeistEventPrivate *priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+ return priv->subjects->len;
+}
+
+/**
+ * zeitgeist_event_add_subject:
+ * @event: The event to add a subject to
+ * @subject: The subject to add
+ *
+ * Append a #ZeitgeistSubject to the list of subjects for @event. The
+ * event will consume the floating reference on @subject when you call this
+ * method.
+ */
+void
+zeitgeist_event_add_subject (ZeitgeistEvent *event,
+ ZeitgeistSubject *subject)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ g_ptr_array_add (priv->subjects, subject);
+ g_object_ref_sink (subject);
+}
+
+/**
+ * zeitgeist_event_get_origin:
+ * @event: The event to get the origin from
+ *
+ * Get the origin of an event.
+ * This differs from a subject's origin, as it describes where the event comes
+ * from, not where it resides.
+ *
+ * Returns: The origin of @event.
+ */
+const gchar*
+zeitgeist_event_get_origin (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ return priv->origin;
+}
+
+/**
+ * zeitgeist_event_set_origin:
+ * @event: The event to set the origin of
+ * @origin: The origin to set
+ *
+ * Set the origin of an event.
+ * This differs from a subject's origin, as it describes where the event comes
+ * from, not where it resides.
+ */
+void
+zeitgeist_event_set_origin (ZeitgeistEvent *event,
+ const gchar *origin)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ gchar* copy = g_strdup (origin);
+
+ if (priv->origin)
+ {
+ g_free (priv->origin);
+ }
+
+ priv->origin = copy;
+}
+
+/**
+ * zeitgeist_event_get_payload:
+ * @event: The event to get the payload for
+ *
+ * Look up the free form binary payload of @event.
+ *
+ * Returns: The event payload or %NULL if unset. Do not free. If you want to
+ * keep the subject around you need to g_byte_array_ref() it.
+ */
+GByteArray*
+zeitgeist_event_get_payload (ZeitgeistEvent *event)
+{
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ return priv->payload;
+}
+
+/**
+ * zeitgeist_event_set_payload:
+ * @event: Event to add the payload to
+ * @payload: (transfer-full): The payload to add to @event
+ *
+ * Attach a a free form binary payload to @event. Payloads are application
+ * specific and can not be assumed to have any particular format unless
+ * you have other contextual information about the event.
+ *
+ * The event will assume ownership of @payload. You should never call
+ * g_byte_array_free() on @payload and only call g_byte_array_unref() on it if
+ * you have added an extra reference to it.
+ */
+void
+zeitgeist_event_set_payload (ZeitgeistEvent *event,
+ GByteArray *payload)
+{
+ g_return_if_fail (ZEITGEIST_IS_EVENT (event));
+
+ ZeitgeistEventPrivate* priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ if (priv->payload)
+ {
+ g_byte_array_unref (priv->payload);
+ }
+
+ priv->payload = payload;
+}
+
+static void
+zeitgeist_event_init (ZeitgeistEvent *object)
+{
+ ZeitgeistEventPrivate *priv;
+
+ priv = ZEITGEIST_EVENT_GET_PRIVATE (object);
+
+ priv->id = 0;
+ priv->timestamp = 0;
+ priv->interpretation = NULL;
+ priv->manifestation = NULL;
+ priv->actor = NULL;
+ priv->origin = NULL;
+ priv->subjects = g_ptr_array_new_with_free_func (
+ (GDestroyNotify)g_object_unref);
+ priv->payload = NULL;
+}
+
+static void
+zeitgeist_event_finalize (GObject *object)
+{
+ ZeitgeistEvent *event = ZEITGEIST_EVENT (object);
+ ZeitgeistEventPrivate *priv;
+
+ priv = ZEITGEIST_EVENT_GET_PRIVATE (event);
+
+ if (priv->subjects)
+ {
+ /* Subjects are unreffed by the free-func of the GPtrArray */
+ g_ptr_array_unref (priv->subjects);
+ priv->subjects = NULL;
+ }
+
+ zeitgeist_event_set_interpretation (event, NULL);
+ zeitgeist_event_set_manifestation (event, NULL);
+ zeitgeist_event_set_actor (event, NULL);
+ zeitgeist_event_set_origin (event, NULL);
+ zeitgeist_event_set_payload (event, NULL);
+
+ G_OBJECT_CLASS (zeitgeist_event_parent_class)->finalize (object);
+
+}
+
+static void
+zeitgeist_event_class_init (ZeitgeistEventClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = zeitgeist_event_finalize;
+
+ g_type_class_add_private (object_class, sizeof (ZeitgeistEventPrivate));
+}
+
+/**
+ * zeitgeist_event_new:
+ *
+ * Create a new empty event structure
+ *
+ * Returns: A newly create #ZeitgeistEvent instance. The returned event will
+ * have a floating reference which will be consumed if you pass the
+ * event to any of the methods provided by this library. If you
+ * do not do that then you must free the event youself with
+ * g_object_unref()
+ */
+ZeitgeistEvent*
+zeitgeist_event_new (void)
+{
+ ZeitgeistEvent *self;
+
+ self = g_object_new (ZEITGEIST_TYPE_EVENT, NULL);
+ return self;
+}
+
+// FIXME: add `origin' parameter
+/**
+ * zeitgeist_event_new_full:
+ * @interpretation: The interpretation type of the event.
+ * See #ZEITGEIST_ZG_EVENT_INTERPRETATION for a list of
+ * event interpretation types
+ * @manifestation: The manifestation type of the event.
+ * See #ZEITGEIST_ZG_EVENT_MANIFESTATION for a list of
+ * event manifestation types
+ * @actor: The actor triggering the event. See zeitgeist_event_set_actor()
+ * for details on how to encode this.
+ * @VarArgs: A list of #ZeitgeistSubject instances terminated by a %NULL
+ *
+ * Create a new event structure with predefined data
+ *
+ * Returns: A newly create #ZeitgeistEvent instance. The returned event will
+ * have a floating reference which will be consumed if you pass the
+ * event to any of the methods provided by this library. If you
+ * do not do that then you must free the event yourself with
+ * g_object_unref()
+ */
+ZeitgeistEvent*
+zeitgeist_event_new_full (const gchar *interpretation,
+ const gchar *manifestation,
+ const gchar *actor,
+ ...)
+{
+ va_list args;
+ ZeitgeistEvent *self;
+
+ va_start (args, actor);
+ self = zeitgeist_event_new_full_valist (interpretation, manifestation,
+ actor, args);
+ va_end (args);
+
+ return self;
+}
+
+/**
+ * zeitgeist_event_new_full_valist:
+ * interpretation: The interpretation type of the event.
+ * See #ZEITGEIST_ZG_EVENT_INTERPRETATION for a list of
+ * event interpretation types
+ * @manifestation: The manifestation type of the event.
+ * See #ZEITGEIST_ZG_EVENT_MANIFESTATION for a list of
+ * event manifestation types
+ * @actor: The actor triggering the event. See zeitgeist_event_set_actor()
+ * for details on how to encode this.
+ * @args: A %va_list of #ZeitgeistSubject<!-- -->s terminated by %NULL
+ *
+ * As zeitgeist_event_new_full() but intended for language bindings
+ */
+ZeitgeistEvent*
+zeitgeist_event_new_full_valist (const gchar *interpretation,
+ const gchar *manifestation,
+ const gchar *actor,
+ va_list args)
+{
+ ZeitgeistEvent *self;
+ ZeitgeistSubject *subject = NULL;
+
+ self = g_object_new (ZEITGEIST_TYPE_EVENT, NULL);
+ zeitgeist_event_set_interpretation (self, interpretation);
+ zeitgeist_event_set_manifestation (self, manifestation);
+ zeitgeist_event_set_actor (self, actor);
+
+ subject = va_arg (args, ZeitgeistSubject*);
+ while (subject != NULL)
+ {
+ g_return_val_if_fail (ZEITGEIST_IS_SUBJECT (subject), NULL);
+ zeitgeist_event_add_subject (self, subject);
+ subject = va_arg (args, ZeitgeistSubject*);
+ }
+
+
+ return self;
+}
+
+/**
+ * zeitgeist_event_new_from_variant:
+ * @event: A #GVariant with signature defined in
+ * #ZEITGEIST_EVENT_VARIANT_SIGNATURE. If @event is a floating
+ * reference the floating reference will be consumed.
+ *
+ * Parse the data in a #GVariant and build a #ZeitgeistEvent from it.
+ * The reverse operation of this is zeitgeist_event_to_variant().
+ *
+ * Returns: A newly allocated #ZeitgeistEvent filled with the metadata,
+ * subjects, and payload described by @event. The returned event will
+ * have a floating reference which will be consumed if you pass the
+ * event to any of the methods provided by this library. If you
+ * do not do that then you must free the event yourself with
+ * g_object_unref()
+ */
+ZeitgeistEvent*
+zeitgeist_event_new_from_variant (GVariant *event)
+{
+ ZeitgeistEvent *result;
+ ZeitgeistSubject *subject;
+ GVariantIter *event_data, *subjects, *payload_data, *subject_data;
+ gchar *str;
+ GByteArray *payload;
+ gint payload_size;
+ guchar payload_byte;
+
+ g_return_val_if_fail (event != NULL, NULL);
+
+ g_variant_ref_sink (event);
+
+ result = zeitgeist_event_new ();
+ g_variant_get (event, ZEITGEIST_EVENT_VARIANT_SIGNATURE,
+ &event_data, &subjects, &payload_data);
+
+ /* Parse event data */
+ if (g_variant_iter_n_children (event_data) < 5)
+ {
+ g_critical ("Event data truncated at length %lu",
+ g_variant_iter_n_children (event_data));
+ goto cleanup;
+ }
+
+ // FIXME: Use g_variant_get_string() to cause less reallocations
+ g_variant_iter_next (event_data, "s", &str);
+ zeitgeist_event_set_id (result, g_ascii_strtoull (str, NULL, 0));
+ g_free (str);
+
+ g_variant_iter_next (event_data, "s", &str);
+ zeitgeist_event_set_timestamp (result, g_ascii_strtoll (str, NULL, 0));
+ g_free (str);
+
+ g_variant_iter_next (event_data, "s", &str);
+ zeitgeist_event_set_interpretation (result, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (event_data, "s", &str);
+ zeitgeist_event_set_manifestation (result, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (event_data, "s", &str);
+ zeitgeist_event_set_actor (result, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ if (g_variant_iter_loop (event_data, "s", &str))
+ zeitgeist_event_set_origin (result, str[0] == '\0' ? NULL : str);
+
+ /* Build the list of subjects */
+ while (g_variant_iter_loop (subjects, "as", &subject_data))
+ {
+ /* Parse subject data */
+ if (g_variant_iter_n_children (subject_data) < 7)
+ {
+ g_critical ("Subject data truncated at length %lu",
+ g_variant_iter_n_children (subject_data));
+ goto cleanup;
+ }
+
+ subject = g_object_new (ZEITGEIST_TYPE_SUBJECT, NULL);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_uri (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_interpretation (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_manifestation (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_origin (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_mimetype (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_text (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ g_variant_iter_next (subject_data, "s", &str);
+ zeitgeist_subject_set_storage (subject, str[0] == '\0' ? NULL : str);
+ g_free (str);
+
+ if (g_variant_iter_loop (subject_data, "s", &str))
+ zeitgeist_subject_set_current_uri (subject, str[0] == '\0' ? NULL : str);
+
+ zeitgeist_event_add_subject (result, subject);
+ }
+
+ /* Construct the event payload if necessary */
+ payload_size = g_variant_iter_n_children (payload_data);
+ if (payload_size > 0)
+ {
+ payload = g_byte_array_sized_new (payload_size);
+ while (g_variant_iter_next (payload_data, "y", &payload_byte))
+ {
+ // FIXME: Implicit guchar <-> uint8 conversion..?
+ g_byte_array_append (payload, &payload_byte, 1);
+ }
+ zeitgeist_event_set_payload (result, payload);
+ }
+
+ cleanup:
+ g_variant_iter_free (event_data);
+ g_variant_iter_free (subjects);
+ g_variant_iter_free (payload_data);
+ g_variant_unref (event);
+
+ return result;
+}
+
+/**
+ * zeitgeist_event_to_variant:
+ * @event: The #ZeitgeistEvent to serialize to a #GVariant
+ *
+ * Serialize a #ZeitgeistEvent to a #GVariant. The reverse operation
+ * is zeitgeist_event_new_from_variant().
+ *
+ * Returns: A floating reference to a #GVariant with signature
+ * #ZEITGEIST_EVENT_VARIANT_SIGNATURE
+ */
+GVariant*
+zeitgeist_event_to_variant (ZeitgeistEvent *event)
+{
+ GVariant *var;
+ GVariantBuilder b;
+ gchar *buf;
+ const gchar *bif;
+ int i, n_subjects;
+ ZeitgeistSubject *su;
+ GByteArray *payload;
+
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+
+ g_variant_builder_init (&b, ZEITGEIST_EVENT_VARIANT_TYPE);
+
+ /* Build event data */
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("as"));
+ if (zeitgeist_event_get_id (event) == 0)
+ buf = g_strdup ("");
+ else
+ buf = g_strdup_printf ("%"G_GUINT32_FORMAT, zeitgeist_event_get_id (event));
+ g_variant_builder_add (&b, "s", buf);
+ g_free (buf);
+ if (zeitgeist_event_get_timestamp (event) == 0)
+ buf = g_strdup ("");
+ else
+ buf = g_strdup_printf ("%"G_GINT64_FORMAT, zeitgeist_event_get_timestamp (event));
+ g_variant_builder_add (&b, "s", buf);
+ g_free (buf);
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_event_get_interpretation(event), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_event_get_manifestation(event), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_event_get_actor (event), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_event_get_origin (event), bif ? bif : ""));
+ g_variant_builder_close (&b);
+
+ /* Build subjects */
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("aas"));
+ n_subjects = zeitgeist_event_num_subjects(event);
+ for (i = 0; i < n_subjects; i++)
+ {
+ su = zeitgeist_event_get_subject (event, i);
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("as"));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_uri(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_interpretation(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_manifestation(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_origin(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_mimetype(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_text(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_storage(su), bif ? bif : ""));
+ g_variant_builder_add (&b, "s", (bif = zeitgeist_subject_get_current_uri(su), bif ? bif : ""));
+ g_variant_builder_close (&b);
+ }
+ g_variant_builder_close (&b);
+
+ /* Build payload */
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("ay"));
+ payload = zeitgeist_event_get_payload (event);
+ if (payload != NULL)
+ {
+ for (i = 0; i < payload->len; i++)
+ {
+ g_variant_builder_add (&b, "y", payload->data[i]);
+ }
+ }
+ g_variant_builder_close (&b);
+
+ return g_variant_builder_end (&b);
+}
+
+/**
+ * zeitgeist_events_to_variant:
+ * @events: A #GPtrArray of #ZeitgeistEvent<!-- -->s. If the events has
+ * floating references they will be consumed. Furthermore the
+ * reference on the #GPtrArray itself will also be stolen and its
+ * @free_func set to %NULL
+ *
+ * Convert a set of #ZeitgeistEvent<-- -->s to a #GVariant with signature
+ * as an array of #ZEITGEIST_EVENT_VARIANT_SIGNATURE.
+ *
+ * Returns: A floating reference to a #GVariant as described above. Unless the
+ * floating reference is consumed somewhere you must free it with
+ * g_variant_unref().
+ */
+GVariant*
+zeitgeist_events_to_variant (GPtrArray *events)
+{
+ GVariantBuilder b;
+ ZeitgeistEvent *event;
+ GVariant *vevent;
+ int i;
+
+ g_return_val_if_fail (events != NULL, NULL);
+
+ g_variant_builder_init (&b,
+ G_VARIANT_TYPE ("a"ZEITGEIST_EVENT_VARIANT_SIGNATURE));
+
+ for (i = 0; i < events->len; i++)
+ {
+ event = ZEITGEIST_EVENT (g_ptr_array_index (events, i));
+ g_object_ref_sink (event);
+ vevent = zeitgeist_event_to_variant (event);
+ g_variant_builder_add_value (&b, vevent);
+ g_object_unref (event);
+ }
+
+ /* We need to unset the free func because we can't risk double unreffing
+ * the events held in it, quite ugly but there is no other way */
+ g_ptr_array_set_free_func (events, NULL);
+ g_ptr_array_unref (events);
+
+ return g_variant_builder_end (&b);
+}
+
+/**
+ * zeitgeist_events_from_variant:
+ * @events: A #GVariant with signature as an array of
+ * #ZEITGEIST_EVENT_VARIANT_SIGNATURE. If @event is floating this
+ * method will consume the floating reference.
+ *
+ * Returns: A reference to a #GPtrArray of #ZeitgeistEvent<!-- -->s.
+ * All the events will be floating references, and the
+ * #GPtrArray<!-- -->'s @free_func will be set to g_object_unref().
+ */
+GPtrArray*
+zeitgeist_events_from_variant (GVariant *events)
+{
+ GPtrArray *result;
+ GVariant *vevent;
+ ZeitgeistEvent *event;
+ int i, n_events;
+
+ g_return_val_if_fail (events != NULL, NULL);
+
+ g_variant_ref_sink (events);
+
+ n_events = g_variant_n_children (events);
+ result = g_ptr_array_sized_new (n_events);
+ g_ptr_array_set_free_func (result, (GDestroyNotify) g_object_unref);
+
+ for (i = 0; i < n_events; i++)
+ {
+ vevent = g_variant_get_child_value (events, i);
+ event = zeitgeist_event_new_from_variant (vevent);
+ g_variant_unref (vevent);
+ g_ptr_array_add (result, event);
+ }
+
+ g_variant_unref (events);
+
+ return result;
+}
+
+/**
+ * zeitgeist_events_from_valist:
+ * @events: a #va_list of #ZeitgeistEvent<!-- -->s.
+ *
+ * Utility function to convert a #va_list of #ZeitgeistEvent<!-- --> into a
+ * #GPtrArray containing these events.
+ *
+ * Returns: A #GPtrArray of #ZeitgeistEvent<!-- -->s. The events are not further
+ * reffed and will still be floating if they where so when you called
+ * this method. The pointer array will have its @free_func set to
+ * g_object_unref()
+ */
+GPtrArray*
+zeitgeist_events_from_valist (va_list events)
+{
+ ZeitgeistEvent *event = NULL;
+ GPtrArray *result;
+
+ result = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+
+ event = va_arg (events, ZeitgeistEvent*);
+ while (event != NULL)
+ {
+ g_return_val_if_fail (ZEITGEIST_IS_EVENT (event), NULL);
+ g_ptr_array_add (result, event);
+ event = va_arg (events, ZeitgeistEvent*);
+ }
+
+ return result;
+}
=== added file 'src/zeitgeist-event.h'
--- src/zeitgeist-event.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-event.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_EVENT_H_
+#define _ZEITGEIST_EVENT_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <zeitgeist-subject.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_EVENT (zeitgeist_event_get_type ())
+
+#define ZEITGEIST_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ ZEITGEIST_TYPE_EVENT, ZeitgeistEvent))
+
+#define ZEITGEIST_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ ZEITGEIST_TYPE_EVENT, ZeitgeistEventClass))
+
+#define ZEITGEIST_IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ ZEITGEIST_TYPE_EVENT))
+
+#define ZEITGEIST_IS_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ ZEITGEIST_TYPE_EVENT))
+
+#define ZEITGEIST_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ ZEITGEIST_TYPE_EVENT, ZeitgeistEventClass))
+
+typedef struct _ZeitgeistEvent ZeitgeistEvent;
+typedef struct _ZeitgeistEventClass ZeitgeistEventClass;
+
+struct _ZeitgeistEventClass
+{
+ GInitiallyUnownedClass parent_class;
+};
+
+
+struct _ZeitgeistEvent
+{
+ GInitiallyUnowned parent_instance;
+};
+
+GType zeitgeist_event_get_type (void);
+
+ZeitgeistEvent* zeitgeist_event_new (void);
+
+ZeitgeistEvent* zeitgeist_event_new_full (const gchar *interpretation,
+ const gchar *manifestation,
+ const gchar *actor,
+ ...) G_GNUC_NULL_TERMINATED;
+
+ZeitgeistEvent* zeitgeist_event_new_full_valist (const gchar *interpretation,
+ const gchar *manifestation,
+ const gchar *actor,
+ va_list args);
+
+ZeitgeistEvent* zeitgeist_event_new_from_variant (GVariant *event);
+
+guint32 zeitgeist_event_get_id (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_id (ZeitgeistEvent *event,
+ guint32 id);
+
+gint64 zeitgeist_event_get_timestamp (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_timestamp (ZeitgeistEvent *event,
+ gint64 timestamp);
+
+const gchar* zeitgeist_event_get_interpretation (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_interpretation (ZeitgeistEvent *event,
+ const gchar *interpretation);
+
+const gchar* zeitgeist_event_get_manifestation (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_manifestation (ZeitgeistEvent *event,
+ const gchar *manifestation);
+
+const gchar* zeitgeist_event_get_actor (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_actor (ZeitgeistEvent *event,
+ const gchar *actor);
+
+const gchar* zeitgeist_event_get_origin (ZeitgeistEvent *event);
+void zeitgeist_event_set_origin (ZeitgeistEvent *event,
+ const gchar *origin);
+
+void zeitgeist_event_set_actor_from_app_info (ZeitgeistEvent *event,
+ GAppInfo *appinfo);
+
+ZeitgeistSubject*
+ zeitgeist_event_get_subject (ZeitgeistEvent *event,
+ gint index);
+
+gint zeitgeist_event_num_subjects (ZeitgeistEvent *event);
+
+void zeitgeist_event_add_subject (ZeitgeistEvent *event,
+ ZeitgeistSubject *subject);
+
+GByteArray* zeitgeist_event_get_payload (ZeitgeistEvent *event);
+
+void zeitgeist_event_set_payload (ZeitgeistEvent *event,
+ GByteArray *payload);
+
+GVariant* zeitgeist_event_to_variant (ZeitgeistEvent *event);
+
+GVariant* zeitgeist_events_to_variant (GPtrArray *events);
+
+GPtrArray* zeitgeist_events_from_variant (GVariant *events);
+
+GPtrArray* zeitgeist_events_from_valist (va_list events);
+
+/**
+ * ZEITGEIST_EVENT_VARIANT_SIGNATURE:
+ *
+ * The #GVariant signature for a serialized #ZeitgeistEvent
+ */
+#define ZEITGEIST_EVENT_VARIANT_SIGNATURE "(asaasay)"
+
+/**
+ * ZEITGEIST_EVENT_VARIANT_TYPE:
+ *
+ * The #GVariantType of #ZEITGEIST_EVENT_SIGNATURE
+ */
+#define ZEITGEIST_EVENT_VARIANT_TYPE G_VARIANT_TYPE(ZEITGEIST_EVENT_VARIANT_SIGNATURE)
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_EVENT_H_ */
=== added file 'src/zeitgeist-index.c'
--- src/zeitgeist-index.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-index.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,424 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-index.h"
+#include "zeitgeist-simple-result-set.h"
+
+/**
+ * SECTION:zeitgeist-index
+ * @short_description: Query the Zeitgeist Full Text Search Extension
+ * @include: zeitgeist.h
+ *
+ *
+ */
+
+G_DEFINE_TYPE (ZeitgeistIndex, zeitgeist_index, G_TYPE_OBJECT);
+#define ZEITGEIST_INDEX_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_INDEX, ZeitgeistIndexPrivate))
+
+typedef struct
+{
+ /* The connection to the ZG daemon.
+ * If index != NULL it means we have a connection */
+ GDBusProxy *index;
+
+ /* Method calls queued up while waiting for a proxy */
+ GSList *method_dispatch_queue;
+
+} ZeitgeistIndexPrivate;
+
+typedef struct
+{
+ ZeitgeistIndex *self;
+ const gchar *method_name;
+ GVariant *params;
+ GCancellable *cancellable;
+ GAsyncReadyCallback cb;
+ gpointer user_data;
+} MethodDispatchContext;
+
+/* Property ids */
+enum
+{
+ PROP_0,
+
+ LAST_PROPERTY
+};
+
+static void on_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void dispatch_method (MethodDispatchContext *ctx);
+
+static void dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void
+zeitgeist_index_init (ZeitgeistIndex *self)
+{
+ ZeitgeistIndexPrivate *priv;
+
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (self);
+
+ /* Set up the connection to the ZG daemon */
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "org.gnome.zeitgeist.Engine",
+ "/org/gnome/zeitgeist/index/activity",
+ "org.gnome.zeitgeist.Index",
+ NULL,
+ on_proxy_acquired,
+ g_object_ref (self));
+}
+
+static void
+zeitgeist_index_finalize (GObject *object)
+{
+ ZeitgeistIndex *index = ZEITGEIST_INDEX (object);
+ ZeitgeistIndexPrivate *priv;
+
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (index);
+
+ if (priv->index)
+ {
+ g_object_unref (priv->index);
+ }
+
+ if (priv->method_dispatch_queue != NULL)
+ {
+ g_critical ("Internal error in libzeitgeist: The method dispatch queue"
+ "should be empty on finalization of ZeitgeistIndex");
+ }
+
+ G_OBJECT_CLASS (zeitgeist_index_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_index_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistIndexPrivate *priv = ZEITGEIST_INDEX_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+zeitgeist_index_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistIndexPrivate *priv = ZEITGEIST_INDEX_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+
+static void
+zeitgeist_index_class_init (ZeitgeistIndexClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
+ object_class->finalize = zeitgeist_index_finalize;
+ object_class->get_property = zeitgeist_index_get_property;
+ object_class->set_property = zeitgeist_index_set_property;
+
+ g_type_class_add_private (object_class, sizeof (ZeitgeistIndexPrivate));
+}
+
+/* Send off the DBus method call, or queue it if we don't
+ * have a proxy at this point */
+static void
+dispatch_method (MethodDispatchContext *ctx)
+{
+ ZeitgeistIndexPrivate *priv;
+
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (ctx->self);
+
+ if (priv->index)
+ {
+ g_dbus_proxy_call (priv->index,
+ ctx->method_name,
+ ctx->params,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ ctx->cancellable,
+ dispatch_async_callback,
+ ctx);
+ }
+ else
+ priv->method_dispatch_queue = g_slist_prepend (priv->method_dispatch_queue,
+ ctx);
+}
+
+/* Used to marshal the async callbacks from GDBus into ones
+ * coming from this ZeitgeistIndex instance */
+static void
+dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GVariant *var;
+ MethodDispatchContext *ctx = (MethodDispatchContext*) user_data;
+
+ if (ctx->cb != NULL)
+ ctx->cb (G_OBJECT (ctx->self), res, ctx->user_data);
+ else
+ {
+ /* Caller ignores response - finish the call our selves */
+ var = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, NULL);
+ if (var != NULL)
+ g_variant_unref (var);
+ }
+
+ g_object_unref (ctx->self);
+ g_free (ctx);
+}
+
+/*
+ * API BELOW HERE
+ */
+
+/**
+ * zeitgeist_index_new:
+ * Create a new index that interfaces with the default event index of the Zeitgeist
+ * daemon.
+ *
+ * Create a new #ZeitgeistIndex instance. The index will start to connect to
+ * Zeitgeist asynchronously. You can however start calling methods on the
+ * returned instance immediately, any method calls issued before the connection
+ * has been established will simply be queued and executed once the connection
+ * is up.
+ *
+ * Returns: A reference to a newly allocated index. Free with g_object_unref().
+ */
+ZeitgeistIndex*
+zeitgeist_index_new (void)
+{
+ ZeitgeistIndex *index;
+
+ index = (ZeitgeistIndex*) g_object_new (ZEITGEIST_TYPE_INDEX, NULL);
+
+ return index;
+}
+
+/**
+ * zeitgeist_index_search:
+ * @self: The #ZeitgeistIndex you want to query
+ * @query: The search string to send to Zeitgeist
+ * @time_range: Restrict matched events to ones within this time range. If you
+ * are not interested in restricting the timerange pass
+ * zeitgeist_time_range_new_anytime() as Zeitgeist will detect this
+ * and optimize the query accordingly
+ * @event_templates: Restrict matches events to ones matching these
+ * templates
+ * @offset: Offset into the result set to read events from
+ * @num_events: Maximal number of events to retrieve
+ * @result_type: The #ZeitgeistResultType determining the sort order.
+ * You may pass #ZEITGEIST_RESULT_TYPE_RELEVANCY to this method
+ * to have the results ordered by relevancy calculated in relation
+ * to @query
+ * @cancellable: A #GCancellable used to cancel the call or %NULL
+ * @callback: A #GAsyncReadyCallback to invoke when the search results are ready
+ * @user_data: User data to pass back with @callback
+ *
+ * Perform a full text search possibly restricted to a #ZeitgeistTimeRange
+ * and/or set of event templates.
+ *
+ * The default boolean operator is %AND. Thus the query
+ * <emphasis>foo bar</emphasis> will be interpreted as
+ * <emphasis>foo AND bar</emphasis>. To exclude a term from the result
+ * set prepend it with a minus sign - eg <emphasis>foo -bar</emphasis>.
+ * Phrase queries can be done by double quoting the string
+ * <emphasis>"foo is a bar"</emphasis>. You can truncate terms by appending
+ * a *.
+ *
+ * There are a few keys you can prefix to a term or phrase to search within
+ * a specific set of metadata. They are used like
+ * <emphasis>key:value</emphasis>. The keys <emphasis>name</emphasis> and
+ * <emphasis>title</emphasis> search strictly within the text field of the
+ * event subjects. The key <emphasis>app</emphasis> searches within the
+ * application name or description that is found in the actor attribute of
+ * the events. Lastly you can use the <emphasis>site</emphasis> key to search
+ * within the domain name of the subject URIs.
+ *
+ * You can also control the results with the boolean operators
+ * <emphasis>AND</emphasis> and <emphasis>OR</emphasis> and you may
+ * use brackets, ( and ), to control the operator precedence.
+ */
+void
+zeitgeist_index_search (ZeitgeistIndex *self,
+ const gchar *query,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ guint32 offset,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistIndexPrivate *priv;
+ GVariant *vevents, *vtime_range, *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_INDEX (self));
+ g_return_if_fail (query != NULL);
+ g_return_if_fail (ZEITGEIST_IS_TIME_RANGE (time_range));
+ g_return_if_fail (event_templates != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (self);
+
+ /* Own all floating refs on the events, and frees the events array */
+ vevents = zeitgeist_events_to_variant (event_templates);
+
+ /* Owns floating ref on time_range */
+ vtime_range = zeitgeist_time_range_to_variant (time_range);
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(s(xx)a(asaasay)uuu)"));
+ g_variant_builder_add (&b, "s", query);
+ g_variant_builder_add_value (&b, vtime_range); // owns ref
+ g_variant_builder_add_value (&b, vevents); // owns ref
+ g_variant_builder_add (&b, "u", offset);
+ g_variant_builder_add (&b, "u", num_events);
+ g_variant_builder_add (&b, "u", result_type);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "Search";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+/**
+ * zeitgeist_index_search_finish:
+ * @self: The #ZeitgeistIndex to retrieve results from
+ * @res: The #GAsyncResult you received in the #GAsyncReadyCallback you passed
+ * to zeitgeist_index_search()
+ * @error: A place to store a #GError or %NULL in case you want to ignore errors
+ *
+ * Retrieve the result from an asynchronous query started with
+ * zeitgeist_index_search().
+ *
+ * The total hit count of the query will be avilable via the returned
+ * result set by calling zeitgeist_result_set_estimated_matches(). This will
+ * often be bigger than actual number of events held in the result set, which
+ * is limited by the @num_events paramter passed to zeitgeist_index_search().
+ *
+ * Returns: A newly allocated #ZeitgeistResultSet containing the
+ * #ZeitgeistEvent<!-- -->s matching the query. You must free the
+ * result set with g_object_unref(). The events held in the result set
+ * will automatically be unreffed when it is finalized.
+ */
+ZeitgeistResultSet*
+zeitgeist_index_search_finish (ZeitgeistIndex *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistIndexPrivate *priv;
+ GPtrArray *events;
+ guint32 num_hits;
+ GVariant *val, *vevents, *vnum_hits;
+
+ g_return_val_if_fail (ZEITGEIST_IS_INDEX (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->index, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ vevents = g_variant_get_child_value (val, 0);
+ vnum_hits = g_variant_get_child_value (val, 1);
+ events = zeitgeist_events_from_variant (vevents);
+ num_hits = g_variant_get_uint32 (vnum_hits);
+ g_variant_unref (val);
+ g_variant_unref (vevents);
+ g_variant_unref (vnum_hits);
+ return _zeitgeist_simple_result_set_new (events, num_hits);
+}
+
+static void
+on_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistIndex *self;
+ ZeitgeistIndexPrivate *priv;
+ GError *error;
+
+ self = ZEITGEIST_INDEX (user_data);
+ priv = ZEITGEIST_INDEX_GET_PRIVATE (self);
+
+ error = NULL;
+ priv->index = g_dbus_proxy_new_finish (res, &error);
+
+ if (error != NULL)
+ {
+ g_critical ("Unable to connect to Zeitgeist daemon: %s",
+ error->message);
+ g_error_free (error);
+ }
+ else
+ {
+ /* Dispatch all method calls queued while waiting for the proxy */
+ priv->method_dispatch_queue = g_slist_reverse (priv->method_dispatch_queue);
+ g_slist_foreach (priv->method_dispatch_queue, (GFunc) dispatch_method, NULL);
+ g_slist_free (priv->method_dispatch_queue);
+ priv->method_dispatch_queue = NULL;
+ }
+
+ /* Release ref we held during async op */
+ g_object_unref (self);
+}
=== added file 'src/zeitgeist-index.h'
--- src/zeitgeist-index.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-index.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_INDEX_H_
+#define _ZEITGEIST_INDEX_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <zeitgeist-event.h>
+#include <zeitgeist-enums.h>
+#include <zeitgeist-index.h>
+#include <zeitgeist-result-set.h>
+#include <zeitgeist-timerange.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_INDEX (zeitgeist_index_get_type())
+#define ZEITGEIST_INDEX(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ZEITGEIST_TYPE_INDEX, ZeitgeistIndex))
+#define ZEITGEIST_INDEX_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ZEITGEIST_TYPE_INDEX, ZeitgeistIndexClass))
+#define ZEITGEIST_INDEX_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZEITGEIST_TYPE_INDEX, ZeitgeistIndexClass))
+#define ZEITGEIST_IS_INDEX(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ZEITGEIST_TYPE_INDEX))
+#define ZEITGEIST_IS_INDEX_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ZEITGEIST_TYPE_INDEX))
+
+typedef struct _ZeitgeistIndex ZeitgeistIndex;
+typedef struct _ZeitgeistIndexClass ZeitgeistIndexClass;
+
+struct _ZeitgeistIndexClass
+{
+ GObjectClass parent_class;
+};
+
+
+struct _ZeitgeistIndex
+{
+ GObject parent_instance;
+};
+
+GType zeitgeist_index_get_type (void);
+
+ZeitgeistIndex* zeitgeist_index_new (void);
+
+void zeitgeist_index_search (ZeitgeistIndex *self,
+ const gchar *query,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ guint32 offset,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ZeitgeistResultSet*
+ zeitgeist_index_search_finish (ZeitgeistIndex *self,
+ GAsyncResult *res,
+ GError **error);
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_INDEX_H_ */
=== added file 'src/zeitgeist-log.c'
--- src/zeitgeist-log.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-log.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,1376 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-log.h"
+#include "zeitgeist-simple-result-set.h"
+#include "org.gnome.zeitgeist.Monitor-xml.h"
+
+/**
+ * SECTION:zeitgeist-log
+ * @short_description: Primary access point for talking to the Zeitgeist daemon
+ * @include: zeitgeist.h
+ *
+ * #ZeitgeistLog encapsulates the low level access to the Zeitgeist daemon.
+ * You can use it to manage the log by inserting and deleting entries as well
+ * as do queries on the logged data.
+ *
+ * It's important to realize that the #ZeitgeistLog class does not expose
+ * any API that does synchronous communications with the message bus -
+ * everything is asynchronous. To ease development some of the methods have
+ * variants that are "fire and forget" ignoring the normal return value, so
+ * that callbacks does not have to be set up.
+ */
+
+G_DEFINE_TYPE (ZeitgeistLog, zeitgeist_log, G_TYPE_OBJECT);
+#define ZEITGEIST_LOG_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_LOG, ZeitgeistLogPrivate))
+
+typedef struct
+{
+ /* Our connection to the bus */
+ GDBusConnection *connection;
+
+ /* Handle for our bus watcher, looking out for the zg daemon */
+ guint watcher_id;
+
+ /* The connection to the ZG daemon.
+ * If log != NULL it means we have a connection */
+ GDBusProxy *log;
+
+ /* Hash set of ZeitgeistMonitors we've installed.
+ * We store a map of (monitor, registration_id) */
+ GHashTable *monitors;
+
+ /* Method calls queued up while waiting for a proxy */
+ GSList *method_dispatch_queue;
+
+ /* Are we connected to Zeitgeist? */
+ gboolean is_connected;
+
+} ZeitgeistLogPrivate;
+
+/* Property ids */
+enum
+{
+ PROP_0,
+
+ PROP_CONNECTED,
+
+ LAST_PROPERTY
+};
+
+typedef struct
+{
+ ZeitgeistLog *self;
+ const gchar *method_name;
+ GVariant *params;
+ GCancellable *cancellable;
+ GAsyncReadyCallback cb;
+ gpointer user_data;
+} MethodDispatchContext;
+
+static void _zeitgeist_log_on_zg_appeared (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data);
+
+static void _zeitgeist_log_on_name_owner_changed (GObject *proxy,
+ GParamSpec *pspec,
+ gpointer user_data);
+
+static void _zeitgeist_log_on_zg_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void _zeitgeist_log_install_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor);
+
+static void _zeitgeist_log_on_monitor_destroyed (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor);
+
+static void _zeitgeist_monitor_weak_unref (ZeitgeistMonitor *monitor,
+ gpointer _ignored,
+ ZeitgeistLog *log);
+
+static void dispatch_method (MethodDispatchContext *ctx);
+
+static void dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data);
+
+static void
+zeitgeist_log_init (ZeitgeistLog *self)
+{
+ ZeitgeistLogPrivate *priv;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ priv->log = NULL;
+
+ /* Reset hash set of monitors */
+ priv->monitors = g_hash_table_new (g_direct_hash, g_direct_equal);
+
+ /* Set up the connection to the ZG daemon */
+ priv->watcher_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
+ "org.gnome.zeitgeist.Engine",
+ G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
+ _zeitgeist_log_on_zg_appeared,
+ NULL,
+ self,
+ NULL);
+}
+
+static void
+zeitgeist_log_finalize (GObject *object)
+{
+ ZeitgeistLog *log = ZEITGEIST_LOG (object);
+ ZeitgeistLogPrivate *priv;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (log);
+
+ if (priv->connection != NULL)
+ {
+ g_object_unref (priv->connection);
+ priv->connection = NULL;
+ }
+
+ if (priv->watcher_id)
+ {
+ g_bus_unwatch_name (priv->watcher_id);
+ priv->watcher_id = 0;
+ }
+
+ if (priv->log)
+ {
+ g_object_unref (priv->log);
+ priv->log = NULL;
+ }
+
+ /* Out list of monitors only holds weak refs to the monitors */
+ if (priv->monitors)
+ {
+ g_hash_table_foreach (priv->monitors,
+ (GHFunc) _zeitgeist_monitor_weak_unref,
+ log);
+ g_hash_table_unref (priv->monitors);
+ }
+
+ G_OBJECT_CLASS (zeitgeist_log_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_log_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistLogPrivate *priv = ZEITGEIST_LOG_GET_PRIVATE (object);
+ gchar *name_owner;
+
+ switch (prop_id)
+ {
+ case PROP_CONNECTED:
+ g_value_set_boolean (value, priv->is_connected);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+zeitgeist_log_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistLogPrivate *priv = ZEITGEIST_LOG_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONNECTED:
+ g_warning ("Can not set read-only property ZeitgeistLog:connected");
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+
+static void
+zeitgeist_log_class_init (ZeitgeistLogClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
+ object_class->finalize = zeitgeist_log_finalize;
+ object_class->get_property = zeitgeist_log_get_property;
+ object_class->set_property = zeitgeist_log_set_property;
+
+ /**
+ * ZeitgeistLog:connected:
+ *
+ * Determines if this Log instance is currently connected to Zeitgeist
+ * daemon.
+ */
+ pspec = g_param_spec_boolean ("connected",
+ "Connected",
+ "Whether this instance is connected to Zeitgeist",
+ FALSE,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_CONNECTED, pspec);
+
+ g_type_class_add_private (object_class, sizeof (ZeitgeistLogPrivate));
+}
+
+/* Send off the DBus method call, or queue it if we don't
+ * have a proxy at this point */
+static void
+dispatch_method (MethodDispatchContext *ctx)
+{
+ ZeitgeistLogPrivate *priv;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (ctx->self);
+
+ if (priv->log)
+ {
+ g_dbus_proxy_call (priv->log,
+ ctx->method_name,
+ ctx->params,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ ctx->cancellable,
+ dispatch_async_callback,
+ ctx);
+ }
+ else
+ priv->method_dispatch_queue = g_slist_prepend (priv->method_dispatch_queue,
+ ctx);
+}
+
+/* Used to marshal the async callbacks from GDBus into ones
+ * coming from this ZeitgeistLog instance */
+static void
+dispatch_async_callback (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GVariant *var;
+ MethodDispatchContext *ctx = (MethodDispatchContext*) user_data;
+
+ if (ctx->cb != NULL)
+ ctx->cb (G_OBJECT (ctx->self), res, ctx->user_data);
+ else
+ {
+ /* Caller ignores response - finish the call our selves */
+ var = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, NULL);
+ if (var != NULL)
+ g_variant_unref (var);
+ }
+
+ g_object_unref (ctx->self);
+ g_free (ctx);
+}
+
+/*
+ * API BELOW HERE
+ */
+
+/**
+ * zeitgeist_log_new:
+ * Create a new log that interfaces with the default event log of the Zeitgeist
+ * daemon.
+ *
+ * The #ZeitgeistLog object will asynchronously start to connect to the
+ * Zeitgeist daemon. Any request you send to via this log object will be queued
+ * until the connection is ready - at which point you will get a notify signal
+ * on the #ZeitgeistLog:connected property.
+ *
+ * Returns: A reference to a newly allocated log.
+ */
+ZeitgeistLog*
+zeitgeist_log_new (void)
+{
+ ZeitgeistLog *log;
+
+ log = (ZeitgeistLog*) g_object_new (ZEITGEIST_TYPE_LOG,
+ NULL);
+
+ return log;
+}
+
+/**
+ * zeitgeist_log_insert_events:
+ * @self: The log logging the events
+ * @cancellable: To cancel the operation or %NULL
+ * @callback: #GAsyncReadyCallback to invoke once the logging operation has
+ * completed. Set to %NULL to ignore the result. In this callback
+ * you can invoke zeitgeist_log_insert_events_finish() to collect
+ * the event ids of the inserted events
+ * @user_data: Any user data to pass back to @callback
+ * @VarArgs: A list of #ZeitgeistEvent<!-- -->s terminated by a %NULL
+ *
+ * Asynchronously send a set of events to the Zeitgeist daemon, requesting they
+ * be inserted into the log.
+ */
+void
+zeitgeist_log_insert_events (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ ...)
+{
+ va_list events;
+
+ va_start (events, user_data);
+ zeitgeist_log_insert_events_valist (self, cancellable,
+ callback, user_data, events);
+ va_end (events);
+}
+
+/**
+ * zeitgeist_log_insert_events_no_reply:
+ * @self: The log logging the events
+ * @VarArgs: A list of #ZeitgeistEvent<!-- -->s terminated by a %NULL
+ *
+ * Asynchronously send a set of events to the Zeitgeist daemon, requesting they
+ * be inserted into the log. This method is "fire and forget" and the
+ * caller will never know whether the events was successfully inserted or not.
+ *
+ * This method is exactly equivalent to calling zeitgeist_log_insert_events()
+ * with %NULL set as @cancellable, @callback, and @user_data.
+ */
+void
+zeitgeist_log_insert_events_no_reply (ZeitgeistLog *self,
+ ...)
+{
+ va_list events;
+
+ va_start (events, self);
+ zeitgeist_log_insert_events_valist (self, NULL, NULL, NULL, events);
+ va_end (events);
+}
+
+/**
+ * zeitgeist_log_insert_events_valist:
+ * @self: The log logging the events
+ * @cancellable: To cancel the operation or %NULL
+ * @callback: #GAsyncReadyCallback to invoke once the logging operation has
+ * completed. Set to %NULL to ignore the result. In this callback
+ * you can invoke zeitgeist_log_insert_events_finish() to collect
+ * the event ids of the inserted events
+ * @user_data: Any user data to pass back to @callback
+ * @events: A #GPtrArray of #ZeitgeistEvent<!-- -->s to insert. This method
+ * steals the reference to @events and consumes all floating refs
+ * on the event members.
+ *
+ * This method is intended for language bindings. If calling this function
+ * from C code it's generally more handy to use zeitgeist_log_insert_events()
+ * or zeitgeist_log_insert_events_from_ptrarray().
+ *
+ * Asynchronously send a set of events to the Zeitgeist daemon, requesting they
+ * be inserted into the log.
+ */
+void
+zeitgeist_log_insert_events_valist (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ va_list events)
+{
+ GPtrArray *_events;
+
+ _events = zeitgeist_events_from_valist (events);
+ zeitgeist_log_insert_events_from_ptrarray (self, _events, cancellable,
+ callback, user_data);
+}
+
+/**
+ * zeitgeist_log_insert_events_from_ptrarray:
+ * @self: The log logging the events
+ * @events: A #GPtrArray of #ZeitgeistEvent<!-- -->s to insert. This method
+ * steals the reference to @events and consumes all floating refs
+ * on the event members. It is assumed that the free_func on @events
+ * is set to g_object_unref().
+ * @cancellable: To cancel the operation or %NULL
+ * @callback: #GAsyncReadyCallback to invoke once the logging operation has
+ * completed. Set to %NULL to ignore the result. In this callback
+ * you can invoke zeitgeist_log_insert_events_finish() to collect
+ * the event ids of the inserted events
+ * @user_data: Any user data to pass back to @callback
+ *
+ * Asynchronously send a set of events to the Zeitgeist daemon, requesting they
+ * be inserted into the log.
+ */
+void
+zeitgeist_log_insert_events_from_ptrarray (ZeitgeistLog *self,
+ GPtrArray *events,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *vevents;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (events != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Own all floating refs on the events, and frees the events array */
+ vevents = zeitgeist_events_to_variant (events); // own ref
+ vevents = g_variant_new_tuple (&vevents, 1); // own ref
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "InsertEvents";
+ ctx->params = vevents;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+GArray*
+zeitgeist_log_insert_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GArray *event_ids;
+ GVariant *val, *_val;
+ gsize n_ids;
+ const guint32 *raw_ids;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ _val = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ raw_ids = g_variant_get_fixed_array (_val, &n_ids, sizeof (guint32));
+ event_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint32), n_ids);
+ g_array_append_vals (event_ids, raw_ids, n_ids);
+
+ g_variant_unref (_val);
+
+ return event_ids;
+}
+
+void
+zeitgeist_log_find_events (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *vevents, *vtime_range, *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (ZEITGEIST_IS_TIME_RANGE (time_range));
+ g_return_if_fail (event_templates != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Own all floating refs on the events, and frees the events array */
+ vevents = zeitgeist_events_to_variant (event_templates);
+
+ /* Owns floating ref on time_range */
+ vtime_range = zeitgeist_time_range_to_variant (time_range);
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("((xx)a(asaasay)uuu)"));
+ g_variant_builder_add_value (&b, vtime_range); // owns ref
+ g_variant_builder_add_value (&b, vevents); // owns ref
+ g_variant_builder_add (&b, "u", storage_state);
+ g_variant_builder_add (&b, "u", num_events);
+ g_variant_builder_add (&b, "u", result_type);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "FindEvents";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+/**
+ * zeitgeist_log_find_events_finish:
+ * @self:
+ * @res:
+ * @error:
+ *
+ * Retrieve the result from an asynchronous query started with
+ * zeitgeist_log_find_events().
+ *
+ * Returns: (transfer-full): A newly allocated #ZeitgeistResultSet containing
+ * the #ZeitgeistEvent<!-- -->s
+ * matching the query. You must free the result set with
+ * g_object_unref(). The events held in the result set will
+ * automatically be unreffed when the result set is finalized.
+ */
+ZeitgeistResultSet*
+zeitgeist_log_find_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GPtrArray *events;
+ GVariant *val, *_val;
+ const guint32 *raw_ids;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ _val = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ events = zeitgeist_events_from_variant (_val);
+ g_variant_unref (_val);
+
+ return _zeitgeist_simple_result_set_new (events, events->len);
+}
+
+void
+zeitgeist_log_find_event_ids (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *vevents, *vtime_range, *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (ZEITGEIST_IS_TIME_RANGE (time_range));
+ g_return_if_fail (event_templates != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Own all floating refs on the events, and frees the events array */
+ vevents = zeitgeist_events_to_variant (event_templates);
+
+ /* Owns floating ref on time_range */
+ vtime_range = zeitgeist_time_range_to_variant (time_range);
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("((xx)a(asaasay)uuu)"));
+ g_variant_builder_add_value (&b, vtime_range); // owns ref
+ g_variant_builder_add_value (&b, vevents); // owns ref
+ g_variant_builder_add (&b, "u", storage_state);
+ g_variant_builder_add (&b, "u", num_events);
+ g_variant_builder_add (&b, "u", result_type);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "FindEventIds";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+GArray*
+zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GArray *event_ids;
+ GVariant *val, *_val;
+ gsize n_ids;
+ const guint32 *raw_ids;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ _val = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ raw_ids = g_variant_get_fixed_array (_val, &n_ids, sizeof (guint32));
+ event_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint32), n_ids);
+ g_array_append_vals (event_ids, raw_ids, n_ids);
+
+ g_variant_unref (_val);
+
+ return event_ids;
+}
+
+void
+zeitgeist_log_get_events (ZeitgeistLog *self,
+ GArray *event_ids,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GVariant *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+ int i;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (event_ids != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(au)"));
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("au"));
+ for (i = 0; i < event_ids->len; i++)
+ g_variant_builder_add (&b, "u", g_array_index (event_ids, guint32, i));
+ g_variant_builder_close (&b);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "GetEvents";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+ZeitgeistResultSet*
+zeitgeist_log_get_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GPtrArray *events;
+ GVariant *val, *_val;
+ const guint32 *raw_ids;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ _val = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ events = zeitgeist_events_from_variant (_val);
+ g_variant_unref (_val);
+
+ return _zeitgeist_simple_result_set_new (events, events->len);
+}
+
+void
+zeitgeist_log_delete_events (ZeitgeistLog *self,
+ GArray *event_ids,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GVariant *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+ int i;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (event_ids != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(au)"));
+ g_variant_builder_open (&b, G_VARIANT_TYPE ("au"));
+ for (i = 0; i < event_ids->len; i++)
+ g_variant_builder_add (&b, "u", g_array_index (event_ids, guint32, i));
+ g_variant_builder_close (&b);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "DeleteEvents";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+gboolean
+zeitgeist_log_delete_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GPtrArray *events;
+ GVariant *val;
+ const guint32 *raw_ids;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return FALSE;
+
+ g_variant_unref (val);
+ return TRUE;
+}
+
+void
+zeitgeist_log_find_related_uris (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ GPtrArray *result_event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *vevent_templates, *vresult_event_templates;
+ GVariant *vtime_range, *params;
+ GVariantBuilder b;
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (ZEITGEIST_IS_TIME_RANGE (time_range));
+ g_return_if_fail (event_templates != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Own all floating refs on the events, and frees the events array */
+ vevent_templates = zeitgeist_events_to_variant (event_templates);
+ vresult_event_templates = zeitgeist_events_to_variant (result_event_templates);
+
+ /* Owns floating ref on time_range */
+ vtime_range = zeitgeist_time_range_to_variant (time_range);
+
+ /* Build the method params */
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("((xx)a(asaasay)a(asaasay)uuu)"));
+ g_variant_builder_add_value (&b, vtime_range); // owns ref
+ g_variant_builder_add_value (&b, vevent_templates); // owns ref
+ g_variant_builder_add_value (&b, vresult_event_templates); // owns ref
+ g_variant_builder_add (&b, "u", storage_state);
+ g_variant_builder_add (&b, "u", num_events);
+ g_variant_builder_add (&b, "u", result_type);
+ params = g_variant_builder_end (&b);
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "FindRelatedUris";
+ ctx->params = params;
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+gchar**
+zeitgeist_log_find_related_uris_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *val, *_val;
+ const gchar **uris;
+ gchar **result;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return NULL;
+
+ /* Unpack return value from wrapper struct */
+ _val = g_variant_get_child_value (val, 0);
+ g_variant_unref (val);
+
+ uris = g_variant_get_strv (_val, NULL);
+ result = g_strdupv ((gchar**)uris);
+
+ g_free (uris);
+ g_variant_unref (_val);
+
+ return result;
+}
+
+void
+zeitgeist_log_delete_log (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "DeleteLog";
+ ctx->params = g_variant_new ("()");
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+gboolean
+zeitgeist_log_delete_log_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *val;
+ gchar **result;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return FALSE;
+
+ g_variant_unref (val);
+
+ return TRUE;
+}
+
+void
+zeitgeist_log_quit (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ MethodDispatchContext *ctx;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE(cancellable));
+
+ ctx = g_new0 (MethodDispatchContext, 1);
+ ctx->self = g_object_ref (self);
+ ctx->method_name = "Quit";
+ ctx->params = g_variant_new ("()");
+ ctx->cancellable = cancellable;
+ ctx->cb = callback;
+ ctx->user_data = user_data;
+
+ dispatch_method (ctx);
+}
+
+gboolean
+zeitgeist_log_quit_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ ZeitgeistLogPrivate *priv;
+ GVariant *val;
+ gchar **result;
+
+ g_return_val_if_fail (ZEITGEIST_IS_LOG (self), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ val = g_dbus_proxy_call_finish (priv->log, res, error);
+
+ if (val == NULL)
+ return FALSE;
+
+ g_variant_unref (val);
+
+ return TRUE;
+}
+
+/* Called when the Zeitgeist daemon enters the bus */
+static void
+_zeitgeist_log_on_zg_appeared (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *name_owner,
+ gpointer user_data)
+{
+ ZeitgeistLog *self;
+ ZeitgeistLogPrivate *priv;
+
+ self = ZEITGEIST_LOG (user_data);
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ if (priv->connection == NULL)
+ {
+ priv->connection = g_object_ref (connection);
+ }
+
+ if (priv->log == NULL)
+ {
+ g_dbus_proxy_new (connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ name,
+ "/org/gnome/zeitgeist/log/activity",
+ "org.gnome.zeitgeist.Log",
+ NULL,
+ _zeitgeist_log_on_zg_proxy_acquired,
+ g_object_ref (self));
+ }
+}
+
+/* Async callback for when a proxy is ready
+ * - triggered from _zeitgeist_log_on_zg_appeared */
+static void
+_zeitgeist_log_on_zg_proxy_acquired (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistLog *self;
+ ZeitgeistLogPrivate *priv;
+ GHashTableIter iter;
+ gpointer monitor, dummy;
+ GError *error;
+
+ self = ZEITGEIST_LOG (user_data);
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ if (priv->log != NULL)
+ {
+ g_critical ("Internal error in libzeitgeist. Registered new connection,"
+ "but we already have one. Discarding the old and using the "
+ "new one");
+ g_object_unref (priv->log);
+ priv->log = NULL;
+ }
+
+ error = NULL;
+ priv->log = g_dbus_proxy_new_finish (res, &error);
+
+ if (error != NULL)
+ {
+ g_critical ("Failed to create proxy for Zeitgeist daemon: %s",
+ error->message);
+ goto cleanup;
+ }
+
+ g_signal_connect (priv->log, "notify::g-name-owner",
+ G_CALLBACK (_zeitgeist_log_on_name_owner_changed), self);
+
+ /* Reinstate all active monitors */
+ g_hash_table_iter_init (&iter, priv->monitors);
+ while (g_hash_table_iter_next (&iter, &monitor, &dummy))
+ {
+ _zeitgeist_log_install_monitor (self, ZEITGEIST_MONITOR (monitor));
+ }
+
+ priv->is_connected = TRUE;
+ g_object_notify (G_OBJECT (self), "connected");
+
+ /* Dispatch all queued method calls we got while we didn't have a proxy.
+ * Note that dispatch_method() also frees all the queue members */
+ priv->method_dispatch_queue = g_slist_reverse (priv->method_dispatch_queue);
+ g_slist_foreach (priv->method_dispatch_queue, (GFunc) dispatch_method, NULL);
+ g_slist_free (priv->method_dispatch_queue);
+ priv->method_dispatch_queue = NULL;
+
+ cleanup:
+ g_object_unref (self);
+}
+
+/* Called when the Zeitgeist daemon leaves the bus */
+static void
+_zeitgeist_log_on_name_owner_changed (GObject *proxy,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ ZeitgeistLog *self;
+ ZeitgeistLogPrivate *priv;
+ gchar *name_owner;
+ gboolean connected;
+ GHashTableIter iter;
+ gpointer monitor, dummy;
+
+ self = ZEITGEIST_LOG (user_data);
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (proxy));
+ connected = name_owner != NULL;
+
+ if (connected)
+ {
+ /* Reinstate all active monitors */
+ g_hash_table_iter_init (&iter, priv->monitors);
+ while (g_hash_table_iter_next (&iter, &monitor, &dummy))
+ {
+ _zeitgeist_log_install_monitor (self, ZEITGEIST_MONITOR (monitor));
+ }
+ }
+
+ if (priv->is_connected ^ connected) /* XOR here! */
+ {
+ priv->is_connected = connected;
+ g_object_notify (G_OBJECT (self), "connected");
+ }
+
+ if (name_owner) g_free (name_owner);
+}
+
+gboolean
+zeitgeist_log_is_connected (ZeitgeistLog *self)
+{
+ ZeitgeistLogPrivate *priv;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ return priv->is_connected;
+}
+
+/*
+ * ZEITGEIST MONITOR STUFF BELOW HERE
+ */
+
+static void
+monitor_handle_method_call (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ ZeitgeistMonitor *mon;
+ GVariant *vtime_range, *vevents, *vids;
+ GPtrArray *aevents;
+ ZeitgeistResultSet *events;
+ ZeitgeistTimeRange *time_range;
+ GArray *event_ids;
+ gsize n_ids;
+ gconstpointer raw_ids;
+
+ mon = ZEITGEIST_MONITOR (user_data);
+
+ if (g_strcmp0 (method_name, "NotifyInsert") == 0)
+ {
+ /* parameters has signature '((xx)a(asaasay))' */
+ vtime_range = g_variant_get_child_value (parameters, 0);
+ time_range = zeitgeist_time_range_new_from_variant (vtime_range);
+ vevents = g_variant_get_child_value (parameters, 1);
+ aevents = zeitgeist_events_from_variant (vevents);
+ events = _zeitgeist_simple_result_set_new (aevents, aevents->len);
+ g_signal_emit_by_name (mon, "events-inserted", time_range, events);
+ g_object_unref (time_range);
+ g_object_unref (events);
+ g_variant_unref (vtime_range);
+ g_variant_unref (vevents);
+ g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
+ }
+ else if (g_strcmp0 (method_name, "NotifyDelete") == 0)
+ {
+ /* parameters has signature '((xx)au)' */
+ vtime_range = g_variant_get_child_value (parameters, 0);
+ time_range = zeitgeist_time_range_new_from_variant (vtime_range);
+ vids = g_variant_get_child_value (parameters, 1);
+ raw_ids = g_variant_get_fixed_array (vids, &n_ids, sizeof (guint32));
+ event_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint32), n_ids);
+ g_array_append_vals (event_ids, raw_ids, n_ids);
+ g_signal_emit_by_name (mon, "events-deleted", time_range, event_ids);
+ g_object_unref (time_range);
+ g_variant_unref (vtime_range);
+ g_variant_unref (vids);
+ g_array_unref (event_ids);
+ g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
+ }
+}
+
+static const GDBusInterfaceVTable monitor_interface_vtable =
+{
+ monitor_handle_method_call,
+ NULL,
+ NULL
+};
+
+/* INVARIANT: This method is only called when priv->log != NULL */
+/* INVARIANT: This method is only called when @monitor is in priv->monitors */
+static void
+_zeitgeist_log_install_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor)
+{
+ ZeitgeistLogPrivate *priv;
+ MethodDispatchContext *ctx;
+ GDBusNodeInfo *monitor_introspection_data;
+ guint registration_id;
+ GVariantBuilder b;
+ GVariant *time_range, *event_templates, *params;
+
+ /* Keep the parsed introspection data of the Monitor interface around */
+ static GDBusInterfaceInfo *monitor_interface_info = NULL;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Load Monitor introspection XML on first run */
+ if (monitor_interface_info == NULL)
+ {
+ monitor_introspection_data = g_dbus_node_info_new_for_xml (
+ org_gnome_zeitgeist_Monitor_xml, NULL);
+ monitor_interface_info = g_dbus_node_info_lookup_interface (
+ monitor_introspection_data,
+ "org.gnome.zeitgeist.Monitor");
+ g_assert (monitor_interface_info != NULL);
+
+ g_dbus_interface_info_ref (monitor_interface_info);
+ g_dbus_node_info_unref (monitor_introspection_data);
+ }
+
+ /* Check invariant priv->log != NULL */
+ if (priv->log == NULL)
+ {
+ g_critical ("Internal error in libzeitgeist: Monitors should not be"
+ "published before when we don't have a connection");
+ return;
+ }
+
+ /* Export the monitor, client side, on the session bus if it isn't already */
+ registration_id = GPOINTER_TO_UINT (g_hash_table_lookup (priv->monitors, monitor));
+ if (registration_id == 0)
+ {
+ registration_id = g_dbus_connection_register_object (priv->connection,
+ zeitgeist_monitor_get_path (monitor),
+ monitor_interface_info,
+ &monitor_interface_vtable,
+ monitor, /* user_data */
+ NULL, /* user_data_free_func */
+ NULL); /* GError** */
+
+ g_hash_table_insert (priv->monitors, monitor,
+ GUINT_TO_POINTER (registration_id));
+ }
+
+ /* Build the method params */
+ time_range = zeitgeist_time_range_to_variant (
+ zeitgeist_monitor_get_time_range (monitor));
+ event_templates = zeitgeist_events_to_variant (
+ g_ptr_array_ref (zeitgeist_monitor_get_templates (monitor)));
+
+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(o(xx)a(asaasay))"));
+ g_variant_builder_add (&b, "o", zeitgeist_monitor_get_path (monitor));
+ g_variant_builder_add_value (&b, time_range); // owns ref
+ g_variant_builder_add_value (&b, event_templates); // owns ref;
+ params = g_variant_builder_end (&b);
+
+ /* Send the shebang to Zeitgeist */
+ g_dbus_proxy_call (priv->log,
+ "InstallMonitor",
+ params,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, NULL, NULL);
+}
+
+void
+zeitgeist_log_install_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor)
+{
+ ZeitgeistLogPrivate *priv;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (ZEITGEIST_IS_MONITOR (monitor));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Track the monitor so we can reinstate it if the Zeitgeist daemon
+ * leaves and reappears on the bus */
+ g_object_weak_ref (G_OBJECT (monitor),
+ (GWeakNotify) _zeitgeist_log_on_monitor_destroyed,
+ self);
+
+ /* The guint value in the monitors table holds the gdbus registration id.
+ * For non-registered monitors this is 0 */
+ g_hash_table_insert (priv->monitors, monitor, GUINT_TO_POINTER (0));
+
+ /* If we are connected send the monitor to Zeitgeist now,
+ * otherwise it will be installed once the connection is up */
+ if (priv->log != NULL)
+ _zeitgeist_log_install_monitor (self, monitor);
+}
+
+static void
+monitor_removed_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ ZeitgeistLog *self = ZEITGEIST_LOG (((gpointer*)user_data)[0]);
+ ZeitgeistMonitor *mon = ZEITGEIST_MONITOR (((gpointer*)user_data)[1]);
+ ZeitgeistLogPrivate *priv;
+ guint registration_id;
+ GVariant *val;
+ GError *error;
+
+ error = NULL;
+ val = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
+
+ if (error != NULL)
+ {
+ g_critical ("Failed to remove monitor from Zeitgeist. Retracting"
+ "%s from the bus nonetheless: %s",
+ zeitgeist_monitor_get_path (mon), error->message);
+ g_error_free (error);
+ }
+
+ if (val != NULL)
+ g_variant_unref (val);
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+ registration_id = GPOINTER_TO_UINT (g_hash_table_lookup (priv->monitors, mon));
+ g_hash_table_remove (priv->monitors, mon);
+
+ /* Retract the monitor from the session bus,
+ * now that ZG is informed we are about to do so */
+ if (registration_id != 0)
+ {
+ g_dbus_connection_unregister_object (priv->connection,
+ registration_id);
+ }
+
+ /* Drop refs we held during async call */
+ g_object_unref (self);
+ g_object_unref (mon);
+
+ g_free (user_data);
+}
+
+void
+zeitgeist_log_remove_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor)
+{
+ ZeitgeistLogPrivate *priv;
+ GDBusConnection *connection;
+ gpointer *dispatch_data;
+
+ g_return_if_fail (ZEITGEIST_IS_LOG (self));
+ g_return_if_fail (ZEITGEIST_IS_MONITOR (monitor));
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* Keep refs while async call is on going */
+ dispatch_data = g_new (gpointer, 2);
+ dispatch_data[0] = g_object_ref (self);
+ dispatch_data[1] = g_object_ref (monitor);
+
+ /* Inform ZG that we are about to remove the monitor from the bus,
+ * only after that has been acked will we retract it */
+ g_dbus_proxy_call (priv->log,
+ "RemoveMonitor",
+ g_variant_new ("o", zeitgeist_monitor_get_path(monitor)),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, NULL, monitor_removed_cb, dispatch_data);
+}
+
+/* Helper for dropping a weak ref from a log on a monitor. The method
+ * signature makes it suitable for casting to a GHFunc */
+static void
+_zeitgeist_monitor_weak_unref (ZeitgeistMonitor *monitor,
+ gpointer _ignored,
+ ZeitgeistLog *log)
+{
+ g_object_weak_unref (G_OBJECT (monitor),
+ (GWeakNotify) _zeitgeist_log_on_monitor_destroyed,
+ log);
+}
+
+/* Called when a monitor is finalized, by virtue of our weak ref */
+static void
+_zeitgeist_log_on_monitor_destroyed (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor)
+{
+ ZeitgeistLogPrivate *priv;
+
+ priv = ZEITGEIST_LOG_GET_PRIVATE (self);
+
+ /* If we have this monitor registered we remove it */
+ if (g_hash_table_lookup (priv->monitors, monitor) != NULL)
+ zeitgeist_log_remove_monitor (self, monitor);
+}
=== added file 'src/zeitgeist-log.h'
--- src/zeitgeist-log.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-log.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_LOG_H_
+#define _ZEITGEIST_LOG_H_
+
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <zeitgeist-monitor.h>
+#include <zeitgeist-event.h>
+#include <zeitgeist-enums.h>
+#include <zeitgeist-result-set.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_LOG (zeitgeist_log_get_type())
+#define ZEITGEIST_LOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ZEITGEIST_TYPE_LOG, ZeitgeistLog))
+#define ZEITGEIST_LOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ZEITGEIST_TYPE_LOG, ZeitgeistLogClass))
+#define ZEITGEIST_LOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZEITGEIST_TYPE_LOG, ZeitgeistLogClass))
+#define ZEITGEIST_IS_LOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ZEITGEIST_TYPE_LOG))
+#define ZEITGEIST_IS_LOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ZEITGEIST_TYPE_LOG))
+
+typedef struct _ZeitgeistLog ZeitgeistLog;
+typedef struct _ZeitgeistLogClass ZeitgeistLogClass;
+
+struct _ZeitgeistLogClass
+{
+ GObjectClass parent_class;
+};
+
+
+struct _ZeitgeistLog
+{
+ GObject parent_instance;
+};
+
+GType zeitgeist_log_get_type (void);
+
+ZeitgeistLog* zeitgeist_log_new (void);
+
+void zeitgeist_log_insert_events (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ ...) G_GNUC_NULL_TERMINATED;
+
+void zeitgeist_log_insert_events_no_reply
+ (ZeitgeistLog *self,
+ ...) G_GNUC_NULL_TERMINATED;
+
+void zeitgeist_log_insert_events_valist (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ va_list events);
+
+void zeitgeist_log_insert_events_from_ptrarray
+ (ZeitgeistLog *self,
+ GPtrArray *events,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GArray* zeitgeist_log_insert_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_find_events (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ZeitgeistResultSet*
+ zeitgeist_log_find_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_find_event_ids (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+GArray* zeitgeist_log_find_event_ids_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_get_events (ZeitgeistLog *self,
+ GArray *event_ids,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ZeitgeistResultSet*
+ zeitgeist_log_get_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_find_related_uris (ZeitgeistLog *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates,
+ GPtrArray *result_event_templates,
+ ZeitgeistStorageState storage_state,
+ guint32 num_events,
+ ZeitgeistResultType result_type,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gchar** zeitgeist_log_find_related_uris_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_delete_events (ZeitgeistLog *self,
+ GArray *event_ids,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean zeitgeist_log_delete_events_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_delete_log (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean zeitgeist_log_delete_log_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_quit (ZeitgeistLog *self,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean zeitgeist_log_quit_finish (ZeitgeistLog *self,
+ GAsyncResult *res,
+ GError **error);
+
+void zeitgeist_log_install_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor);
+
+void zeitgeist_log_remove_monitor (ZeitgeistLog *self,
+ ZeitgeistMonitor *monitor);
+
+gboolean zeitgeist_log_is_connected (ZeitgeistLog *self);
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_LOG_H_ */
=== added file 'src/zeitgeist-mimetypes.c'
--- src/zeitgeist-mimetypes.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-mimetypes.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#include "zeitgeist-mimetypes.h"
+#include "zeitgeist-ontology-interpretations.h"
+#include "zeitgeist-ontology-manifestations.h"
+
+static void _ensure_mimes_loaded (void);
+static void _ensure_schemes_loaded (void);
+
+static gboolean mimes_loaded = FALSE;
+static gboolean schemes_loaded = FALSE;
+static GHashTable *mimes = NULL;
+static GSList *mimes_r = NULL;
+static GSList *schemes = NULL;
+
+typedef struct
+{
+ gchar *scheme;
+ gchar *manifestation_uri;
+} UriScheme;
+
+typedef struct
+{
+ GRegex *regex;
+ gchar *interpretation_uri;
+} MimeRegex;
+
+static MimeRegex*
+mime_regex_new (const gchar *mimetype_regex, const gchar *interpretation_uri)
+{
+ MimeRegex *m = g_slice_new (MimeRegex);
+ m->regex = g_regex_new (mimetype_regex, 0, 0, NULL);
+ m->interpretation_uri = g_strdup (interpretation_uri);
+ return m;
+}
+
+/*static void
+mime_regex_free (MimeRegex *m)
+{
+ g_regex_unref (m->regex);
+ g_free (m->interpretation_uri);
+ g_slice_free (MimeRegex, m);
+}*/
+
+static UriScheme*
+uri_scheme_new (const gchar *uri_scheme, const gchar *manifestation_uri)
+{
+ UriScheme *s = g_slice_new (UriScheme);
+ s->scheme = g_strdup (uri_scheme);
+ s->manifestation_uri = g_strdup (manifestation_uri);
+ return s;
+}
+
+/*static void
+uri_scheme_free (UriScheme *s)
+{
+ g_free (s->scheme);
+ g_free (s->manifestation_uri);
+ g_slice_free (UriScheme, s);
+}*/
+
+
+
+/**
+ * zeitgeist_register_mimetype:
+ * @mimetype: A mimetype string. Fx. <emphasis>text/plain</emphasis>
+ * @interpretation_uri: A URI defining the interpretation type to associate with @mimetype
+ *
+ * Associate a mimetype with a given interpretation type. Registered mimetypes
+ * can be looked up with zeitgeist_interpretation_for_mimetype(). You can
+ * register a regular expression as mimetype if you instead of this function
+ * invoke zeitgeist_register_mimetype_regex().
+ *
+ * Mimetypes are first looked up by their exact name and then if none is
+ * found the regular expressions will be checked as fallbacks.
+ *
+ * This library will install a wide range a common mimetypes for you, so unless
+ * you have very specific needs you will normally not have to call this
+ * function.
+ *
+ * See the list of common
+ * <link linkend="zeitgeist-1.0-Interpretation-Ontology">interpretation types</link>.
+ */
+void
+zeitgeist_register_mimetype (const gchar *mimetype,
+ const gchar *interpretation_uri)
+{
+ if (mimes == NULL)
+ mimes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
+ g_hash_table_insert (mimes, g_strdup (mimetype),
+ g_strdup (interpretation_uri));
+}
+
+/**
+ * zeitgeist_register_mimetype_regex:
+ * @mimetype_regex: A regular expression matching a certain range of mimetypes.
+ * Fx. <emphasis>text/.*</emphasis> to match all
+ * <emphasis>text</emphasis> sub types.
+ * @interpretation_uri: A URI defining the interpretation type to associate with
+ * the matched mimetypes
+ *
+ * Associate a range of mimetypes with a given interpretation type.
+ * Registered mimetypes can be looked up with
+ * zeitgeist_interpretation_for_mimetype(). If you only need to register one
+ * specific mimetype it is more efficient if you instead of this function
+ * call zeitgeist_register_mimetype().
+ *
+ * Mimetypes are first looked up by their exact name and then if none is
+ * found the regular expressions will be checked as fallbacks.
+ *
+ * This library will install a wide range a common mimetypes for you, so unless
+ * you have very specific needs you will normally not have to call this
+ * function.
+ *
+ * See the list of common
+ * <link linkend="zeitgeist-1.0-Interpretation-Ontology">interpretation types</link>.
+ */
+void
+zeitgeist_register_mimetype_regex (const gchar *mimetype_regex,
+ const gchar *interpretation_uri)
+{
+ mimes_r = g_slist_append (mimes_r,
+ mime_regex_new (mimetype_regex,
+ interpretation_uri));
+}
+
+/**
+ * zeitgeist_interpretation_for_mimetype:
+ * @mimetype: A mimetype string. Fx. <emphasis>text/plain</emphasis>
+ *
+ * Look up the interpretation type associated with @mimetype. Please see the
+ * list of common
+ * <link linkend="zeitgeist-1.0-Interpretation-Ontology">interpretation types</link>.
+ *
+ * Returns: A URI defining the interpretation type associated with @mimetype or
+ * %NULL in case @mimetype is unknown.
+ */
+const gchar*
+zeitgeist_interpretation_for_mimetype (const gchar *mimetype)
+{
+ const gchar *result;
+ GSList *iter;
+
+ _ensure_mimes_loaded();
+
+ /* First look in our hash table */
+ result = g_hash_table_lookup (mimes,
+ mimetype);
+ if (result != NULL)
+ return result;
+
+ /* Check our regexes */
+ for (iter = mimes_r; iter; iter = iter->next)
+ {
+ MimeRegex *m = (MimeRegex*) iter->data;
+ if (g_regex_match (m->regex, mimetype, 0, NULL))
+ return m->interpretation_uri;
+ }
+
+ return NULL;
+}
+
+/**
+ * zeitgeist_register_uri_scheme:
+ * @uri_scheme: A URI scheme such as <emphasis>http://</emphasis>
+ * @manifestation_uri: A URI defining the manifestation type to associate with
+ * @uri_scheme
+ *
+ * Associate a URI scheme with a given manifestation type.
+ * You can find the manifestation type of a given URI by passing it to
+ * zeitgeist_manifestation_for_uri().
+ *
+ * This library will install a range a common URI schemes for you, so unless
+ * you have very specific needs you will normally not have to call this
+ * function.
+ *
+ * See the list of common
+ * <link linkend="zeitgeist-1.0-Manifestation-Ontology">manifestation types</link>.
+ */
+void
+zeitgeist_register_uri_scheme (const gchar *uri_scheme,
+ const gchar *manifestation_uri)
+{
+ schemes = g_slist_append (schemes,
+ uri_scheme_new (uri_scheme, manifestation_uri));
+}
+
+/**
+ * zeitgeist_manifestation_for_uri:
+ * @uri: A URI
+ *
+ * Look up a manifestation type for a given URI. Eg. if you pass in
+ * <emphasis>file:///tmp/foo.txt</emphasis> you will get back
+ * #ZEITGEIST_NFO_FILE_DATA_OBJECT.
+ *
+ * See the list of common
+ * <link linkend="zeitgeist-1.0-Manifestation-Ontology">manifestation types</link>.
+ *
+ * Returns: A manifestation type for @uri or %NULL in case no suitable
+ * manifestation type is known
+ */
+const gchar*
+zeitgeist_manifestation_for_uri (const gchar *uri)
+{
+ GSList *iter;
+
+ _ensure_schemes_loaded();
+
+ for (iter = schemes; iter; iter = iter->next)
+ {
+ UriScheme *s = (UriScheme*) iter->data;
+ if (g_str_has_prefix (uri, s->scheme))
+ return s->manifestation_uri;
+ }
+
+ return NULL;
+}
+
+static void
+_ensure_mimes_loaded (void)
+{
+ if (mimes_loaded) return;
+
+ zeitgeist_register_mimetype ("text/x-patch", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/postscript", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("image/png", ZEITGEIST_NFO_RASTER_IMAGE);
+ zeitgeist_register_mimetype ("application/x-m4", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-deb", ZEITGEIST_NFO_SOFTWARE);
+ zeitgeist_register_mimetype ("text/x-tex", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-shellscript", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-ocaml", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-gnumeric", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("application/x-executable", ZEITGEIST_NFO_SOFTWARE);
+ zeitgeist_register_mimetype ("application/rtf", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("application/x-fluid", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/html", ZEITGEIST_NFO_HTML_DOCUMENT);
+ zeitgeist_register_mimetype ("text/x-python", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-applix-spreadsheet", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("application/x-sql", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/ogg", ZEITGEIST_NFO_AUDIO);
+ zeitgeist_register_mimetype ("application/x-perl", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-bzip", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/x-7z-compressed", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("text/x-gettext-translation-template", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-lzma", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/ps", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("application/x-compressed-tar", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/msexcel", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("application/xml", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-lisp", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-archive", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/vnd.corel-draw", ZEITGEIST_NFO_VECTOR_IMAGE);
+ zeitgeist_register_mimetype ("text/x-troff", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/ms-excel", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("text/x-c++", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/plain", ZEITGEIST_NFO_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("text/x-latex", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-bzip-compressed-tar", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("audio/x-scpls", ZEITGEIST_NFO_MEDIA_LIST);
+ zeitgeist_register_mimetype ("text/x-pascal", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-cd-image", ZEITGEIST_NFO_FILESYSTEM_IMAGE);
+ zeitgeist_register_mimetype ("application/zip", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("text/x-sql", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("image/svg+xml", ZEITGEIST_NFO_VECTOR_IMAGE);
+ zeitgeist_register_mimetype ("application/x-ms-dos-executable", ZEITGEIST_NFO_SOFTWARE);
+ zeitgeist_register_mimetype ("application/x-lzma-compressed-tar", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/ms-powerpoint", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype ("text/x-eiffel", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-java-archive", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/pdf", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("text/x-csrc", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-vala", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-java", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-gettext-translation", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-killustrator", ZEITGEIST_NFO_VECTOR_IMAGE);
+ zeitgeist_register_mimetype ("text/x-credits", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-glade", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-php", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("image/gif", ZEITGEIST_NFO_RASTER_IMAGE);
+ zeitgeist_register_mimetype ("application/javascript", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-c++src", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("image/tiff", ZEITGEIST_NFO_RASTER_IMAGE);
+ zeitgeist_register_mimetype ("text/x-makefile", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-objcsrc", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-idl", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-applix-presents", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype ("application/x-kpresenter", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype ("application/x-rpm", ZEITGEIST_NFO_SOFTWARE);
+ zeitgeist_register_mimetype ("application/xhtml+xml", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-chdr", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-gzip", ZEITGEIST_NFO_ARCHIVE);
+ zeitgeist_register_mimetype ("application/x-dia-diagram", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("image/vnd.djvu", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("application/x-csh", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/css", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-csharp", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("image/jpeg", ZEITGEIST_NFO_RASTER_IMAGE);
+ zeitgeist_register_mimetype ("application/x-kspread", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("application/x-designer", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-gnucash", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("image/x-xcf", ZEITGEIST_NFO_RASTER_IMAGE);
+ zeitgeist_register_mimetype ("text/x-lua", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-desktop", ZEITGEIST_NFO_SOFTWARE);
+ zeitgeist_register_mimetype ("application/x-abiword", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("text/x-vhdl", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/vnd.ms-excel", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype ("text/x-dsrc", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-haskell", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("inode/directory", ZEITGEIST_NFO_FOLDER);
+ zeitgeist_register_mimetype ("application/x-object", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-c", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-ruby", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-copying", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/x-kword", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("application/x-applix-word", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype ("application/vnd.ms-powerpoint", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype ("text/x-m4", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("text/x-tcl", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/ecmascript", ZEITGEIST_NFO_SOURCE_CODE);
+ zeitgeist_register_mimetype ("application/msword", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype_regex ("application/vnd.oasis.opendocument.text.*", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype_regex ("application/vnd.oasis.opendocument.presentation.*", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype_regex ("application/vnd.oasis.opendocument.spreadsheet.*", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype_regex ("application/vnd.oasis.opendocument.graphics.*", ZEITGEIST_NFO_VECTOR_IMAGE);
+ zeitgeist_register_mimetype_regex ("application/vnd\\..*", ZEITGEIST_NFO_DOCUMENT);
+ zeitgeist_register_mimetype_regex ("application/x-applix-.*", ZEITGEIST_NFO_DOCUMENT);
+ zeitgeist_register_mimetype_regex ("application/vnd.ms-excel.*", ZEITGEIST_NFO_SPREADSHEET);
+ zeitgeist_register_mimetype_regex ("application/vnd.ms-powerpoint.*", ZEITGEIST_NFO_PRESENTATION);
+ zeitgeist_register_mimetype_regex (".*/x-dvi", ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT);
+ zeitgeist_register_mimetype_regex ("image/.*", ZEITGEIST_NFO_IMAGE);
+ zeitgeist_register_mimetype_regex ("audio/.*", ZEITGEIST_NFO_AUDIO);
+ zeitgeist_register_mimetype_regex ("video/.*", ZEITGEIST_NFO_VIDEO);
+
+ mimes_loaded = TRUE;
+}
+
+static void
+_ensure_schemes_loaded (void)
+{
+ if (schemes_loaded) return;
+
+ zeitgeist_register_uri_scheme ("file://", ZEITGEIST_NFO_FILE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("http://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("https://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("ssh://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("sftp://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("ftp://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("dav://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("davs://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+ zeitgeist_register_uri_scheme ("smb://", ZEITGEIST_NFO_REMOTE_DATA_OBJECT);
+
+ schemes_loaded = TRUE;
+}
+
=== added file 'src/zeitgeist-mimetypes.h'
--- src/zeitgeist-mimetypes.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-mimetypes.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#ifndef _ZEITGEIST_MIMETYPES_H_
+#define _ZEITGEIST_MIMETYPES_H_
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+void zeitgeist_register_mimetype (const gchar *mimetype,
+ const gchar *interpretation_uri);
+
+void zeitgeist_register_mimetype_regex (const gchar *mimetype_regex,
+ const gchar *interpretation_uri);
+
+const gchar* zeitgeist_interpretation_for_mimetype (const gchar *mimetype);
+
+void zeitgeist_register_uri_scheme (const gchar *uri_scheme,
+ const gchar *manifestation_type);
+
+const gchar* zeitgeist_manifestation_for_uri (const gchar *uri);
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_MIMETYPES_H_ */
=== added file 'src/zeitgeist-monitor.c'
--- src/zeitgeist-monitor.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-monitor.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,319 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-marshal.h"
+#include "zeitgeist-monitor.h"
+#include "zeitgeist-result-set.h"
+#include "zeitgeist-simple-result-set.h"
+
+/**
+ * SECTION:zeitgeist-monitor
+ * @short_description: Listens for updates to the Zeitgeist event log
+ * @include: zeitgeist.h
+ *
+ * A #ZeitgeistMonitor listens for updates to the Zeitgeist event log
+ * matching a given set of templates and with timestamps in some predefined
+ * time range.
+ *
+ * A monitor must be installed into the running Zeitgeist daemon by calling
+ * zeitgeist_log_install_monitor(). The monitor will not emit any of the
+ * ::events-added or ::events-deleted signals before this.
+ */
+
+static gint _monitor_counter = 0;
+
+typedef struct
+{
+ ZeitgeistTimeRange *time_range;
+ GPtrArray *event_templates;
+
+ /* Client side DBus path the monitor lives under */
+ gchar *monitor_path;
+} ZeitgeistMonitorPrivate;
+
+/* Property ids */
+enum
+{
+ PROP_0,
+
+ PROP_TIME_RANGE,
+ PROP_EVENT_TEMPLATES,
+
+ LAST_PROPERTY
+};
+
+/* signal ids */
+enum
+{
+ EVENTS_INSERTED,
+ EVENTS_DELETED,
+
+ LAST_SIGNAL
+};
+
+static guint monitor_signals[LAST_SIGNAL] = { 0 };
+
+G_DEFINE_TYPE (ZeitgeistMonitor, zeitgeist_monitor, G_TYPE_OBJECT);
+
+#define ZEITGEIST_MONITOR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_MONITOR, ZeitgeistMonitorPrivate))
+
+static void
+zeitgeist_monitor_init (ZeitgeistMonitor *object)
+{
+ ZeitgeistMonitorPrivate *priv = ZEITGEIST_MONITOR_GET_PRIVATE (object);
+
+ priv->monitor_path = g_strdup_printf ("/org/gnome/zeitgeist/monitor/%i",
+ _monitor_counter++);
+}
+
+static void
+zeitgeist_monitor_finalize (GObject *object)
+{
+ ZeitgeistMonitor *monitor = ZEITGEIST_MONITOR (object);
+ ZeitgeistMonitorPrivate *priv;
+
+ priv = ZEITGEIST_MONITOR_GET_PRIVATE (monitor);
+
+ if (priv->time_range)
+ {
+ g_object_unref (priv->time_range);
+ }
+ if (priv->event_templates)
+ {
+ g_ptr_array_unref (priv->event_templates);
+ }
+ if (priv->monitor_path)
+ {
+ g_free (priv->monitor_path);
+ }
+
+ G_OBJECT_CLASS (zeitgeist_monitor_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_monitor_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistMonitorPrivate *priv = ZEITGEIST_MONITOR_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_TIME_RANGE:
+ g_value_set_object (value, priv->time_range);
+ return;
+ case PROP_EVENT_TEMPLATES:
+ g_value_set_boxed (value, priv->event_templates);
+ return;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+zeitgeist_monitor_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZeitgeistMonitorPrivate *priv = ZEITGEIST_MONITOR_GET_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_TIME_RANGE:
+ priv->time_range = g_value_get_object (value);
+ g_object_ref_sink (priv->time_range);
+ return;
+ case PROP_EVENT_TEMPLATES:
+ /* By contract we own the ref to the event_templates
+ * passed to the constructor */
+ priv->event_templates = (GPtrArray*) g_value_get_boxed (value);
+ g_ptr_array_foreach (priv->event_templates,
+ (GFunc) g_object_ref_sink, NULL);
+ return;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+
+static void
+zeitgeist_monitor_class_init (ZeitgeistMonitorClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *pspec;
+
+ object_class->finalize = zeitgeist_monitor_finalize;
+ object_class->get_property = zeitgeist_monitor_get_property;
+ object_class->set_property = zeitgeist_monitor_set_property;
+
+ /**
+ * ZeitgeistMonitor:time-range:
+ *
+ * Events must have timestamps within this timerange in order to trigger
+ * the monitor.
+ */
+ pspec = g_param_spec_object ("time-range",
+ "Time range",
+ "Events must have timestamps within this time range",
+ ZEITGEIST_TYPE_TIME_RANGE,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+ g_object_class_install_property (object_class,
+ PROP_TIME_RANGE,
+ pspec);
+
+ /**
+ * ZeitgeistMonitor:event-templates:
+ *
+ * Events must match at least one these templates in order to trigger the
+ * monitor
+ */
+ pspec = g_param_spec_boxed ("event-templates",
+ "Event templates",
+ "Events must match one of these templates",
+ G_TYPE_PTR_ARRAY,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+ g_object_class_install_property (object_class,
+ PROP_EVENT_TEMPLATES,
+ pspec);
+
+ /**
+ * ZeitgeistMonitor::events-inserted:
+ * @time_range: A #ZeitgeistTimeRange that specifies the minimum and maximum
+ * of the timestamps in @events
+ * @events: A #ZeitgeistResultSet holding the #ZeitgeistEvent<!-- -->s that
+ * have been inserted into the log
+ *
+ * Emitted when events matching the event templates and with timestamps
+ * within the time range of the monitor has been inserted into the log.
+ */
+ monitor_signals[EVENTS_INSERTED] =
+ g_signal_new ("events-inserted",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ZeitgeistMonitorClass, events_inserted),
+ NULL, NULL,
+ _zeitgeist_cclosure_marshal_VOID__OBJECT_OBJECT,
+ G_TYPE_NONE,
+ 2, ZEITGEIST_TYPE_TIME_RANGE, ZEITGEIST_TYPE_RESULT_SET);
+
+ /**
+ * ZeitgeistMonitor::events-deleted:
+ * @time_range: A #ZeitgeistTimeRange that specifies the minimum and maximum
+ * timestamps of the deleted events
+ * @event_ids: A #GArray of #guint32<!-- -->s holding the ids of the deleted
+ * events
+ *
+ * Emitted when events with timestamps within the time range of this monitor
+ * has been deleted from the log. Note that the deleted events may not match
+ * the event templates for the monitor.
+ */
+ monitor_signals[EVENTS_DELETED] =
+ g_signal_new ("events-deleted",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ZeitgeistMonitorClass, events_deleted),
+ NULL, NULL,
+ _zeitgeist_cclosure_marshal_VOID__OBJECT_BOXED,
+ G_TYPE_NONE,
+ 2, ZEITGEIST_TYPE_TIME_RANGE, G_TYPE_ARRAY);
+
+ g_type_class_add_private (object_class, sizeof (ZeitgeistMonitorPrivate));
+}
+
+/**
+ * zeitgeist_monitor_new
+ * @time_range: The monitor will only listen for events with timestamps within
+ * this time range. Note that it is legal for applications to insert
+ * events that are "in the past".
+ * @event_templates: A #GPtrArray of #ZeitgeistEvent<!-- -->s. Only listen for
+ * events that match any of these templates.
+ * The monitor will assume ownership of the events and
+ * the pointer array.
+ * If you want to keep a reference for yourself you must do a
+ * g_ptr_array_ref() on @event_templates as well as reffing
+ * the events held by it before calling this method.
+ *
+ * Create a new monitor. Before you can receive signals from the monitor you
+ * need to install it in the running Zeitgeist daemon by calling
+ * zeitgeist_log_install_monitor().
+ *
+ * Returns: A reference to a newly allocated monitor.
+ */
+ZeitgeistMonitor*
+zeitgeist_monitor_new (ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates)
+{
+ ZeitgeistMonitor *monitor;
+
+ g_return_val_if_fail (ZEITGEIST_IS_TIME_RANGE (time_range), NULL);
+ g_return_val_if_fail (event_templates != NULL, NULL);
+
+ monitor = (ZeitgeistMonitor*) g_object_new (ZEITGEIST_TYPE_MONITOR,
+ "time-range", time_range,
+ "event-templates", event_templates,
+ NULL);
+
+ return monitor;
+}
+
+ZeitgeistTimeRange*
+zeitgeist_monitor_get_time_range (ZeitgeistMonitor *self)
+{
+ ZeitgeistMonitorPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_MONITOR (self), NULL);
+
+ priv = ZEITGEIST_MONITOR_GET_PRIVATE (self);
+ return priv->time_range;
+}
+
+GPtrArray*
+zeitgeist_monitor_get_templates (ZeitgeistMonitor *self)
+{
+ ZeitgeistMonitorPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_MONITOR (self), NULL);
+
+ priv = ZEITGEIST_MONITOR_GET_PRIVATE (self);
+ return priv->event_templates;
+}
+
+const gchar*
+zeitgeist_monitor_get_path (ZeitgeistMonitor *self)
+{
+ ZeitgeistMonitorPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_MONITOR (self), NULL);
+
+ priv = ZEITGEIST_MONITOR_GET_PRIVATE (self);
+ return priv->monitor_path;
+}
=== added file 'src/zeitgeist-monitor.h'
--- src/zeitgeist-monitor.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-monitor.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_MONITOR_H_
+#define _ZEITGEIST_MONITOR_H_
+
+#include <glib-object.h>
+#include <zeitgeist-timerange.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_MONITOR (zeitgeist_monitor_get_type())
+#define ZEITGEIST_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ZEITGEIST_TYPE_MONITOR, ZeitgeistMonitor))
+#define ZEITGEIST_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ZEITGEIST_TYPE_MONITOR, ZeitgeistMonitorClass))
+#define ZEITGEIST_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ZEITGEIST_TYPE_MONITOR, ZeitgeistMonitorClass))
+#define ZEITGEIST_IS_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ZEITGEIST_TYPE_MONITOR))
+#define ZEITGEIST_IS_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ZEITGEIST_TYPE_MONITOR))
+
+typedef struct _ZeitgeistMonitor ZeitgeistMonitor;
+typedef struct _ZeitgeistMonitorClass ZeitgeistMonitorClass;
+
+struct _ZeitgeistMonitorClass
+{
+ GObjectClass parent_class;
+
+ /*< signals >*/
+ void (*events_inserted) (ZeitgeistMonitor *self,
+ ZeitgeistTimeRange *time_range,
+ GPtrArray *events);
+
+ void (*events_deleted) (ZeitgeistMonitor *self,
+ ZeitgeistTimeRange *time_range,
+ GArray *event_ids);
+};
+
+
+struct _ZeitgeistMonitor
+{
+ GObject parent_instance;
+};
+
+GType zeitgeist_monitor_get_type ();
+
+ZeitgeistMonitor* zeitgeist_monitor_new (ZeitgeistTimeRange *time_range,
+ GPtrArray *event_templates);
+
+ZeitgeistTimeRange* zeitgeist_monitor_get_time_range (ZeitgeistMonitor *self);
+
+GPtrArray* zeitgeist_monitor_get_templates (ZeitgeistMonitor *self);
+
+const gchar* zeitgeist_monitor_get_path (ZeitgeistMonitor *self);
+
+G_END_DECLS
+
+#endif /* _ZEITGEIST_MONITOR_H_ */
=== added file 'src/zeitgeist-ontology-interpretations.h'
--- src/zeitgeist-ontology-interpretations.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-ontology-interpretations.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,914 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_ONTOLOGY_INTERPRETATIONS_H_
+#define _ZEITGEIST_ONTOLOGY_INTERPRETATIONS_H_
+
+/**
+ * SECTION:zeitgeist-ontology-interpretations
+ * @short_description: Helper macros for declaring interpretation types
+ * for both events and subjects
+ * @include: zeitgeist.h
+ *
+ *
+ */
+
+/* IMPORTANT: AUTO GENERATED CONTENT BELOW HERE */
+
+/**
+ * ZEITGEIST_NCAL_ALARM:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm</ulink>
+ *
+ * Provide a grouping of component properties that define an alarm.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_ALARM "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm"
+
+/**
+ * ZEITGEIST_NCAL_CALENDAR:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar</ulink>
+ *
+ * A calendar. Inspirations for this class can be traced to the VCALENDAR component defined in RFC 2445 sec. 4.4, but it may just as well be used to represent any kind of Calendar.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_CALENDAR "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar"
+
+/**
+ * ZEITGEIST_NCAL_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event</ulink>
+ *
+ * Provide a grouping of component properties that describe an event.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_EVENT "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event"
+
+/**
+ * ZEITGEIST_NCAL_FREEBUSY:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy</ulink>
+ *
+ * Provide a grouping of component properties that describe either a request for free/busy time, describe a response to a request for free/busy time or describe a published set of busy time.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_FREEBUSY "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy"
+
+/**
+ * ZEITGEIST_NCAL_JOURNAL:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal</ulink>
+ *
+ * Provide a grouping of component properties that describe a journal entry.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_JOURNAL "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal"
+
+/**
+ * ZEITGEIST_NCAL_TIMEZONE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone</ulink>
+ *
+ * Provide a grouping of component properties that defines a time zone.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_TIMEZONE "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone"
+
+/**
+ * ZEITGEIST_NCAL_TODO:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo</ulink>
+ *
+ * Provide a grouping of calendar properties that describe a to-do.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_TODO "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo"
+
+/**
+ * ZEITGEIST_NCO_CONTACT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact</ulink>
+ *
+ * A Contact. A piece of data that can provide means to identify or communicate with an entity.
+ *
+ * Children: #ZEITGEIST_NCO_PERSON_CONTACT, #ZEITGEIST_NCO_ORGANIZATION_CONTACT
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCO_CONTACT "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#Contact"
+
+/**
+ * ZEITGEIST_NCO_CONTACT_GROUP:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactGroup">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactGroup</ulink>
+ *
+ * A group of Contacts. Could be used to express a group in an addressbook or on a contact list of an IM application. One contact can belong to many groups.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCO_CONTACT_GROUP "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactGroup"
+
+/**
+ * ZEITGEIST_NCO_CONTACT_LIST:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactList">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactList</ulink>
+ *
+ * A contact list, this class represents an addressbook or a contact list of an IM application. Contacts inside a contact list can belong to contact groups.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCO_CONTACT_LIST "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactList"
+
+/**
+ * ZEITGEIST_NCO_ORGANIZATION_CONTACT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#OrganizationContact">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#OrganizationContact</ulink>
+ *
+ * A Contact that denotes on Organization.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NCO_CONTACT
+ */
+#define ZEITGEIST_NCO_ORGANIZATION_CONTACT "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#OrganizationContact"
+
+/**
+ * ZEITGEIST_NCO_PERSON_CONTACT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#PersonContact">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#PersonContact</ulink>
+ *
+ * A Contact that denotes a Person. A person can have multiple Affiliations.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NCO_CONTACT
+ */
+#define ZEITGEIST_NCO_PERSON_CONTACT "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#PersonContact"
+
+/**
+ * ZEITGEIST_NFO_APPLICATION:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application</ulink>
+ *
+ * An application.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_SOFTWARE
+ */
+#define ZEITGEIST_NFO_APPLICATION "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application"
+
+/**
+ * ZEITGEIST_NFO_ARCHIVE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive</ulink>
+ *
+ * A compressed file. May contain other files or folder inside.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DATA_CONTAINER
+ */
+#define ZEITGEIST_NFO_ARCHIVE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive"
+
+/**
+ * ZEITGEIST_NFO_AUDIO:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio</ulink>
+ *
+ * A file containing audio content.
+ *
+ * Children: #ZEITGEIST_NMM_MUSIC_PIECE
+ *
+ * Parents: #ZEITGEIST_NFO_MEDIA
+ */
+#define ZEITGEIST_NFO_AUDIO "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"
+
+/**
+ * ZEITGEIST_NFO_BOOKMARK:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark</ulink>
+ *
+ * A bookmark of a webbrowser. Use nie:title for the name/label, nie:contentCreated to represent the date when the user added the bookmark, and nie:contentLastModified for modifications. nfo:bookmarks to store the link.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_BOOKMARK "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"
+
+/**
+ * ZEITGEIST_NFO_BOOKMARK_FOLDER:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder</ulink>
+ *
+ * A folder with bookmarks of a webbrowser. Use nfo:containsBookmark to relate Bookmarks. Folders can contain subfolders, use containsBookmarkFolder to relate them.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_BOOKMARK_FOLDER "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder"
+
+/**
+ * ZEITGEIST_NFO_CURSOR:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor</ulink>
+ *
+ * A Cursor.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_RASTER_IMAGE
+ */
+#define ZEITGEIST_NFO_CURSOR "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor"
+
+/**
+ * ZEITGEIST_NFO_DATA_CONTAINER:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer</ulink>
+ *
+ * A superclass for all entities, whose primary purpose is to serve as containers for other data object. They usually don't have any "meaning" by themselves. Examples include folders, archives and optical disc images.
+ *
+ * Children: #ZEITGEIST_NFO_FILESYSTEM, #ZEITGEIST_NFO_ARCHIVE, #ZEITGEIST_NFO_FOLDER, #ZEITGEIST_NFO_TRASH
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_DATA_CONTAINER "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer"
+
+/**
+ * ZEITGEIST_NFO_DOCUMENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document</ulink>
+ *
+ * A generic document. A common superclass for all documents on the desktop.
+ *
+ * Children: #ZEITGEIST_NFO_TEXT_DOCUMENT, #ZEITGEIST_NFO_PRESENTATION, #ZEITGEIST_NFO_MIND_MAP, #ZEITGEIST_NFO_SPREADSHEET
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_DOCUMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"
+
+/**
+ * ZEITGEIST_NFO_EXECUTABLE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable</ulink>
+ *
+ * An executable file.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_EXECUTABLE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"
+
+/**
+ * ZEITGEIST_NFO_FILESYSTEM:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem</ulink>
+ *
+ * A filesystem. Examples of filesystems include hard disk partitions, removable media, but also images thereof stored in files such as ISO.
+ *
+ * Children: #ZEITGEIST_NFO_FILESYSTEM_IMAGE
+ *
+ * Parents: #ZEITGEIST_NFO_DATA_CONTAINER
+ */
+#define ZEITGEIST_NFO_FILESYSTEM "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem"
+
+/**
+ * ZEITGEIST_NFO_FILESYSTEM_IMAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage</ulink>
+ *
+ * An image of a filesystem. Instances of this class may include CD images, DVD images or hard disk partition images created by various pieces of software (e.g. Norton Ghost). Deprecated in favor of nfo:Filesystem.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_FILESYSTEM
+ */
+#define ZEITGEIST_NFO_FILESYSTEM_IMAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage"
+
+/**
+ * ZEITGEIST_NFO_FOLDER:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder</ulink>
+ *
+ * A folder/directory. Examples of folders include folders on a filesystem and message folders in a mailbox.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DATA_CONTAINER
+ */
+#define ZEITGEIST_NFO_FOLDER "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"
+
+/**
+ * ZEITGEIST_NFO_FONT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font</ulink>
+ *
+ * A font.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_FONT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"
+
+/**
+ * ZEITGEIST_NFO_HTML_DOCUMENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument</ulink>
+ *
+ * A HTML document, may contain links to other files.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT
+ */
+#define ZEITGEIST_NFO_HTML_DOCUMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument"
+
+/**
+ * ZEITGEIST_NFO_ICON:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon</ulink>
+ *
+ * An Icon (regardless of whether it's a raster or a vector icon. A resource representing an icon could have two types (Icon and Raster, or Icon and Vector) if required.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_IMAGE
+ */
+#define ZEITGEIST_NFO_ICON "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon"
+
+/**
+ * ZEITGEIST_NFO_IMAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image</ulink>
+ *
+ * A file containing an image.
+ *
+ * Children: #ZEITGEIST_NFO_ICON, #ZEITGEIST_NFO_VECTOR_IMAGE, #ZEITGEIST_NFO_RASTER_IMAGE
+ *
+ * Parents: #ZEITGEIST_NFO_VISUAL
+ */
+#define ZEITGEIST_NFO_IMAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"
+
+/**
+ * ZEITGEIST_NFO_MEDIA:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media</ulink>
+ *
+ * A piece of media content. This class may be used to express complex media containers with many streams of various media content (both aural and visual).
+ *
+ * Children: #ZEITGEIST_NFO_VISUAL, #ZEITGEIST_NFO_AUDIO
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_MEDIA "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media"
+
+/**
+ * ZEITGEIST_NFO_MEDIA_LIST:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList</ulink>
+ *
+ * A file containing a list of media files.e.g. a playlist.
+ *
+ * Children: #ZEITGEIST_NMM_MUSIC_ALBUM
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_MEDIA_LIST "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList"
+
+/**
+ * ZEITGEIST_NFO_MIND_MAP:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap</ulink>
+ *
+ * A MindMap, created by a mind-mapping utility. Examples might include FreeMind or mind mapper.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DOCUMENT
+ */
+#define ZEITGEIST_NFO_MIND_MAP "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap"
+
+/**
+ * ZEITGEIST_NFO_OPERATING_SYSTEM:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem</ulink>
+ *
+ * An OperatingSystem.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_SOFTWARE
+ */
+#define ZEITGEIST_NFO_OPERATING_SYSTEM "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem"
+
+/**
+ * ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument</ulink>
+ *
+ * A file containing a text document, that is unambiguously divided into pages. Examples might include PDF, DOC, PS, DVI etc.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_TEXT_DOCUMENT
+ */
+#define ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument"
+
+/**
+ * ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument</ulink>
+ *
+ * A file containing plain text (ASCII, Unicode or other encodings). Examples may include TXT, HTML, XML, program source code etc.
+ *
+ * Children: #ZEITGEIST_NFO_SOURCE_CODE, #ZEITGEIST_NFO_HTML_DOCUMENT
+ *
+ * Parents: #ZEITGEIST_NFO_TEXT_DOCUMENT
+ */
+#define ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument"
+
+/**
+ * ZEITGEIST_NFO_PRESENTATION:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation</ulink>
+ *
+ * A Presentation made by some presentation software (Corel Presentations, OpenOffice Impress, MS Powerpoint etc.).
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DOCUMENT
+ */
+#define ZEITGEIST_NFO_PRESENTATION "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"
+
+/**
+ * ZEITGEIST_NFO_RASTER_IMAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage</ulink>
+ *
+ * A raster image.
+ *
+ * Children: #ZEITGEIST_NFO_CURSOR
+ *
+ * Parents: #ZEITGEIST_NFO_IMAGE
+ */
+#define ZEITGEIST_NFO_RASTER_IMAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage"
+
+/**
+ * ZEITGEIST_NFO_SOFTWARE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software</ulink>
+ *
+ * A piece of software. Examples may include applications and the operating system. This interpretation most commonly applies to SoftwareItems.
+ *
+ * Children: #ZEITGEIST_NFO_APPLICATION, #ZEITGEIST_NFO_OPERATING_SYSTEM
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_SOFTWARE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"
+
+/**
+ * ZEITGEIST_NFO_SOURCE_CODE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode</ulink>
+ *
+ * Code in a compilable or interpreted programming language.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT
+ */
+#define ZEITGEIST_NFO_SOURCE_CODE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"
+
+/**
+ * ZEITGEIST_NFO_SPREADSHEET:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet</ulink>
+ *
+ * A spreadsheet, created by a spreadsheet application. Examples might include Gnumeric, OpenOffice Calc or MS Excel.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DOCUMENT
+ */
+#define ZEITGEIST_NFO_SPREADSHEET "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet"
+
+/**
+ * ZEITGEIST_NFO_TEXT_DOCUMENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument</ulink>
+ *
+ * A text document.
+ *
+ * Children: #ZEITGEIST_NFO_PAGINATED_TEXT_DOCUMENT, #ZEITGEIST_NFO_PLAIN_TEXT_DOCUMENT
+ *
+ * Parents: #ZEITGEIST_NFO_DOCUMENT
+ */
+#define ZEITGEIST_NFO_TEXT_DOCUMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"
+
+/**
+ * ZEITGEIST_NFO_TRASH:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash</ulink>
+ *
+ * Represents a container for deleted files, a feature common in modern operating systems.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_DATA_CONTAINER
+ */
+#define ZEITGEIST_NFO_TRASH "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash"
+
+/**
+ * ZEITGEIST_NFO_VECTOR_IMAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage</ulink>
+ *
+ * .
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_IMAGE
+ */
+#define ZEITGEIST_NFO_VECTOR_IMAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage"
+
+/**
+ * ZEITGEIST_NFO_VIDEO:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video</ulink>
+ *
+ * A video file.
+ *
+ * Children: #ZEITGEIST_NMM_TVSHOW, #ZEITGEIST_NMM_MOVIE
+ *
+ * Parents: #ZEITGEIST_NFO_VISUAL
+ */
+#define ZEITGEIST_NFO_VIDEO "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"
+
+/**
+ * ZEITGEIST_NFO_VISUAL:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual</ulink>
+ *
+ * File containing visual content.
+ *
+ * Children: #ZEITGEIST_NFO_IMAGE, #ZEITGEIST_NFO_VIDEO
+ *
+ * Parents: #ZEITGEIST_NFO_MEDIA
+ */
+#define ZEITGEIST_NFO_VISUAL "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual"
+
+/**
+ * ZEITGEIST_NFO_WEBSITE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website</ulink>
+ *
+ * A website, usually a container for remote resources, that may be interpreted as HTMLDocuments, images or other types of content.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_WEBSITE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website"
+
+/**
+ * ZEITGEIST_NMM_MOVIE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie">http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie</ulink>
+ *
+ * A Movie.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_VIDEO
+ */
+#define ZEITGEIST_NMM_MOVIE "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie"
+
+/**
+ * ZEITGEIST_NMM_MUSIC_ALBUM:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum">http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum</ulink>
+ *
+ * The music album as provided by the publisher. Not to be confused with media lists or collections.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_MEDIA_LIST
+ */
+#define ZEITGEIST_NMM_MUSIC_ALBUM "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum"
+
+/**
+ * ZEITGEIST_NMM_MUSIC_PIECE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece">http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece</ulink>
+ *
+ * Used to assign music-specific properties such a BPM to video and audio.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_AUDIO
+ */
+#define ZEITGEIST_NMM_MUSIC_PIECE "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece"
+
+/**
+ * ZEITGEIST_NMM_TVSERIES:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries">http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries</ulink>
+ *
+ * A TV Series has multiple seasons and episodes.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NMM_TVSERIES "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries"
+
+/**
+ * ZEITGEIST_NMM_TVSHOW:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow">http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow</ulink>
+ *
+ * A TV Show.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_VIDEO
+ */
+#define ZEITGEIST_NMM_TVSHOW "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow"
+
+/**
+ * ZEITGEIST_NMO_EMAIL:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email</ulink>
+ *
+ * An email.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NMO_MESSAGE
+ */
+#define ZEITGEIST_NMO_EMAIL "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"
+
+/**
+ * ZEITGEIST_NMO_IMMESSAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage</ulink>
+ *
+ * A message sent with Instant Messaging software.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NMO_MESSAGE
+ */
+#define ZEITGEIST_NMO_IMMESSAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage"
+
+/**
+ * ZEITGEIST_NMO_MAILBOX:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox</ulink>
+ *
+ * A mailbox - container for MailboxDataObjects.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NMO_MAILBOX "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox"
+
+/**
+ * ZEITGEIST_NMO_MESSAGE:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message</ulink>
+ *
+ * A message. Could be an email, instant messanging message, SMS message etc.
+ *
+ * Children: #ZEITGEIST_NMO_EMAIL, #ZEITGEIST_NMO_IMMESSAGE
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NMO_MESSAGE "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message"
+
+/**
+ * ZEITGEIST_NMO_MIME_ENTITY:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity</ulink>
+ *
+ * A MIME entity, as defined in RFC2045, Section 2.4.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NMO_MIME_ENTITY "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity"
+
+/**
+ * ZEITGEIST_ZG_ACCEPT_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AcceptEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AcceptEvent</ulink>
+ *
+ * Event triggered when the user accepts a request of some sort. Examples could be answering a phone call, accepting a file transfer, or accepting a friendship request over an IM protocol. See also DenyEvent for when the user denies a similar request.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_ACCEPT_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AcceptEvent"
+
+/**
+ * ZEITGEIST_ZG_ACCESS_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent</ulink>
+ *
+ * Event triggered by opening, accessing, or starting a resource. Most zg:AccessEvents will have an accompanying zg:LeaveEvent, but this need not always be the case.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_ACCESS_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent"
+
+/**
+ * ZEITGEIST_ZG_CREATE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent</ulink>
+ *
+ * Event type triggered when an item is created.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_CREATE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent"
+
+/**
+ * ZEITGEIST_ZG_DELETE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent</ulink>
+ *
+ * Event triggered because a resource has been deleted or otherwise made permanently unavailable. Fx. when deleting a file. FIXME: How about when moving to trash?.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_DELETE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent"
+
+/**
+ * ZEITGEIST_ZG_DENY_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DenyEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DenyEvent</ulink>
+ *
+ * Event triggered when the user denies a request of some sort. Examples could be rejecting a phone call, rejecting a file transfer, or denying a friendship request over an IM protocol. See also AcceptEvent for the converse event type.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_DENY_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DenyEvent"
+
+/**
+ * ZEITGEIST_ZG_EVENT_INTERPRETATION:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation</ulink>
+ *
+ * Base class for event interpretations. Please do no instantiate directly, but use one of the sub classes. The interpretation of an event describes 'what happened' - fx. 'something was created' or 'something was accessed'.
+ *
+ * Children: #ZEITGEIST_ZG_DENY_EVENT, #ZEITGEIST_ZG_ACCESS_EVENT, #ZEITGEIST_ZG_EXPIRE_EVENT, #ZEITGEIST_ZG_LEAVE_EVENT, #ZEITGEIST_ZG_CREATE_EVENT, #ZEITGEIST_ZG_MOVE_EVENT, #ZEITGEIST_ZG_ACCEPT_EVENT, #ZEITGEIST_ZG_SEND_EVENT, #ZEITGEIST_ZG_MODIFY_EVENT, #ZEITGEIST_ZG_DELETE_EVENT, #ZEITGEIST_ZG_RECEIVE_EVENT
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_ZG_EVENT_INTERPRETATION "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation"
+
+/**
+ * ZEITGEIST_ZG_EXPIRE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ExpireEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ExpireEvent</ulink>
+ *
+ * Event triggered when something expires or times out. These types of events are normally not triggered by the user, but by the operating system or some external party. Examples are a recurring calendar item or task deadline that expires or a when the user fails to respond to an external request such as a phone call.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_EXPIRE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ExpireEvent"
+
+/**
+ * ZEITGEIST_ZG_LEAVE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent</ulink>
+ *
+ * Event triggered by closing, leaving, or stopping a resource. Most zg:LeaveEvents will be following a zg:Access event, but this need not always be the case.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_LEAVE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent"
+
+/**
+ * ZEITGEIST_ZG_MODIFY_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent</ulink>
+ *
+ * Event triggered by modifying an existing resources. Fx. when editing and saving a file on disk or correcting a typo in the name of a contact.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_MODIFY_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent"
+
+/**
+ * ZEITGEIST_ZG_MOVE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#MoveEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#MoveEvent</ulink>
+ *
+ * Event triggered when a resource has been moved from a location to another. Fx. moving a file from a folder to another.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_MOVE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#MoveEvent"
+
+/**
+ * ZEITGEIST_ZG_RECEIVE_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent</ulink>
+ *
+ * Event triggered when something is received from an external party. The event manifestation must be set according to the world view of the receiving party. Most often the item that is being received will be some sort of message - an email, instant message, or broadcasted media such as micro blogging.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_RECEIVE_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent"
+
+/**
+ * ZEITGEIST_ZG_SEND_EVENT:
+ *
+ * Macro defining the interpretation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent</ulink>
+ *
+ * Event triggered when something is send to an external party. The event manifestation must be set according to the world view of the sending party. Most often the item that is being send will be some sort of message - an email, instant message, or broadcasted media such as micro blogging.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_INTERPRETATION
+ */
+#define ZEITGEIST_ZG_SEND_EVENT "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent"
+
+
+/* IMPORTANT: AUTO GENERATED CONTENT STOP */
+
+#endif /* _ZEITGEIST_ONTOLOGY_INTERPRETATIONS_H_ */
=== added file 'src/zeitgeist-ontology-manifestations.h'
--- src/zeitgeist-ontology-manifestations.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-ontology-manifestations.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,329 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_ONTOLOGY_MANIFESTATIONS_H_
+#define _ZEITGEIST_ONTOLOGY_MANIFESTATIONS_H_
+
+/**
+ * SECTION:zeitgeist-ontology-manifestations
+ * @short_description: Helper macros for declaring manifestation types
+ * for both events and subjects
+ * @include: zeitgeist.h
+ *
+ *
+ */
+
+/* IMPORTANT: AUTO GENERATED CONTENT BELOW HERE */
+
+/**
+ * ZEITGEIST_NCAL_ATTACHMENT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment</ulink>
+ *
+ * An object attached to a calendar entity. This class has been introduced to serve as a structured value of the ncal:attach property. See the documentation of ncal:attach for details.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_ATTACHMENT
+ */
+#define ZEITGEIST_NCAL_ATTACHMENT "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment"
+
+/**
+ * ZEITGEIST_NCAL_CALENDAR_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject">http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject</ulink>
+ *
+ * A DataObject found in a calendar. It is usually interpreted as one of the calendar entity types (e.g. Event, Journal, Todo etc.).
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCAL_CALENDAR_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject"
+
+/**
+ * ZEITGEIST_NCO_CONTACT_LIST_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactListDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactListDataObject</ulink>
+ *
+ * An entity occuring on a contact list (usually interpreted as an nco:Contact).
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NCO_CONTACT_LIST_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#ContactListDataObject"
+
+/**
+ * ZEITGEIST_NFO_ARCHIVE_ITEM:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem</ulink>
+ *
+ * A file entity inside an archive.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT
+ */
+#define ZEITGEIST_NFO_ARCHIVE_ITEM "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem"
+
+/**
+ * ZEITGEIST_NFO_ATTACHMENT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Attachment">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Attachment</ulink>
+ *
+ * A file attached to another data object. Many data formats allow for attachments: emails, vcards, ical events, id3 and exif.
+ *
+ * Children: #ZEITGEIST_NCAL_ATTACHMENT
+ *
+ * Parents: #ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT
+ */
+#define ZEITGEIST_NFO_ATTACHMENT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Attachment"
+
+/**
+ * ZEITGEIST_NFO_DELETED_RESOURCE:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource</ulink>
+ *
+ * A file entity that has been deleted from the original source. Usually such entities are stored within various kinds of 'Trash' or 'Recycle Bin' folders.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_FILE_DATA_OBJECT
+ */
+#define ZEITGEIST_NFO_DELETED_RESOURCE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource"
+
+/**
+ * ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject</ulink>
+ *
+ * A file embedded in another data object. There are many ways in which a file may be embedded in another one. Use this class directly only in cases if none of the subclasses gives a better description of your case.
+ *
+ * Children: #ZEITGEIST_NFO_ARCHIVE_ITEM, #ZEITGEIST_NFO_ATTACHMENT
+ *
+ * Parents: #ZEITGEIST_NFO_FILE_DATA_OBJECT
+ */
+#define ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject"
+
+/**
+ * ZEITGEIST_NFO_FILE_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject</ulink>
+ *
+ * A resource containing a finite sequence of bytes with arbitrary information, that is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished.
+ *
+ * Children: #ZEITGEIST_NFO_EMBEDDED_FILE_DATA_OBJECT, #ZEITGEIST_NFO_DELETED_RESOURCE, #ZEITGEIST_NFO_REMOTE_DATA_OBJECT
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_FILE_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject"
+
+/**
+ * ZEITGEIST_NFO_HARD_DISK_PARTITION:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition</ulink>
+ *
+ * A partition on a hard disk.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_HARD_DISK_PARTITION "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition"
+
+/**
+ * ZEITGEIST_NFO_MEDIA_STREAM:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream</ulink>
+ *
+ * A stream of multimedia content, usually contained within a media container such as a movie (containing both audio and video) or a DVD (possibly containing many streams of audio and video). Most common interpretations for such a DataObject include Audio and Video.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_MEDIA_STREAM "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream"
+
+/**
+ * ZEITGEIST_NFO_REMOTE_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject</ulink>
+ *
+ * A file data object stored at a remote location. Don't confuse this class with a RemotePortAddress. This one applies to a particular resource, RemotePortAddress applies to an address, that can have various interpretations.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_NFO_FILE_DATA_OBJECT
+ */
+#define ZEITGEIST_NFO_REMOTE_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject"
+
+/**
+ * ZEITGEIST_NFO_REMOTE_PORT_ADDRESS:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress</ulink>
+ *
+ * An address specifying a remote host and port. Such an address can be interpreted in many ways (examples of such interpretations include mailboxes, websites, remote calendars or filesystems), depending on an interpretation, various kinds of data may be extracted from such an address.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_REMOTE_PORT_ADDRESS "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress"
+
+/**
+ * ZEITGEIST_NFO_SOFTWARE_ITEM:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem</ulink>
+ *
+ * A DataObject representing a piece of software. Examples of interpretations of a SoftwareItem include an Application and an OperatingSystem.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_SOFTWARE_ITEM "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem"
+
+/**
+ * ZEITGEIST_NFO_SOFTWARE_SERVICE:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService</ulink>
+ *
+ * A service published by a piece of software, either by an operating system or an application. Examples of such services may include calendar, addressbook and mailbox managed by a PIM application. This category is introduced to distinguish between data available directly from the applications (Via some Interprocess Communication Mechanisms) and data available from files on a disk. In either case both DataObjects would receive a similar interpretation (e.g. a Mailbox) and wouldn't differ on the content level.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_SOFTWARE_SERVICE "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService"
+
+/**
+ * ZEITGEIST_NFO_WEB_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#WebDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#WebDataObject</ulink>
+ *
+ * An information resources of which representations (files, streams) can be retrieved through a web server. They may be generated at retrieval time. Typical examples are pages served by PHP or AJAX or mp3 streams.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NFO_WEB_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#WebDataObject"
+
+/**
+ * ZEITGEIST_NMO_MAILBOX_DATA_OBJECT:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject">http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject</ulink>
+ *
+ * An entity encountered in a mailbox. Most common interpretations for such an entity include Message or Folder.
+ *
+ * Children: None
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_NMO_MAILBOX_DATA_OBJECT "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject"
+
+/**
+ * ZEITGEIST_ZG_EVENT_MANIFESTATION:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation</ulink>
+ *
+ * Base class for event manifestation types. Please do no instantiate directly, but use one of the sub classes. The manifestation of an event describes 'how it happened'. Fx. 'the user did this' or 'the system notified the user'.
+ *
+ * Children: #ZEITGEIST_ZG_USER_ACTIVITY, #ZEITGEIST_ZG_SYSTEM_NOTIFICATION, #ZEITGEIST_ZG_HEURISTIC_ACTIVITY, #ZEITGEIST_ZG_SCHEDULED_ACTIVITY, #ZEITGEIST_ZG_WORLD_ACTIVITY
+ *
+ * Parents: None
+ */
+#define ZEITGEIST_ZG_EVENT_MANIFESTATION "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation"
+
+/**
+ * ZEITGEIST_ZG_HEURISTIC_ACTIVITY:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity</ulink>
+ *
+ * An event that is caused indirectly from user activity or deducted via analysis of other events. Fx. if an algorithm divides a user workflow into disjoint 'projects' based on temporal analysis it could insert heuristic events when the user changed project.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_MANIFESTATION
+ */
+#define ZEITGEIST_ZG_HEURISTIC_ACTIVITY "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity"
+
+/**
+ * ZEITGEIST_ZG_SCHEDULED_ACTIVITY:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity</ulink>
+ *
+ * An event that was directly triggered by some user initiated sequence of actions. For example a music player automatically changing to the next song in a playlist.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_MANIFESTATION
+ */
+#define ZEITGEIST_ZG_SCHEDULED_ACTIVITY "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity"
+
+/**
+ * ZEITGEIST_ZG_SYSTEM_NOTIFICATION:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification</ulink>
+ *
+ * An event send to the user by the operating system. Examples could include when the user inserts a USB stick or when the system warns that the hard disk is full.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_MANIFESTATION
+ */
+#define ZEITGEIST_ZG_SYSTEM_NOTIFICATION "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification"
+
+/**
+ * ZEITGEIST_ZG_USER_ACTIVITY:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity</ulink>
+ *
+ * An event that was actively performed by the user. For example saving or opening a file by clicking on it in the file manager.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_MANIFESTATION
+ */
+#define ZEITGEIST_ZG_USER_ACTIVITY "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity"
+
+/**
+ * ZEITGEIST_ZG_WORLD_ACTIVITY:
+ *
+ * Macro defining the manifestation type <ulink url="http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity">http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity</ulink>
+ *
+ * An event that was performed by an entity, usually human or organization, other than the user. An example could be logging the activities of other people in a team.
+ *
+ * Children: None
+ *
+ * Parents: #ZEITGEIST_ZG_EVENT_MANIFESTATION
+ */
+#define ZEITGEIST_ZG_WORLD_ACTIVITY "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity"
+
+
+/* IMPORTANT: AUTO GENERATED CONTENT STOP */
+
+#endif /* _ZEITGEIST_ONTOLOGY_MANIFESTATIONS_H_ */
=== added file 'src/zeitgeist-result-set.c'
--- src/zeitgeist-result-set.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-result-set.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,218 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by:
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+/**
+ * SECTION:zeitgeist-result-set
+ * @short_description: Cursor-like interface for results sets
+ * @include: zeitgeist.h
+ *
+ * Interface for results returned by zeitgeist_log_find_events(),
+ * zeitgeist_log_get_events(), and zeitgeist_index_search().
+ *
+ * This interface utilizes a cursor-like metaphor. You advance the cursor
+ * by calling zeitgeist_result_set_next() or adjust it manually by calling
+ * zeitgeist_result_set_seek().
+ *
+ * Calling zeitgeist_result_set_next() will also return the event at the
+ * current cursor position. You may retrieve the current event without advancing
+ * the cursor by calling zeitgeist_result_set_peek().
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-result-set.h"
+
+typedef ZeitgeistResultSetIface ZeitgeistResultSetInterface;
+G_DEFINE_INTERFACE (ZeitgeistResultSet, zeitgeist_result_set, G_TYPE_OBJECT)
+
+enum
+{
+ /* Public signals */
+
+ ZEITGEIST_RESULT_SET_LAST_SIGNAL
+};
+
+static void
+zeitgeist_result_set_default_init (ZeitgeistResultSetInterface *klass)
+{
+
+}
+
+/**
+ * zeitgeist_result_set_size:
+ * @self: The #ZeitgeistResultSet to get the size of
+ *
+ * Get the number of #ZeitgeistEvent<!-- -->s held in a #ZeitgeistResultSet.
+ * Unlike the number obtained from zeitgeist_result_set_estimated_matches() the
+ * size of the result set is always equal to the number of times you can call
+ * zeitgeist_result_set_next().
+ *
+ * Returns: The number of events held in the result set
+ */
+guint
+zeitgeist_result_set_size (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), 0);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->size) (self);
+}
+
+/**
+ * zeitgeist_result_set_estimated_matches:
+ * @self: The #ZeitgeistResultSet to get the number of estimated matches on
+ *
+ * Get an estimated total number of matches that would have been for the query
+ * that generated the result set had it not been restricted in size.
+ *
+ * For zeitgeist_log_find_events() and zeitgeist_log_get_events() this will
+ * always be the same as zeitgeist_result_set_size(). For cases like
+ * zeitgeist_index_search() where you specify a subset of the hits to retrieve
+ * the estimated match count will often be bigger than the result set size.
+ *
+ * Returns: The number of events that matched the query
+ */
+guint
+zeitgeist_result_set_estimated_matches (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), 0);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->estimated_matches) (self);
+}
+
+/**
+ * zeitgeist_result_set_next:
+ * @self: The #ZeitgeistResultSet to get an event from
+ *
+ * Get the current event from the result set and advance the cursor.
+ * To ensure that calls to this method will succeed you can call
+ * zeitgeist_result_set_has_next().
+ *
+ * To retrieve the current event without advancing the cursor call
+ * zeitgeist_result_set_peek() in stead of this method.
+ *
+ * Returns: The #ZeitgeistEvent at the current cursor position
+ */
+ZeitgeistEvent*
+zeitgeist_result_set_next (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), NULL);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->next) (self);
+}
+
+/**
+ * zeitgeist_result_set_has_next:
+ * @self: The #ZeitgeistResultSet to check
+ *
+ * Check if a call to zeitgeist_result_set_next() will succeed.
+ *
+ * Returns: %TRUE if and only if more events can be retrieved by calling
+ * zeitgeist_result_set_next()
+ */
+gboolean
+zeitgeist_result_set_has_next (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), FALSE);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->has_next) (self);
+}
+
+/**
+ * zeitgeist_result_set_peek:
+ * @self: The #ZeitgeistResultSet to get an event from
+ *
+ * Get the event at the current cursor position.
+ *
+ * To retrieve the current event and advance the cursor position call
+ * zeitgeist_result_set_next() in stead of this method.
+ *
+ * Returns: The #ZeitgeistEvent at the current cursor position
+ */
+ZeitgeistEvent*
+zeitgeist_result_set_peek (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), NULL);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->peek) (self);
+}
+
+/**
+ * zeitgeist_result_set_seek:
+ * @self: The #ZeitgeistResultSet to seek in
+ * @pos: The position to seek to
+ *
+ * Set the cursor position. Following calls to zeitgeist_result_set_peek()
+ * or zeitgeist_result_set_next() will read the event at position @pos.
+ */
+void
+zeitgeist_result_set_seek (ZeitgeistResultSet *self,
+ guint pos)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_if_fail (ZEITGEIST_IS_RESULT_SET (self));
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ (* iface->seek) (self, pos);
+}
+
+/**
+ * zeitgeist_result_set_tell:
+ * @self: The #ZeitgeistResultSet to check the cursor position for
+ *
+ * Get the current position of the cursor.
+ *
+ * Returns: The current position of the cursor
+ */
+guint
+zeitgeist_result_set_tell (ZeitgeistResultSet *self)
+{
+ ZeitgeistResultSetIface *iface;
+
+ g_return_val_if_fail (ZEITGEIST_IS_RESULT_SET (self), 0);
+
+ iface = ZEITGEIST_RESULT_SET_GET_IFACE (self);
+
+ return (* iface->tell) (self);
+}
=== added file 'src/zeitgeist-result-set.h'
--- src/zeitgeist-result-set.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-result-set.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_RESULT_SET_H_
+#define _ZEITGEIST_RESULT_SET_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <zeitgeist-event.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_RESULT_SET (zeitgeist_result_set_get_type ())
+
+#define ZEITGEIST_RESULT_SET(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZEITGEIST_TYPE_RESULT_SET, ZeitgeistResultSet))
+
+#define ZEITGEIST_IS_RESULT_SET(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZEITGEIST_TYPE_RESULT_SET))
+
+#define ZEITGEIST_RESULT_SET_GET_IFACE(obj) \
+ (G_TYPE_INSTANCE_GET_INTERFACE(obj, zeitgeist_result_set_get_type (), ZeitgeistResultSetIface))
+
+typedef struct _ZeitgeistResultSetIface ZeitgeistResultSetIface;
+typedef struct _ZeitgeistResultSet ZeitgeistResultSet;
+
+
+struct _ZeitgeistResultSetIface
+{
+ GTypeInterface g_iface;
+
+ /*< public >*/
+ guint (*size) (ZeitgeistResultSet *self);
+
+ guint (*estimated_matches) (ZeitgeistResultSet *self);
+
+ ZeitgeistEvent* (*next) (ZeitgeistResultSet *self);
+
+ gboolean (*has_next) (ZeitgeistResultSet *self);
+
+ ZeitgeistEvent* (*peek) (ZeitgeistResultSet *self);
+
+ void (*seek) (ZeitgeistResultSet *self,
+ guint pos);
+
+ guint (*tell) (ZeitgeistResultSet *self);
+};
+
+GType zeitgeist_result_set_get_type (void) G_GNUC_CONST;
+
+guint zeitgeist_result_set_size (ZeitgeistResultSet *self);
+
+guint zeitgeist_result_set_estimated_matches (ZeitgeistResultSet *self);
+
+ZeitgeistEvent* zeitgeist_result_set_next (ZeitgeistResultSet *self);
+
+gboolean zeitgeist_result_set_has_next (ZeitgeistResultSet *self);
+
+ZeitgeistEvent* zeitgeist_result_set_peek (ZeitgeistResultSet *self);
+
+void zeitgeist_result_set_seek (ZeitgeistResultSet *self,
+ guint pos);
+
+guint zeitgeist_result_set_tell (ZeitgeistResultSet *self);
+
+#define _vala_zeitgeist_result_set_next_value(rs) (zeitgeist_result_set_has_next(rs) ? zeitgeist_result_set_next(rs) : NULL)
+#define _vala_zeitgeist_result_set_iterator(rs) ((ZeitgeistResultSet*)g_object_ref(rs))
+
+G_END_DECLS
+
+#endif /* _HAVE_ZEITGEIST_RESULT_SET_H */
=== added file 'src/zeitgeist-simple-result-set.c'
--- src/zeitgeist-simple-result-set.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-simple-result-set.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by:
+ * Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+/**
+ * SECTION:zeitgeist-simple-result-set
+ * @short_description: Internal API do not use
+ *
+ * Simple implementation of a #ZeitgeistResultSet on top of a #GptrArray
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "zeitgeist-simple-result-set.h"
+
+static void zeitgeist_simple_result_set_result_set_iface_init (ZeitgeistResultSetIface *iface);
+G_DEFINE_TYPE_WITH_CODE (ZeitgeistSimpleResultSet,
+ zeitgeist_simple_result_set,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (ZEITGEIST_TYPE_RESULT_SET,
+ zeitgeist_simple_result_set_result_set_iface_init))
+
+#define ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE(obj, ZEITGEIST_TYPE_SIMPLE_RESULT_SET, ZeitgeistSimpleResultSetPrivate))
+
+typedef struct
+{
+ GPtrArray *events;
+ guint estimated_matches;
+ guint cursor;
+} ZeitgeistSimpleResultSetPrivate;
+
+/* GObject Init */
+static void
+zeitgeist_simple_result_set_finalize (GObject *object)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (object);
+
+ if (priv->events)
+ g_ptr_array_unref (priv->events);
+
+ G_OBJECT_CLASS (zeitgeist_simple_result_set_parent_class)->finalize (object);
+}
+
+static void
+zeitgeist_simple_result_set_class_init (ZeitgeistSimpleResultSetClass *klass)
+{
+ GObjectClass *obj_class = G_OBJECT_CLASS (klass);
+
+ obj_class->finalize = zeitgeist_simple_result_set_finalize;
+
+ /* Add private data */
+ g_type_class_add_private (obj_class, sizeof (ZeitgeistSimpleResultSetPrivate));
+}
+
+static void
+zeitgeist_simple_result_set_init (ZeitgeistSimpleResultSet *self)
+{
+
+}
+
+static guint
+zeitgeist_simple_result_set_size (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), 0);
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ return priv->events->len;
+}
+
+static guint
+zeitgeist_simple_result_set_estimated_matches (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), 0);
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ return priv->estimated_matches;
+}
+
+static ZeitgeistEvent*
+zeitgeist_simple_result_set_next (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+ ZeitgeistEvent *next;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), NULL);
+ g_return_val_if_fail (zeitgeist_result_set_has_next (self), NULL);
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ next = zeitgeist_result_set_peek (self);
+ priv->cursor++;
+ return next;
+}
+
+static gboolean
+zeitgeist_simple_result_set_has_next (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+ ZeitgeistEvent *next;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), FALSE);
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ return priv->cursor < priv->events->len;
+}
+
+static ZeitgeistEvent*
+zeitgeist_simple_result_set_peek (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+ ZeitgeistEvent *next;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), NULL);
+
+ /* Invariant: priv->cursor < priv->events->len. Ensured by next() */
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ return ZEITGEIST_EVENT (g_ptr_array_index (priv->events, priv->cursor));
+}
+
+static void
+zeitgeist_simple_result_set_seek (ZeitgeistResultSet *self,
+ guint pos)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+ ZeitgeistEvent *next;
+
+ g_return_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self));
+ g_return_if_fail (pos < zeitgeist_result_set_size (self));
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ priv->cursor = pos;
+}
+
+static guint
+zeitgeist_simple_result_set_tell (ZeitgeistResultSet *self)
+{
+ ZeitgeistSimpleResultSetPrivate *priv;
+
+ g_return_val_if_fail (ZEITGEIST_IS_SIMPLE_RESULT_SET (self), 0);
+
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ return priv->cursor;
+}
+
+static void
+zeitgeist_simple_result_set_result_set_iface_init (ZeitgeistResultSetIface *iface)
+{
+ iface->size = zeitgeist_simple_result_set_size;
+ iface->estimated_matches = zeitgeist_simple_result_set_estimated_matches;
+ iface->next = zeitgeist_simple_result_set_next;
+ iface->has_next = zeitgeist_simple_result_set_has_next;
+ iface->peek = zeitgeist_simple_result_set_peek;
+ iface->seek = zeitgeist_simple_result_set_seek;
+ iface->tell = zeitgeist_simple_result_set_tell;
+}
+
+/* Internal constructor. Steals the ref to @events */
+ZeitgeistResultSet*
+_zeitgeist_simple_result_set_new (GPtrArray *events,
+ guint estimated_matches)
+{
+ GObject *self;
+ ZeitgeistSimpleResultSetPrivate *priv;
+
+ self = g_object_new (ZEITGEIST_TYPE_SIMPLE_RESULT_SET, NULL);
+ priv = ZEITGEIST_SIMPLE_RESULT_SET_GET_PRIVATE (self);
+ priv->events = events;
+ priv->estimated_matches = estimated_matches;
+
+ return (ZeitgeistResultSet*)self;
+}
=== added file 'src/zeitgeist-simple-result-set.h'
--- src/zeitgeist-simple-result-set.h 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-simple-result-set.h 2012-02-02 12:33:19 +0000
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2009 Canonical, Ltd.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.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, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xxxxxxxxxxxxx>
+ */
+
+#if !defined (_ZEITGEIST_H_INSIDE_) && !defined (ZEITGEIST_COMPILATION)
+#error "Only <zeitgeist.h> can be included directly."
+#endif
+
+#ifndef _ZEITGEIST_SIMPLE_RESULT_SET_H_
+#define _ZEITGEIST_SIMPLE_RESULT_SET_H_
+
+#include <glib.h>
+#include <glib-object.h>
+#include <zeitgeist-event.h>
+#include <zeitgeist-result-set.h>
+
+G_BEGIN_DECLS
+
+#define ZEITGEIST_TYPE_SIMPLE_RESULT_SET (zeitgeist_simple_result_set_get_type ())
+
+#define ZEITGEIST_SIMPLE_RESULT_SET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ ZEITGEIST_TYPE_SIMPLE_RESULT_SET, ZeitgeistSimpleResultSet))
+
+#define ZEITGEIST_SIMPLE_RESULT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ ZEITGEIST_TYPE_SIMPLE_RESULT_SET, ZeitgeistSimpleResultSetClass))
+
+#define ZEITGEIST_IS_SIMPLE_RESULT_SET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ ZEITGEIST_TYPE_SIMPLE_RESULT_SET))
+
+#define ZEITGEIST_IS_SIMPLE_RESULT_SET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ ZEITGEIST_TYPE_SIMPLE_RESULT_SET))
+
+#define ZEITGEIST_SIMPLE_RESULT_SET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ ZEITGEIST_TYPE_SIMPLE_RESULT_SET, ZeitgeistSimpleResultSetClass))
+
+typedef struct _ZeitgeistSimpleResultSet ZeitgeistSimpleResultSet;
+typedef struct _ZeitgeistSimpleResultSetClass ZeitgeistSimpleResultSetClass;
+
+struct _ZeitgeistSimpleResultSet
+{
+ GObject parent_instance;
+};
+
+struct _ZeitgeistSimpleResultSetClass
+{
+ GObjectClass parent_class;
+};
+
+ZeitgeistResultSet* _zeitgeist_simple_result_set_new (GPtrArray *events,
+ guint estimated_matches);
+
+G_END_DECLS
+
+#endif /* _HAVE_ZEITGEIST_RESULT_SET_H */
=== added file 'src/zeitgeist-subject.c'
--- src/zeitgeist-subject.c 1970-01-01 00:00:00 +0000
+++ src/zeitgeist-subject.c 2012-02-02 12:33:19 +0000
@@ -0,0 +1