diff options
author | Benjamin Otte <otte@redhat.com> | 2017-01-08 03:34:58 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-01-08 03:46:30 +0100 |
commit | 7ade6e3f4668220f0fa1382944a87e63691ad9ad (patch) | |
tree | d905898183986f9211f0f7ce13287a1a811cfe4b | |
parent | 2a9ae1e8df5d59140e54d3b05419f27fb2ac7d7b (diff) | |
download | gtk+-7ade6e3f4668220f0fa1382944a87e63691ad9ad.tar.gz |
gdk: Remove testing functions
They were unused and unimplemented.
-rw-r--r-- | docs/reference/gdk/gdk4-sections.txt | 8 | ||||
-rw-r--r-- | gdk/Makefile.am | 3 | ||||
-rw-r--r-- | gdk/broadway/Makefile.am | 1 | ||||
-rw-r--r-- | gdk/broadway/gdkprivate-broadway.h | 13 | ||||
-rw-r--r-- | gdk/broadway/gdktestutils-broadway.c | 66 | ||||
-rw-r--r-- | gdk/broadway/gdkwindow-broadway.c | 3 | ||||
-rw-r--r-- | gdk/gdk.h | 1 | ||||
-rw-r--r-- | gdk/gdktestutils.h | 61 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 100 | ||||
-rw-r--r-- | gdk/gdkwindowimpl.h | 14 | ||||
-rw-r--r-- | gdk/mir/gdkmirwindowimpl.c | 34 | ||||
-rw-r--r-- | gdk/quartz/Makefile.am | 1 | ||||
-rw-r--r-- | gdk/quartz/gdkprivate-quartz.h | 15 | ||||
-rw-r--r-- | gdk/quartz/gdktestutils-quartz.c | 65 | ||||
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 3 | ||||
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 30 | ||||
-rw-r--r-- | gdk/win32/Makefile.am | 1 | ||||
-rw-r--r-- | gdk/win32/gdkprivate-win32.h | 12 | ||||
-rw-r--r-- | gdk/win32/gdktestutils-win32.c | 127 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 3 | ||||
-rw-r--r-- | gdk/x11/Makefile.am | 1 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 13 | ||||
-rw-r--r-- | gdk/x11/gdktestutils-x11.c | 184 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 3 |
24 files changed, 0 insertions, 762 deletions
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index e50788113e..0eec4fe112 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -1218,14 +1218,6 @@ gdk_app_launch_context_get_type </SECTION> <SECTION> -<TITLE>Testing</TITLE> -<FILE>gdktestutils</FILE> -gdk_test_render_sync -gdk_test_simulate_button -gdk_test_simulate_key -</SECTION> - -<SECTION> <TITLE>GdkFrameClock</TITLE> <FILE>gdkframeclock</FILE> GdkFrameClock diff --git a/gdk/Makefile.am b/gdk/Makefile.am index f40ffc778e..064fe39fb2 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -87,7 +87,6 @@ gdk_public_h_sources = \ gdkscreen.h \ gdkseat.h \ gdkselection.h \ - gdktestutils.h \ gdkthreads.h \ gdktypes.h \ gdkvisual.h \ @@ -264,7 +263,6 @@ x11_introspection_files = \ x11/gdkscreen-x11.c \ x11/gdkselection-x11.c \ x11/gdksettings.c \ - x11/gdktestutils-x11.c \ x11/gdkvisual-x11.c \ x11/gdkwindow-x11.c \ x11/gdkxftdefaults.c \ @@ -321,7 +319,6 @@ w32_introspection_files = \ win32/gdkproperty-win32.c \ win32/gdkscreen-win32.c \ win32/gdkselection-win32.c \ - win32/gdktestutils-win32.c \ win32/gdkwin32.h \ win32/gdkwin32cursor.h \ win32/gdkwin32display.h \ diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am index 47e6ed3806..05fd5b1e6f 100644 --- a/gdk/broadway/Makefile.am +++ b/gdk/broadway/Makefile.am @@ -71,7 +71,6 @@ libgdk_broadway_la_SOURCES = \ gdkscreen-broadway.c \ gdkscreen-broadway.h \ gdkselection-broadway.c \ - gdktestutils-broadway.c \ gdkwindow-broadway.c \ gdkwindow-broadway.h \ gdkprivate-broadway.h \ diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h index b5710cfe49..4e56071b6f 100644 --- a/gdk/broadway/gdkprivate-broadway.h +++ b/gdk/broadway/gdkprivate-broadway.h @@ -161,19 +161,6 @@ BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display, gboolean remove); /* Window methods - testing */ -void _gdk_broadway_window_sync_rendering (GdkWindow *window); -gboolean _gdk_broadway_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease); -gboolean _gdk_broadway_window_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, - GdkModifierType modifiers, - GdkEventType button_pressrelease); void _gdk_broadway_window_resize_surface (GdkWindow *window); void _gdk_broadway_cursor_update_theme (GdkCursor *cursor); diff --git a/gdk/broadway/gdktestutils-broadway.c b/gdk/broadway/gdktestutils-broadway.c deleted file mode 100644 index a3b1ee2fde..0000000000 --- a/gdk/broadway/gdktestutils-broadway.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Gtk+ testing utilities - * Copyright (C) 2007 Imendio AB - * Authors: Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ -#include "config.h" -#include <gdk/gdktestutils.h> -#include <gdk/gdkkeysyms.h> -#include <gdk/gdkinternals.h> -#include "gdkprivate-broadway.h" - -void -_gdk_broadway_window_sync_rendering (GdkWindow *window) -{ - /* FIXME: Find out if there is a way to implement this on broadway. */ -} - -gboolean -_gdk_broadway_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); - - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - /* FIXME: Implement. */ - - return FALSE; -} - -gboolean -_gdk_broadway_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); - - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - /* FIXME: Implement. */ - - return FALSE; -} diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c index 4701568be0..0967ffe611 100644 --- a/gdk/broadway/gdkwindow-broadway.c +++ b/gdk/broadway/gdkwindow-broadway.c @@ -1534,9 +1534,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass) impl_class->destroy_notify = gdk_broadway_window_destroy_notify; impl_class->register_dnd = _gdk_broadway_window_register_dnd; impl_class->drag_begin = _gdk_broadway_window_drag_begin; - impl_class->sync_rendering = _gdk_broadway_window_sync_rendering; - impl_class->simulate_key = _gdk_broadway_window_simulate_key; - impl_class->simulate_button = _gdk_broadway_window_simulate_button; impl_class->get_property = _gdk_broadway_window_get_property; impl_class->change_property = _gdk_broadway_window_change_property; impl_class->delete_property = _gdk_broadway_window_delete_property; @@ -58,7 +58,6 @@ #include <gdk/gdkscreen.h> #include <gdk/gdkseat.h> #include <gdk/gdkselection.h> -#include <gdk/gdktestutils.h> #include <gdk/gdkthreads.h> #include <gdk/gdktypes.h> #include <gdk/gdkvisual.h> diff --git a/gdk/gdktestutils.h b/gdk/gdktestutils.h deleted file mode 100644 index ebccb56842..0000000000 --- a/gdk/gdktestutils.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Gdk testing utilities - * Copyright (C) 2007 Imendio AB - * Authors: Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef __GDK_TEST_UTILS_H__ -#define __GDK_TEST_UTILS_H__ - -#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) -#error "Only <gdk/gdk.h> can be included directly." -#endif - -#include <gdk/gdkwindow.h> - -G_BEGIN_DECLS - - -/** - * SECTION:gdktestutils - * @Short_description: Test utilities - * @Title: Testing - * - * The functions in this section are intended to be used in test programs. - * They allow to simulate some user input. - */ - - -/* --- Gdk Test Utility API --- */ -GDK_AVAILABLE_IN_ALL -void gdk_test_render_sync (GdkWindow *window); -GDK_AVAILABLE_IN_ALL -gboolean gdk_test_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease); -GDK_AVAILABLE_IN_ALL -gboolean gdk_test_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, /*1..3*/ - GdkModifierType modifiers, - GdkEventType button_pressrelease); - -G_END_DECLS - -#endif /* __GDK_TEST_UTILS_H__ */ diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index b761c490d6..6dffc61175 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -8931,106 +8931,6 @@ gdk_drag_begin_from_point (GdkWindow *window, } /** - * gdk_test_render_sync: - * @window: a mapped #GdkWindow - * - * Retrieves a pixel from @window to force the windowing - * system to carry out any pending rendering commands. - * - * This function is intended to be used to synchronize with rendering - * pipelines, to benchmark windowing system rendering operations. - * - * Since: 2.14 - **/ -void -gdk_test_render_sync (GdkWindow *window) -{ - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->sync_rendering (window); -} - -/** - * gdk_test_simulate_key: - * @window: a #GdkWindow 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) coordinates 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, gdk_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: whether all actions necessary for a key event simulation - * were carried out successfully - * - * Since: 2.14 - */ -gboolean -gdk_test_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease) -{ - return GDK_WINDOW_IMPL_GET_CLASS (window->impl) - ->simulate_key (window, x, y, keyval, modifiers, key_pressrelease); -} - -/** - * gdk_test_simulate_button: - * @window: a #GdkWindow 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) coordinates - * 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, gdk_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: whether all actions necessary for a button event simulation - * were carried out successfully - * - * Since: 2.14 - */ -gboolean -gdk_test_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, /*1..3*/ - GdkModifierType modifiers, - GdkEventType button_pressrelease) -{ - return GDK_WINDOW_IMPL_GET_CLASS (window->impl) - ->simulate_button (window, x, y, button, modifiers, button_pressrelease); -} - -/** * gdk_property_get: * @window: a #GdkWindow * @property: the property to retrieve diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index cdfe36f59e..6d7637951b 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -231,20 +231,6 @@ struct _GdkWindowImplClass void (*process_updates_recurse) (GdkWindow *window, cairo_region_t *region); - void (*sync_rendering) (GdkWindow *window); - gboolean (*simulate_key) (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType event_type); - gboolean (*simulate_button) (GdkWindow *window, - gint x, - gint y, - guint button, - GdkModifierType modifiers, - GdkEventType event_type); - gboolean (*get_property) (GdkWindow *window, GdkAtom property, GdkAtom type, diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index b00e35eba5..1939e7fb6d 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -1400,37 +1400,6 @@ gdk_mir_window_impl_process_updates_recurse (GdkWindow *window, _gdk_window_process_updates_recurse (window, region); } -static void -gdk_mir_window_impl_sync_rendering (GdkWindow *window) -{ - //g_printerr ("gdk_mir_window_impl_sync_rendering window=%p\n", window); - // FIXME: Only used for benchmarking -} - -static gboolean -gdk_mir_window_impl_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease) -{ - //g_printerr ("gdk_mir_window_impl_simulate_key window=%p\n", window); - return FALSE; -} - -static gboolean -gdk_mir_window_impl_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, - GdkModifierType modifiers, - GdkEventType button_pressrelease) -{ - //g_printerr ("gdk_mir_window_impl_simulate_button window=%p\n", window); - return FALSE; -} - static gboolean gdk_mir_window_impl_get_property (GdkWindow *window, GdkAtom property, @@ -2007,9 +1976,6 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass) impl_class->register_dnd = gdk_mir_window_impl_register_dnd; impl_class->drag_begin = gdk_mir_window_impl_drag_begin; impl_class->process_updates_recurse = gdk_mir_window_impl_process_updates_recurse; - impl_class->sync_rendering = gdk_mir_window_impl_sync_rendering; - impl_class->simulate_key = gdk_mir_window_impl_simulate_key; - impl_class->simulate_button = gdk_mir_window_impl_simulate_button; impl_class->get_property = gdk_mir_window_impl_get_property; impl_class->change_property = gdk_mir_window_impl_change_property; impl_class->delete_property = gdk_mir_window_impl_delete_property; diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am index eda5263f72..43b8eeedbc 100644 --- a/gdk/quartz/Makefile.am +++ b/gdk/quartz/Makefile.am @@ -44,7 +44,6 @@ libgdk_quartz_la_SOURCES = \ gdkscreen-quartz.c \ gdkscreen-quartz.h \ gdkselection-quartz.c \ - gdktestutils-quartz.c \ gdkutils-quartz.c \ gdkwindow-quartz.c \ gdkwindow-quartz.h \ diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h index 7fcb2cbeca..576cac9de4 100644 --- a/gdk/quartz/gdkprivate-quartz.h +++ b/gdk/quartz/gdkprivate-quartz.h @@ -194,21 +194,6 @@ void _gdk_quartz_window_debug_highlight (GdkWindow *window, void _gdk_quartz_window_update_position (GdkWindow *window); void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window); -/* Window methods - testing */ -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); - /* Window methods - property */ gboolean _gdk_quartz_window_get_property (GdkWindow *window, GdkAtom property, diff --git a/gdk/quartz/gdktestutils-quartz.c b/gdk/quartz/gdktestutils-quartz.c deleted file mode 100644 index ad236617bd..0000000000 --- a/gdk/quartz/gdktestutils-quartz.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Gtk+ testing utilities - * Copyright (C) 2007 Imendio AB - * Authors: Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ -#include "config.h" -#include <gdk/gdktestutils.h> -#include <gdk/gdkkeysyms.h> -#include <gdk/gdkinternals.h> - -void -_gdk_quartz_window_sync_rendering (GdkWindow *window) -{ - /* FIXME: Find out if there is a way to implement this on quartz. */ -} - -gboolean -_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); - - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - /* FIXME: Implement. */ - - return FALSE; -} - -gboolean -_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); - - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - /* FIXME: Implement. */ - - return FALSE; -} diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index e853a83487..515a779aec 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -2791,9 +2791,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *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_quartz_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; impl_class->get_property = _gdk_quartz_window_get_property; impl_class->change_property = _gdk_quartz_window_change_property; impl_class->delete_property = _gdk_quartz_window_delete_property; diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 823fc3bef2..466f7c3c72 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -3422,33 +3422,6 @@ gdk_wayland_window_destroy_notify (GdkWindow *window) g_object_unref (window); } -static void -gdk_wayland_window_sync_rendering (GdkWindow *window) -{ -} - -static gboolean -gdk_wayland_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease) -{ - return FALSE; -} - -static gboolean -gdk_wayland_window_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, - GdkModifierType modifiers, - GdkEventType button_pressrelease) -{ - return FALSE; -} - static gboolean gdk_wayland_window_get_property (GdkWindow *window, GdkAtom property, @@ -3639,9 +3612,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass) impl_class->get_drag_protocol = _gdk_wayland_window_get_drag_protocol; impl_class->register_dnd = _gdk_wayland_window_register_dnd; impl_class->drag_begin = _gdk_wayland_window_drag_begin; - impl_class->sync_rendering = gdk_wayland_window_sync_rendering; - impl_class->simulate_key = gdk_wayland_window_simulate_key; - impl_class->simulate_button = gdk_wayland_window_simulate_button; impl_class->get_property = gdk_wayland_window_get_property; impl_class->change_property = gdk_wayland_window_change_property; impl_class->delete_property = gdk_wayland_window_delete_property; diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am index 4497429c8a..991dc9e3bc 100644 --- a/gdk/win32/Makefile.am +++ b/gdk/win32/Makefile.am @@ -54,7 +54,6 @@ libgdk_win32_la_SOURCES = \ gdkproperty-win32.c \ gdkscreen-win32.c \ gdkselection-win32.c \ - gdktestutils-win32.c \ gdkvulkancontext-win32.c \ gdkvulkancontext-win32.h \ gdkwin32cursor.h \ diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index f2c5b3be85..ef51184be1 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -481,18 +481,6 @@ void _gdk_win32_display_create_window_impl (GdkDisplay *display, /* stray GdkWindowImplWin32 members */ void _gdk_win32_window_register_dnd (GdkWindow *window); GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root); -gboolean _gdk_win32_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease); -gboolean _gdk_win32_window_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, /*1..3*/ - GdkModifierType modifiers, - GdkEventType button_pressrelease); gint _gdk_win32_window_get_property (GdkWindow *window, GdkAtom property, diff --git a/gdk/win32/gdktestutils-win32.c b/gdk/win32/gdktestutils-win32.c deleted file mode 100644 index 6e4729ded7..0000000000 --- a/gdk/win32/gdktestutils-win32.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Gtk+ testing utilities - * Copyright (C) 2007 Imendio AB - * Authors: Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ -#include "config.h" - -#include <gdk/gdktestutils.h> -#include <gdk/gdkkeysyms.h> -#include <win32/gdkwin32.h> - - -gboolean -_gdk_win32_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease) -{ - gboolean success = FALSE; - GdkKeymapKey *keys = NULL; - gint n_keys = 0; - INPUT ip; - gint i; - - g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE); - g_return_val_if_fail (window != NULL, FALSE); - - ip.type = INPUT_KEYBOARD; - ip.ki.wScan = 0; - ip.ki.time = 0; - ip.ki.dwExtraInfo = 0; - - switch (key_pressrelease) - { - case GDK_KEY_PRESS: - ip.ki.dwFlags = 0; - break; - case GDK_KEY_RELEASE: - ip.ki.dwFlags = KEYEVENTF_KEYUP; - break; - default: - /* Not a key event. */ - return FALSE; - } - if (gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (), keyval, &keys, &n_keys)) - { - for (i = 0; i < n_keys; i++) - { - if (key_pressrelease == GDK_KEY_PRESS) - { - /* AltGr press. */ - if (keys[i].group) - { - /* According to some virtualbox code I found, AltGr is - * simulated on win32 with LCtrl+RAlt */ - ip.ki.wVk = VK_CONTROL; - SendInput(1, &ip, sizeof(INPUT)); - ip.ki.wVk = VK_MENU; - SendInput(1, &ip, sizeof(INPUT)); - } - /* Shift press. */ - if (keys[i].level || (modifiers & GDK_SHIFT_MASK)) - { - ip.ki.wVk = VK_SHIFT; - SendInput(1, &ip, sizeof(INPUT)); - } - } - - /* Key pressed/released. */ - ip.ki.wVk = keys[i].keycode; - SendInput(1, &ip, sizeof(INPUT)); - - if (key_pressrelease == GDK_KEY_RELEASE) - { - /* Shift release. */ - if (keys[i].level || (modifiers & GDK_SHIFT_MASK)) - { - ip.ki.wVk = VK_SHIFT; - SendInput(1, &ip, sizeof(INPUT)); - } - /* AltrGr release. */ - if (keys[i].group) - { - ip.ki.wVk = VK_MENU; - SendInput(1, &ip, sizeof(INPUT)); - ip.ki.wVk = VK_CONTROL; - SendInput(1, &ip, sizeof(INPUT)); - } - } - - /* No need to loop for alternative keycodes. We want only one - * key generated. */ - success = TRUE; - break; - } - g_free (keys); - } - return success; -} - -gboolean -_gdk_win32_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); - - return FALSE; -} diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 7466f58cd1..a545611d74 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -5939,9 +5939,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass) impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol; impl_class->register_dnd = _gdk_win32_window_register_dnd; impl_class->drag_begin = _gdk_win32_window_drag_begin; - //? impl_class->sync_rendering = _gdk_win32_window_sync_rendering; - impl_class->simulate_key = _gdk_win32_window_simulate_key; - impl_class->simulate_button = _gdk_win32_window_simulate_button; impl_class->get_property = _gdk_win32_window_get_property; impl_class->change_property = _gdk_win32_window_change_property; impl_class->delete_property = _gdk_win32_window_delete_property; diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am index d1f6df8137..f318ef3cf9 100644 --- a/gdk/x11/Makefile.am +++ b/gdk/x11/Makefile.am @@ -50,7 +50,6 @@ libgdk_x11_la_SOURCES = \ gdkscreen-x11.c \ gdkscreen-x11.h \ gdkselection-x11.c \ - gdktestutils-x11.c \ gdkvisual-x11.c \ gdkvulkancontext-x11.c \ gdkvulkancontext-x11.h \ diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index ce6a9e69ff..30a388f0b2 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -74,19 +74,6 @@ void _gdk_x11_window_process_expose (GdkWindow *window, gulong serial, GdkRectangle *area); -void _gdk_x11_window_sync_rendering (GdkWindow *window); -gboolean _gdk_x11_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease); -gboolean _gdk_x11_window_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, - GdkModifierType modifiers, - GdkEventType button_pressrelease); gboolean _gdk_x11_window_get_property (GdkWindow *window, GdkAtom property, GdkAtom type, diff --git a/gdk/x11/gdktestutils-x11.c b/gdk/x11/gdktestutils-x11.c deleted file mode 100644 index 9ef443947f..0000000000 --- a/gdk/x11/gdktestutils-x11.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Gtk+ testing utilities - * Copyright (C) 2007 Imendio AB - * Authors: Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "config.h" - -#include "gdktestutils.h" - -#include "gdkkeysyms.h" -#include "gdkprivate-x11.h" - -#include <X11/Xlib.h> - -void -_gdk_x11_window_sync_rendering (GdkWindow *window) -{ - Display *display = GDK_WINDOW_XDISPLAY (window); - XImage *ximage; - - /* syncronize to X drawing queue, see: - * http://mail.gnome.org/archives/gtk-devel-list/2006-October/msg00103.html - */ - ximage = XGetImage (display, DefaultRootWindow (display), - 0, 0, 1, 1, AllPlanes, ZPixmap); - if (ximage != NULL) - XDestroyImage (ximage); -} - -gboolean -_gdk_x11_window_simulate_key (GdkWindow *window, - gint x, - gint y, - guint keyval, - GdkModifierType modifiers, - GdkEventType key_pressrelease) -{ - GdkScreen *screen; - GdkKeymapKey *keys = NULL; - gboolean success; - gint n_keys = 0; - XKeyEvent xev = { - 0, /* type */ - 0, /* serial */ - 1, /* send_event */ - }; - g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE); - g_return_val_if_fail (window != NULL, FALSE); - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - screen = gdk_window_get_screen (window); - - if (x < 0 && y < 0) - { - x = window->width / 2; - y = window->height / 2; - } - - /* Convert to impl coordinates */ - x = x + window->abs_x; - y = y + window->abs_y; - - xev.type = key_pressrelease == GDK_KEY_PRESS ? KeyPress : KeyRelease; - xev.display = GDK_WINDOW_XDISPLAY (window); - xev.window = GDK_WINDOW_XID (window); - xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num); - xev.subwindow = 0; - xev.time = 0; - xev.x = MAX (x, 0); - xev.y = MAX (y, 0); - xev.x_root = 0; - xev.y_root = 0; - xev.state = modifiers; - xev.keycode = 0; - success = gdk_keymap_get_entries_for_keyval (gdk_keymap_get_for_display (gdk_window_get_display (window)), keyval, &keys, &n_keys); - success &= n_keys > 0; - if (success) - { - gint i; - for (i = 0; i < n_keys; i++) - if (keys[i].group == 0 && (keys[i].level == 0 || keys[i].level == 1)) - { - xev.keycode = keys[i].keycode; - if (keys[i].level == 1) - { - /* Assume shift takes us to level 1 */ - xev.state |= GDK_SHIFT_MASK; - } - break; - } - if (i >= n_keys) /* no match for group==0 and level==0 or 1 */ - xev.keycode = keys[0].keycode; - } - g_free (keys); - if (!success) - return FALSE; - gdk_x11_display_error_trap_push (GDK_WINDOW_DISPLAY (window)); - xev.same_screen = XTranslateCoordinates (xev.display, xev.window, xev.root, - xev.x, xev.y, &xev.x_root, &xev.y_root, - &xev.subwindow); - if (!xev.subwindow) - xev.subwindow = xev.window; - success &= xev.same_screen; - if (x >= 0 && y >= 0) - success &= 0 != XWarpPointer (xev.display, None, xev.window, 0, 0, 0, 0, xev.x, xev.y); - success &= 0 != XSendEvent (xev.display, xev.window, True, key_pressrelease == GDK_KEY_PRESS ? KeyPressMask : KeyReleaseMask, (XEvent*) &xev); - XSync (xev.display, False); - success &= 0 == gdk_x11_display_error_trap_pop (GDK_WINDOW_DISPLAY (window)); - return success; -} - -gboolean -_gdk_x11_window_simulate_button (GdkWindow *window, - gint x, - gint y, - guint button, /*1..3*/ - GdkModifierType modifiers, - GdkEventType button_pressrelease) -{ - GdkScreen *screen; - XButtonEvent xev = { - 0, /* type */ - 0, /* serial */ - 1, /* send_event */ - }; - gboolean success; - - g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE); - g_return_val_if_fail (window != NULL, FALSE); - - if (!GDK_WINDOW_IS_MAPPED (window)) - return FALSE; - - screen = gdk_window_get_screen (window); - - if (x < 0 && y < 0) - { - x = window->width / 2; - y = window->height / 2; - } - - /* Convert to impl coordinates */ - x = x + window->abs_x; - y = y + window->abs_y; - - xev.type = button_pressrelease == GDK_BUTTON_PRESS ? ButtonPress : ButtonRelease; - xev.display = GDK_WINDOW_XDISPLAY (window); - xev.window = GDK_WINDOW_XID (window); - xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num); - xev.subwindow = 0; - xev.time = 0; - xev.x = x; - xev.y = y; - xev.x_root = 0; - xev.y_root = 0; - xev.state = modifiers; - xev.button = button; - gdk_x11_display_error_trap_push (GDK_WINDOW_DISPLAY (window)); - xev.same_screen = XTranslateCoordinates (xev.display, xev.window, xev.root, - xev.x, xev.y, &xev.x_root, &xev.y_root, - &xev.subwindow); - if (!xev.subwindow) - xev.subwindow = xev.window; - success = xev.same_screen; - success &= 0 != XWarpPointer (xev.display, None, xev.window, 0, 0, 0, 0, xev.x, xev.y); - success &= 0 != XSendEvent (xev.display, xev.window, True, button_pressrelease == GDK_BUTTON_PRESS ? ButtonPressMask : ButtonReleaseMask, (XEvent*) &xev); - XSync (xev.display, False); - success &= 0 == gdk_x11_display_error_trap_pop(GDK_WINDOW_DISPLAY (window)); - return success; -} diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index e00c0186c8..661b5cc86e 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -5105,9 +5105,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol; impl_class->register_dnd = _gdk_x11_window_register_dnd; impl_class->drag_begin = _gdk_x11_window_drag_begin; - impl_class->sync_rendering = _gdk_x11_window_sync_rendering; - impl_class->simulate_key = _gdk_x11_window_simulate_key; - impl_class->simulate_button = _gdk_x11_window_simulate_button; impl_class->get_property = _gdk_x11_window_get_property; impl_class->change_property = _gdk_x11_window_change_property; impl_class->delete_property = _gdk_x11_window_delete_property; |