Experimental GTK structs-as-references support. Not enabled by default.
[girtod.git] / mixin / GLib2__MODULE_HEAD.d
bloba9cbbe856391f062027581a3d6938de7d3488601
1 import core.stdc.limits: c_long, c_ulong;
2 alias int c_int; // Assumes 32-bit wide int.
3 alias uint c_uint; // Assumes 32-bit wide int.
5 import core.sys.posix.sys.types : time_t, ssize_t;
6 import std.c.stdarg : va_list;
7 import std.c.stdio : FILE;
9 alias int gboolean;
12 // A wrapper that makes type <S> behave like a reference type.
14 struct Ref(S) {
15 S* __refpointer;
17 alias __refpointer this;
19 this(S:S)(ref S s) { __refpointer = &s; }
20 this(SP:S*)(SP s) { __refpointer = s; }
21 this(A...)(A s) { __refpointer = new S(s); }
23 void toString(FT)(scope void delegate(const(char)[]) sink, FT fmt) {
24 import std.format;
25 formatValue(sink, *__refpointer, fmt);