diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-07-05 13:41:34 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-07-05 13:41:34 +0000 |
commit | 191e83b32a2d0c91a530c22f6c22af60fa08a4c1 (patch) | |
tree | d867318e242e21f8d9d4d186a4d8249f7d45910e | |
parent | bf7258ea8adf3f58bfe7d5ac95893a4718f986b3 (diff) | |
download | gdk-pixbuf-191e83b32a2d0c91a530c22f6c22af60fa08a4c1.tar.gz |
Add gdk_set_pointer_hooks() to allow pointer-querying to be hooked by an
Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c
gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk:
Add gdk_set_pointer_hooks() to allow pointer-querying to
be hooked by an event record/playback system like GERD.
(#56914)
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 8 | ||||
-rw-r--r-- | gdk/gdkinternals.h | 7 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 53 | ||||
-rw-r--r-- | gdk/gdkwindow.h | 13 | ||||
-rw-r--r-- | gdk/linux-fb/gdkwindow-fb.c | 12 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 14 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 12 |
13 files changed, 148 insertions, 19 deletions
@@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c91442e8e..7598feba5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Jul 2 01:09:37 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch] gdk/gdkinternals.h gdk/x11/gdkwindow-x11.c + gdk/linux-fb/gdkwindow-fb.c gdk/x11/gdkwindow-x11.c gdk/gdk: + Add gdk_set_pointer_hooks() to allow pointer-querying to + be hooked by an event record/playback system like GERD. + (#56914) + Thu Jul 5 08:57:07 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c (gtk_widget_reset_rc_style): Pass diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index fbcf34658..e90758e06 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -159,6 +159,13 @@ void _gdk_windowing_window_clear_area_e (GdkWindow *window, gint width, gint height); +GdkWindow* _gdk_windowing_window_at_pointer (gint *win_x, + gint *win_y); +GdkWindow* _gdk_windowing_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); + #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0) /* Called before processing updates for a window. This gives the windowing diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 81c919bab..59183b204 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -42,6 +42,14 @@ struct _GdkWindowPaint gint x_offset; gint y_offset; }; + +static const GdkPointerHooks default_pointer_hooks = { + _gdk_windowing_window_get_pointer, + _gdk_windowing_window_at_pointer +}; + +const GdkPointerHooks *current_pointer_hooks = &default_pointer_hooks; + static GdkGC *gdk_window_create_gc (GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask mask); @@ -2279,3 +2287,48 @@ gdk_window_constrain_size (GdkGeometry *geometry, *new_width = width; *new_height = height; } + +/** + * gdk_set_pointer_hooks: + * @new_hooks: a table of pointer to functions for getting + * quantities related to the current pointer position, + * or %NULL to restore the default table. + * + * This function allows for hooking into the operation + * of getting the current location of the pointer. This + * is only useful for such low-level tools as an + * event recorder. Applications should never have any + * reason to use this facility + * + * Return value: the previous pointer hook table + **/ +GdkPointerHooks * +gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks) +{ + const GdkPointerHooks *result = current_pointer_hooks; + + if (new_hooks) + current_pointer_hooks = new_hooks; + else + current_pointer_hooks = &default_pointer_hooks; + + return (GdkPointerHooks *)result; +} + +GdkWindow* +gdk_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) +{ + g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); + + return current_pointer_hooks->get_pointer (window, x, y, mask); +} + +GdkWindow* +gdk_window_at_pointer (gint *win_x, + gint *win_y) +{ + return current_pointer_hooks->window_at_pointer (win_x, win_y); +} diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index d13c5acb0..6ea64594a 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -12,6 +12,7 @@ extern "C" { typedef struct _GdkGeometry GdkGeometry; typedef struct _GdkWindowAttr GdkWindowAttr; +typedef struct _GdkPointerHooks GdkPointerHooks; /* Classes of windows. * InputOutput: Almost every window should be of this type. Such windows @@ -195,6 +196,16 @@ struct _GdkGeometry GdkGravity win_gravity; }; +struct _GdkPointerHooks +{ + GdkWindow* (*get_pointer) (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); + GdkWindow* (*window_at_pointer) (gint *win_x, + gint *win_y); +}; + typedef struct _GdkWindowObject GdkWindowObject; typedef struct _GdkWindowObjectClass GdkWindowObjectClass; @@ -496,6 +507,8 @@ void gdk_window_constrain_size (GdkGeometry *geometry, gint *new_width, gint *new_height); +GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/gdk/linux-fb/gdkwindow-fb.c b/gdk/linux-fb/gdkwindow-fb.c index e5d415475..62054129b 100644 --- a/gdk/linux-fb/gdkwindow-fb.c +++ b/gdk/linux-fb/gdkwindow-fb.c @@ -1602,10 +1602,10 @@ gdk_window_fb_get_visible_region (GdkDrawable *drawable) } GdkWindow * -gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindow *return_val; int winx = 0; @@ -1686,8 +1686,8 @@ gdk_window_get_pointer (GdkWindow *window, } GdkWindow* -gdk_window_at_pointer (gint *win_x, - gint *win_y) +_gdk_windowing_window_at_pointer (gint *win_x, + gint *win_y) { gint rx, ry; GdkWindow *retval = gdk_window_get_pointer (NULL, win_x, win_y, NULL); diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 449418cd5..c6205b835 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -1739,10 +1739,10 @@ gdk_window_get_frame_extents (GdkWindow *window, } GdkWindow* -gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindow *return_val; POINT pointc, point; @@ -1801,8 +1801,8 @@ gdk_window_get_pointer (GdkWindow *window, } GdkWindow* -gdk_window_at_pointer (gint *win_x, - gint *win_y) +_gdk_windowing_window_at_pointer (gint *win_x, + gint *win_y) { GdkWindow *window; POINT point, pointc; @@ -2505,4 +2505,4 @@ gdk_window_begin_move_drag (GdkWindow *window, return; /* XXX: isn't all this default on win32 ... */ -}
\ No newline at end of file +} diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 9f8aebaa9..450644e9a 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -1976,10 +1976,10 @@ gdk_window_get_frame_extents (GdkWindow *window, } GdkWindow* -gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_window_get_pointer (GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindow *return_val; Window root; @@ -2018,8 +2018,8 @@ gdk_window_get_pointer (GdkWindow *window, } GdkWindow* -gdk_window_at_pointer (gint *win_x, - gint *win_y) +_gdk_windowing_window_at_pointer (gint *win_x, + gint *win_y) { GdkWindow *window; Window root; |