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 	"gpointer": "void*",
27 	"gconstpointer": "void*",
28 	"gchar": "char",
29 	"guchar": "char",
30 	"gshort": "short",
31 	"gushort": "ushort",
32 	"gint8": "byte",
33 	"guint8": "ubyte",
34 	"gint16": "short",
35 	"guint16": "ushort",
36 	"gint32": "int",
37 	"gint64": "long",
38 	"guint32": "uint",
39 	"guint64": "ulong",
40 	"guintptr": "size_t",
41 	"gfloat": "float",
42 	"gdouble": "double",
43 	"greal": "real",
44 	"goffset": "long",
45 	"gsize": "size_t",
46 	"gssize": "ptrdiff_t",
47 	"va_list": "void*",
48 	"unichar": "dchar",
49 	"unichar2": "wchar",
50 	"uchar": "ubyte",
51 	"XID": "uint",
52 
53 	"gunichar": "dchar",
54 	"gunichar2": "wchar",
55 
56 	"time_t": "uint",
57 	"uid_t": "uid_t",
58 
59 	"alias": "alias_",
60 	"align": "align_",
61 	"body": "body_",
62 	"cast": "cast_",
63 	"continue": "continue_",
64 	"debug": "debug_",
65 	"default": "default_",
66 	"delete": "delete_",
67 	"deprecated": "deprecated_",
68 	"export": "export_",
69 	"foreach": "foreach_",
70 	"function": "function_",
71 	"Function": "Function_",
72 	"in": "in_",
73 	"instance": "instance_",
74 	"interface": "interface_",
75 	"module": "module_",
76 	"new": "new_",
77 	"out": "out_",
78 	"package": "package_",
79 	"real": "real_",
80 	"ref": "ref_",
81 	"scope": "scope_",
82 	"string": "string_",
83 	"switch": "switch_",
84 	"union": "union_",
85 	"version": "version_",
86 	"byte": "byte_",
87 	"shared": "shared_",
88 
89 	"GLIB_SYSDEF_POLLIN": "=1",
90 	"GLIB_SYSDEF_POLLOUT": "=4",
91 	"GLIB_SYSDEF_POLLPRI": "=2",
92 	"GLIB_SYSDEF_POLLHUP": "=16",
93 	"GLIB_SYSDEF_POLLERR": "=8",
94 	"GLIB_SYSDEF_POLLNVAL": "=32",
95 ];
96 
97 /**
98  * Set some defaults for the basic libraries.
99  */
100 enum string[][string] defaultLookupText = [
101 	"Atk": [
102 		"struct: Implementor",
103 		"interface: Implementor",
104 		"merge: ImplementorIface"
105 	],
106 	"cairo": [
107 		"struct: Context",
108 		"class: Context",
109 		"struct: Surface",
110 		"class: Surface",
111 		"struct: Matrix",
112 		"class: Matrix",
113 		"struct: Pattern",
114 		"class: Pattern",
115 		"struct: Region",
116 		"class: Region",
117 		"struct: FontOptions",
118 		"class: FontOption",
119 		"struct: FontFace",
120 		"class: FontFace",
121 		"struct: ScaledFont",
122 		"class: ScaledFont"
123 	],
124 	"Gdk": [
125 		"struct: Atom",
126 		"namespace:",
127 		"struct: Monitor",
128 		"class: MonitorG",
129 		"struct: Rectangle",
130 		"noCode: get_type",
131 		"namespace:"
132 	],
133 	"GLib": [
134 		"struct: Array",
135 		"class: ArrayG",
136 		"struct: ByteArray",
137 		"class: ByteArray",
138 		"struct: Error",
139 		"class: ErrorG",
140 		"struct: HashTable",
141 		"class: HashTable",
142 		"struct: List",
143 		"class: ListG",
144 		"struct: SList",
145 		"class: ListSG",
146 		"struct: MarkupParseContext",
147 		"class: SimpleXML",
148 		"struct: PtrArray",
149 		"class: PtrArray",
150 		"struct: Scanner",
151 		"class: ScannerG",
152 		"struct: String",
153 		"class: StringG",
154 		"struct: Tree",
155 		"class: BBTree"
156 	],
157 	"GModule": [
158 		"wrap: glib"
159 	],
160 	"Pango": [
161 		"struct: AttrList",
162 		"class: PgAttributeList"
163 	],
164 	"Gst": [
165 		"wrap: gstreamer"
166 	]
167 ];
168