mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 10:23:27 +00:00
huge WIN
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@705 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -59,8 +59,8 @@ typedef unsigned long MwU64;
|
|||||||
#ifdef OTHER_TYPES_DEFINED
|
#ifdef OTHER_TYPES_DEFINED
|
||||||
#undef OTHER_TYPES_DEFINED
|
#undef OTHER_TYPES_DEFINED
|
||||||
#else
|
#else
|
||||||
typedef int MwI32;
|
typedef int MwI32;
|
||||||
typedef unsigned int MwU32;
|
typedef unsigned int MwU32;
|
||||||
|
|
||||||
typedef short MwI16;
|
typedef short MwI16;
|
||||||
typedef unsigned short MwU16;
|
typedef unsigned short MwU16;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
MwLLSetSizeHints = MwLLSetSizeHintsImpl; \
|
MwLLSetSizeHints = MwLLSetSizeHintsImpl; \
|
||||||
MwLLMakeBorderless = MwLLMakeBorderlessImpl; \
|
MwLLMakeBorderless = MwLLMakeBorderlessImpl; \
|
||||||
MwLLMakeToolWindow = MwLLMakeToolWindowImpl; \
|
MwLLMakeToolWindow = MwLLMakeToolWindowImpl; \
|
||||||
MwLLMakePopup = MwLLMakePopupImpl; \
|
MwLLMakePopup = MwLLMakePopupImpl; \
|
||||||
\
|
\
|
||||||
MwLLSetBackground = MwLLSetBackgroundImpl; \
|
MwLLSetBackground = MwLLSetBackgroundImpl; \
|
||||||
\
|
\
|
||||||
|
|||||||
@@ -73,22 +73,17 @@ static void sync_move(MwLL handle, int x, int y) {
|
|||||||
MwLLSetXY(handle, x, y);
|
MwLLSetXY(handle, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wait_map(MwLL handle, int move_back, int nomap) {
|
static void wait_map(MwLL handle) {
|
||||||
XEvent* queue = NULL;
|
XEvent* queue = NULL;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
int x, y;
|
|
||||||
unsigned int w, h;
|
|
||||||
XWindowAttributes xwa;
|
XWindowAttributes xwa;
|
||||||
|
|
||||||
MwLLGetXYWH(handle, &x, &y, &w, &h);
|
|
||||||
|
|
||||||
XGetWindowAttributes(handle->x11.display, handle->x11.window, &xwa);
|
XGetWindowAttributes(handle->x11.display, handle->x11.window, &xwa);
|
||||||
if(xwa.map_state != IsViewable) {
|
if(xwa.map_state != IsViewable) {
|
||||||
if(move_back) MwLLSetXY(handle, x, y);
|
|
||||||
|
|
||||||
XSync(handle->x11.display, False);
|
XSync(handle->x11.display, False);
|
||||||
|
|
||||||
if(!nomap) XMapWindow(handle->x11.display, handle->x11.window);
|
XMapWindow(handle->x11.display, handle->x11.window);
|
||||||
|
|
||||||
XSync(handle->x11.display, False);
|
XSync(handle->x11.display, False);
|
||||||
|
|
||||||
@@ -107,31 +102,6 @@ static void wait_map(MwLL handle, int move_back, int nomap) {
|
|||||||
}
|
}
|
||||||
arrfree(queue);
|
arrfree(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(move_back) MwLLSetXY(handle, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void wait_unmap(MwLL handle) {
|
|
||||||
XEvent* queue = NULL;
|
|
||||||
XEvent ev;
|
|
||||||
|
|
||||||
XUnmapWindow(handle->x11.display, handle->x11.window);
|
|
||||||
XSync(handle->x11.display, False);
|
|
||||||
|
|
||||||
while(1) {
|
|
||||||
XNextEvent(handle->x11.display, &ev);
|
|
||||||
if(ev.type == UnmapNotify && ev.xunmap.window == handle->x11.window) {
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
arrput(queue, ev);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while(arrlen(queue) > 0) {
|
|
||||||
XPutBackEvent(handle->x11.display, &queue[0]);
|
|
||||||
arrdel(queue, 0);
|
|
||||||
}
|
|
||||||
arrfree(queue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned long generate_color(MwLL handle, unsigned long r, unsigned long g, unsigned long b) {
|
static unsigned long generate_color(MwLL handle, unsigned long r, unsigned long g, unsigned long b) {
|
||||||
@@ -245,7 +215,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
|
|||||||
|
|
||||||
XSelectInput(r->x11.display, r->x11.window, mask);
|
XSelectInput(r->x11.display, r->x11.window, mask);
|
||||||
|
|
||||||
wait_map(r, 0, 0);
|
wait_map(r);
|
||||||
|
|
||||||
if(x != MwDEFAULT || y != MwDEFAULT) {
|
if(x != MwDEFAULT || y != MwDEFAULT) {
|
||||||
unsigned int dummy;
|
unsigned int dummy;
|
||||||
@@ -882,11 +852,11 @@ static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
|||||||
|
|
||||||
static void MwLLShowImpl(MwLL handle, int show) {
|
static void MwLLShowImpl(MwLL handle, int show) {
|
||||||
if(show) {
|
if(show) {
|
||||||
wait_map(handle, 0, 0);
|
wait_map(handle);
|
||||||
|
|
||||||
XSetInputFocus(handle->x11.display, handle->x11.window, RevertToNone, CurrentTime);
|
XSetInputFocus(handle->x11.display, handle->x11.window, RevertToNone, CurrentTime);
|
||||||
} else {
|
} else {
|
||||||
wait_unmap(handle);
|
XUnmapWindow(handle->x11.display, handle->x11.window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -902,11 +872,8 @@ static void MwLLMakePopupImpl(MwLL handle, MwLL parent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx, int maxy) {
|
static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx, int maxy) {
|
||||||
XSizeHints* hints = XAllocSizeHints();
|
XSizeHints* hints = XAllocSizeHints();
|
||||||
long ret;
|
long ret;
|
||||||
XWindowAttributes xwa;
|
|
||||||
|
|
||||||
XGetWindowAttributes(handle->x11.display, handle->x11.window, &xwa);
|
|
||||||
|
|
||||||
XGetWMSizeHints(handle->x11.display, handle->x11.window, hints, &ret, XA_WM_NORMAL_HINTS);
|
XGetWMSizeHints(handle->x11.display, handle->x11.window, hints, &ret, XA_WM_NORMAL_HINTS);
|
||||||
|
|
||||||
@@ -917,11 +884,6 @@ static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx, int
|
|||||||
hints->max_height = maxy;
|
hints->max_height = maxy;
|
||||||
XSetWMSizeHints(handle->x11.display, handle->x11.window, hints, XA_WM_NORMAL_HINTS);
|
XSetWMSizeHints(handle->x11.display, handle->x11.window, hints, XA_WM_NORMAL_HINTS);
|
||||||
XFree(hints);
|
XFree(hints);
|
||||||
|
|
||||||
if(xwa.map_state == IsViewable) {
|
|
||||||
wait_unmap(handle);
|
|
||||||
wait_map(handle, 1, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLMakeBorderlessImpl(MwLL handle, int toggle) {
|
static void MwLLMakeBorderlessImpl(MwLL handle, int toggle) {
|
||||||
|
|||||||
@@ -90,8 +90,7 @@ static int create(MwWidget handle) {
|
|||||||
attribs[3] = 24;
|
attribs[3] = 24;
|
||||||
attribs[4] = None;
|
attribs[4] = None;
|
||||||
|
|
||||||
while(glpath[glincr] != NULL && (o->lib = MwDynamicOpen(glpath[glincr++])) == NULL)
|
while(glpath[glincr] != NULL && (o->lib = MwDynamicOpen(glpath[glincr++])) == NULL);
|
||||||
;
|
|
||||||
|
|
||||||
o->glXChooseVisual = (MWglXChooseVisual)MwDynamicSymbol(o->lib, "glXChooseVisual");
|
o->glXChooseVisual = (MWglXChooseVisual)MwDynamicSymbol(o->lib, "glXChooseVisual");
|
||||||
o->glXCreateContext = (MWglXCreateContext)MwDynamicSymbol(o->lib, "glXCreateContext");
|
o->glXCreateContext = (MWglXCreateContext)MwDynamicSymbol(o->lib, "glXCreateContext");
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ static void draw(MwWidget handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_move(MwWidget handle) {
|
static void mouse_move(MwWidget handle) {
|
||||||
int or = MwGetInteger(handle, MwNorientation);
|
int or = MwGetInteger(handle, MwNorientation);
|
||||||
scrollbar_t* scr = handle->internal;
|
scrollbar_t* scr = handle->internal;
|
||||||
|
|
||||||
if(!handle->pressed) return;
|
if(!handle->pressed) return;
|
||||||
@@ -158,9 +158,9 @@ static void mouse_move(MwWidget handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_down(MwWidget handle, void* ptr) {
|
static void mouse_down(MwWidget handle, void* ptr) {
|
||||||
int ww = MwGetInteger(handle, MwNwidth);
|
int ww = MwGetInteger(handle, MwNwidth);
|
||||||
int wh = MwGetInteger(handle, MwNheight);
|
int wh = MwGetInteger(handle, MwNheight);
|
||||||
int or = MwGetInteger(handle, MwNorientation);
|
int or = MwGetInteger(handle, MwNorientation);
|
||||||
scrollbar_t* scr = handle->internal;
|
scrollbar_t* scr = handle->internal;
|
||||||
MwLLMouse* m = ptr;
|
MwLLMouse* m = ptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user