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