Changeset 438
- Timestamp:
- 02/20/08 16:36:52 (10 months ago)
- Files:
-
- trunk/src/glib/Spawn.d (modified) (2 diffs)
- trunk/src/gtkc/paths.d (modified) (3 diffs)
- trunk/src/pango/PgMiscellaneous.d (modified) (1 diff)
- trunk/wrap/APILookupGLib.txt (modified) (2 diffs)
- trunk/wrap/paths.d (modified) (3 diffs)
- trunk/wrap/utils/GtkDClass.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/glib/Spawn.d
r411 r438 73 73 private import tango.core.Thread; 74 74 private import tango.stdc.stdio; 75 private import tango.stdc. posix.stdio;75 private import tango.stdc.stdio; 76 76 private import tango.text.Util; 77 77 private import tango.stdc.string; … … 193 193 } 194 194 195 extern (C) FILE* fdopen(int, char*); 195 196 196 197 /** trunk/src/gtkc/paths.d
r411 r438 7 7 * Updated: 2005-02-21 changed names; added version(linux) 8 8 * Updated: 2005-05-05 updated Linux support 9 * Updated: 2008-02-16 Tango support 9 10 */ 10 11 … … 94 95 } 95 96 96 // dmd 1.005 still makes private char[] public?!97 //private char[] libPath;98 // Specify the default path for the gtkD dll's99 100 97 version(Windows) 101 98 { 102 import std.windows.registry; 103 import std.stdio; 99 //version(Phobos) 100 version(Tango){} else 101 { 102 import std.windows.registry; 103 import std.stdio; 104 } 105 106 extern (Windows) 107 { 108 private uint GetEnvironmentVariableA(char*, char*, uint); 109 } 110 111 //Based on tango.sys.Environment.Environment.get 112 static char[] GetEnvironmentVariable(char[] variable) 113 { 114 char[] var = variable ~ "\0"; 115 uint size = GetEnvironmentVariableA(var.ptr, cast(char*)null, 0); 116 117 if (size == 0) return ""; 118 119 char[] buf = new char[size]; 120 size = GetEnvironmentVariableA(var.ptr, buf.ptr, size); 121 122 if (size == 0) return ""; 123 124 return buf[0 .. size]; 125 } 104 126 105 127 char[] libPath() 106 128 { 107 // if ( libPath is null )108 // {109 // libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";110 // }111 // return libPath;112 113 Key k = Registry.localMachine();114 115 129 char[] libPath; 116 130 117 foreach ( Key key ; k.keys() ) 131 libPath = GetEnvironmentVariable("%GTK_BASEPATH%"); 132 133 if(libPath.length > 0) 134 return libPath ~ "\\bin\\"; 135 136 // version(Phobos) 137 version(Tango){} else 118 138 { 119 writefln("key = ", key.name()); 139 // When using phobos Also try the Register 140 141 Key k = Registry.localMachine(); 142 143 debug(register) foreach ( Key key ; k.keys() ) 144 { 145 writefln("key = ", key.name()); 146 } 147 148 try 149 { 150 k = k.getKey("SOFTWARE"); 151 //writefln("key.value = %s", k.name()); 152 k = k.getKey("GTK"); 153 //writefln("key.value = %s", k.name()); 154 k = k.getKey("2.0"); 155 //writefln("key.value = %s", k.name()); 156 Value v = k.getValue("DllPath"); 157 libPath = v.value_SZ() ~ "\\"; 158 } 159 catch ( Exception e ) 160 { 161 libPath = ""; 162 } 120 163 } 121 164 122 try 123 { 124 k = k.getKey("SOFTWARE"); 125 //writefln("key.value = %s", k.name()); 126 k = k.getKey("GTK"); 127 //writefln("key.value = %s", k.name()); 128 k = k.getKey("2.0"); 129 //writefln("key.value = %s", k.name()); 130 Value v = k.getValue("DllPath"); 131 libPath = v.value_SZ() ~ "\\"; 132 } 133 catch ( Exception e ) 134 { 135 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\"; 136 } 137 138 if ( libPath is null ) 139 { 140 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\"; 141 } 142 143 165 // Returns the found location or an empty string 166 // to load the libraries from the path. 167 // see http://msdn2.microsoft.com/en-us/library/ms682586(VS.85).aspx 144 168 return libPath; 145 169 } 146 170 } 147 171 148 // empty for linux because default path is known by ld172 // empty for linux because default path is known by ld 149 173 150 174 version(linux) … … 152 176 char[] libPath() 153 177 { 154 // if ( libPath is null )155 // {156 // libPath = "";157 // }158 // return libPath;159 178 return ""; 160 179 } trunk/src/pango/PgMiscellaneous.d
r411 r438 66 66 67 67 version(Tango) { 68 private import tango.stdc. posix.stdio;68 private import tango.stdc.stdio; 69 69 } else { 70 70 private import std.c.stdio; trunk/wrap/APILookupGLib.txt
r392 r438 55 55 public alias dchar unichar; 56 56 public alias wchar unichar2; 57 //public alias dchar gunichar;58 //public alias wchar gunichar2;59 57 public alias uint time_t; 60 58 public alias uint XID; … … 817 815 } 818 816 817 extern (C) FILE* fdopen(int, char*); 819 818 820 819 /** trunk/wrap/paths.d
r345 r438 7 7 * Updated: 2005-02-21 changed names; added version(linux) 8 8 * Updated: 2005-05-05 updated Linux support 9 * Updated: 2008-02-16 Tango support 9 10 */ 10 11 … … 94 95 } 95 96 96 // dmd 1.005 still makes private char[] public?!97 //private char[] libPath;98 // Specify the default path for the gtkD dll's99 100 97 version(Windows) 101 98 { 102 import std.windows.registry; 103 import std.stdio; 99 //version(Phobos) 100 version(Tango){} else 101 { 102 import std.windows.registry; 103 import std.stdio; 104 } 105 106 extern (Windows) 107 { 108 private uint GetEnvironmentVariableA(char*, char*, uint); 109 } 110 111 //Based on tango.sys.Environment.Environment.get 112 static char[] GetEnvironmentVariable(char[] variable) 113 { 114 char[] var = variable ~ "\0"; 115 uint size = GetEnvironmentVariableA(var.ptr, cast(char*)null, 0); 116 117 if (size == 0) return ""; 118 119 char[] buf = new char[size]; 120 size = GetEnvironmentVariableA(var.ptr, buf.ptr, size); 121 122 if (size == 0) return ""; 123 124 return buf[0 .. size]; 125 } 104 126 105 127 char[] libPath() 106 128 { 107 // if ( libPath is null )108 // {109 // libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";110 // }111 // return libPath;112 113 Key k = Registry.localMachine();114 115 129 char[] libPath; 116 130 117 foreach ( Key key ; k.keys() ) 131 libPath = GetEnvironmentVariable("%GTK_BASEPATH%"); 132 133 if(libPath.length > 0) 134 return libPath ~ "\\bin\\"; 135 136 // version(Phobos) 137 version(Tango){} else 118 138 { 119 writefln("key = ", key.name()); 139 // When using phobos Also try the Register 140 141 Key k = Registry.localMachine(); 142 143 debug(register) foreach ( Key key ; k.keys() ) 144 { 145 writefln("key = ", key.name()); 146 } 147 148 try 149 { 150 k = k.getKey("SOFTWARE"); 151 //writefln("key.value = %s", k.name()); 152 k = k.getKey("GTK"); 153 //writefln("key.value = %s", k.name()); 154 k = k.getKey("2.0"); 155 //writefln("key.value = %s", k.name()); 156 Value v = k.getValue("DllPath"); 157 libPath = v.value_SZ() ~ "\\"; 158 } 159 catch ( Exception e ) 160 { 161 libPath = ""; 162 } 120 163 } 121 164 122 try 123 { 124 k = k.getKey("SOFTWARE"); 125 //writefln("key.value = %s", k.name()); 126 k = k.getKey("GTK"); 127 //writefln("key.value = %s", k.name()); 128 k = k.getKey("2.0"); 129 //writefln("key.value = %s", k.name()); 130 Value v = k.getValue("DllPath"); 131 libPath = v.value_SZ() ~ "\\"; 132 } 133 catch ( Exception e ) 134 { 135 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\"; 136 } 137 138 if ( libPath is null ) 139 { 140 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\"; 141 } 142 143 165 // Returns the found location or an empty string 166 // to load the libraries from the path. 167 // see http://msdn2.microsoft.com/en-us/library/ms682586(VS.85).aspx 144 168 return libPath; 145 169 } 146 170 } 147 171 148 // empty for linux because default path is known by ld172 // empty for linux because default path is known by ld 149 173 150 174 version(linux) … … 152 176 char[] libPath() 153 177 { 154 // if ( libPath is null )155 // {156 // libPath = "";157 // }158 // return libPath;159 178 return ""; 160 179 } trunk/wrap/utils/GtkDClass.d
r436 r438 256 256 tangoImportConvs["std.string"] = ["tango.text.Util"]; 257 257 tangoImportConvs["std.c.string"] = ["tango.stdc.string"]; 258 tangoImportConvs["std.c.stdio"] = ["tango.stdc. posix.stdio"];258 tangoImportConvs["std.c.stdio"] = ["tango.stdc.stdio"]; 259 259 tangoImportConvs["std.gc"] = ["tango.core.Memory"]; 260 260 tangoImportConvs["std.stdarg"] = ["tango.core.Vararg"];
