Commit 59a3d9ae authored by Kristian Rietveld's avatar Kristian Rietveld

quartz: Rename GdkDeviceCore -> GdkQuartzDeviceCore

parent e2e43919
......@@ -23,7 +23,8 @@ libgdk_quartz_la_SOURCES = \
GdkQuartzWindow.h \
gdkcursor-quartz.c \
gdkcursor-quartz.h \
gdkdevice-core.c \
gdkdevice-core-quartz.c \
gdkdevice-core-quartz.h \
gdkdevicemanager-core.c \
gdkdisplay-quartz.c \
gdkdisplay-quartz.h \
......
......@@ -26,98 +26,98 @@
#include "gdkwindow-quartz.h"
#include "gdkcursor-quartz.h"
#include "gdkprivate-quartz.h"
#include "gdkdevice-core.h"
static gboolean gdk_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,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask);
static void gdk_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor);
static void gdk_device_core_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y);
static gboolean gdk_device_core_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_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,
guint32 time_);
static GdkWindow * gdk_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,
GdkWindow *window,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE)
#include "gdkdevice-core-quartz.h"
static gboolean gdk_quartz_device_core_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events);
static void gdk_quartz_device_core_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask);
static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor);
static void gdk_quartz_device_core_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y);
static gboolean gdk_quartz_device_core_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask);
static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_);
static void gdk_quartz_device_core_ungrab (GdkDevice *device,
guint32 time_);
static GdkWindow * gdk_quartz_device_core_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
static void gdk_quartz_device_core_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkQuartzDeviceCore, gdk_quartz_device_core, GDK_TYPE_DEVICE)
static void
gdk_device_core_class_init (GdkDeviceCoreClass *klass)
gdk_quartz_device_core_class_init (GdkQuartzDeviceCoreClass *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_quartz_device_core_get_history;
device_class->get_state = gdk_quartz_device_core_get_state;
device_class->set_window_cursor = gdk_quartz_device_core_set_window_cursor;
device_class->warp = gdk_quartz_device_core_warp;
device_class->query_state = gdk_quartz_device_core_query_state;
device_class->grab = gdk_quartz_device_core_grab;
device_class->ungrab = gdk_quartz_device_core_ungrab;
device_class->window_at_position = gdk_quartz_device_core_window_at_position;
device_class->select_window_events = gdk_quartz_device_core_select_window_events;
}
static void
gdk_device_core_init (GdkDeviceCore *device_core)
gdk_quartz_device_core_init (GdkQuartzDeviceCore *quartz_device_core)
{
GdkDevice *device;
device = GDK_DEVICE (device_core);
device = GDK_DEVICE (quartz_device_core);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1);
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1);
}
static gboolean
gdk_device_core_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events)
gdk_quartz_device_core_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
guint32 stop,
GdkTimeCoord ***events,
gint *n_events)
{
return FALSE;
}
static void
gdk_device_core_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask)
gdk_quartz_device_core_get_state (GdkDevice *device,
GdkWindow *window,
gdouble *axes,
GdkModifierType *mask)
{
gint x_int, y_int;
......@@ -155,9 +155,9 @@ translate_coords_to_child_coords (GdkWindow *parent,
}
static void
gdk_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window,
GdkCursor *cursor)
{
GdkQuartzCursor *cursor_private;
NSCursor *nscursor;
......@@ -176,20 +176,20 @@ gdk_device_core_set_window_cursor (GdkDevice *device,
}
static void
gdk_device_core_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y)
gdk_quartz_device_core_warp (GdkDevice *device,
GdkScreen *screen,
gint x,
gint y)
{
CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y));
}
static GdkWindow *
gdk_device_core_query_state_helper (GdkWindow *window,
GdkDevice *device,
gint *x,
gint *y,
GdkModifierType *mask)
gdk_quartz_device_core_query_state_helper (GdkWindow *window,
GdkDevice *device,
gint *x,
gint *y,
GdkModifierType *mask)
{
GdkWindow *toplevel;
NSPoint point;
......@@ -251,24 +251,24 @@ gdk_device_core_query_state_helper (GdkWindow *window,
}
static gboolean
gdk_device_core_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
gdk_quartz_device_core_query_state (GdkDevice *device,
GdkWindow *window,
GdkWindow **root_window,
GdkWindow **child_window,
gint *root_x,
gint *root_y,
gint *win_x,
gint *win_y,
GdkModifierType *mask)
{
GdkDisplay *display;
GdkWindow *found_window;
NSPoint point;
gint x_tmp, y_tmp;
found_window = gdk_device_core_query_state_helper (window, device,
win_x, win_y,
mask);
found_window = gdk_quartz_device_core_query_state_helper (window, device,
win_x, win_y,
mask);
if (!found_window)
return FALSE;
......@@ -293,21 +293,21 @@ gdk_device_core_query_state (GdkDevice *device,
}
static GdkGrabStatus
gdk_device_core_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_)
gdk_quartz_device_core_grab (GdkDevice *device,
GdkWindow *window,
gboolean owner_events,
GdkEventMask event_mask,
GdkWindow *confine_to,
GdkCursor *cursor,
guint32 time_)
{
/* Should remain empty */
return GDK_GRAB_SUCCESS;
}
static void
gdk_device_core_ungrab (GdkDevice *device,
guint32 time_)
gdk_quartz_device_core_ungrab (GdkDevice *device,
guint32 time_)
{
GdkDeviceGrabInfo *grab;
......@@ -319,11 +319,11 @@ gdk_device_core_ungrab (GdkDevice *device,
}
static GdkWindow *
gdk_device_core_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
gdk_quartz_device_core_window_at_position (GdkDevice *device,
gint *win_x,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel)
{
GdkDisplay *display;
GdkScreen *screen;
......@@ -358,9 +358,9 @@ gdk_device_core_window_at_position (GdkDevice *device,
}
static void
gdk_device_core_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
gdk_quartz_device_core_select_window_events (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask)
{
/* The mask is set in the common code. */
}
......@@ -17,35 +17,35 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GDK_DEVICE_CORE_H__
#define __GDK_DEVICE_CORE_H__
#ifndef __GDK_QUARTZ_DEVICE_CORE_H__
#define __GDK_QUARTZ_DEVICE_CORE_H__
#include <gdk/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))
#define GDK_TYPE_QUARTZ_DEVICE_CORE (gdk_quartz_device_core_get_type ())
#define GDK_QUARTZ_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_QUARTZ_DEVICE_CORE, GdkQuartzDeviceCore))
#define GDK_QUARTZ_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_QUARTZ_DEVICE_CORE, GdkQuartzDeviceCoreClass))
#define GDK_IS_QUARTZ_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_QUARTZ_DEVICE_CORE))
#define GDK_IS_QUARTZ_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_QUARTZ_DEVICE_CORE))
#define GDK_QUARTZ_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_QUARTZ_DEVICE_CORE, GdkQuartzDeviceCoreClass))
typedef struct _GdkDeviceCore GdkDeviceCore;
typedef struct _GdkDeviceCoreClass GdkDeviceCoreClass;
typedef struct _GdkQuartzDeviceCore GdkQuartzDeviceCore;
typedef struct _GdkQuartzDeviceCoreClass GdkQuartzDeviceCoreClass;
struct _GdkDeviceCore
struct _GdkQuartzDeviceCore
{
GdkDevice parent_instance;
};
struct _GdkDeviceCoreClass
struct _GdkQuartzDeviceCoreClass
{
GdkDeviceClass parent_class;
};
GType gdk_device_core_get_type (void) G_GNUC_CONST;
GType gdk_quartz_device_core_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GDK_DEVICE_CORE_H__ */
#endif /* __GDK_QUARTZ_DEVICE_CORE_H__ */
......@@ -22,7 +22,7 @@
#include <gdk/gdktypes.h>
#include <gdk/gdkdevicemanager.h>
#include "gdkdevicemanager-core.h"
#include "gdkdevice-core.h"
#include "gdkdevice-core-quartz.h"
#include "gdkkeysyms.h"
......@@ -55,7 +55,7 @@ static GdkDevice *
create_core_pointer (GdkDeviceManager *device_manager,
GdkDisplay *display)
{
return g_object_new (GDK_TYPE_DEVICE_CORE,
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
......@@ -70,7 +70,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_QUARTZ_DEVICE_CORE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_KEYBOARD,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment