I've no idea here...
[gtkD.git] / wrap / paths.d
blob4c188bbbb107980ba945d3ceecfe891763ad77ca
1 /*
2 * This file is part of gtkD. Adapted from:
4 * paths.d -- list of libraries that will be dynamically linked with gtkD
6 * Added: John Reimer -- 2004-12-20
7 * Updated: 2005-02-21 changed names; added version(linux)
8 * Updated: 2005-05-05 updated Linux support
9 */
11 module gtkc.paths;
13 /*
14 * Define the Libraries that gtkD will be using.
15 * This is a growable list, as long as the programmer
16 * also adds to the importLibs list.
19 enum LIBRARY
21 ATK,
22 CAIROLIB,
23 GDK,
24 GDKPIXBUF,
25 GLIB,
26 GMODULE,
27 GOBJECT,
28 GTHREAD,
29 GTK,
30 PANGO,
31 GLGDK,
32 GLGTK,
33 GL,
34 GLU,
35 GLEXT
38 version (Windows)
40 const char[][LIBRARY.max+1] importLibs =
42 LIBRARY.ATK: "libatk-1.0-0.dll",
43 LIBRARY.CAIROLIB: "libcairo-2.dll",
44 LIBRARY.GDK: "libgdk-win32-2.0-0.dll",
45 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0-0.dll",
46 LIBRARY.GLIB: "libglib-2.0-0.dll",
47 LIBRARY.GMODULE: "libgmodule-2.0-0.dll",
48 LIBRARY.GOBJECT: "libgobject-2.0-0.dll",
49 LIBRARY.GTHREAD: "libgthread-2.0-0.dll",
50 LIBRARY.GTK: "libgtk-win32-2.0-0.dll",
51 LIBRARY.PANGO: "libpango-1.0-0.dll",
52 LIBRARY.GLGDK: "libgdkglext-win32-1.0-0.dll",
53 LIBRARY.GLGTK: "libgtkglext-win32-1.0-0.dll",
54 LIBRARY.GL: "opengl32.dll",
55 LIBRARY.GLU: "glu32.dll"
59 version(linux)
61 const char[][LIBRARY.max+1] importLibs =
63 LIBRARY.ATK: "libatk-1.0.so",
64 LIBRARY.CAIROLIB: "libcairo.so.2",
65 LIBRARY.GDK: "libgdk-x11-2.0.so",
66 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0.so",
67 LIBRARY.GLIB: "libglib-2.0.so",
68 LIBRARY.GMODULE: "libgmodule-2.0.so",
69 LIBRARY.GOBJECT: "libgobject-2.0.so",
70 LIBRARY.GTHREAD: "libgthread-2.0.so",
71 LIBRARY.GTK: "libgtk-x11-2.0.so",
72 LIBRARY.PANGO: "libpango-1.0.so",
73 LIBRARY.GLGDK: "libgdkglext-x11-1.0.so",
74 LIBRARY.GLGTK: "libgtkglext-x11-1.0.so",
75 LIBRARY.GL: "libGL.so",
76 LIBRARY.GLU: "libGLU.so",
77 LIBRARY.GLEXT: "libGL.so"
82 // dmd 1.005 still makes private char[] public?!
83 //private char[] libPath;
84 // Specify the default path for the gtkD dll's
86 version(Windows)
88 import std.windows.registry;
89 import std.stdio;
91 char[] libPath()
93 // if ( libPath is null )
94 // {
95 // libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
96 // }
97 // return libPath;
99 Key k = Registry.localMachine();
101 char[] libPath;
103 foreach ( Key key ; k.keys() )
105 writefln("key = ", key.name());
110 k = k.getKey("SOFTWARE");
111 //writefln("key.value = %s", k.name());
112 k = k.getKey("GTK");
113 //writefln("key.value = %s", k.name());
114 k = k.getKey("2.0");
115 //writefln("key.value = %s", k.name());
116 Value v = k.getValue("DllPath");
117 libPath = v.value_SZ() ~ "\\";
119 catch ( Exception e )
121 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
124 if ( libPath is null )
126 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
130 return libPath;
134 // empty for linux because default path is known by ld
136 version(linux)
138 char[] libPath()
140 // if ( libPath is null )
141 // {
142 // libPath = "";
143 // }
144 // return libPath;
145 return "";