quartz: Remove gdkinput code

This commit is contained in:
Kristian Rietveld 2010-12-22 14:24:20 +01:00
parent e4a0101542
commit 6fe3100f14
4 changed files with 0 additions and 467 deletions

View File

@ -33,8 +33,6 @@ libgdk_quartz_la_SOURCES = \
gdkeventloop-quartz.c \
gdkgeometry-quartz.c \
gdkglobals-quartz.c \
gdkinput.c \
gdkinputprivate.h \
gdkkeys-quartz.c \
gdkmain-quartz.c \
gdkprivate-quartz.h \

View File

@ -1,68 +0,0 @@
/* gdkinput.c
*
* Copyright (C) 2005 Imendio AB
*
* 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdkinput.h"
GType
gdk_device_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) NULL,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkDevicePrivate),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkDevice",
&object_info, 0);
}
return object_type;
}
void
gdk_device_set_key (GdkDevice *device,
guint index,
guint keyval,
GdkModifierType modifiers)
{
/* FIXME: Implement */
}
gboolean
gdk_device_get_axis (GdkDevice *device, gdouble *axes, GdkAxisUse use, gdouble *value)
{
/* FIXME: Implement */
return FALSE;
}

View File

@ -1,249 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include <stdlib.h>
#include "gdkprivate-quartz.h"
#include "gdkinput.h"
#include "gdkprivate.h"
#include "gdkinputprivate.h"
#include <gdkdevice.h>
#include <gdkdeviceprivate.h>
/* Addition used for extension_events mask */
#define GDK_ALL_DEVICES_MASK (1<<30)
GdkDevice *_gdk_core_pointer = NULL;
/* Global variables */
gchar *_gdk_input_gxid_host;
gint _gdk_input_gxid_port;
gint _gdk_input_ignore_core;
GList *_gdk_input_windows;
GList *_gdk_input_devices;
GList *
_gdk_quartz_display_list_devices (GdkDisplay *dpy)
{
return _gdk_input_devices;
}
static void
_gdk_input_select_device_events (GdkWindow *impl_window,
GdkDevice *device)
{
guint event_mask;
GdkWindow *w;
GdkInputWindow *iw;
GdkInputMode mode;
gboolean has_cursor;
GdkDeviceType type;
GList *l;
event_mask = 0;
iw = impl_window->input_window;
g_object_get (device,
"type", &type,
"input-mode", &mode,
"has-cursor", &has_cursor,
NULL);
if (iw == NULL ||
mode == GDK_MODE_DISABLED ||
type == GDK_DEVICE_TYPE_MASTER)
return;
for (l = _gdk_input_windows; l != NULL; l = l->next)
{
w = l->data;
if (has_cursor || (w->extension_events & GDK_ALL_DEVICES_MASK))
{
event_mask = w->extension_events;
if (event_mask)
event_mask |= GDK_PROXIMITY_OUT_MASK
| GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK;
gdk_window_set_device_events ((GdkWindow *) w, device, event_mask);
}
}
}
gint
_gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
return TRUE;
}
gint
_gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev)
{
return TRUE;
}
GdkInputWindow *
_gdk_input_window_find(GdkWindow *window)
{
GList *tmp_list;
for (tmp_list=_gdk_input_windows; tmp_list; tmp_list=tmp_list->next)
if (((GdkInputWindow *)(tmp_list->data))->window == window)
return (GdkInputWindow *)(tmp_list->data);
return NULL; /* Not found */
}
/* FIXME: this routine currently needs to be called between creation
and the corresponding configure event (because it doesn't get the
root_relative_geometry). This should work with
gtk_window_set_extension_events, but will likely fail in other
cases */
void
gdk_input_set_extension_events (GdkWindow *window,
gint mask,
GdkExtensionMode mode)
{
GList *tmp_list;
GdkInputWindow *iw;
GdkWindow *impl_window;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_WINDOW_IS_QUARTZ (window));
impl_window = (GdkWindow *)_gdk_window_get_impl_window (window);
if (mode == GDK_EXTENSION_EVENTS_NONE)
mask = 0;
if (mask != 0)
{
iw = g_new (GdkInputWindow, 1);
iw->window = window;
iw->mode = mode;
iw->obscuring = NULL;
iw->num_obscuring = 0;
iw->grabbed = FALSE;
_gdk_input_windows = g_list_append (_gdk_input_windows, iw);
window->extension_events = mask;
/* Add enter window events to the event mask */
/* FIXME, this is not needed for XINPUT_NONE */
gdk_window_set_events (window,
gdk_window_get_events (window) |
GDK_ENTER_NOTIFY_MASK);
}
else
{
iw = _gdk_input_window_find (window);
if (iw)
{
_gdk_input_windows = g_list_remove (_gdk_input_windows,iw);
g_free (iw);
}
window->extension_events = 0;
}
for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next)
{
GdkDevice *dev = tmp_list->data;
_gdk_input_select_device_events (GDK_WINDOW (impl_window), dev);
}
}
void
_gdk_input_window_destroy (GdkWindow *window)
{
GdkInputWindow *input_window;
input_window = _gdk_input_window_find (window);
g_return_if_fail (input_window != NULL);
_gdk_input_windows = g_list_remove (_gdk_input_windows,input_window);
g_free (input_window);
}
void
_gdk_quartz_input_init (void)
{
GdkDeviceManager *device_manager;
GList *list, *l;
device_manager = gdk_display_get_device_manager (_gdk_display);
/* For backward compatibility, just add floating devices that are
* not keyboards.
*/
list = gdk_device_manager_list_devices (device_manager,
GDK_DEVICE_TYPE_FLOATING);
for (l = list; l; l = l->next)
{
GdkDevice *device = l->data;
if (gdk_device_get_source(device) == GDK_SOURCE_KEYBOARD)
continue;
_gdk_input_devices = g_list_prepend (_gdk_input_devices, l->data);
}
g_list_free (list);
/* Now set "core" pointer to the first master device that is a pointer.
*/
list = gdk_device_manager_list_devices (device_manager,
GDK_DEVICE_TYPE_MASTER);
for (l = list; l; l = l->next)
{
GdkDevice *device = list->data;
if (gdk_device_get_source(device) != GDK_SOURCE_MOUSE)
continue;
_gdk_display->core_pointer = device;
break;
}
g_list_free (list);
/* Add the core pointer to the devices list */
_gdk_input_devices = g_list_prepend (_gdk_input_devices,
_gdk_display->core_pointer);
_gdk_input_ignore_core = FALSE;
}

View File

@ -1,148 +0,0 @@
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* 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, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_INPUTPRIVATE_H__
#define __GDK_INPUTPRIVATE_H__
#include "config.h"
#include "gdkinput.h"
#include "gdkevents.h"
#include "gdkquartz.h"
typedef struct _GdkAxisInfo GdkAxisInfo;
typedef struct _GdkInputVTable GdkInputVTable;
struct _GdkInputVTable {
gint (*set_mode) (guint32 deviceid, GdkInputMode mode);
void (*set_axes) (guint32 deviceid, GdkAxisUse *axes);
void (*set_key) (guint32 deviceid,
guint index,
guint keyval,
GdkModifierType modifiers);
GdkTimeCoord* (*motion_events) (GdkWindow *window,
guint32 deviceid,
guint32 start,
guint32 stop,
gint *nevents_return);
void (*get_pointer) (GdkWindow *window,
guint32 deviceid,
gdouble *x,
gdouble *y,
gdouble *pressure,
gdouble *xtilt,
gdouble *ytilt,
GdkModifierType *mask);
gint (*grab_pointer) (GdkWindow * window,
gint owner_events,
GdkEventMask event_mask,
GdkWindow * confine_to,
guint32 time);
void (*ungrab_pointer) (guint32 time);
void (*configure_event) (GdkEventConfigure *event, GdkWindow *window);
void (*enter_event) (GdkEventCrossing *event, GdkWindow *window);
gint (*other_event) (GdkEvent *event, GdkWindow *window);
/* Handle an unidentified event. Returns TRUE if handled, FALSE
otherwise */
gint (*window_none_event) (GdkEvent *event);
gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev);
};
/* information about a device axis */
struct _GdkAxisInfo
{
/* reported x resolution */
gint xresolution;
/* reported x minimum/maximum values */
gint xmin_value, xmax_value;
/* calibrated resolution (for aspect ration) - only relative values
between axes used */
gint resolution;
/* calibrated minimum/maximum values */
gint min_value, max_value;
};
#define GDK_INPUT_NUM_EVENTC 6
struct _GdkDevicePrivate {
GdkDevice info;
};
struct _GdkInputWindow
{
/* gdk window */
GdkWindow *window;
/* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */
GdkExtensionMode mode;
/* position relative to root window */
gint root_x;
gint root_y;
/* rectangles relative to window of windows obscuring this one */
GdkRectangle *obscuring;
gint num_obscuring;
/* Is there a pointer grab for this window ? */
gint grabbed;
};
/* Global data */
extern const GdkDevice gdk_input_core_info;
extern GdkDevice *_gdk_core_pointer;
extern GList *_gdk_input_devices;
extern GList *_gdk_input_windows;
extern GdkInputVTable gdk_input_vtable;
/* information about network port and host for gxid daemon */
extern gchar *_gdk_input_gxid_host;
extern gint _gdk_input_gxid_port;
extern gint _gdk_input_ignore_core;
/* Function declarations */
GdkInputWindow * _gdk_input_window_find (GdkWindow *window);
void _gdk_input_window_destroy (GdkWindow *window);
void _gdk_quartz_input_init (void);
gint _gdk_input_enable_window (GdkWindow *window,
GdkDevicePrivate *gdkdev);
gint _gdk_input_disable_window (GdkWindow *window,
GdkDevicePrivate *gdkdev);
void _gdk_init_input_core (void);
void _gdk_input_window_crossing (GdkWindow *window,
gboolean enter);
void _gdk_input_exit (void);
#endif /* __GDK_INPUTPRIVATE_H__ */