From: Jürg Billeter Date: Wed, 8 Jul 2009 10:40:04 +0000 (+0100) Subject: Fix GTypeModule-based plugins X-Git-Tag: 0.7.5~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a002d00095ce0c2b6e0d73c2dc176381c6cd0aca;p=thirdparty%2Fvala.git Fix GTypeModule-based plugins --- diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index a38954cf8..7ac0ed2d9 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -529,6 +529,7 @@ internal class Vala.GTypeModule : GErrorModule { var type_fun = new ClassRegisterFunction (cl, context); type_fun.init_from_type (in_plugin); + source_declarations.add_type_member_declaration (type_fun.get_source_declaration ()); source_type_member_definition.append (type_fun.get_definition ()); if (in_plugin) { diff --git a/codegen/valatyperegisterfunction.vala b/codegen/valatyperegisterfunction.vala index 85dfcc01b..736883fab 100644 --- a/codegen/valatyperegisterfunction.vala +++ b/codegen/valatyperegisterfunction.vala @@ -1,6 +1,6 @@ /* valatyperegisterfunction.vala * - * Copyright (C) 2006-2008 Jürg Billeter + * Copyright (C) 2006-2009 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,9 +26,9 @@ using GLib; * C function to register a type at runtime. */ public abstract class Vala.TypeRegisterFunction { - private CCodeFragment declaration_fragment = new CCodeFragment (); - - private CCodeFragment definition_fragment = new CCodeFragment (); + CCodeFragment source_declaration_fragment = new CCodeFragment (); + CCodeFragment declaration_fragment = new CCodeFragment (); + CCodeFragment definition_fragment = new CCodeFragment (); public CodeContext context { get; set; } @@ -62,7 +62,7 @@ public abstract class Vala.TypeRegisterFunction { if (!plugin) { type_block.add_statement (cdecl); } else { - definition_fragment.append (cdecl); + source_declaration_fragment.append (cdecl); } CCodeFunction fun; @@ -366,6 +366,10 @@ public abstract class Vala.TypeRegisterFunction { */ public abstract CCodeFragment get_type_interface_init_statements (); + public CCodeFragment get_source_declaration () { + return source_declaration_fragment; + } + /** * Returns the declaration for this type register function in C code. *