gobject-introspection r764 - trunk/tests/scanner
- From: walters svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r764 - trunk/tests/scanner
- Date: Mon, 20 Oct 2008 20:54:30 +0000 (UTC)
Author: walters
Date: Mon Oct 20 20:54:30 2008
New Revision: 764
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=764&view=rev
Log:
Tests for bug 556777
Modified:
trunk/tests/scanner/foo.c
Modified: trunk/tests/scanner/foo.c
==============================================================================
--- trunk/tests/scanner/foo.c (original)
+++ trunk/tests/scanner/foo.c Mon Oct 20 20:54:30 2008
@@ -2,6 +2,40 @@
#include "foo.h"
+/* A hidden type not exposed publicly, similar to GUPNP's XML wrapper
+ object */
+typedef struct _FooHidden FooHidden;
+
+struct _FooHidden
+{
+ char *frob;
+};
+
+FooHidden *
+foo_hidden_copy (const FooHidden *boxed)
+{
+ return (FooHidden *)g_memdup (boxed, sizeof (FooHidden));
+}
+
+void
+foo_hidden_free (FooHidden *boxed)
+{
+ g_slice_free (FooHidden, boxed);
+}
+
+
+GType
+foo_hidden_get_type (void)
+{
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ our_type = g_boxed_type_register_static ("FooHidden",
+ (GBoxedCopyFunc) foo_hidden_copy,
+ (GBoxedFreeFunc) foo_hidden_free);
+ return our_type;
+}
+
static void foo_do_foo (FooInterface *self);
typedef struct
@@ -39,7 +73,8 @@
enum {
PROP_0,
- PROP_STRING
+ PROP_STRING,
+ PROP_HIDDEN
};
enum {
@@ -73,6 +108,8 @@
{
case PROP_STRING:
break;
+ case PROP_HIDDEN:
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -91,6 +128,8 @@
{
case PROP_STRING:
break;
+ case PROP_HIDDEN:
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -114,6 +153,13 @@
"The String Property Blurb",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (gobject_class,
+ PROP_HIDDEN,
+ g_param_spec_boxed ("hidden",
+ "hidden property",
+ "should not be exposed",
+ foo_hidden_get_type (),
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
foo_object_signals[SIGNAL] =
g_signal_new ("signal",
G_OBJECT_CLASS_TYPE (gobject_class),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]