mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-09 19:03:29 +00:00
abstract
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@604 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/* $Id$ */
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
typedef struct userdata {
|
||||
MwLL ll;
|
||||
POINT min;
|
||||
@@ -201,7 +203,7 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
} else if(msg == WM_SETCURSOR) {
|
||||
if(LOWORD(lp) != HTCLIENT) return DefWindowProc(hWnd, msg, wp, lp);
|
||||
if(u->ll->cursor != NULL) SetCursor(u->ll->cursor);
|
||||
}else if(msg == WM_USER){
|
||||
} else if(msg == WM_USER) {
|
||||
InvalidateRect(hWnd, NULL, FALSE);
|
||||
UpdateWindow(hWnd);
|
||||
} else {
|
||||
@@ -390,10 +392,6 @@ void MwLLNextEvent(MwLL handle) {
|
||||
}
|
||||
}
|
||||
|
||||
void MwLLSleep(int ms) {
|
||||
Sleep(ms);
|
||||
}
|
||||
|
||||
MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int height) {
|
||||
MwLLPixmap r = malloc(sizeof(*r));
|
||||
HDC dc = GetDC(handle->hWnd);
|
||||
@@ -628,10 +626,6 @@ void MwLLMakeBorderless(MwLL handle, int toggle) {
|
||||
SetWindowPos(handle->hWnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
||||
|
||||
long MwLLGetTick(void) {
|
||||
return GetTickCount();
|
||||
}
|
||||
|
||||
void MwLLFocus(MwLL handle) {
|
||||
SetFocus(handle->hWnd);
|
||||
}
|
||||
|
||||
@@ -417,15 +417,6 @@ void MwLLNextEvent(MwLL handle) {
|
||||
}
|
||||
}
|
||||
|
||||
void MwLLSleep(int ms) {
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = ms / 1000;
|
||||
ts.tv_nsec = (ms % 1000) * 1000 * 1000;
|
||||
|
||||
nanosleep(&ts, NULL);
|
||||
}
|
||||
|
||||
void MwLLSetTitle(MwLL handle, const char* title) {
|
||||
XSetStandardProperties(handle->display, handle->window, title, title, None, (char**)NULL, 0, NULL);
|
||||
}
|
||||
@@ -757,18 +748,6 @@ void MwLLMakeBorderless(MwLL handle, int toggle) {
|
||||
wait_map(handle);
|
||||
}
|
||||
|
||||
long MwLLGetTick(void) {
|
||||
struct timespec ts;
|
||||
long n = 0;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
||||
n += ts.tv_nsec / 1000 / 1000;
|
||||
n += ts.tv_sec * 1000;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
void MwLLFocus(MwLL handle) {
|
||||
XSetInputFocus(handle->display, handle->window, RevertToNone, CurrentTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user