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

@ -2,7 +2,7 @@
MwWidget window, box;
void resize(MwWidget handle, void* user, void* client) {
void MWAPI resize(MwWidget handle, void* user, void* client) {
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight);

View file

@ -7,7 +7,7 @@ MwWidget inp;
double stack[512];
int sp = 0;
static void resize(MwWidget handle, void* client, void* user) {
static void MWAPI resize(MwWidget handle, void* client, void* user) {
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight) - MwGetInteger(inp, MwNheight);
int i;
@ -30,7 +30,7 @@ static void resize(MwWidget handle, void* client, void* user) {
}
}
static void activate(MwWidget handle, void* client, void* user) {
static void MWAPI activate(MwWidget handle, void* client, void* user) {
const char* n = MwGetText(handle, MwNtext);
if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {

View file

@ -2,7 +2,7 @@
MwWidget window, instructions, text1, text2, cur_text;
static void resize(MwWidget handle, void* user_data, void* call_data) {
static void MWAPI resize(MwWidget handle, void* user_data, void* call_data) {
unsigned int w, h;
(void)user_data;
@ -28,7 +28,7 @@ static void resize(MwWidget handle, void* user_data, void* call_data) {
MwNheight, h - 125 - 50 * 3,
NULL);
}
static void clipboard(MwWidget handle, void* user_data, void* call_data) {
static void MWAPI clipboard(MwWidget handle, void* user_data, void* call_data) {
char* clipboard = call_data;
(void)handle;
@ -40,7 +40,7 @@ static void clipboard(MwWidget handle, void* user_data, void* call_data) {
}
}
static void tick(MwWidget handle, void* user_data, void* call_data) {
static void MWAPI tick(MwWidget handle, void* user_data, void* call_data) {
cur_text = text1;
MwGetClipboard(handle, MwCLIPBOARD_MAIN);
cur_text = text2;

View file

@ -4,7 +4,7 @@ MwWidget cpicker;
MwWidget window;
MwWidget button;
void color_callback(MwWidget handle, void* user_data, void* call_data) {
void MWAPI color_callback(MwWidget handle, void* user_data, void* call_data) {
char hexColor[8];
MwRGB* rgb = call_data;
@ -18,7 +18,7 @@ void color_callback(MwWidget handle, void* user_data, void* call_data) {
MwSetText(window, MwNbackground, hexColor);
}
void color_picker(MwWidget handle, void* user_data, void* call_data) {
void MWAPI color_picker(MwWidget handle, void* user_data, void* call_data) {
MwWidget cpicker = MwColorPicker(window, "cpicker");
(void)handle;

View file

@ -2,7 +2,7 @@
MwWidget window, menu, button, button2, button3, button4, button5, button6;
void handler(MwWidget handle, void* user_data, void* call_data) {
void MWAPI handler(MwWidget handle, void* user_data, void* call_data) {
(void)handle;
(void)user_data;
(void)call_data;
@ -10,7 +10,7 @@ void handler(MwWidget handle, void* user_data, void* call_data) {
printf("hello world!\n");
}
void handler_theme(MwWidget handle, void* user_data, void* call_data) {
void MWAPI handler_theme(MwWidget handle, void* user_data, void* call_data) {
(void)handle;
(void)user_data;
(void)call_data;
@ -20,7 +20,7 @@ void handler_theme(MwWidget handle, void* user_data, void* call_data) {
NULL);
}
void handler_look(MwWidget handle, void* user_data, void* call_data) {
void MWAPI handler_look(MwWidget handle, void* user_data, void* call_data) {
(void)handle;
(void)user_data;
(void)call_data;
@ -30,7 +30,7 @@ void handler_look(MwWidget handle, void* user_data, void* call_data) {
NULL);
}
void handler_font(MwWidget handle, void* user_data, void* call_data) {
void MWAPI handler_font(MwWidget handle, void* user_data, void* call_data) {
(void)handle;
(void)user_data;
(void)call_data;
@ -40,7 +40,7 @@ void handler_font(MwWidget handle, void* user_data, void* call_data) {
NULL);
}
void resize(MwWidget handle, void* user_data, void* call_data) {
void MWAPI resize(MwWidget handle, void* user_data, void* call_data) {
unsigned int w, h, mh;
(void)user_data;

View file

@ -4,13 +4,13 @@
MwWidget wmain;
void destroy(MwWidget handle, void* user, void* call) {
void MWAPI destroy(MwWidget handle, void* user, void* call) {
(void)handle;
(void)call;
MwDestroyWidget(user);
}
void activate(MwWidget handle, void* user, void* call) {
void MWAPI activate(MwWidget handle, void* user, void* call) {
char msg[256];
MwWidget msgbox;

View file

@ -1,12 +1,12 @@
#include <Mw/Milsko.h>
void ok(MwWidget handle, void* user, void* call) {
void MWAPI ok(MwWidget handle, void* user, void* call) {
(void)handle;
(void)call;
MwDestroyWidget(user);
}
void spawn(MwWidget handle, void* user, void* call) {
void MWAPI spawn(MwWidget handle, void* user, void* call) {
MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK);
(void)handle;
@ -16,7 +16,7 @@ void spawn(MwWidget handle, void* user, void* call) {
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
}
void spawn2(MwWidget handle, void* user, void* call) {
void MWAPI spawn2(MwWidget handle, void* user, void* call) {
MwWidget mb = MwMessageBox(user, "something went wrong!", "title", MwMB_ICONERROR | MwMB_BUTTONOK);
(void)handle;
@ -26,7 +26,7 @@ void spawn2(MwWidget handle, void* user, void* call) {
MwAddUserHandler(mb, MwNcloseHandler, ok, mb);
}
void spawn3(MwWidget handle, void* user, void* call) {
void MWAPI spawn3(MwWidget handle, void* user, void* call) {
int i;
(void)handle;

View file

@ -11,7 +11,7 @@ MwWidget boxes[32];
int n = 0, row = -1;
MwMenu e;
static void resize(MwWidget handle, void* user, void* call) {
static void MWAPI resize(MwWidget handle, void* user, void* call) {
int w = MwGetInteger(window, MwNwidth);
int h = MwGetInteger(window, MwNheight);
@ -47,7 +47,7 @@ static void add(MwWidget w) {
}
}
static void resize_content(MwWidget handle, void* user, void* call) {
static void MWAPI resize_content(MwWidget handle, void* user, void* call) {
MwWidget* ws = MwGetChildren(handle);
if(ws != NULL) {
int pw = MwGetInteger(ws[0], "IpWidth");
@ -76,7 +76,7 @@ static void resize_content(MwWidget handle, void* user, void* call) {
}
}
static void resize_frame(MwWidget handle, void* user, void* call) {
static void MWAPI resize_frame(MwWidget handle, void* user, void* call) {
MwWidget* ws = MwGetChildren(handle);
if(ws != NULL) {
int w = MwGetInteger(handle, MwNwidth);
@ -140,7 +140,7 @@ static MwWidget child(MwWidget w) {
return MwGetVoid(w, "VhandledWidget");
}
static void menu_handler(MwWidget handle, void* user, void* call) {
static void MWAPI menu_handler(MwWidget handle, void* user, void* call) {
if(call == e) MwDestroyWidget(window);
}

View file

@ -14,7 +14,7 @@ double deg = 0;
int ww, wh;
void handler(MwWidget w, void* user, void* client) {
void MWAPI handler(MwWidget w, void* user, void* client) {
int i;
double cdeg = deg;
@ -44,7 +44,7 @@ void handler(MwWidget w, void* user, void* client) {
deg += 120.0 / (1000.0 / MwWaitMS);
}
void resize(MwWidget w, void* user, void* client) {
void MWAPI resize(MwWidget w, void* user, void* client) {
(void)w;
(void)user;
(void)client;

View file

@ -1,4 +1,3 @@
#include <Mw/Milsko.h>
int main() {

View file

@ -2,13 +2,13 @@
MwWidget wmain;
void destroy(MwWidget handle, void* user, void* call) {
void MWAPI destroy(MwWidget handle, void* user, void* call) {
(void)handle;
(void)call;
MwDestroyWidget(user);
}
void activate(MwWidget handle, void* user, void* call) {
void MWAPI activate(MwWidget handle, void* user, void* call) {
char msg[256];
MwWidget msgbox;

View file

@ -2,7 +2,7 @@
MwWidget vp;
static void resize(MwWidget handle, void* user, void* call) {
static void MWAPI resize(MwWidget handle, void* user, void* call) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);