vala r1289 - in trunk: . gobject vala vapi
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1289 - in trunk: . gobject vala vapi
- Date: Sun, 20 Apr 2008 22:42:04 +0100 (BST)
Author: juergbi
Date: Sun Apr 20 21:42:04 2008
New Revision: 1289
URL: http://svn.gnome.org/viewvc/vala?rev=1289&view=rev
Log:
2008-04-20 Juerg Billeter <j bitron ch>
* vala/valaclass.vala, vala/valadatatype.vala,
vala/valastruct.vala, vala/valatypesymbol.vala,
gobject/valaccodeclassbinding.vala,
gobject/valaccodedynamicsignalbinding.vala,
gobject/valaccodegenerator.vala,
gobject/valaccodegeneratorsignal.vala,
gobject/valaccodegeneratorsourcefile.vala,
gobject/valaccodetypesymbolbinding.vala, vapi/dbus-glib-1.vapi,
vapi/glib-2.0.vapi:
Add experimental D-Bus server support
Modified:
trunk/ChangeLog
trunk/gobject/valaccodeclassbinding.vala
trunk/gobject/valaccodedynamicsignalbinding.vala
trunk/gobject/valaccodegenerator.vala
trunk/gobject/valaccodegeneratorsignal.vala
trunk/gobject/valaccodegeneratorsourcefile.vala
trunk/gobject/valaccodetypesymbolbinding.vala
trunk/vala/valaclass.vala
trunk/vala/valadatatype.vala
trunk/vala/valastruct.vala
trunk/vala/valatypesymbol.vala
trunk/vapi/dbus-glib-1.vapi
trunk/vapi/glib-2.0.vapi
Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala (original)
+++ trunk/gobject/valaccodeclassbinding.vala Sun Apr 20 21:42:04 2008
@@ -450,6 +450,8 @@
}
}
+ register_dbus_info ();
+
init_block.add_statement (codegen.class_init_fragment);
codegen.source_type_member_definition.append (class_init);
@@ -740,4 +742,121 @@
cwarn.add_argument (new CCodeIdentifier ("pspec"));
return new CCodeExpressionStatement (cwarn);
}
+
+ void register_dbus_info () {
+ var dbus = cl.get_attribute ("DBus");
+ if (dbus == null) {
+ return;
+ }
+ var dbus_iface_name = dbus.get_string ("name");
+ if (dbus_iface_name == null) {
+ return;
+ }
+
+ codegen.dbus_glib_h_needed = true;
+
+ var dbus_methods = new StringBuilder ();
+ dbus_methods.append ("{\n");
+
+ var blob = new StringBuilder ();
+ blob.append_c ('"');
+
+ int method_count = 0;
+ long blob_len = 0;
+ foreach (Method m in cl.get_methods ()) {
+ if (m is CreationMethod || !m.instance) {
+ continue;
+ }
+
+ dbus_methods.append ("{ (GCallback) ");
+ dbus_methods.append (m.get_cname ());
+ dbus_methods.append (", ");
+ dbus_methods.append (codegen.get_marshaller_function (m.get_parameters (), m.return_type));
+ dbus_methods.append (", ");
+ dbus_methods.append (blob_len.to_string ());
+ dbus_methods.append (" },\n");
+
+ codegen.generate_marshaller (m.get_parameters (), m.return_type);
+
+ long start = blob.len;
+
+ blob.append (dbus_iface_name);
+ blob.append ("\\0");
+ start++;
+
+ blob.append (m.name);
+ blob.append ("\\0");
+ start++;
+
+ // synchronous
+ blob.append ("S\\0");
+ start++;
+
+ foreach (FormalParameter param in m.get_parameters ()) {
+ blob.append (param.name);
+ blob.append ("\\0");
+ start++;
+
+ if (param.direction == ParameterDirection.IN) {
+ blob.append ("I\\0");
+ start++;
+ } else if (param.direction == ParameterDirection.OUT) {
+ blob.append ("O\\0");
+ start++;
+ blob.append ("F\\0");
+ start++;
+ blob.append ("N\\0");
+ start++;
+ } else {
+ Report.error (param.source_reference, "unsupported parameter direction for D-Bus method");
+ }
+
+ blob.append (param.type_reference.get_type_signature ());
+ blob.append ("\\0");
+ start++;
+ }
+
+ if (!(m.return_type is VoidType)) {
+ blob.append ("result\\0");
+ start++;
+
+ blob.append ("O\\0");
+ start++;
+ blob.append ("F\\0");
+ start++;
+ blob.append ("R\\0");
+ start++;
+
+ blob.append (m.return_type.get_type_signature ());
+ blob.append ("\\0");
+ start++;
+ }
+
+ blob.append ("\\0");
+
+ blob_len += blob.len - start;
+
+ method_count++;
+ }
+
+ blob.append_c ('"');
+
+ dbus_methods.append ("}\n");
+
+ var dbus_methods_decl = new CCodeDeclaration ("const DBusGMethodInfo");
+ dbus_methods_decl.modifiers = CCodeModifiers.STATIC;
+ dbus_methods_decl.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_dbus_methods[]".printf (cl.get_lower_case_cname ()), new CCodeConstant (dbus_methods.str)));
+ codegen.class_init_fragment.append (dbus_methods_decl);
+
+ var dbus_object_info = new CCodeDeclaration ("const DBusGObjectInfo");
+ dbus_object_info.modifiers = CCodeModifiers.STATIC;
+ dbus_object_info.add_declarator (new CCodeVariableDeclarator.with_initializer ("%s_dbus_object_info".printf (cl.get_lower_case_cname ()), new CCodeConstant ("{ 0, %s_dbus_methods, %d, %s, \"\\0\", \"\\0\" }".printf (cl.get_lower_case_cname (), method_count, blob.str))));
+ codegen.class_init_fragment.append (dbus_object_info);
+
+ var install_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_object_type_install_info"));
+ install_call.add_argument (new CCodeIdentifier (cl.get_type_id ()));
+ install_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("%s_dbus_object_info".printf (cl.get_lower_case_cname ()))));
+ codegen.class_init_fragment.append (new CCodeExpressionStatement (install_call));
+ }
}
+
Modified: trunk/gobject/valaccodedynamicsignalbinding.vala
==============================================================================
--- trunk/gobject/valaccodedynamicsignalbinding.vala (original)
+++ trunk/gobject/valaccodedynamicsignalbinding.vala Sun Apr 20 21:42:04 2008
@@ -110,7 +110,7 @@
// FIXME should only be done once per marshaller
var register_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_object_register_marshaller"));
- register_call.add_argument (new CCodeIdentifier (codegen.get_signal_marshaller_function (node)));
+ register_call.add_argument (new CCodeIdentifier (codegen.get_marshaller_function (node.get_parameters (), node.return_type)));
register_call.add_argument (new CCodeIdentifier ("G_TYPE_NONE"));
var add_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_proxy_add_signal"));
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sun Apr 20 21:42:04 2008
@@ -125,6 +125,7 @@
private bool requires_array_free;
public bool requires_array_move;
private bool requires_strcmp0;
+ public bool dbus_glib_h_needed;
private Set<string> wrappers;
Modified: trunk/gobject/valaccodegeneratorsignal.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorsignal.vala (original)
+++ trunk/gobject/valaccodegeneratorsignal.vala Sun Apr 20 21:42:04 2008
@@ -44,11 +44,10 @@
}
}
- public string get_signal_marshaller_function (Signal sig, string? prefix = null) {
- var signature = get_signal_signature (sig);
+ public string get_marshaller_function (Collection<FormalParameter> params, DataType return_type, string? prefix = null) {
+ var signature = get_marshaller_signature (params, return_type);
string ret;
- var params = sig.get_parameters ();
-
+
if (prefix == null) {
if (predefined_marshal_set.contains (signature)) {
prefix = "g_cclosure_marshal";
@@ -57,7 +56,7 @@
}
}
- ret = "%s_%s_".printf (prefix, get_marshaller_type_name (sig.return_type));
+ ret = "%s_%s_".printf (prefix, get_marshaller_type_name (return_type));
if (params == null || params.size == 0) {
ret = ret + "_VOID";
@@ -105,11 +104,10 @@
}
}
- private string get_signal_signature (Signal sig) {
+ private string get_marshaller_signature (Collection<FormalParameter> params, DataType return_type) {
string signature;
- var params = sig.get_parameters ();
- signature = "%s:".printf (get_marshaller_type_name (sig.return_type));
+ signature = "%s:".printf (get_marshaller_type_name (return_type));
if (params == null || params.size == 0) {
signature = signature + "VOID";
} else {
@@ -140,17 +138,20 @@
sig.accept_children (this);
+ generate_marshaller (sig.get_parameters (), sig.return_type);
+ }
+
+ public void generate_marshaller (Collection<FormalParameter> params, DataType return_type) {
string signature;
- var params = sig.get_parameters ();
int n_params, i;
/* check whether a signal with the same signature already exists for this source file (or predefined) */
- signature = get_signal_signature (sig);
+ signature = get_marshaller_signature (params, return_type);
if (predefined_marshal_set.contains (signature) || user_marshal_set.contains (signature)) {
return;
}
- var signal_marshaller = new CCodeFunction (get_signal_marshaller_function (sig), "void");
+ var signal_marshaller = new CCodeFunction (get_marshaller_function (params, return_type), "void");
signal_marshaller.modifiers = CCodeModifiers.STATIC;
signal_marshaller.add_parameter (new CCodeFormalParameter ("closure", "GClosure *"));
@@ -164,7 +165,7 @@
var marshaller_body = new CCodeBlock ();
- var callback_decl = new CCodeFunctionDeclarator (get_signal_marshaller_function (sig, "GMarshalFunc"));
+ var callback_decl = new CCodeFunctionDeclarator (get_marshaller_function (params, return_type, "GMarshalFunc"));
callback_decl.add_parameter (new CCodeFormalParameter ("data1", "gpointer"));
n_params = 1;
foreach (FormalParameter p in params) {
@@ -172,9 +173,9 @@
n_params++;
}
callback_decl.add_parameter (new CCodeFormalParameter ("data2", "gpointer"));
- marshaller_body.add_statement (new CCodeTypeDefinition (get_value_type_name_from_type_reference (sig.return_type), callback_decl));
+ marshaller_body.add_statement (new CCodeTypeDefinition (get_value_type_name_from_type_reference (return_type), callback_decl));
- var var_decl = new CCodeDeclaration (get_signal_marshaller_function (sig, "GMarshalFunc"));
+ var var_decl = new CCodeDeclaration (get_marshaller_function (params, return_type, "GMarshalFunc"));
var_decl.modifiers = CCodeModifiers.REGISTER;
var_decl.add_declarator (new CCodeVariableDeclarator ("callback"));
marshaller_body.add_statement (var_decl);
@@ -192,8 +193,8 @@
CCodeFunctionCall fc;
- if (sig.return_type.data_type != null) {
- var_decl = new CCodeDeclaration (get_value_type_name_from_type_reference (sig.return_type));
+ if (return_type.data_type != null) {
+ var_decl = new CCodeDeclaration (get_value_type_name_from_type_reference (return_type));
var_decl.add_declarator (new CCodeVariableDeclarator ("v_return"));
marshaller_body.add_statement (var_decl);
@@ -218,7 +219,7 @@
false_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("data2"), data)));
marshaller_body.add_statement (new CCodeIfStatement (cond, true_block, false_block));
- var c_assign = new CCodeAssignment (new CCodeIdentifier ("callback"), new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_signal_marshaller_function (sig, "GMarshalFunc")));
+ var c_assign = new CCodeAssignment (new CCodeIdentifier ("callback"), new CCodeCastExpression (new CCodeConditionalExpression (new CCodeIdentifier ("marshal_data"), new CCodeIdentifier ("marshal_data"), new CCodeMemberAccess (new CCodeIdentifier ("cc"), "callback", true)), get_marshaller_function (params, return_type, "GMarshalFunc")));
marshaller_body.add_statement (new CCodeExpressionStatement (c_assign));
fc = new CCodeFunctionCall (new CCodeIdentifier ("callback"));
@@ -240,20 +241,20 @@
}
fc.add_argument (new CCodeIdentifier ("data2"));
- if (sig.return_type.data_type != null) {
+ if (return_type.data_type != null) {
marshaller_body.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("v_return"), fc)));
CCodeFunctionCall set_fc;
- if (sig.return_type.type_parameter != null) {
+ if (return_type.type_parameter != null) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
- } else if (sig.return_type is ErrorType) {
+ } else if (return_type is ErrorType) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_set_pointer"));
- } else if (sig.return_type.data_type is Class || sig.return_type.data_type is Interface) {
+ } else if (return_type.data_type is Class || return_type.data_type is Interface) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_object"));
- } else if (sig.return_type.data_type == string_type.data_type) {
+ } else if (return_type.data_type == string_type.data_type) {
set_fc = new CCodeFunctionCall (new CCodeIdentifier ("g_value_take_string"));
} else {
- set_fc = new CCodeFunctionCall (new CCodeIdentifier (sig.return_type.data_type.get_set_value_function ()));
+ set_fc = new CCodeFunctionCall (new CCodeIdentifier (return_type.data_type.get_set_value_function ()));
}
set_fc.add_argument (new CCodeIdentifier ("return_value"));
set_fc.add_argument (new CCodeIdentifier ("v_return"));
Modified: trunk/gobject/valaccodegeneratorsourcefile.vala
==============================================================================
--- trunk/gobject/valaccodegeneratorsourcefile.vala (original)
+++ trunk/gobject/valaccodegeneratorsourcefile.vala Sun Apr 20 21:42:04 2008
@@ -193,6 +193,7 @@
next_temp_var_id = 0;
string_h_needed = false;
+ dbus_glib_h_needed = false;
requires_free_checked = false;
requires_array_free = false;
requires_array_move = false;
@@ -286,6 +287,10 @@
source_include_directives.append (new CCodeIncludeDirective ("string.h"));
}
+ if (dbus_glib_h_needed) {
+ source_include_directives.append (new CCodeIncludeDirective ("dbus/dbus-glib.h"));
+ }
+
CCodeComment comment = null;
if (source_file.comment != null) {
comment = new CCodeComment (source_file.comment);
Modified: trunk/gobject/valaccodetypesymbolbinding.vala
==============================================================================
--- trunk/gobject/valaccodetypesymbolbinding.vala (original)
+++ trunk/gobject/valaccodetypesymbolbinding.vala Sun Apr 20 21:42:04 2008
@@ -161,7 +161,7 @@
csignew.add_argument (new CCodeConstant ("NULL"));
csignew.add_argument (new CCodeConstant ("NULL"));
- string marshaller = codegen.get_signal_marshaller_function (sig);
+ string marshaller = codegen.get_marshaller_function (sig.get_parameters (), sig.return_type);
var marshal_arg = new CCodeIdentifier (marshaller);
csignew.add_argument (marshal_arg);
Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala (original)
+++ trunk/vala/valaclass.vala Sun Apr 20 21:42:04 2008
@@ -62,6 +62,7 @@
private string marshaller_type_name;
private string get_value_function;
private string set_value_function;
+ private string? type_signature;
private Gee.List<TypeParameter> type_parameters = new ArrayList<TypeParameter> ();
@@ -487,6 +488,10 @@
return get_lower_case_cname (infix).up ();
}
+ public override string? get_type_signature () {
+ return type_signature;
+ }
+
public override bool is_reference_type () {
return true;
}
@@ -538,6 +543,9 @@
add_cheader_filename (filename);
}
}
+ if (a.has_argument ("type_signature")) {
+ type_signature = a.get_string ("type_signature");
+ }
}
/**
Modified: trunk/vala/valadatatype.vala
==============================================================================
--- trunk/vala/valadatatype.vala (original)
+++ trunk/vala/valadatatype.vala Sun Apr 20 21:42:04 2008
@@ -443,4 +443,15 @@
return null;
}
}
+
+ /**
+ * Returns type signature as used for GVariant and D-Bus.
+ */
+ public string? get_type_signature () {
+ if (data_type != null) {
+ return data_type.get_type_signature ();
+ } else {
+ return null;
+ }
+ }
}
Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala (original)
+++ trunk/vala/valastruct.vala Sun Apr 20 21:42:04 2008
@@ -49,6 +49,7 @@
private string set_value_function;
private string default_value = null;
private bool simple_type;
+ private string? type_signature;
/**
* Specifies the default construction method.
@@ -223,6 +224,10 @@
return get_lower_case_cname (infix).up ();
}
+ public override string? get_type_signature () {
+ return type_signature;
+ }
+
/**
* Returns whether this is an integer type.
*
@@ -281,6 +286,9 @@
if (a.has_argument ("default_value")) {
set_default_value (a.get_string ("default_value"));
}
+ if (a.has_argument ("type_signature")) {
+ type_signature = a.get_string ("type_signature");
+ }
}
private void process_integer_type_attribute (Attribute a) {
Modified: trunk/vala/valatypesymbol.vala
==============================================================================
--- trunk/vala/valatypesymbol.vala (original)
+++ trunk/vala/valatypesymbol.vala Sun Apr 20 21:42:04 2008
@@ -233,4 +233,11 @@
public virtual int get_type_parameter_index (string name) {
return -1;
}
+
+ /**
+ * Returns type signature as used for GVariant and D-Bus
+ */
+ public virtual string? get_type_signature () {
+ return null;
+ }
}
Modified: trunk/vapi/dbus-glib-1.vapi
==============================================================================
--- trunk/vapi/dbus-glib-1.vapi (original)
+++ trunk/vapi/dbus-glib-1.vapi Sun Apr 20 21:42:04 2008
@@ -97,6 +97,8 @@
public class Connection {
[CCode (cname = "dbus_g_proxy_new_for_name")]
public Object get_object (string name, string path, string interface_);
+ [CCode (cname = "dbus_g_connection_register_g_object")]
+ public void register_object (string at_path, GLib.Object object);
}
[CCode (cname = "DBusGProxy", lower_case_csuffix = "g_proxy")]
@@ -113,4 +115,11 @@
[CCode (cname = "DBusGProxyCall")]
public class ProxyCall {
}
+
+ public enum RequestNameReply {
+ PRIMARY_OWNER,
+ IN_QUEUE,
+ EXISTS,
+ ALREADY_OWNER
+ }
}
Modified: trunk/vapi/glib-2.0.vapi
==============================================================================
--- trunk/vapi/glib-2.0.vapi (original)
+++ trunk/vapi/glib-2.0.vapi Sun Apr 20 21:42:04 2008
@@ -24,7 +24,7 @@
*/
[SimpleType]
-[CCode (cname = "gboolean", cheader_filename = "glib.h", type_id = "G_TYPE_BOOLEAN", marshaller_type_name = "BOOLEAN", get_value_function = "g_value_get_boolean", set_value_function = "g_value_set_boolean", default_value = "FALSE")]
+[CCode (cname = "gboolean", cheader_filename = "glib.h", type_id = "G_TYPE_BOOLEAN", marshaller_type_name = "BOOLEAN", get_value_function = "g_value_get_boolean", set_value_function = "g_value_set_boolean", default_value = "FALSE", type_signature = "b")]
public struct bool {
}
@@ -34,7 +34,7 @@
}
[SimpleType]
-[CCode (cname = "gchar", cprefix = "g_ascii_", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "\'\\0\'")]
+[CCode (cname = "gchar", cprefix = "g_ascii_", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "\'\\0\'", type_signature = "y")]
[IntegerType (rank = 2, min = 0, max = 127)]
public struct char {
[InstanceLast ()]
@@ -67,7 +67,7 @@
}
[SimpleType]
-[CCode (cname = "gint", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0")]
+[CCode (cname = "gint", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0", type_signature = "i")]
[IntegerType (rank = 6)]
public struct int {
[CCode (cname = "G_MININT")]
@@ -87,7 +87,7 @@
}
[SimpleType]
-[CCode (cname = "guint", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U")]
+[CCode (cname = "guint", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U", type_signature = "u")]
[IntegerType (rank = 7)]
public struct uint {
[CCode (cname = "0")]
@@ -107,7 +107,7 @@
}
[SimpleType]
-[CCode (cname = "gshort", cheader_filename = "glib.h", default_value = "0")]
+[CCode (cname = "gshort", cheader_filename = "glib.h", default_value = "0", type_signature = "n")]
[IntegerType (rank = 4, min = -32768, max = 32767)]
public struct short {
[CCode (cname = "G_MINSHORT")]
@@ -121,7 +121,7 @@
}
[SimpleType]
-[CCode (cname = "gushort", cheader_filename = "glib.h", default_value = "0U")]
+[CCode (cname = "gushort", cheader_filename = "glib.h", default_value = "0U", type_signature = "q")]
[IntegerType (rank = 5, min = 0, max = 65535)]
public struct ushort {
[CCode (cname = "0U")]
@@ -194,7 +194,7 @@
}
[SimpleType]
-[CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "0")]
+[CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "0", type_signature = "y")]
[IntegerType (rank = 1, min = -128, max = 127)]
public struct int8 {
[CCode (cname = "G_MININT8")]
@@ -207,7 +207,7 @@
}
[SimpleType]
-[CCode (cname = "guint8", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "0U")]
+[CCode (cname = "guint8", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "0U", type_signature = "y")]
[IntegerType (rank = 3, min = 0, max = 255)]
public struct uint8 {
[CCode (cname = "0U")]
@@ -220,7 +220,7 @@
}
[SimpleType]
-[CCode (cname = "gint16", cheader_filename = "glib.h", default_value = "0")]
+[CCode (cname = "gint16", cheader_filename = "glib.h", default_value = "0", type_signature = "n")]
[IntegerType (rank = 4, min = -32768, max = 32767)]
public struct int16 {
[CCode (cname = "G_MININT16")]
@@ -233,7 +233,7 @@
}
[SimpleType]
-[CCode (cname = "guint16", cheader_filename = "glib.h", default_value = "0U")]
+[CCode (cname = "guint16", cheader_filename = "glib.h", default_value = "0U", type_signature = "q")]
[IntegerType (rank = 5, min = 0, max = 65535)]
public struct uint16 {
[CCode (cname = "0U")]
@@ -246,7 +246,7 @@
}
[SimpleType]
-[CCode (cname = "gint32", cheader_filename = "glib.h", default_value = "0")]
+[CCode (cname = "gint32", cheader_filename = "glib.h", default_value = "0", type_signature = "i")]
[IntegerType (rank = 6)]
public struct int32 {
[CCode (cname = "G_MININT32")]
@@ -259,7 +259,7 @@
}
[SimpleType]
-[CCode (cname = "guint32", cheader_filename = "glib.h", default_value = "0U")]
+[CCode (cname = "guint32", cheader_filename = "glib.h", default_value = "0U", type_signature = "u")]
[IntegerType (rank = 7)]
public struct uint32 {
[CCode (cname = "0U")]
@@ -273,7 +273,7 @@
}
[SimpleType]
-[CCode (cname = "gint64", cheader_filename = "glib.h", type_id = "G_TYPE_INT64", marshaller_type_name = "INT64", get_value_function = "g_value_get_int64", set_value_function = "g_value_set_int64", default_value = "0LL")]
+[CCode (cname = "gint64", cheader_filename = "glib.h", type_id = "G_TYPE_INT64", marshaller_type_name = "INT64", get_value_function = "g_value_get_int64", set_value_function = "g_value_set_int64", default_value = "0LL", type_signature = "x")]
[IntegerType (rank = 10)]
public struct int64 {
[CCode (cname = "G_MININT64")]
@@ -287,7 +287,7 @@
}
[SimpleType]
-[CCode (cname = "guint64", cheader_filename = "glib.h", type_id = "G_TYPE_UINT64", marshaller_type_name = "UINT64", get_value_function = "g_value_get_uint64", set_value_function = "g_value_set_uint64", default_value = "0ULL")]
+[CCode (cname = "guint64", cheader_filename = "glib.h", type_id = "G_TYPE_UINT64", marshaller_type_name = "UINT64", get_value_function = "g_value_get_uint64", set_value_function = "g_value_set_uint64", default_value = "0ULL", type_signature = "t")]
[IntegerType (rank = 11)]
public struct uint64 {
[CCode (cname = "0ULL")]
@@ -345,7 +345,7 @@
}
[SimpleType]
-[CCode (cname = "double", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_DOUBLE", marshaller_type_name = "DOUBLE", get_value_function = "g_value_get_double", set_value_function = "g_value_set_double", default_value = "0.0")]
+[CCode (cname = "double", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_DOUBLE", marshaller_type_name = "DOUBLE", get_value_function = "g_value_get_double", set_value_function = "g_value_set_double", default_value = "0.0", type_signature = "d")]
[FloatingType (rank = 2)]
public struct double {
[CCode (cname = "DBL_MANT_DIG")]
@@ -494,7 +494,7 @@
HANGUL_LVT_SYLLABLE
}
-[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string")]
+[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "s")]
public class string {
[CCode (cname = "strstr")]
public weak string? str (string needle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]