[gtk+] GDK: Make sure W32 backend compiles without GdkDeviceManager
- From: Руслан Ижбулатов <ruslanizhb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GDK: Make sure W32 backend compiles without GdkDeviceManager
- Date: Sat, 2 Dec 2017 11:22:52 +0000 (UTC)
commit c7bdf643c5564e7b3cc21c2dfc86e4c889839cdf
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Thu Nov 30 05:38:20 2017 +0000
GDK: Make sure W32 backend compiles without GdkDeviceManager
https://bugzilla.gnome.org/show_bug.cgi?id=773299
docs/reference/gdk/meson.build | 1 -
gdk/win32/gdkdevicemanager-win32.c | 18 +++++++-----------
gdk/win32/gdkdevicemanager-win32.h | 2 --
gdk/win32/gdkdisplay-win32.c | 2 +-
gdk/win32/gdkevents-win32.c | 10 +++++-----
gdk/win32/gdkglobals-win32.c | 2 +-
gdk/win32/gdkprivate-win32.h | 3 ++-
7 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build
index a6b0724..0e6d8ff 100644
--- a/docs/reference/gdk/meson.build
+++ b/docs/reference/gdk/meson.build
@@ -7,7 +7,6 @@ private_headers = [
'gdk-private.h',
'gdkapplaunchcontextprivate.h',
'gdkcursorprivate.h',
- 'gdkdevicemanagerprivate.h',
'gdkdeviceprivate.h',
'gdkdisplaymanagerprivate.h',
'gdkdisplayprivate.h',
diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c
index b716eb1..18e12e5 100644
--- a/gdk/win32/gdkdevicemanager-win32.c
+++ b/gdk/win32/gdkdevicemanager-win32.c
@@ -71,7 +71,7 @@ static gboolean default_display_opened = FALSE;
G_DEFINE_TYPE (GdkDeviceManagerWin32, gdk_device_manager_win32, G_TYPE_OBJECT)
static GdkDevice *
-create_pointer (GdkDeviceManager *device_manager,
+create_pointer (GdkDeviceManagerWin32 *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
@@ -83,12 +83,11 @@ create_pointer (GdkDeviceManager *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"display", _gdk_display,
- "device-manager", device_manager,
NULL);
}
static GdkDevice *
-create_keyboard (GdkDeviceManager *device_manager,
+create_keyboard (GdkDeviceManagerWin32 *device_manager,
GType g_type,
const char *name,
GdkDeviceType type)
@@ -100,7 +99,6 @@ create_keyboard (GdkDeviceManager *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", _gdk_display,
- "device-manager", device_manager,
NULL);
}
@@ -352,7 +350,7 @@ print_cursor (int index)
static void
wintab_init_check (GdkDeviceManagerWin32 *device_manager)
{
- GdkDisplay *display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager));
+ GdkDisplay *display = device_manager->display;
static gboolean wintab_initialized = FALSE;
GdkDeviceWintab *device;
WORD specversion;
@@ -564,7 +562,6 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
"input-mode", GDK_MODE_SCREEN,
"has-cursor", lc.lcOptions & CXO_SYSTEM,
"display", display,
- "device-manager", device_manager,
NULL);
device->sends_core = lc.lcOptions & CXO_SYSTEM;
@@ -701,12 +698,12 @@ gdk_device_manager_win32_constructed (GObject *object)
device_manager = GDK_DEVICE_MANAGER_WIN32 (object);
device_manager->core_pointer =
- create_pointer (GDK_DEVICE_MANAGER (device_manager),
+ create_pointer (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Pointer",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_pointer =
- create_pointer (GDK_DEVICE_MANAGER (device_manager),
+ create_pointer (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Pointer",
GDK_DEVICE_TYPE_SLAVE);
@@ -716,12 +713,12 @@ gdk_device_manager_win32_constructed (GObject *object)
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
device_manager->core_keyboard =
- create_keyboard (GDK_DEVICE_MANAGER (device_manager),
+ create_keyboard (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Keyboard",
GDK_DEVICE_TYPE_MASTER);
device_manager->system_keyboard =
- create_keyboard (GDK_DEVICE_MANAGER (device_manager),
+ create_keyboard (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Keyboard",
GDK_DEVICE_TYPE_SLAVE);
@@ -757,7 +754,6 @@ gdk_device_manager_win32_constructed (GObject *object)
static void
gdk_device_manager_win32_class_init (GdkDeviceManagerWin32Class *klass)
{
- GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gdk_device_manager_win32_finalize;
diff --git a/gdk/win32/gdkdevicemanager-win32.h b/gdk/win32/gdkdevicemanager-win32.h
index eb6caa1..ab82bba 100644
--- a/gdk/win32/gdkdevicemanager-win32.h
+++ b/gdk/win32/gdkdevicemanager-win32.h
@@ -18,8 +18,6 @@
#ifndef __GDK_DEVICE_MANAGER_WIN32_H__
#define __GDK_DEVICE_MANAGER_WIN32_H__
-#include <gdk/gdkdevicemanagerprivate.h>
-
G_BEGIN_DECLS
#define GDK_TYPE_DEVICE_MANAGER_WIN32 (gdk_device_manager_win32_get_type ())
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 0753d5f..0072014 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -447,8 +447,8 @@ _gdk_win32_display_open (const gchar *display_name)
_gdk_input_ignore_core = FALSE;
_gdk_device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32,
- "display", _gdk_display,
NULL);
+ _gdk_device_manager->display = _gdk_display;
_gdk_dnd_init ();
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 3bebec9..75fe164 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -179,7 +179,7 @@ _gdk_win32_get_next_tick (gulong suggested_tick)
}
static void
-generate_focus_event (GdkDeviceManager *device_manager,
+generate_focus_event (GdkDeviceManagerWin32 *device_manager,
GdkWindow *window,
gboolean in)
{
@@ -201,7 +201,7 @@ generate_focus_event (GdkDeviceManager *device_manager,
}
static void
-generate_grab_broken_event (GdkDeviceManager *device_manager,
+generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager,
GdkWindow *window,
gboolean keyboard,
GdkWindow *grab_window)
@@ -1107,7 +1107,7 @@ send_crossing_event (GdkDisplay *display,
POINT pt;
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
- device_manager = GDK_DEVICE_MANAGER_WIN32 (_gdk_device_manager);_gdk_device_manager);
+ device_manager = _gdk_device_manager;
grab = _gdk_display_has_device_grab (display, device_manager->core_pointer, 0);
@@ -3009,7 +3009,7 @@ gdk_event_translate (MSG *msg,
if (keyboard_grab != NULL &&
!GDK_WINDOW_DESTROYED (keyboard_grab->window))
{
- generate_grab_broken_event (device_manager, keyboard_grab->window, TRUE, NULL);
+ generate_grab_broken_event (_gdk_device_manager, keyboard_grab->window, TRUE, NULL);
}
/* fallthrough */
@@ -3024,7 +3024,7 @@ gdk_event_translate (MSG *msg,
if (GDK_WINDOW_DESTROYED (window))
break;
- generate_focus_event (device_manager, window, (msg->message == WM_SETFOCUS));
+ generate_focus_event (_gdk_device_manager, window, (msg->message == WM_SETFOCUS));
return_val = TRUE;
break;
diff --git a/gdk/win32/gdkglobals-win32.c b/gdk/win32/gdkglobals-win32.c
index 6882786..0af85d6 100644
--- a/gdk/win32/gdkglobals-win32.c
+++ b/gdk/win32/gdkglobals-win32.c
@@ -28,7 +28,7 @@
#include "gdkprivate-win32.h"
GdkDisplay *_gdk_display = NULL;
-GdkDeviceManager *_gdk_device_manager = NULL;
+GdkDeviceManagerWin32 *_gdk_device_manager = NULL;
gint _gdk_offset_x, _gdk_offset_y;
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index d7c0722..ccfc601 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -39,6 +39,7 @@
#include <gdk/win32/gdkwin32display.h>
#include <gdk/win32/gdkwin32screen.h>
#include <gdk/win32/gdkwin32keys.h>
+#include <gdk/win32/gdkdevicemanager-win32.h>
#include "gdkinternals.h"
@@ -259,7 +260,7 @@ extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM)
extern GdkDisplay *_gdk_display;
-extern GdkDeviceManager *_gdk_device_manager;
+extern GdkDeviceManagerWin32 *_gdk_device_manager;
/* Offsets to add to Windows coordinates (which are relative to the
* primary monitor's origin, and thus might be negative for monitors
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]