fix(fltk): gen_ffi 无名 C 类型参数修复(Fl_color_average 参数名重复)+ ViperFLProject 补齐 FLTK Windows 系统库(gdiplus/advapi32/shell32/ws2_32/user32/winspool)

This commit is contained in:
TermiNexus committed 2026-09-01 21:08:17 +08:00
1 parent 5ba5fb5ff3
commit 7c8dd5f501
5 files changed
+19 -18

No files matched your search

+7 -1
View File
@@ -24,7 +24,13 @@
"-lole32",
"-luuid",
"-lwinmm",
"-lgdi32"
"-lgdi32",
"-lgdiplus",
"-ladvapi32",
"-lshell32",
"-lws2_32",
"-luser32",
"-lwinspool"
],
"static_libs": [
"../includes/fltk/cfltk/build/libcfltk2.a",
+1 -1
View File
@@ -159,7 +159,7 @@ extern def Fl_darker(c: t.CUInt32T) -> t.CUInt32T
extern def Fl_set_box_type_cb(a0: int, cb1: bytes, a2: int, a3: int, a4: int, a5: int)
extern def Fl_draw_box_active() -> int
extern def Fl_gray_ramp(i: int) -> t.CUInt32T
extern def Fl_color_average(int_: bytes, int_: bytes, f: t.CFloat) -> t.CUInt32T
extern def Fl_color_average(a0: t.CUInt32T, a1: t.CUInt32T, f: t.CFloat) -> t.CUInt32T
extern def Fl_contrast(c1: t.CUInt32T, c2: t.CUInt32T) -> t.CUInt32T
extern def Fl_rgb_color(r: t.CUInt8T, g: t.CUInt8T, b: t.CUInt8T) -> t.CUInt32T
extern def Fl_rgb_color_grayscale(g: t.CUInt8T) -> t.CUInt32T
+1 -1
View File
@@ -94,7 +94,7 @@ extern def Fl_measure(str_: str, x: bytes, y: bytes, draw_symbols: int)
extern def Fl_draw5(str_: str, x: int, y: int, w: int, h: int, align: int, img: bytes, draw_symbols: int)
extern def Fl_frame(s: str, x: int, y: int, w: int, h: int)
extern def Fl_frame2(s: str, x: int, y: int, w: int, h: int)
extern def Fl_draw_box(box_type: int, x: int, y: int, w: int, h: int, int_: bytes)
extern def Fl_draw_box(box_type: int, x: int, y: int, w: int, h: int, a5: t.CUInt32T)
extern def Fl_draw_image(buf: bytes, X: int, Y: int, W: int, H: int, D: int, L: int)
extern def Fl_draw_image_mono(buf: bytes, X: int, Y: int, W: int, H: int, D: int, L: int)
extern def Fl_can_do_alpha_blending() -> t.CChar
-14
View File
@@ -445,17 +445,3 @@ Fl_Table_RESIZE_COL_LEFT: t.CInt = 1
Fl_Table_RESIZE_COL_RIGHT: t.CInt = 2
Fl_Table_RESIZE_ROW_ABOVE: t.CInt = 3
Fl_Table_RESIZE_ROW_BELOW: t.CInt = 4
# ---- Fl_Native_File_Chooser 类型/选项(FLTK Fl_Native_File_Chooser.H,与
# Fl_FileDialogType_*/Fl_FileDialogOptions_* 同值,按 FLTK 原名提供)----
Fl_Native_File_Chooser_BROWSE_FILE: t.CInt = 0
Fl_Native_File_Chooser_BROWSE_DIRECTORY: t.CInt = 1
Fl_Native_File_Chooser_BROWSE_MULTI_FILE: t.CInt = 2
Fl_Native_File_Chooser_BROWSE_MULTI_DIRECTORY: t.CInt = 3
Fl_Native_File_Chooser_BROWSE_SAVE_FILE: t.CInt = 4
Fl_Native_File_Chooser_BROWSE_SAVE_DIRECTORY: t.CInt = 5
Fl_Native_File_Chooser_NO_OPTIONS: t.CInt = 0
Fl_Native_File_Chooser_SAVEAS_CONFIRM: t.CInt = 1
Fl_Native_File_Chooser_NEW_FOLDER: t.CInt = 2
Fl_Native_File_Chooser_PREVIEW: t.CInt = 4
Fl_Native_File_Chooser_USE_FILTER_EXT: t.CInt = 8
+10 -1
View File
@@ -40,6 +40,13 @@ _KEYWORDS = {
"int", "str", "float", "bool", "len",
}
# C 类型关键字:作无名参数末尾单词时属于类型的一部分而非参数名
# (`unsigned int` → 末尾 int 不是参数名;`Fl_color_average(unsigned int, ...)`)。
_C_TYPE_WORDS = {
"int", "char", "short", "long", "unsigned", "signed", "float", "double",
"void", "size_t", "uintptr_t",
}
def map_type(t: str) -> str | None:
"""返回 Viper 注解类型;void 返回 None。"""
@@ -129,7 +136,9 @@ def split_args(args: str) -> list[tuple[str, str]]:
if m:
typ = p[:m.start()].strip()
nm = m.group(1)
if not typ: # 纯类型参数(如 `int`、`Fl_Widget *` 无名)
# 纯类型(无名)参数:无类型部分(`int`)或末尾单词本身是 C 类型
# 关键字(`unsigned int` → 末尾 int 是类型的一部分,非参数名)。
if not typ or nm in _C_TYPE_WORDS:
typ, nm = p, "a%d" % len(out)
if nm in _KEYWORDS:
nm = nm + "_"