forked from AuroraMiddleware/gtk
quartz: rename GdkDeviceManagerCore -> GdkQuartzDeviceManagerCore
This commit is contained in:
parent
59a3d9ae46
commit
083c556e00
@ -25,7 +25,8 @@ libgdk_quartz_la_SOURCES = \
|
|||||||
gdkcursor-quartz.h \
|
gdkcursor-quartz.h \
|
||||||
gdkdevice-core-quartz.c \
|
gdkdevice-core-quartz.c \
|
||||||
gdkdevice-core-quartz.h \
|
gdkdevice-core-quartz.h \
|
||||||
gdkdevicemanager-core.c \
|
gdkdevicemanager-core-quartz.c \
|
||||||
|
gdkdevicemanager-core-quartz.h \
|
||||||
gdkdisplay-quartz.c \
|
gdkdisplay-quartz.c \
|
||||||
gdkdisplay-quartz.h \
|
gdkdisplay-quartz.h \
|
||||||
gdkdisplaymanager-quartz.c \
|
gdkdisplaymanager-quartz.c \
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <gdk/gdktypes.h>
|
#include <gdk/gdktypes.h>
|
||||||
#include <gdk/gdkdevicemanager.h>
|
#include <gdk/gdkdevicemanager.h>
|
||||||
#include "gdkdevicemanager-core.h"
|
#include "gdkdevicemanager-core-quartz.h"
|
||||||
#include "gdkdevice-core-quartz.h"
|
#include "gdkdevice-core-quartz.h"
|
||||||
#include "gdkkeysyms.h"
|
#include "gdkkeysyms.h"
|
||||||
|
|
||||||
@ -29,26 +29,26 @@
|
|||||||
#define HAS_FOCUS(toplevel) \
|
#define HAS_FOCUS(toplevel) \
|
||||||
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
|
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
|
||||||
|
|
||||||
static void gdk_device_manager_core_finalize (GObject *object);
|
static void gdk_quartz_device_manager_core_finalize (GObject *object);
|
||||||
static void gdk_device_manager_core_constructed (GObject *object);
|
static void gdk_quartz_device_manager_core_constructed (GObject *object);
|
||||||
|
|
||||||
static GList * gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
static GList * gdk_quartz_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||||
GdkDeviceType type);
|
GdkDeviceType type);
|
||||||
static GdkDevice * gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
|
static GdkDevice * gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GdkDeviceManagerCore, gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
|
G_DEFINE_TYPE (GdkQuartzDeviceManagerCore, gdk_quartz_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass)
|
gdk_quartz_device_manager_core_class_init (GdkQuartzDeviceManagerCoreClass *klass)
|
||||||
{
|
{
|
||||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = gdk_device_manager_core_finalize;
|
object_class->finalize = gdk_quartz_device_manager_core_finalize;
|
||||||
object_class->constructed = gdk_device_manager_core_constructed;
|
object_class->constructed = gdk_quartz_device_manager_core_constructed;
|
||||||
device_manager_class->list_devices = gdk_device_manager_core_list_devices;
|
device_manager_class->list_devices = gdk_quartz_device_manager_core_list_devices;
|
||||||
device_manager_class->get_client_pointer = gdk_device_manager_core_get_client_pointer;
|
device_manager_class->get_client_pointer = gdk_quartz_device_manager_core_get_client_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkDevice *
|
static GdkDevice *
|
||||||
@ -82,30 +82,30 @@ create_core_keyboard (GdkDeviceManager *device_manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager)
|
gdk_quartz_device_manager_core_init (GdkQuartzDeviceManagerCore *device_manager)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_device_manager_core_finalize (GObject *object)
|
gdk_quartz_device_manager_core_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
GdkDeviceManagerCore *device_manager_core;
|
GdkQuartzDeviceManagerCore *quartz_device_manager_core;
|
||||||
|
|
||||||
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
|
quartz_device_manager_core = GDK_QUARTZ_DEVICE_MANAGER_CORE (object);
|
||||||
|
|
||||||
g_object_unref (device_manager_core->core_pointer);
|
g_object_unref (quartz_device_manager_core->core_pointer);
|
||||||
g_object_unref (device_manager_core->core_keyboard);
|
g_object_unref (quartz_device_manager_core->core_keyboard);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gdk_quartz_device_manager_core_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_device_manager_core_constructed (GObject *object)
|
gdk_quartz_device_manager_core_constructed (GObject *object)
|
||||||
{
|
{
|
||||||
GdkDeviceManagerCore *device_manager;
|
GdkQuartzDeviceManagerCore *device_manager;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
|
||||||
device_manager = GDK_DEVICE_MANAGER_CORE (object);
|
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (object);
|
||||||
display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (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_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display);
|
||||||
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display);
|
device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display);
|
||||||
@ -115,27 +115,27 @@ gdk_device_manager_core_constructed (GObject *object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GList *
|
static GList *
|
||||||
gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
gdk_quartz_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||||
GdkDeviceType type)
|
GdkDeviceType type)
|
||||||
{
|
{
|
||||||
GdkDeviceManagerCore *device_manager_core;
|
GdkQuartzDeviceManagerCore *quartz_device_manager_core;
|
||||||
GList *devices = NULL;
|
GList *devices = NULL;
|
||||||
|
|
||||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||||
{
|
{
|
||||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
|
||||||
devices = g_list_prepend (devices, device_manager_core->core_keyboard);
|
devices = g_list_prepend (devices, quartz_device_manager_core->core_keyboard);
|
||||||
devices = g_list_prepend (devices, device_manager_core->core_pointer);
|
devices = g_list_prepend (devices, quartz_device_manager_core->core_pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkDevice *
|
static GdkDevice *
|
||||||
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||||
{
|
{
|
||||||
GdkDeviceManagerCore *device_manager_core;
|
GdkQuartzDeviceManagerCore *quartz_device_manager_core;
|
||||||
|
|
||||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
|
||||||
return device_manager_core->core_pointer;
|
return quartz_device_manager_core->core_pointer;
|
||||||
}
|
}
|
54
gdk/quartz/gdkdevicemanager-core-quartz.h
Normal file
54
gdk/quartz/gdkdevicemanager-core-quartz.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_QUARTZ_DEVICE_MANAGER_CORE_H__
|
||||||
|
#define __GDK_QUARTZ_DEVICE_MANAGER_CORE_H__
|
||||||
|
|
||||||
|
#include <gdk/gdkdevicemanagerprivate.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE (gdk_quartz_device_manager_core_get_type ())
|
||||||
|
#define GDK_QUARTZ_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE, GdkQuartzDeviceManagerCore))
|
||||||
|
#define GDK_QUARTZ_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE, GdkQuartzDeviceManagerCoreClass))
|
||||||
|
#define GDK_IS_QUARTZ_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE))
|
||||||
|
#define GDK_IS_QUARTZ_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE))
|
||||||
|
#define GDK_QUARTZ_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE, GdkQuartzDeviceManagerCoreClass))
|
||||||
|
|
||||||
|
typedef struct _GdkQuartzDeviceManagerCore GdkQuartzDeviceManagerCore;
|
||||||
|
typedef struct _GdkQuartzDeviceManagerCoreClass GdkQuartzDeviceManagerCoreClass;
|
||||||
|
|
||||||
|
struct _GdkQuartzDeviceManagerCore
|
||||||
|
{
|
||||||
|
GdkDeviceManager parent_object;
|
||||||
|
GdkDevice *core_pointer;
|
||||||
|
GdkDevice *core_keyboard;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GdkQuartzDeviceManagerCoreClass
|
||||||
|
{
|
||||||
|
GdkDeviceManagerClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType gdk_quartz_device_manager_core_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GDK_QUARTZ_DEVICE_MANAGER_CORE_H__ */
|
@ -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 <gdk/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__ */
|
|
@ -25,7 +25,7 @@
|
|||||||
#include "gdkscreen-quartz.h"
|
#include "gdkscreen-quartz.h"
|
||||||
#include "gdkwindow-quartz.h"
|
#include "gdkwindow-quartz.h"
|
||||||
#include "gdkdisplay-quartz.h"
|
#include "gdkdisplay-quartz.h"
|
||||||
#include "gdkdevicemanager-core.h"
|
#include "gdkdevicemanager-core-quartz.h"
|
||||||
|
|
||||||
static GdkWindow *
|
static GdkWindow *
|
||||||
gdk_quartz_display_get_default_group (GdkDisplay *display)
|
gdk_quartz_display_get_default_group (GdkDisplay *display)
|
||||||
@ -40,7 +40,7 @@ gdk_quartz_display_get_default_group (GdkDisplay *display)
|
|||||||
GdkDeviceManager *
|
GdkDeviceManager *
|
||||||
_gdk_device_manager_new (GdkDisplay *display)
|
_gdk_device_manager_new (GdkDisplay *display)
|
||||||
{
|
{
|
||||||
return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE,
|
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_MANAGER_CORE,
|
||||||
"display", display,
|
"display", display,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "gdkkeysyms.h"
|
#include "gdkkeysyms.h"
|
||||||
#include "gdkdisplay-quartz.h"
|
#include "gdkdisplay-quartz.h"
|
||||||
#include "gdkprivate-quartz.h"
|
#include "gdkprivate-quartz.h"
|
||||||
#include "gdkdevicemanager-core.h"
|
#include "gdkdevicemanager-core-quartz.h"
|
||||||
|
|
||||||
#define GRIP_WIDTH 15
|
#define GRIP_WIDTH 15
|
||||||
#define GRIP_HEIGHT 15
|
#define GRIP_HEIGHT 15
|
||||||
@ -312,13 +312,13 @@ create_focus_event (GdkWindow *window,
|
|||||||
gboolean in)
|
gboolean in)
|
||||||
{
|
{
|
||||||
GdkEvent *event;
|
GdkEvent *event;
|
||||||
GdkDeviceManagerCore *device_manager;
|
GdkQuartzDeviceManagerCore *device_manager;
|
||||||
|
|
||||||
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
event = gdk_event_new (GDK_FOCUS_CHANGE);
|
||||||
event->focus_change.window = window;
|
event->focus_change.window = window;
|
||||||
event->focus_change.in = in;
|
event->focus_change.in = in;
|
||||||
|
|
||||||
device_manager = GDK_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
|
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
|
||||||
gdk_event_set_device (event, device_manager->core_keyboard);
|
gdk_event_set_device (event, device_manager->core_keyboard);
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
@ -900,7 +900,7 @@ fill_key_event (GdkWindow *window,
|
|||||||
GdkEventType type)
|
GdkEventType type)
|
||||||
{
|
{
|
||||||
GdkEventPrivate *priv;
|
GdkEventPrivate *priv;
|
||||||
GdkDeviceManagerCore *device_manager;
|
GdkQuartzDeviceManagerCore *device_manager;
|
||||||
gchar buf[7];
|
gchar buf[7];
|
||||||
gunichar c = 0;
|
gunichar c = 0;
|
||||||
|
|
||||||
@ -915,7 +915,7 @@ fill_key_event (GdkWindow *window,
|
|||||||
event->key.group = ([nsevent modifierFlags] & NSAlternateKeyMask) ? 1 : 0;
|
event->key.group = ([nsevent modifierFlags] & NSAlternateKeyMask) ? 1 : 0;
|
||||||
event->key.keyval = GDK_KEY_VoidSymbol;
|
event->key.keyval = GDK_KEY_VoidSymbol;
|
||||||
|
|
||||||
device_manager = GDK_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
|
device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_display->device_manager);
|
||||||
gdk_event_set_device (event, device_manager->core_keyboard);
|
gdk_event_set_device (event, device_manager->core_keyboard);
|
||||||
|
|
||||||
gdk_keymap_translate_keyboard_state (NULL,
|
gdk_keymap_translate_keyboard_state (NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user