mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
Fixed CI build
This commit is contained in:
parent
481fbb72a5
commit
caf3fbb982
@ -1,8 +1,8 @@
|
||||
#if defined(IS_WINDOWS)
|
||||
bool CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
|
||||
BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) {
|
||||
uint32_t *count = (uint32_t*)dwData;
|
||||
(*count)++;
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct{
|
||||
|
@ -52,7 +52,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id)
|
||||
#elif defined(USE_X11)
|
||||
MMBitmapRef bitmap;
|
||||
Display *display;
|
||||
if display_id == -1 {
|
||||
if (display_id == -1) {
|
||||
display = XOpenDisplay(NULL);
|
||||
} else {
|
||||
display = XGetMainDisplay();
|
||||
@ -92,7 +92,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id)
|
||||
bi.bmiHeader.biClrUsed = 0;
|
||||
bi.bmiHeader.biClrImportant = 0;
|
||||
|
||||
if display_id == -1 {
|
||||
if (display_id == -1) {
|
||||
screen = GetDC(NULL); /* Get entire screen */
|
||||
} else {
|
||||
screen = GetDC((HWND) display_id);
|
||||
|
21
window/pub.h
21
window/pub.h
@ -9,10 +9,15 @@
|
||||
// except according to those terms.
|
||||
|
||||
// #include "../base/os.h"
|
||||
#if defined(IS_MACOSX)
|
||||
#include <dlfcn.h>
|
||||
#elif defined(USE_X11)
|
||||
#include <X11/Xatom.h>
|
||||
#endif
|
||||
|
||||
#ifdef RobotGo_64
|
||||
typedef int64 intptr;
|
||||
typedef uint64 uintptr;
|
||||
typedef int64_t intptr;
|
||||
typedef uint64_t uintptr;
|
||||
#else
|
||||
typedef int32_t intptr;
|
||||
typedef uint32_t uintptr; // Unsigned pointer integer
|
||||
@ -177,7 +182,7 @@ typedef struct _Bounds Bounds;
|
||||
}
|
||||
|
||||
// Functions
|
||||
static void* GetWindowProperty(MData win, Atom atom, uint32* items) {
|
||||
static void* GetWindowProperty(MData win, Atom atom, uint32_t* items) {
|
||||
// Property variables
|
||||
Atom type; int format;
|
||||
unsigned long nItems;
|
||||
@ -253,15 +258,15 @@ typedef struct _Bounds Bounds;
|
||||
Bounds frame;
|
||||
// Retrieve frame bounds
|
||||
if (WM_EXTENTS != None) {
|
||||
long* result; uint32 nItems = 0;
|
||||
long* result; uint32_t nItems = 0;
|
||||
// Get the window extents property
|
||||
result = (long*) GetWindowProperty(win, WM_EXTENTS, &nItems);
|
||||
if (result != NULL) {
|
||||
if (nItems == 4) {
|
||||
frame.X = (int32) result[0];
|
||||
frame.Y = (int32) result[2];
|
||||
frame.W = (int32) result[0] + (int32) result[1];
|
||||
frame.H = (int32) result[2] + (int32) result[3];
|
||||
frame.X = (int32_t) result[0];
|
||||
frame.Y = (int32_t) result[2];
|
||||
frame.W = (int32_t) result[0] + (int32_t) result[1];
|
||||
frame.H = (int32_t) result[2] + (int32_t) result[3];
|
||||
}
|
||||
|
||||
XFree(result);
|
||||
|
@ -164,7 +164,7 @@ Bounds get_bounds(uintptr pid, uintptr isHwnd){
|
||||
#endif
|
||||
}
|
||||
|
||||
Bounds get_client(uintptr pid, uintptr isHwnd){
|
||||
Bounds get_client(uintptr pid, uintptr isHwnd) {
|
||||
// Check if the window is valid
|
||||
Bounds bounds;
|
||||
if (!IsValid()) { return bounds; }
|
||||
@ -183,7 +183,7 @@ Bounds get_client(uintptr pid, uintptr isHwnd){
|
||||
Window root, parent;
|
||||
Window* children;
|
||||
unsigned int count;
|
||||
int32 x = 0, y = 0;
|
||||
int32_t x = 0, y = 0;
|
||||
|
||||
// Check if the window is the root
|
||||
XQueryTree(rDisplay, win.XWin,
|
||||
|
@ -10,9 +10,6 @@
|
||||
|
||||
// #include "../base/os.h"
|
||||
#include "pub.h"
|
||||
#if defined(IS_MACOSX)
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
bool setHandle(uintptr handle);
|
||||
bool IsValid();
|
||||
@ -447,7 +444,7 @@ MData GetActive(void) {
|
||||
// Attempt to get the foreground window multiple times in case
|
||||
MData result;
|
||||
|
||||
uint8 times = 0;
|
||||
uint8_t times = 0;
|
||||
while (++times < 20) {
|
||||
HWND handle;
|
||||
handle = GetForegroundWindow();
|
||||
@ -626,7 +623,7 @@ int32_t WGetPID(void) {
|
||||
// Check result and convert it
|
||||
if (result == NULL) { return 0; }
|
||||
|
||||
int32 pid = (int32) *result;
|
||||
int32_t pid = (int32_t) *result;
|
||||
XFree(result);
|
||||
return pid;
|
||||
#elif defined(IS_WINDOWS)
|
||||
|
Loading…
Reference in New Issue
Block a user