- 生成 24 个 _cfl*.vp(10327 条 extern 声明)+ _types/_enums 常量 - __init__.vp 提供 Fl/Fl_Widget/Fl_Window/Fl_Button/Fl_Input/Fl_Text_Buffer/Fl_Group/Fl_Menu_Bar/Fl_Native_File_Chooser 等包装类 - 回调(Fl_Callback)按 bytes 不透明处理,菜单回调位传 t.CPtr(0) - 新增 examples/hello.vp、dialog.vp 冒烟样例,26 个 .vp 全部通过 vast parse - 内嵌 cfltk(C API 封装)与 FLTK 1.4 完整源码,构建目标 cfltk2
34 lines
2.3 KiB
Plaintext
34 lines
2.3 KiB
Plaintext
import t, c
|
||
from fltk._types import *
|
||
|
||
# ============================================================
|
||
# fltk/_cfl_surface.vp — cfl_surface.h 的 extern FFI 声明(对接 cfltk C API)
|
||
# ============================================================
|
||
|
||
# 所有函数直接对应 cfltk 生成的 C 符号(extern "C"),链接目标: cfltk2。
|
||
# 类型约定: Fl_* 对象均为不透明指针 (Fl_XxxPtr);const char* → str;
|
||
# 函数指针/void* → bytes(Viper 端传 0/NULL 或不使用)。
|
||
|
||
extern def Fl_Surface_Device_set_current(self: Fl_Surface_DevicePtr)
|
||
extern def Fl_Surface_Device_is_current(self: Fl_Surface_DevicePtr) -> int
|
||
extern def Fl_Surface_Device_surface() -> Fl_Surface_DevicePtr
|
||
extern def Fl_Surface_Device_push_current(new_current: Fl_Surface_DevicePtr)
|
||
extern def Fl_Surface_Device_pop_current() -> Fl_Surface_DevicePtr
|
||
extern def Fl_Image_Surface_new(w: int, h: int, high_res: int) -> Fl_Image_SurfacePtr
|
||
extern def Fl_Image_Surface_delete(s: Fl_Image_SurfacePtr)
|
||
extern def Fl_Image_Surface_set_current(self: Fl_Image_SurfacePtr)
|
||
extern def Fl_Image_Surface_is_current(self: Fl_Image_SurfacePtr) -> int
|
||
extern def Fl_Image_Surface_image(self: Fl_Image_SurfacePtr) -> bytes
|
||
extern def Fl_Image_Surface_highres_image(self: Fl_Image_SurfacePtr) -> bytes
|
||
extern def Fl_Image_Surface_origin(self: Fl_Image_SurfacePtr, x: bytes, y: bytes)
|
||
extern def Fl_Image_Surface_set_origin(self: Fl_Image_SurfacePtr, x: int, y: int)
|
||
extern def Fl_Image_Surface_rescale(self: Fl_Image_SurfacePtr)
|
||
extern def Fl_Image_Surface_draw(self: Fl_Image_SurfacePtr, widget: bytes, delta_x: int, delta_y: int)
|
||
extern def Fl_Image_Surface_draw_decorated_window(self: Fl_Image_SurfacePtr, widget: bytes, delta_x: int, delta_y: int)
|
||
extern def Fl_SVG_File_Surface_new(width: int, height: int, file: str) -> Fl_SVG_File_SurfacePtr
|
||
extern def Fl_SVG_File_Surface_delete(self: Fl_SVG_File_SurfacePtr)
|
||
extern def Fl_SVG_File_Surface_origin(self: Fl_SVG_File_SurfacePtr, x: int, y: int)
|
||
extern def Fl_SVG_File_Surface_printable_rect(self: Fl_SVG_File_SurfacePtr, w: bytes, h: bytes) -> int
|
||
extern def Fl_SVG_File_Surface_draw(self: Fl_SVG_File_SurfacePtr, widget: bytes, delta_x: int, delta_y: int)
|
||
extern def Fl_SVG_File_Surface_draw_decorated_window(self: Fl_SVG_File_SurfacePtr, widget: bytes, delta_x: int, delta_y: int)
|