mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
SysInfo: Added by default NO_XTEST flag to avoid problems with old CentOS version
git-svn-id: svn://ultimatepp.org/upp/trunk@8851 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
45fccc4849
commit
bdbe1bd2f7
5 changed files with 20 additions and 11 deletions
|
|
@ -74,9 +74,6 @@ int Window_GetStatus(int64 windowId);
|
|||
/////////////////////////////////////////////////////////////////////
|
||||
// Process list
|
||||
bool GetProcessList(Upp::Array<int64> &pid, Upp::Array<String> &pNames);
|
||||
#if defined(PLATFORM_WIN32)
|
||||
Upp::Array<int64> GetChildProcessList(int64 processID);
|
||||
#endif
|
||||
Upp::Array<int64> 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);
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
#include <X11/Xfuncs.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#ifdef flagXTEST // XTEST is not available by default, add compilation flag to include it
|
||||
#ifndef flagNO_XTEST
|
||||
#include <X11/extensions/XTest.h>
|
||||
#endif
|
||||
#include <X11/XKBlib.h>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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; &]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue