mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Convert GdkDevice to a GObject.
2001-06-30 Alex Larsson <alexl@redhat.com> * gdk/linux-fb/gdkinput-none.c: * gdk/linux-fb/gdkinput.c: * gdk/linux-fb/gdkinputprivate.h: Convert GdkDevice to a GObject. * linux-fb/gdkprivate-fb.h: * linux-fb/gdkvisual-fb.c: Convert GdkVisual to a GObject.
This commit is contained in:
parent
43696e841d
commit
ba02311234
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
2001-06-30 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* gdk/linux-fb/gdkinput-none.c:
|
||||||
|
* gdk/linux-fb/gdkinput.c:
|
||||||
|
* gdk/linux-fb/gdkinputprivate.h:
|
||||||
|
Convert GdkDevice to a GObject.
|
||||||
|
|
||||||
|
* linux-fb/gdkprivate-fb.h:
|
||||||
|
* linux-fb/gdkvisual-fb.c:
|
||||||
|
Convert GdkVisual to a GObject.
|
||||||
|
|
||||||
2001-06-29 Alex Larsson <alexl@redhat.com>
|
2001-06-29 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
* gdk/gdkvisual.h:
|
* gdk/gdkvisual.h:
|
||||||
|
@ -38,6 +38,7 @@ static void gdk_input_none_get_pointer (GdkWindow *window,
|
|||||||
void
|
void
|
||||||
gdk_input_init (void)
|
gdk_input_init (void)
|
||||||
{
|
{
|
||||||
|
_gdk_init_input_core ();
|
||||||
gdk_input_vtable.set_mode = NULL;
|
gdk_input_vtable.set_mode = NULL;
|
||||||
gdk_input_vtable.set_axes = NULL;
|
gdk_input_vtable.set_axes = NULL;
|
||||||
gdk_input_vtable.set_key = NULL;
|
gdk_input_vtable.set_key = NULL;
|
||||||
|
@ -37,19 +37,7 @@ static const GdkDeviceAxis gdk_input_core_axes[] = {
|
|||||||
{ GDK_AXIS_Y, 0, 0 }
|
{ GDK_AXIS_Y, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static GdkDevice gdk_input_core_info =
|
GdkDevice *gdk_core_pointer = NULL;
|
||||||
{
|
|
||||||
"Core Pointer",
|
|
||||||
GDK_SOURCE_MOUSE,
|
|
||||||
GDK_MODE_SCREEN,
|
|
||||||
TRUE,
|
|
||||||
2,
|
|
||||||
(GdkDeviceAxis *)gdk_input_core_axes,
|
|
||||||
0,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
GdkDevice *gdk_core_pointer = (GdkDevice *)&gdk_input_core_info;
|
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
|
||||||
@ -59,6 +47,61 @@ gint gdk_input_ignore_core;
|
|||||||
GList *gdk_input_windows;
|
GList *gdk_input_windows;
|
||||||
GList *gdk_input_devices;
|
GList *gdk_input_devices;
|
||||||
|
|
||||||
|
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 *
|
GList *
|
||||||
gdk_devices_list (void)
|
gdk_devices_list (void)
|
||||||
{
|
{
|
||||||
|
@ -98,6 +98,11 @@ struct _GdkDevicePrivate {
|
|||||||
GdkDevice info;
|
GdkDevice info;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _GdkDeviceClass
|
||||||
|
{
|
||||||
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
struct _GdkInputWindow
|
struct _GdkInputWindow
|
||||||
{
|
{
|
||||||
/* gdk window */
|
/* gdk window */
|
||||||
@ -141,6 +146,7 @@ gint gdk_input_enable_window (GdkWindow *window,
|
|||||||
GdkDevicePrivate *gdkdev);
|
GdkDevicePrivate *gdkdev);
|
||||||
gint gdk_input_disable_window (GdkWindow *window,
|
gint gdk_input_disable_window (GdkWindow *window,
|
||||||
GdkDevicePrivate *gdkdev);
|
GdkDevicePrivate *gdkdev);
|
||||||
|
void _gdk_init_input_core (void);
|
||||||
|
|
||||||
GdkDevicePrivate *gdk_input_find_device (guint32 id);
|
GdkDevicePrivate *gdk_input_find_device (guint32 id);
|
||||||
GdkInputWindow *gdk_input_window_find (GdkWindow *window);
|
GdkInputWindow *gdk_input_window_find (GdkWindow *window);
|
||||||
|
@ -155,9 +155,11 @@ struct _GdkFBDisplay
|
|||||||
int manager_blocked;
|
int manager_blocked;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
struct _GdkVisualClass
|
||||||
GdkVisual base;
|
{
|
||||||
} GdkVisualPrivateFB;
|
GObjectClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GHashTable *hash;
|
GHashTable *hash;
|
||||||
|
@ -31,10 +31,51 @@
|
|||||||
|
|
||||||
static GdkVisual *system_visual = NULL;
|
static GdkVisual *system_visual = NULL;
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_visual_finalize (GObject *object)
|
||||||
|
{
|
||||||
|
g_error ("A GdkVisual object was finalized. This should not happen");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_visual_class_init (GObjectClass *class)
|
||||||
|
{
|
||||||
|
class->finalize = gdk_visual_finalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
GType
|
||||||
|
gdk_visual_get_type (void)
|
||||||
|
{
|
||||||
|
static GType object_type = 0;
|
||||||
|
|
||||||
|
if (!object_type)
|
||||||
|
{
|
||||||
|
static const GTypeInfo object_info =
|
||||||
|
{
|
||||||
|
sizeof (GdkVisualClass),
|
||||||
|
(GBaseInitFunc) NULL,
|
||||||
|
(GBaseFinalizeFunc) NULL,
|
||||||
|
(GClassInitFunc) gdk_visual_class_init,
|
||||||
|
NULL, /* class_finalize */
|
||||||
|
NULL, /* class_data */
|
||||||
|
sizeof (GdkVisual),
|
||||||
|
0, /* n_preallocs */
|
||||||
|
(GInstanceInitFunc) NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||||
|
"GdkVisual",
|
||||||
|
&object_info, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return object_type;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_visual_init (void)
|
gdk_visual_init (void)
|
||||||
{
|
{
|
||||||
system_visual = g_new0 (GdkVisual, 1);
|
system_visual = g_object_new (GDK_TYPE_VISUAL, NULL);
|
||||||
|
|
||||||
system_visual->depth = system_visual->bits_per_rgb = gdk_display->modeinfo.bits_per_pixel;
|
system_visual->depth = system_visual->bits_per_rgb = gdk_display->modeinfo.bits_per_pixel;
|
||||||
system_visual->byte_order = GDK_LSB_FIRST;
|
system_visual->byte_order = GDK_LSB_FIRST;
|
||||||
@ -101,17 +142,6 @@ gdk_visual_init (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkVisual*
|
|
||||||
gdk_visual_ref (GdkVisual *visual)
|
|
||||||
{
|
|
||||||
return visual;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gdk_visual_unref (GdkVisual *visual)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
gint
|
||||||
gdk_visual_get_best_depth (void)
|
gdk_visual_get_best_depth (void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user