Rename GdkDevice[Manager]Core to GdkX11Device[Manager]Core
This is mainly to avoid clash with the classes of the same name in the quartz backend.
This commit is contained in:
@ -23,10 +23,8 @@ libgdk_x11_la_SOURCES = \
|
||||
gdkasync.c \
|
||||
gdkasync.h \
|
||||
gdkcursor-x11.c \
|
||||
gdkdevice-core.h \
|
||||
gdkdevice-core.c \
|
||||
gdkdevicemanager-core.h \
|
||||
gdkdevicemanager-core.c \
|
||||
gdkdevice-core-x11.c \
|
||||
gdkdevicemanager-core-x11.c \
|
||||
gdkdevicemanager-x11.c \
|
||||
gdkdisplaymanager-x11.c \
|
||||
gdkdisplay-x11.c \
|
||||
@ -77,6 +75,8 @@ libgdkinclude_HEADERS = \
|
||||
|
||||
libgdkx11include_HEADERS = \
|
||||
gdkx11cursor.h \
|
||||
gdkx11device-core.h \
|
||||
gdkx11devicemanager-core.h \
|
||||
gdkx11display.h \
|
||||
gdkx11displaymanager.h \
|
||||
gdkx11keys.h \
|
||||
|
||||
@ -19,31 +19,31 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdevice-core.h"
|
||||
#include "gdkx11device-core.h"
|
||||
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkasync.h"
|
||||
|
||||
static gboolean gdk_device_core_get_history (GdkDevice *device,
|
||||
static gboolean gdk_x11_device_core_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
GdkTimeCoord ***events,
|
||||
gint *n_events);
|
||||
static void gdk_device_core_get_state (GdkDevice *device,
|
||||
static void gdk_x11_device_core_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask);
|
||||
static void gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
static void gdk_x11_device_core_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor);
|
||||
static void gdk_device_core_warp (GdkDevice *device,
|
||||
static void gdk_x11_device_core_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y);
|
||||
static gboolean gdk_device_core_query_state (GdkDevice *device,
|
||||
static gboolean gdk_x11_device_core_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
@ -52,45 +52,44 @@ static gboolean gdk_device_core_query_state (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask);
|
||||
static GdkGrabStatus gdk_device_core_grab (GdkDevice *device,
|
||||
static GdkGrabStatus gdk_x11_device_core_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindow *confine_to,
|
||||
GdkCursor *cursor,
|
||||
guint32 time_);
|
||||
static void gdk_device_core_ungrab (GdkDevice *device,
|
||||
static void gdk_x11_device_core_ungrab (GdkDevice *device,
|
||||
guint32 time_);
|
||||
static GdkWindow * gdk_device_core_window_at_position (GdkDevice *device,
|
||||
static GdkWindow * gdk_x11_device_core_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
gboolean get_toplevel);
|
||||
static void gdk_device_core_select_window_events (GdkDevice *device,
|
||||
static void gdk_x11_device_core_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask);
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE)
|
||||
G_DEFINE_TYPE (GdkX11DeviceCore, gdk_x11_device_core, GDK_TYPE_DEVICE)
|
||||
|
||||
static void
|
||||
gdk_device_core_class_init (GdkDeviceCoreClass *klass)
|
||||
gdk_x11_device_core_class_init (GdkX11DeviceCoreClass *klass)
|
||||
{
|
||||
GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
|
||||
|
||||
device_class->get_history = gdk_device_core_get_history;
|
||||
device_class->get_state = gdk_device_core_get_state;
|
||||
device_class->set_window_cursor = gdk_device_core_set_window_cursor;
|
||||
device_class->warp = gdk_device_core_warp;
|
||||
device_class->query_state = gdk_device_core_query_state;
|
||||
device_class->grab = gdk_device_core_grab;
|
||||
device_class->ungrab = gdk_device_core_ungrab;
|
||||
device_class->window_at_position = gdk_device_core_window_at_position;
|
||||
device_class->select_window_events = gdk_device_core_select_window_events;
|
||||
device_class->get_history = gdk_x11_device_core_get_history;
|
||||
device_class->get_state = gdk_x11_device_core_get_state;
|
||||
device_class->set_window_cursor = gdk_x11_device_core_set_window_cursor;
|
||||
device_class->warp = gdk_x11_device_core_warp;
|
||||
device_class->query_state = gdk_x11_device_core_query_state;
|
||||
device_class->grab = gdk_x11_device_core_grab;
|
||||
device_class->ungrab = gdk_x11_device_core_ungrab;
|
||||
device_class->window_at_position = gdk_x11_device_core_window_at_position;
|
||||
device_class->select_window_events = gdk_x11_device_core_select_window_events;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_init (GdkDeviceCore *device_core)
|
||||
gdk_x11_device_core_init (GdkX11DeviceCore *device_core)
|
||||
{
|
||||
GdkDevice *device;
|
||||
|
||||
@ -117,7 +116,7 @@ impl_coord_in_window (GdkWindow *window,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_core_get_history (GdkDevice *device,
|
||||
gdk_x11_device_core_get_history (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
guint32 start,
|
||||
guint32 stop,
|
||||
@ -179,7 +178,7 @@ gdk_device_core_get_history (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_get_state (GdkDevice *device,
|
||||
gdk_x11_device_core_get_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gdouble *axes,
|
||||
GdkModifierType *mask)
|
||||
@ -196,7 +195,7 @@ gdk_device_core_get_state (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
gdk_x11_device_core_set_window_cursor (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkCursor *cursor)
|
||||
{
|
||||
@ -213,7 +212,7 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_warp (GdkDevice *device,
|
||||
gdk_x11_device_core_warp (GdkDevice *device,
|
||||
GdkScreen *screen,
|
||||
gint x,
|
||||
gint y)
|
||||
@ -228,7 +227,7 @@ gdk_device_core_warp (GdkDevice *device,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_core_query_state (GdkDevice *device,
|
||||
gdk_x11_device_core_query_state (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkWindow **root_window,
|
||||
GdkWindow **child_window,
|
||||
@ -253,10 +252,8 @@ gdk_device_core_query_state (GdkDevice *device,
|
||||
GDK_WINDOW_XID (window),
|
||||
&xroot_window,
|
||||
&xchild_window,
|
||||
&xroot_x,
|
||||
&xroot_y,
|
||||
&xwin_x,
|
||||
&xwin_y,
|
||||
&xroot_x, &xroot_y,
|
||||
&xwin_x, &xwin_y,
|
||||
&xmask))
|
||||
return FALSE;
|
||||
}
|
||||
@ -276,10 +273,8 @@ gdk_device_core_query_state (GdkDevice *device,
|
||||
XQueryPointer (xdisplay, w,
|
||||
&xroot_window,
|
||||
&xchild_window,
|
||||
&xroot_x,
|
||||
&xroot_y,
|
||||
&xwin_x,
|
||||
&xwin_y,
|
||||
&xroot_x, &xroot_y,
|
||||
&xwin_x, &xwin_y,
|
||||
&xmask);
|
||||
XDestroyWindow (xdisplay, w);
|
||||
}
|
||||
@ -309,7 +304,7 @@ gdk_device_core_query_state (GdkDevice *device,
|
||||
}
|
||||
|
||||
static GdkGrabStatus
|
||||
gdk_device_core_grab (GdkDevice *device,
|
||||
gdk_x11_device_core_grab (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
gboolean owner_events,
|
||||
GdkEventMask event_mask,
|
||||
@ -391,7 +386,7 @@ gdk_device_core_grab (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_ungrab (GdkDevice *device,
|
||||
gdk_x11_device_core_ungrab (GdkDevice *device,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
@ -409,7 +404,7 @@ gdk_device_core_ungrab (GdkDevice *device,
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gdk_device_core_window_at_position (GdkDevice *device,
|
||||
gdk_x11_device_core_window_at_position (GdkDevice *device,
|
||||
gint *win_x,
|
||||
gint *win_y,
|
||||
GdkModifierType *mask,
|
||||
@ -473,7 +468,10 @@ gdk_device_core_window_at_position (GdkDevice *device,
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XQueryPointer (xdisplay, xwindow,
|
||||
&root, &child, &rootx, &rooty, &winx, &winy, &xmask);
|
||||
&root, &child,
|
||||
&rootx, &rooty,
|
||||
&winx, &winy,
|
||||
&xmask);
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
continue;
|
||||
if (child != None)
|
||||
@ -494,7 +492,9 @@ gdk_device_core_window_at_position (GdkDevice *device,
|
||||
XMapWindow (xdisplay, w);
|
||||
XQueryPointer (xdisplay, xwindow,
|
||||
&root, &child,
|
||||
&rootx, &rooty, &winx, &winy, &xmask);
|
||||
&rootx, &rooty,
|
||||
&winx, &winy,
|
||||
&xmask);
|
||||
XDestroyWindow (xdisplay, w);
|
||||
if (child == w)
|
||||
{
|
||||
@ -550,7 +550,7 @@ gdk_device_core_window_at_position (GdkDevice *device,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_core_select_window_events (GdkDevice *device,
|
||||
gdk_x11_device_core_select_window_events (GdkDevice *device,
|
||||
GdkWindow *window,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
@ -1,52 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DEVICE_CORE_H__
|
||||
#define __GDK_DEVICE_CORE_H__
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_DEVICE_CORE (gdk_device_core_get_type ())
|
||||
#define GDK_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCore))
|
||||
#define GDK_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass))
|
||||
#define GDK_IS_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_CORE))
|
||||
#define GDK_IS_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_CORE))
|
||||
#define GDK_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass))
|
||||
|
||||
typedef struct _GdkDeviceCore GdkDeviceCore;
|
||||
typedef struct _GdkDeviceCoreClass GdkDeviceCoreClass;
|
||||
|
||||
struct _GdkDeviceCore
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkDeviceCoreClass
|
||||
{
|
||||
GdkDeviceClass parent_class;
|
||||
};
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
GType gdk_device_core_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DEVICE_CORE_H__ */
|
||||
@ -19,13 +19,13 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdevicemanager-core.h"
|
||||
#include "gdkx11devicemanager-core.h"
|
||||
#include "gdkx11device-core.h"
|
||||
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkdevicemanagerprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkeventtranslator.h"
|
||||
#include "gdkdevice-core.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
@ -36,48 +36,48 @@
|
||||
#define HAS_FOCUS(toplevel) \
|
||||
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
|
||||
|
||||
static void gdk_device_manager_core_finalize (GObject *object);
|
||||
static void gdk_device_manager_core_constructed (GObject *object);
|
||||
static void gdk_x11_device_manager_core_finalize (GObject *object);
|
||||
static void gdk_x11_device_manager_core_constructed (GObject *object);
|
||||
|
||||
static GList * gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
static GList * gdk_x11_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type);
|
||||
static GdkDevice * gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
|
||||
static GdkDevice * gdk_x11_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
|
||||
|
||||
static void gdk_device_manager_event_translator_init (GdkEventTranslatorIface *iface);
|
||||
static void gdk_x11_device_manager_event_translator_init (GdkEventTranslatorIface *iface);
|
||||
|
||||
static gboolean gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
static gboolean gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
XEvent *xevent);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerCore, gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER,
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerCore, gdk_x11_device_manager_core, GDK_TYPE_DEVICE_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
|
||||
gdk_device_manager_event_translator_init))
|
||||
gdk_x11_device_manager_event_translator_init))
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass)
|
||||
gdk_x11_device_manager_core_class_init (GdkX11DeviceManagerCoreClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_device_manager_core_finalize;
|
||||
object_class->constructed = gdk_device_manager_core_constructed;
|
||||
device_manager_class->list_devices = gdk_device_manager_core_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_device_manager_core_get_client_pointer;
|
||||
object_class->finalize = gdk_x11_device_manager_core_finalize;
|
||||
object_class->constructed = gdk_x11_device_manager_core_constructed;
|
||||
device_manager_class->list_devices = gdk_x11_device_manager_core_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_x11_device_manager_core_get_client_pointer;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_event_translator_init (GdkEventTranslatorIface *iface)
|
||||
gdk_x11_device_manager_event_translator_init (GdkEventTranslatorIface *iface)
|
||||
{
|
||||
iface->translate_event = gdk_device_manager_core_translate_event;
|
||||
iface->translate_event = gdk_x11_device_manager_core_translate_event;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_pointer (GdkDeviceManager *device_manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_CORE,
|
||||
return g_object_new (GDK_TYPE_X11_DEVICE_CORE,
|
||||
"name", "Core Pointer",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
"input-source", GDK_SOURCE_MOUSE,
|
||||
@ -92,7 +92,7 @@ static GdkDevice *
|
||||
create_core_keyboard (GdkDeviceManager *device_manager,
|
||||
GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_CORE,
|
||||
return g_object_new (GDK_TYPE_X11_DEVICE_CORE,
|
||||
"name", "Core Keyboard",
|
||||
"type", GDK_DEVICE_TYPE_MASTER,
|
||||
"input-source", GDK_SOURCE_KEYBOARD,
|
||||
@ -104,30 +104,30 @@ create_core_keyboard (GdkDeviceManager *device_manager,
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager)
|
||||
gdk_x11_device_manager_core_init (GdkX11DeviceManagerCore *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_finalize (GObject *object)
|
||||
gdk_x11_device_manager_core_finalize (GObject *object)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkX11DeviceManagerCore *device_manager_core;
|
||||
|
||||
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
|
||||
device_manager_core = GDK_X11_DEVICE_MANAGER_CORE (object);
|
||||
|
||||
g_object_unref (device_manager_core->core_pointer);
|
||||
g_object_unref (device_manager_core->core_keyboard);
|
||||
|
||||
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_x11_device_manager_core_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_constructed (GObject *object)
|
||||
gdk_x11_device_manager_core_constructed (GObject *object)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager;
|
||||
GdkX11DeviceManagerCore *device_manager;
|
||||
GdkDisplay *display;
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_CORE (object);
|
||||
device_manager = GDK_X11_DEVICE_MANAGER_CORE (object);
|
||||
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object));
|
||||
device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display);
|
||||
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display);
|
||||
@ -138,7 +138,7 @@ gdk_device_manager_core_constructed (GObject *object)
|
||||
|
||||
static void
|
||||
translate_key_event (GdkDisplay *display,
|
||||
GdkDeviceManagerCore *device_manager,
|
||||
GdkX11DeviceManagerCore *device_manager,
|
||||
GdkEvent *event,
|
||||
XEvent *xevent)
|
||||
{
|
||||
@ -283,7 +283,7 @@ set_user_time (GdkWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
generate_focus_event (GdkDeviceManagerCore *device_manager,
|
||||
generate_focus_event (GdkX11DeviceManagerCore *device_manager,
|
||||
GdkWindow *window,
|
||||
gboolean in)
|
||||
{
|
||||
@ -392,7 +392,7 @@ get_event_window (GdkEventTranslator *translator,
|
||||
|
||||
serial = _gdk_display_get_next_serial (display);
|
||||
info = _gdk_display_has_device_grab (display,
|
||||
GDK_DEVICE_MANAGER_CORE (device_manager)->core_keyboard,
|
||||
GDK_X11_DEVICE_MANAGER_CORE (device_manager)->core_keyboard,
|
||||
serial);
|
||||
if (info &&
|
||||
(!is_parent_of (info->window, window) ||
|
||||
@ -407,19 +407,19 @@ get_event_window (GdkEventTranslator *translator,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
XEvent *xevent)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager;
|
||||
GdkX11DeviceManagerCore *device_manager;
|
||||
GdkWindow *window;
|
||||
GdkWindowImplX11 *window_impl = NULL;
|
||||
gboolean return_val;
|
||||
GdkToplevelX11 *toplevel = NULL;
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
|
||||
device_manager = GDK_DEVICE_MANAGER_CORE (translator);
|
||||
device_manager = GDK_X11_DEVICE_MANAGER_CORE (translator);
|
||||
return_val = FALSE;
|
||||
|
||||
window = get_event_window (translator, xevent);
|
||||
@ -883,15 +883,15 @@ gdk_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
gdk_x11_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkX11DeviceManagerCore *device_manager_core;
|
||||
GList *devices = NULL;
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
device_manager_core = (GdkX11DeviceManagerCore *) device_manager;
|
||||
devices = g_list_prepend (devices, device_manager_core->core_keyboard);
|
||||
devices = g_list_prepend (devices, device_manager_core->core_pointer);
|
||||
}
|
||||
@ -900,10 +900,10 @@ gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
gdk_x11_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkX11DeviceManagerCore *device_manager_core;
|
||||
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
device_manager_core = (GdkX11DeviceManagerCore *) device_manager;
|
||||
return device_manager_core->core_pointer;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_DEVICE_MANAGER_CORE_H__
|
||||
#define __GDK_DEVICE_MANAGER_CORE_H__
|
||||
|
||||
#include "gdkdevicemanagerprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ())
|
||||
#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore))
|
||||
#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
|
||||
typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore;
|
||||
typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass;
|
||||
|
||||
struct _GdkDeviceManagerCore
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
};
|
||||
|
||||
struct _GdkDeviceManagerCoreClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_device_manager_core_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_DEVICE_MANAGER_CORE_H__ */
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkdevicemanager-core.h"
|
||||
#include "gdkx11devicemanager-core.h"
|
||||
#ifdef XINPUT_XFREE
|
||||
#include "gdkdevicemanager-xi.h"
|
||||
#ifdef XINPUT_2
|
||||
@ -79,7 +79,7 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
|
||||
|
||||
GDK_NOTE (INPUT, g_print ("Creating core device manager\n"));
|
||||
|
||||
return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE,
|
||||
return g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_CORE,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ static GList * gdk_device_manager_xi_list_devices (GdkDeviceManager *devic
|
||||
GdkDeviceType type);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerXI, gdk_device_manager_xi, GDK_TYPE_DEVICE_MANAGER_CORE,
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerXI, gdk_device_manager_xi, GDK_TYPE_X11_DEVICE_MANAGER_CORE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
|
||||
gdk_device_manager_xi_event_translator_init))
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#ifndef __GDK_DEVICE_MANAGER_XI_H__
|
||||
#define __GDK_DEVICE_MANAGER_XI_H__
|
||||
|
||||
#include "gdkdevicemanager-core.h"
|
||||
#include "gdkx11devicemanager-core.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -37,7 +37,7 @@ typedef struct _GdkDeviceManagerXIClass GdkDeviceManagerXIClass;
|
||||
|
||||
struct _GdkDeviceManagerXI
|
||||
{
|
||||
GdkDeviceManagerCore parent_object;
|
||||
GdkX11DeviceManagerCore parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
|
||||
@ -47,7 +47,7 @@ struct _GdkDeviceManagerXI
|
||||
|
||||
struct _GdkDeviceManagerXIClass
|
||||
{
|
||||
GdkDeviceManagerCoreClass parent_class;
|
||||
GdkX11DeviceManagerCoreClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_device_manager_xi_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@ -56,6 +56,8 @@
|
||||
#define __GDKX_H_INSIDE__
|
||||
|
||||
#include <gdk/x11/gdkx11cursor.h>
|
||||
#include <gdk/x11/gdkx11device-core.h>
|
||||
#include <gdk/x11/gdkx11devicemanager-core.h>
|
||||
#include <gdk/x11/gdkx11display.h>
|
||||
#include <gdk/x11/gdkx11displaymanager.h>
|
||||
#include <gdk/x11/gdkx11keys.h>
|
||||
|
||||
51
gdk/x11/gdkx11device-core.h
Normal file
51
gdk/x11/gdkx11device-core.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_X11_DEVICE_CORE_H__
|
||||
#define __GDK_X11_DEVICE_CORE_H__
|
||||
|
||||
#include "gdkdeviceprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_X11_DEVICE_CORE (gdk_x11_device_core_get_type ())
|
||||
#define GDK_X11_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_X11_DEVICE_CORE, GdkX11DeviceCore))
|
||||
#define GDK_X11_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_X11_DEVICE_CORE, GdkX11DeviceCoreClass))
|
||||
#define GDK_IS_X11_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_X11_DEVICE_CORE))
|
||||
#define GDK_IS_X11_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_X11_DEVICE_CORE))
|
||||
#define GDK_X11_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_X11_DEVICE_CORE, GdkX11DeviceCoreClass))
|
||||
|
||||
typedef struct _GdkX11DeviceCore GdkX11DeviceCore;
|
||||
typedef struct _GdkX11DeviceCoreClass GdkX11DeviceCoreClass;
|
||||
|
||||
struct _GdkX11DeviceCore
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
};
|
||||
|
||||
struct _GdkX11DeviceCoreClass
|
||||
{
|
||||
GdkDeviceClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_x11_device_core_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_X11_DEVICE_CORE_H__ */
|
||||
54
gdk/x11/gdkx11devicemanager-core.h
Normal file
54
gdk/x11/gdkx11devicemanager-core.h
Normal file
@ -0,0 +1,54 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __GDK_X11_DEVICE_MANAGER_CORE_H__
|
||||
#define __GDK_X11_DEVICE_MANAGER_CORE_H__
|
||||
|
||||
#include "gdkdevicemanagerprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_TYPE_X11_DEVICE_MANAGER_CORE (gdk_x11_device_manager_core_get_type ())
|
||||
#define GDK_X11_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_X11_DEVICE_MANAGER_CORE, GdkX11DeviceManagerCore))
|
||||
#define GDK_X11_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_X11_DEVICE_MANAGER_CORE, GdkX11DeviceManagerCoreClass))
|
||||
#define GDK_IS_X11_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_X11_DEVICE_MANAGER_CORE))
|
||||
#define GDK_IS_X11_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_X11_DEVICE_MANAGER_CORE))
|
||||
#define GDK_X11_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_X11_DEVICE_MANAGER_CORE, GdkX11DeviceManagerCoreClass))
|
||||
|
||||
typedef struct _GdkX11DeviceManagerCore GdkX11DeviceManagerCore;
|
||||
typedef struct _GdkX11DeviceManagerCoreClass GdkX11DeviceManagerCoreClass;
|
||||
|
||||
struct _GdkX11DeviceManagerCore
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
};
|
||||
|
||||
struct _GdkX11DeviceManagerCoreClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
GType gdk_x11_device_manager_core_get_type (void) G_GNUC_CONST;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_X11_DEVICE_MANAGER_CORE_H__ */
|
||||
Reference in New Issue
Block a user