alternative to assert
[gtkD.git] / gtkD / src / gtkc / paths.d
blob88f0169aaedf2426cd8adb28eccf113589f76286
1 /*
2 * This file is part of gtkD. Adapted from:
4 * paths.d -- list of libraries that will be dynamically linked with DUI
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;
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,
36 GDA,
37 GLADE,
38 GSV,
39 GSTREAMER
42 version (Windows)
44 const char[][LIBRARY.max+1] importLibs =
46 LIBRARY.ATK: "libatk-1.0-0.dll",
47 LIBRARY.CAIROLIB: "libcairo-2.dll",
48 LIBRARY.GDK: "libgdk-win32-2.0-0.dll",
49 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0-0.dll",
50 LIBRARY.GLIB: "libglib-2.0-0.dll",
51 LIBRARY.GMODULE: "libgmodule-2.0-0.dll",
52 LIBRARY.GOBJECT: "libgobject-2.0-0.dll",
53 LIBRARY.GTHREAD: "libgthread-2.0-0.dll",
54 LIBRARY.GTK: "libgtk-win32-2.0-0.dll",
55 LIBRARY.PANGO: "libpango-1.0-0.dll",
56 LIBRARY.GLGDK: "libgdkglext-win32-1.0-0.dll",
57 LIBRARY.GLGTK: "libgtkglext-win32-1.0-0.dll",
58 LIBRARY.GL: "opengl32.dll",
59 LIBRARY.GLU: "glu32.dll",
60 LIBRARY.GDA: "libgda-2.dll",
61 LIBRARY.GLADE: "libglade-2.0.dll",
62 LIBRARY.GSV: "libgtksourceview-1.0-0.dll",
63 LIBRARY.GSTREAMER: "libgstreamer-0.10.dll"
67 version(linux)
69 const char[][LIBRARY.max+1] importLibs =
71 LIBRARY.ATK: "libatk-1.0.so",
72 LIBRARY.CAIROLIB: "libcairo.so.2",
73 LIBRARY.GDK: "libgdk-x11-2.0.so",
74 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0.so",
75 LIBRARY.GLIB: "libglib-2.0.so",
76 LIBRARY.GMODULE: "libgmodule-2.0.so",
77 LIBRARY.GOBJECT: "libgobject-2.0.so",
78 LIBRARY.GTHREAD: "libgthread-2.0.so",
79 LIBRARY.GTK: "libgtk-x11-2.0.so",
80 LIBRARY.PANGO: "libpango-1.0.so",
81 LIBRARY.GLGDK: "libgdkglext-x11-1.0.so",
82 LIBRARY.GLGTK: "libgtkglext-x11-1.0.so",
83 LIBRARY.GL: "libGL.so",
84 LIBRARY.GLU: "libGLU.so",
85 LIBRARY.GLEXT: "libGL.so",
86 LIBRARY.GDA: "libgda-2.so.3",
87 LIBRARY.GLADE: "libglade-2.0.so",
88 LIBRARY.GSV: "libgtksourceview-1.0.so",
89 LIBRARY.GSTREAMER: "libgstreamer-0.10.so"
93 // dmd 1.005 still makes private char[] public?!
94 //private char[] libPath;
95 // Specify the default path for the gtkD dll's
97 version(Windows)
99 import std.windows.registry;
100 version(Tango)
102 private import tango.stdc.stdio;
104 else
106 private import std.stdio;
109 char[] libPath()
111 // if ( libPath is null )
112 // {
113 // libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
114 // }
115 // return libPath;
117 Key k = Registry.localMachine();
119 char[] libPath;
121 foreach ( Key key ; k.keys() )
123 writefln("key = ", key.name());
128 k = k.getKey("SOFTWARE");
129 //writefln("key.value = %s", k.name());
130 k = k.getKey("GTK");
131 //writefln("key.value = %s", k.name());
132 k = k.getKey("2.0");
133 //writefln("key.value = %s", k.name());
134 Value v = k.getValue("DllPath");
135 libPath = v.value_SZ() ~ "\\";
137 catch ( Exception e )
139 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
142 if ( libPath is null )
144 libPath = "\\Program Files\\Common Files\\GTK\\2.0\\bin\\";
148 return libPath;
152 // empty for linux because default path is known by ld
154 version(linux)
156 char[] libPath()
158 // if ( libPath is null )
159 // {
160 // libPath = "";
161 // }
162 // return libPath;
163 return "";