Merge lp:~manishsinha/zeitgeist-datasources/reworked-tomboy into lp:zeitgeist-datasources/0.8

Status: Rejected
Rejected by: Seif Lotfy
Proposed branch: lp:~manishsinha/zeitgeist-datasources/reworked-tomboy
Merge into: lp:zeitgeist-datasources/0.8
Diff against target: 962 lines (+528/-247)
13 files modified
Makefile.include (+118/-0)
configure.ac (+28/-4)
tomboy/AssemblyInfo.cs (+27/-0)
tomboy/Makefile.am (+103/-0)
tomboy/NoteHandler.cs (+69/-0)
tomboy/Tomboy.Zeitgeist.csproj (+65/-0)
tomboy/Tomboy.Zeitgeist.sln (+20/-0)
tomboy/Zeitgeist.addin.xml (+2/-2)
tomboy/Zeitgeist.cs (+0/-200)
tomboy/Zeitgeist.mdp (+0/-28)
tomboy/ZeitgeistAddin.cs (+90/-0)
tomboy/install.sh (+0/-13)
tomboy/tomboy.zeitgeist.pc (+6/-0)
To merge this branch: bzr merge lp:~manishsinha/zeitgeist-datasources/reworked-tomboy
Reviewer Review Type Date Requested Status
Michal Hruby Pending
Review via email: mp+35961@code.launchpad.net

This proposal supersedes a proposal from 2010-09-19.

Description of the change

Reimplemented Tomboy's data provider using zeitgeist-sharp
http://launchpad.net/zeitgeist-sharp

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote : Posted in a previous version of this proposal

From a quick look (I'm not using Tomboy):
- 'TomboyUri' should be just application://tomboy.desktop
- please get rid of the install.sh script, everything is now done using Makefiles
- I really don't like the bundled dll library, isn't there another way to check for it?

review: Needs Fixing
Revision history for this message
Manish Sinha (मनीष सिन्हा) (manishsinha) wrote : Posted in a previous version of this proposal

> From a quick look (I'm not using Tomboy):
> - 'TomboyUri' should be just application://tomboy.desktop
Doing it.

> - please get rid of the install.sh script, everything is now done using
> Makefiles
Yeah. Have to get it working. I just kept the old way of building.
> - I really don't like the bundled dll library, isn't there another way to
> check for it?
Until zeitgeist-sharp is not made available in the PPA/Repo, till then we have to keep it here. Once it is made available, then we can get rid of this. BTW this bundled dll is just a workaround till zg-sharp makes it into APT repo

Unmerged revisions

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

Removed the old mdp based builds

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

Modified build to include tomboy too

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

Added Simple Makefile support with most common targets. The config script does the basic package dependency checking

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

Changed the App name to application://tomboy.desktop and created a sln file

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

Implemented Note open, closed, deleted, hidden and renamed

Zeitgeist.dll is added in the source control. Once it is packages and available in the APT repos, it can be removed from the source code

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

Created the basic infrastructure for using Zeitgeist.dll. At present Logging is not implemented

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'Makefile.include'
--- Makefile.include 1970-01-01 00:00:00 +0000
+++ Makefile.include 2010-09-19 19:02:39 +0000
@@ -0,0 +1,118 @@
1VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT
2
3s2q=$(subst \ ,?,$1)
4q2s=$(subst ?,\ ,$1)
5# use this when result will be quoted
6unesc2=$(subst ?, ,$1)
7
8build_sources = $(FILES) $(GENERATED_FILES)
9build_sources_esc= $(call s2q,$(build_sources))
10# use unesc2, as build_sources_embed is quoted
11build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%'))
12
13comma__=,
14get_resource_name = $(firstword $(subst $(comma__), ,$1))
15get_culture = $(lastword $(subst ., ,$(basename $1)))
16is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1)))))
17
18RESOURCES_ESC=$(call s2q,$(RESOURCES))
19
20build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),))
21build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
22build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
23build_others_list = $(build_non_culture_others_list)
24build_xamlg_list = $(filter %.xaml.g.cs, $(FILES))
25
26# resgen all .resx resources
27build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res)))
28build_resx_resources_esc = $(build_resx_files:.resx=.resources)
29build_resx_resources = $(call q2s,$(build_resx_resources_esc))
30
31# embed resources for the main assembly
32build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list))
33# use unesc2, as build_resx_resources_embed is quoted
34build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%'))
35build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res))))
36build_others_resources = $(build_others_files)
37# use unesc2, as build_others_resources_embed is quoted
38build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%'))
39
40build_resources = $(build_resx_resources) $(build_others_resources)
41build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed)
42
43# -usesourcepath is available only for resgen2
44emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')'
45emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@'
46
47emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1))
48emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res))))
49
50build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))))
51build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref)))
52build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref)))
53
54s2q2s=$(call unesc2,$(call s2q,$1))
55cp_actual=test -z $1 || cp $1 $2
56cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)')
57
58rm_actual=test -z '$1' || rm -f '$2'
59rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)'))
60
61EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files)
62CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list)
63DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/*
64
65pkglib_SCRIPTS = $(ASSEMBLY)
66bin_SCRIPTS = $(BINARIES)
67
68programfilesdir = @libdir@/@PACKAGE@
69programfiles_DATA = $(PROGRAMFILES)
70linuxpkgconfigdir = @libdir@/pkgconfig
71linuxpkgconfig_DATA = $(LINUX_PKGCONFIG)
72
73
74# macros
75
76# $(call emit-deploy-target,deploy-variable-name)
77define emit-deploy-target
78$($1): $($1_SOURCE)
79 mkdir -p '$$(shell dirname '$$@')'
80 cp '$$<' '$$@'
81endef
82
83# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x)
84# assumes that for a wrapper foo.pc its source template is foo.pc.in
85# if $3 is non-empty then wrapper is marked exec
86define emit-deploy-wrapper
87$($1): $2
88 mkdir -p '$$(shell dirname '$$@')'
89 cp '$$<' '$$@'
90 $(if $3,chmod +x '$$@')
91
92endef
93
94# generating satellite assemblies
95
96culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res)))
97cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res)))))
98culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2))
99culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)')
100build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)))
101build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res))))
102install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list))
103
104$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res))))))
105$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res)))))
106
107$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME):
108 mkdir -p '$(@D)'
109 $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*)
110
111$(install_satellite_assembly_list):
112 mkdir -p '$(@D)'
113 cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@
114
115install-satellite-assemblies: $(install_satellite_assembly_list)
116
117uninstall-satellite-assemblies:
118 rm -rf $(install_satellite_assembly_list)
0\ No newline at end of file119\ No newline at end of file
1120
=== modified file 'configure.ac'
--- configure.ac 2010-08-05 20:45:47 +0000
+++ configure.ac 2010-09-19 19:02:39 +0000
@@ -51,8 +51,8 @@
51AC_MSG_RESULT($all_plugins)51AC_MSG_RESULT($all_plugins)
5252
53# The full list of plugins53# The full list of plugins
54allowed_plugins="bzr chrome eog firefox-libzg geany gedit rhythmbox totem-libzg vim emacs"54allowed_plugins="bzr chrome eog firefox-libzg geany gedit rhythmbox totem-libzg vim emacs tomboy"
55# currently disabled = "epiphany tomboy"55# currently disabled = "epiphany"
5656
57# npapi-plugin has a template Makefile.am, but don't use it directly57# npapi-plugin has a template Makefile.am, but don't use it directly
58# - see chrome's Makefile.am for how to compile it58# - see chrome's Makefile.am for how to compile it
@@ -152,8 +152,31 @@
152 fi152 fi
153 ;;153 ;;
154 tomboy)154 tomboy)
155 # not supported atm155 AC_PATH_PROG(GMCS, gmcs, no)
156 continue156 PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0])
157 if test "x$GMCS" = "xno"; then
158 AC_MSG_ERROR([gmcs Not found])
159 fi
160 AC_ARG_ENABLE(debug,
161 AC_HELP_STRING([--enable-debug],
162 [Use 'DEBUG' Configuration [default=NO]]),
163 enable_debug=yes, enable_debug=no)
164 AM_CONDITIONAL(ENABLE_DEBUG, test x$enable_debug = xyes)
165 if test "x$enable_debug" = "xyes" ; then
166 CONFIG_REQUESTED="yes"
167 fi
168 AC_ARG_ENABLE(release,
169 AC_HELP_STRING([--enable-release],
170 [Use 'RELEASE' Configuration [default=YES]]),
171 enable_release=yes, enable_release=no)
172 AM_CONDITIONAL(ENABLE_RELEASE, test x$enable_release = xyes)
173 if test "x$enable_release" = "xyes" ; then
174 CONFIG_REQUESTED="yes"
175 fi
176 if test -z "$CONFIG_REQUESTED" ; then
177 AM_CONDITIONAL(ENABLE_RELEASE, true)
178 enable_release=yes
179 fi
157 ;;180 ;;
158 totem*)181 totem*)
159 if test "${with_vala}" != "yes" ; then182 if test "${with_vala}" != "yes" ; then
@@ -217,6 +240,7 @@
217totem-libzg/Makefile240totem-libzg/Makefile
218vim/Makefile241vim/Makefile
219emacs/Makefile242emacs/Makefile
243tomboy/Makefile
220])244])
221245
222AC_MSG_NOTICE([Zeitgeist-dataproviders was configured with the following options:])246AC_MSG_NOTICE([Zeitgeist-dataproviders was configured with the following options:])
223247
=== added file 'tomboy/AssemblyInfo.cs'
--- tomboy/AssemblyInfo.cs 1970-01-01 00:00:00 +0000
+++ tomboy/AssemblyInfo.cs 2010-09-19 19:02:39 +0000
@@ -0,0 +1,27 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3
4// Information about this assembly is defined by the following attributes.
5// Change them to the values specific to your project.
6
7[assembly: AssemblyTitle("Tomboy.Zeitgeist")]
8[assembly: AssemblyDescription("")]
9[assembly: AssemblyConfiguration("")]
10[assembly: AssemblyCompany("")]
11[assembly: AssemblyProduct("")]
12[assembly: AssemblyCopyright("Zeitgeist Sharp Developers")]
13[assembly: AssemblyTrademark("")]
14[assembly: AssemblyCulture("")]
15
16// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17// The form "{Major}.{Minor}.*" will automatically update the build and revision,
18// and "{Major}.{Minor}.{Build}.*" will update just the revision.
19
20[assembly: AssemblyVersion("0.1.0.*")]
21
22// The following attributes are used to specify the signing key for the assembly,
23// if desired. See the Mono documentation for more information about signing.
24
25//[assembly: AssemblyDelaySign(false)]
26//[assembly: AssemblyKeyFile("")]
27
028
=== added file 'tomboy/Makefile.am'
--- tomboy/Makefile.am 1970-01-01 00:00:00 +0000
+++ tomboy/Makefile.am 2010-09-19 19:02:39 +0000
@@ -0,0 +1,103 @@
1
2EXTRA_DIST = expansions.m4 /usr/lib/tomboy/Tomboy.exe Zeitgeist.dll
3
4#Warning: This is an automatically generated file, do not edit!
5if ENABLE_DEBUG
6 SUBDIRS = .
7endif
8if ENABLE_RELEASE
9 SUBDIRS = .
10endif
11
12
13
14# Warning: This is an automatically generated file, do not edit!
15
16if ENABLE_DEBUG
17ASSEMBLY_COMPILER_COMMAND = gmcs
18ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG"
19ASSEMBLY = bin/Debug/Tomboy.Zeitgeist.dll
20ASSEMBLY_MDB = $(ASSEMBLY).mdb
21COMPILE_TARGET = library
22PROJECT_REFERENCES =
23BUILD_DIR = bin/Debug
24
25ZEITGEIST_DLL_SOURCE=Zeitgeist.dll
26TOMBOY_ZEITGEIST_DLL_MDB_SOURCE=bin/Debug/Tomboy.Zeitgeist.dll.mdb
27TOMBOY_ZEITGEIST_DLL_MDB=$(BUILD_DIR)/Tomboy.Zeitgeist.dll.mdb
28
29endif
30
31if ENABLE_RELEASE
32ASSEMBLY_COMPILER_COMMAND = gmcs
33ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize-
34ASSEMBLY = bin/Release/Tomboy.Zeitgeist.dll
35ASSEMBLY_MDB =
36COMPILE_TARGET = library
37PROJECT_REFERENCES =
38BUILD_DIR = bin/Release
39
40ZEITGEIST_DLL_SOURCE=Zeitgeist.dll
41TOMBOY_ZEITGEIST_DLL_MDB=
42
43endif
44
45AL=al2
46SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
47
48PROGRAMFILES = \
49 $(ZEITGEIST_DLL) \
50 $(TOMBOY_ZEITGEIST_DLL_MDB)
51
52LINUX_PKGCONFIG = \
53 $(TOMBOY_ZEITGEIST_PC)
54
55
56RESGEN=resgen2
57
58all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG)
59
60FILES = \
61 AssemblyInfo.cs \
62 ZeitgeistAddin.cs \
63 NoteHandler.cs \
64 Zeitgeist.cs
65
66DATA_FILES =
67
68RESOURCES = \
69 Zeitgeist.addin.xml,Tomboy.Zeitgeist.Zeitgeist.addin.xml
70
71EXTRAS = \
72 tomboy.zeitgeist.pc.in
73
74REFERENCES = \
75 System \
76 $(GTK_SHARP_20_LIBS) \
77 Mono.Posix \
78 $(GLIB_SHARP_20_LIBS)
79
80DLL_REFERENCES = \
81 /usr/lib/tomboy/Tomboy.exe \
82 Zeitgeist.dll
83
84CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG)
85
86include $(top_srcdir)/Makefile.include
87
88ZEITGEIST_DLL = $(BUILD_DIR)/Zeitgeist.dll
89TOMBOY_ZEITGEIST_PC = $(BUILD_DIR)/tomboy.zeitgeist.pc
90
91$(eval $(call emit-deploy-target,ZEITGEIST_DLL))
92$(eval $(call emit-deploy-wrapper,TOMBOY_ZEITGEIST_PC,tomboy.zeitgeist.pc))
93
94
95$(eval $(call emit_resgen_targets))
96$(build_xamlg_list): %.xaml.g.cs: %.xaml
97 xamlg '$<'
98
99$(ASSEMBLY_MDB): $(ASSEMBLY)
100
101$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
102 mkdir -p $(shell dirname $(ASSEMBLY))
103 $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
0104
=== added file 'tomboy/NoteHandler.cs'
--- tomboy/NoteHandler.cs 1970-01-01 00:00:00 +0000
+++ tomboy/NoteHandler.cs 2010-09-19 19:02:39 +0000
@@ -0,0 +1,69 @@
1using System;
2using Zeitgeist.Datamodel;
3using System.Collections.Generic;
4
5namespace Tomboy.Zeitgeist
6{
7 public class NoteHandler
8 {
9 public NoteHandler(Note note)
10 {
11 // Check if the Note has already been processes.
12 // Whent he note is being processed, event handlers are attached to
13 if (handledNotes.Contains(note) == false)
14 {
15 this._note = note;
16
17 note.Opened += HandleNoteOpened;
18 if (note.HasWindow)
19 {
20 HandleNoteOpened();
21 }
22 }
23 }
24
25 void HandleNoteOpened (object sender, EventArgs e)
26 {
27 HandleNoteOpened();
28 }
29
30 void HandleNoteOpened()
31 {
32 this._note.Window.Hidden += HandleNoteWindowHidden;
33 this._note.Window.Shown += HandleNoteWindowShown;
34 this._note.Renamed += HandleNoteRenamed;
35 if (this._note.Window.Visible)
36 {
37 HandleNoteWindowShown();
38 }
39 }
40
41 void HandleNoteRenamed (Note sender, string old_title)
42 {
43 Console.WriteLine("Zg#: Renamed: " + this._note.Title);
44 ZeitgeistHandler.SendEvent(sender, Interpretation.Instance.EventInterpretation.ModifyEvent);
45 }
46
47 void HandleNoteWindowShown (object sender, EventArgs e)
48 {
49 HandleNoteWindowShown();
50 }
51
52 void HandleNoteWindowShown ()
53 {
54 Console.WriteLine("Zg#: Note window opened: " + this._note.Title);
55 ZeitgeistHandler.SendEvent(this._note, Interpretation.Instance.EventInterpretation.AccessEvent);
56 }
57
58 void HandleNoteWindowHidden (object sender, EventArgs e)
59 {
60 Console.WriteLine("Zg#: Note window closed: " + this._note.Title);
61 ZeitgeistHandler.SendEvent(this._note, Interpretation.Instance.EventInterpretation.LeaveEvent);
62 }
63
64 private Note _note;
65
66 private static List<Note> handledNotes = new List<Note>();
67 }
68}
69
070
=== added file 'tomboy/Tomboy.Zeitgeist.csproj'
--- tomboy/Tomboy.Zeitgeist.csproj 1970-01-01 00:00:00 +0000
+++ tomboy/Tomboy.Zeitgeist.csproj 2010-09-19 19:02:39 +0000
@@ -0,0 +1,65 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup>
4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6 <ProductVersion>9.0.21022</ProductVersion>
7 <SchemaVersion>2.0</SchemaVersion>
8 <ProjectGuid>{4DC09956-B20D-4ECA-8ACD-17E7609BAE41}</ProjectGuid>
9 <OutputType>Library</OutputType>
10 <RootNamespace>Tomboy.Zeitgeist</RootNamespace>
11 <AssemblyName>Tomboy.Zeitgeist</AssemblyName>
12 </PropertyGroup>
13 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14 <DebugSymbols>true</DebugSymbols>
15 <DebugType>full</DebugType>
16 <Optimize>false</Optimize>
17 <OutputPath>bin\Debug</OutputPath>
18 <DefineConstants>DEBUG</DefineConstants>
19 <ErrorReport>prompt</ErrorReport>
20 <WarningLevel>4</WarningLevel>
21 <ConsolePause>false</ConsolePause>
22 </PropertyGroup>
23 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
24 <DebugType>none</DebugType>
25 <Optimize>false</Optimize>
26 <OutputPath>bin\Release</OutputPath>
27 <ErrorReport>prompt</ErrorReport>
28 <WarningLevel>4</WarningLevel>
29 <ConsolePause>false</ConsolePause>
30 </PropertyGroup>
31 <ItemGroup>
32 <Reference Include="System" />
33 <Reference Include="Tomboy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
34 <SpecificVersion>False</SpecificVersion>
35 <HintPath>\usr\lib\tomboy\Tomboy.exe</HintPath>
36 <Private>False</Private>
37 </Reference>
38 <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
39 <Package>gtk-sharp-2.0</Package>
40 </Reference>
41 <Reference Include="Mono.Posix" />
42 <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
43 <Package>glib-sharp-2.0</Package>
44 </Reference>
45 <Reference Include="Zeitgeist, Version=1.0.3914.35475, Culture=neutral, PublicKeyToken=null">
46 <SpecificVersion>False</SpecificVersion>
47 <HintPath>Zeitgeist.dll</HintPath>
48 </Reference>
49 </ItemGroup>
50 <ItemGroup>
51 <Compile Include="AssemblyInfo.cs" />
52 <Compile Include="ZeitgeistAddin.cs" />
53 <Compile Include="NoteHandler.cs" />
54 <Compile Include="Zeitgeist.cs" />
55 </ItemGroup>
56 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
57 <ItemGroup>
58 <EmbeddedResource Include="Zeitgeist.addin.xml" />
59 </ItemGroup>
60 <ProjectExtensions>
61 <MonoDevelop>
62 <Properties InternalTargetFrameworkVersion="3.5" />
63 </MonoDevelop>
64 </ProjectExtensions>
65</Project>
066
=== added file 'tomboy/Tomboy.Zeitgeist.sln'
--- tomboy/Tomboy.Zeitgeist.sln 1970-01-01 00:00:00 +0000
+++ tomboy/Tomboy.Zeitgeist.sln 2010-09-19 19:02:39 +0000
@@ -0,0 +1,20 @@
1
2Microsoft Visual Studio Solution File, Format Version 9.00
3# Visual Studio 2005
4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tomboy.Zeitgeist", "Tomboy.Zeitgeist.csproj", "{2591D85F-7B39-486E-8260-D9022DE8BDE6}"
5EndProject
6Global
7 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 Debug|Any CPU = Debug|Any CPU
9 Release|Any CPU = Release|Any CPU
10 EndGlobalSection
11 GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 {2591D85F-7B39-486E-8260-D9022DE8BDE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 {2591D85F-7B39-486E-8260-D9022DE8BDE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 {2591D85F-7B39-486E-8260-D9022DE8BDE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 {2591D85F-7B39-486E-8260-D9022DE8BDE6}.Release|Any CPU.Build.0 = Release|Any CPU
16 EndGlobalSection
17 GlobalSection(MonoDevelopProperties) = preSolution
18 StartupItem = Tomboy.Zeitgeist.csproj
19 EndGlobalSection
20EndGlobal
021
=== modified file 'tomboy/Zeitgeist.addin.xml'
--- tomboy/Zeitgeist.addin.xml 2010-08-16 11:07:09 +0000
+++ tomboy/Zeitgeist.addin.xml 2010-09-19 19:02:39 +0000
@@ -1,14 +1,14 @@
1<Addin id="Zeitgeist"1<Addin id="Zeitgeist"
2 namespace="Tomboy"2 namespace="Tomboy"
3 name="Zeitgeist Integration"3 name="Zeitgeist Integration"
4 author="Laszlo Pandy laszlok2@gmail.com"4 author="Manish Sinha"
5 description="Logs usage data to Zeitgeist."5 description="Logs usage data to Zeitgeist."
6 category="Desktop Integration"6 category="Desktop Integration"
7 defaultEnabled="true"7 defaultEnabled="true"
8 version="0.1">8 version="0.1">
99
10 <Runtime>10 <Runtime>
11 <Import assembly="Zeitgeist.dll" />11 <Import assembly="Tomboy.Zeitgeist.dll" />
12 </Runtime>12 </Runtime>
1313
14 <Dependencies>14 <Dependencies>
1515
=== added file 'tomboy/Zeitgeist.cs'
--- tomboy/Zeitgeist.cs 1970-01-01 00:00:00 +0000
+++ tomboy/Zeitgeist.cs 2010-09-19 19:02:39 +0000
@@ -0,0 +1,83 @@
1using System;
2using Zeitgeist.Datamodel;
3using Zeitgeist;
4using System.Collections.Generic;
5using Tomboy;
6
7namespace Tomboy.Zeitgeist
8{
9 public class ZeitgeistHandler
10 {
11 public static bool SendEvent(Note note, KeyValuePair<string,string> eventInterpretation)
12 {
13 KeyValuePair<string,string> eventManifestation = Manifestation.Instance.EventManifestation.UserActivity;
14
15 KeyValuePair<string,string> subjectInterpretation = Interpretation.Instance.Document.Document;
16 KeyValuePair<string,string> subjectManifestation = Manifestation.Instance.FileDataObject.FileDataObject;
17
18 Event ev = EventCreator.CreateEvent(note, eventInterpretation, eventManifestation, subjectInterpretation, subjectManifestation);
19
20
21 try
22 {
23 List<Event> listOfEvents = new List<Event>();
24 listOfEvents.Add(ev);
25
26 GLib.Idle.Add(delegate()
27 {
28 SendEvent(listOfEvents);
29 return false;
30 });
31
32 Console.WriteLine(string.Format("Operation {0} successful", ev.Interpretation.Key));
33 return true;
34 }
35 catch(Exception e)
36 {
37 Console.WriteLine(e.StackTrace);
38
39 return false;
40 }
41 }
42
43 private static void SendEvent(List<Event> e)
44 {
45 LogClient client = new LogClient();
46 client.InsertEvents(e);
47 }
48 }
49
50 public class EventCreator
51 {
52 public static Event CreateEvent(Note note,
53 KeyValuePair<string,string> eventInterpretation,
54 KeyValuePair<string,string> eventManifestation,
55 KeyValuePair<string,string> subjectInterpretation,
56 KeyValuePair<string,string> subjectManifestation)
57 {
58 Event ev = new Event();
59
60
61 ev.Id = 0;
62 ev.Timestamp = DateTime.Now;
63 ev.Interpretation = eventInterpretation;
64 ev.Manifestation = eventManifestation;
65 ev.Actor = ZeitgeistAddin.TomboyUri;
66
67 Subject sub = new Subject();
68
69 sub.Uri = note.Uri;
70 sub.Interpretation = subjectInterpretation;
71 sub.Manifestation = subjectManifestation;
72 sub.Origin = string.Empty;
73 sub.MimeType = ZeitgeistAddin.NoteMimetype;
74 sub.Text = note.Title;
75 sub.Storage = string.Empty;
76
77 ev.Subjects.Add(sub);
78
79 return ev;
80 }
81 }
82}
83
084
=== removed file 'tomboy/Zeitgeist.cs'
--- tomboy/Zeitgeist.cs 2010-08-19 10:33:11 +0000
+++ tomboy/Zeitgeist.cs 1970-01-01 00:00:00 +0000
@@ -1,200 +0,0 @@
1
2using System;
3using System.Collections.Generic;
4using Tomboy;
5using NDesk.DBus;
6using Gtk;
7using GLib;
8using Mono.Unix.Native;
9
10namespace Tomboy.Zeitgeist
11{
12 class NoteHandler
13 {
14 private static List<string> handled_notes = new List<string>();
15 private Note note;
16
17 public NoteHandler(Note note) {
18 if (handled_notes.Contains(note.Id) == false) {
19 this.note = note;
20 note.Opened += HandleNoteOpened;
21 if (note.HasWindow) {
22 HandleNoteOpened();
23 }
24 }
25 }
26
27 void HandleNoteOpened (object sender, EventArgs e) {
28 HandleNoteOpened();
29 }
30 void HandleNoteOpened() {
31 note.Window.Hidden += HandleNoteWindowHidden;
32 note.Window.Shown += HandleNoteWindowShown;
33 note.Renamed += HandleNoteRenamed;
34 if (note.Window.Visible) {
35 HandleNoteWindowShown();
36 }
37 }
38
39 void HandleNoteRenamed (Note sender, string old_title)
40 {
41 Console.WriteLine("Zg: Renamed: " + note.Title);
42 ZeitgeistDbus.SendToZeitgeist(note, ZeitgeistDbus.EventInterpretation.ModifyEvent);
43 }
44
45 void HandleNoteWindowShown (object sender, EventArgs e) {
46 HandleNoteWindowShown();
47 }
48 void HandleNoteWindowShown ()
49 {
50 Console.WriteLine("Zg: Note window opened: " + note.Title);
51 ZeitgeistDbus.SendToZeitgeist(note, ZeitgeistDbus.EventInterpretation.OpenEvent);
52 }
53
54 void HandleNoteWindowHidden (object sender, EventArgs e)
55 {
56 Console.WriteLine("Zg: Note window closed: " + note.Title);
57 ZeitgeistDbus.SendToZeitgeist(note, ZeitgeistDbus.EventInterpretation.CloseEvent);
58 }
59 }
60
61 class ZeitgeistDbus
62 {
63 private static ILogger zeitgeist_proxy =
64 Bus.Session.GetObject<ILogger>("org.gnome.zeitgeist.Engine",
65 new ObjectPath("/org/gnome/zeitgeist/log/activity"));
66
67 public enum EventInterpretation {
68 OpenEvent,
69 CloseEvent,
70 CreateEvent,
71 ModifyEvent,
72 }
73
74 private static string GetEventInterpetation(EventInterpretation e) {
75 switch(e) {
76 case EventInterpretation.OpenEvent:
77 return "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent";
78 case EventInterpretation.CloseEvent:
79 return "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent";
80 case EventInterpretation.CreateEvent:
81 return "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent";
82 case EventInterpretation.ModifyEvent:
83 return "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent";
84 default:
85 return null;
86 }
87 }
88
89 public static void SendToZeitgeist(Note note, EventInterpretation ev_interp) {
90 if (zeitgeist_proxy == null) {
91 Console.WriteLine("Zg: cannot connect to zeitgeist, dbus proxy is null");
92 return;
93 }
94
95 string ev_interp_string = GetEventInterpetation(ev_interp);
96 if (ev_interp_string == null) {
97 Console.WriteLine("Zg: unknown interpretation type: " + ev_interp.ToString());
98 return;
99 }
100
101 Timeval t;
102 Syscall.gettimeofday(out t);
103 long millis_now = (t.tv_sec * 1000) + (t.tv_usec / 1000);
104
105 Event e = new Event();
106 e.metadata = new string[5];
107 e.metadata[0] = ""; //id (filled in by Zeitgeist)
108 e.metadata[1] = millis_now.ToString();
109 e.metadata[2] = ev_interp_string;
110 e.metadata[3] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity";
111 e.metadata[4] = "application://tomboy.desktop";
112
113 string[] subject = new string[7];
114 subject[0] = note.Uri;
115 subject[1] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document";
116 subject[2] = "http://www.semanticdesktop.org/ontologies/nfo#FileDataObject";
117 subject[3] = ""; //origin
118 subject[4] = "application/x-tomboy"; //mimetype
119 subject[5] = note.Title;
120 subject[6] = ""; //storage id
121
122 e.subjects = new string[][] { subject };
123 e.payload = new byte[0];
124
125 GLib.Idle.Add(delegate() {
126 SendEvent(e);
127 return false;
128 });
129 }
130
131 private static void SendEvent(Event e) {
132 int[] inserted;
133 try {
134 inserted = zeitgeist_proxy.InsertEvents(new Event[] { e });
135 } catch (Exception ex) {
136 Console.WriteLine("Zg: insertion failed: " + ex.Message);
137 return;
138 }
139
140 if (inserted.Length > 0) {
141 Console.WriteLine("Zg: Inserted event: " + inserted[0]);
142 }
143 else {
144 Console.WriteLine("Zg: Insertion failed");
145 }
146 return;
147 }
148 }
149
150 [NDesk.DBus.Interface ("org.gnome.zeitgeist.Log")]
151 interface ILogger {
152 int[] InsertEvents(Event[] events);
153 }
154
155 struct Event {
156 public string[] metadata;
157 public string[][] subjects;
158 public byte[] payload;
159 }
160
161 public class ZeitgeistAddin : ApplicationAddin
162 {
163 private bool _init = false;
164 public override bool Initialized {
165 get { return _init; }
166 }
167
168 public override
169 void Initialize() {
170 Console.WriteLine("Zg: init new");
171 init_handlers();
172 _init = true;
173 }
174
175 public override
176 void Shutdown() {
177 Console.WriteLine("Zg: shutdown");
178 }
179
180 void HandleNoteAdded(object sender, Note new_note) {
181 Console.WriteLine("Zg: Note added: " + new_note.Title);
182 Console.WriteLine("\t" + new_note.Uri);
183
184 new NoteHandler(new_note);
185 ZeitgeistDbus.SendToZeitgeist(new_note, ZeitgeistDbus.EventInterpretation.CreateEvent);
186 }
187
188 public void init_handlers() {
189 foreach (Note note in Tomboy.DefaultNoteManager.Notes) {
190 new NoteHandler(note);
191 }
192
193 Tomboy.DefaultNoteManager.NoteAdded -= HandleNoteAdded;
194 Tomboy.DefaultNoteManager.NoteAdded += HandleNoteAdded;
195 }
196 }
197
198
199
200}
2010
=== added file 'tomboy/Zeitgeist.dll'
202Binary files tomboy/Zeitgeist.dll 1970-01-01 00:00:00 +0000 and tomboy/Zeitgeist.dll 2010-09-19 19:02:39 +0000 differ1Binary files tomboy/Zeitgeist.dll 1970-01-01 00:00:00 +0000 and tomboy/Zeitgeist.dll 2010-09-19 19:02:39 +0000 differ
=== removed file 'tomboy/Zeitgeist.mdp'
--- tomboy/Zeitgeist.mdp 2010-08-16 10:57:40 +0000
+++ tomboy/Zeitgeist.mdp 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1<Project name="Zeitgeist" fileversion="2.0" DefaultNamespace="Zeitgeist" language="C#" targetFramework="2.0" ctype="DotNetProject">
2 <Configurations active="Debug">
3 <Configuration name="Debug" ctype="DotNetProjectConfiguration">
4 <Output directory="bin/Debug" assembly="Zeitgeist" />
5 <Build debugmode="True" target="Library" />
6 <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" />
7 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
8 </Configuration>
9 <Configuration name="Release" ctype="DotNetProjectConfiguration">
10 <Output directory="bin/Release" assembly="Zeitgeist" />
11 <Build debugmode="False" target="Library" />
12 <Execution consolepause="False" runwithwarnings="True" runtime="MsNet" />
13 <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
14 </Configuration>
15 </Configurations>
16 <Contents>
17 <File subtype="Code" buildaction="Compile" name="Zeitgeist.cs" />
18 <File subtype="Code" buildaction="EmbedAsResource" name="Zeitgeist.addin.xml" />
19 </Contents>
20 <References>
21 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
22 <ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
23 <ProjectReference type="Gac" localcopy="True" refto="NDesk.DBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6716e4f9b2ed099" />
24 <ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
25 <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
26 <ProjectReference type="Assembly" localcopy="True" specificVersion="False" refto="/usr/lib/tomboy/Tomboy.exe" />
27 </References>
28</Project>
290
=== added file 'tomboy/ZeitgeistAddin.cs'
--- tomboy/ZeitgeistAddin.cs 1970-01-01 00:00:00 +0000
+++ tomboy/ZeitgeistAddin.cs 2010-09-19 19:02:39 +0000
@@ -0,0 +1,90 @@
1using System;
2using Tomboy;
3using System.Collections.Generic;
4using System.IO;
5using Zeitgeist.Datamodel;
6
7namespace Tomboy.Zeitgeist
8{
9 public class ZeitgeistAddin : ApplicationAddin
10 {
11 public ZeitgeistAddin ()
12 {
13 notesList = new List<NoteHandler>();
14 }
15
16 #region Overridden methods
17
18 public override bool Initialized
19 {
20 get
21 {
22 return _init;
23 }
24 }
25
26 public override void Initialize()
27 {
28 Console.WriteLine("Zg#: init new");
29
30 // Initialize the handlers for hooking into Tomboy
31 InitHandlers();
32
33 _init = true;
34 }
35
36 public override void Shutdown()
37 {
38 Console.WriteLine("Zg#: shutdown");
39 }
40
41 #endregion
42
43 public void InitHandlers()
44 {
45 // For every note present in the store
46
47 foreach (Note note in Tomboy.DefaultNoteManager.Notes)
48 {
49 notesList.Add(new NoteHandler(note));
50 }
51
52 Tomboy.DefaultNoteManager.NoteAdded -= HandleNoteAdded;
53 Tomboy.DefaultNoteManager.NoteAdded += HandleNoteAdded;
54
55 Tomboy.DefaultNoteManager.NoteDeleted -= HandleNoteDeleted;
56 Tomboy.DefaultNoteManager.NoteDeleted += HandleNoteDeleted;
57 }
58
59 void HandleNoteAdded(object sender, Note new_note)
60 {
61 Console.WriteLine("Zg#: Note added: " + new_note.Title);
62 Console.WriteLine("\t" + new_note.Uri);
63
64 notesList.Add(new NoteHandler(new_note));
65
66 ZeitgeistHandler.SendEvent(new_note, Interpretation.Instance.EventInterpretation.CreateEvent);
67 }
68
69 void HandleNoteDeleted(object sender, Note new_note)
70 {
71 Console.WriteLine("Zg#: Note deleted: " + new_note.Title);
72 Console.WriteLine("\t" + new_note.Uri);
73
74 ZeitgeistHandler.SendEvent(new_note, Interpretation.Instance.EventInterpretation.DeleteEvent);
75 }
76
77 List<NoteHandler> notesList;
78
79 private bool _init = false;
80
81 #region Public Constants
82
83 public const string TomboyUri = "application://tomboy.desktop";
84
85 public const string NoteMimetype = "application/x-tomboy";
86
87 #endregion
88 }
89}
90
091
=== removed file 'tomboy/install.sh'
--- tomboy/install.sh 2010-02-03 16:06:55 +0000
+++ tomboy/install.sh 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1#!/bin/sh
2
3mkdir -p ~/.config/tomboy/addins/
4
5# Please install monodevelop to get mdtool.
6# Please edit Zeitgeist.mdp and change the local path of Tomboy.exe
7# to the correct one for your environment (so it can link to the
8# correct version of Tomboy).
9mdtool build Zeitgeist.mdp
10
11cp bin/Debug/Zeitgeist.dll ~/.config/tomboy/addins/Zeitgeist.dll
12
13
140
=== added file 'tomboy/tomboy.zeitgeist.pc'
--- tomboy/tomboy.zeitgeist.pc 1970-01-01 00:00:00 +0000
+++ tomboy/tomboy.zeitgeist.pc 2010-09-19 19:02:39 +0000
@@ -0,0 +1,6 @@
1Name: Tomboy.Zeitgeist
2Description: Tomboy.Zeitgeist
3Version: 0.1
4
5Requires:
6Libs: -r:@expanded_libdir@/@PACKAGE@/Tomboy.Zeitgeist.dll

Subscribers

People subscribed via source and target branches