git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@295 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-12 10:34:22 +00:00
parent f79b7469b7
commit a0ffac278b
11 changed files with 912 additions and 3859 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 498 B

File diff suppressed because it is too large Load Diff

View File

@@ -59,7 +59,7 @@ static void llclosehandler(MwLL handle, void* data) {
MwDispatchUserHandler(h, MwNcloseHandler, NULL); MwDispatchUserHandler(h, MwNcloseHandler, NULL);
h = h->parent; h = h->parent;
} }
}else{ } else {
h->close = 1; h->close = 1;
} }
} }

View File

@@ -8,19 +8,15 @@ print(OUT "/* \$Id\$ */\n");
print(OUT "#include <Mw/Milsko.h>\n"); print(OUT "#include <Mw/Milsko.h>\n");
print(OUT "\n"); print(OUT "\n");
print(OUT "MwLLColor MwParseColorName(MwWidget handle, const char* color){\n"); print(OUT "MwLLColor MwParseColorName(MwWidget handle, const char* color){\n");
print(OUT " int r = 0, g = 0, b = 0;\n");
print(OUT " \n");
while (my $l = <IN>) { while (my $l = <IN>) {
$l =~ s/\r?\n$//; $l =~ s/\r?\n$//;
if ($l =~ /^[ \t]*([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+(.+)$/) { if ($l =~ /^[ \t]*([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+(.+)$/) {
print(OUT " if(strcmp(color, \"$4\") == 0){\n"); print(OUT
print(OUT " r = $1;\n"); " if(strcmp(color, \"$4\") == 0) return MwLLAllocColor(handle->lowlevel, $1, $2, $3);\n"
print(OUT " g = $2;\n"); );
print(OUT " b = $3;\n");
print(OUT " }\n");
} }
} }
print(OUT " return MwLLAllocColor(handle->lowlevel, r, g, b);\n"); print(OUT " return MwLLAllocColor(handle->lowlevel, 0, 0, 0);\n");
print(OUT "}\n"); print(OUT "}\n");
close(OUT); close(OUT);

View File

@@ -1,175 +1,187 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# $Id$ # $Id$
my @cfiles = (); my @cfiles = ();
my @cxxfiles = (); my @cxxfiles = ();
sub scan { sub scan {
opendir(DIR, $_[0]); opendir(DIR, $_[0]);
my @files = readdir(DIR); my @files = readdir(DIR);
foreach my $f (@files){ foreach my $f (@files) {
if($f =~ /^vulkan\.cc?$/){ if ($f =~ /^vulkan\.cc?$/) {
next; next;
} }
if($f =~ /\.c$/){ if ($f =~ /\.c$/) {
push(@cfiles, $_[0] . "/" . $f); push(@cfiles, $_[0] . "/" . $f);
}elsif($f =~ /\.cc$/){ }
push(@cxxfiles, $_[0] . "/" . $f); elsif ($f =~ /\.cc$/) {
} push(@cxxfiles, $_[0] . "/" . $f);
} }
closedir(DIR); }
closedir(DIR);
} }
sub cobjs { sub cobjs {
my $r = ""; my $r = "";
foreach my $f (@cfiles){ foreach my $f (@cfiles) {
my $b = $f; my $b = $f;
$b =~ s/\.cc?$/.obj/; $b =~ s/\.cc?$/.obj/;
$b =~ s/\//$_[0]/g; $b =~ s/\//$_[0]/g;
$r = $r . " " . $_[1] . $b; $r = $r . " " . $_[1] . $b;
} }
return $r; return $r;
} }
sub cxxobjs { sub cxxobjs {
my $r = ""; my $r = "";
foreach my $f (@cxxfiles){ foreach my $f (@cxxfiles) {
my $b = $f; my $b = $f;
$b =~ s/\.cc?$/.obj/; $b =~ s/\.cc?$/.obj/;
$b =~ s/\//$_[0]/g; $b =~ s/\//$_[0]/g;
$r = $r . " " . $_[1] . $b; $r = $r . " " . $_[1] . $b;
} }
return $r; return $r;
} }
sub generate { sub generate {
my ($output, $type) = @_; my ($output, $type) = @_;
my $cc = ""; my $cc = "";
my $cxx = ""; my $cxx = "";
my $link = ""; my $link = "";
my $suffix = 1; my $suffix = 1;
my $symbolic = ""; my $symbolic = "";
my $dir = "\\"; my $dir = "\\";
my $del = "del /f /q"; my $del = "del /f /q";
my $out = ""; my $out = "";
my $dllout = ""; my $dllout = "";
my $def = ""; my $def = "";
my $inc = ""; my $inc = "";
my $dll = ""; my $dll = "";
my $prefobj = ""; my $prefobj = "";
my $needlibs = ""; my $needlibs = "";
my $lib = ""; my $lib = "";
my $c_dllout = ""; my $c_dllout = "";
my $cxx_dllout = ""; my $cxx_dllout = "";
my $c_dllafter = ""; my $c_dllafter = "";
my $cxx_dllafter = ""; my $cxx_dllafter = "";
if($type eq "Borland"){ if ($type eq "Borland") {
$cc = "bcc32 -c"; $cc = "bcc32 -c";
$cxx = "bcc32 -c -P"; $cxx = "bcc32 -c -P";
$link = "bcc32"; $link = "bcc32";
$out = "-o"; $out = "-o";
$dllout = "-e"; $dllout = "-e";
$def = "-D"; $def = "-D";
$inc = "-I"; $inc = "-I";
$dll = "-tWD"; $dll = "-tWD";
$lib = "-l"; $lib = "-l";
$c_dllafter = "implib src${dir}Mw.lib src${dir}Mw.dll"; $c_dllafter = "implib src${dir}Mw.lib src${dir}Mw.dll";
$cxx_dllafter = "implib oosrc${dir}MwOO.lib oosrc${dir}MwOO.dll"; $cxx_dllafter = "implib oosrc${dir}MwOO.lib oosrc${dir}MwOO.dll";
}elsif($type eq "MSVC"){ }
$cc = "cl /TC /c /nologo"; elsif ($type eq "MSVC") {
$cxx = "cl /TP /c /nologo"; $cc = "cl /TC /c /nologo";
$link = "link /nologo"; $cxx = "cl /TP /c /nologo";
$out = "/Fo"; $link = "link /nologo";
$dllout = "/OUT:"; $out = "/Fo";
$def = "/D"; $dllout = "/OUT:";
$inc = "/I"; $def = "/D";
$dll = "/DLL"; $inc = "/I";
}elsif($type eq "Watcom"){ $dll = "/DLL";
$cc = "wcc386 -bt=nt -q"; }
$cxx = "wpp386 -bt=nt -q"; elsif ($type eq "Watcom") {
$link = "wlink"; $cc = "wcc386 -bt=nt -q";
$out = "-fo="; $cxx = "wpp386 -bt=nt -q";
$dllout = "name "; $link = "wlink";
$def = "-d"; $out = "-fo=";
$inc = "-i="; $dllout = "name ";
$dll = "system nt_dll"; $def = "-d";
$lib = "library "; $inc = "-i=";
$dll = "system nt_dll";
$lib = "library ";
$suffix = 0; # is watcom make broken with suffix rule $suffix = 0; # is watcom make broken with suffix rule
$symbolic = ".SYMBOLIC"; $symbolic = ".SYMBOLIC";
$dir = "/"; $dir = "/";
$del = "%erase"; $del = "%erase";
$prefobj = "file "; $prefobj = "file ";
$needlibs = "${lib}clib3r.lib"; $needlibs = "${lib}clib3r.lib";
$c_dllout = "option implib=src${dir}Mw.lib"; $c_dllout = "option implib=src${dir}Mw.lib";
$cxx_dllout = "option implib=oosrc${dir}MwOO.lib"; $cxx_dllout = "option implib=oosrc${dir}MwOO.lib";
} }
open(OUT, ">", $output); open(OUT, ">", $output);
print(OUT "# \$Id\$\n"); print(OUT "# \$Id\$\n");
print(OUT "CC = $cc\n"); print(OUT "CC = $cc\n");
print(OUT "CXX = $cxx\n"); print(OUT "CXX = $cxx\n");
print(OUT "LD = $link\n"); print(OUT "LD = $link\n");
print(OUT "\n"); print(OUT "\n");
print(OUT "CFLAGS = ${inc}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n"); print(OUT
print(OUT "CXXFLAGS = ${inc}include\n"); "CFLAGS = ${inc}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n"
print(OUT "LDFLAGS = $dll"); );
print(OUT "\n"); print(OUT "CXXFLAGS = ${inc}include\n");
if($suffix){ print(OUT "LDFLAGS = $dll");
print(OUT ".SUFFIXES: .c .cc .obj\n"); print(OUT "\n");
}
print(OUT "all: src${dir}Mw.dll oosrc${dir}MwOO.dll\n"); if ($suffix) {
print(OUT "clean: $symbolic\n"); print(OUT ".SUFFIXES: .c .cc .obj\n");
foreach my $f (@cfiles){ }
my $b = $f; print(OUT "all: src${dir}Mw.dll oosrc${dir}MwOO.dll\n");
$b =~ s/\.cc?$/.obj/; print(OUT "clean: $symbolic\n");
$b =~ s/\//$dir/g; foreach my $f (@cfiles) {
print(OUT " $del $b\n"); my $b = $f;
} $b =~ s/\.cc?$/.obj/;
foreach my $f (@cxxfiles){ $b =~ s/\//$dir/g;
my $b = $f; print(OUT " $del $b\n");
$b =~ s/\.cc?$/.obj/; }
$b =~ s/\//$dir/g; foreach my $f (@cxxfiles) {
print(OUT " $del $b\n"); my $b = $f;
} $b =~ s/\.cc?$/.obj/;
print(OUT " $del src${dir}Mw.dll\n"); $b =~ s/\//$dir/g;
print(OUT " $del oosrc${dir}MwOO.dll\n"); print(OUT " $del $b\n");
print(OUT "\n"); }
print(OUT "src${dir}Mw.dll: " . cobjs($dir) . "\n"); print(OUT " $del src${dir}Mw.dll\n");
print(OUT " \$(LD) \$(LDFLAGS) $c_dllout $dllout\$@ " . cobjs($dir, $prefobj) . " $needlibs ${lib}gdi32.lib ${lib}user32.lib\n"); print(OUT " $del oosrc${dir}MwOO.dll\n");
print(OUT " $c_dllafter\n"); print(OUT "\n");
print(OUT "\n"); print(OUT "src${dir}Mw.dll: " . cobjs($dir) . "\n");
print(OUT "oosrc${dir}MwOO.dll: " . cxxobjs($dir) . "\n"); print( OUT " \$(LD) \$(LDFLAGS) $c_dllout $dllout\$@ "
print(OUT " \$(LD) \$(LDFLAGS) $cxx_dllout $dllout\$@ " . cxxobjs($dir, $prefobj) . " $needlibs ${lib}src${dir}Mw.lib\n"); . cobjs($dir, $prefobj)
print(OUT " $cxx_dllafter\n"); . " $needlibs ${lib}gdi32.lib ${lib}user32.lib\n");
print(OUT "\n"); print(OUT " $c_dllafter\n");
if($suffix){ print(OUT "\n");
print(OUT ".c.obj:\n"); print(OUT "oosrc${dir}MwOO.dll: " . cxxobjs($dir) . "\n");
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n"); print( OUT " \$(LD) \$(LDFLAGS) $cxx_dllout $dllout\$@ "
print(OUT ".cc.obj:\n"); . cxxobjs($dir, $prefobj)
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n"); . " $needlibs ${lib}src${dir}Mw.lib\n");
}else{ print(OUT " $cxx_dllafter\n");
print(OUT "\n"); print(OUT "\n");
foreach my $f (@cfiles){
my $o = $f; if ($suffix) {
$o =~ s/\.cc?$/.obj/; print(OUT ".c.obj:\n");
print(OUT "$o: $f\n"); print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n"); print(OUT ".cc.obj:\n");
} print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
foreach my $f (@cxxfiles){ }
my $o = $f; else {
$o =~ s/\.cc?$/.obj/; print(OUT "\n");
print(OUT "$o: $f\n"); foreach my $f (@cfiles) {
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n"); my $o = $f;
} $o =~ s/\.cc?$/.obj/;
} print(OUT "$o: $f\n");
close(OUT); print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
}
foreach my $f (@cxxfiles) {
my $o = $f;
$o =~ s/\.cc?$/.obj/;
print(OUT "$o: $f\n");
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
}
}
close(OUT);
} }
scan("src"); scan("src");
@@ -183,5 +195,5 @@ scan("oosrc");
scan("oosrc/widget"); scan("oosrc/widget");
generate("BorMakefile", "Borland"); generate("BorMakefile", "Borland");
generate("NTMakefile", "MSVC"); generate("NTMakefile", "MSVC");
generate("WatMakefile", "Watcom"); generate("WatMakefile", "Watcom");

View File

@@ -7,6 +7,5 @@ fi
./tools/doc.pl ./tools/doc.pl
./tools/icon.sh ./tools/icon.sh
./tools/genoo.pl ./tools/genoo.pl
./tools/genmsvc.pl ./tools/genmk.pl
./tools/genwat.pl
$MAKE format $MAKE format