diff --git a/bazaar/SysInfo/SysInfo.h b/bazaar/SysInfo/SysInfo.h index a4d0bd5ac..ab94c8170 100644 --- a/bazaar/SysInfo/SysInfo.h +++ b/bazaar/SysInfo/SysInfo.h @@ -74,9 +74,6 @@ int Window_GetStatus(int64 windowId); ///////////////////////////////////////////////////////////////////// // Process list bool GetProcessList(Upp::Array &pid, Upp::Array &pNames); -#if defined(PLATFORM_WIN32) -Upp::Array GetChildProcessList(int64 processID); -#endif Upp::Array GetProcessList(); String GetProcessName(int64 pid); String GetProcessFileName(int64 processID); @@ -130,6 +127,7 @@ bool CloseCDTray(String drive); bool Mouse_GetPos(long &x, long &y); bool Mouse_SetPos(long x, long y, int64 windowId = 0); +#if defined(PLATFORM_WIN32) || !defined(flagNO_XTEST) void Mouse_LeftClick(); void Mouse_LeftDown(); void Mouse_LeftUp(); @@ -144,6 +142,7 @@ void Mouse_MiddleDblClick(); void Mouse_RightDblClick(); void Keyb_SendKeys(String text, long finalDelay = 100, long delayBetweenKeys = 50); +#endif bool Window_SaveCapture(int64 windowId, String fileName, int left = -1, int top = -1, int width = -1, int height = -1); Image Window_SaveCapture(int64 windowId, int left = -1, int top = -1, int width = -1, int height = -1); diff --git a/bazaar/SysInfo/SysInfo.upp b/bazaar/SysInfo/SysInfo.upp index 2d9966722..132d1cdf9 100644 --- a/bazaar/SysInfo/SysInfo.upp +++ b/bazaar/SysInfo/SysInfo.upp @@ -8,7 +8,7 @@ library(WIN32) "ws2_32 psapi gdi32 vfw32 oleaut32 iphlpapi PowrProf netapi32 wbe library(POSIX | LINUX | FREEBSD) X11; -library(XTEST) Xtst; +library(!NO_XTEST) Xtst; options(MSC) "/D PSAPI_VERSION=1"; diff --git a/bazaar/SysInfo/SysInfo_in.h b/bazaar/SysInfo/SysInfo_in.h index 0f9c38256..04243956c 100644 --- a/bazaar/SysInfo/SysInfo_in.h +++ b/bazaar/SysInfo/SysInfo_in.h @@ -48,7 +48,7 @@ #include #include #include -#ifdef flagXTEST // XTEST is not available by default, add compilation flag to include it +#ifndef flagNO_XTEST #include #endif #include diff --git a/bazaar/SysInfo/mousekey.cpp b/bazaar/SysInfo/mousekey.cpp index 9852e2cda..25dd74bc6 100644 --- a/bazaar/SysInfo/mousekey.cpp +++ b/bazaar/SysInfo/mousekey.cpp @@ -1,7 +1,5 @@ #include "SysInfo_in.h" -#ifdef flagXTEST - NAMESPACE_UPP struct KeyCodes { @@ -268,8 +266,9 @@ bool Mouse_SetPos(long x, long y, int64 windowId) { return true; } -#ifdef flagXTEST // libxtst-dev +#if !defined(flagNO_XTEST) + void Mouse_FakeClick(int button, int press) { _XDisplay *dpy = XOpenDisplay(NULL); XTestFakeButtonEvent(dpy, button, press, CurrentTime); @@ -349,6 +348,8 @@ void PressKey(wchar key, _XDisplay *dpy = NULL) { } } +#endif + bool GetKeyLockStatus0(bool &caps, bool &num, bool &scroll, _XDisplay *dpy) { int x, y, xx, yy; Window dm1, dm2; @@ -378,6 +379,8 @@ bool GetKeyLockStatus(bool &caps, bool &num, bool &scroll) { return true; } +#if !defined(flagNO_XTEST) + bool SetKeyLockStatus(bool caps, bool num, bool scroll) { _XDisplay *dpy; if (!(dpy = XOpenDisplay(NULL))) @@ -434,11 +437,12 @@ KeyCodes keyCodes[] = { "CAPSLOCK", XK_Caps_Lock, "BACKSPACE",XK_BackSpace, "" }; - #endif #endif +#if defined(PLATFORM_WIN32) || !defined(flagNO_XTEST) + void Mouse_LeftClick() { Mouse_LeftDown(); @@ -522,6 +526,6 @@ void Keyb_SendKeys(String text, long finalDelay, long delayBetweenKeys) Sleep(finalDelay); } -END_UPP_NAMESPACE - #endif + +END_UPP_NAMESPACE \ No newline at end of file diff --git a/bazaar/SysInfo/srcimp.tpp/SysInfo$en-us.tpp b/bazaar/SysInfo/srcimp.tpp/SysInfo$en-us.tpp index 6717888f7..a0776ceb0 100644 --- a/bazaar/SysInfo/srcimp.tpp/SysInfo$en-us.tpp +++ b/bazaar/SysInfo/srcimp.tpp/SysInfo$en-us.tpp @@ -51,6 +51,12 @@ so in case of problems in Ubuntu go to terminal and run this:&] [s0; [C sudo apt`-get install libxtst`-dev]&] [s0; &] [s0; &] +[s0; In any case to avoid compiling problems the flag set by default +is NO`_XTEST that avoids the using of fake mouse and keyboard +functions. After installing package XTest, NO`_XTEST can be removed +to use all functions.&] +[s0; &] +[s0; &] [s0; To have CPU temperature it is necessary to install [* acpi] or [* lm`-sensors.]&] [s0; &]