summaryrefslogtreecommitdiff
path: root/tests/scanner/annotation.c
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-13 00:02:24 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-13 00:02:24 +0000
commit19d6a8145200ddccea4ad62ccd93442f30772fe1 (patch)
tree1b534c2e6384723a2bd0b687b38faf0df8aaf618 /tests/scanner/annotation.c
parent6de1b29629397bc7328f1a44da7530ea2ff53dac (diff)
downloadgobject-introspection-19d6a8145200ddccea4ad62ccd93442f30772fe1.tar.gz
Bug 562467 – Property annotation
2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 562467 – Property annotation * giscanner/annotationparser.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c (annotation_object_set_property), (annotation_object_get_property), (annotation_object_class_init): Annotations are parsed for properties. svn path=/trunk/; revision=1027
Diffstat (limited to 'tests/scanner/annotation.c')
-rw-r--r--tests/scanner/annotation.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c
index 98b3b061..3c771dd6 100644
--- a/tests/scanner/annotation.c
+++ b/tests/scanner/annotation.c
@@ -5,6 +5,11 @@ static char backslash_parsing_tester = '\\';
G_DEFINE_TYPE (AnnotationObject, annotation_object, G_TYPE_OBJECT);
enum {
+ PROP_0,
+ PROP_STRING_PROPERTY,
+};
+
+enum {
STRING_SIGNAL,
LAST_SIGNAL
};
@@ -12,12 +17,47 @@ enum {
static guint annotation_object_signals[LAST_SIGNAL] = { 0 };
static void
+annotation_object_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id)
+ {
+ case PROP_STRING_PROPERTY:
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+annotation_object_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (prop_id)
+ {
+ case PROP_STRING_PROPERTY:
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
annotation_object_class_init (AnnotationObjectClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
+ gobject_class->set_property = annotation_object_set_property;
+ gobject_class->get_property = annotation_object_get_property;
+
/**
* AnnotationObject::string-signal:
* @annotation: the annotation object
@@ -38,6 +78,23 @@ annotation_object_class_init (AnnotationObjectClass *klass)
(GSignalCMarshaller)g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+ /**
+ * AnnotationObject:string-property:
+ *
+ * This is a property which is a string
+ *
+ * Since: 1.0
+ * Deprecated: 1.2: Use better-string-property instead
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_STRING_PROPERTY,
+ g_param_spec_string ("string-property",
+ "String property",
+ "This property is a string",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
}
static void