[gtk+] Implement test vfuncs for quartz
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Implement test vfuncs for quartz
- Date: Wed, 22 Dec 2010 16:52:24 +0000 (UTC)
commit a1b300ecb6714e05541d4c0bd97fddbc26b4d08c
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 21 21:24:25 2010 -0500
Implement test vfuncs for quartz
gdk/quartz/Makefile.am | 1 -
gdk/quartz/gdkprivate-quartz.h | 14 ++++++
gdk/quartz/gdktestutils-quartz.c | 84 ++++++--------------------------------
gdk/quartz/gdkwindow-quartz.c | 4 ++
4 files changed, 31 insertions(+), 72 deletions(-)
---
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index 7774dbc..381ddeb 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -42,7 +42,6 @@ libgdk_quartz_la_SOURCES = \
gdkscreen-quartz.c \
gdkscreen-quartz.h \
gdkselection-quartz.c \
- gdkspawn-quartz.c \
gdktestutils-quartz.c \
gdkvisual-quartz.c \
gdkwindow-quartz.c \
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index b32a578..e3ab859 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -242,5 +242,19 @@ GdkAtom _gdk_quartz_display_manager_atom_intern (GdkDisplayManager *manager,
gchar * _gdk_quartz_display_manager_get_atom_name (GdkDisplayManager *manager,
GdkAtom atom);
+void _gdk_quartz_window_sync_rendering (GdkWindow *window);
+gboolean _gdk_quartz_window_simulate_key (GdkWindow *window,
+ gint x,
+ gint y,
+ guint keyval,
+ GdkModifierType modifiers,
+ GdkEventType key_pressrelease);
+gboolean _gdk_quartz_window_simulate_button (GdkWindow *window,
+ gint x,
+ gint y,
+ guint button,
+ GdkModifierType modifiers,
+ GdkEventType button_pressrelease);
+
#endif /* __GDK_PRIVATE_QUARTZ_H__ */
diff --git a/gdk/quartz/gdktestutils-quartz.c b/gdk/quartz/gdktestutils-quartz.c
index f62baa4..731b00b 100644
--- a/gdk/quartz/gdktestutils-quartz.c
+++ b/gdk/quartz/gdktestutils-quartz.c
@@ -22,54 +22,19 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkinternals.h>
-/**
- * gdk_test_render_sync
- * @window: a mapped GdkWindow
- *
- * This function retrives a pixel from @window to force the windowing
- * system to carry out any pending rendering commands.
- * This function is intended to be used to syncronize with rendering
- * pipelines, to benchmark windowing system rendering operations.
- **/
void
-gdk_test_render_sync (GdkWindow *window)
+_gdk_quartz_window_sync_rendering (GdkWindow *window)
{
/* FIXME: Find out if there is a way to implement this on quartz. */
}
-/**
- * gdk_test_simulate_key
- * @window: Gdk window to simulate a key event for.
- * @x: x coordinate within @window for the key event.
- * @y: y coordinate within @window for the key event.
- * @keyval: A Gdk keyboard value.
- * @modifiers: Keyboard modifiers the event is setup with.
- * @key_pressrelease: either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
- *
- * This function is intended to be used in Gtk+ test programs.
- * If (@x,@y) are > (-1,-1), it will warp the mouse pointer to
- * the given (@x,@y) corrdinates within @window and simulate a
- * key press or release event.
- * When the mouse pointer is warped to the target location, use
- * of this function outside of test programs that run in their
- * own virtual windowing system (e.g. Xvfb) is not recommended.
- * If (@x,@y) are passed as (-1,-1), the mouse pointer will not
- * be warped and @window origin will be used as mouse pointer
- * location for the event.
- * Also, gtk_test_simulate_key() is a fairly low level function,
- * for most testing purposes, gtk_test_widget_send_key() is the
- * right function to call which will generate a key press event
- * followed by its accompanying key release event.
- *
- * Returns: wether all actions neccessary for a key event simulation were carried out successfully.
- **/
gboolean
-gdk_test_simulate_key (GdkWindow *window,
- gint x,
- gint y,
- guint keyval,
- GdkModifierType modifiers,
- GdkEventType key_pressrelease)
+_gdk_quartz_window_simulate_key (GdkWindow *window,
+ gint x,
+ gint y,
+ guint keyval,
+ GdkModifierType modifiers,
+ GdkEventType key_pressrelease)
{
g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
g_return_val_if_fail (window != NULL, FALSE);
@@ -82,36 +47,13 @@ gdk_test_simulate_key (GdkWindow *window,
return FALSE;
}
-/**
- * gdk_test_simulate_button
- * @window: Gdk window to simulate a button event for.
- * @x: x coordinate within @window for the button event.
- * @y: y coordinate within @window for the button event.
- * @button: Number of the pointer button for the event, usually 1, 2 or 3.
- * @modifiers: Keyboard modifiers the event is setup with.
- * @button_pressrelease: either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE
- *
- * This function is intended to be used in Gtk+ test programs.
- * It will warp the mouse pointer to the given (@x,@y) corrdinates
- * within @window and simulate a button press or release event.
- * Because the mouse pointer needs to be warped to the target
- * location, use of this function outside of test programs that
- * run in their own virtual windowing system (e.g. Xvfb) is not
- * recommended.
- * Also, gtk_test_simulate_button() is a fairly low level function,
- * for most testing purposes, gtk_test_widget_click() is the right
- * function to call which will generate a button press event followed
- * by its accompanying button release event.
- *
- * Returns: wether all actions neccessary for a button event simulation were carried out successfully.
- **/
gboolean
-gdk_test_simulate_button (GdkWindow *window,
- gint x,
- gint y,
- guint button, /*1..3*/
- GdkModifierType modifiers,
- GdkEventType button_pressrelease)
+_gdk_quartz_window_simulate_button (GdkWindow *window,
+ gint x,
+ gint y,
+ guint button, /*1..3*/
+ GdkModifierType modifiers,
+ GdkEventType button_pressrelease)
{
g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
g_return_val_if_fail (window != NULL, FALSE);
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 9221416..d70740d 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -3050,6 +3050,7 @@ static void
gdk_root_window_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass)
{
GdkWindowImplQuartzClass *window_quartz_class = GDK_WINDOW_IMPL_QUARTZ_CLASS (klass);
+ GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass);
root_window_parent_class = g_type_class_peek_parent (klass);
@@ -3100,6 +3101,9 @@ gdk_root_window_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass)
impl_class->register_dnd = _gdk_quartz_window_register_dnd;
impl_class->drag_begin = _gdk_quartz_window_drag_begin;
impl_class->process_updates_recurse = gdk_x11_window_process_updates_recurse;
+ impl_class->sync_rendering = _gdk_quartz_window_sync_rendering;
+ impl_class->simulate_key = _gdk_quartz_window_simulate_key;
+ impl_class->simulate_button = _gdk_quartz_window_simulate_button;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]