Merge lp:~manishsinha/zeitgeist-datasources/add-ff-36-support-bug-775817 into lp:zeitgeist-datasources/0.8

Status: Merged
Merged at revision: 134
Proposed branch: lp:~manishsinha/zeitgeist-datasources/add-ff-36-support-bug-775817
Merge into: lp:zeitgeist-datasources/0.8
Diff against target: 2623 lines (+1584/-749)
41 files modified
configure.ac (+35/-13)
firefox-36-libzg/Makefile.am (+15/-0)
firefox-36-libzg/README (+43/-0)
firefox-36-libzg/extension/Makefile.am (+42/-0)
firefox-36-libzg/extension/chrome.manifest (+2/-0)
firefox-36-libzg/extension/chrome/content/zeitgeist.xul (+164/-0)
firefox-36-libzg/extension/components/Makefile.am (+60/-0)
firefox-36-libzg/extension/components/ZeitgeistComponent.cpp (+39/-0)
firefox-36-libzg/extension/components/ZeitgeistModule.cpp (+86/-0)
firefox-36-libzg/extension/components/zeitgeist.idl (+30/-0)
firefox-36-libzg/extension/components/zeitgeistextend.h (+45/-0)
firefox-36-libzg/extension/defaults/preferences/zeitgeist.js (+2/-0)
firefox-36-libzg/extension/install.rdf (+28/-0)
firefox-36-libzg/extension/license.txt (+166/-0)
firefox-40-libzg/Makefile.am (+16/-0)
firefox-40-libzg/README (+43/-0)
firefox-40-libzg/extension/Makefile.am (+42/-0)
firefox-40-libzg/extension/chrome.manifest (+4/-0)
firefox-40-libzg/extension/chrome/content/zeitgeist.xul (+164/-0)
firefox-40-libzg/extension/components/Makefile.am (+60/-0)
firefox-40-libzg/extension/components/ZeitgeistComponent.cpp (+50/-0)
firefox-40-libzg/extension/components/ZeitgeistModule.cpp (+86/-0)
firefox-40-libzg/extension/components/zeitgeist.h (+91/-0)
firefox-40-libzg/extension/components/zeitgeist.idl (+30/-0)
firefox-40-libzg/extension/components/zeitgeistextend.h (+45/-0)
firefox-40-libzg/extension/defaults/preferences/zeitgeist.js (+2/-0)
firefox-40-libzg/extension/install.rdf (+28/-0)
firefox-40-libzg/extension/license.txt (+166/-0)
firefox-libzg/Makefile.am (+0/-16)
firefox-libzg/README (+0/-43)
firefox-libzg/extension/Makefile.am (+0/-42)
firefox-libzg/extension/chrome.manifest (+0/-4)
firefox-libzg/extension/chrome/content/zeitgeist.xul (+0/-164)
firefox-libzg/extension/components/Makefile.am (+0/-60)
firefox-libzg/extension/components/ZeitgeistComponent.cpp (+0/-50)
firefox-libzg/extension/components/ZeitgeistModule.cpp (+0/-86)
firefox-libzg/extension/components/zeitgeist.idl (+0/-30)
firefox-libzg/extension/components/zeitgeistextend.h (+0/-45)
firefox-libzg/extension/defaults/preferences/zeitgeist.js (+0/-2)
firefox-libzg/extension/install.rdf (+0/-28)
firefox-libzg/extension/license.txt (+0/-166)
To merge this branch: bzr merge lp:~manishsinha/zeitgeist-datasources/add-ff-36-support-bug-775817
Reviewer Review Type Date Requested Status
Artem (community) Approve
Zeitgeist Data-Sources Team Pending
Review via email: mp+59704@code.launchpad.net

Description of the change

Added support for Firefox 3.6

The firefox 3.6 dataprovider is given the name firefox-36-libzg
and it needs xulrunner-1.92-dev to build

Steps
./autogen.sh
make

then test local install by
$ cd firefox-36-libzg
$ make local-install

Open firefox 3.6 to test
if works then
$ make local-uninstall

Then check system-wide install
$ sudo make install

Then open browser and check if it works. If it works then

$ sudo make uninstall

To post a comment you must log in.
133. By Manish Sinha (मनीष सिन्हा)

Bumped the version number of Firefox 3.6 dataprovider from 0.1 to 0.3

Revision history for this message
Artem (leipreachan) wrote :

Hi Manish
Please fix configure.ac. Currently it asks for "libxul >= 1.92" where libxul is 1.9.2.* now.

Thanks

Revision history for this message
Artem (leipreachan) wrote :

I've changed
PKG_CHECK_MODULES(LIBXUL_1_92, libxul >= 1.92,
to
PKG_CHECK_MODULES(LIBXUL_1_9_2, [libxul >= 1.9.2 libxul < 2.0],

now make fails with the following listing

make[4]: Entering directory `/home/nzr/workspaces/build/add-ff-36-support-bug-775817/firefox-36-libzg/extension/components'
  CXX libzeitgeist_xpcom_la-ZeitgeistComponent.lo
cc1plus: fatal error: xpcom-config.h: No such file or directory
compilation terminated.

thanks

134. By Manish Sinha (मनीष सिन्हा)

Fixed the macro which detects the presence of xul >= 1.9.2 and xul < 2.0

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I hope this would fix the issues.

Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote :

I tested it on my desktop and laptop. Works on both of them

Revision history for this message
Artem (leipreachan) wrote :

I tested against 3.6.17.
Everything is okay.

Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2011-05-02 18:28:16 +0000
+++ configure.ac 2011-05-03 18:52:25 +0000
@@ -65,7 +65,7 @@
65AC_MSG_NOTICE([Requested to enable all plugins: ${all_plugins}])65AC_MSG_NOTICE([Requested to enable all plugins: ${all_plugins}])
6666
67# The full list of plugins67# The full list of plugins
68allowed_plugins="bzr chrome eog geany vim emacs tomboy telepathy xchat firefox-libzg"68allowed_plugins="bzr chrome eog geany vim emacs tomboy telepathy xchat firefox-40-libzg firefox-36-libzg"
69# currently disabled = "epiphany"69# currently disabled = "epiphany"
7070
71# npapi-plugin has a template Makefile.am, but don't use it directly71# npapi-plugin has a template Makefile.am, but don't use it directly
@@ -107,7 +107,7 @@
107 # not supported atm107 # not supported atm
108 continue108 continue
109 ;;109 ;;
110 firefox-libzg)110 firefox-40-libzg)
111 if test "${HAVE_LIBZG}" != "yes" ; then111 if test "${HAVE_LIBZG}" != "yes" ; then
112 plugin_error_or_ignore "libzeitgeist not found"112 plugin_error_or_ignore "libzeitgeist not found"
113 continue113 continue
@@ -115,7 +115,7 @@
115 PKG_CHECK_MODULES(LIBXUL_2_0, libxul >= 2.0,115 PKG_CHECK_MODULES(LIBXUL_2_0, libxul >= 2.0,
116 [HAVE_LIBXUL=yes], [HAVE_LIBXUL=no])116 [HAVE_LIBXUL=yes], [HAVE_LIBXUL=no])
117 if test "${HAVE_LIBXUL}" != "yes" ; then117 if test "${HAVE_LIBXUL}" != "yes" ; then
118 plugin_error_or_ignore "libxul 2.0+ not found"118 plugin_error_or_ignore "libxul 2.0+ for firefox-40-libzg not found"
119 continue119 continue
120 fi120 fi
121 XPIDL_BIN="`$PKG_CONFIG --variable=sdkdir libxul`/bin/xpidl"121 XPIDL_BIN="`$PKG_CONFIG --variable=sdkdir libxul`/bin/xpidl"
@@ -124,15 +124,31 @@
124 AC_SUBST(XUL_IDLDIR)124 AC_SUBST(XUL_IDLDIR)
125 AC_DEFINE(MOZ_NO_MOZALLOC, ["For Mozilla Firefox 4"])125 AC_DEFINE(MOZ_NO_MOZALLOC, ["For Mozilla Firefox 4"])
126 ;;126 ;;
127 firefox-36-libzg)
128 if test "${HAVE_LIBZG}" != "yes" ; then
129 plugin_error_or_ignore "libzeitgeist not found"
130 continue
131 fi
132 PKG_CHECK_MODULES(LIBXUL_1_9_2, [libxul >= 1.9.2 libxul < 2.0],
133 [HAVE_LIBXUL=yes], [HAVE_LIBXUL=no])
134 if test "${HAVE_LIBXUL}" != "yes" ; then
135 plugin_error_or_ignore "libxul 1.92 for firefox-36-libzg not found"
136 continue
137 fi
138 XPIDL_BIN="`$PKG_CONFIG --variable=sdkdir libxul`/bin/xpidl"
139 AC_SUBST(XPIDL_BIN)
140 XUL_IDLDIR="`$PKG_CONFIG --variable=idldir libxul`"
141 AC_SUBST(XUL_IDLDIR)
142 ;;
127 geany)143 geany)
128 if test "${HAVE_LIBZG}" != "yes" ; then144 if test "${HAVE_LIBZG}" != "yes" ; then
129 plugin_error_or_ignore "libzeitgeist not found"145 plugin_error_or_ignore "libzeitgeist not found"
130 continue146 continue
131 fi147 fi
132 if test "x$HAVE_GTK" = "xno"; then148 if test "x$HAVE_GTK" = "xno"; then
133 plugin_error_or_ignore "You need to install gtk development headers"149 plugin_error_or_ignore "You need to install gtk development headers"
134 continue150 continue
135 fi151 fi
136 PKG_CHECK_MODULES(GEANY, geany,152 PKG_CHECK_MODULES(GEANY, geany,
137 [HAVE_GEANY=yes], [HAVE_GEANY=no])153 [HAVE_GEANY=yes], [HAVE_GEANY=no])
138 if test "${HAVE_GEANY}" != "yes" ; then154 if test "${HAVE_GEANY}" != "yes" ; then
@@ -140,8 +156,6 @@
140 continue156 continue
141 fi157 fi
142 ;;158 ;;
143 gedit)
144 ;;
145 npapi-plugin)159 npapi-plugin)
146 if test "${HAVE_LIBZG}" != "yes" ; then160 if test "${HAVE_LIBZG}" != "yes" ; then
147 plugin_error_or_ignore "libzeitgeist not found"161 plugin_error_or_ignore "libzeitgeist not found"
@@ -155,7 +169,7 @@
155 PKG_CHECK_MODULES(ZEITGEIST_SHARP, zeitgeist-sharp,169 PKG_CHECK_MODULES(ZEITGEIST_SHARP, zeitgeist-sharp,
156 ENABLE_ZEITGEIST_SHARP=yes, ENABLE_ZEITGEIST_SHARP=no)170 ENABLE_ZEITGEIST_SHARP=yes, ENABLE_ZEITGEIST_SHARP=no)
157 PKG_CHECK_MODULES(TOMBOY_ADDINS, tomboy-addins,171 PKG_CHECK_MODULES(TOMBOY_ADDINS, tomboy-addins,
158 HAS_TOMBOY_ADDINS=yes, HAS_TOMBOY_ADDINS=no)172 HAS_TOMBOY_ADDINS=yes, HAS_TOMBOY_ADDINS=no)
159 PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0, 173 PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0,
160 HAS_GTK_SHARP=yes, GTK_SHARP=no)174 HAS_GTK_SHARP=yes, GTK_SHARP=no)
161 if test "${ENABLE_ZEITGEIST_SHARP}" = "no" ; then175 if test "${ENABLE_ZEITGEIST_SHARP}" = "no" ; then
@@ -243,11 +257,19 @@
243 AC_CONFIG_FILES([eog/Makefile])257 AC_CONFIG_FILES([eog/Makefile])
244 continue 2258 continue 2
245 ;;259 ;;
246 firefox-libzg)260 firefox-40-libzg)
247 AC_CONFIG_FILES([261 AC_CONFIG_FILES([
248 firefox-libzg/Makefile262 firefox-40-libzg/Makefile
249 firefox-libzg/extension/Makefile263 firefox-40-libzg/extension/Makefile
250 firefox-libzg/extension/components/Makefile264 firefox-40-libzg/extension/components/Makefile
265 ])
266 continue 2
267 ;;
268 firefox-36-libzg)
269 AC_CONFIG_FILES([
270 firefox-36-libzg/Makefile
271 firefox-36-libzg/extension/Makefile
272 firefox-36-libzg/extension/components/Makefile
251 ])273 ])
252 continue 2274 continue 2
253 ;;275 ;;
254276
=== added directory 'firefox-36-libzg'
=== added file 'firefox-36-libzg/Makefile.am'
--- firefox-36-libzg/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,15 @@
1SUBDIRS = extension
2
3# identifier for the FF profile in which 'make install' installs this extension
4TARGET_PROFILE = *default*
5
6local-install: all
7 $(MAKE) -C extension $@
8 cd ~/.mozilla/firefox/$(TARGET_PROFILE)/ && mkdir -p extensions
9 cp ZeitgeistDataprovider.xpi ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions
10
11local-uninstall:
12 $(MAKE) -C extension $@
13 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/xpcom_firefox\@zeitgeist-project.com
14 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/ZeitgeistDataprovider.xpi
15
016
=== added file 'firefox-36-libzg/README'
--- firefox-36-libzg/README 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/README 2011-05-03 18:52:25 +0000
@@ -0,0 +1,43 @@
1Links
2=====
3
4Code is based on:
5 http://www.ibm.com/developerworks/opensource/library/os-xpcomfirefox/index.html
6
7Other useful ressources:
8 https://developer.mozilla.org/en/XPCOM_Glue
9 http://www.iosart.com/firefox/xpcom/
10 http://www.ibm.com/developerworks/webservices/library/co-xpcom5.html (with link to the complete series)
11 http://blog.lazytech.info/2007/05/26/xpcom-javascript-function-call/ (about implementing JS callbacks)
12
13
14Unknown symbols in ubuntu lucid
15===============================
16
17On ubuntu lucid `ldd -r *.so` shows libxpcom as unknown symbol, to fix this create
18
19 /etc/ld.so.conf.d/libxpcom.conf
20
21with this content:
22
23 # for xpcom
24 /usr/lib/xulrunner-1.9.2.3
25
26
27And rebuild the cache
28 $ sudo ldconfig
29
30You have to do the same for libzeitgeist!
31
32
33Component UUID
34==============
35
36the uuid for the component is
37 d879c08c-517d-44f0-83e1-3ef75a527ddf
38
39
40TODO
41====
42 * add JS callback to .insert() so user can be notified of issues while inserting event
43 * add events for downloads, see https://developer.mozilla.org/en/nsIDownloadProgressListener
044
=== added directory 'firefox-36-libzg/extension'
=== added file 'firefox-36-libzg/extension/Makefile.am'
--- firefox-36-libzg/extension/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,42 @@
1SUBDIRS = components
2
3extensiondir = $(datadir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
4EXTENSIONS_SYMLINK = $(extensiondir)/xpcom_firefox@zeitgeist-project.com
5
6xul_extdir = $(datadir)/xul-ext-zeitgeist
7dist_xul_ext_DATA = \
8 license.txt \
9 chrome.manifest \
10 install.rdf \
11 $(NULL)
12
13contentdir = $(xul_extdir)/chrome/content
14dist_content_DATA = \
15 chrome/content/zeitgeist.xul \
16 chrome/content/zeitgeist.png \
17 $(NULL)
18
19prefsdir = $(xul_extdir)/defaults/preferences
20dist_prefs_DATA = \
21 defaults/preferences/zeitgeist.js \
22 $(NULL)
23
24install-exec-hook:
25 $(MKDIR_P) $(DESTDIR)$(extensiondir)
26 test -h "$(DESTDIR)$(EXTENSIONS_SYMLINK)" || $(LN_S) -f "$(DESTDIR)$(xul_extdir)" "$(DESTDIR)$(EXTENSIONS_SYMLINK)"
27
28# we want to allow also local install
29EXTENSION_CONTENT = \
30 $(dist_xul_ext_DATA) \
31 defaults \
32 chrome \
33 components/libzeitgeist_xpcom.so \
34 components/zeitgeist.xpt \
35 $(NULL)
36
37local-install: all
38 $(MAKE) -C components $@
39 zip -r ../ZeitgeistDataprovider.xpi $(EXTENSION_CONTENT)
40
41local-uninstall:
42 $(MAKE) -C components $@
043
=== added directory 'firefox-36-libzg/extension/chrome'
=== added file 'firefox-36-libzg/extension/chrome.manifest'
--- firefox-36-libzg/extension/chrome.manifest 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/chrome.manifest 2011-05-03 18:52:25 +0000
@@ -0,0 +1,2 @@
1content zeitgeist chrome/content/
2overlay chrome://browser/content/browser.xul chrome://zeitgeist/content/zeitgeist.xul
03
=== added directory 'firefox-36-libzg/extension/chrome/content'
=== added file 'firefox-36-libzg/extension/chrome/content/zeitgeist.png'
1Binary files firefox-36-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 and firefox-36-libzg/extension/chrome/content/zeitgeist.png 2011-05-03 18:52:25 +0000 differ4Binary files firefox-36-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 and firefox-36-libzg/extension/chrome/content/zeitgeist.png 2011-05-03 18:52:25 +0000 differ
=== added file 'firefox-36-libzg/extension/chrome/content/zeitgeist.xul'
--- firefox-36-libzg/extension/chrome/content/zeitgeist.xul 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/chrome/content/zeitgeist.xul 2011-05-03 18:52:25 +0000
@@ -0,0 +1,164 @@
1<?xml version="1.0"?>
2<overlay id="zeitgeist" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
3
4 <script type="application/x-javascript"><![CDATA[
5 var zeitgeistgluexpcominterface = null;
6
7 var enable_googlemail = false;
8 var googlemail_view_regex = new RegExp("mail\\.google\\.com");
9 var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
10 .getService(Components.interfaces.nsIPrivateBrowsingService);
11
12 var debug = function (aMessage) {
13 var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
14 .getService(Components.interfaces.nsIConsoleService);
15 consoleService.logStringMessage("Zeitgeist Extension: " + aMessage);
16 window.dump("Zeitgeist Extension:" + aMessage + "\n");
17 }
18
19 var make_pattern = function(pattern) {
20 for (item in pattern) {
21 // alert(pattern[item]);
22 pattern[item] = new RegExp(pattern[item]);
23 };
24 return pattern;
25 };
26
27 var ZeitgeistPrefObserver = {
28 register: function() {
29 // First we'll need the preference services to look for preferences.
30 var prefService = Components.classes["@mozilla.org/preferences-service;1"]
31 .getService(Components.interfaces.nsIPrefService);
32
33 // For this._branch we ask that the preferences for extensions.myextension. and children
34 this._branch = prefService.getBranch("extensions.zeitgeist.");
35
36 // Now we queue the interface called nsIPrefBranch2. This interface is described as:
37 // "nsIPrefBranch2 allows clients to observe changes to pref values."
38 this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
39
40 // Finally add the observer.
41 this._branch.addObserver("", this, false);
42 },
43
44 unregister: function() {
45 if(!this._branch) return;
46 this._branch.removeObserver("", this);
47 },
48
49 observe: function(aSubject, aTopic, aData) {
50 if(aTopic != "nsPref:changed") return;
51 // aSubject is the nsIPrefBranch we're observing (after appropriate QI)
52 // aData is the name of the pref that's been changed (relative to aSubject)
53 switch (aData) {
54 case "ignored_uris":
55 // extensions.zeitgeist.ignored_uris was changed
56 pattern = this.get_string(aData);
57 // alert(pattern);
58 ignored_uris = make_pattern(pattern);
59 break;
60 case "enable_googlemail":
61 enable_googlemail = this.get_bool(aData);
62 //alert("changed gmail to"+enable_googlemail);
63 break
64 }
65 },
66 get_string: function(key) {
67 try {
68 return JSON.parse(this._branch.getCharPref(key));
69 } catch(err) {
70 // this means there is no such config value
71 // ignoring this error
72 //alert(key + " : " + err);
73 };
74 },
75 get_bool: function(key) {
76 try {
77 return this._branch.getBoolPref(key);
78 } catch(err) {
79 // this means there is no such config value
80 // ignoring this error
81 //alert(key + " : " + err);
82 };
83 }
84 }
85 ZeitgeistPrefObserver.register();
86 ignored_uris = make_pattern(ZeitgeistPrefObserver.get_string("ignored_uris"));
87 debug("We are ignoring this uris: " + ignored_uris);
88 var enable_googlemail = ZeitgeistPrefObserver.get_bool("enable_googlemail");
89 debug("the googlemail handler extension is activated? ["+enable_googlemail+"]");
90
91 ignore_uri = function(uri) {
92 for (pattern in ignored_uris) {
93 if (ignored_uris[pattern].test(uri)) {
94 // alert("ignored " + uri);
95 return true;
96 };
97 };
98 return false;
99 };
100
101 try {
102 if(zeitgeistgluexpcominterface == null) {
103 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
104 zeitgeistgluexpcominterface = Components.
105 classes["@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"].
106 createInstance(Components.interfaces.zeitgeist);
107 }
108 } catch(err) {
109 alert(err);
110 }
111
112 var ZeitgeistProgressListener = {
113 onStateChange: function(aBrowser, aProgress, aRequest, aStateFlags) {
114 var inPrivateBrowsingMode = pbs.privateBrowsingEnabled;
115 if (inPrivateBrowsingMode) return;
116 if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) {
117 var uri = aBrowser.currentURI.spec;
118 var mimetype = aBrowser.contentDocument.contentType;
119 if (aRequest.name == uri && !ignore_uri(uri)) {
120 zeitgeistgluexpcominterface.insert(
121 uri,
122 mimetype,
123 aBrowser.contentTitle
124 );
125 //alert("THATS WHAT WE HAVE "+enable_googlemail+" | "+uri+" | "+(enable_googlemail & googlemail_view_regex.test(uri)));
126 if (enable_googlemail & googlemail_view_regex.test(uri)) {
127 debug("let's begin the google fun'");
128 var dmt = aBrowser.contentDocument;
129 var head = dmt.getElementsByTagName("title")[0];
130 head.addEventListener("DOMSubtreeModified", function(event){
131 if (dmt.title) {
132 zeitgeistgluexpcominterface.insert(
133 dmt.location.href,
134 dmt.contentType,
135 dmt.title
136 );
137 };
138 }, false);
139 }
140 }
141 }
142 },
143 // we don't implement this methods
144 onStatusChange: function(){},
145 onLocationChange: function(){},
146 onSecurityChange: function(){},
147 onProgressChange: function(){},
148 };
149
150
151 var zeitgeist = {
152 init: function() {
153 gBrowser.addTabsProgressListener(ZeitgeistProgressListener);
154 },
155 uninit: function() {
156 gBrowser.removeTabsProgressListener(ZeitgeistProgressListener);
157 },
158 };
159
160 window.addEventListener("load", function() {zeitgeist.init()}, false);
161 window.addEventListener("unload", function() {zeitgeist.uninit()}, false);
162
163 ]]></script>
164</overlay>
0165
=== added directory 'firefox-36-libzg/extension/components'
=== added file 'firefox-36-libzg/extension/components/Makefile.am'
--- firefox-36-libzg/extension/components/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/components/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,60 @@
1zeitgeistmoduledir = $(libdir)/xul-ext-zeitgeist
2zeitgeistmodule_LTLIBRARIES = libzeitgeist_xpcom.la
3zeitgeistmodule_DATA = zeitgeist.xpt
4
5xul_extdir = $(datadir)/xul-ext-zeitgeist
6
7libzeitgeist_xpcom_la_SOURCES = \
8 ZeitgeistComponent.cpp \
9 ZeitgeistModule.cpp \
10 $(NULL)
11
12libzeitgeist_xpcom_la_CXXFLAGS = \
13 -include "xpcom-config.h" \
14 $(ZEITGEIST_CFLAGS) \
15 $(LIBXUL_1_9_2_CFLAGS) \
16 $(NULL)
17
18libzeitgeist_xpcom_la_LIBADD = \
19 $(ZEITGEIST_LIBS) \
20 $(LIBXUL_1_9_2_LIBS) \
21 $(NULL)
22
23libzeitgeist_xpcom_la_LDFLAGS = \
24 -module -avoid-version \
25 $(NULL)
26
27BUILT_SOURCES = \
28 zeitgeist-library.h \
29 zeitgeist.h \
30 zeitgeist.xpt \
31 $(NULL)
32
33EXTRA_DIST = \
34 zeitgeist.idl \
35 zeitgeistextend.h \
36 $(NULL)
37
38DISTCLEANFILES = \
39 $(BUILT_SOURCES) \
40 $(NULL)
41
42
43zeitgeist.h: zeitgeist.idl
44 $(AM_V_GEN)$(XPIDL_BIN) -m header -I $(XUL_IDLDIR) -o zeitgeist $<
45
46zeitgeist.xpt: zeitgeist.idl
47 $(AM_V_GEN)$(XPIDL_BIN) -m typelib -I $(XUL_IDLDIR) -o zeitgeist $<
48
49zeitgeist-library.h:
50 $(AM_V_GEN)$(LN_S) "`$(PKG_CONFIG) --variable includedir zeitgeist-1.0`/zeitgeist-1.0/zeitgeist.h" $@
51
52install-exec-hook:
53 test -d $(DESTDIR)$(xul_extdir) || $(MKDIR_P) $(DESTDIR)$(xul_extdir)
54 test -h $(DESTDIR)$(xul_extdir)/components || $(LN_S) -f $(DESTDIR)$(zeitgeistmoduledir) $(DESTDIR)$(xul_extdir)/components
55
56# small helper with local install
57local-install: all
58 cp .libs/libzeitgeist_xpcom.so ./
59
60local-uninstall: ;
061
=== added file 'firefox-36-libzg/extension/components/ZeitgeistComponent.cpp'
--- firefox-36-libzg/extension/components/ZeitgeistComponent.cpp 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/components/ZeitgeistComponent.cpp 2011-05-03 18:52:25 +0000
@@ -0,0 +1,39 @@
1/*
2 * ZeitgeistComponent.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#include "nsIGenericFactory.h"
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27NS_GENERIC_FACTORY_CONSTRUCTOR(zeitgeistextend)
28
29static nsModuleComponentInfo components[] =
30{
31 {
32 ZEITGEIST_COMPONENT_CLASSNAME,
33 ZEITGEIST_COMPONENT_CID,
34 ZEITGEIST_COMPONENT_CONTRACTID,
35 zeitgeistextendConstructor,
36 }
37};
38
39NS_IMPL_NSGETMODULE("ZeitgeistModule", components)
040
=== added file 'firefox-36-libzg/extension/components/ZeitgeistModule.cpp'
--- firefox-36-libzg/extension/components/ZeitgeistModule.cpp 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/components/ZeitgeistModule.cpp 2011-05-03 18:52:25 +0000
@@ -0,0 +1,86 @@
1/*
2 * ZeitgeistModule.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27#include <nsStringAPI.h>
28#include <glib.h>
29#include <glib-object.h>
30#include <zeitgeist.h>
31
32
33using namespace std;
34
35NS_IMPL_ISUPPORTS1(zeitgeistextend, zeitgeist)
36
37zeitgeistextend::zeitgeistextend()
38{
39 g_debug("constructor of zeitgeistextend");
40 g_type_init ();
41
42 log = (ZeitgeistLog *)g_object_new (ZEITGEIST_TYPE_LOG, NULL);
43}
44
45zeitgeistextend::~zeitgeistextend()
46{
47 g_debug("destructor of zeitgeistextend");
48}
49
50NS_IMETHODIMP zeitgeistextend::Insert(const char *url,
51 const char *mimetype,
52 const nsACString &title_str)
53{
54 ZeitgeistEvent *event;
55 gchar *title = NULL;
56
57 g_debug("zeitgeist start - creating event");
58
59 if (!title_str.IsEmpty ())
60 {
61 gsize title_len = title_str.EndReading () - title_str.BeginReading ();
62 title = g_strndup (title_str.BeginReading (), title_len);
63 }
64
65 event = zeitgeist_event_new_full (
66 ZEITGEIST_ZG_ACCESS_EVENT,
67 ZEITGEIST_ZG_USER_ACTIVITY,
68 "application://firefox.desktop",
69 zeitgeist_subject_new_full (
70 url,
71 ZEITGEIST_NFO_WEBSITE,
72 ZEITGEIST_NFO_REMOTE_DATA_OBJECT,
73 mimetype,
74 url,
75 title,
76 "net"),
77 NULL);
78
79 if (title) g_free (title);
80 g_debug("inserting event");
81 zeitgeist_log_insert_events_no_reply(log, event, NULL);
82 g_debug("zeitgeist end");
83
84 return NS_OK;
85}
86
087
=== added file 'firefox-36-libzg/extension/components/zeitgeist.idl'
--- firefox-36-libzg/extension/components/zeitgeist.idl 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/components/zeitgeist.idl 2011-05-03 18:52:25 +0000
@@ -0,0 +1,30 @@
1/*
2 * zeitgeist.idl
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "nsISupports.idl"
25[scriptable, uuid(d879c08c-517d-44f0-83e1-3ef75a527ddf)]
26interface zeitgeist : nsISupports
27{
28 void insert(in string url, in string mimetype, in AUTF8String title);
29};
30
031
=== added file 'firefox-36-libzg/extension/components/zeitgeistextend.h'
--- firefox-36-libzg/extension/components/zeitgeistextend.h 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/components/zeitgeistextend.h 2011-05-03 18:52:25 +0000
@@ -0,0 +1,45 @@
1/*
2 * zeitgeistextend.h
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#ifndef _ZEITGEISTEXTEND_H_
24#define _ZEITGEISTEXTEND_H_
25
26#include "zeitgeist.h"
27#include "zeitgeist-library.h"
28
29#define ZEITGEIST_COMPONENT_CONTRACTID "@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"
30#define ZEITGEIST_COMPONENT_CLASSNAME "zeitgeist dataprovider for firefox"
31#define ZEITGEIST_COMPONENT_CID { 0xd879c08c, 0x517d, 0x44f0, { 0x83, 0xe1, 0x3e, 0xf7, 0x5a, 0x52, 0x7d, 0xdf } }
32
33//d879c08c-517d-44f0-83e1-3ef75a527ddf
34class zeitgeistextend : public zeitgeist
35{
36 public:
37 NS_DECL_ISUPPORTS
38 NS_DECL_ZEITGEIST
39
40 zeitgeistextend();
41 virtual ~zeitgeistextend();
42 ZeitgeistLog *log;
43
44};
45#endif
046
=== added directory 'firefox-36-libzg/extension/defaults'
=== added directory 'firefox-36-libzg/extension/defaults/preferences'
=== added file 'firefox-36-libzg/extension/defaults/preferences/zeitgeist.js'
--- firefox-36-libzg/extension/defaults/preferences/zeitgeist.js 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/defaults/preferences/zeitgeist.js 2011-05-03 18:52:25 +0000
@@ -0,0 +1,2 @@
1pref("extensions.zeitgeist.ignored_uris", "[\"^about:*\"]");
2pref("extensions.zeitgeist.enable_googlemail", false);
03
=== added file 'firefox-36-libzg/extension/install.rdf'
--- firefox-36-libzg/extension/install.rdf 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/install.rdf 2011-05-03 18:52:25 +0000
@@ -0,0 +1,28 @@
1<?xml version="1.0"?>
2
3<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4 xmlns:em="http://www.mozilla.org/2004/em-rdf#">
5
6 <Description about="urn:mozilla:install-manifest">
7 <em:id>xpcom_firefox@zeitgeist-project.com</em:id>
8 <em:version>0.3</em:version>
9 <em:type>2</em:type>
10
11 <!-- Target Application this extension can install into,
12 with minimum and maximum supported versions. -->
13 <em:targetApplication>
14 <Description>
15 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
16 <em:minVersion>3.5</em:minVersion>
17 <em:maxVersion>3.6.*</em:maxVersion>
18 </Description>
19 </em:targetApplication>
20
21 <!-- Front End MetaData -->
22 <em:name>zeitgeist</em:name>
23 <em:description>dataprovider for the zeitgeist framework, using xpcom and libzeitgeist</em:description>
24 <em:creator>Markus Korn</em:creator>
25 <em:homepageURL>http://launchpad.net/zeitgeist</em:homepageURL>
26 <em:iconURL>chrome://zeitgeist/content/zeitgeist.png</em:iconURL>
27 </Description>
28</RDF>
029
=== added file 'firefox-36-libzg/extension/license.txt'
--- firefox-36-libzg/extension/license.txt 1970-01-01 00:00:00 +0000
+++ firefox-36-libzg/extension/license.txt 2011-05-03 18:52:25 +0000
@@ -0,0 +1,166 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the event an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatever part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and reverse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License ever published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library.
166
0167
=== added directory 'firefox-40-libzg'
=== added file 'firefox-40-libzg/Makefile.am'
--- firefox-40-libzg/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,16 @@
1SUBDIRS = extension
2
3# identifier for the FF profile in which 'make install' installs this extension
4TARGET_PROFILE = *default*
5
6local-install: all
7 $(MAKE) -C extension $@
8 unzip -o ZeitgeistDataprovider.xpi -d ~/xpcom_firefox\@zeitgeist-project.com
9 cd ~/.mozilla/firefox/$(TARGET_PROFILE)/ && mkdir -p extensions
10 cp -r ~/xpcom_firefox\@zeitgeist-project.com/ ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/
11
12local-uninstall:
13 $(MAKE) -C extension $@
14 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/xpcom_firefox\@zeitgeist-project.com
15 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/ZeitgeistDataprovider.xpi
16
017
=== added file 'firefox-40-libzg/README'
--- firefox-40-libzg/README 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/README 2011-05-03 18:52:25 +0000
@@ -0,0 +1,43 @@
1Links
2=====
3
4Code is based on:
5 http://www.ibm.com/developerworks/opensource/library/os-xpcomfirefox/index.html
6
7Other useful ressources:
8 https://developer.mozilla.org/en/XPCOM_Glue
9 http://www.iosart.com/firefox/xpcom/
10 http://www.ibm.com/developerworks/webservices/library/co-xpcom5.html (with link to the complete series)
11 http://blog.lazytech.info/2007/05/26/xpcom-javascript-function-call/ (about implementing JS callbacks)
12
13
14Unknown symbols in ubuntu lucid
15===============================
16
17On ubuntu lucid `ldd -r *.so` shows libxpcom as unknown symbol, to fix this create
18
19 /etc/ld.so.conf.d/libxpcom.conf
20
21with this content:
22
23 # for xpcom
24 /usr/lib/xulrunner-1.9.2.3
25
26
27And rebuild the cache
28 $ sudo ldconfig
29
30You have to do the same for libzeitgeist!
31
32
33Component UUID
34==============
35
36the uuid for the component is
37 d879c08c-517d-44f0-83e1-3ef75a527ddf
38
39
40TODO
41====
42 * add JS callback to .insert() so user can be notified of issues while inserting event
43 * add events for downloads, see https://developer.mozilla.org/en/nsIDownloadProgressListener
044
=== added directory 'firefox-40-libzg/extension'
=== added file 'firefox-40-libzg/extension/Makefile.am'
--- firefox-40-libzg/extension/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,42 @@
1SUBDIRS = components
2
3extensiondir = $(datadir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
4EXTENSIONS_SYMLINK = $(extensiondir)/xpcom_firefox@zeitgeist-project.com
5
6xul_extdir = $(datadir)/xul-ext-zeitgeist
7dist_xul_ext_DATA = \
8 license.txt \
9 chrome.manifest \
10 install.rdf \
11 $(NULL)
12
13contentdir = $(xul_extdir)/chrome/content
14dist_content_DATA = \
15 chrome/content/zeitgeist.xul \
16 chrome/content/zeitgeist.png \
17 $(NULL)
18
19prefsdir = $(xul_extdir)/defaults/preferences
20dist_prefs_DATA = \
21 defaults/preferences/zeitgeist.js \
22 $(NULL)
23
24install-exec-hook:
25 $(MKDIR_P) $(DESTDIR)$(extensiondir)
26 test -h "$(DESTDIR)$(EXTENSIONS_SYMLINK)" || $(LN_S) -f "$(DESTDIR)$(xul_extdir)" "$(DESTDIR)$(EXTENSIONS_SYMLINK)"
27
28# we want to allow also local install
29EXTENSION_CONTENT = \
30 $(dist_xul_ext_DATA) \
31 defaults \
32 chrome \
33 components/libzeitgeist_xpcom.so \
34 components/zeitgeist.xpt \
35 $(NULL)
36
37local-install: all
38 $(MAKE) -C components $@
39 zip -r ../ZeitgeistDataprovider.xpi $(EXTENSION_CONTENT)
40
41local-uninstall:
42 $(MAKE) -C components $@
043
=== added directory 'firefox-40-libzg/extension/chrome'
=== added file 'firefox-40-libzg/extension/chrome.manifest'
--- firefox-40-libzg/extension/chrome.manifest 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/chrome.manifest 2011-05-03 18:52:25 +0000
@@ -0,0 +1,4 @@
1binary-component components/libzeitgeist_xpcom.so
2interfaces components/zeitgeist.xpt
3content zeitgeist chrome/content/
4overlay chrome://browser/content/browser.xul chrome://zeitgeist/content/zeitgeist.xul
05
=== added directory 'firefox-40-libzg/extension/chrome/content'
=== added file 'firefox-40-libzg/extension/chrome/content/zeitgeist.png'
1Binary files firefox-40-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 and firefox-40-libzg/extension/chrome/content/zeitgeist.png 2011-05-03 18:52:25 +0000 differ6Binary files firefox-40-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 and firefox-40-libzg/extension/chrome/content/zeitgeist.png 2011-05-03 18:52:25 +0000 differ
=== added file 'firefox-40-libzg/extension/chrome/content/zeitgeist.xul'
--- firefox-40-libzg/extension/chrome/content/zeitgeist.xul 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/chrome/content/zeitgeist.xul 2011-05-03 18:52:25 +0000
@@ -0,0 +1,164 @@
1<?xml version="1.0"?>
2<overlay id="zeitgeist" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
3
4 <script type="application/x-javascript"><![CDATA[
5 var zeitgeistgluexpcominterface = null;
6
7 var enable_googlemail = false;
8 var googlemail_view_regex = new RegExp("mail\\.google\\.com");
9 var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
10 .getService(Components.interfaces.nsIPrivateBrowsingService);
11
12 var debug = function (aMessage) {
13 var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
14 .getService(Components.interfaces.nsIConsoleService);
15 consoleService.logStringMessage("Zeitgeist Extension: " + aMessage);
16 window.dump("Zeitgeist Extension:" + aMessage + "\n");
17 }
18
19 var make_pattern = function(pattern) {
20 for (item in pattern) {
21 // alert(pattern[item]);
22 pattern[item] = new RegExp(pattern[item]);
23 };
24 return pattern;
25 };
26
27 var ZeitgeistPrefObserver = {
28 register: function() {
29 // First we'll need the preference services to look for preferences.
30 var prefService = Components.classes["@mozilla.org/preferences-service;1"]
31 .getService(Components.interfaces.nsIPrefService);
32
33 // For this._branch we ask that the preferences for extensions.myextension. and children
34 this._branch = prefService.getBranch("extensions.zeitgeist.");
35
36 // Now we queue the interface called nsIPrefBranch2. This interface is described as:
37 // "nsIPrefBranch2 allows clients to observe changes to pref values."
38 this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
39
40 // Finally add the observer.
41 this._branch.addObserver("", this, false);
42 },
43
44 unregister: function() {
45 if(!this._branch) return;
46 this._branch.removeObserver("", this);
47 },
48
49 observe: function(aSubject, aTopic, aData) {
50 if(aTopic != "nsPref:changed") return;
51 // aSubject is the nsIPrefBranch we're observing (after appropriate QI)
52 // aData is the name of the pref that's been changed (relative to aSubject)
53 switch (aData) {
54 case "ignored_uris":
55 // extensions.zeitgeist.ignored_uris was changed
56 pattern = this.get_string(aData);
57 // alert(pattern);
58 ignored_uris = make_pattern(pattern);
59 break;
60 case "enable_googlemail":
61 enable_googlemail = this.get_bool(aData);
62 //alert("changed gmail to"+enable_googlemail);
63 break
64 }
65 },
66 get_string: function(key) {
67 try {
68 return JSON.parse(this._branch.getCharPref(key));
69 } catch(err) {
70 // this means there is no such config value
71 // ignoring this error
72 //alert(key + " : " + err);
73 };
74 },
75 get_bool: function(key) {
76 try {
77 return this._branch.getBoolPref(key);
78 } catch(err) {
79 // this means there is no such config value
80 // ignoring this error
81 //alert(key + " : " + err);
82 };
83 }
84 }
85 ZeitgeistPrefObserver.register();
86 ignored_uris = make_pattern(ZeitgeistPrefObserver.get_string("ignored_uris"));
87 debug("We are ignoring this uris: " + ignored_uris);
88 var enable_googlemail = ZeitgeistPrefObserver.get_bool("enable_googlemail");
89 debug("the googlemail handler extension is activated? ["+enable_googlemail+"]");
90
91 ignore_uri = function(uri) {
92 for (pattern in ignored_uris) {
93 if (ignored_uris[pattern].test(uri)) {
94 // alert("ignored " + uri);
95 return true;
96 };
97 };
98 return false;
99 };
100
101 try {
102 if(zeitgeistgluexpcominterface == null) {
103 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
104 zeitgeistgluexpcominterface = Components.
105 classes["@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"].
106 createInstance(Components.interfaces.zeitgeist);
107 }
108 } catch(err) {
109 alert(err);
110 }
111
112 var ZeitgeistProgressListener = {
113 onStateChange: function(aBrowser, aProgress, aRequest, aStateFlags) {
114 var inPrivateBrowsingMode = pbs.privateBrowsingEnabled;
115 if (inPrivateBrowsingMode) return;
116 if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) {
117 var uri = aBrowser.currentURI.spec;
118 var mimetype = aBrowser.contentDocument.contentType;
119 if (aRequest.name == uri && !ignore_uri(uri)) {
120 zeitgeistgluexpcominterface.insert(
121 uri,
122 mimetype,
123 aBrowser.contentTitle
124 );
125 //alert("THATS WHAT WE HAVE "+enable_googlemail+" | "+uri+" | "+(enable_googlemail & googlemail_view_regex.test(uri)));
126 if (enable_googlemail & googlemail_view_regex.test(uri)) {
127 debug("let's begin the google fun'");
128 var dmt = aBrowser.contentDocument;
129 var head = dmt.getElementsByTagName("title")[0];
130 head.addEventListener("DOMSubtreeModified", function(event){
131 if (dmt.title) {
132 zeitgeistgluexpcominterface.insert(
133 dmt.location.href,
134 dmt.contentType,
135 dmt.title
136 );
137 };
138 }, false);
139 }
140 }
141 }
142 },
143 // we don't implement this methods
144 onStatusChange: function(){},
145 onLocationChange: function(){},
146 onSecurityChange: function(){},
147 onProgressChange: function(){},
148 };
149
150
151 var zeitgeist = {
152 init: function() {
153 gBrowser.addTabsProgressListener(ZeitgeistProgressListener);
154 },
155 uninit: function() {
156 gBrowser.removeTabsProgressListener(ZeitgeistProgressListener);
157 },
158 };
159
160 window.addEventListener("load", function() {zeitgeist.init()}, false);
161 window.addEventListener("unload", function() {zeitgeist.uninit()}, false);
162
163 ]]></script>
164</overlay>
0165
=== added directory 'firefox-40-libzg/extension/components'
=== added file 'firefox-40-libzg/extension/components/Makefile.am'
--- firefox-40-libzg/extension/components/Makefile.am 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/Makefile.am 2011-05-03 18:52:25 +0000
@@ -0,0 +1,60 @@
1zeitgeistmoduledir = $(libdir)/xul-ext-zeitgeist
2zeitgeistmodule_LTLIBRARIES = libzeitgeist_xpcom.la
3zeitgeistmodule_DATA = zeitgeist.xpt
4
5xul_extdir = $(datadir)/xul-ext-zeitgeist
6
7libzeitgeist_xpcom_la_SOURCES = \
8 ZeitgeistComponent.cpp \
9 ZeitgeistModule.cpp \
10 $(NULL)
11
12libzeitgeist_xpcom_la_CXXFLAGS = \
13 -include "xpcom-config.h" \
14 $(ZEITGEIST_CFLAGS) \
15 $(LIBXUL_2_0_CFLAGS) \
16 $(NULL)
17
18libzeitgeist_xpcom_la_LIBADD = \
19 $(ZEITGEIST_LIBS) \
20 $(LIBXUL_2_0_LIBS) \
21 $(NULL)
22
23libzeitgeist_xpcom_la_LDFLAGS = \
24 -module -avoid-version \
25 $(NULL)
26
27BUILT_SOURCES = \
28 zeitgeist-library.h \
29 zeitgeist.h \
30 zeitgeist.xpt \
31 $(NULL)
32
33EXTRA_DIST = \
34 zeitgeist.idl \
35 zeitgeistextend.h \
36 $(NULL)
37
38DISTCLEANFILES = \
39 $(BUILT_SOURCES) \
40 $(NULL)
41
42
43zeitgeist.h: zeitgeist.idl
44 $(AM_V_GEN)$(XPIDL_BIN) -m header -I $(XUL_IDLDIR) -o zeitgeist $<
45
46zeitgeist.xpt: zeitgeist.idl
47 $(AM_V_GEN)$(XPIDL_BIN) -m typelib -I $(XUL_IDLDIR) -o zeitgeist $<
48
49zeitgeist-library.h:
50 $(AM_V_GEN)$(LN_S) "`$(PKG_CONFIG) --variable includedir zeitgeist-1.0`/zeitgeist-1.0/zeitgeist.h" $@
51
52install-exec-hook:
53 test -d $(DESTDIR)$(xul_extdir) || $(MKDIR_P) $(DESTDIR)$(xul_extdir)
54 test -h $(DESTDIR)$(xul_extdir)/components || $(LN_S) -f $(DESTDIR)$(zeitgeistmoduledir) $(DESTDIR)$(xul_extdir)/components
55
56# small helper with local install
57local-install: all
58 cp .libs/libzeitgeist_xpcom.so ./
59
60local-uninstall: ;
061
=== added file 'firefox-40-libzg/extension/components/ZeitgeistComponent.cpp'
--- firefox-40-libzg/extension/components/ZeitgeistComponent.cpp 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/ZeitgeistComponent.cpp 2011-05-03 18:52:25 +0000
@@ -0,0 +1,50 @@
1/*
2 * ZeitgeistComponent.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#include "mozilla/ModuleUtils.h"
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27NS_GENERIC_FACTORY_CONSTRUCTOR(zeitgeistextend)
28
29NS_DEFINE_NAMED_CID(ZEITGEIST_COMPONENT_CID);
30
31static const mozilla::Module::CIDEntry kZeitgeistCIDs[] = {
32 { &kZEITGEIST_COMPONENT_CID, false, NULL, zeitgeistextendConstructor },
33 { NULL }
34};
35
36static const mozilla::Module::ContractIDEntry kZeitgeistContracts[] = {
37 { ZEITGEIST_COMPONENT_CONTRACTID, &kZEITGEIST_COMPONENT_CID },
38 { NULL }
39};
40
41static const mozilla::Module kZeitgeistModule = {
42 mozilla::Module::kVersion,
43 kZeitgeistCIDs,
44 kZeitgeistContracts,
45 NULL
46};
47
48NSMODULE_DEFN(ZeitgeistModule) = &kZeitgeistModule;
49
50NS_IMPL_MOZILLA192_NSGETMODULE(&kZeitgeistModule)
051
=== added file 'firefox-40-libzg/extension/components/ZeitgeistModule.cpp'
--- firefox-40-libzg/extension/components/ZeitgeistModule.cpp 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/ZeitgeistModule.cpp 2011-05-03 18:52:25 +0000
@@ -0,0 +1,86 @@
1/*
2 * ZeitgeistModule.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27#include <nsStringAPI.h>
28#include <glib.h>
29#include <glib-object.h>
30#include <zeitgeist.h>
31
32
33using namespace std;
34
35NS_IMPL_ISUPPORTS1(zeitgeistextend, zeitgeist)
36
37zeitgeistextend::zeitgeistextend()
38{
39 g_debug("constructor of zeitgeistextend");
40 g_type_init ();
41
42 log = (ZeitgeistLog *)g_object_new (ZEITGEIST_TYPE_LOG, NULL);
43}
44
45zeitgeistextend::~zeitgeistextend()
46{
47 g_debug("destructor of zeitgeistextend");
48}
49
50NS_IMETHODIMP zeitgeistextend::Insert(const char *url,
51 const char *mimetype,
52 const nsACString &title_str)
53{
54 ZeitgeistEvent *event;
55 gchar *title = NULL;
56
57 g_debug("zeitgeist start - creating event");
58
59 if (!title_str.IsEmpty ())
60 {
61 gsize title_len = title_str.EndReading () - title_str.BeginReading ();
62 title = g_strndup (title_str.BeginReading (), title_len);
63 }
64
65 event = zeitgeist_event_new_full (
66 ZEITGEIST_ZG_ACCESS_EVENT,
67 ZEITGEIST_ZG_USER_ACTIVITY,
68 "application://firefox.desktop",
69 zeitgeist_subject_new_full (
70 url,
71 ZEITGEIST_NFO_WEBSITE,
72 ZEITGEIST_NFO_REMOTE_DATA_OBJECT,
73 mimetype,
74 url,
75 title,
76 "net"),
77 NULL);
78
79 if (title) g_free (title);
80 g_debug("inserting event");
81 zeitgeist_log_insert_events_no_reply(log, event, NULL);
82 g_debug("zeitgeist end");
83
84 return NS_OK;
85}
86
087
=== added symlink 'firefox-40-libzg/extension/components/zeitgeist-library.h'
=== target is u'/usr/include/zeitgeist-1.0/zeitgeist.h'
=== added file 'firefox-40-libzg/extension/components/zeitgeist.h'
--- firefox-40-libzg/extension/components/zeitgeist.h 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/zeitgeist.h 2011-05-03 18:52:25 +0000
@@ -0,0 +1,91 @@
1/*
2 * DO NOT EDIT. THIS FILE IS GENERATED FROM zeitgeist.idl
3 */
4
5#ifndef __gen_zeitgeist_h__
6#define __gen_zeitgeist_h__
7
8
9#ifndef __gen_nsISupports_h__
10#include "nsISupports.h"
11#endif
12
13/* For IDL files that don't want to include root IDL files. */
14#ifndef NS_NO_VTABLE
15#define NS_NO_VTABLE
16#endif
17
18/* starting interface: zeitgeist */
19#define ZEITGEIST_IID_STR "d879c08c-517d-44f0-83e1-3ef75a527ddf"
20
21#define ZEITGEIST_IID \
22 {0xd879c08c, 0x517d, 0x44f0, \
23 { 0x83, 0xe1, 0x3e, 0xf7, 0x5a, 0x52, 0x7d, 0xdf }}
24
25class NS_NO_VTABLE NS_SCRIPTABLE zeitgeist : public nsISupports {
26 public:
27
28 NS_DECLARE_STATIC_IID_ACCESSOR(ZEITGEIST_IID)
29
30 /* void insert (in string url, in string mimetype, in AUTF8String title); */
31 NS_SCRIPTABLE NS_IMETHOD Insert(const char *url, const char *mimetype, const nsACString & title) = 0;
32
33};
34
35 NS_DEFINE_STATIC_IID_ACCESSOR(zeitgeist, ZEITGEIST_IID)
36
37/* Use this macro when declaring classes that implement this interface. */
38#define NS_DECL_ZEITGEIST \
39 NS_SCRIPTABLE NS_IMETHOD Insert(const char *url, const char *mimetype, const nsACString & title);
40
41/* Use this macro to declare functions that forward the behavior of this interface to another object. */
42#define NS_FORWARD_ZEITGEIST(_to) \
43 NS_SCRIPTABLE NS_IMETHOD Insert(const char *url, const char *mimetype, const nsACString & title) { return _to Insert(url, mimetype, title); }
44
45/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
46#define NS_FORWARD_SAFE_ZEITGEIST(_to) \
47 NS_SCRIPTABLE NS_IMETHOD Insert(const char *url, const char *mimetype, const nsACString & title) { return !_to ? NS_ERROR_NULL_POINTER : _to->Insert(url, mimetype, title); }
48
49#if 0
50/* Use the code below as a template for the implementation class for this interface. */
51
52/* Header file */
53class _MYCLASS_ : public zeitgeist
54{
55public:
56 NS_DECL_ISUPPORTS
57 NS_DECL_ZEITGEIST
58
59 _MYCLASS_();
60
61private:
62 ~_MYCLASS_();
63
64protected:
65 /* additional members */
66};
67
68/* Implementation file */
69NS_IMPL_ISUPPORTS1(_MYCLASS_, zeitgeist)
70
71_MYCLASS_::_MYCLASS_()
72{
73 /* member initializers and constructor code */
74}
75
76_MYCLASS_::~_MYCLASS_()
77{
78 /* destructor code */
79}
80
81/* void insert (in string url, in string mimetype, in AUTF8String title); */
82NS_IMETHODIMP _MYCLASS_::Insert(const char *url, const char *mimetype, const nsACString & title)
83{
84 return NS_ERROR_NOT_IMPLEMENTED;
85}
86
87/* End of implementation class template. */
88#endif
89
90
91#endif /* __gen_zeitgeist_h__ */
092
=== added file 'firefox-40-libzg/extension/components/zeitgeist.idl'
--- firefox-40-libzg/extension/components/zeitgeist.idl 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/zeitgeist.idl 2011-05-03 18:52:25 +0000
@@ -0,0 +1,30 @@
1/*
2 * zeitgeist.idl
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "nsISupports.idl"
25[scriptable, uuid(d879c08c-517d-44f0-83e1-3ef75a527ddf)]
26interface zeitgeist : nsISupports
27{
28 void insert(in string url, in string mimetype, in AUTF8String title);
29};
30
031
=== added file 'firefox-40-libzg/extension/components/zeitgeist.xpt'
1Binary files firefox-40-libzg/extension/components/zeitgeist.xpt 1970-01-01 00:00:00 +0000 and firefox-40-libzg/extension/components/zeitgeist.xpt 2011-05-03 18:52:25 +0000 differ32Binary files firefox-40-libzg/extension/components/zeitgeist.xpt 1970-01-01 00:00:00 +0000 and firefox-40-libzg/extension/components/zeitgeist.xpt 2011-05-03 18:52:25 +0000 differ
=== added file 'firefox-40-libzg/extension/components/zeitgeistextend.h'
--- firefox-40-libzg/extension/components/zeitgeistextend.h 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/components/zeitgeistextend.h 2011-05-03 18:52:25 +0000
@@ -0,0 +1,45 @@
1/*
2 * zeitgeistextend.h
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#ifndef _ZEITGEISTEXTEND_H_
24#define _ZEITGEISTEXTEND_H_
25
26#include "zeitgeist.h"
27#include "zeitgeist-library.h"
28
29#define ZEITGEIST_COMPONENT_CONTRACTID "@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"
30#define ZEITGEIST_COMPONENT_CLASSNAME "zeitgeist dataprovider for firefox"
31#define ZEITGEIST_COMPONENT_CID { 0xd879c08c, 0x517d, 0x44f0, { 0x83, 0xe1, 0x3e, 0xf7, 0x5a, 0x52, 0x7d, 0xdf } }
32
33//d879c08c-517d-44f0-83e1-3ef75a527ddf
34class zeitgeistextend : public zeitgeist
35{
36 public:
37 NS_DECL_ISUPPORTS
38 NS_DECL_ZEITGEIST
39
40 zeitgeistextend();
41 virtual ~zeitgeistextend();
42 ZeitgeistLog *log;
43
44};
45#endif
046
=== added directory 'firefox-40-libzg/extension/defaults'
=== added directory 'firefox-40-libzg/extension/defaults/preferences'
=== added file 'firefox-40-libzg/extension/defaults/preferences/zeitgeist.js'
--- firefox-40-libzg/extension/defaults/preferences/zeitgeist.js 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/defaults/preferences/zeitgeist.js 2011-05-03 18:52:25 +0000
@@ -0,0 +1,2 @@
1pref("extensions.zeitgeist.ignored_uris", "[\"^about:*\"]");
2pref("extensions.zeitgeist.enable_googlemail", false);
03
=== added file 'firefox-40-libzg/extension/install.rdf'
--- firefox-40-libzg/extension/install.rdf 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/install.rdf 2011-05-03 18:52:25 +0000
@@ -0,0 +1,28 @@
1<?xml version="1.0"?>
2
3<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4 xmlns:em="http://www.mozilla.org/2004/em-rdf#">
5
6 <Description about="urn:mozilla:install-manifest">
7 <em:id>xpcom_firefox@zeitgeist-project.com</em:id>
8 <em:version>0.3</em:version>
9 <em:type>2</em:type>
10
11 <!-- Target Application this extension can install into,
12 with minimum and maximum supported versions. -->
13 <em:targetApplication>
14 <Description>
15 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
16 <em:minVersion>4.0</em:minVersion>
17 <em:maxVersion>4.0.*</em:maxVersion>
18 </Description>
19 </em:targetApplication>
20
21 <!-- Front End MetaData -->
22 <em:name>zeitgeist</em:name>
23 <em:description>dataprovider for the zeitgeist framework, using xpcom and libzeitgeist</em:description>
24 <em:creator>Markus Korn</em:creator>
25 <em:homepageURL>http://launchpad.net/zeitgeist</em:homepageURL>
26 <em:iconURL>chrome://zeitgeist/content/zeitgeist.png</em:iconURL>
27 </Description>
28</RDF>
029
=== added file 'firefox-40-libzg/extension/license.txt'
--- firefox-40-libzg/extension/license.txt 1970-01-01 00:00:00 +0000
+++ firefox-40-libzg/extension/license.txt 2011-05-03 18:52:25 +0000
@@ -0,0 +1,166 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the event an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatever part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and reverse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License ever published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library.
166
0167
=== removed directory 'firefox-libzg'
=== removed file 'firefox-libzg/Makefile.am'
--- firefox-libzg/Makefile.am 2011-05-02 19:02:52 +0000
+++ firefox-libzg/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1SUBDIRS = extension
2
3# identifier for the FF profile in which 'make install' installs this extension
4TARGET_PROFILE = *default*
5
6local-install: all
7 $(MAKE) -C extension $@
8 unzip -o ZeitgeistDataprovider.xpi -d ~/xpcom_firefox\@zeitgeist-project.com
9 cd ~/.mozilla/firefox/$(TARGET_PROFILE)/ && mkdir -p extensions
10 cp -r ~/xpcom_firefox\@zeitgeist-project.com/ ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/
11
12local-uninstall:
13 $(MAKE) -C extension $@
14 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/xpcom_firefox\@zeitgeist-project.com
15 -rm -rf ~/.mozilla/firefox/$(TARGET_PROFILE)/extensions/ZeitgeistDataprovider.xpi
16
170
=== removed file 'firefox-libzg/README'
--- firefox-libzg/README 2010-05-11 15:51:49 +0000
+++ firefox-libzg/README 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1Links
2=====
3
4Code is based on:
5 http://www.ibm.com/developerworks/opensource/library/os-xpcomfirefox/index.html
6
7Other useful ressources:
8 https://developer.mozilla.org/en/XPCOM_Glue
9 http://www.iosart.com/firefox/xpcom/
10 http://www.ibm.com/developerworks/webservices/library/co-xpcom5.html (with link to the complete series)
11 http://blog.lazytech.info/2007/05/26/xpcom-javascript-function-call/ (about implementing JS callbacks)
12
13
14Unknown symbols in ubuntu lucid
15===============================
16
17On ubuntu lucid `ldd -r *.so` shows libxpcom as unknown symbol, to fix this create
18
19 /etc/ld.so.conf.d/libxpcom.conf
20
21with this content:
22
23 # for xpcom
24 /usr/lib/xulrunner-1.9.2.3
25
26
27And rebuild the cache
28 $ sudo ldconfig
29
30You have to do the same for libzeitgeist!
31
32
33Component UUID
34==============
35
36the uuid for the component is
37 d879c08c-517d-44f0-83e1-3ef75a527ddf
38
39
40TODO
41====
42 * add JS callback to .insert() so user can be notified of issues while inserting event
43 * add events for downloads, see https://developer.mozilla.org/en/nsIDownloadProgressListener
440
=== removed directory 'firefox-libzg/extension'
=== removed file 'firefox-libzg/extension/Makefile.am'
--- firefox-libzg/extension/Makefile.am 2011-01-25 17:08:17 +0000
+++ firefox-libzg/extension/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1SUBDIRS = components
2
3extensiondir = $(datadir)/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
4EXTENSIONS_SYMLINK = $(extensiondir)/xpcom_firefox@zeitgeist-project.com
5
6xul_extdir = $(datadir)/xul-ext-zeitgeist
7dist_xul_ext_DATA = \
8 license.txt \
9 chrome.manifest \
10 install.rdf \
11 $(NULL)
12
13contentdir = $(xul_extdir)/chrome/content
14dist_content_DATA = \
15 chrome/content/zeitgeist.xul \
16 chrome/content/zeitgeist.png \
17 $(NULL)
18
19prefsdir = $(xul_extdir)/defaults/preferences
20dist_prefs_DATA = \
21 defaults/preferences/zeitgeist.js \
22 $(NULL)
23
24install-exec-hook:
25 $(MKDIR_P) $(DESTDIR)$(extensiondir)
26 test -h "$(DESTDIR)$(EXTENSIONS_SYMLINK)" || $(LN_S) -f "$(DESTDIR)$(xul_extdir)" "$(DESTDIR)$(EXTENSIONS_SYMLINK)"
27
28# we want to allow also local install
29EXTENSION_CONTENT = \
30 $(dist_xul_ext_DATA) \
31 defaults \
32 chrome \
33 components/libzeitgeist_xpcom.so \
34 components/zeitgeist.xpt \
35 $(NULL)
36
37local-install: all
38 $(MAKE) -C components $@
39 zip -r ../ZeitgeistDataprovider.xpi $(EXTENSION_CONTENT)
40
41local-uninstall:
42 $(MAKE) -C components $@
430
=== removed directory 'firefox-libzg/extension/chrome'
=== removed file 'firefox-libzg/extension/chrome.manifest'
--- firefox-libzg/extension/chrome.manifest 2011-04-29 20:41:04 +0000
+++ firefox-libzg/extension/chrome.manifest 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1binary-component components/libzeitgeist_xpcom.so
2interfaces components/zeitgeist.xpt
3content zeitgeist chrome/content/
4overlay chrome://browser/content/browser.xul chrome://zeitgeist/content/zeitgeist.xul
50
=== removed directory 'firefox-libzg/extension/chrome/content'
=== removed file 'firefox-libzg/extension/chrome/content/zeitgeist.png'
6Binary files firefox-libzg/extension/chrome/content/zeitgeist.png 2010-05-16 08:58:25 +0000 and firefox-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 differ1Binary files firefox-libzg/extension/chrome/content/zeitgeist.png 2010-05-16 08:58:25 +0000 and firefox-libzg/extension/chrome/content/zeitgeist.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'firefox-libzg/extension/chrome/content/zeitgeist.xul'
--- firefox-libzg/extension/chrome/content/zeitgeist.xul 2011-01-25 18:26:06 +0000
+++ firefox-libzg/extension/chrome/content/zeitgeist.xul 1970-01-01 00:00:00 +0000
@@ -1,164 +0,0 @@
1<?xml version="1.0"?>
2<overlay id="zeitgeist" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
3
4 <script type="application/x-javascript"><![CDATA[
5 var zeitgeistgluexpcominterface = null;
6
7 var enable_googlemail = false;
8 var googlemail_view_regex = new RegExp("mail\\.google\\.com");
9 var pbs = Components.classes["@mozilla.org/privatebrowsing;1"]
10 .getService(Components.interfaces.nsIPrivateBrowsingService);
11
12 var debug = function (aMessage) {
13 var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
14 .getService(Components.interfaces.nsIConsoleService);
15 consoleService.logStringMessage("Zeitgeist Extension: " + aMessage);
16 window.dump("Zeitgeist Extension:" + aMessage + "\n");
17 }
18
19 var make_pattern = function(pattern) {
20 for (item in pattern) {
21 // alert(pattern[item]);
22 pattern[item] = new RegExp(pattern[item]);
23 };
24 return pattern;
25 };
26
27 var ZeitgeistPrefObserver = {
28 register: function() {
29 // First we'll need the preference services to look for preferences.
30 var prefService = Components.classes["@mozilla.org/preferences-service;1"]
31 .getService(Components.interfaces.nsIPrefService);
32
33 // For this._branch we ask that the preferences for extensions.myextension. and children
34 this._branch = prefService.getBranch("extensions.zeitgeist.");
35
36 // Now we queue the interface called nsIPrefBranch2. This interface is described as:
37 // "nsIPrefBranch2 allows clients to observe changes to pref values."
38 this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
39
40 // Finally add the observer.
41 this._branch.addObserver("", this, false);
42 },
43
44 unregister: function() {
45 if(!this._branch) return;
46 this._branch.removeObserver("", this);
47 },
48
49 observe: function(aSubject, aTopic, aData) {
50 if(aTopic != "nsPref:changed") return;
51 // aSubject is the nsIPrefBranch we're observing (after appropriate QI)
52 // aData is the name of the pref that's been changed (relative to aSubject)
53 switch (aData) {
54 case "ignored_uris":
55 // extensions.zeitgeist.ignored_uris was changed
56 pattern = this.get_string(aData);
57 // alert(pattern);
58 ignored_uris = make_pattern(pattern);
59 break;
60 case "enable_googlemail":
61 enable_googlemail = this.get_bool(aData);
62 //alert("changed gmail to"+enable_googlemail);
63 break
64 }
65 },
66 get_string: function(key) {
67 try {
68 return JSON.parse(this._branch.getCharPref(key));
69 } catch(err) {
70 // this means there is no such config value
71 // ignoring this error
72 //alert(key + " : " + err);
73 };
74 },
75 get_bool: function(key) {
76 try {
77 return this._branch.getBoolPref(key);
78 } catch(err) {
79 // this means there is no such config value
80 // ignoring this error
81 //alert(key + " : " + err);
82 };
83 }
84 }
85 ZeitgeistPrefObserver.register();
86 ignored_uris = make_pattern(ZeitgeistPrefObserver.get_string("ignored_uris"));
87 debug("We are ignoring this uris: " + ignored_uris);
88 var enable_googlemail = ZeitgeistPrefObserver.get_bool("enable_googlemail");
89 debug("the googlemail handler extension is activated? ["+enable_googlemail+"]");
90
91 ignore_uri = function(uri) {
92 for (pattern in ignored_uris) {
93 if (ignored_uris[pattern].test(uri)) {
94 // alert("ignored " + uri);
95 return true;
96 };
97 };
98 return false;
99 };
100
101 try {
102 if(zeitgeistgluexpcominterface == null) {
103 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
104 zeitgeistgluexpcominterface = Components.
105 classes["@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"].
106 createInstance(Components.interfaces.zeitgeist);
107 }
108 } catch(err) {
109 alert(err);
110 }
111
112 var ZeitgeistProgressListener = {
113 onStateChange: function(aBrowser, aProgress, aRequest, aStateFlags) {
114 var inPrivateBrowsingMode = pbs.privateBrowsingEnabled;
115 if (inPrivateBrowsingMode) return;
116 if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) {
117 var uri = aBrowser.currentURI.spec;
118 var mimetype = aBrowser.contentDocument.contentType;
119 if (aRequest.name == uri && !ignore_uri(uri)) {
120 zeitgeistgluexpcominterface.insert(
121 uri,
122 mimetype,
123 aBrowser.contentTitle
124 );
125 //alert("THATS WHAT WE HAVE "+enable_googlemail+" | "+uri+" | "+(enable_googlemail & googlemail_view_regex.test(uri)));
126 if (enable_googlemail & googlemail_view_regex.test(uri)) {
127 debug("let's begin the google fun'");
128 var dmt = aBrowser.contentDocument;
129 var head = dmt.getElementsByTagName("title")[0];
130 head.addEventListener("DOMSubtreeModified", function(event){
131 if (dmt.title) {
132 zeitgeistgluexpcominterface.insert(
133 dmt.location.href,
134 dmt.contentType,
135 dmt.title
136 );
137 };
138 }, false);
139 }
140 }
141 }
142 },
143 // we don't implement this methods
144 onStatusChange: function(){},
145 onLocationChange: function(){},
146 onSecurityChange: function(){},
147 onProgressChange: function(){},
148 };
149
150
151 var zeitgeist = {
152 init: function() {
153 gBrowser.addTabsProgressListener(ZeitgeistProgressListener);
154 },
155 uninit: function() {
156 gBrowser.removeTabsProgressListener(ZeitgeistProgressListener);
157 },
158 };
159
160 window.addEventListener("load", function() {zeitgeist.init()}, false);
161 window.addEventListener("unload", function() {zeitgeist.uninit()}, false);
162
163 ]]></script>
164</overlay>
1650
=== removed directory 'firefox-libzg/extension/components'
=== removed file 'firefox-libzg/extension/components/Makefile.am'
--- firefox-libzg/extension/components/Makefile.am 2011-05-02 18:47:16 +0000
+++ firefox-libzg/extension/components/Makefile.am 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
1zeitgeistmoduledir = $(libdir)/xul-ext-zeitgeist
2zeitgeistmodule_LTLIBRARIES = libzeitgeist_xpcom.la
3zeitgeistmodule_DATA = zeitgeist.xpt
4
5xul_extdir = $(datadir)/xul-ext-zeitgeist
6
7libzeitgeist_xpcom_la_SOURCES = \
8 ZeitgeistComponent.cpp \
9 ZeitgeistModule.cpp \
10 $(NULL)
11
12libzeitgeist_xpcom_la_CXXFLAGS = \
13 -include "xpcom-config.h" \
14 $(ZEITGEIST_CFLAGS) \
15 $(LIBXUL_2_0_CFLAGS) \
16 $(NULL)
17
18libzeitgeist_xpcom_la_LIBADD = \
19 $(ZEITGEIST_LIBS) \
20 $(LIBXUL_2_0_LIBS) \
21 $(NULL)
22
23libzeitgeist_xpcom_la_LDFLAGS = \
24 -module -avoid-version \
25 $(NULL)
26
27BUILT_SOURCES = \
28 zeitgeist-library.h \
29 zeitgeist.h \
30 zeitgeist.xpt \
31 $(NULL)
32
33EXTRA_DIST = \
34 zeitgeist.idl \
35 zeitgeistextend.h \
36 $(NULL)
37
38DISTCLEANFILES = \
39 $(BUILT_SOURCES) \
40 $(NULL)
41
42
43zeitgeist.h: zeitgeist.idl
44 $(AM_V_GEN)$(XPIDL_BIN) -m header -I $(XUL_IDLDIR) -o zeitgeist $<
45
46zeitgeist.xpt: zeitgeist.idl
47 $(AM_V_GEN)$(XPIDL_BIN) -m typelib -I $(XUL_IDLDIR) -o zeitgeist $<
48
49zeitgeist-library.h:
50 $(AM_V_GEN)$(LN_S) "`$(PKG_CONFIG) --variable includedir zeitgeist-1.0`/zeitgeist-1.0/zeitgeist.h" $@
51
52install-exec-hook:
53 test -d $(DESTDIR)$(xul_extdir) || $(MKDIR_P) $(DESTDIR)$(xul_extdir)
54 test -h $(DESTDIR)$(xul_extdir)/components || $(LN_S) -f $(DESTDIR)$(zeitgeistmoduledir) $(DESTDIR)$(xul_extdir)/components
55
56# small helper with local install
57local-install: all
58 cp .libs/libzeitgeist_xpcom.so ./
59
60local-uninstall: ;
610
=== removed file 'firefox-libzg/extension/components/ZeitgeistComponent.cpp'
--- firefox-libzg/extension/components/ZeitgeistComponent.cpp 2011-04-29 20:41:04 +0000
+++ firefox-libzg/extension/components/ZeitgeistComponent.cpp 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
1/*
2 * ZeitgeistComponent.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#include "mozilla/ModuleUtils.h"
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27NS_GENERIC_FACTORY_CONSTRUCTOR(zeitgeistextend)
28
29NS_DEFINE_NAMED_CID(ZEITGEIST_COMPONENT_CID);
30
31static const mozilla::Module::CIDEntry kZeitgeistCIDs[] = {
32 { &kZEITGEIST_COMPONENT_CID, false, NULL, zeitgeistextendConstructor },
33 { NULL }
34};
35
36static const mozilla::Module::ContractIDEntry kZeitgeistContracts[] = {
37 { ZEITGEIST_COMPONENT_CONTRACTID, &kZEITGEIST_COMPONENT_CID },
38 { NULL }
39};
40
41static const mozilla::Module kZeitgeistModule = {
42 mozilla::Module::kVersion,
43 kZeitgeistCIDs,
44 kZeitgeistContracts,
45 NULL
46};
47
48NSMODULE_DEFN(ZeitgeistModule) = &kZeitgeistModule;
49
50NS_IMPL_MOZILLA192_NSGETMODULE(&kZeitgeistModule)
510
=== removed file 'firefox-libzg/extension/components/ZeitgeistModule.cpp'
--- firefox-libzg/extension/components/ZeitgeistModule.cpp 2010-05-28 17:56:06 +0000
+++ firefox-libzg/extension/components/ZeitgeistModule.cpp 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
1/*
2 * ZeitgeistModule.cpp
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "zeitgeist.h"
25#include "zeitgeistextend.h"
26
27#include <nsStringAPI.h>
28#include <glib.h>
29#include <glib-object.h>
30#include <zeitgeist.h>
31
32
33using namespace std;
34
35NS_IMPL_ISUPPORTS1(zeitgeistextend, zeitgeist)
36
37zeitgeistextend::zeitgeistextend()
38{
39 g_debug("constructor of zeitgeistextend");
40 g_type_init ();
41
42 log = (ZeitgeistLog *)g_object_new (ZEITGEIST_TYPE_LOG, NULL);
43}
44
45zeitgeistextend::~zeitgeistextend()
46{
47 g_debug("destructor of zeitgeistextend");
48}
49
50NS_IMETHODIMP zeitgeistextend::Insert(const char *url,
51 const char *mimetype,
52 const nsACString &title_str)
53{
54 ZeitgeistEvent *event;
55 gchar *title = NULL;
56
57 g_debug("zeitgeist start - creating event");
58
59 if (!title_str.IsEmpty ())
60 {
61 gsize title_len = title_str.EndReading () - title_str.BeginReading ();
62 title = g_strndup (title_str.BeginReading (), title_len);
63 }
64
65 event = zeitgeist_event_new_full (
66 ZEITGEIST_ZG_ACCESS_EVENT,
67 ZEITGEIST_ZG_USER_ACTIVITY,
68 "application://firefox.desktop",
69 zeitgeist_subject_new_full (
70 url,
71 ZEITGEIST_NFO_WEBSITE,
72 ZEITGEIST_NFO_REMOTE_DATA_OBJECT,
73 mimetype,
74 url,
75 title,
76 "net"),
77 NULL);
78
79 if (title) g_free (title);
80 g_debug("inserting event");
81 zeitgeist_log_insert_events_no_reply(log, event, NULL);
82 g_debug("zeitgeist end");
83
84 return NS_OK;
85}
86
870
=== removed file 'firefox-libzg/extension/components/zeitgeist.idl'
--- firefox-libzg/extension/components/zeitgeist.idl 2010-05-14 16:34:36 +0000
+++ firefox-libzg/extension/components/zeitgeist.idl 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
1/*
2 * zeitgeist.idl
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 * Copyright (C) 2010 - Michal Hruby <michal.mhr@gmail.com>
7 *
8 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 3 of the License, or (at your option) any later version.
12 *
13 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23
24#include "nsISupports.idl"
25[scriptable, uuid(d879c08c-517d-44f0-83e1-3ef75a527ddf)]
26interface zeitgeist : nsISupports
27{
28 void insert(in string url, in string mimetype, in AUTF8String title);
29};
30
310
=== removed file 'firefox-libzg/extension/components/zeitgeistextend.h'
--- firefox-libzg/extension/components/zeitgeistextend.h 2010-06-08 00:24:42 +0000
+++ firefox-libzg/extension/components/zeitgeistextend.h 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
1/*
2 * zeitgeistextend.h
3 * This file is part of zeitgeist dataprovider for firefox
4 *
5 * Copyright (C) 2010 - Markus Korn <thekorn@gmx.de>
6 *
7 * zeitgeist dataprovider for firefox is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 *
12 * zeitgeist dataprovider for firefox is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23#ifndef _ZEITGEISTEXTEND_H_
24#define _ZEITGEISTEXTEND_H_
25
26#include "zeitgeist.h"
27#include "zeitgeist-library.h"
28
29#define ZEITGEIST_COMPONENT_CONTRACTID "@zeitgeist-project.com/DATAPROVIDER/firefox-xpcom;1"
30#define ZEITGEIST_COMPONENT_CLASSNAME "zeitgeist dataprovider for firefox"
31#define ZEITGEIST_COMPONENT_CID { 0xd879c08c, 0x517d, 0x44f0, { 0x83, 0xe1, 0x3e, 0xf7, 0x5a, 0x52, 0x7d, 0xdf } }
32
33//d879c08c-517d-44f0-83e1-3ef75a527ddf
34class zeitgeistextend : public zeitgeist
35{
36 public:
37 NS_DECL_ISUPPORTS
38 NS_DECL_ZEITGEIST
39
40 zeitgeistextend();
41 virtual ~zeitgeistextend();
42 ZeitgeistLog *log;
43
44};
45#endif
460
=== removed directory 'firefox-libzg/extension/defaults'
=== removed directory 'firefox-libzg/extension/defaults/preferences'
=== removed file 'firefox-libzg/extension/defaults/preferences/zeitgeist.js'
--- firefox-libzg/extension/defaults/preferences/zeitgeist.js 2010-05-20 18:33:46 +0000
+++ firefox-libzg/extension/defaults/preferences/zeitgeist.js 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1pref("extensions.zeitgeist.ignored_uris", "[\"^about:*\"]");
2pref("extensions.zeitgeist.enable_googlemail", false);
30
=== removed file 'firefox-libzg/extension/install.rdf'
--- firefox-libzg/extension/install.rdf 2011-05-02 20:13:34 +0000
+++ firefox-libzg/extension/install.rdf 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1<?xml version="1.0"?>
2
3<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4 xmlns:em="http://www.mozilla.org/2004/em-rdf#">
5
6 <Description about="urn:mozilla:install-manifest">
7 <em:id>xpcom_firefox@zeitgeist-project.com</em:id>
8 <em:version>0.3</em:version>
9 <em:type>2</em:type>
10
11 <!-- Target Application this extension can install into,
12 with minimum and maximum supported versions. -->
13 <em:targetApplication>
14 <Description>
15 <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
16 <em:minVersion>4.0</em:minVersion>
17 <em:maxVersion>4.0.*</em:maxVersion>
18 </Description>
19 </em:targetApplication>
20
21 <!-- Front End MetaData -->
22 <em:name>zeitgeist</em:name>
23 <em:description>dataprovider for the zeitgeist framework, using xpcom and libzeitgeist</em:description>
24 <em:creator>Markus Korn</em:creator>
25 <em:homepageURL>http://launchpad.net/zeitgeist</em:homepageURL>
26 <em:iconURL>chrome://zeitgeist/content/zeitgeist.png</em:iconURL>
27 </Description>
28</RDF>
290
=== removed file 'firefox-libzg/extension/license.txt'
--- firefox-libzg/extension/license.txt 2010-05-12 06:44:01 +0000
+++ firefox-libzg/extension/license.txt 1970-01-01 00:00:00 +0000
@@ -1,166 +0,0 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the event an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatever part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and reverse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License ever published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library.
166

Subscribers

People subscribed via source and target branches