summaryrefslogtreecommitdiff
path: root/community/gnome-do/gio-gnomedesktop.patch
blob: 358b0b7317fb6a0db081c7fd84c190f88b2e23a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
diff -Naur gnome-do-0.9.orig/configure.ac gnome-do-0.9/configure.ac
--- gnome-do-0.9.orig/configure.ac	2012-03-04 08:46:12.000000000 +0100
+++ gnome-do-0.9/configure.ac	2012-06-24 19:31:49.150955445 +0200
@@ -60,17 +60,29 @@
 PKG_CHECK_MODULES([GCONF_SHARP_20], [gconf-sharp-2.0])
 PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0])
 PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0])
+
+dnl gio-sharp is an unstable api library
+PKG_CHECK_MODULES([GIO_SHARP], [gio-sharp-2.0])
+files="`$PKG_CONFIG --variable=Libraries gio-sharp-2.0`"
+for file in $files; do
+	GIO_SHARP_SOURCE_ASSEMBLIES="$GIO_SHARP_SOURCE_ASSEMBLIES $file"
+	GIO_SHARP_ASSEMBLIES="$GIO_SHARP_ASSEMBLIES $top_srcdir/build/$(basename $file)"
+	[[ -r "$file.config" ]] && GIO_SHARP_SOURCE_ASSEMBLIES="$GIO_SHARP_SOURCE_ASSEMBLIES $file.config"
+	[[ -r "$file.config" ]] && GIO_SHARP_ASSEMBLIES="$GIO_SHARP_ASSEMBLIES $top_srcdir/build/$(basename $file).config"
+
+	GIO_SHARP_LIBS="$GIO_SHARP_LIBS -r:$top_srcdir/build/$(basename $file)"
+done
+AC_SUBST([GIO_SHARP_SOURCE_ASSEMBLIES])
+AC_SUBST([GIO_SHARP_ASSEMBLIES])
+AC_SUBST([GIO_SHARP_LIBS])
+
 PKG_CHECK_MODULES([GNOME_DESKTOP_SHARP_20], [gnome-desktop-sharp-2.0])
 PKG_CHECK_MODULES([GNOME_KEYRING_SHARP], [gnome-keyring-sharp-1.0])
-PKG_CHECK_MODULES([GNOME_SHARP_20], [gnome-sharp-2.0])
-PKG_CHECK_MODULES([GNOME_VFS_SHARP_20], [gnome-vfs-sharp-2.0])
 PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0])
-PKG_CHECK_MODULES([LIBRSVG_SHARP], [rsvg2-sharp-2.0])
 PKG_CHECK_MODULES([MONO_ADDINS], [mono-addins])
 PKG_CHECK_MODULES([MONO_ADDINS_GUI], [mono-addins-gui])
 PKG_CHECK_MODULES([MONO_ADDINS_SETUP], [mono-addins-setup])
 PKG_CHECK_MODULES([NOTIFY_SHARP], [notify-sharp])
-PKG_CHECK_MODULES([WNCK_SHARP_10], [wnck-sharp-1.0])
 
 
 AC_SUBST([GCONF_SHARP_20_LIBS])
@@ -78,10 +90,7 @@
 AC_SUBST([GLIB_SHARP_20_LIBS])
 AC_SUBST([GNOME_DESKTOP_SHARP_20_LIBS])
 AC_SUBST([GNOME_KEYRING_SHARP_LIBS])
-AC_SUBST([GNOME_SHARP_20_LIBS])
-AC_SUBST([GNOME_VFS_SHARP_20_LIBS])
 AC_SUBST([GTK_SHARP_20_LIBS])
-AC_SUBST([LIBRSVG_SHARP_LIBS])
 AC_SUBST([MONO_ADDINS_LIBS])
 AC_SUBST([MONO_ADDINS_GUI_LIBS])
 AC_SUBST([MONO_ADDINS_SETUP_LIBS])
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/Do.Platform.Linux.dll.config.in gnome-do-0.9/Do.Platform.Linux/Do.Platform.Linux.dll.config.in
--- gnome-do-0.9.orig/Do.Platform.Linux/Do.Platform.Linux.dll.config.in	2012-01-14 14:49:58.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/Do.Platform.Linux.dll.config.in	2012-06-24 19:31:49.124289904 +0200
@@ -1,3 +1,4 @@
 <configuration>
 	<dllmap dll="libdo" target="@expanded_libdir@/@PACKAGE@/libdo.so"/>
+	<dllmap dll="gnome-desktop-2" target="libgnome-desktop-2.so.17"/>
 </configuration>
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/Makefile.am gnome-do-0.9/Do.Platform.Linux/Makefile.am
--- gnome-do-0.9.orig/Do.Platform.Linux/Makefile.am	2012-01-14 14:49:58.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/Makefile.am	2012-06-24 19:31:49.127623096 +0200
@@ -27,6 +27,8 @@
 	src/Do.Platform/Do.Platform.Linux/KeyBindingService.cs \
 	src/Do.Universe/ApplicationItem.cs \
 	src/Do.Universe/CategoryItem.cs \
+	src/Do.Universe/Desktop.cs \
+	src/Do.Universe/DesktopThumbnailSize.cs \
 	src/Do.Universe/NullApplicationItem.cs \
 	src/Do.Universe/FileItem.cs \
 	src/Do.Universe/ApplicationItemSource.cs \
@@ -54,7 +56,7 @@
 	Mono.Posix \
 	$(GTK_SHARP_20_LIBS) \
 	$(GNOME_KEYRING_SHARP_LIBS) \
-	$(GNOME_SHARP_20_LIBS) \
+	$(GIO_SHARP_LIBS) \
 	$(GNOME_DESKTOP_SHARP_20_LIBS) \
 	$(GCONF_SHARP_20_LIBS) \
 	$(MONO_ADDINS_LIBS) \
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs gnome-do-0.9/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs
--- gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs	2012-01-14 14:49:58.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/SystemService.cs	2012-06-24 19:31:49.130956287 +0200
@@ -166,7 +166,8 @@
 		
 		string AutoStartUri {
 			get {
-				return Gnome.Vfs.Uri.GetUriFromLocalPath (AutoStartFileName);
+				var uri = new Uri(AutoStartFileName).ToString();
+				return uri;
 			}
 		}
 		
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/Desktop.cs gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/Desktop.cs
--- gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/Desktop.cs	1970-01-01 01:00:00.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/Desktop.cs	2012-06-24 19:31:49.134289478 +0200
@@ -0,0 +1,76 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Gnome {
+
+	using System;
+	using System.Runtime.InteropServices;
+
+#region Autogenerated code
+	public class Desktop {
+
+		[DllImport("gnome-desktop-2")]
+		static extern void gnome_desktop_prepend_terminal_to_vector(out int argc, IntPtr argv);
+
+		public static int PrependTerminalToVector(string argv) {
+			int argc;
+			gnome_desktop_prepend_terminal_to_vector(out argc, GLib.Marshaller.StringToPtrGStrdup(argv));
+			return argc;
+		}
+
+		[DllImport("gnome-desktop-2")]
+		static extern bool gnome_desktop_thumbnail_has_uri(IntPtr pixbuf, IntPtr uri);
+
+		public static bool ThumbnailHasUri(Gdk.Pixbuf pixbuf, string uri) {
+			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+			bool raw_ret = gnome_desktop_thumbnail_has_uri(pixbuf == null ? IntPtr.Zero : pixbuf.Handle, native_uri);
+			bool ret = raw_ret;
+			GLib.Marshaller.Free (native_uri);
+			return ret;
+		}
+
+		[DllImport("gnome-desktop-2")]
+		static extern IntPtr gnome_desktop_thumbnail_scale_down_pixbuf(IntPtr pixbuf, int dest_width, int dest_height);
+
+		public static Gdk.Pixbuf ThumbnailScaleDownPixbuf(Gdk.Pixbuf pixbuf, int dest_width, int dest_height) {
+			IntPtr raw_ret = gnome_desktop_thumbnail_scale_down_pixbuf(pixbuf == null ? IntPtr.Zero : pixbuf.Handle, dest_width, dest_height);
+			Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+			return ret;
+		}
+
+		[DllImport("gnome-desktop-2")]
+		static extern IntPtr gnome_desktop_thumbnail_path_for_uri(IntPtr uri, int size);
+
+		public static string ThumbnailPathForUri(string uri, Gnome.DesktopThumbnailSize size) {
+			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+			IntPtr raw_ret = gnome_desktop_thumbnail_path_for_uri(native_uri, (int) size);
+			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+			GLib.Marshaller.Free (native_uri);
+			return ret;
+		}
+
+		[DllImport("gnome-desktop-2")]
+		static extern bool gnome_desktop_thumbnail_is_valid(IntPtr pixbuf, IntPtr uri, IntPtr mtime);
+
+		public static bool ThumbnailIsValid(Gdk.Pixbuf pixbuf, string uri, System.DateTime mtime) {
+			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+			bool raw_ret = gnome_desktop_thumbnail_is_valid(pixbuf == null ? IntPtr.Zero : pixbuf.Handle, native_uri, GLib.Marshaller.DateTimeTotime_t (mtime));
+			bool ret = raw_ret;
+			GLib.Marshaller.Free (native_uri);
+			return ret;
+		}
+
+		[DllImport("gnome-desktop-2")]
+		static extern IntPtr gnome_desktop_thumbnail_md5(IntPtr uri);
+
+		public static string ThumbnailMd5(string uri) {
+			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+			IntPtr raw_ret = gnome_desktop_thumbnail_md5(native_uri);
+			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+			GLib.Marshaller.Free (native_uri);
+			return ret;
+		}
+
+#endregion
+	}
+}
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/DesktopThumbnailSize.cs gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/DesktopThumbnailSize.cs
--- gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/DesktopThumbnailSize.cs	1970-01-01 01:00:00.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/DesktopThumbnailSize.cs	2012-06-24 19:31:49.137622670 +0200
@@ -0,0 +1,16 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Gnome {
+
+	using System;
+	using System.Runtime.InteropServices;
+
+#region Autogenerated code
+	public enum DesktopThumbnailSize {
+
+		Normal,
+		Large,
+	}
+#endregion
+}
diff -Naur gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/FileItem.cs gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/FileItem.cs
--- gnome-do-0.9.orig/Do.Platform.Linux/src/Do.Universe/FileItem.cs	2012-01-14 14:49:58.000000000 +0100
+++ gnome-do-0.9/Do.Platform.Linux/src/Do.Universe/FileItem.cs	2012-06-24 19:31:49.140955864 +0200
@@ -63,8 +63,6 @@
 
 		static FileItem ()
 		{
-			Gnome.Vfs.Vfs.Initialize ();
-
 			// Initialize SpecialFolderIcons by expanding paths in
 			// SpecialFolderIconsXDG.
 			//
@@ -130,7 +128,11 @@
 		}
 
 		public string MimeType {
-			get { return Gnome.Vfs.Global.GetMimeType (Path); }
+			get {
+				GLib.File file = GLib.FileFactory.NewFromCommandlineArg(Path);
+				var info = file.QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null);
+				return info.ContentType;
+			}
 		}
 
 		public override string Icon {
@@ -142,8 +144,8 @@
 				icon = MaybeGetSpecialFolderIconForPath (Path);
 				if (icon != null) return icon;
 
-				string large_thumb = Thumbnail.PathForUri (Uri, ThumbnailSize.Large);
-				string normal_thumb = Thumbnail.PathForUri (Uri, ThumbnailSize.Normal);
+				string large_thumb = Desktop.ThumbnailPathForUri (Uri, DesktopThumbnailSize.Large);
+				string normal_thumb = Desktop.ThumbnailPathForUri (Uri, DesktopThumbnailSize.Normal);
 
 				// Generating the thumbnail ourself is too slow for large files.
 				// Suggestion: generate thumbnails asynchronously. Banshee's
diff -Naur gnome-do-0.9.orig/Makefile.am gnome-do-0.9/Makefile.am
--- gnome-do-0.9.orig/Makefile.am	2012-01-14 14:49:58.000000000 +0100
+++ gnome-do-0.9/Makefile.am	2012-06-24 19:31:56.837297364 +0200
@@ -2,6 +2,22 @@
 
 ACLOCAL_AMFLAGS = -I m4 -I m4/shamrock
 
+# Install copied assemblies to our libdir
+copiedlibsdir = $(pkglibdir)
+copiedlibs_DATA = \
+	$(GIO_SHARP_ASSEMBLIES)
+
+$(GIO_SHARP_ASSEMBLIES): $(GIO_SHARP_SOURCE_ASSEMBLIES) 
+	@mkdir -p $(top_builddir)/build
+	@for file in $@ ; do \
+		for source in $? ; do \
+			if [ $$(basename $$source) == $$(basename $$file) ] ; then \
+				echo " CP " $$(basename $$file) ; \
+				cp $$source $$file ; \
+			fi ;\
+		done ; \
+	done
+
 SUBDIRS = \
 	. \
 	data \