diff --git a/ChangeLog b/ChangeLog index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0ce0065f0f..b09be1b2ec 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2001-06-29 James Henstridge + + The following changes correspond to bug #56812 + + * gdk/gdkinput.h, gdk/gdkevents.c (GDK_TYPE_DEVICE): register type + code for GdkDevice. + + * gdk/gdkcursor.[ch] (GDK_TYPE_CURSOR): register type code for + GdkCursor. + 2001-06-19 Havoc Pennington * gdk/x11/gdkwindow-x11.c (gdk_window_show_unraised): new function diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index e743f28f71..ca1ff045aa 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -27,6 +27,20 @@ #include "gdkcursor.h" #include "gdkinternals.h" +GType +gdk_cursor_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GdkCursor", + NULL, + (GBoxedCopyFunc)gdk_cursor_ref, + (GBoxedFreeFunc)gdk_cursor_unref, + TRUE); + return our_type; +} + /** * gdk_cursor_ref: * @cursor: a #GdkCursor diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h index 56929f2e67..3c676f7772 100644 --- a/gdk/gdkcursor.h +++ b/gdk/gdkcursor.h @@ -7,6 +7,8 @@ extern "C" { #endif /* __cplusplus */ +#define GDK_TYPE_CURSOR (gdk_cursor_get_type ()) + /* Cursor types. */ typedef enum @@ -24,6 +26,9 @@ struct _GdkCursor /* Cursors */ + +GType gdk_cursor_get_type (void); + GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 2f86c5aa15..57f3da04e4 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -897,3 +897,32 @@ gdk_event_get_type (void) FALSE); return our_type; } + +/* These functions are defined here to avoid a new C file, as GdkDevice is + * platform specific. (similar to how gdk_visual_get_type() is in gdkcolor.c) + */ +GdkDevice * +gdk_device_ref (GdkDevice *device) +{ + return device; +} + +void +gdk_device_unref (GdkDevice *device) +{ + return; +} + +GType +gdk_device_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("GdkDevice", + NULL, + (GBoxedCopyFunc)gdk_device_ref, + (GBoxedFreeFunc)gdk_device_unref, + TRUE); + return our_type; +} diff --git a/gdk/gdkinput.h b/gdk/gdkinput.h index d2fa666e54..d2a17f2eba 100644 --- a/gdk/gdkinput.h +++ b/gdk/gdkinput.h @@ -7,6 +7,8 @@ extern "C" { #endif /* __cplusplus */ +#define GDK_TYPE_DEVICE (gdk_device_get_type ()) + typedef struct _GdkDeviceKey GdkDeviceKey; typedef struct _GdkDeviceAxis GdkDeviceAxis; typedef struct _GdkDevice GdkDevice; @@ -86,6 +88,13 @@ struct _GdkTimeCoord gdouble axes[GDK_MAX_TIMECOORD_AXES]; }; +GType gdk_device_get_type (void); +/* these two are no ops provided for the boxed type code */ +/* XXXX do they need to be exposed as public APIs at all? */ +GdkDevice *gdk_device_ref (GdkDevice *device); +void gdk_device_unref (GdkDevice *device); + + /* Returns a list of GdkDevice * */ GList * gdk_devices_list (void);