summaryrefslogtreecommitdiff
path: root/vala/valadynamicproperty.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2008-05-18 16:57:27 +0000
committerJürg Billeter <juergbi@src.gnome.org>2008-05-18 16:57:27 +0000
commit414ff72391eee8ca23b00883b71350e0e83b31ca (patch)
tree1e509e4ec72d95d1eb832054bd70b11cdbd2e071 /vala/valadynamicproperty.vala
parent2b3184c12b8b21d2d05c6814f5be8676e20f9adc (diff)
downloadvala-414ff72391eee8ca23b00883b71350e0e83b31ca.tar.gz
Add support for dynamic properties
2008-05-18 Juerg Billeter <j@bitron.ch> * vala/Makefile.am: * vala/valacodegenerator.vala: * vala/valadynamicproperty.vala: * vala/valasemanticanalyzer.vala: * gobject/Makefile.am: * gobject/valaccodedynamicmethodbinding.vala: * gobject/valaccodedynamicpropertybinding.vala: * gobject/valaccodegenerator.vala: * gobject/valaccodememberaccessbinding.vala: Add support for dynamic properties svn path=/trunk/; revision=1398
Diffstat (limited to 'vala/valadynamicproperty.vala')
-rw-r--r--vala/valadynamicproperty.vala47
1 files changed, 47 insertions, 0 deletions
diff --git a/vala/valadynamicproperty.vala b/vala/valadynamicproperty.vala
new file mode 100644
index 000000000..ea76ca57d
--- /dev/null
+++ b/vala/valadynamicproperty.vala
@@ -0,0 +1,47 @@
+/* valadynamicproperty.vala
+ *
+ * Copyright (C) 2008 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Jürg Billeter <j@bitron.ch>
+ */
+
+using GLib;
+using Gee;
+
+/**
+ * Represents a late bound property.
+ */
+public class Vala.DynamicProperty : Property {
+ public DataType dynamic_type { get; set; }
+
+ private string cname;
+
+ public DynamicProperty (DataType dynamic_type, string name, SourceReference? source_reference = null) {
+ this.dynamic_type = dynamic_type;
+ this.name = name;
+ this.source_reference = source_reference;
+ }
+
+ public override Collection<string> get_cheader_filenames () {
+ return new ReadOnlyCollection<string> ();
+ }
+
+ public override CodeBinding? create_code_binding (CodeGenerator codegen) {
+ return codegen.create_dynamic_property_binding (this);
+ }
+}