8674f61b12492abe25b84f4d4b05dfba45b6f041
[pspp-builds.git] / src / ui / gui / psppire-object.c
1 /*
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2004  Free Software Foundation
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18     02110-1301, USA. */
19
20
21 #include <string.h>
22 #include <stdlib.h>
23
24 #include "psppire-object.h"
25
26
27 /* --- prototypes --- */
28 static void psppire_object_class_init   (PsppireObjectClass     *class);
29 static void psppire_object_init (PsppireObject          *accel_group);
30 static void psppire_object_finalize     (GObject                *object);
31
32
33 /* --- variables --- */
34 static GObjectClass     *parent_class = NULL;
35
36
37 /* --- functions --- */
38 /**
39  * psppire_object_get_type:
40  * @returns: the type ID for accelerator groups.
41  */
42 GType
43 psppire_object_get_type (void)
44 {
45   static GType object_type = 0;
46
47   if (!object_type)
48     {
49       static const GTypeInfo object_info = {
50         sizeof (PsppireObjectClass),
51         (GBaseInitFunc) NULL,
52         (GBaseFinalizeFunc) NULL,
53         (GClassInitFunc) psppire_object_class_init,
54         NULL,   /* class_finalize */
55         NULL,   /* class_data */
56         sizeof (PsppireObject),
57         0,      /* n_preallocs */
58         (GInstanceInitFunc) psppire_object_init,
59       };
60
61       object_type = g_type_register_static (G_TYPE_OBJECT, "PsppireObject",
62                                             &object_info, G_TYPE_FLAG_ABSTRACT);
63     }
64
65   return object_type;
66 }
67
68 static guint signal_changed = 0 ;
69
70 static void
71 psppire_object_class_init (PsppireObjectClass *class)
72 {
73   GObjectClass *object_class = G_OBJECT_CLASS (class);
74
75   parent_class = g_type_class_peek_parent (class);
76
77   object_class->finalize = psppire_object_finalize;
78
79    signal_changed =
80      g_signal_new ("changed",
81                    G_OBJECT_CLASS_TYPE (class),
82                    G_SIGNAL_RUN_FIRST,
83                    0,
84                    NULL, NULL,
85                    g_cclosure_marshal_VOID__VOID,
86                    G_TYPE_NONE, 0);
87
88 }
89
90 static void
91 psppire_object_finalize (GObject *object)
92 {
93   G_OBJECT_CLASS (parent_class)->finalize (object);
94 }
95
96 static void
97 psppire_object_init (PsppireObject *psppire_object)
98 {
99
100 }
101
102 /**
103  * psppire_object_new:
104  * @returns: a new #PsppireObject object
105  *
106  * Creates a new #PsppireObject.
107  */
108 PsppireObject*
109 psppire_object_new (void)
110 {
111   return g_object_new (G_TYPE_PSPPIRE_OBJECT, NULL);
112 }