From 37814e480e0545c3186b0c04b9cdbb7e0f9a1b26 Mon Sep 17 00:00:00 2001 From: codereader Date: Tue, 24 Dec 2019 05:08:57 +0100 Subject: [PATCH] Remove remnant Cursor.h/Cursor.cpp from wxutil library --- libs/wxutil/Cursor.cpp | 50 ------------------------------------------ libs/wxutil/Cursor.h | 23 ------------------- 2 files changed, 73 deletions(-) delete mode 100644 libs/wxutil/Cursor.cpp delete mode 100644 libs/wxutil/Cursor.h diff --git a/libs/wxutil/Cursor.cpp b/libs/wxutil/Cursor.cpp deleted file mode 100644 index eb88856536..0000000000 --- a/libs/wxutil/Cursor.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "Cursor.h" - -#ifdef WIN32 -#include -#else -#include -#endif - -namespace gtkutil -{ - -#ifdef WIN32 - -void Cursor::ReadPosition(const Glib::RefPtr& window, int& x, int& y) -{ - POINT pos; - GetCursorPos(&pos); - - ScreenToClient((HWND)GDK_WINDOW_HWND(window->get_window()->gobj()), &pos); - - x = pos.x; - y = pos.y; -} - -void Cursor::SetPosition(const Glib::RefPtr& window, int x, int y) -{ - POINT pos; - pos.x = x; - pos.y = y; - - ClientToScreen((HWND)GDK_WINDOW_HWND(window->get_window()->gobj()), &pos); - - SetCursorPos(pos.x, pos.y); -} - -#else - -void Cursor::ReadPosition(const Glib::RefPtr& window, int& x, int& y) -{ - gdk_display_get_pointer(gdk_display_get_default(), 0, &x, &y, 0); -} - -void Cursor::SetPosition(const Glib::RefPtr& window, int x, int y) -{ - XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, x, y); -} - -#endif - -} // namespace diff --git a/libs/wxutil/Cursor.h b/libs/wxutil/Cursor.h deleted file mode 100644 index 879e2e969b..0000000000 --- a/libs/wxutil/Cursor.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include - -namespace gtkutil -{ - -class Cursor -{ -public: - /** - * Reads the cursor position of the given window and writes the result to x,y. - */ - static void ReadPosition(const Glib::RefPtr& window, int& x, int& y); - - /** - * Sets the cursor position of the given window to x,y. - */ - static void SetPosition(const Glib::RefPtr& window, int x, int y); -}; - -} // namespace