Back to index

unity  6.0.0
test_glib_signals_utils.cpp
Go to the documentation of this file.
00001 #include "test_glib_signals_utils.h"
00002 #include "test_glib_signals_utils_marshal.h"
00003 
00004 enum
00005 {
00006   SIGNAL_0,
00007   SIGNAL_1,
00008   SIGNAL_2,
00009   SIGNAL_3,
00010   SIGNAL_4,
00011   SIGNAL_5,
00012   SIGNAL_6,
00013 
00014   LAST_SIGNAL
00015 };
00016 
00017 
00018 static guint32 _service_signals[LAST_SIGNAL] = { 0 };
00019 
00020 G_DEFINE_TYPE(TestSignals, test_signals, G_TYPE_OBJECT);
00021 
00022 static void
00023 test_signals_class_init(TestSignalsClass* klass)
00024 {
00025   GObjectClass* obj_class = G_OBJECT_CLASS(klass);
00026 
00027   /* Signals */
00028   _service_signals[SIGNAL_0] =
00029     g_signal_new("signal0",
00030                  G_OBJECT_CLASS_TYPE(obj_class),
00031                  G_SIGNAL_RUN_LAST,
00032                  0,
00033                  NULL, NULL,
00034                  g_cclosure_marshal_VOID__VOID,
00035                  G_TYPE_NONE, 0);
00036 
00037   _service_signals[SIGNAL_1] =
00038     g_signal_new("signal1",
00039                  G_OBJECT_CLASS_TYPE(obj_class),
00040                  G_SIGNAL_RUN_LAST,
00041                  0,
00042                  NULL, NULL,
00043                  g_cclosure_marshal_VOID__STRING,
00044                  G_TYPE_NONE, 1, G_TYPE_STRING);
00045 
00046   _service_signals[SIGNAL_2] =
00047     g_signal_new("signal2",
00048                  G_OBJECT_CLASS_TYPE(obj_class),
00049                  G_SIGNAL_RUN_LAST,
00050                  0,
00051                  NULL, NULL,
00052                  test_signals_VOID__STRING_INT,
00053                  G_TYPE_NONE, 2,
00054                  G_TYPE_STRING, G_TYPE_INT);
00055 
00056   _service_signals[SIGNAL_3] =
00057     g_signal_new("signal3",
00058                  G_OBJECT_CLASS_TYPE(obj_class),
00059                  G_SIGNAL_RUN_LAST,
00060                  0,
00061                  NULL, NULL,
00062                  test_signals_VOID__STRING_INT_FLOAT,
00063                  G_TYPE_NONE, 3,
00064                  G_TYPE_STRING, G_TYPE_INT, G_TYPE_FLOAT);
00065 
00066   _service_signals[SIGNAL_4] =
00067     g_signal_new("signal4",
00068                  G_OBJECT_CLASS_TYPE(obj_class),
00069                  G_SIGNAL_RUN_LAST,
00070                  0,
00071                  NULL, NULL,
00072                  test_signals_VOID__STRING_INT_FLOAT_DOUBLE,
00073                  G_TYPE_NONE, 4,
00074                  G_TYPE_STRING, G_TYPE_INT, G_TYPE_FLOAT, G_TYPE_DOUBLE);
00075 
00076   _service_signals[SIGNAL_5] =
00077     g_signal_new("signal5",
00078                  G_OBJECT_CLASS_TYPE(obj_class),
00079                  G_SIGNAL_RUN_LAST,
00080                  0,
00081                  NULL, NULL,
00082                  test_signals_VOID__STRING_INT_FLOAT_DOUBLE_BOOLEAN,
00083                  G_TYPE_NONE, 5,
00084                  G_TYPE_STRING, G_TYPE_INT, G_TYPE_FLOAT,
00085                  G_TYPE_DOUBLE, G_TYPE_BOOLEAN);
00086 
00087   _service_signals[SIGNAL_6] =
00088     g_signal_new("signal6",
00089                  G_OBJECT_CLASS_TYPE(obj_class),
00090                  G_SIGNAL_RUN_LAST,
00091                  0,
00092                  NULL, NULL,
00093                  test_signals_BOOLEAN__STRING_INT_FLOAT_DOUBLE_BOOLEAN_CHAR,
00094                  G_TYPE_BOOLEAN, 6,
00095                  G_TYPE_STRING, G_TYPE_INT, G_TYPE_FLOAT,
00096                  G_TYPE_DOUBLE, G_TYPE_BOOLEAN, G_TYPE_CHAR);
00097 }
00098 
00099 static void
00100 test_signals_init(TestSignals* self)
00101 {
00102 }