vala r1561 - in trunk: . gobject vapi
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1561 - in trunk: . gobject vapi
- Date: Wed, 4 Jun 2008 13:53:55 +0000 (UTC)
Author: juergbi
Date: Wed Jun 4 13:53:55 2008
New Revision: 1561
URL: http://svn.gnome.org/viewvc/vala?rev=1561&view=rev
Log:
2008-06-04 JÃrg Billeter <j bitron ch>
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodeinterfacebinding.vala:
* gobject/valaccodetypesymbolbinding.vala:
* gobject/valaclassregisterfunction.vala:
Respect custom type_id
* vapi/glib-2.0.vapi:
Fix GTypeModule binding
Modified:
trunk/ChangeLog
trunk/gobject/valaccodeclassbinding.vala
trunk/gobject/valaccodegenerator.vala
trunk/gobject/valaccodeinterfacebinding.vala
trunk/gobject/valaccodetypesymbolbinding.vala
trunk/gobject/valaclassregisterfunction.vala
trunk/vapi/glib-2.0.vapi
Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala (original)
+++ trunk/gobject/valaccodeclassbinding.vala Wed Jun 4 13:53:55 2008
@@ -80,21 +80,21 @@
if (is_gtypeinstance) {
decl_frag.append (new CCodeNewline ());
var macro = "(%s_get_type ())".printf (cl.get_lower_case_cname (null));
- decl_frag.append (new CCodeMacroReplacement (cl.get_upper_case_cname ("TYPE_"), macro));
+ decl_frag.append (new CCodeMacroReplacement (cl.get_type_id (), macro));
- macro = "(G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, %s))".printf (cl.get_upper_case_cname ("TYPE_"), cl.get_cname ());
+ macro = "(G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, %s))".printf (cl.get_type_id (), cl.get_cname ());
decl_frag.append (new CCodeMacroReplacement ("%s(obj)".printf (cl.get_upper_case_cname (null)), macro));
- macro = "(G_TYPE_CHECK_CLASS_CAST ((klass), %s, %sClass))".printf (cl.get_upper_case_cname ("TYPE_"), cl.get_cname ());
+ macro = "(G_TYPE_CHECK_CLASS_CAST ((klass), %s, %sClass))".printf (cl.get_type_id (), cl.get_cname ());
decl_frag.append (new CCodeMacroReplacement ("%s_CLASS(klass)".printf (cl.get_upper_case_cname (null)), macro));
- macro = "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))".printf (cl.get_upper_case_cname ("TYPE_"));
+ macro = "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))".printf (cl.get_type_id ());
decl_frag.append (new CCodeMacroReplacement ("%s(obj)".printf (cl.get_upper_case_cname ("IS_")), macro));
- macro = "(G_TYPE_CHECK_CLASS_TYPE ((klass), %s))".printf (cl.get_upper_case_cname ("TYPE_"));
+ macro = "(G_TYPE_CHECK_CLASS_TYPE ((klass), %s))".printf (cl.get_type_id ());
decl_frag.append (new CCodeMacroReplacement ("%s_CLASS(klass)".printf (cl.get_upper_case_cname ("IS_")), macro));
- macro = "(G_TYPE_INSTANCE_GET_CLASS ((obj), %s, %sClass))".printf (cl.get_upper_case_cname ("TYPE_"), cl.get_cname ());
+ macro = "(G_TYPE_INSTANCE_GET_CLASS ((obj), %s, %sClass))".printf (cl.get_type_id (), cl.get_cname ());
decl_frag.append (new CCodeMacroReplacement ("%s_GET_CLASS(obj)".printf (cl.get_upper_case_cname (null)), macro));
decl_frag.append (new CCodeNewline ());
}
@@ -143,7 +143,7 @@
/* only add the *Private struct if it is not empty, i.e. we actually have private data */
if (cl.has_private_fields || cl.get_type_parameters ().size > 0) {
codegen.source_type_member_declaration.append (codegen.instance_priv_struct);
- var macro = "(G_TYPE_INSTANCE_GET_PRIVATE ((o), %s, %sPrivate))".printf (cl.get_upper_case_cname ("TYPE_"), cl.get_cname ());
+ var macro = "(G_TYPE_INSTANCE_GET_PRIVATE ((o), %s, %sPrivate))".printf (cl.get_type_id (), cl.get_cname ());
codegen.source_type_member_declaration.append (new CCodeMacroReplacement ("%s_GET_PRIVATE(o)".printf (cl.get_upper_case_cname (null)), macro));
}
codegen.source_type_member_declaration.append (codegen.prop_enum);
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Wed Jun 4 13:53:55 2008
@@ -311,7 +311,7 @@
decl_frag.append (new CCodeNewline ());
var macro = "(%s_get_type ())".printf (en.get_lower_case_cname (null));
- decl_frag.append (new CCodeMacroReplacement (en.get_upper_case_cname ("TYPE_"), macro));
+ decl_frag.append (new CCodeMacroReplacement (en.get_type_id (), macro));
var clist = new CCodeInitializerList (); /* or during visit time? */
CCodeInitializerList clist_ev = null;
@@ -981,7 +981,7 @@
var ccall = new CCodeFunctionCall (new CCodeIdentifier ("g_type_class_peek"));
- ccall.add_argument (new CCodeIdentifier (cl.get_upper_case_cname ("TYPE_")));
+ ccall.add_argument (new CCodeIdentifier (cl.get_type_id ()));
var ccast = new CCodeFunctionCall (new CCodeIdentifier ("%s_CLASS".printf (cl.get_upper_case_cname (null))));
ccast.add_argument (ccall);
cblock.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("klass"), ccast)));
Modified: trunk/gobject/valaccodeinterfacebinding.vala
==============================================================================
--- trunk/gobject/valaccodeinterfacebinding.vala (original)
+++ trunk/gobject/valaccodeinterfacebinding.vala Wed Jun 4 13:53:55 2008
@@ -56,15 +56,15 @@
decl_frag.append (new CCodeNewline ());
var macro = "(%s_get_type ())".printf (iface.get_lower_case_cname (null));
- decl_frag.append (new CCodeMacroReplacement (iface.get_upper_case_cname ("TYPE_"), macro));
+ decl_frag.append (new CCodeMacroReplacement (iface.get_type_id (), macro));
- macro = "(G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, %s))".printf (iface.get_upper_case_cname ("TYPE_"), iface.get_cname ());
+ macro = "(G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, %s))".printf (iface.get_type_id (), iface.get_cname ());
decl_frag.append (new CCodeMacroReplacement ("%s(obj)".printf (iface.get_upper_case_cname (null)), macro));
- macro = "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))".printf (iface.get_upper_case_cname ("TYPE_"));
+ macro = "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))".printf (iface.get_type_id ());
decl_frag.append (new CCodeMacroReplacement ("%s(obj)".printf (iface.get_upper_case_cname ("IS_")), macro));
- macro = "(G_TYPE_INSTANCE_GET_INTERFACE ((obj), %s, %s))".printf (iface.get_upper_case_cname ("TYPE_"), iface.get_type_cname ());
+ macro = "(G_TYPE_INSTANCE_GET_INTERFACE ((obj), %s, %s))".printf (iface.get_type_id (), iface.get_type_cname ());
decl_frag.append (new CCodeMacroReplacement ("%s_GET_INTERFACE(obj)".printf (iface.get_upper_case_cname (null)), macro));
decl_frag.append (new CCodeNewline ());
Modified: trunk/gobject/valaccodetypesymbolbinding.vala
==============================================================================
--- trunk/gobject/valaccodetypesymbolbinding.vala (original)
+++ trunk/gobject/valaccodetypesymbolbinding.vala Wed Jun 4 13:53:55 2008
@@ -31,7 +31,7 @@
cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.blurb)));
if ((prop.property_type.data_type is Class && ((Class) prop.property_type.data_type).is_subtype_of (codegen.gobject_type)) || prop.property_type.data_type is Interface) {
cspec.call = new CCodeIdentifier ("g_param_spec_object");
- cspec.add_argument (new CCodeIdentifier (prop.property_type.data_type.get_upper_case_cname ("TYPE_")));
+ cspec.add_argument (new CCodeIdentifier (prop.property_type.data_type.get_type_id ()));
} else if (prop.property_type.data_type == codegen.string_type.data_type) {
cspec.call = new CCodeIdentifier ("g_param_spec_string");
cspec.add_argument (new CCodeConstant ("NULL"));
@@ -169,7 +169,7 @@
public CCodeFunctionCall get_signal_creation (Signal sig, TypeSymbol type) {
var csignew = new CCodeFunctionCall (new CCodeIdentifier ("g_signal_new"));
csignew.add_argument (new CCodeConstant ("\"%s\"".printf (sig.name)));
- csignew.add_argument (new CCodeIdentifier (type.get_upper_case_cname ("TYPE_")));
+ csignew.add_argument (new CCodeIdentifier (type.get_type_id ()));
csignew.add_argument (new CCodeConstant ("G_SIGNAL_RUN_LAST"));
csignew.add_argument (new CCodeConstant ("0"));
csignew.add_argument (new CCodeConstant ("NULL"));
Modified: trunk/gobject/valaclassregisterfunction.vala
==============================================================================
--- trunk/gobject/valaclassregisterfunction.vala (original)
+++ trunk/gobject/valaclassregisterfunction.vala Wed Jun 4 13:53:55 2008
@@ -70,7 +70,7 @@
}
public override string get_parent_type_name () {
- return class_reference.base_class.get_upper_case_cname ("TYPE_");
+ return class_reference.base_class.get_type_id ();
}
public override string get_type_flags () {
@@ -120,7 +120,7 @@
var reg_call = new CCodeFunctionCall (new CCodeIdentifier ("g_type_add_interface_static"));
reg_call.add_argument (new CCodeIdentifier ("%s_type_id".printf (class_reference.get_lower_case_cname (null))));
- reg_call.add_argument (new CCodeIdentifier (iface.get_upper_case_cname ("TYPE_")));
+ reg_call.add_argument (new CCodeIdentifier (iface.get_type_id ()));
reg_call.add_argument (new CCodeIdentifier ("&%s".printf (iface_info_name)));
frag.append (new CCodeExpressionStatement (reg_call));
}
Modified: trunk/vapi/glib-2.0.vapi
==============================================================================
--- trunk/vapi/glib-2.0.vapi (original)
+++ trunk/vapi/glib-2.0.vapi Wed Jun 4 13:53:55 2008
@@ -757,10 +757,15 @@
public interface TypePlugin {
}
+ [CCode (lower_case_csuffix = "type_module")]
public class TypeModule : Object, TypePlugin {
public bool use ();
public void unuse ();
public void set_name (string name);
+ [NoWrapper]
+ public virtual bool load ();
+ [NoWrapper]
+ public virtual void unload ();
}
[CCode (ref_function = "g_param_spec_ref", unref_function = "g_param_spec_unref")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]