From 37e45d85c572c8f373e5a37a7080f4b71ce128ee Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 23 Mar 2017 12:47:09 -0400 Subject: reneame --- tkmacosx/xxlib.c | 32 -------------------------------- tkmacosx/xxlib.mm | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 tkmacosx/xxlib.c create mode 100644 tkmacosx/xxlib.mm diff --git a/tkmacosx/xxlib.c b/tkmacosx/xxlib.c deleted file mode 100644 index 412c56c..0000000 --- a/tkmacosx/xxlib.c +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 1999-2016 -// Smithsonian Astrophysical Observatory, Cambridge, MA, USA -// For conditions of distribution and use, see copyright notice in "copyright" - -#include -#include -#include -using namespace std; - -#include - -void XXWarpPointer(Display* display, Window src_w, Window dest_w, - int src_x, int src_y, - unsigned int src_width, unsigned int src_height, - int dest_x, int dest_y) -{ - int xx, yy; - if (dest_w) - Tk_GetRootCoords(Tk_IdToWindow(display,dest_w), &xx, &yy); - else - XQueryPointer(display, dest_w, NULL, NULL, &xx, &yy, NULL, NULL, NULL); - - CGPoint pt; - pt.x = xx+dest_x; - pt.y = yy+dest_y; - - CGEventSourceRef src = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); - CGEventRef ev = CGEventCreateMouseEvent(src,kCGEventMouseMoved,pt,kCGMouseButtonLeft); - CGEventPost(kCGSessionEventTap,ev); - CFRelease(ev); - CFRelease(src); -} diff --git a/tkmacosx/xxlib.mm b/tkmacosx/xxlib.mm new file mode 100644 index 0000000..412c56c --- /dev/null +++ b/tkmacosx/xxlib.mm @@ -0,0 +1,32 @@ +// Copyright (C) 1999-2016 +// Smithsonian Astrophysical Observatory, Cambridge, MA, USA +// For conditions of distribution and use, see copyright notice in "copyright" + +#include +#include +#include +using namespace std; + +#include + +void XXWarpPointer(Display* display, Window src_w, Window dest_w, + int src_x, int src_y, + unsigned int src_width, unsigned int src_height, + int dest_x, int dest_y) +{ + int xx, yy; + if (dest_w) + Tk_GetRootCoords(Tk_IdToWindow(display,dest_w), &xx, &yy); + else + XQueryPointer(display, dest_w, NULL, NULL, &xx, &yy, NULL, NULL, NULL); + + CGPoint pt; + pt.x = xx+dest_x; + pt.y = yy+dest_y; + + CGEventSourceRef src = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); + CGEventRef ev = CGEventCreateMouseEvent(src,kCGEventMouseMoved,pt,kCGMouseButtonLeft); + CGEventPost(kCGSessionEventTap,ev); + CFRelease(ev); + CFRelease(src); +} -- cgit v0.12