1 /*
2  * This file is part of gir-to-d.
3  *
4  * gir-to-d is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation, either version 3
7  * of the License, or (at your option) any later version.
8  *
9  * gir-to-d is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with gir-to-d.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 module gtd.GlibTypes;
19 
20 enum string[string] glibTypes = [
21 	"volatile": "",
22 	"G_CONST_RETURN": "",
23 	"gint": "int",
24 	"guint": "uint",
25 	"gboolean": "bool",
26 	"_Bool": "bool",
27 	"gpointer": "void*",
28 	"gconstpointer": "void*",
29 	"gchar": "char",
30 	"guchar": "char",
31 	"gshort": "short",
32 	"gushort": "ushort",
33 	"gint8": "byte",
34 	"guint8": "ubyte",
35 	"gint16": "short",
36 	"guint16": "ushort",
37 	"gint32": "int",
38 	"gint64": "long",
39 	"guint32": "uint",
40 	"guint64": "ulong",
41 	"guintptr": "size_t",
42 	"gfloat": "float",
43 	"gdouble": "double",
44 	"greal": "real",
45 	"goffset": "long",
46 	"gsize": "size_t",
47 	"gssize": "ptrdiff_t",
48 	"va_list": "void*",
49 	"unichar": "dchar",
50 	"unichar2": "wchar",
51 	"uchar": "ubyte",
52 	"XID": "uint",
53 
54 	"gunichar": "dchar",
55 	"gunichar2": "wchar",
56 
57 	"time_t": "uint",
58 	"uid_t": "uid_t",
59 
60 	"alias": "alias_",
61 	"align": "align_",
62 	"body": "body_",
63 	"cast": "cast_",
64 	"continue": "continue_",
65 	"debug": "debug_",
66 	"default": "default_",
67 	"delete": "delete_",
68 	"deprecated": "deprecated_",
69 	"export": "export_",
70 	"foreach": "foreach_",
71 	"function": "function_",
72 	"Function": "Function_",
73 	"in": "in_",
74 	"instance": "instance_",
75 	"interface": "interface_",
76 	"module": "module_",
77 	"new": "new_",
78 	"out": "out_",
79 	"package": "package_",
80 	"real": "real_",
81 	"ref": "ref_",
82 	"scope": "scope_",
83 	"string": "string_",
84 	"switch": "switch_",
85 	"this": "this_",
86 	"union": "union_",
87 	"version": "version_",
88 	"byte": "byte_",
89 	"shared": "shared_",
90 
91 	"GLIB_SYSDEF_POLLIN": "=1",
92 	"GLIB_SYSDEF_POLLOUT": "=4",
93 	"GLIB_SYSDEF_POLLPRI": "=2",
94 	"GLIB_SYSDEF_POLLHUP": "=16",
95 	"GLIB_SYSDEF_POLLERR": "=8",
96 	"GLIB_SYSDEF_POLLNVAL": "=32",
97 ];
98 
99 /**
100  * Set some defaults for the basic libraries.
101  */
102 enum string[][string] defaultLookupText = [
103 	"Atk": [
104 		"struct: Implementor",
105 		"interface: Implementor",
106 		"merge: ImplementorIface"
107 	],
108 	"cairo": [
109 		"struct: Context",
110 		"class: Context",
111 		"struct: Surface",
112 		"class: Surface",
113 		"struct: Matrix",
114 		"class: Matrix",
115 		"struct: Pattern",
116 		"class: Pattern",
117 		"struct: Region",
118 		"class: Region",
119 		"struct: FontOptions",
120 		"class: FontOption",
121 		"struct: FontFace",
122 		"class: FontFace",
123 		"struct: ScaledFont",
124 		"class: ScaledFont"
125 	],
126 	"Gdk": [
127 		"struct: Atom",
128 		"namespace:",
129 		"struct: Monitor",
130 		"class: MonitorG",
131 		"struct: Rectangle",
132 		"noCode: get_type",
133 		"namespace:"
134 	],
135 	"GLib": [
136 		"struct: Array",
137 		"class: ArrayG",
138 		"struct: ByteArray",
139 		"class: ByteArray",
140 		"struct: Error",
141 		"class: ErrorG",
142 		"struct: HashTable",
143 		"class: HashTable",
144 		"struct: List",
145 		"class: ListG",
146 		"struct: SList",
147 		"class: ListSG",
148 		"struct: MarkupParseContext",
149 		"class: SimpleXML",
150 		"struct: PtrArray",
151 		"class: PtrArray",
152 		"struct: Scanner",
153 		"class: ScannerG",
154 		"struct: String",
155 		"class: StringG",
156 		"struct: Tree",
157 		"class: BBTree"
158 	],
159 	"GModule": [
160 		"wrap: glib"
161 	],
162 	"Pango": [
163 		"struct: AttrList",
164 		"class: PgAttributeList"
165 	],
166 	"Gst": [
167 		"wrap: gstreamer"
168 	]
169 ];
170