comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/program/Program.d @ 113:fb3aa8075988

D2 support for the linux port.
author Jacob Carlborg <doob@me.com>
date Wed, 06 Apr 2011 21:57:23 +0200
parents b397a43d66d1
children 536e43f63c81
comparison
equal deleted inserted replaced
112:9f4c18c268b2 113:fb3aa8075988
171 GnomeVFSResult function(char*) gnome_vfs_url_show; 171 GnomeVFSResult function(char*) gnome_vfs_url_show;
172 char* function(char*) gnome_vfs_make_uri_from_input; 172 char* function(char*) gnome_vfs_make_uri_from_input;
173 GList* function() gnome_vfs_get_registered_mime_types; 173 GList* function() gnome_vfs_get_registered_mime_types;
174 char* function(char*) gnome_vfs_mime_type_from_name; 174 char* function(char*) gnome_vfs_mime_type_from_name;
175 } 175 }
176 static Symbol symbols[] = [ 176 static Symbol[] symbols;
177 { "gnome_vfs_mime_get_default_application", cast(void**)&gnome_vfs_mime_get_default_application }, 177 static this () {
178 { "gnome_vfs_make_uri_from_input_with_dirs", cast(void**)&gnome_vfs_make_uri_from_input_with_dirs }, 178 symbols = [
179 { "gnome_vfs_mime_application_launch", cast(void**)&gnome_vfs_mime_application_launch }, 179 Symbol("gnome_vfs_mime_get_default_application", cast(void**)&gnome_vfs_mime_get_default_application ),
180 { "gnome_vfs_mime_application_free", cast(void**)&gnome_vfs_mime_application_free }, 180 Symbol("gnome_vfs_make_uri_from_input_with_dirs", cast(void**)&gnome_vfs_make_uri_from_input_with_dirs ),
181 { "gnome_vfs_url_show", cast(void**)&gnome_vfs_url_show }, 181 Symbol("gnome_vfs_mime_application_launch", cast(void**)&gnome_vfs_mime_application_launch ),
182 { "gnome_vfs_make_uri_from_input", cast(void**)&gnome_vfs_make_uri_from_input }, 182 Symbol("gnome_vfs_mime_application_free", cast(void**)&gnome_vfs_mime_application_free ),
183 { "gnome_vfs_get_registered_mime_types", cast(void**)&gnome_vfs_get_registered_mime_types }, 183 Symbol("gnome_vfs_url_show", cast(void**)&gnome_vfs_url_show ),
184 { "gnome_vfs_mime_get_extensions_list", cast(void**)&gnome_vfs_mime_get_extensions_list }, 184 Symbol("gnome_vfs_make_uri_from_input", cast(void**)&gnome_vfs_make_uri_from_input ),
185 { "gnome_vfs_mime_extensions_list_free", cast(void**)&gnome_vfs_mime_extensions_list_free }, 185 Symbol("gnome_vfs_get_registered_mime_types", cast(void**)&gnome_vfs_get_registered_mime_types ),
186 { "gnome_vfs_mime_registered_mime_type_list_free", cast(void**)&gnome_vfs_mime_registered_mime_type_list_free }, 186 Symbol("gnome_vfs_mime_get_extensions_list", cast(void**)&gnome_vfs_mime_get_extensions_list ),
187 { "gnome_vfs_mime_type_from_name", cast(void**)&gnome_vfs_mime_type_from_name } 187 Symbol("gnome_vfs_mime_extensions_list_free", cast(void**)&gnome_vfs_mime_extensions_list_free ),
188 ]; 188 Symbol("gnome_vfs_mime_registered_mime_type_list_free", cast(void**)&gnome_vfs_mime_registered_mime_type_list_free ),
189 Symbol("gnome_vfs_mime_type_from_name", cast(void**)&gnome_vfs_mime_type_from_name )
190 ];
191 }
189 } 192 }
190 193
191 /** 194 /**
192 * Instances of this class represent programs and 195 * Instances of this class represent programs and
193 * their associated file extensions in the operating 196 * their associated file extensions in the operating
783 String[] mimeExts = mimeInfo[mimeType]; 786 String[] mimeExts = mimeInfo[mimeType];
784 for (int index = 0; index < mimeExts.length; index++){ 787 for (int index = 0; index < mimeExts.length; index++){
785 version(Tango){ 788 version(Tango){
786 bool contains = cast(bool)tango.core.Array.contains(extensions, mimeExts[index]); 789 bool contains = cast(bool)tango.core.Array.contains(extensions, mimeExts[index]);
787 } else { // Phobos 790 } else { // Phobos
788 bool contains = std.algorithm.find(extensions, mimeExts[index]) != std.iterator.end(extensions); 791 bool contains = std.algorithm.canFind(extensions, mimeExts[index]);
789 } 792 }
790 if (!contains) { 793 if (!contains) {
791 extensions ~= mimeExts[index]; 794 extensions ~= mimeExts[index];
792 } 795 }
793 } 796 }