some migration
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-09-27 06:30:16 +09:00
commit 8d91a97dad
39 changed files with 154 additions and 137 deletions

View file

@ -31,10 +31,10 @@ static void MWAPI resize(MwWidget handle, void* client, void* user) {
}
static void MWAPI activate(MwWidget handle, void* client, void* user) {
const char* n = MwGetText(handle, MwNtext);
const char* n = MwGetString(handle, MwNtext);
if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {
const char* s = MwGetText(inp, MwNtext);
const char* s = MwGetString(inp, MwNtext);
char* r;
if(n[0] == '.' && s != NULL) {
@ -52,7 +52,7 @@ static void MWAPI activate(MwWidget handle, void* client, void* user) {
NULL);
free(r);
} else if(n[0] == 'E') {
const char* s = MwGetText(inp, MwNtext);
const char* s = MwGetString(inp, MwNtext);
if(s != NULL) {
stack[sp++] = atof(s);

View file

@ -15,7 +15,7 @@ void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
rgb->green &= 0xff;
rgb->blue &= 0xff;
MwStringPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue);
MwSetText(window, MwNbackground, hexColor);
MwSetString(window, MwNbackground, hexColor);
}
void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
@ -27,7 +27,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
MwAddUserHandler(cpicker, MwNcolorChosenHandler, file_callback, NULL);
MwSetText(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetString(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
}
int main() {
@ -35,14 +35,14 @@ int main() {
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetText(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
MwSetString(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetString(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
MwNtext, "change window background",
NULL);
MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetText(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
MwSetString(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetString(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL);

View file

@ -48,7 +48,7 @@ void MWAPI file_picker(MwWidget handle, void* user_data, void* call_data) {
MwAddUserHandler(fpicker, MwNfileChosenHandler, file_callback, NULL);
MwSetText(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetString(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
#ifdef BUG
fpicker_wait = MwTRUE;

View file

@ -354,9 +354,9 @@ int main() {
f = frame("Tab", -PaddingContent, -PaddingContent, MwTabClass, NULL);
w = child(f);
MwSetText(MwTabAdd(w, "ABC"), MwNbackground, "#f00");
MwSetText(MwTabAdd(w, "DEF"), MwNbackground, "#0f0");
MwSetText(MwTabAdd(w, "GHI"), MwNbackground, "#00f");
MwSetString(MwTabAdd(w, "ABC"), MwNbackground, "#f00");
MwSetString(MwTabAdd(w, "DEF"), MwNbackground, "#0f0");
MwSetString(MwTabAdd(w, "GHI"), MwNbackground, "#00f");
f = frame("TreeView", -PaddingContent, -PaddingContent, MwTreeViewClass, NULL);
w = child(f);

View file

@ -33,10 +33,10 @@ void MWAPI tick(MwWidget handle, void* user, void* call) {
tm = localtime(&t);
MwStringPrintIntoBuffer(buf, 512, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]);
MwSetText(ldate, MwNtext, buf);
MwSetString(ldate, MwNtext, buf);
MwStringPrintIntoBuffer(buf, 512, "%02d:%02d %s", tm->tm_hour % 12, tm->tm_min, tm->tm_hour >= 12 ? "PM" : "AM");
MwSetText(ltime, MwNtext, buf);
MwSetString(ltime, MwNtext, buf);
render = 1;
@ -141,10 +141,10 @@ int main() {
MwNtitle, "clock",
NULL);
bgcolor = MwParseColor(window, MwGetText(window, MwNbackground));
bgcolor = MwParseColor(window, MwGetString(window, MwNbackground));
MwColorGet(bgcolor, &br, &bg, &bb);
fgcolor = MwParseColor(window, MwGetText(window, MwNforeground));
fgcolor = MwParseColor(window, MwGetString(window, MwNforeground));
MwColorGet(fgcolor, &fr, &fg, &fb);
opengl = MwCreateWidget(MwOpenGLClass, "clock", window, 0, 0, 100, 100);

View file

@ -159,7 +159,7 @@ MWDECL void MWAPI MwSetInteger(MwWidget handle, const char* key, int n);
* @param key Key
* @param value Value
*/
MWDECL void MWAPI MwSetText(MwWidget handle, const char* key, const char* value);
MWDECL void MWAPI MwSetString(MwWidget handle, const char* key, const char* value);
/*!
* @brief Sets a pointer property
@ -183,7 +183,7 @@ MWDECL int MWAPI MwGetInteger(MwWidget handle, const char* key);
* @param key Key
* @return Value
*/
MWDECL const char* MWAPI MwGetText(MwWidget handle, const char* key);
MWDECL const char* MWAPI MwGetString(MwWidget handle, const char* key);
/*!
* @brief Gets the pointer property

View file

@ -10,10 +10,10 @@
typedef struct _MwClass * MwClass, MwClassRec;
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
typedef struct _MwTextKeyValue MwTextKeyValue;
typedef struct _MwStringKeyValue MwStringKeyValue;
typedef struct _MwUserHandlerArray MwUserHandlerArray;
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
typedef struct _MwVoidKeyValue MwVoidKeyValue;
typedef struct _MwPointerKeyValue MwPointerKeyValue;
typedef struct _MwMenu* MwMenu;
typedef struct _MwEntry* MwEntry;
typedef struct _MwViewport* MwViewport;
@ -62,7 +62,7 @@ typedef void (*MwHandlerClipboardReceived)(MwWidget handle, const char* data);
typedef void(MWAPI* MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
typedef void(MWAPI* MwErrorHandler)(int code, const char* message, void* user_data);
struct _MwTextKeyValue {
struct _MwStringKeyValue {
char* key;
char* value;
};
@ -82,7 +82,7 @@ struct _MwUserHandlerKeyValue {
MwUserHandlerArray* value;
};
struct _MwVoidKeyValue {
struct _MwPointerKeyValue {
char* key;
void* value;
};
@ -101,6 +101,8 @@ struct _MwPixmap {
struct _MwColor {
MwLLColor lowlevel;
MwLLCommonColor common;
MwWidget handle;
};
struct _MwFont {
@ -130,11 +132,12 @@ struct _MwWidget {
MwHandlerProp prop_inject_pixmap; /* this is for pixmap; do not use */
MwPixmap* pixmaps;
MwColor* colors;
MwIntegerKeyValue* integer;
MwTextKeyValue* text;
MwStringKeyValue* string;
MwUserHandlerKeyValue* handler;
MwVoidKeyValue* data;
MwPointerKeyValue* data;
MwWidget* destroy_queue;
MwWidget* tick_list;

View file

@ -376,7 +376,7 @@
<integer name="n" />
</arguments>
</function>
<function name="MwSetText">
<function name="MwSetString">
<arguments>
<widget name="handle" />
<string name="key" />
@ -399,7 +399,7 @@
<string name="key" />
</arguments>
</function>
<function name="MwGetText">
<function name="MwGetString">
<return>
<string />
</return>
@ -408,7 +408,7 @@
<string name="key" />
</arguments>
</function>
<function name="MwGePointer">
<function name="MwGetPointer">
<return>
<pointer />
</return>

View file

@ -275,6 +275,7 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
h->destroy_inject = NULL;
h->prop_inject_pixmap = NULL;
h->pixmaps = NULL;
h->colors = NULL;
h->tick_list = NULL;
h->destroyed = 0;
h->bgcolor = NULL;
@ -314,13 +315,13 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
if(parent != NULL) arrput(parent->children, h);
sh_new_strdup(h->text);
sh_new_strdup(h->string);
sh_new_strdup(h->integer);
sh_new_strdup(h->handler);
sh_new_strdup(h->data);
shdefault(h->integer, MwDEFAULT);
shdefault(h->text, NULL);
shdefault(h->string, NULL);
shdefault(h->handler, NULL);
shdefault(h->data, NULL);
@ -450,11 +451,11 @@ void MwFreeWidget(MwWidget handle) {
shfree(handle->integer);
for(i = 0; i < shlen(handle->text); i++) {
free(handle->text[i].value);
handle->text[i].value = NULL;
for(i = 0; i < shlen(handle->string); i++) {
free(handle->string[i].value);
handle->string[i].value = NULL;
}
shfree(handle->text);
shfree(handle->string);
for(i = 0; i < shlen(handle->handler); i++) {
arrfree(handle->handler[i].value);
}
@ -467,6 +468,9 @@ void MwFreeWidget(MwWidget handle) {
while(arrlen(handle->pixmaps) > 0) MwDestroyPixmap(handle->pixmaps[0]);
arrfree(handle->pixmaps);
while(arrlen(handle->colors) > 0) MwFreeColor(handle->colors[0]);
arrfree(handle->colors);
arrfree(handle->draw_queue);
arrfree(handle->resize_queue);
@ -711,18 +715,18 @@ void MwSetInteger(MwWidget handle, const char* key, int n) {
}
}
void MwSetText(MwWidget handle, const char* key, const char* value) {
void MwSetString(MwWidget handle, const char* key, const char* value) {
if(handle->widget_class == MwWindowClass && strcmp(key, MwNtitle) == 0) {
MwLLSetTitle(handle->lowlevel, value);
} else {
char* v = value == NULL ? NULL : MwStringDuplicate(value);
if(shgeti(handle->text, key) != -1) free(shget(handle->text, key));
if(shgeti(handle->string, key) != -1) free(shget(handle->string, key));
if(value != NULL) {
shput(handle->text, key, v);
shput(handle->string, key, v);
} else {
shdel(handle->text, key);
shdel(handle->string, key);
}
}
if(handle->prop_event) {
@ -814,13 +818,13 @@ int MwGetInteger(MwWidget handle, const char* key) {
}
}
const char* MwGetText(MwWidget handle, const char* key) {
if((shgeti(handle->text, key) == -1 || strcmp(shget(handle->text, key), "DEFAULT") == 0) && (strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0 || strcmp(key, MwNtitleBackground) == 0 || strcmp(key, MwNtitleForeground) == 0)) {
const char* MwGetString(MwWidget handle, const char* key) {
if((shgeti(handle->string, key) == -1 || strcmp(shget(handle->string, key), "DEFAULT") == 0) && (strcmp(key, MwNbackground) == 0 || strcmp(key, MwNforeground) == 0 || strcmp(key, MwNsubBackground) == 0 || strcmp(key, MwNsubForeground) == 0 || strcmp(key, MwNtitleBackground) == 0 || strcmp(key, MwNtitleForeground) == 0)) {
const char* v = NULL;
if(shgeti(handle->text, key) != -1 && strcmp(shget(handle->text, key), "DEFAULT") != 0) {
if(shgeti(handle->string, key) != -1 && strcmp(shget(handle->string, key), "DEFAULT") != 0) {
MwWidget h = handle->parent;
while(h != NULL) {
if((v = MwGetText(h, key)) != NULL) break;
if((v = MwGetString(h, key)) != NULL) break;
h = h->parent;
}
}
@ -844,7 +848,7 @@ const char* MwGetText(MwWidget handle, const char* key) {
return v;
}
return shget(handle->text, key);
return shget(handle->string, key);
}
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_GDI_TEXT)
@ -930,7 +934,7 @@ static void MwVaListApply_Internal(MwWidget handle, va_list va, int only_early)
char* t = va_arg(va, char*);
if(only_early && key[1] != 'E') continue;
MwSetText(handle, key, t);
MwSetString(handle, key, t);
} else if(key[0] == 'C') {
MwUserHandler h = va_arg(va, MwUserHandler);
if(only_early && key[1] != 'E') continue;

View file

@ -185,10 +185,10 @@ static void MWAPI color_picker_click(MwWidget handle, void* user, void* call) {
fb = picker->chosen_color.blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 8, "#%02X%02X%02X", fr, fg, fb);
MwSetText(picker->color_display_text, MwNforeground, fgColor);
MwSetString(picker->color_display_text, MwNforeground, fgColor);
MwSetText(picker->color_display_text, MwNbackground, hexColor);
MwSetText(picker->color_display_text, MwNtext, hexColor);
MwSetString(picker->color_display_text, MwNbackground, hexColor);
MwSetString(picker->color_display_text, MwNtext, hexColor);
}
static void MWAPI color_picker_on_change_value(MwWidget handle, void* user,
void* call) {
@ -244,7 +244,7 @@ static void MWAPI color_display_text_change(MwWidget handle, void* user,
(void)call;
memcpy(&hexColor, MwGetText(handle, MwNtext), 8);
memcpy(&hexColor, MwGetString(handle, MwNtext), 8);
color = MwParseColor(handle, hexColor);
@ -253,10 +253,10 @@ static void MWAPI color_display_text_change(MwWidget handle, void* user,
fb = color->common->blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 9, "#%02X%02X%02X", fr, fg, fb);
MwSetText(picker->color_display_text, MwNforeground, fgColor);
MwSetString(picker->color_display_text, MwNforeground, fgColor);
MwSetText(picker->color_display_text, MwNbackground, hexColor);
MwSetText(picker->color_display_text, MwNtext, hexColor);
MwSetString(picker->color_display_text, MwNbackground, hexColor);
MwSetString(picker->color_display_text, MwNtext, hexColor);
picker->chosen_color.red = color->common->red;
picker->chosen_color.green = color->common->green;
@ -302,8 +302,8 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) {
MwEntryClass, "colorDisplayText", picker->parent, IMG_POS_X(w) + (PICKER_SIZE / 2) - ((PICKER_SIZE / 4) / 2),
IMG_POS_Y(h) - (PICKER_SIZE / 16) - MARGIN, (PICKER_SIZE / 4), PICKER_SIZE / 16);
MwSetText(picker->color_display_text, MwNbackground, "#FFFFFF");
MwSetText(picker->color_display_text, MwNtext, "#FFFFFF");
MwSetString(picker->color_display_text, MwNbackground, "#FFFFFF");
MwSetString(picker->color_display_text, MwNtext, "#FFFFFF");
/* MwSetInteger(picker->color_display_text, Mwnali, MwALIGNMENT_CENTER); */
MwAddUserHandler(picker->color_display_text, MwNactivateHandler,
@ -330,7 +330,7 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) {
picker->finish = MwCreateWidget(
MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w),
IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, (WIN_SIZE - PICKER_SIZE - MARGIN * 4) / 2);
MwSetText(picker->finish, MwNtext, "Select");
MwSetString(picker->finish, MwNtext, "Select");
MwSetInteger(picker->finish, MwNhasBorder, 1);
MwSetInteger(picker->finish, MwNinverted, 1);

View file

@ -105,7 +105,7 @@ static void MWAPI files_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);
char* t = (char*)MwGetString(fc->filename, MwNtext);
struct stat s;
char* p = NULL;
@ -195,7 +195,7 @@ static void MWAPI addr_activate(MwWidget handle, void* user, void* call) {
(void)user;
(void)call;
scan(handle->parent, MwGetText(handle, MwNtext), 1);
scan(handle->parent, MwGetString(handle, MwNtext), 1);
}
static void layout(MwWidget handle) {

View file

@ -42,7 +42,7 @@ static void color_set_disabled_if_disabled(MwWidget handle, MwColor rgb) {
int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && n) {
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
rgb->common->red = (MwU8)(rgb->common->red + (c->common->red - rgb->common->red) * 0.5);
@ -251,7 +251,7 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwColor color, int invert,
if(border) {
if(!handle->lowlevel->common.supports_transparency) {
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
MwDrawRect(handle, rect, c);
@ -403,7 +403,7 @@ void MwDrawCircle(MwWidget handle, MwRect* rect, MwColor color, MwColor backgrou
if(inside) {
MwColor mixColor;
MwColor c = background ? background : (handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground)));
MwColor c = background ? background : (handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground)));
double mod;
unsigned char* pout = &data[(y * width + x) * 4];
@ -990,7 +990,7 @@ MwPixmap MwLoadRaw(MwWidget handle, unsigned char* rgb, int width, int height) {
void MwPixmapReloadRaw(MwPixmap px, unsigned char* rgb) {
int i;
MwWidget handle = px->handle;
MwColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetText(handle, MwNbackground)) : handle->bgcolor;
MwColor base = handle->bgcolor == NULL ? MwParseColor(handle, MwGetString(handle, MwNbackground)) : handle->bgcolor;
if(rgb != NULL) memcpy(px->raw, rgb, px->common->width * px->common->height * 4);
@ -1044,7 +1044,6 @@ void MwDestroyPixmap(MwPixmap pixmap) {
break;
}
}
if(arrlen(handle->pixmaps) == 0) handle->prop_inject_pixmap = NULL;
MwLLDestroyPixmap(pixmap->lowlevel);
@ -1061,6 +1060,7 @@ MwColor MwAllocColor(MwWidget handle, unsigned int red, unsigned int green, unsi
color->lowlevel = MwLLAllocColor(handle->lowlevel, red, green, blue);
color->common = &color->lowlevel->common;
color->handle = handle;
return color;
}
@ -1076,6 +1076,16 @@ void MwColorUpdate(MwColor c, int r, int g, int b) {
}
void MwFreeColor(MwColor color) {
int i;
MwWidget handle = color->handle;
for(i = 0; i < arrlen(handle->colors); i++) {
if(handle->colors[i] == color) {
arrdel(handle->colors, i);
break;
}
}
MwLLFreeColor(color->lowlevel);
free(color);
}

View file

@ -85,7 +85,7 @@ void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text,
int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && n) {
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetText(handle->parent, MwNbackground));
MwColor c = handle->parent == NULL ? NULL : MwParseColor(handle->parent, MwGetString(handle->parent, MwNbackground));
if(c != NULL) {
fadedColor = MwAllocColor(handle, color->common->red, color->common->blue, color->common->green);

View file

@ -78,7 +78,7 @@ static void layout(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;

View file

@ -15,9 +15,9 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwPoint point;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
const char* str = MwGetText(handle, MwNtext);
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
const char* str = MwGetString(handle, MwNtext);
MwPixmap px = MwGetPointer(handle, MwNpixmap);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
int inv;

View file

@ -81,8 +81,8 @@ static MwPixmap blit(MwWidget handle, const char* str, MwColor bg, MwColor fg, i
}
static void draw(MwWidget handle) {
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor cf = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor cf = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor cb = MwParseColor(handle, "#fff");
MwColor cb_g = MwParseColor(handle, "#666");
MwColor ct = MwParseColor(handle, "#000");

View file

@ -395,8 +395,8 @@ static void line_chart(MwWidget handle, MwRect* _r, double vmin, double vmax, in
}
static void draw(MwWidget handle) {
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor border = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor border = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
MwChart c = handle->internal;
int i;

View file

@ -10,9 +10,9 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
r.x = 0;

View file

@ -55,10 +55,10 @@ static void draw(MwWidget handle) {
int ColorDiff = MwGetColorDifference(handle);
int ShadowDist;
int BaseWidth;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor shadow = MwLightenColor(handle, base, -ColorDiff, -ColorDiff, -ColorDiff);
MwColor inside = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
MwColor border = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
MwColor inside = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
MwColor border = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwRect r;
int i;
double w;

View file

@ -25,8 +25,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r, rc;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwComboBox cb = handle->internal;
r.x = 0;

View file

@ -52,8 +52,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwDocument d = handle->internal;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
int i;
MwFLFont font = NULL;
@ -634,7 +634,7 @@ static void prop_change(MwWidget handle, const char* key) {
if(strcmp(key, MwNtext) == 0) {
MD_PARSER parser;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
memset(&parser, 0, sizeof(parser));

View file

@ -47,9 +47,9 @@ static void tick(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwEntry t = handle->internal;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
const char* str = MwGetText(handle, MwNtext);
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
MwFLFont font = MwFLBuildFont(MwFLFlagMonospace);
if(str == NULL) str = "";
@ -114,7 +114,7 @@ static void draw(MwWidget handle) {
static void key(MwWidget handle, int code) {
MwEntry t = handle->internal;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
char* out;
if(str == NULL) str = "";
@ -127,7 +127,7 @@ static void key(MwWidget handle, int code) {
MwUTF8Copy(str, 0, out, 0, t->cursor);
MwUTF8Copy(str, t->cursor + 1, out, t->cursor, MwUTF8Length(str) - (t->cursor + 1));
MwSetText(handle, MwNtext, out);
MwSetString(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out);
@ -150,13 +150,13 @@ static void key(MwWidget handle, int code) {
t->cursor++;
MwSetText(handle, MwNtext, out);
MwSetString(handle, MwNtext, out);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out);
}
if(MwGetText(handle, MwNtext) != NULL) t->length = MwUTF8Length(MwGetText(handle, MwNtext));
if(MwGetString(handle, MwNtext) != NULL) t->length = MwUTF8Length(MwGetString(handle, MwNtext));
MwForceRender(handle);
}
@ -199,7 +199,7 @@ static void prop_change(MwWidget handle, const char* prop) {
if(strcmp(prop, MwNtext) == 0) {
MwEntry t = handle->internal;
int len = MwUTF8Length(MwGetText(handle, MwNtext));
int len = MwUTF8Length(MwGetString(handle, MwNtext));
if(len < t->cursor) {
t->cursor = len;
} else if(t->length == t->cursor) {
@ -211,7 +211,7 @@ static void prop_change(MwWidget handle, const char* prop) {
static void clipboard(MwWidget handle, const char* data) {
MwEntry t = handle->internal;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
char* out;
if(!str) {
str = "";
@ -226,7 +226,7 @@ static void clipboard(MwWidget handle, const char* data) {
t->cursor += MwUTF8Length(data);
MwSetText(handle, MwNtext, out);
MwSetString(handle, MwNtext, out);
free(out);
MwForceRender(handle);

View file

@ -12,7 +12,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect fr;
MwRect rr;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
int inverted;
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);

View file

@ -13,7 +13,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwPixmap px = MwGetPointer(handle, MwNpixmap);
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;

View file

@ -124,11 +124,11 @@ static void draw_h(MwWidget handle, unsigned char* raw, int x, int y, int stride
static void draw_seven_segment(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
MwLabel lab = handle->internal;
int l_one = MwGetInteger(handle, MwNlength) - (MwGetInteger(handle, MwNlength) % 2);
@ -315,11 +315,11 @@ static void draw_seven_segment(MwWidget handle) {
static void draw_normal(MwWidget handle) {
MwRect r;
MwPoint p;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
if(str == NULL) str = "";

View file

@ -136,10 +136,10 @@ static void MWAPI frame_mouse_move(MwWidget handle, void* user, void* call) {
static void frame_draw(MwWidget handle) {
MwRect r, r2;
MwListBox lb = handle->parent->internal;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
int i;
MwPoint p;
int st = 0;
@ -359,8 +359,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwListBox lb = handle->internal;
r.x = 0;

View file

@ -103,8 +103,8 @@ static void destroy(MwWidget handle) {
m->sub[i]->cleaned = 0;
static void draw(MwWidget handle) {
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MENU_LOOP_DECL;
MENU_LOOP_INIT;

View file

@ -9,7 +9,7 @@ static int wcreate(MwWidget handle) {
e = handle->internal;
e->right = 32;
MwSetText(handle, MwNtext, "0");
MwSetString(handle, MwNtext, "0");
return 0;
}
@ -24,7 +24,7 @@ static void draw(MwWidget handle) {
MwEntry e = handle->internal;
MwRect r;
int pr;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwEntryClass->draw(handle);
@ -65,7 +65,7 @@ static void draw(MwWidget handle) {
static void key(MwWidget handle, int code) {
MwEntry e = handle->internal;
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
int ok = 0;
if(str == NULL) str = "";
@ -96,7 +96,7 @@ static void mouse_up(MwWidget handle, void* ptr) {
MwEntry e = handle->internal;
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
const char* str = MwGetText(handle, MwNtext);
const char* str = MwGetString(handle, MwNtext);
if(((MwMouse*)ptr)->button != MwMOUSE_LEFT) return;
@ -107,7 +107,7 @@ static void mouse_up(MwWidget handle, void* ptr) {
} else {
MwStringPrintIntoBuffer(s, 512, "%g", atof(str) + 1);
}
MwSetText(handle, MwNtext, s);
MwSetString(handle, MwNtext, s);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
}

View file

@ -13,8 +13,8 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor fill = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor fill = MwParseColor(handle, MwGetString(handle, MwNforeground));
double w;
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);

View file

@ -12,7 +12,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
r.x = 0;

View file

@ -55,7 +55,7 @@ static void add_value(MwWidget handle, int mul) {
static void draw(MwWidget handle) {
MwRect r = {0}, rt = {0}, rbar = {0};
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor dark = MwLightenColor(handle, base, -64, -64, -64);
MwScrollBar scr = handle->internal;
int or ;

View file

@ -10,7 +10,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;

View file

@ -29,8 +29,8 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r;
MwMenu menu = handle->internal;

View file

@ -11,7 +11,7 @@ static void close_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@ -52,7 +52,7 @@ static void maximize_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@ -117,7 +117,7 @@ static void minimize_draw(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
MwPoint p[2];
MwColor c = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNforeground));
int bw = MwDefaultBorderWidth(handle);
p[0].x = bw * 2;
@ -285,11 +285,11 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor tb = MwParseColor(handle, MwGetText(handle, MwNtitleBackground));
MwColor tf = MwParseColor(handle, MwGetText(handle, MwNtitleForeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor tb = MwParseColor(handle, MwGetString(handle, MwNtitleBackground));
MwColor tf = MwParseColor(handle, MwGetString(handle, MwNtitleForeground));
MwRect r, r2, r3;
const char* title = MwGetText(handle, MwNtitle);
const char* title = MwGetString(handle, MwNtitle);
int incr = 0;
MwPixmap px = MwGetPointer(handle, MwNiconPixmap);

View file

@ -58,8 +58,8 @@ static int icon_width(MwWidget handle, const char* text) {
static void draw(MwWidget handle) {
MwTab t = handle->internal;
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor ct = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor ct = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r, r2;
int h = tab_height(handle);
int i;

View file

@ -167,10 +167,10 @@ static void recursion(MwWidget handle, MwTreeViewEntry* tree, MwTreeViewEntry**
static void frame_draw(MwWidget handle) {
MwRect r, r2;
MwTreeView tv = handle->parent->internal;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground));
MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
MwPoint p;
int shared = 0;
int i;
@ -322,7 +322,7 @@ static void destroy(MwWidget handle) {
}
static void draw(MwWidget handle) {
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwRect r;
r.x = 0;

View file

@ -102,7 +102,7 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) {
MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0;
r.y = 0;

View file

@ -568,11 +568,11 @@ static void prop_change(MwWidget handle, const char* prop) {
}
if(strcmp(prop, MwNvulkanExtension) == 0) {
char* str = MwStringDuplicate(MwGetText(handle, MwNvulkanExtension));
char* str = MwStringDuplicate(MwGetString(handle, MwNvulkanExtension));
arrput(o->enabledExtensions, str);
} else if(strcmp(prop, MwNvulkanLayer) == 0) {
char* str = MwStringDuplicate(MwGetText(handle, MwNvulkanExtension));
char* str = MwStringDuplicate(MwGetString(handle, MwNvulkanExtension));
arrput(o->enabledLayers, str);
} else if(strcmp(prop, MwNvulkanConfig) == 0) {

View file

@ -10,7 +10,7 @@ static int wcreate(MwWidget handle) {
}
static void draw(MwWidget handle) {
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground));
MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwRect r;
r.x = 0;