diff options
author | Alex Larsson <alexl@redhat.com> | 2001-06-30 02:56:50 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2001-06-30 02:56:50 +0000 |
commit | 43696e841d807d9dba7b50314517069634d4cba2 (patch) | |
tree | 3418f45d3bc7bdcc326cdf5b64cb08a34dca7933 /gdk/x11/gdkinput.c | |
parent | ee5ff7ddc23a90018b35102ac87e6ac41928da10 (diff) | |
download | gdk-pixbuf-43696e841d807d9dba7b50314517069634d4cba2.tar.gz |
Convert GdkVisual to a GObject.
2001-06-29 Alex Larsson <alexl@redhat.com>
* gdk/gdkvisual.h:
* gdk/gdkcolor.c:
* gdk/x11/gdkx.h:
* gdk/x11/gdkvisual-x11.c:
Convert GdkVisual to a GObject.
* gdk/gdkinput.h:
* gdk/gdkevents.c:
* gdk/x11/gdkinputprivate.h:
* gdk/x11/gdkinput-gxi.c:
* gdk/x11/gdkinput-none.c:
* gdk/x11/gdkinput-x11.c:
* gdk/x11/gdkinput-xfree.c:
* gdk/x11/gdkinput.c:
Convert GdkDevice to a GObject.
Diffstat (limited to 'gdk/x11/gdkinput.c')
-rw-r--r-- | gdk/x11/gdkinput.c | 71 |
1 files changed, 56 insertions, 15 deletions
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c index b4525987c..2232f584d 100644 --- a/gdk/x11/gdkinput.c +++ b/gdk/x11/gdkinput.c @@ -39,21 +39,7 @@ static GdkDeviceAxis gdk_input_core_axes[] = { { GDK_AXIS_Y, 0, 0 } }; -static const GdkDevice gdk_input_core_info = -{ - "Core Pointer", - GDK_SOURCE_MOUSE, - GDK_MODE_SCREEN, - TRUE, - - 2, - gdk_input_core_axes, - - 0, - NULL -}; - -GdkDevice *gdk_core_pointer = (GdkDevice *)&gdk_input_core_info; +GdkDevice *gdk_core_pointer = NULL; /* Global variables */ @@ -65,6 +51,61 @@ gint gdk_input_ignore_core; GList *gdk_input_devices; GList *gdk_input_windows; +void +_gdk_init_input_core (void) +{ + gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); + + gdk_core_pointer->name = "Core Pointer"; + gdk_core_pointer->source = GDK_SOURCE_MOUSE; + gdk_core_pointer->mode = GDK_MODE_SCREEN; + gdk_core_pointer->has_cursor = TRUE; + gdk_core_pointer->num_axes = 2; + gdk_core_pointer->axes = gdk_input_core_axes; + gdk_core_pointer->num_keys = 0; + gdk_core_pointer->keys = NULL; +} + +static void +gdk_device_finalize (GObject *object) +{ + g_error ("A GdkDevice object was finalized. This should not happen"); +} + +static void +gdk_device_class_init (GObjectClass *class) +{ + class->finalize = gdk_device_finalize; +} + +GType +gdk_device_get_type (void) +{ + static GType object_type = 0; + + if (!object_type) + { + static const GTypeInfo object_info = + { + sizeof (GdkDeviceClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) gdk_device_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GdkDevicePrivate), + 0, /* n_preallocs */ + (GInstanceInitFunc) NULL, + }; + + object_type = g_type_register_static (G_TYPE_OBJECT, + "GdkDevice", + &object_info, 0); + } + + return object_type; +} + GList * gdk_devices_list (void) { |