classic mac os
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit
This commit is contained in:
parent
6f9b3c12a7
commit
5315f4ec4d
34 changed files with 369 additions and 51 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -19,3 +19,9 @@ examples/*/*.exe
|
||||||
compile_flags.txt
|
compile_flags.txt
|
||||||
.cache
|
.cache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
*.pef
|
||||||
|
*.dsk
|
||||||
|
*.bin
|
||||||
|
*.rsrc
|
||||||
|
*.finf
|
||||||
|
|
|
||||||
63
configure
vendored
63
configure
vendored
|
|
@ -46,14 +46,6 @@ param_set("shared", 1);
|
||||||
param_set("static", 1);
|
param_set("static", 1);
|
||||||
param_set("examples", 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 = (
|
my %features = (
|
||||||
"classic-theme" => "use classic theme",
|
"classic-theme" => "use classic theme",
|
||||||
"stb-image" => "use stb_image, instead use libjpeg/libpng",
|
"stb-image" => "use stb_image, instead use libjpeg/libpng",
|
||||||
|
|
@ -77,13 +69,6 @@ my @features_keys = (
|
||||||
"1wayland", "1gnustep",
|
"1wayland", "1gnustep",
|
||||||
);
|
);
|
||||||
|
|
||||||
if($target eq "Linux") {
|
|
||||||
param_set("x11", 1);
|
|
||||||
if(!param_get("tiny")){
|
|
||||||
param_set("wayland", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $l (@ARGV) {
|
foreach my $l (@ARGV) {
|
||||||
if ($l =~ /^--with-([^=]+)=(.+)$/) {
|
if ($l =~ /^--with-([^=]+)=(.+)$/) {
|
||||||
param_set($1, $2);
|
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") {
|
if (-f "./pl/ostype/${target}.pl") {
|
||||||
require("./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 "${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");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
@ -274,12 +278,18 @@ if (param_get("examples")) {
|
||||||
$libs = $examples_libs{$l};
|
$libs = $examples_libs{$l};
|
||||||
}
|
}
|
||||||
|
|
||||||
print(OUT
|
if (param_get("shared")) {
|
||||||
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
|
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)) {
|
if (grep(/^cocoa$/, @backends)) {
|
||||||
print(OUT
|
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 {
|
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"
|
" \$(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 "${s}${object_suffix}: ${s}.c\n");
|
||||||
print(OUT
|
print(OUT
|
||||||
" \$(CC) -c \$\(INCDIR) -o ${s}${object_suffix} ${s}.c -lMw ${math}\n"
|
" \$(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");
|
print(OUT "\n");
|
||||||
|
|
|
||||||
27
include/Mw/LowLevel/ClassicMacOS.h
Normal file
27
include/Mw/LowLevel/ClassicMacOS.h
Normal file
|
|
@ -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 <Mw/MachDep.h>
|
||||||
|
#include <Mw/TypeDefs.h>
|
||||||
|
#include <Mw/LowLevel.h>
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOS {
|
||||||
|
struct _MwLLCommon common;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOSColor {
|
||||||
|
struct _MwLLCommonColor common;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _MwLLClassicMacOSPixmap {
|
||||||
|
struct _MwLLCommonPixmap common;
|
||||||
|
};
|
||||||
|
|
||||||
|
MWDECL int MwLLClassicMacOSCallInit(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -37,17 +37,28 @@
|
||||||
#define GET_WHEEL_DELTA_WPARAM(x) ((short)HIWORD(x))
|
#define GET_WHEEL_DELTA_WPARAM(x) ((short)HIWORD(x))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <MacTypes.h>
|
||||||
|
#include <CFBundle.h>
|
||||||
|
#include <CodeFragments.h>
|
||||||
|
#include <Timer.h>
|
||||||
|
#include <MacWindows.h>
|
||||||
|
#include <TextEdit.h>
|
||||||
|
#include <Dialogs.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <dirent.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __unix__
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <mach/clock.h>
|
#include <mach/clock.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
|
|
|
||||||
7
pl/ostype/ClassicMacOS68k.pl
Normal file
7
pl/ostype/ClassicMacOS68k.pl
Normal file
|
|
@ -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;
|
||||||
7
pl/ostype/ClassicMacOSPPC.pl
Normal file
7
pl/ostype/ClassicMacOSPPC.pl
Normal file
|
|
@ -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;
|
||||||
|
|
@ -30,6 +30,13 @@ if (grep(/^gdi$/, @backends)) {
|
||||||
$gl_libs = "-lopengl32 -lglu32";
|
$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)) {
|
if (grep(/^wayland$/, @backends)) {
|
||||||
add_cflags("-DUSE_WAYLAND");
|
add_cflags("-DUSE_WAYLAND");
|
||||||
new_object("src/backend/wayland.c");
|
new_object("src/backend/wayland.c");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ typedef struct dir {
|
||||||
WIN32_FIND_DATA ffd;
|
WIN32_FIND_DATA ffd;
|
||||||
int next;
|
int next;
|
||||||
} dir_t;
|
} dir_t;
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
typedef struct dir {
|
||||||
|
int dummy;
|
||||||
|
} dir_t;
|
||||||
#else
|
#else
|
||||||
typedef struct dir {
|
typedef struct dir {
|
||||||
DIR* dir;
|
DIR* dir;
|
||||||
|
|
@ -31,6 +35,8 @@ void* MwDirectoryOpen(const char* path) {
|
||||||
}
|
}
|
||||||
free(p);
|
free(p);
|
||||||
dir->next = 1;
|
dir->next = 1;
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
/* todo */
|
||||||
#else
|
#else
|
||||||
if((dir->dir = opendir(path)) == NULL) {
|
if((dir->dir = opendir(path)) == NULL) {
|
||||||
free(dir);
|
free(dir);
|
||||||
|
|
@ -47,6 +53,8 @@ void MwDirectoryClose(void* handle) {
|
||||||
dir_t* dir = handle;
|
dir_t* dir = handle;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
FindClose(dir->hFind);
|
FindClose(dir->hFind);
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
/* todo */
|
||||||
#else
|
#else
|
||||||
closedir(dir->dir);
|
closedir(dir->dir);
|
||||||
free(dir->base);
|
free(dir->base);
|
||||||
|
|
@ -80,6 +88,8 @@ MwDirectoryEntry* MwDirectoryRead(void* handle) {
|
||||||
entry->mtime = l->QuadPart / 10000000 - 11644473600;
|
entry->mtime = l->QuadPart / 10000000 - 11644473600;
|
||||||
|
|
||||||
dir->next = FindNextFile(dir->hFind, &dir->ffd);
|
dir->next = FindNextFile(dir->hFind, &dir->ffd);
|
||||||
|
#elif defined(CLASSIC_MAC_OS)
|
||||||
|
/* todo */
|
||||||
#else
|
#else
|
||||||
struct dirent* d;
|
struct dirent* d;
|
||||||
struct stat s;
|
struct stat s;
|
||||||
|
|
@ -123,6 +133,8 @@ char* MwDirectoryCurrent(void) {
|
||||||
GetCurrentDirectory(len, out);
|
GetCurrentDirectory(len, out);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
#elif CLASSIC_MAC_OS
|
||||||
|
return "";
|
||||||
#else
|
#else
|
||||||
return getcwd(NULL, 0);
|
return getcwd(NULL, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,36 @@ void* MwDynamicSymbol(void* handle, const char* symbol) {
|
||||||
void MwDynamicClose(void* handle) {
|
void MwDynamicClose(void* handle) {
|
||||||
FreeLibrary(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__)
|
#elif defined(__unix__) || defined(__APPLE__)
|
||||||
void* MwDynamicOpen(const char* path) {
|
void* MwDynamicOpen(const char* path) {
|
||||||
return dlopen(path, RTLD_LOCAL | RTLD_LAZY);
|
return dlopen(path, RTLD_LOCAL | RTLD_LAZY);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,27 @@ void MwTimeSleep(int ms) {
|
||||||
|
|
||||||
nanosleep(&ts, NULL);
|
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__)
|
#elif defined(__unix__)
|
||||||
long MwTimeGetTick(void) {
|
long MwTimeGetTick(void) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
|
||||||
167
src/backend/classicmacos.c
Normal file
167
src/backend/classicmacos.c
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
|
#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);
|
||||||
|
|
@ -53,7 +53,7 @@ static void destroy(MwWidget handle) {
|
||||||
MwDestroyWidget(handle);
|
MwDestroyWidget(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cancel(MwWidget handle, void* user, void* call) {
|
static void filecancel(MwWidget handle, void* user, void* call) {
|
||||||
(void)user;
|
(void)user;
|
||||||
(void)call;
|
(void)call;
|
||||||
|
|
||||||
|
|
@ -147,7 +147,7 @@ static void nav_activate(MwWidget handle, void* user, void* call) {
|
||||||
(void)user;
|
(void)user;
|
||||||
|
|
||||||
if(strcmp(e, "Home") == 0) {
|
if(strcmp(e, "Home") == 0) {
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(CLASSIC_MAC_OS)
|
||||||
#else
|
#else
|
||||||
struct passwd* p = getpwuid(getuid());
|
struct passwd* p = getpwuid(getuid());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwBox b = malloc(sizeof(*b));
|
MwBox b = malloc(sizeof(*b));
|
||||||
memset(b, 0, sizeof(*b));
|
memset(b, 0, sizeof(*b));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNflat, 0);
|
MwSetInteger(handle, MwNflat, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNchecked, 0);
|
MwSetInteger(handle, MwNchecked, 0);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwComboBox cb = malloc(sizeof(*cb));
|
MwComboBox cb = malloc(sizeof(*cb));
|
||||||
|
|
||||||
cb->list = NULL;
|
cb->list = NULL;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwEntry t = malloc(sizeof(*t));
|
MwEntry t = malloc(sizeof(*t));
|
||||||
|
|
||||||
t->cursor = 0;
|
t->cursor = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNhasBorder, 0);
|
MwSetInteger(handle, MwNhasBorder, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNhasBorder, 0);
|
MwSetInteger(handle, MwNhasBorder, 0);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#define Spacing 1
|
#define Spacing 1
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwLabel lab = malloc(sizeof(*lab));
|
MwLabel lab = malloc(sizeof(*lab));
|
||||||
|
|
||||||
lab->segment = NULL;
|
lab->segment = NULL;
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ static void resize(MwWidget handle) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwListBox lb = malloc(sizeof(*lb));
|
MwListBox lb = malloc(sizeof(*lb));
|
||||||
memset(lb, 0, sizeof(*lb));
|
memset(lb, 0, sizeof(*lb));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ static void set_xywh(MwWidget handle) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwMenu m = malloc(sizeof(*m));
|
MwMenu m = malloc(sizeof(*m));
|
||||||
|
|
||||||
m->name = NULL;
|
m->name = NULL;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
int st;
|
int st;
|
||||||
MwEntry e;
|
MwEntry e;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ typedef struct waylandopengl {
|
||||||
} waylandopengl_t;
|
} waylandopengl_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
void* r = NULL;
|
void* r = NULL;
|
||||||
MwWidget w = handle;
|
MwWidget w = handle;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
void* r = NULL;
|
void* r = NULL;
|
||||||
MwWidget w = handle;
|
MwWidget w = handle;
|
||||||
|
|
||||||
|
|
@ -128,4 +128,4 @@ MwClassRec MwOpenGLClassRec = {create, /* create */
|
||||||
NULL, /* children_prop_change */
|
NULL, /* children_prop_change */
|
||||||
NULL, /* clipboard */
|
NULL, /* clipboard */
|
||||||
NULL, NULL, NULL, NULL};
|
NULL, NULL, NULL, NULL};
|
||||||
MwClass MwOpenGLClass = &MwOpenGLClassRec;
|
MwClass MwOpenGLClass = &MwOpenGLClassRec;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
MwVaApply(handle,
|
MwVaApply(handle,
|
||||||
MwNminValue, 0,
|
MwNminValue, 0,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNchecked, 0);
|
MwSetInteger(handle, MwNchecked, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwScrollBar scr = malloc(sizeof(*scr));
|
MwScrollBar scr = malloc(sizeof(*scr));
|
||||||
|
|
||||||
handle->internal = scr;
|
handle->internal = scr;
|
||||||
|
|
@ -58,9 +58,9 @@ static void draw(MwWidget handle) {
|
||||||
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground));
|
||||||
MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64);
|
MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64);
|
||||||
MwScrollBar scr = handle->internal;
|
MwScrollBar scr = handle->internal;
|
||||||
int or ;
|
int or;
|
||||||
int uy, dy, ux, dx;
|
int uy, dy, ux, dx;
|
||||||
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap);
|
||||||
|
|
||||||
r.x = 0;
|
r.x = 0;
|
||||||
r.y = 0;
|
r.y = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNorientation, MwHORIZONTAL);
|
MwSetInteger(handle, MwNorientation, MwHORIZONTAL);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwLLBeginStateChange(handle->lowlevel);
|
MwLLBeginStateChange(handle->lowlevel);
|
||||||
|
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ static void resize(MwWidget handle) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwTreeView tv = malloc(sizeof(*tv));
|
MwTreeView tv = malloc(sizeof(*tv));
|
||||||
memset(tv, 0, sizeof(*tv));
|
memset(tv, 0, sizeof(*tv));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ static void resize(MwWidget handle) {
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwViewport vp = malloc(sizeof(*vp));
|
MwViewport vp = malloc(sizeof(*vp));
|
||||||
memset(vp, 0, sizeof(*vp));
|
memset(vp, 0, sizeof(*vp));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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_surface_setup(MwWidget handle, vulkan_t* o);
|
||||||
static int vulkan_devices_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));
|
vulkan_t* o = malloc(sizeof(*o));
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
||||||
static int create(MwWidget handle) {
|
static int wcreate(MwWidget handle) {
|
||||||
MwSetDefault(handle);
|
MwSetDefault(handle);
|
||||||
|
|
||||||
MwSetInteger(handle, MwNhasBorder, 0);
|
MwSetInteger(handle, MwNhasBorder, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue