mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-07 09:59:45 +00:00
stuff
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@400 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
26
src/core.c
26
src/core.c
@@ -90,6 +90,18 @@ static void llkeyrelhandler(MwLL handle, void* data) {
|
||||
MwDispatchUserHandler(h, MwNkeyReleaseHandler, data);
|
||||
}
|
||||
|
||||
static void llfocusinhandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
|
||||
MwDispatchUserHandler(h, MwNfocusInHandler, data);
|
||||
}
|
||||
|
||||
static void llfocusouthandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->user;
|
||||
|
||||
MwDispatchUserHandler(h, MwNfocusOutHandler, data);
|
||||
}
|
||||
|
||||
MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) {
|
||||
MwWidget h = malloc(sizeof(*h));
|
||||
|
||||
@@ -127,6 +139,8 @@ MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent,
|
||||
h->lowlevel->handler->move = llmovehandler;
|
||||
h->lowlevel->handler->key = llkeyhandler;
|
||||
h->lowlevel->handler->key_released = llkeyrelhandler;
|
||||
h->lowlevel->handler->focus_in = llfocusinhandler;
|
||||
h->lowlevel->handler->focus_out = llfocusouthandler;
|
||||
}
|
||||
|
||||
if(parent != NULL) arrput(parent->children, h);
|
||||
@@ -400,6 +414,10 @@ void MwSetDefault(MwWidget handle) {
|
||||
inherit_text(handle, MwNforeground, MwDefaultForeground);
|
||||
}
|
||||
|
||||
void MwHideCursor(MwWidget handle){
|
||||
MwLLSetCursor(handle->lowlevel, &MwCursorHidden, &MwCursorHiddenMask);
|
||||
}
|
||||
|
||||
void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data) {
|
||||
int ind = shgeti(handle->handler, key);
|
||||
if(ind == -1) return;
|
||||
@@ -459,3 +477,11 @@ void MwAddTickList(MwWidget handle) {
|
||||
|
||||
arrput(root->tick_list, handle);
|
||||
}
|
||||
|
||||
void MwFocus(MwWidget handle){
|
||||
MwLLFocus(handle->lowlevel);
|
||||
}
|
||||
|
||||
void MwGrabPointer(MwWidget handle, int toggle){
|
||||
MwLLGrabPointer(handle->lowlevel, toggle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user