PazeE 编译器(.NET 8/C# 实现),直接生成原生 x64/ARM64 机器码,无需 gcc/clang/nasm。 主要特性: - 词法/语法/语义分析、AST 生成、代码生成 - 目标平台:Windows (PE32+)、Linux (ELF64)、macOS (Mach-O 64)、Los4 - 架构:AMD64 与 ARM64 独立后端 - C 语法特性:匿名结构体/联合、位域、灵活数组成员、语句表达式+typeof - printf 颜色格式化、time.get.utc 时区支持 - GUI 支持:Windows (Win11 API)、Los4、Linux (X11)、macOS (ObjC) - Windows GUI 程序无控制台窗口(PE 子系统自动检测) - WiX Bundle 安装器(仅输出 .exe,MSI 作为中间产物内嵌)
27 行
1006 B
Plaintext
27 行
1006 B
Plaintext
/* GUI 测试:创建窗口显示文字,按任意键或关闭窗口退出 */
|
|
struct gui_event { int type, key, mouse_x, mouse_y, button, window_id; };
|
|
int gui_init(void);
|
|
int gui_window_create(const char *title, int width, int height);
|
|
int gui_window_text(int win, int x, int y, const char *text, unsigned int fg, unsigned int bg);
|
|
int gui_event_wait(struct gui_event *ev, int timeout_ms);
|
|
int gui_window_destroy(int win);
|
|
|
|
int main(void) {
|
|
if (gui_init() < 0) return 1;
|
|
if (gui_window_create("PazeE GUI Demo", 480, 320) < 0) return 1;
|
|
|
|
/* 显示文字:黑底绿字 */
|
|
gui_window_text(0, 60, 80, "Hello from PazeE!", 0x00FF00, 0x000000);
|
|
gui_window_text(0, 60, 120, "Press any key or close to exit", 0xFFFFFF, 0x000000);
|
|
|
|
struct gui_event ev;
|
|
while (1) {
|
|
gui_event_wait(&ev, 0);
|
|
if (ev.type == 4 || ev.type == 1) break; /* quit or close */
|
|
if (ev.type == 2) break; /* key down */
|
|
}
|
|
|
|
gui_window_destroy(0);
|
|
return 0;
|
|
}
|