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) { 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] == '.') { if(('0' <= n[0] && n[0] <= '9') || n[0] == '.') {
const char* s = MwGetText(inp, MwNtext); const char* s = MwGetString(inp, MwNtext);
char* r; char* r;
if(n[0] == '.' && s != NULL) { if(n[0] == '.' && s != NULL) {
@ -52,7 +52,7 @@ static void MWAPI activate(MwWidget handle, void* client, void* user) {
NULL); NULL);
free(r); free(r);
} else if(n[0] == 'E') { } else if(n[0] == 'E') {
const char* s = MwGetText(inp, MwNtext); const char* s = MwGetString(inp, MwNtext);
if(s != NULL) { if(s != NULL) {
stack[sp++] = atof(s); 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->green &= 0xff;
rgb->blue &= 0xff; rgb->blue &= 0xff;
MwStringPrintIntoBuffer(hexColor, 8, "#%02X%02X%02X", rgb->red, rgb->green, rgb->blue); 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) { 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); MwAddUserHandler(cpicker, MwNcolorChosenHandler, file_callback, NULL);
MwSetText(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); MwSetString(cpicker, MwNbackground, MwGetInteger(cpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
} }
int main() { int main() {
@ -35,14 +35,14 @@ int main() {
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT,
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL); MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); MwSetString(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetText(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground); MwSetString(window, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120, button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
MwNtext, "change window background", MwNtext, "change window background",
NULL); NULL);
MwSetText(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); MwSetString(button, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
MwSetText(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground); MwSetString(button, MwNforeground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultDarkForeground : MwDefaultForeground);
MwAddUserHandler(button, MwNactivateHandler, file_picker, NULL); 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); MwAddUserHandler(fpicker, MwNfileChosenHandler, file_callback, NULL);
MwSetText(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground); MwSetString(fpicker, MwNbackground, MwGetInteger(fpicker, MwNdarkTheme) ? MwDefaultDarkBackground : MwDefaultBackground);
#ifdef BUG #ifdef BUG
fpicker_wait = MwTRUE; fpicker_wait = MwTRUE;

View file

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

View file

@ -33,10 +33,10 @@ void MWAPI tick(MwWidget handle, void* user, void* call) {
tm = localtime(&t); tm = localtime(&t);
MwStringPrintIntoBuffer(buf, 512, "%s %02d %s", mon[tm->tm_mon], tm->tm_mday, wday[tm->tm_wday]); 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"); 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; render = 1;
@ -141,10 +141,10 @@ int main() {
MwNtitle, "clock", MwNtitle, "clock",
NULL); NULL);
bgcolor = MwParseColor(window, MwGetText(window, MwNbackground)); bgcolor = MwParseColor(window, MwGetString(window, MwNbackground));
MwColorGet(bgcolor, &br, &bg, &bb); MwColorGet(bgcolor, &br, &bg, &bb);
fgcolor = MwParseColor(window, MwGetText(window, MwNforeground)); fgcolor = MwParseColor(window, MwGetString(window, MwNforeground));
MwColorGet(fgcolor, &fr, &fg, &fb); MwColorGet(fgcolor, &fr, &fg, &fb);
opengl = MwCreateWidget(MwOpenGLClass, "clock", window, 0, 0, 100, 100); 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 key Key
* @param value Value * @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 * @brief Sets a pointer property
@ -183,7 +183,7 @@ MWDECL int MWAPI MwGetInteger(MwWidget handle, const char* key);
* @param key Key * @param key Key
* @return Value * @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 * @brief Gets the pointer property

View file

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

View file

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

View file

@ -275,6 +275,7 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
h->destroy_inject = NULL; h->destroy_inject = NULL;
h->prop_inject_pixmap = NULL; h->prop_inject_pixmap = NULL;
h->pixmaps = NULL; h->pixmaps = NULL;
h->colors = NULL;
h->tick_list = NULL; h->tick_list = NULL;
h->destroyed = 0; h->destroyed = 0;
h->bgcolor = NULL; h->bgcolor = NULL;
@ -314,13 +315,13 @@ static MwWidget MwCreateWidget_Internal(MwClass widget_class, const char* name,
if(parent != NULL) arrput(parent->children, h); 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->integer);
sh_new_strdup(h->handler); sh_new_strdup(h->handler);
sh_new_strdup(h->data); sh_new_strdup(h->data);
shdefault(h->integer, MwDEFAULT); shdefault(h->integer, MwDEFAULT);
shdefault(h->text, NULL); shdefault(h->string, NULL);
shdefault(h->handler, NULL); shdefault(h->handler, NULL);
shdefault(h->data, NULL); shdefault(h->data, NULL);
@ -450,11 +451,11 @@ void MwFreeWidget(MwWidget handle) {
shfree(handle->integer); shfree(handle->integer);
for(i = 0; i < shlen(handle->text); i++) { for(i = 0; i < shlen(handle->string); i++) {
free(handle->text[i].value); free(handle->string[i].value);
handle->text[i].value = NULL; handle->string[i].value = NULL;
} }
shfree(handle->text); shfree(handle->string);
for(i = 0; i < shlen(handle->handler); i++) { for(i = 0; i < shlen(handle->handler); i++) {
arrfree(handle->handler[i].value); arrfree(handle->handler[i].value);
} }
@ -467,6 +468,9 @@ void MwFreeWidget(MwWidget handle) {
while(arrlen(handle->pixmaps) > 0) MwDestroyPixmap(handle->pixmaps[0]); while(arrlen(handle->pixmaps) > 0) MwDestroyPixmap(handle->pixmaps[0]);
arrfree(handle->pixmaps); arrfree(handle->pixmaps);
while(arrlen(handle->colors) > 0) MwFreeColor(handle->colors[0]);
arrfree(handle->colors);
arrfree(handle->draw_queue); arrfree(handle->draw_queue);
arrfree(handle->resize_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) { if(handle->widget_class == MwWindowClass && strcmp(key, MwNtitle) == 0) {
MwLLSetTitle(handle->lowlevel, value); MwLLSetTitle(handle->lowlevel, value);
} else { } else {
char* v = value == NULL ? NULL : MwStringDuplicate(value); 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) { if(value != NULL) {
shput(handle->text, key, v); shput(handle->string, key, v);
} else { } else {
shdel(handle->text, key); shdel(handle->string, key);
} }
} }
if(handle->prop_event) { if(handle->prop_event) {
@ -814,13 +818,13 @@ int MwGetInteger(MwWidget handle, const char* key) {
} }
} }
const char* MwGetText(MwWidget handle, const char* key) { const char* MwGetString(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)) { 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; 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; MwWidget h = handle->parent;
while(h != NULL) { while(h != NULL) {
if((v = MwGetText(h, key)) != NULL) break; if((v = MwGetString(h, key)) != NULL) break;
h = h->parent; h = h->parent;
} }
} }
@ -844,7 +848,7 @@ const char* MwGetText(MwWidget handle, const char* key) {
return v; return v;
} }
return shget(handle->text, key); return shget(handle->string, key);
} }
#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2) || defined(USE_GDI_TEXT) #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*); char* t = va_arg(va, char*);
if(only_early && key[1] != 'E') continue; if(only_early && key[1] != 'E') continue;
MwSetText(handle, key, t); MwSetString(handle, key, t);
} else if(key[0] == 'C') { } else if(key[0] == 'C') {
MwUserHandler h = va_arg(va, MwUserHandler); MwUserHandler h = va_arg(va, MwUserHandler);
if(only_early && key[1] != 'E') continue; 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; fb = picker->chosen_color.blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 8, "#%02X%02X%02X", fr, fg, fb); 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); MwSetString(picker->color_display_text, MwNbackground, hexColor);
MwSetText(picker->color_display_text, MwNtext, hexColor); MwSetString(picker->color_display_text, MwNtext, hexColor);
} }
static void MWAPI color_picker_on_change_value(MwWidget handle, void* user, static void MWAPI color_picker_on_change_value(MwWidget handle, void* user,
void* call) { void* call) {
@ -244,7 +244,7 @@ static void MWAPI color_display_text_change(MwWidget handle, void* user,
(void)call; (void)call;
memcpy(&hexColor, MwGetText(handle, MwNtext), 8); memcpy(&hexColor, MwGetString(handle, MwNtext), 8);
color = MwParseColor(handle, hexColor); 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; fb = color->common->blue > 128 ? 0 : 255;
MwStringPrintIntoBuffer(fgColor, 9, "#%02X%02X%02X", fr, fg, fb); 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); MwSetString(picker->color_display_text, MwNbackground, hexColor);
MwSetText(picker->color_display_text, MwNtext, hexColor); MwSetString(picker->color_display_text, MwNtext, hexColor);
picker->chosen_color.red = color->common->red; picker->chosen_color.red = color->common->red;
picker->chosen_color.green = color->common->green; 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), 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); IMG_POS_Y(h) - (PICKER_SIZE / 16) - MARGIN, (PICKER_SIZE / 4), PICKER_SIZE / 16);
MwSetText(picker->color_display_text, MwNbackground, "#FFFFFF"); MwSetString(picker->color_display_text, MwNbackground, "#FFFFFF");
MwSetText(picker->color_display_text, MwNtext, "#FFFFFF"); MwSetString(picker->color_display_text, MwNtext, "#FFFFFF");
/* MwSetInteger(picker->color_display_text, Mwnali, MwALIGNMENT_CENTER); */ /* MwSetInteger(picker->color_display_text, Mwnali, MwALIGNMENT_CENTER); */
MwAddUserHandler(picker->color_display_text, MwNactivateHandler, 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( picker->finish = MwCreateWidget(
MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w), MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w),
IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, (WIN_SIZE - PICKER_SIZE - MARGIN * 4) / 2); 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, MwNhasBorder, 1);
MwSetInteger(picker->finish, MwNinverted, 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) { static void MWAPI okay_activate(MwWidget handle, void* user, void* call) {
filechooser_t* fc = handle->parent->opaque; filechooser_t* fc = handle->parent->opaque;
char* t = (char*)MwGetText(fc->filename, MwNtext); char* t = (char*)MwGetString(fc->filename, MwNtext);
struct stat s; struct stat s;
char* p = NULL; char* p = NULL;
@ -195,7 +195,7 @@ static void MWAPI addr_activate(MwWidget handle, void* user, void* call) {
(void)user; (void)user;
(void)call; (void)call;
scan(handle->parent, MwGetText(handle, MwNtext), 1); scan(handle->parent, MwGetString(handle, MwNtext), 1);
} }
static void layout(MwWidget handle) { static void layout(MwWidget handle) {

View file

@ -42,7 +42,7 @@ static void color_set_disabled_if_disabled(MwWidget handle, MwColor rgb) {
int n; int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && 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) { if(c != NULL) {
rgb->common->red = (MwU8)(rgb->common->red + (c->common->red - rgb->common->red) * 0.5); 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(border) {
if(!handle->lowlevel->common.supports_transparency) { 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) { if(c != NULL) {
MwDrawRect(handle, rect, c); MwDrawRect(handle, rect, c);
@ -403,7 +403,7 @@ void MwDrawCircle(MwWidget handle, MwRect* rect, MwColor color, MwColor backgrou
if(inside) { if(inside) {
MwColor mixColor; 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; double mod;
unsigned char* pout = &data[(y * width + x) * 4]; 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) { void MwPixmapReloadRaw(MwPixmap px, unsigned char* rgb) {
int i; int i;
MwWidget handle = px->handle; 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); if(rgb != NULL) memcpy(px->raw, rgb, px->common->width * px->common->height * 4);
@ -1044,7 +1044,6 @@ void MwDestroyPixmap(MwPixmap pixmap) {
break; break;
} }
} }
if(arrlen(handle->pixmaps) == 0) handle->prop_inject_pixmap = NULL; if(arrlen(handle->pixmaps) == 0) handle->prop_inject_pixmap = NULL;
MwLLDestroyPixmap(pixmap->lowlevel); 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->lowlevel = MwLLAllocColor(handle->lowlevel, red, green, blue);
color->common = &color->lowlevel->common; color->common = &color->lowlevel->common;
color->handle = handle;
return color; return color;
} }
@ -1076,6 +1076,16 @@ void MwColorUpdate(MwColor c, int r, int g, int b) {
} }
void MwFreeColor(MwColor color) { 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); MwLLFreeColor(color->lowlevel);
free(color); free(color);
} }

View file

@ -85,7 +85,7 @@ void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text,
int n; int n;
if((n = MwGetInteger(handle, MwNdisabled)) != MwDEFAULT && 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) { if(c != NULL) {
fadedColor = MwAllocColor(handle, color->common->red, color->common->blue, color->common->green); 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) { static void draw(MwWidget handle) {
MwRect r; MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0; r.x = 0;
r.y = 0; r.y = 0;

View file

@ -15,9 +15,9 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) { static void draw(MwWidget handle) {
MwRect r; MwRect r;
MwPoint point; MwPoint point;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
const char* str = MwGetText(handle, MwNtext); const char* str = MwGetString(handle, MwNtext);
MwPixmap px = MwGetPointer(handle, MwNpixmap); MwPixmap px = MwGetPointer(handle, MwNpixmap);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap); MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
int inv; 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) { static void draw(MwWidget handle) {
MwColor c = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor c = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor cf = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor cf = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor cb = MwParseColor(handle, "#fff"); MwColor cb = MwParseColor(handle, "#fff");
MwColor cb_g = MwParseColor(handle, "#666"); MwColor cb_g = MwParseColor(handle, "#666");
MwColor ct = MwParseColor(handle, "#000"); 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) { static void draw(MwWidget handle) {
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor border = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor border = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwRect r; MwRect r;
MwChart c = handle->internal; MwChart c = handle->internal;
int i; int i;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -13,7 +13,7 @@ static int wcreate(MwWidget handle) {
static void draw(MwWidget handle) { static void draw(MwWidget handle) {
MwRect r; MwRect r;
MwPixmap px = MwGetPointer(handle, MwNpixmap); MwPixmap px = MwGetPointer(handle, MwNpixmap);
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
r.x = 0; r.x = 0;
r.y = 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) { static void draw_seven_segment(MwWidget handle) {
MwRect r; MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow); MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align; int align;
const char* str = MwGetText(handle, MwNtext); const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap); MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
MwLabel lab = handle->internal; MwLabel lab = handle->internal;
int l_one = MwGetInteger(handle, MwNlength) - (MwGetInteger(handle, MwNlength) % 2); 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) { static void draw_normal(MwWidget handle) {
MwRect r; MwRect r;
MwPoint p; MwPoint p;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow); MwColor shadow = MwLightenColor(handle, base, MwDefaultShadow, MwDefaultShadow, MwDefaultShadow);
int align; int align;
const char* str = MwGetText(handle, MwNtext); const char* str = MwGetString(handle, MwNtext);
MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap); MwPixmap bgpx = MwGetPointer(handle, MwNbackgroundPixmap);
if(str == NULL) str = ""; 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) { static void frame_draw(MwWidget handle) {
MwRect r, r2; MwRect r, r2;
MwListBox lb = handle->parent->internal; MwListBox lb = handle->parent->internal;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor base2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground)); MwColor base2 = MwParseColor(handle, MwGetString(handle, MwNsubBackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwColor text2 = MwParseColor(handle, MwGetText(handle, MwNsubForeground)); MwColor text2 = MwParseColor(handle, MwGetString(handle, MwNsubForeground));
int i; int i;
MwPoint p; MwPoint p;
int st = 0; int st = 0;
@ -359,8 +359,8 @@ static void destroy(MwWidget handle) {
static void draw(MwWidget handle) { static void draw(MwWidget handle) {
MwRect r; MwRect r;
MwColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwColor base = MwParseColor(handle, MwGetString(handle, MwNbackground));
MwColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); MwColor text = MwParseColor(handle, MwGetString(handle, MwNforeground));
MwListBox lb = handle->internal; MwListBox lb = handle->internal;
r.x = 0; r.x = 0;

View file

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

View file

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

View file

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

View file

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

View file

@ -55,7 +55,7 @@ static void add_value(MwWidget handle, int mul) {
static void draw(MwWidget handle) { static void draw(MwWidget handle) {
MwRect r = {0}, rt = {0}, rbar = {0}; 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); MwColor dark = MwLightenColor(handle, base, -64, -64, -64);
MwScrollBar scr = handle->internal; MwScrollBar scr = handle->internal;
int or ; int or ;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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