mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 18:33:30 +00:00
add get screen size
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@825 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -330,6 +330,13 @@ MWDECL MwWidget* MwGetChildren(MwWidget handle);
|
||||
*/
|
||||
MWDECL void MwGetCursorCoord(MwWidget handle, MwPoint* point);
|
||||
|
||||
/*!
|
||||
* @brief Gets the screen size
|
||||
* @param handle Widget
|
||||
* @param rect Rectangle
|
||||
*/
|
||||
MWDECL void MwGetScreenSize(MwWidget handle, MwRect* rect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -193,6 +193,7 @@ MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text);
|
||||
MWDECL char* (*MwLLGetClipboard)(MwLL handle);
|
||||
|
||||
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
||||
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
MwLLGetClipboard = MwLLGetClipboardImpl; \
|
||||
\
|
||||
MwLLGetCursorCoord = MwLLGetCursorCoordImpl; \
|
||||
MwLLGetScreenSize = MwLLGetScreenSizeImpl; \
|
||||
\
|
||||
return 0; \
|
||||
}
|
||||
|
||||
@@ -727,6 +727,15 @@ static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) {
|
||||
point->y = p.y;
|
||||
}
|
||||
|
||||
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
||||
RECT rc;
|
||||
GetClientRect(GetDesktopWindow(), &rc);
|
||||
|
||||
rect->x = rect->y = 0;
|
||||
rect->width = rc.right - rc.left;
|
||||
rect->height = rc.bottom - rc.top;
|
||||
}
|
||||
|
||||
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
@@ -1001,6 +1001,15 @@ static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) {
|
||||
point->y = ry;
|
||||
}
|
||||
|
||||
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
||||
XWindowAttributes xwa;
|
||||
XGetWindowAttributes(handle->x11.display, handle->x11.window, &xwa);
|
||||
|
||||
rect->x = rect->y = 0;
|
||||
rect->width = xwa.width;
|
||||
rect->height = xwa.height;
|
||||
}
|
||||
|
||||
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
||||
MwLLShow(handle, 0);
|
||||
}
|
||||
|
||||
@@ -738,3 +738,7 @@ MwWidget* MwGetChildren(MwWidget handle) {
|
||||
void MwGetCursorCoord(MwWidget handle, MwPoint* point) {
|
||||
MwLLGetCursorCoord(handle->lowlevel, point);
|
||||
}
|
||||
|
||||
void MwGetScreenSize(MwWidget handle, MwRect* rect) {
|
||||
MwLLGetScreenSize(handle->lowlevel, rect);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ void (*MwLLSetClipboard)(MwLL handle, const char* text);
|
||||
char* (*MwLLGetClipboard)(MwLL handle);
|
||||
|
||||
void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
||||
void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
||||
|
||||
void MwLLCreateCommon(MwLL handle) {
|
||||
handle->common.handler = malloc(sizeof(*handle->common.handler));
|
||||
|
||||
Reference in New Issue
Block a user