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

View File

@@ -8,19 +8,15 @@ print(OUT "/* \$Id\$ */\n");
print(OUT "#include <Mw/Milsko.h>\n");
print(OUT "\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>) {
$l =~ s/\r?\n$//;
if ($l =~ /^[ \t]*([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+(.+)$/) {
print(OUT " if(strcmp(color, \"$4\") == 0){\n");
print(OUT " r = $1;\n");
print(OUT " g = $2;\n");
print(OUT " b = $3;\n");
print(OUT " }\n");
print(OUT
" if(strcmp(color, \"$4\") == 0) return MwLLAllocColor(handle->lowlevel, $1, $2, $3);\n"
);
}
}
print(OUT " return MwLLAllocColor(handle->lowlevel, r, g, b);\n");
print(OUT " return MwLLAllocColor(handle->lowlevel, 0, 0, 0);\n");
print(OUT "}\n");
close(OUT);