mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 02:13:29 +00:00
better api for mouse
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@269 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
34
src/core.c
34
src/core.c
@@ -12,28 +12,26 @@ static void lldrawhandler(MwLL handle, void* data) {
|
||||
}
|
||||
|
||||
static void lluphandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
MwPoint* p = data;
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
MwLLMouse* p = data;
|
||||
|
||||
(void)data;
|
||||
if(p->button == MwLLMouseLeft) h->pressed = 0;
|
||||
h->mouse_point.x = p->point.x;
|
||||
h->mouse_point.y = p->point.y;
|
||||
|
||||
h->pressed = 0;
|
||||
h->mouse_point.x = p->x;
|
||||
h->mouse_point.y = p->y;
|
||||
|
||||
MwDispatch(h, click);
|
||||
MwDispatch(h, mouse_up);
|
||||
if(p->button == MwLLMouseLeft) MwDispatch(h, click);
|
||||
MwDispatch3(h, mouse_up, data);
|
||||
MwDispatchUserHandler(h, MwNmouseUpHandler, data);
|
||||
}
|
||||
|
||||
static void lldownhandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
MwPoint* p = data;
|
||||
h->pressed = 1;
|
||||
h->mouse_point.x = p->x;
|
||||
h->mouse_point.y = p->y;
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
MwLLMouse* p = data;
|
||||
if(p->button == MwLLMouseLeft) h->pressed = 1;
|
||||
h->mouse_point.x = p->point.x;
|
||||
h->mouse_point.y = p->point.y;
|
||||
|
||||
MwDispatch(h, mouse_down);
|
||||
MwDispatch3(h, mouse_down, data);
|
||||
MwDispatchUserHandler(h, MwNmouseDownHandler, data);
|
||||
}
|
||||
|
||||
@@ -384,3 +382,9 @@ void MwGetBeforeStep(MwWidget handle, jmp_buf* jmpbuf) {
|
||||
void MwForceRender(MwWidget handle) {
|
||||
MwLLForceRender(handle->lowlevel);
|
||||
}
|
||||
|
||||
void MwForceRender2(MwWidget handle, void* ptr) {
|
||||
(void)ptr;
|
||||
|
||||
MwForceRender(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user