mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 02:09:46 +08:00
4fe7dc47e4
- 新增国际化系统,支持中英文切换 - 添加语言选择对话框和语言切换按钮回调 - 扩展配置系统以支持语言设置存储 - 创建语言文件目录结构和占位文件 - 更新主窗口支持UI文本动态刷新
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
#ifndef LUA_CONFIG_H
|
|
#define LUA_CONFIG_H
|
|
|
|
#include <lua.h>
|
|
|
|
// 初始化 Lua 配置系统
|
|
// 返回值: 0 成功, -1 失败
|
|
int lua_config_init(void);
|
|
|
|
// 销毁 Lua 配置系统
|
|
void lua_config_destroy(void);
|
|
|
|
// 获取字符串配置值
|
|
// section: 配置章节名 (如 "app", "dialog", "button")
|
|
// key: 配置键名 (如 "name", "size", "rastersize")
|
|
// 返回值: 配置值字符串, 失败时返回 NULL
|
|
const char* lua_config_get_string(const char* section, const char* key);
|
|
|
|
// 获取整型配置值
|
|
// section: 配置章节名
|
|
// key: 配置键名
|
|
// default_value: 默认值 (当配置不存在或转换失败时返回)
|
|
// 返回值: 配置值或默认值
|
|
int lua_config_get_int(const char* section, const char* key, int default_value);
|
|
|
|
// 重新加载配置文件
|
|
// 返回值: 0 成功, -1 失败
|
|
int lua_config_reload(void);
|
|
|
|
// 获取配置加载状态
|
|
// 返回值: 1 已加载, 0 未加载
|
|
int lua_config_is_loaded(void);
|
|
|
|
// 设置字符串配置值
|
|
// section: 配置章节名
|
|
// key: 配置键名
|
|
// value: 配置值
|
|
// 返回值: 0 成功, -1 失败
|
|
int lua_config_set_string(const char *section, const char *key, const char *value);
|
|
|
|
#endif // LUA_CONFIG_H
|