Mercurial > projects > dwt2
comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d @ 108:b397a43d66d1
Updated swt linux for DMD 1.063 and latest Tango trunk.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 25 Aug 2010 23:08:27 +0200 |
parents | 12b890a6392a |
children | fb3aa8075988 |
comparison
equal
deleted
inserted
replaced
107:e944a4cf537b | 108:b397a43d66d1 |
---|---|
230 | 230 |
231 /* Determine the desktop for the given display. */ | 231 /* Determine the desktop for the given display. */ |
232 static int getDesktop(Display display) { | 232 static int getDesktop(Display display) { |
233 if (display is null) return DESKTOP_UNKNOWN; | 233 if (display is null) return DESKTOP_UNKNOWN; |
234 Integer desktopValue = cast(Integer)display.getData(DESKTOP_DATA); | 234 Integer desktopValue = cast(Integer)display.getData(DESKTOP_DATA); |
235 if (desktopValue !is null) return desktopValue.value; | 235 if (desktopValue !is null) return desktopValue.intValue; |
236 int desktop = DESKTOP_UNKNOWN; | 236 int desktop = DESKTOP_UNKNOWN; |
237 | 237 |
238 /* Get the list of properties on the root window. */ | 238 /* Get the list of properties on the root window. */ |
239 void* xDisplay = OS.GDK_DISPLAY(); | 239 void* xDisplay = OS.GDK_DISPLAY(); |
240 uint rootWindow = OS.XDefaultRootWindow(xDisplay); | 240 uint rootWindow = OS.XDefaultRootWindow(xDisplay); |
273 display.setData(ICON_THEME_DATA, null); | 273 display.setData(ICON_THEME_DATA, null); |
274 /* | 274 /* |
275 * Note. gnome_icon_theme_new uses g_object_new to allocate the | 275 * Note. gnome_icon_theme_new uses g_object_new to allocate the |
276 * data it returns. Use g_object_unref to free the pointer it returns. | 276 * data it returns. Use g_object_unref to free the pointer it returns. |
277 */ | 277 */ |
278 if (gnomeIconTheme.value !is 0) OS.g_object_unref( cast(void*)gnomeIconTheme.value); | 278 if (gnomeIconTheme.intValue !is 0) OS.g_object_unref( cast(void*)gnomeIconTheme.intValue); |
279 } | 279 } |
280 }); | 280 }); |
281 /* Check for libgnomevfs-2 version 2.4 */ | 281 /* Check for libgnomevfs-2 version 2.4 */ |
282 String buffer = "libgnomevfs-2.so.0"; | 282 String buffer = "libgnomevfs-2.so.0"; |
283 SharedLib.tryUseSymbol( "gnome_vfs_url_show", buffer, (void*){ | 283 void delegate (void*) dg = (void*){ desktop = DESKTOP_GNOME_24; }; |
284 desktop = DESKTOP_GNOME_24; | 284 SharedLib.tryUseSymbol( "gnome_vfs_url_show", buffer, dg); |
285 }); | |
286 if( desktop is DESKTOP_GNOME_24 ){ | 285 if( desktop is DESKTOP_GNOME_24 ){ |
287 SharedLib.loadLibSymbols( GNOME.symbols, buffer ); | 286 SharedLib.loadLibSymbols( GNOME.symbols, buffer ); |
288 } | 287 } |
289 } | 288 } |
290 } | 289 } |
687 program.command = buffer; | 686 program.command = buffer; |
688 program.gnomeExpectUri = application.expects_uris is GNOME.GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS; | 687 program.gnomeExpectUri = application.expects_uris is GNOME.GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS; |
689 | 688 |
690 buffer = (fromStringz( application.id) ~ '\0')._idup(); | 689 buffer = (fromStringz( application.id) ~ '\0')._idup(); |
691 Integer gnomeIconTheme = cast(Integer)display.getData(ICON_THEME_DATA); | 690 Integer gnomeIconTheme = cast(Integer)display.getData(ICON_THEME_DATA); |
692 char* icon_name = GNOME.gnome_icon_lookup( cast(GtkIconTheme*) gnomeIconTheme.value, null, null, cast(char*)buffer.ptr, null, mimeTypeBuffer, | 691 char* icon_name = GNOME.gnome_icon_lookup( cast(GtkIconTheme*) gnomeIconTheme.intValue, null, null, cast(char*)buffer.ptr, null, mimeTypeBuffer, |
693 GNOME.GNOME_ICON_LOOKUP_FLAGS_NONE, null); | 692 GNOME.GNOME_ICON_LOOKUP_FLAGS_NONE, null); |
694 char* path = null; | 693 char* path = null; |
695 if (icon_name !is null) path = GNOME.gnome_icon_theme_lookup_icon(cast(GtkIconTheme*)gnomeIconTheme.value, icon_name, PREFERRED_ICON_SIZE, null, null); | 694 if (icon_name !is null) path = GNOME.gnome_icon_theme_lookup_icon(cast(GtkIconTheme*)gnomeIconTheme.intValue, icon_name, PREFERRED_ICON_SIZE, null, null); |
696 if (path !is null) { | 695 if (path !is null) { |
697 program.iconPath = fromStringz( path)._idup(); | 696 program.iconPath = fromStringz( path)._idup(); |
698 OS.g_free(path); | 697 OS.g_free(path); |
699 } | 698 } |
700 if (icon_name !is null) OS.g_free(icon_name); | 699 if (icon_name !is null) OS.g_free(icon_name); |