stuff
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@295 b9cfdab3-6d41-4d17-bbe4-086880011989
|
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 663 B |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 542 B |
|
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 594 B |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 529 B |
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
4432
src/color.c
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ sub scan {
|
||||||
}
|
}
|
||||||
if ($f =~ /\.c$/) {
|
if ($f =~ /\.c$/) {
|
||||||
push(@cfiles, $_[0] . "/" . $f);
|
push(@cfiles, $_[0] . "/" . $f);
|
||||||
}elsif($f =~ /\.cc$/){
|
}
|
||||||
|
elsif ($f =~ /\.cc$/) {
|
||||||
push(@cxxfiles, $_[0] . "/" . $f);
|
push(@cxxfiles, $_[0] . "/" . $f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +82,8 @@ sub generate {
|
||||||
|
|
||||||
$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"){
|
}
|
||||||
|
elsif ($type eq "MSVC") {
|
||||||
$cc = "cl /TC /c /nologo";
|
$cc = "cl /TC /c /nologo";
|
||||||
$cxx = "cl /TP /c /nologo";
|
$cxx = "cl /TP /c /nologo";
|
||||||
$link = "link /nologo";
|
$link = "link /nologo";
|
||||||
|
|
@ -90,7 +92,8 @@ sub generate {
|
||||||
$def = "/D";
|
$def = "/D";
|
||||||
$inc = "/I";
|
$inc = "/I";
|
||||||
$dll = "/DLL";
|
$dll = "/DLL";
|
||||||
}elsif($type eq "Watcom"){
|
}
|
||||||
|
elsif ($type eq "Watcom") {
|
||||||
$cc = "wcc386 -bt=nt -q";
|
$cc = "wcc386 -bt=nt -q";
|
||||||
$cxx = "wpp386 -bt=nt -q";
|
$cxx = "wpp386 -bt=nt -q";
|
||||||
$link = "wlink";
|
$link = "wlink";
|
||||||
|
|
@ -117,10 +120,13 @@ sub generate {
|
||||||
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
|
||||||
|
"CFLAGS = ${inc}include ${def}_MILSKO ${def}USE_GDI ${def}USE_STB_IMAGE ${def}STBI_NO_SIMD\n"
|
||||||
|
);
|
||||||
print(OUT "CXXFLAGS = ${inc}include\n");
|
print(OUT "CXXFLAGS = ${inc}include\n");
|
||||||
print(OUT "LDFLAGS = $dll");
|
print(OUT "LDFLAGS = $dll");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
||||||
if ($suffix) {
|
if ($suffix) {
|
||||||
print(OUT ".SUFFIXES: .c .cc .obj\n");
|
print(OUT ".SUFFIXES: .c .cc .obj\n");
|
||||||
}
|
}
|
||||||
|
|
@ -142,19 +148,25 @@ sub generate {
|
||||||
print(OUT " $del oosrc${dir}MwOO.dll\n");
|
print(OUT " $del oosrc${dir}MwOO.dll\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "src${dir}Mw.dll: " . cobjs($dir) . "\n");
|
print(OUT "src${dir}Mw.dll: " . cobjs($dir) . "\n");
|
||||||
print(OUT " \$(LD) \$(LDFLAGS) $c_dllout $dllout\$@ " . cobjs($dir, $prefobj) . " $needlibs ${lib}gdi32.lib ${lib}user32.lib\n");
|
print( OUT " \$(LD) \$(LDFLAGS) $c_dllout $dllout\$@ "
|
||||||
|
. cobjs($dir, $prefobj)
|
||||||
|
. " $needlibs ${lib}gdi32.lib ${lib}user32.lib\n");
|
||||||
print(OUT " $c_dllafter\n");
|
print(OUT " $c_dllafter\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
print(OUT "oosrc${dir}MwOO.dll: " . cxxobjs($dir) . "\n");
|
print(OUT "oosrc${dir}MwOO.dll: " . cxxobjs($dir) . "\n");
|
||||||
print(OUT " \$(LD) \$(LDFLAGS) $cxx_dllout $dllout\$@ " . cxxobjs($dir, $prefobj) . " $needlibs ${lib}src${dir}Mw.lib\n");
|
print( OUT " \$(LD) \$(LDFLAGS) $cxx_dllout $dllout\$@ "
|
||||||
|
. cxxobjs($dir, $prefobj)
|
||||||
|
. " $needlibs ${lib}src${dir}Mw.lib\n");
|
||||||
print(OUT " $cxx_dllafter\n");
|
print(OUT " $cxx_dllafter\n");
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
|
|
||||||
if ($suffix) {
|
if ($suffix) {
|
||||||
print(OUT ".c.obj:\n");
|
print(OUT ".c.obj:\n");
|
||||||
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
|
print(OUT " \$(CC) \$(CFLAGS) ${out}\$@ \$<\n");
|
||||||
print(OUT ".cc.obj:\n");
|
print(OUT ".cc.obj:\n");
|
||||||
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
|
print(OUT " \$(CXX) \$(CXXFLAGS) ${out}\$@ \$<\n");
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
print(OUT "\n");
|
print(OUT "\n");
|
||||||
foreach my $f (@cfiles) {
|
foreach my $f (@cfiles) {
|
||||||
my $o = $f;
|
my $o = $f;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||