introduce MWAPI
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

This commit is contained in:
Nishi 2026-04-22 12:05:49 +09:00
commit 2dd2c3870f
41 changed files with 189 additions and 166 deletions

View file

@ -913,6 +913,16 @@ void MwForceRender2(MwWidget handle, void* ptr) {
MwForceRender(handle);
}
void MwForceRender_Internal(MwWidget handle) {
MwForceRender(handle);
}
void MwForceRender2_Internal(MwWidget handle, void* ptr) {
(void)ptr;
MwForceRender(handle);
}
void MwAddTickList(MwWidget handle) {
MwWidget root = handle;
while(root->parent != NULL) root = root->parent;

View file

@ -158,7 +158,7 @@ static void color_picker_image_update(color_picker_t* picker) {
/* printf("%d\n", n); */
}
static void color_picker_click(MwWidget handle, void* user, void* call) {
static void MWAPI color_picker_click(MwWidget handle, void* user, void* call) {
color_picker_t* picker = user;
MwMouse* mouse = call;
char hexColor[8];
@ -190,7 +190,7 @@ static void color_picker_click(MwWidget handle, void* user, void* call) {
MwSetText(picker->color_display_text, MwNbackground, hexColor);
MwSetText(picker->color_display_text, MwNtext, hexColor);
}
static void color_picker_on_change_value(MwWidget handle, void* user,
static void MWAPI color_picker_on_change_value(MwWidget handle, void* user,
void* call) {
color_picker_t* picker = user;
@ -206,7 +206,7 @@ static void color_picker_on_change_value(MwWidget handle, void* user,
/* color_picker_image_update(picker); */
}
static void color_picker_tick(MwWidget handle, void* user,
static void MWAPI color_picker_tick(MwWidget handle, void* user,
void* call) {
color_picker_t* picker = user;
@ -224,7 +224,7 @@ static void color_picker_destroy(color_picker_t* picker) {
free(picker);
}
static void color_picker_close(MwWidget handle, void* user,
static void MWAPI color_picker_close(MwWidget handle, void* user,
void* call) {
color_picker_t* picker = user;
@ -234,7 +234,7 @@ static void color_picker_close(MwWidget handle, void* user,
MwDestroyWidget(handle);
}
static void color_display_text_change(MwWidget handle, void* user,
static void MWAPI color_display_text_change(MwWidget handle, void* user,
void* call) {
color_picker_t* picker = user;
char hexColor[9];
@ -265,7 +265,7 @@ static void color_display_text_change(MwWidget handle, void* user,
MwLLFreeColor(color);
}
static void color_picker_finish(MwWidget handle, void* user,
static void MWAPI color_picker_finish(MwWidget handle, void* user,
void* call) {
color_picker_t* picker = user;

View file

@ -53,35 +53,35 @@ static void destroy(MwWidget handle) {
MwDestroyWidget(handle);
}
static void filecancel(MwWidget handle, void* user, void* call) {
static void MWAPI filecancel(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
destroy(handle->parent);
}
static void cancel_window(MwWidget handle, void* user, void* call) {
static void MWAPI cancel_window(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
destroy(handle);
}
static void okay(MwWidget handle, void* user, void* call) {
static void MWAPI okay(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
destroy(handle->parent);
}
static void msgbox_okay(MwWidget handle, void* user, void* call) {
static void MWAPI msgbox_okay(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
MwDestroyWidget(handle->parent);
}
static void files_activate(MwWidget handle, void* user, void* call) {
static void MWAPI files_activate(MwWidget handle, void* user, void* call) {
int index = *(int*)call;
filechooser_t* fc = handle->parent->opaque;
@ -104,7 +104,7 @@ static void files_activate(MwWidget handle, void* user, void* call) {
}
}
static void okay_activate(MwWidget handle, void* user, void* call) {
static void MWAPI okay_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque;
char* t = (char*)MwGetText(fc->filename, MwNtext);
struct stat s;
@ -140,7 +140,7 @@ static void okay_activate(MwWidget handle, void* user, void* call) {
if(p != NULL) free(p);
}
static void nav_activate(MwWidget handle, void* user, void* call) {
static void MWAPI nav_activate(MwWidget handle, void* user, void* call) {
int index = *(int*)call;
const char* e = MwListBoxGet(handle, index);
@ -156,7 +156,7 @@ static void nav_activate(MwWidget handle, void* user, void* call) {
}
}
static void addr_up_activate(MwWidget handle, void* user, void* call) {
static void MWAPI addr_up_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque;
char* p = MwDirectoryJoin(fc->path, "..");
@ -168,7 +168,7 @@ static void addr_up_activate(MwWidget handle, void* user, void* call) {
free(p);
}
static void addr_back_activate(MwWidget handle, void* user, void* call) {
static void MWAPI addr_back_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque;
(void)user;
@ -181,7 +181,7 @@ static void addr_back_activate(MwWidget handle, void* user, void* call) {
}
}
static void addr_fwd_activate(MwWidget handle, void* user, void* call) {
static void MWAPI addr_fwd_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque;
(void)user;
@ -192,7 +192,7 @@ static void addr_fwd_activate(MwWidget handle, void* user, void* call) {
}
}
static void addr_activate(MwWidget handle, void* user, void* call) {
static void MWAPI addr_activate(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
@ -390,7 +390,7 @@ static void layout(MwWidget handle) {
}
}
static void resize(MwWidget handle, void* user, void* call) {
static void MWAPI resize(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;

View file

@ -24,7 +24,7 @@ static void messagebox_destroy_inject(MwWidget handle) {
if((px = MwGetVoid(handle, MwNpixmap)) != NULL) MwLLDestroyPixmap(px);
}
static void messagebox_close(MwWidget handle, void* user, void* call) {
static void MWAPI messagebox_close(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
MwDestroyWidget(handle);

View file

@ -78,7 +78,7 @@ static void draw(MwWidget handle) {
MwLLFreeColor(base);
}
static void listbox_activate(MwWidget handle, void* user, void* client) {
static void MWAPI listbox_activate(MwWidget handle, void* user, void* client) {
MwComboBox cb = handle->parent->internal;
(void)user;

View file

@ -54,7 +54,7 @@ static int get_col_width(MwListBox lb, int ind) {
return 0;
}
static void vscroll_changed(MwWidget handle, void* user, void* call) {
static void MWAPI vscroll_changed(MwWidget handle, void* user, void* call) {
MwListBox lb = handle->parent->internal;
(void)user;
@ -63,7 +63,7 @@ static void vscroll_changed(MwWidget handle, void* user, void* call) {
lb->changed = 1;
}
static void frame_mouse_down(MwWidget handle, void* user, void* call) {
static void MWAPI frame_mouse_down(MwWidget handle, void* user, void* call) {
MwListBox lb = handle->parent->internal;
MwMouse* m = call;
@ -98,7 +98,7 @@ static void frame_mouse_down(MwWidget handle, void* user, void* call) {
}
}
static void frame_mouse_up(MwWidget handle, void* user, void* call) {
static void MWAPI frame_mouse_up(MwWidget handle, void* user, void* call) {
MwListBox lb = handle->parent->internal;
MwMouse* m = call;
@ -109,7 +109,7 @@ static void frame_mouse_up(MwWidget handle, void* user, void* call) {
}
}
static void frame_mouse_move(MwWidget handle, void* user, void* call) {
static void MWAPI frame_mouse_move(MwWidget handle, void* user, void* call) {
MwListBox lb = handle->parent->internal;
MwPoint* p = call;

View file

@ -6,7 +6,7 @@
#define LineSpace 16
#define LinePadding 4
static void vscroll_changed(MwWidget handle, void* user, void* call) {
static void MWAPI vscroll_changed(MwWidget handle, void* user, void* call) {
MwTreeView tv = handle->parent->internal;
(void)user;
@ -211,7 +211,7 @@ static int recursive_length(MwTreeViewEntry** e) {
return l;
}
static void frame_mouse_down(MwWidget handle, void* user, void* call) {
static void MWAPI frame_mouse_down(MwWidget handle, void* user, void* call) {
MwTreeView tv = handle->parent->internal;
MwMouse* mouse = call;
@ -222,7 +222,7 @@ static void frame_mouse_down(MwWidget handle, void* user, void* call) {
static void resize(MwWidget handle);
static void frame_mouse_up(MwWidget handle, void* user, void* call) {
static void MWAPI frame_mouse_up(MwWidget handle, void* user, void* call) {
MwTreeView tv = handle->parent->internal;
int shared = 0;
int skip = MwGetInteger(tv->vscroll, MwNvalue) * (MwGetInteger(tv->vscroll, MwNmaxValue) - MwGetInteger(tv->vscroll, MwNareaShown)) / MwGetInteger(tv->vscroll, MwNmaxValue);

View file

@ -1,6 +1,6 @@
#include <Mw/Milsko.h>
static void vscroll_changed(MwWidget handle, void* user, void* call) {
static void MWAPI vscroll_changed(MwWidget handle, void* user, void* call) {
MwViewport vp = user;
(void)handle;
@ -9,7 +9,7 @@ static void vscroll_changed(MwWidget handle, void* user, void* call) {
vp->vchanged = 1;
}
static void hscroll_changed(MwWidget handle, void* user, void* call) {
static void MWAPI hscroll_changed(MwWidget handle, void* user, void* call) {
MwViewport vp = user;
(void)handle;