vala r1888 - in trunk: . gobject vala



Author: juergbi
Date: Fri Oct 24 12:46:45 2008
New Revision: 1888
URL: http://svn.gnome.org/viewvc/vala?rev=1888&view=rev

Log:
2008-10-24  JÃrg Billeter  <j bitron ch>

	* vala/valaclass.vala:
	* vala/valacodegenerator.vala:
	* vala/valainterface.vala:
	* gobject/Makefile.am:
	* gobject/valaccodegenerator.vala:
	* gobject/valaccodemodule.vala:
	* gobject/valagobjectclassmodule.vala:
	* gobject/valagobjectinterfacemodule.vala:

	Add GObjectClassModule and GObjectInterfaceModule


Added:
   trunk/gobject/valagobjectclassmodule.vala   (contents, props changed)
      - copied, changed from r1887, /trunk/gobject/valaccodeclassbinding.vala
   trunk/gobject/valagobjectinterfacemodule.vala   (contents, props changed)
      - copied, changed from r1887, /trunk/gobject/valaccodeinterfacebinding.vala
Removed:
   trunk/gobject/valaccodeclassbinding.vala
   trunk/gobject/valaccodeinterfacebinding.vala
Modified:
   trunk/ChangeLog
   trunk/gobject/Makefile.am
   trunk/gobject/valaccodegenerator.vala
   trunk/gobject/valaccodemodule.vala
   trunk/vala/valaclass.vala
   trunk/vala/valacodegenerator.vala
   trunk/vala/valainterface.vala

Modified: trunk/gobject/Makefile.am
==============================================================================
--- trunk/gobject/Makefile.am	(original)
+++ trunk/gobject/Makefile.am	Fri Oct 24 12:46:45 2008
@@ -16,7 +16,6 @@
 	valaccodeassignmentbinding.vala \
 	valaccodebasemodule.vala \
 	valaccodebinding.vala \
-	valaccodeclassbinding.vala \
 	valaccodecompiler.vala \
 	valaccodedynamicpropertybinding.vala \
 	valaccodedynamicsignalbinding.vala \
@@ -26,7 +25,6 @@
 	valaccodegeneratorsignal.vala \
 	valaccodegeneratorsourcefile.vala \
 	valaccodegeneratorstruct.vala \
-	valaccodeinterfacebinding.vala \
 	valaccodeinvocationexpressionbinding.vala \
 	valaccodememberaccessbinding.vala \
 	valaccodemethodmodule.vala \
@@ -34,6 +32,8 @@
 	valaclassregisterfunction.vala \
 	valadbusmodule.vala \
 	valagirwriter.vala \
+	valagobjectclassmodule.vala \
+	valagobjectinterfacemodule.vala \
 	valagobjectmodule.vala \
 	valainterfaceregisterfunction.vala \
 	valatyperegisterfunction.vala \

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Fri Oct 24 12:46:45 2008
@@ -144,6 +144,8 @@
 		head = new CCodeBaseModule (this, head);
 		head = new CCodeMethodModule (this, head);
 		head = new GObjectModule (this, head);
+		head = new GObjectClassModule (this, head);
+		head = new GObjectInterfaceModule (this, head);
 		head = new DBusModule (this, head);
 
 		predefined_marshal_set = new HashSet<string> (str_hash, str_equal);
@@ -291,11 +293,11 @@
 	}
 
 	public override void visit_class (Class cl) {
-		code_binding (cl).emit ();
+		head.visit_class (cl);
 	}
 
 	public override void visit_interface (Interface iface) {
-		code_binding (iface).emit ();
+		head.visit_interface (iface);
 	}
 
 	public override void visit_enum (Enum en) {
@@ -4362,14 +4364,6 @@
 		return node.ccodenode;
 	}
 
-	public override CodeBinding? create_class_binding (Class node) {
-		return new CCodeClassBinding (this, node);
-	}
-
-	public override CodeBinding? create_interface_binding (Interface node) {
-		return new CCodeInterfaceBinding (this, node);
-	}
-
 	public override CodeBinding? create_dynamic_property_binding (DynamicProperty node) {
 		return new CCodeDynamicPropertyBinding (this, node);
 	}

Modified: trunk/gobject/valaccodemodule.vala
==============================================================================
--- trunk/gobject/valaccodemodule.vala	(original)
+++ trunk/gobject/valaccodemodule.vala	Fri Oct 24 12:46:45 2008
@@ -52,6 +52,14 @@
 		next.emit (context);
 	}
 
+	public virtual void visit_class (Class cl) {
+		next.visit_class (cl);
+	}
+
+	public virtual void visit_interface (Interface iface) {
+		next.visit_interface (iface);
+	}
+
 	public virtual void visit_method (Method m) {
 		next.visit_method (m);
 	}

Copied: trunk/gobject/valagobjectclassmodule.vala (from r1887, /trunk/gobject/valaccodeclassbinding.vala)
==============================================================================
--- /trunk/gobject/valaccodeclassbinding.vala	(original)
+++ trunk/gobject/valagobjectclassmodule.vala	Fri Oct 24 12:46:45 2008
@@ -1,4 +1,4 @@
-/* valaccodeclassbinding.vala
+/* valagobjectclassmodule.vala
  *
  * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
  *
@@ -23,15 +23,12 @@
 
 using GLib;
 
-public class Vala.CCodeClassBinding : CCodeBinding {
-	public Class cl { get; set; }
-
-	public CCodeClassBinding (CCodeGenerator codegen, Class cl) {
-		this.cl = cl;
-		this.codegen = codegen;
+public class Vala.GObjectClassModule : CCodeModule {
+	public GObjectClassModule (CCodeGenerator codegen, CCodeModule? next) {
+		base (codegen, next);
 	}
 
-	public override void emit () {
+	public override void visit_class (Class cl) {
 		var old_symbol = codegen.current_symbol;
 		var old_type_symbol = codegen.current_type_symbol;
 		var old_class = codegen.current_class;

Copied: trunk/gobject/valagobjectinterfacemodule.vala (from r1887, /trunk/gobject/valaccodeinterfacebinding.vala)
==============================================================================
--- /trunk/gobject/valaccodeinterfacebinding.vala	(original)
+++ trunk/gobject/valagobjectinterfacemodule.vala	Fri Oct 24 12:46:45 2008
@@ -1,4 +1,4 @@
-/* valaccodeinterfacebinding.vala
+/* valagobjectinterfacemodule.vala
  *
  * Copyright (C) 2006-2008  JÃrg Billeter, Raffaele Sandrini
  *
@@ -23,15 +23,12 @@
 
 using GLib;
 
-public class Vala.CCodeInterfaceBinding : CCodeBinding {
-	public Interface iface { get; set; }
-
-	public CCodeInterfaceBinding (CCodeGenerator codegen, Interface iface) {
-		this.iface = iface;
-		this.codegen = codegen;
+public class Vala.GObjectInterfaceModule : CCodeModule {
+	public GObjectInterfaceModule (CCodeGenerator codegen, CCodeModule? next) {
+		base (codegen, next);
 	}
 
-	public override void emit () {
+	public override void visit_interface (Interface iface) {
 		codegen.current_symbol = iface;
 		codegen.current_type_symbol = iface;
 

Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala	(original)
+++ trunk/vala/valaclass.vala	Fri Oct 24 12:46:45 2008
@@ -817,9 +817,5 @@
 			}
 		}
 	}
-
-	public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-		return codegen.create_class_binding (this);
-	}
 }
 

Modified: trunk/vala/valacodegenerator.vala
==============================================================================
--- trunk/vala/valacodegenerator.vala	(original)
+++ trunk/vala/valacodegenerator.vala	Fri Oct 24 12:46:45 2008
@@ -34,14 +34,6 @@
 	public virtual void emit (CodeContext context) {
 	}
 
-	public virtual CodeBinding? create_class_binding (Class node) {
-		return null;
-	}
-
-	public virtual CodeBinding? create_interface_binding (Interface node) {
-		return null;
-	}
-
 	public virtual CodeBinding? create_dynamic_property_binding (DynamicProperty node) {
 		return null;
 	}

Modified: trunk/vala/valainterface.vala
==============================================================================
--- trunk/vala/valainterface.vala	(original)
+++ trunk/vala/valainterface.vala	Fri Oct 24 12:46:45 2008
@@ -530,10 +530,6 @@
 		}
 	}
 
-	public override CodeBinding? create_code_binding (CodeGenerator codegen) {
-		return codegen.create_interface_binding (this);
-	}
-
 	public override string? get_param_spec_function () {
 		foreach (DataType prerequisite in prerequisites) {
 			var prereq = prerequisite as ObjectType;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]