~ubuntu-branches/ubuntu/trusty/gtk-doc/trusty-proposed

« back to all changes in this revision

Viewing changes to tests/gobject/src/gobject.c

  • Committer: Martin Pitt
  • Date: 2011-01-27 14:41:59 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: martin.pitt@canonical.com-20110127144159-wagev8l04yc5b8jc
New upstream release with lots of bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * </para></listitem>
38
38
 * </itemizedlist>
39
39
 */
 
40
/**
 
41
 * SECTION:object2
 
42
 * @title: GtkdocObject2
 
43
 * @short_description: class with interface for gtk-doc unit test
 
44
 * @see_also: #GtkdocIface
 
45
 *
 
46
 * This file contains non-sense code for the sole purpose of testing the docs.
 
47
 */
40
48
 
41
49
#include <glib.h>
42
50
#include <glib-object.h>
43
51
 
44
52
#include "gobject.h"
 
53
#include "giface.h"
45
54
 
46
55
/* property ids */
47
56
 
50
59
  GTKDOC_OBJECT_DEP_TEST
51
60
};
52
61
 
 
62
enum {
 
63
  GTKDOC_OBJECT2_ITEST=1
 
64
};
 
65
 
53
66
/* constructor methods */
54
67
 
55
68
/**
170
183
                0); // n_params
171
184
 
172
185
  /**
 
186
   * GtkdocObject::strings-changed:
 
187
   * 
 
188
   * Something has happened.
 
189
   */
 
190
  g_signal_new ("strings-changed", G_TYPE_FROM_CLASS (klass),
 
191
                G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
 
192
                0,
 
193
                NULL, // accumulator
 
194
                NULL, // acc data
 
195
                g_cclosure_marshal_VOID__BOXED,
 
196
                G_TYPE_NONE, // return type
 
197
                1, G_TYPE_STRV); // n_params
 
198
  
 
199
#if GLIB_CHECK_VERSION (2, 25, 9)
 
200
  /**
 
201
   * GtkdocObject::variant-changed:
 
202
   * 
 
203
   * Something has happened.
 
204
   */
 
205
  g_signal_new ("variant-changed", G_TYPE_FROM_CLASS (klass),
 
206
                G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
 
207
                0,
 
208
                NULL, // accumulator
 
209
                NULL, // acc data
 
210
                g_cclosure_marshal_VOID__VARIANT,
 
211
                G_TYPE_NONE, // return type
 
212
                1, G_TYPE_VARIANT); // n_params
 
213
#endif
 
214
 
 
215
  /**
173
216
   * GtkdocObject:otest:
174
217
   *
175
218
   * Since: 0.1
205
248
      NULL, // class_finalize
206
249
      NULL, // class_data
207
250
      (guint16)sizeof(GtkdocObject),
208
 
      0,   // n_preallocs
 
251
      0,    // n_preallocs
209
252
      NULL, // instance_init
210
 
      NULL // value_table
 
253
      NULL  // value_table
211
254
    };
212
255
    type = g_type_register_static(G_TYPE_OBJECT,"GtkdocObject",&info,0);
213
256
  }
214
257
  return type;
215
258
}
216
259
 
 
260
 
 
261
static void gtkdoc_object2_class_init (GtkdocObjectClass *klass) {
 
262
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
263
 
 
264
  gobject_class->set_property = gtkdoc_object_set_property;
 
265
  gobject_class->get_property = gtkdoc_object_get_property;
 
266
 
 
267
  g_object_class_override_property (gobject_class, GTKDOC_OBJECT2_ITEST, "itest");
 
268
}
 
269
 
 
270
GType gtkdoc_object2_get_type (void) {
 
271
  static GType type = 0;
 
272
  if (type == 0) {
 
273
    static const GTypeInfo info = {
 
274
      (guint16)sizeof(GtkdocObject2Class),
 
275
      NULL, // base_init
 
276
      NULL, // base_finalize
 
277
      (GClassInitFunc)gtkdoc_object2_class_init, // class_init
 
278
      NULL, // class_finalize
 
279
      NULL, // class_data
 
280
      (guint16)sizeof(GtkdocObject2),
 
281
      0,    // n_preallocs
 
282
      NULL, // instance_init
 
283
      NULL  // value_table
 
284
    };
 
285
    static const GInterfaceInfo interface_info = {
 
286
      NULL,  // interface_init
 
287
      NULL,  // interface_finalize
 
288
      NULL   // interface_data 
 
289
    };
 
290
    type = g_type_register_static(G_TYPE_OBJECT,"GtkdocObject2",&info,0);
 
291
    g_type_add_interface_static(type, GTKDOC_TYPE_IFACE, &interface_info);
 
292
  }
 
293
  return type;
 
294
}
 
295