[gtk+/xi2] Remove unused code.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2] Remove unused code.
- Date: Mon, 19 Oct 2009 14:30:25 +0000 (UTC)
commit d241ae75d87c0b9d52974e810ee44f90718f62ca
Author: Carlos Garnacho <carlos gnome org>
Date: Sun Oct 11 03:27:30 2009 +0200
Remove unused code.
All this code was #if 0'ed out and has been obsoleted by the GdkDeviceManager
changes.
gdk/gdkwindow.c | 35 -------
gdk/x11/gdkdisplay-x11.c | 8 --
gdk/x11/gdkinput.c | 244 ----------------------------------------------
3 files changed, 0 insertions(+), 287 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8205b1f..17d35a4 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2023,11 +2023,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
-#if 0
- if (private->extension_events)
- impl_iface->input_window_destroy (window);
-#endif
-
if (gdk_window_has_impl (private))
impl_iface->destroy (window, recursing_native,
foreign_destroy);
@@ -9620,15 +9615,6 @@ send_crossing_event (GdkDisplay *display,
if (block_event)
return;
-#if 0
- if (window->extension_events != 0)
- {
- impl_iface = GDK_WINDOW_IMPL_GET_IFACE (window->impl);
- impl_iface->input_window_crossing ((GdkWindow *) window,
- type == GDK_ENTER_NOTIFY);
- }
-#endif
-
if (window_event_mask & type_event_mask)
{
event = _gdk_make_event ((GdkWindow *)window, type, event_in_queue, TRUE);
@@ -10632,22 +10618,6 @@ gdk_window_print_tree (GdkWindow *window,
#endif /* DEBUG_WINDOW_PRINTING */
-static gboolean
-is_input_event (GdkDisplay *display,
- GdkEvent *event)
-{
- GdkDevice *core_pointer;
-
- core_pointer = gdk_display_get_core_pointer (display);
- if ((event->type == GDK_MOTION_NOTIFY &&
- event->motion.device != core_pointer) ||
- ((event->type == GDK_BUTTON_PRESS ||
- event->type == GDK_BUTTON_RELEASE) &&
- event->button.device != core_pointer))
- return TRUE;
- return FALSE;
-}
-
void
_gdk_windowing_got_event (GdkDisplay *display,
GList *event_link,
@@ -10749,11 +10719,6 @@ _gdk_windowing_got_event (GdkDisplay *display,
return;
}
-#if 0
- if (is_input_event (display, event))
- return;
-#endif
-
if (!(is_button_type (event->type) ||
is_motion_type (event->type)) ||
event_private->window_type == GDK_WINDOW_ROOT)
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index a34de56..decdd89 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -679,14 +679,6 @@ gdk_display_x11_translate_event (GdkEventTranslator *translator,
_gdk_x11_screen_size_changed (screen, xevent);
}
-#if 0
- if (window &&
- xevent->xconfigure.event == xevent->xconfigure.window &&
- !GDK_WINDOW_DESTROYED (window) &&
- window_private->input_window != NULL)
- _gdk_input_configure_event (&xevent->xconfigure, window);
-#endif
-
#ifdef HAVE_XSYNC
if (toplevel && display_x11->use_sync && !XSyncValueIsZero (toplevel->pending_counter_value))
{
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index f6cc890..49db778 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -37,107 +37,6 @@
#include "gdkwindow.h"
#include "gdkalias.h"
-#if 0
-
-static GdkDeviceAxis gdk_input_core_axes[] = {
- { GDK_AXIS_X, 0, 0 },
- { GDK_AXIS_Y, 0, 0 }
-};
-
-void
-_gdk_init_input_core (GdkDisplay *display)
-{
- GdkDevicePrivate *private;
-
- display->core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL);
- private = (GdkDevicePrivate *)display->core_pointer;
-
- display->core_pointer->name = "Core Pointer";
- display->core_pointer->source = GDK_SOURCE_MOUSE;
- display->core_pointer->mode = GDK_MODE_SCREEN;
- display->core_pointer->has_cursor = TRUE;
- display->core_pointer->num_axes = 2;
- display->core_pointer->axes = gdk_input_core_axes;
- display->core_pointer->num_keys = 0;
- display->core_pointer->keys = NULL;
-
- private->display = display;
-}
-
-static void gdk_device_class_init (GdkDeviceClass *klass);
-static void gdk_device_dispose (GObject *object);
-
-static gpointer gdk_device_parent_class = NULL;
-
-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,
- g_intern_static_string ("GdkDevice"),
- &object_info, 0);
- }
-
- return object_type;
-}
-
-static void
-gdk_device_class_init (GdkDeviceClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- gdk_device_parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = gdk_device_dispose;
-}
-
-static void
-gdk_device_dispose (GObject *object)
-{
- GdkDevicePrivate *gdkdev = (GdkDevicePrivate *) object;
-
- if (gdkdev->display && !GDK_IS_CORE (gdkdev))
- {
-#ifndef XINPUT_NONE
- if (gdkdev->xdevice)
- {
- XCloseDevice (GDK_DISPLAY_XDISPLAY (gdkdev->display), gdkdev->xdevice);
- gdkdev->xdevice = NULL;
- }
- g_free (gdkdev->axes);
- gdkdev->axes = NULL;
-#endif /* !XINPUT_NONE */
-
- g_free (gdkdev->info.name);
- g_free (gdkdev->info.keys);
- g_free (gdkdev->info.axes);
-
- gdkdev->info.name = NULL;
- gdkdev->info.keys = NULL;
- gdkdev->info.axes = NULL;
- }
-
- G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object);
-}
-
-#endif
-
/**
* gdk_devices_list:
*
@@ -154,76 +53,6 @@ gdk_devices_list (void)
#if 0
-/**
- * gdk_display_list_devices:
- * @display: a #GdkDisplay
- *
- * Returns the list of available input devices attached to @display.
- * The list is statically allocated and should not be freed.
- *
- * Return value: a list of #GdkDevice
- *
- * Since: 2.2
- **/
-GList *
-gdk_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return GDK_DISPLAY_X11 (display)->input_devices;
-}
-
-void
-gdk_device_set_source (GdkDevice *device,
- GdkInputSource source)
-{
- g_return_if_fail (device != NULL);
-
- device->source = source;
-}
-
-void
-gdk_device_set_key (GdkDevice *device,
- guint index,
- guint keyval,
- GdkModifierType modifiers)
-{
- g_return_if_fail (device != NULL);
- g_return_if_fail (index < device->num_keys);
-
- device->keys[index].keyval = keyval;
- device->keys[index].modifiers = modifiers;
-}
-
-void
-gdk_device_set_axis_use (GdkDevice *device,
- guint index,
- GdkAxisUse use)
-{
- g_return_if_fail (device != NULL);
- g_return_if_fail (index < device->num_axes);
-
- device->axes[index].use = use;
-
- switch (use)
- {
- case GDK_AXIS_X:
- case GDK_AXIS_Y:
- device->axes[index].min = 0.;
- device->axes[index].max = 0.;
- break;
- case GDK_AXIS_XTILT:
- case GDK_AXIS_YTILT:
- device->axes[index].min = -1.;
- device->axes[index].max = 1;
- break;
- default:
- device->axes[index].min = 0.;
- device->axes[index].max = 1;
- break;
- }
-}
-
static gboolean
impl_coord_in_window (GdkWindow *window,
int impl_x,
@@ -340,32 +169,6 @@ gdk_device_get_history (GdkDevice *device,
return result;
}
-GdkTimeCoord **
-_gdk_device_allocate_history (GdkDevice *device,
- gint n_events)
-{
- GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events);
- gint i;
-
- for (i=0; i<n_events; i++)
- result[i] = g_malloc (sizeof (GdkTimeCoord) -
- sizeof (double) * (GDK_MAX_TIMECOORD_AXES - device->num_axes));
-
- return result;
-}
-
-void
-gdk_device_free_history (GdkTimeCoord **events,
- gint n_events)
-{
- gint i;
-
- for (i=0; i<n_events; i++)
- g_free (events[i]);
-
- g_free (events);
-}
-
#endif
static void
@@ -481,14 +284,6 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
iw->grabbed = FALSE;
display_x11->input_windows = g_list_append (display_x11->input_windows, iw);
-
-#if 0
-#ifndef XINPUT_NONE
- /* we might not receive ConfigureNotify so get the root_relative_geometry
- * now, just in case */
- _gdk_input_get_root_relative_geometry (window, &iw->root_x, &iw->root_y);
-#endif /* !XINPUT_NONE */
-#endif
impl_window->input_window = iw;
}
@@ -530,44 +325,5 @@ _gdk_input_check_extension_events (GdkDevice *device)
}
}
-#if 0
-/**
- * gdk_device_get_axis:
- * @device: a #GdkDevice
- * @axes: pointer to an array of axes
- * @use: the use to look for
- * @value: location to store the found value.
- *
- * Interprets an array of double as axis values for a given device,
- * and locates the value in the array for a given axis use.
- *
- * Return value: %TRUE if the given axis use was found, otherwise %FALSE
- **/
-gboolean
-gdk_device_get_axis (GdkDevice *device,
- gdouble *axes,
- GdkAxisUse use,
- gdouble *value)
-{
- gint i;
-
- g_return_val_if_fail (device != NULL, FALSE);
-
- if (axes == NULL)
- return FALSE;
-
- for (i=0; i<device->num_axes; i++)
- if (device->axes[i].use == use)
- {
- if (value)
- *value = axes[i];
- return TRUE;
- }
-
- return FALSE;
-}
-
-#endif
-
#define __GDK_INPUT_C__
#include "gdkaliasdef.c"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]