This commit is contained in:
Nishi 2025-12-31 04:29:27 +09:00
commit d3147ac087
Signed by: nishi
GPG key ID: 27EF69B208EB9343
24 changed files with 80 additions and 80 deletions

View file

@ -197,26 +197,26 @@ struct _MwListBoxPacket {
}; };
struct _MwClass { struct _MwClass {
MwHandlerWithStatus create; MwHandlerWithStatus create;
MwHandler destroy; MwHandler destroy;
MwHandler draw; MwHandler draw;
MwHandler click; MwHandler click;
MwHandler parent_resize; MwHandler parent_resize;
MwHandlerProp prop_change; MwHandlerProp prop_change;
MwHandler mouse_move; MwHandler mouse_move;
MwHandlerMouse mouse_up; MwHandlerMouse mouse_up;
MwHandlerMouse mouse_down; MwHandlerMouse mouse_down;
MwHandlerKey key; MwHandlerKey key;
MwHandlerExecute execute; MwHandlerExecute execute;
MwHandler tick; MwHandler tick;
MwHandler resize; MwHandler resize;
MwHandler children_update; MwHandler children_update;
MwHandlerChildrenProp children_prop_change; MwHandlerChildrenProp children_prop_change;
MwHandlerClipboardReceived clipboard_received; MwHandlerClipboardReceived clipboard_received;
void* reserved1; void* reserved1;
void* reserved2; void* reserved2;
void* reserved3; void* reserved3;
void* reserved4; void* reserved4;
}; };
#endif #endif

View file

@ -238,12 +238,12 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
r->common.type = MwLLBackendGDI; r->common.type = MwLLBackendGDI;
r->gdi.get_clipboard = 1; r->gdi.get_clipboard = 1;
r->gdi.force_render = 0; r->gdi.force_render = 0;
r->gdi.grabbed = 0; r->gdi.grabbed = 0;
r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL); r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL);
r->gdi.hInstance = wc.hInstance; r->gdi.hInstance = wc.hInstance;
r->gdi.cursor = NULL; r->gdi.cursor = NULL;
r->gdi.icon = NULL; r->gdi.icon = NULL;
u->ll = r; u->ll = r;
u->min_set = 0; u->min_set = 0;
@ -393,9 +393,9 @@ static void MwLLNextEventImpl(MwLL handle) {
(void)handle; (void)handle;
if(handle->gdi.get_clipboard){ if(handle->gdi.get_clipboard) {
HGLOBAL hg; HGLOBAL hg;
if(OpenClipboard(handle->gdi.hWnd) != 0 && (hg = GetClipboardData(CF_TEXT)) != NULL){ if(OpenClipboard(handle->gdi.hWnd) != 0 && (hg = GetClipboardData(CF_TEXT)) != NULL) {
char* txt = malloc(GlobalSize(hg)); char* txt = malloc(GlobalSize(hg));
char* clp = GlobalLock(hg); char* clp = GlobalLock(hg);

View file

@ -107,8 +107,8 @@ static void llfocusouthandler(MwLL handle, void* data) {
MwDispatchUserHandler(h, MwNfocusOutHandler, data); MwDispatchUserHandler(h, MwNfocusOutHandler, data);
} }
static void llclipboardreceivedhandler(MwLL handle, void* data){ static void llclipboardreceivedhandler(MwLL handle, void* data) {
MwWidget h = (MwWidget)handle->common.user; MwWidget h = (MwWidget)handle->common.user;
MwDispatch3(h, clipboard_received, data); MwDispatch3(h, clipboard_received, data);
} }
@ -143,18 +143,18 @@ MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent,
if(parent == NULL) arrput(h->tick_list, h); if(parent == NULL) arrput(h->tick_list, h);
if(h->lowlevel != NULL) { if(h->lowlevel != NULL) {
h->lowlevel->common.user = h; h->lowlevel->common.user = h;
h->lowlevel->common.handler->draw = lldrawhandler; h->lowlevel->common.handler->draw = lldrawhandler;
h->lowlevel->common.handler->up = lluphandler; h->lowlevel->common.handler->up = lluphandler;
h->lowlevel->common.handler->down = lldownhandler; h->lowlevel->common.handler->down = lldownhandler;
h->lowlevel->common.handler->resize = llresizehandler; h->lowlevel->common.handler->resize = llresizehandler;
h->lowlevel->common.handler->close = llclosehandler; h->lowlevel->common.handler->close = llclosehandler;
h->lowlevel->common.handler->move = llmovehandler; h->lowlevel->common.handler->move = llmovehandler;
h->lowlevel->common.handler->key = llkeyhandler; h->lowlevel->common.handler->key = llkeyhandler;
h->lowlevel->common.handler->key_released = llkeyrelhandler; h->lowlevel->common.handler->key_released = llkeyrelhandler;
h->lowlevel->common.handler->focus_in = llfocusinhandler; h->lowlevel->common.handler->focus_in = llfocusinhandler;
h->lowlevel->common.handler->focus_out = llfocusouthandler; h->lowlevel->common.handler->focus_out = llfocusouthandler;
h->lowlevel->common.handler->clipboard_received = llclipboardreceivedhandler; h->lowlevel->common.handler->clipboard_received = llclipboardreceivedhandler;
} }
if(parent != NULL) arrput(parent->children, h); if(parent != NULL) arrput(parent->children, h);

View file

@ -114,7 +114,7 @@ MwClassRec MwBoxClassRec = {
resize, /* resize */ resize, /* resize */
children_update, /* children_update */ children_update, /* children_update */
children_prop_change, /* children_prop_change */ children_prop_change, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -107,7 +107,7 @@ MwClassRec MwButtonClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -53,7 +53,7 @@ MwClassRec MwCheckBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -204,7 +204,7 @@ MwClassRec MwComboBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -144,10 +144,10 @@ static void prop_change(MwWidget handle, const char* prop) {
} }
} }
static void clipboard_received(MwWidget handle, const char* data){ static void clipboard_received(MwWidget handle, const char* data) {
MwEntry t = handle->internal; MwEntry t = handle->internal;
const char* str = MwGetText(handle, MwNtext); const char* str = MwGetText(handle, MwNtext);
char* out = malloc(strlen(str) + strlen(data) + 1); char* out = malloc(strlen(str) + strlen(data) + 1);
if(str == NULL) str = ""; if(str == NULL) str = "";
@ -162,22 +162,22 @@ static void clipboard_received(MwWidget handle, const char* data){
} }
MwClassRec MwEntryClassRec = { MwClassRec MwEntryClassRec = {
create, /* create */ create, /* create */
destroy, /* destroy */ destroy, /* destroy */
draw, /* draw */ draw, /* draw */
NULL, /* click */ NULL, /* click */
NULL, /* parent_resize */ NULL, /* parent_resize */
prop_change, /* prop_change */ prop_change, /* prop_change */
NULL, /* mouse_move */ NULL, /* mouse_move */
MwForceRender2, /* mouse_up */ MwForceRender2, /* mouse_up */
MwForceRender2, /* mouse_down */ MwForceRender2, /* mouse_down */
key, /* key */ key, /* key */
NULL, /* execute */ NULL, /* execute */
NULL, /* tick */ NULL, /* tick */
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
clipboard_received, /* clipboard_received */ clipboard_received, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -61,7 +61,7 @@ MwClassRec MwFrameClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -57,7 +57,7 @@ MwClassRec MwImageClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -375,7 +375,7 @@ MwClassRec MwLabelClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -608,7 +608,7 @@ MwClassRec MwListBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -204,7 +204,7 @@ MwClassRec MwMenuClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -143,7 +143,7 @@ MwClassRec MwNumberEntryClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -244,7 +244,7 @@ MwClassRec MwOpenGLClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -61,7 +61,7 @@ MwClassRec MwProgressBarClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -62,7 +62,7 @@ MwClassRec MwRadioBoxClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -272,7 +272,7 @@ MwClassRec MwScrollBarClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -50,7 +50,7 @@ MwClassRec MwSeparatorClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -253,7 +253,7 @@ MwClassRec MwSubMenuClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -496,7 +496,7 @@ MwClassRec MwTreeViewClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -191,7 +191,7 @@ MwClassRec MwViewportClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -524,7 +524,7 @@ MwClassRec MwVulkanClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,

View file

@ -59,7 +59,7 @@ MwClassRec MwWindowClassRec = {
NULL, /* resize */ NULL, /* resize */
NULL, /* children_update */ NULL, /* children_update */
NULL, /* children_prop_change */ NULL, /* children_prop_change */
NULL, /* clipboard_received */ NULL, /* clipboard_received */
NULL, NULL,
NULL, NULL,
NULL, NULL,