beginnings of drag and drop #33

Merged
IoI_xD merged 8 commits from dnd into master 2026-07-23 11:45:02 +09:00
Showing only changes of commit d375e28af8 - Show all commits

undo accidental clang-format
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

IoIxD 2026-07-22 19:37:03 -07:00

88
configure vendored
View file

@ -7,8 +7,7 @@ $target = ~s /\r ?\n$ //;
$target = "Windows"; $target = "Windows";
} }
foreach foreach my $l (@ARGV) {
my $l(@ARGV) {
if ($l =~ /^--.+$/) { if ($l =~ /^--.+$/) {
} }
elsif ($l =~ /^(.+)=(.+)$/) { elsif ($l =~ /^(.+)=(.+)$/) {
@ -55,7 +54,8 @@ param_set("examples", 1);
# (option that only makes sense on x11) # (option that only makes sense on x11)
param_set("allow-sloppy-focus", 0); param_set("allow-sloppy-focus", 0);
my % features = ("classic-theme" = > "use classic theme", my %features = (
"classic-theme" => "use classic theme",
"stb-image" => "use stb_image, instead use libjpeg/libpng", "stb-image" => "use stb_image, instead use libjpeg/libpng",
"stb-truetype" => "use stb_truetype", "stb-truetype" => "use stb_truetype",
"freetype2" => "use FreeType2", "freetype2" => "use FreeType2",
@ -69,25 +69,26 @@ my % features = ("classic-theme" = > "use classic theme",
"wayland" => "enable wayland backend", "wayland" => "enable wayland backend",
"gnustep" => "use gnustep", "gnustep" => "use gnustep",
"dbus" => "use DBus on supported platform", "dbus" => "use DBus on supported platform",
"allow-sloppy-focus" = > "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus"); "allow-sloppy-focus" => "prevent the x11 backend from using XSetInputFocus to enforce click-to-focus"
my @features_keys = ("1classic-theme", "1stb-image", );
my @features_keys = (
"1classic-theme", "1stb-image",
"1stb-truetype", "1freetype2", "1gdi-text", "1stb-truetype", "1freetype2", "1gdi-text",
"1opengl", "2xrender", "1opengl", "2xrender",
"1vulkan", "2vulkan-string-helper", "1vulkan", "2vulkan-string-helper",
"1shared", "1static", "1shared", "1static",
"1wayland", "1gnustep", "1wayland", "1gnustep",
"1dbus"); "1dbus"
);
sub def_platform { sub def_platform {
if($target eq "Windows") { if($target eq "Windows") {
param_set("freetype2", 0); param_set("freetype2", 0);
param_set("stb-truetype", 0); param_set("stb-truetype", 0);
} } elsif($target ne "Darwin" and $target ne "ClassicMacOS" and $target ne "Haiku") {
elsif($target ne "Darwin" and $target ne "ClassicMacOS" and $target ne "Haiku") {
param_set("freetype2", 1); param_set("freetype2", 1);
param_set("stb-truetype", 0); param_set("stb-truetype", 0);
} } else {
else {
param_set("freetype2", 0); param_set("freetype2", 0);
param_set("stb-truetype", 1); param_set("stb-truetype", 1);
} }
@ -109,8 +110,7 @@ sub def_platform {
} }
} }
foreach foreach my $l (@ARGV) {
my $l(@ARGV) {
if ($l =~ /^--target=(.+)$/) { if ($l =~ /^--target=(.+)$/) {
$target = $1; $target = $1;
} }
@ -118,8 +118,8 @@ foreach
def_platform(); def_platform();
foreach
my $l(@ARGV) { foreach my $l (@ARGV) {
if ($l =~ /^--with-([^=]+)=(.+)$/) { if ($l =~ /^--with-([^=]+)=(.+)$/) {
param_set($1, $2); param_set($1, $2);
} }
@ -161,12 +161,12 @@ foreach
print(" --disable-FEATURE Do not use FEATURE\n"); print(" --disable-FEATURE Do not use FEATURE\n");
print(" --without-FEATURE Do not use FEATURE\n"); print(" --without-FEATURE Do not use FEATURE\n");
foreach foreach my $l (@features_keys) {
my $l(@features_keys) { my $flag = (
my $flag = ((substr($l, 0, 1) eq '1') (substr($l, 0, 1) eq '1')
? (param_get(substr($l, 1)) ? "--disable-" : "--enable-") ? (param_get(substr($l, 1)) ? "--disable-" : "--enable-")
: (param_get(substr($l, 1)) ? "--without-" : "--with-")) : (param_get(substr($l, 1)) ? "--without-" : "--with-")
.substr($l, 1); ) . substr($l, 1);
my $do = param_get(substr($l, 1)) ? "Do not " : ""; my $do = param_get(substr($l, 1)) ? "Do not " : "";
my $feat = $features{ substr($l, 1) }; my $feat = $features{ substr($l, 1) };
if (not(param_get(substr($l, 1)))) { if (not(param_get(substr($l, 1)))) {
@ -180,9 +180,11 @@ foreach
if (-f "./pl/ostype/${target}.pl") { if (-f "./pl/ostype/${target}.pl") {
require("./pl/ostype/${target}.pl"); require("./pl/ostype/${target}.pl");
} else { }
else {
print( print(
"Perl file (pl/ostype/${target}.pl) was not found for your target. Please add one.\n"); "Perl file (pl/ostype/${target}.pl) was not found for your target. Please add one.\n"
);
exit(1); exit(1);
} }
@ -191,8 +193,7 @@ require("./pl/rules.pl");
print("Target : " . $target . "\n"); print("Target : " . $target . "\n");
my @l = (); my @l = ();
foreach foreach my $e (param_list()) {
my $e(param_list()) {
if (not(param_get($e))) { if (not(param_get($e))) {
next; next;
} }
@ -233,15 +234,18 @@ print(OUT "install: lib\n");
print(OUT print(OUT
" mkdir -p \$(DESTDIR)\$(PREFIX)/lib \$(DESTDIR)\$(PREFIX)/include\n"); " mkdir -p \$(DESTDIR)\$(PREFIX)/lib \$(DESTDIR)\$(PREFIX)/include\n");
print(OUT print(OUT
" -cp src/${library_prefix}Mw${library_suffix} \$(DESTDIR)\$(PREFIX)/lib/\n"); " -cp src/${library_prefix}Mw${library_suffix} \$(DESTDIR)\$(PREFIX)/lib/\n"
);
print(OUT " -cp src/libMw.a \$(DESTDIR)\$(PREFIX)/lib/\n"); print(OUT " -cp src/libMw.a \$(DESTDIR)\$(PREFIX)/lib/\n");
print(OUT " cp -rf include \$(DESTDIR)\$(PREFIX)/\n"); print(OUT " cp -rf include \$(DESTDIR)\$(PREFIX)/\n");
print(OUT "\n"); print(OUT "\n");
print(OUT "format:\n"); print(OUT "format:\n");
print(OUT print(OUT
" clang-format --verbose -i `find tools src include examples \"(\" -name \"*.c\" -or -name \"*.cc\" -or -name \"*.h\" -or -name \"*.m\" \")\" -and -not -name \"*ttf.c\"`\n"); " clang-format --verbose -i `find tools src include examples \"(\" -name \"*.c\" -or -name \"*.cc\" -or -name \"*.h\" -or -name \"*.m\" \")\" -and -not -name \"*ttf.c\"`\n"
);
print(OUT print(OUT
" perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"); " perltidy -b -bext=\"/\" --paren-tightness=2 `find tools pl configure -name \"*.pl\"`\n"
);
print(OUT "\n"); print(OUT "\n");
print(OUT "lib:"); print(OUT "lib:");
@ -272,8 +276,7 @@ if(param_get("static")) {
print(OUT " \$(AR) rcs src/libMw.a " . join(" ", @library_targets) . "\n"); print(OUT " \$(AR) rcs src/libMw.a " . join(" ", @library_targets) . "\n");
} }
foreach foreach my $l (@library_targets) {
my $l(@library_targets) {
my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value"; my $warn = "-Wall -Wextra -Wno-sign-compare -Wno-unused-value";
my $s = $l; my $s = $l;
my $compiler = "CC"; my $compiler = "CC";
@ -303,8 +306,7 @@ print(OUT "\n");
if (param_get("examples")) { if (param_get("examples")) {
print(OUT "examples: " . join(" ", @examples_targets) . "\n"); print(OUT "examples: " . join(" ", @examples_targets) . "\n");
print(OUT "\n"); print(OUT "\n");
foreach foreach my $l (@examples_targets) {
my $l(@examples_targets) {
my $libs = ""; my $libs = "";
my $s = $l; my $s = $l;
my $o = $executable_suffix; my $o = $executable_suffix;
@ -317,32 +319,36 @@ if(param_get("examples")) {
if (param_get("shared")) { if (param_get("shared")) {
print(OUT print(OUT
"${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"); "${l}: ${s}${object_suffix} src/${library_prefix}Mw${library_suffix}\n"
);
} else { } else {
print(OUT print(OUT
"${l}: ${s}${object_suffix} src/${library_prefix}Mw.a\n"); "${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 \$\(LIBDIR) -o ${l} ${s}${object_suffix} -lMw ${math} ${libs}\n"
} else { );
}
else {
print(OUT print(OUT
" \$(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") { if($target eq "ClassicMacOS") {
print(OUT print(OUT
" ".$ENV{RETRO68_TOOLCHAIN_PATH} " ".$ENV{RETRO68_TOOLCHAIN_PATH}."/bin/MakePEF ${l} -o ${s}.pef\n");
."/bin/MakePEF ${l} -o ${s}.pef\n");
print(OUT print(OUT
" Rez -I ".$ENV{RETRO68_TOOLCHAIN_PATH} " 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"
."/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 "\n"); print(OUT "\n");