From 5315f4ec4df13f09b73fcd49ff3244385b211ee7 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Wed, 15 Apr 2026 20:21:20 -0700 Subject: [PATCH] classic mac os --- .gitignore | 6 ++ configure | 63 +++++++---- include/Mw/LowLevel/ClassicMacOS.h | 27 +++++ include/Mw/MachDep.h | 17 ++- pl/ostype/ClassicMacOS68k.pl | 7 ++ pl/ostype/ClassicMacOSPPC.pl | 7 ++ pl/rules.pl | 7 ++ src/abstract/directory.c | 12 +++ src/abstract/dynamic.c | 30 ++++++ src/abstract/time.c | 21 ++++ src/backend/classicmacos.c | 167 +++++++++++++++++++++++++++++ src/dialog/filechooser.c | 4 +- src/widget/box.c | 2 +- src/widget/button.c | 2 +- src/widget/checkbox.c | 2 +- src/widget/combobox.c | 2 +- src/widget/entry.c | 2 +- src/widget/frame.c | 2 +- src/widget/image.c | 2 +- src/widget/label.c | 2 +- src/widget/listbox.c | 2 +- src/widget/menu.c | 2 +- src/widget/numberentry.c | 2 +- src/widget/opengl.c | 2 +- src/widget/opengl_cocoa.m | 4 +- src/widget/progressbar.c | 2 +- src/widget/radiobox.c | 2 +- src/widget/scrollbar.c | 8 +- src/widget/separator.c | 2 +- src/widget/submenu.c | 2 +- src/widget/treeview.c | 2 +- src/widget/viewport.c | 2 +- src/widget/vulkan.c | 2 +- src/widget/window.c | 2 +- 34 files changed, 369 insertions(+), 51 deletions(-) create mode 100644 include/Mw/LowLevel/ClassicMacOS.h create mode 100644 pl/ostype/ClassicMacOS68k.pl create mode 100644 pl/ostype/ClassicMacOSPPC.pl create mode 100644 src/backend/classicmacos.c diff --git a/.gitignore b/.gitignore index 88160709..21058b8b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,9 @@ examples/*/*.exe compile_flags.txt .cache .DS_Store + +*.pef +*.dsk +*.bin +*.rsrc +*.finf diff --git a/configure b/configure index 5d981086..5751b3d1 100755 --- a/configure +++ b/configure @@ -46,14 +46,6 @@ param_set("shared", 1); param_set("static", 1); param_set("examples", 1); - -if($target ne "Darwin") { - param_set("freetype2", 1); - param_set("stb-truetype", 0); -} else { - param_set("stb-truetype", 1); -} - my %features = ( "classic-theme" => "use classic theme", "stb-image" => "use stb_image, instead use libjpeg/libpng", @@ -77,13 +69,6 @@ my @features_keys = ( "1wayland", "1gnustep", ); -if($target eq "Linux") { - param_set("x11", 1); - if(!param_get("tiny")){ - param_set("wayland", 1); - } -} - foreach my $l (@ARGV) { if ($l =~ /^--with-([^=]+)=(.+)$/) { param_set($1, $2); @@ -146,6 +131,25 @@ foreach my $l (@ARGV) { } } +if($target ne "Darwin" and $target ne "ClassicMacOS68k" and $target ne "ClassicMacOSPPC") { + param_set("freetype2", 1); + param_set("stb-truetype", 0); +} else { + if($target ne "ClassicMacOS68k" and $target ne "ClassicMacOSPPC"){ + param_set("freetype2", 0); + param_set("stb-truetype", 1); + } else { + param_set("stb-truetype", 0); + } +} + +if($target eq "Linux") { + param_set("x11", 1); + if(!param_get("tiny")){ + param_set("wayland", 1); + } +} + if (-f "./pl/ostype/${target}.pl") { require("./pl/ostype/${target}.pl"); } @@ -256,7 +260,7 @@ foreach my $l (@library_targets) { } print(OUT "${l}: ${s}\n"); - print(OUT " \$(CC) $warn \$\(INCDIR) \$(CFLAGS\) -c -o ${l} ${s}\n"); + print(OUT " \$(CC) $warn \$\(INCDIR\) \$(CFLAGS\) -c -o ${l} ${s}\n"); } print(OUT "\n"); print(OUT "\n"); @@ -274,12 +278,18 @@ if (param_get("examples")) { $libs = $examples_libs{$l}; } - print(OUT -"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n" - ); + if (param_get("shared")) { + print(OUT + "${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n" + ); + } else { + print(OUT + "${l}: ${s}${object_suffix} src/${library_prefix}Mw.a\n" + ); + } if (grep(/^cocoa$/, @backends)) { print(OUT -" \$(CC) -L./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n" +" \$(CC) -L./src -I\$\(INCDIR\) \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n" ); } else { @@ -287,10 +297,23 @@ if (param_get("examples")) { " \$(CC) -L src -Wl,-R./src \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n" ); } + + if($target eq "ClassicMacOS") { + print(OUT +" ".$ENV{RETRO68_TOOLCHAIN_PATH}."/bin/MakePEF ${l} -o ${s}.pef\n"); + print(OUT +" Rez -I ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes ".$ENV{RETRO68_TOOLCHAIN_PATH}."/RIncludes/Retro68APPL.r -DCFRAG_NAME=\"example\" --data ${l}.pef --cc ${l}.dsk -t APPL\n" + ); + print(OUT "${s}${object_suffix}: ${s}.c\n"); print(OUT " \$(CC) -c \$\(INCDIR) -o ${s}${object_suffix} ${s}.c -lMw ${math}\n" ); + + + #print(OUT "Rez -I /path/to/Universal/RIncludes /path/to/libretro/RIncludes/Retro68APPL.r -DCFRAG_NAME="\"MyProgram\"" --data program.pef -o program.bin -t APPL"); + } + } } print(OUT "\n"); diff --git a/include/Mw/LowLevel/ClassicMacOS.h b/include/Mw/LowLevel/ClassicMacOS.h new file mode 100644 index 00000000..01654387 --- /dev/null +++ b/include/Mw/LowLevel/ClassicMacOS.h @@ -0,0 +1,27 @@ +/*! + * @file Mw/LowLevel/ClassicMacOS.h + * @brief ClassicMacOS Backend + * @warning This is used internally + */ +#ifndef __MW_LOWLEVEL_ClassicMacOS_H__ +#define __MW_LOWLEVEL_ClassicMacOS_H__ + +#include +#include +#include + +struct _MwLLClassicMacOS { + struct _MwLLCommon common; +}; + +struct _MwLLClassicMacOSColor { + struct _MwLLCommonColor common; +}; + +struct _MwLLClassicMacOSPixmap { + struct _MwLLCommonPixmap common; +}; + +MWDECL int MwLLClassicMacOSCallInit(void); + +#endif diff --git a/include/Mw/MachDep.h b/include/Mw/MachDep.h index 025fc29b..10a1a04b 100644 --- a/include/Mw/MachDep.h +++ b/include/Mw/MachDep.h @@ -37,17 +37,28 @@ #define GET_WHEEL_DELTA_WPARAM(x) ((short)HIWORD(x)) #endif #endif - +#elif defined(CLASSIC_MAC_OS) +#include +#include +#include +#include +#include +#include +#include +#include #else #include #include -#include #include -#include #include #include #endif +#ifdef __unix__ +#include +#include +#endif + #ifdef __APPLE__ #include #include diff --git a/pl/ostype/ClassicMacOS68k.pl b/pl/ostype/ClassicMacOS68k.pl new file mode 100644 index 00000000..c9ceba8c --- /dev/null +++ b/pl/ostype/ClassicMacOS68k.pl @@ -0,0 +1,7 @@ +use_backend("classicmacos"); + +$cc = $ENV{RETRO68_TOOLCHAIN_PATH}."/bin/m68k-apple-macos-gcc"; +$ar = $ENV{RETRO68_TOOLCHAIN_PATH}."/bin/m68k-apple-macos-ar"; +add_cflags("-DCLASSIC_MAC_OS"); + +1; diff --git a/pl/ostype/ClassicMacOSPPC.pl b/pl/ostype/ClassicMacOSPPC.pl new file mode 100644 index 00000000..b2626d96 --- /dev/null +++ b/pl/ostype/ClassicMacOSPPC.pl @@ -0,0 +1,7 @@ +use_backend("classicmacos"); + +$cc = $ENV{RETRO68_TOOLCHAIN_PATH}."/bin/powerpc-apple-macos-gcc"; +$ar = $ENV{RETRO68_TOOLCHAIN_PATH}."/bin/powerpc-apple-macos-ar"; +add_cflags("-DCLASSIC_MAC_OS"); + +1; diff --git a/pl/rules.pl b/pl/rules.pl index 2b222249..4d68cb94 100644 --- a/pl/rules.pl +++ b/pl/rules.pl @@ -30,6 +30,13 @@ if (grep(/^gdi$/, @backends)) { $gl_libs = "-lopengl32 -lglu32"; } +if (grep(/^classicmacos$/, @backends)) { + #add_cflags("-DCLASSIC_MAC_OS"); + new_object("src/backend/classicmacos.c"); + + $gl_libs = ""; +} + if (grep(/^wayland$/, @backends)) { add_cflags("-DUSE_WAYLAND"); new_object("src/backend/wayland.c"); diff --git a/src/abstract/directory.c b/src/abstract/directory.c index aa516cf4..ac5a382d 100644 --- a/src/abstract/directory.c +++ b/src/abstract/directory.c @@ -6,6 +6,10 @@ typedef struct dir { WIN32_FIND_DATA ffd; int next; } dir_t; +#elif defined(CLASSIC_MAC_OS) +typedef struct dir { + int dummy; +} dir_t; #else typedef struct dir { DIR* dir; @@ -31,6 +35,8 @@ void* MwDirectoryOpen(const char* path) { } free(p); dir->next = 1; +#elif defined(CLASSIC_MAC_OS) +/* todo */ #else if((dir->dir = opendir(path)) == NULL) { free(dir); @@ -47,6 +53,8 @@ void MwDirectoryClose(void* handle) { dir_t* dir = handle; #ifdef _WIN32 FindClose(dir->hFind); +#elif defined(CLASSIC_MAC_OS) +/* todo */ #else closedir(dir->dir); free(dir->base); @@ -80,6 +88,8 @@ MwDirectoryEntry* MwDirectoryRead(void* handle) { entry->mtime = l->QuadPart / 10000000 - 11644473600; dir->next = FindNextFile(dir->hFind, &dir->ffd); +#elif defined(CLASSIC_MAC_OS) +/* todo */ #else struct dirent* d; struct stat s; @@ -123,6 +133,8 @@ char* MwDirectoryCurrent(void) { GetCurrentDirectory(len, out); return out; +#elif CLASSIC_MAC_OS + return ""; #else return getcwd(NULL, 0); #endif diff --git a/src/abstract/dynamic.c b/src/abstract/dynamic.c index 79cad83f..d9558af6 100644 --- a/src/abstract/dynamic.c +++ b/src/abstract/dynamic.c @@ -12,6 +12,36 @@ void* MwDynamicSymbol(void* handle, const char* symbol) { void MwDynamicClose(void* handle) { FreeLibrary(handle); } +#elif defined(CLASSIC_MAC_OS) +void* MwDynamicOpen(const char* path) { + CFragConnectionID connID; + Ptr* addr; + unsigned char err[255]; + + if(GetSharedLibrary((ConstStr63Param)path, kPowerPCCFragArch, kPrivateCFragCopy, + &connID, addr, err)) { + printf("Error getting %s: %s\n", path, err); + return NULL; + }; + return connID; +} + +void* MwDynamicSymbol(void* handle, const char* symbol) { + CFragConnectionID connID = (CFragConnectionID)handle; + Ptr* symAddr; + CFragSymbolClass* symClass; + OSErr err; + if((err = FindSymbol(connID, (ConstStr63Param)symbol, symAddr, symClass))) { + printf("Error getting %s: %d\n", symbol, err); + return NULL; + }; + return symAddr; +} + +void MwDynamicClose(void* handle) { + CFragConnectionID connID = (CFragConnectionID)handle; + CloseConnection(&connID); +} #elif defined(__unix__) || defined(__APPLE__) void* MwDynamicOpen(const char* path) { return dlopen(path, RTLD_LOCAL | RTLD_LAZY); diff --git a/src/abstract/time.c b/src/abstract/time.c index 1050c46d..52d99868 100644 --- a/src/abstract/time.c +++ b/src/abstract/time.c @@ -32,6 +32,27 @@ void MwTimeSleep(int ms) { nanosleep(&ts, NULL); } +#elif defined(CLASSIC_MAC_OS) +static TMTask tm; +static int timer; +void timerUpdateFunc(void) { + timer += 1; + PrimeTime((QElemPtr)&tm, 1); +}; + +long MwTimeGetTick(void) { + UnsignedWide h; + Microseconds(&h); + return *(long*)&h; +} +void MwTimeSleep(int ms) { + tm.tmAddr = NewTimerProc(timerUpdateFunc); + tm.tmWakeUp = 0; + tm.tmReserved = 0; + + InsTime((QElemPtr)&tm); + PrimeTime((QElemPtr)&tm, 1); +} #elif defined(__unix__) long MwTimeGetTick(void) { struct timespec ts; diff --git a/src/backend/classicmacos.c b/src/backend/classicmacos.c new file mode 100644 index 00000000..01a9d973 --- /dev/null +++ b/src/backend/classicmacos.c @@ -0,0 +1,167 @@ +#include + +#include "../../external/stb_ds.h" + +static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) { + MwLL r; + + return r; +} + +static void MwLLDestroyImpl(MwLL handle) { + MwLLDestroyCommon(handle); + + free(handle); +} + +static void MwLLBeginDrawImpl(MwLL handle) { + (void)handle; +} + +static void MwLLEndDrawImpl(MwLL handle) { + (void)handle; +} + +static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLLColor color) { + int i; +} + +static void MwLLLineImpl(MwLL handle, MwPoint* points, MwLLColor color) { +} + +static MwLLColor MwLLAllocColorImpl(MwLL handle, int r, int g, int b) { + MwLLColor c = malloc(sizeof(*c)); + MwLLColorUpdate(handle, c, r, g, b); + return c; +} + +static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) { + c->common.red = r; + c->common.green = g; + c->common.blue = b; +} + +static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h) { + *x = 0; + *y = 0; + *w = 0; + *h = 0; +} + +static void MwLLSetXYImpl(MwLL handle, int x, int y) { +} + +static void MwLLSetWHImpl(MwLL handle, int w, int h) { +} + +static void MwLLFreeColorImpl(MwLLColor color) { + free(color); +} + +static int MwLLPendingImpl(MwLL handle) { + + return 0; +} + +static void MwLLNextEventImpl(MwLL handle) { +} + +static void MwLLSetTitleImpl(MwLL handle, const char* title) { +} + +static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data, int width, int height) { + MwLLPixmap r = malloc(sizeof(*r)); + + r->common.raw = malloc(4 * width * height); + memcpy(r->common.raw, data, 4 * width * height); + + MwLLPixmapUpdate(r); + return r; +} + +static void MwLLPixmapUpdateImpl(MwLLPixmap r) { +} + +static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) { +} + +static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) { +} + +static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) { +} + +static void MwLLForceRenderImpl(MwLL handle) { +} + +static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) { +} + +static void MwLLDetachImpl(MwLL handle, MwPoint* point) { +} + +static void MwLLShowImpl(MwLL handle, int show) { +} + +static void MwLLMakePopupImpl(MwLL handle, MwLL parent) { +} + +static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx, int maxy) { +} + +static void MwLLMakeBorderlessImpl(MwLL handle, int toggle) { +} + +static void MwLLFocusImpl(MwLL handle) { +} + +static void MwLLGrabPointerImpl(MwLL handle, int toggle) { +} + +static void MwLLSetClipboardImpl(MwLL handle, const char* text) { + /* TODO */ + + (void)handle; + (void)text; +} + +static void MwLLGetClipboardImpl(MwLL handle) { +} + +static void MwLLMakeToolWindowImpl(MwLL handle) { +} + +static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) { +} + +static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) { +} + +static void MwLLBeginStateChangeImpl(MwLL handle) { + MwLLShow(handle, 0); +} + +static void MwLLEndStateChangeImpl(MwLL handle) { + MwLLShow(handle, 1); +} + +static void MwLLSetDarkThemeImpl(MwLL handle, int toggle) { + (void)handle; + (void)toggle; +} + +static int MwLLClassicMacOSCallInitImpl(void) { + InitGraf(&qd.thePort); + InitFonts(); + FlushEvents(everyEvent, 0); + InitWindows(); + InitMenus(); + TEInit(); + InitDialogs(0L); + InitCursor(); + + return 0; +} + +#include "call.c" +CALL(ClassicMacOS); diff --git a/src/dialog/filechooser.c b/src/dialog/filechooser.c index cd23faaa..d5faa4ba 100644 --- a/src/dialog/filechooser.c +++ b/src/dialog/filechooser.c @@ -53,7 +53,7 @@ static void destroy(MwWidget handle) { MwDestroyWidget(handle); } -static void cancel(MwWidget handle, void* user, void* call) { +static void filecancel(MwWidget handle, void* user, void* call) { (void)user; (void)call; @@ -147,7 +147,7 @@ static void nav_activate(MwWidget handle, void* user, void* call) { (void)user; if(strcmp(e, "Home") == 0) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(CLASSIC_MAC_OS) #else struct passwd* p = getpwuid(getuid()); diff --git a/src/widget/box.c b/src/widget/box.c index a87000f0..e96c0087 100644 --- a/src/widget/box.c +++ b/src/widget/box.c @@ -2,7 +2,7 @@ #include "../../external/stb_ds.h" -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwBox b = malloc(sizeof(*b)); memset(b, 0, sizeof(*b)); diff --git a/src/widget/button.c b/src/widget/button.c index c5f3a4b9..6653b54e 100644 --- a/src/widget/button.c +++ b/src/widget/button.c @@ -2,7 +2,7 @@ #include "../../external/stb_ds.h" -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNflat, 0); diff --git a/src/widget/checkbox.c b/src/widget/checkbox.c index 1ccccd41..56b8f11a 100644 --- a/src/widget/checkbox.c +++ b/src/widget/checkbox.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNchecked, 0); diff --git a/src/widget/combobox.c b/src/widget/combobox.c index 22a90060..988bb24a 100644 --- a/src/widget/combobox.c +++ b/src/widget/combobox.c @@ -2,7 +2,7 @@ #include "../../external/stb_ds.h" -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwComboBox cb = malloc(sizeof(*cb)); cb->list = NULL; diff --git a/src/widget/entry.c b/src/widget/entry.c index bd7dbe1b..eca5e5ce 100644 --- a/src/widget/entry.c +++ b/src/widget/entry.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwEntry t = malloc(sizeof(*t)); t->cursor = 0; diff --git a/src/widget/frame.c b/src/widget/frame.c index 117b0f8b..6f9d8812 100644 --- a/src/widget/frame.c +++ b/src/widget/frame.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNhasBorder, 0); diff --git a/src/widget/image.c b/src/widget/image.c index 74ee0bfd..90f3cbe7 100644 --- a/src/widget/image.c +++ b/src/widget/image.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNhasBorder, 0); diff --git a/src/widget/label.c b/src/widget/label.c index d29977ca..3c88eb92 100644 --- a/src/widget/label.c +++ b/src/widget/label.c @@ -4,7 +4,7 @@ #define Spacing 1 -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwLabel lab = malloc(sizeof(*lab)); lab->segment = NULL; diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 9960e1d6..7f4ef0b7 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -347,7 +347,7 @@ static void resize(MwWidget handle) { NULL); } -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwListBox lb = malloc(sizeof(*lb)); memset(lb, 0, sizeof(*lb)); diff --git a/src/widget/menu.c b/src/widget/menu.c index 0808f691..b3652788 100644 --- a/src/widget/menu.c +++ b/src/widget/menu.c @@ -18,7 +18,7 @@ static void set_xywh(MwWidget handle) { NULL); } -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwMenu m = malloc(sizeof(*m)); m->name = NULL; diff --git a/src/widget/numberentry.c b/src/widget/numberentry.c index 7c317d36..96860f84 100644 --- a/src/widget/numberentry.c +++ b/src/widget/numberentry.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { int st; MwEntry e; diff --git a/src/widget/opengl.c b/src/widget/opengl.c index d75b358f..582db0cb 100644 --- a/src/widget/opengl.c +++ b/src/widget/opengl.c @@ -101,7 +101,7 @@ typedef struct waylandopengl { } waylandopengl_t; #endif -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { void* r = NULL; MwWidget w = handle; diff --git a/src/widget/opengl_cocoa.m b/src/widget/opengl_cocoa.m index 2397a847..27c21588 100644 --- a/src/widget/opengl_cocoa.m +++ b/src/widget/opengl_cocoa.m @@ -20,7 +20,7 @@ @end -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { void* r = NULL; MwWidget w = handle; @@ -128,4 +128,4 @@ MwClassRec MwOpenGLClassRec = {create, /* create */ NULL, /* children_prop_change */ NULL, /* clipboard */ NULL, NULL, NULL, NULL}; -MwClass MwOpenGLClass = &MwOpenGLClassRec; \ No newline at end of file +MwClass MwOpenGLClass = &MwOpenGLClassRec; diff --git a/src/widget/progressbar.c b/src/widget/progressbar.c index d85a8dda..2a032b09 100644 --- a/src/widget/progressbar.c +++ b/src/widget/progressbar.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwVaApply(handle, MwNminValue, 0, diff --git a/src/widget/radiobox.c b/src/widget/radiobox.c index 3229faad..2416b71d 100644 --- a/src/widget/radiobox.c +++ b/src/widget/radiobox.c @@ -2,7 +2,7 @@ #include "../../external/stb_ds.h" -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNchecked, 0); diff --git a/src/widget/scrollbar.c b/src/widget/scrollbar.c index bb75939c..e11ba6ac 100644 --- a/src/widget/scrollbar.c +++ b/src/widget/scrollbar.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwScrollBar scr = malloc(sizeof(*scr)); handle->internal = scr; @@ -58,9 +58,9 @@ static void draw(MwWidget handle) { MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64); MwScrollBar scr = handle->internal; - int or ; - int uy, dy, ux, dx; - MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); + int or; + int uy, dy, ux, dx; + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); r.x = 0; r.y = 0; diff --git a/src/widget/separator.c b/src/widget/separator.c index 8fcfc5b7..d7d6aae2 100644 --- a/src/widget/separator.c +++ b/src/widget/separator.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNorientation, MwHORIZONTAL); diff --git a/src/widget/submenu.c b/src/widget/submenu.c index 4990fd21..a71d65b0 100644 --- a/src/widget/submenu.c +++ b/src/widget/submenu.c @@ -2,7 +2,7 @@ #include "../../external/stb_ds.h" -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwLLBeginStateChange(handle->lowlevel); MwSetDefault(handle); diff --git a/src/widget/treeview.c b/src/widget/treeview.c index acc35bf6..bd3067c4 100644 --- a/src/widget/treeview.c +++ b/src/widget/treeview.c @@ -297,7 +297,7 @@ static void resize(MwWidget handle) { NULL); } -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwTreeView tv = malloc(sizeof(*tv)); memset(tv, 0, sizeof(*tv)); diff --git a/src/widget/viewport.c b/src/widget/viewport.c index de71af79..38ef8994 100644 --- a/src/widget/viewport.c +++ b/src/widget/viewport.c @@ -74,7 +74,7 @@ static void resize(MwWidget handle) { NULL); } -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwViewport vp = malloc(sizeof(*vp)); memset(vp, 0, sizeof(*vp)); diff --git a/src/widget/vulkan.c b/src/widget/vulkan.c index 8d4aa3da..ab73fcaf 100644 --- a/src/widget/vulkan.c +++ b/src/widget/vulkan.c @@ -116,7 +116,7 @@ static int vulkan_instance_setup(MwWidget handle, vulkan_t* o); static int vulkan_surface_setup(MwWidget handle, vulkan_t* o); static int vulkan_devices_setup(MwWidget handle, vulkan_t* o); -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { vulkan_t* o = malloc(sizeof(*o)); int err; diff --git a/src/widget/window.c b/src/widget/window.c index 979e073c..b4aaa8d2 100644 --- a/src/widget/window.c +++ b/src/widget/window.c @@ -1,6 +1,6 @@ #include -static int create(MwWidget handle) { +static int wcreate(MwWidget handle) { MwSetDefault(handle); MwSetInteger(handle, MwNhasBorder, 0);