diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index b672c1b..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(Gobang VERSION 9.0 LANGUAGES C) - -set(CMAKE_C_STANDARD 17) -set(CMAKE_C_STANDARD_REQUIRED ON) - -# === 输出目录:与原 Makefile 保持一致 === -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) - -# === 编译选项 === -add_compile_options(-Wall -Wextra -O2) -add_compile_options(-finput-charset=UTF-8 -fexec-charset=UTF-8) - -# === ENet(从源码编译静态库)=== -set(ENET_DIR ${CMAKE_SOURCE_DIR}/libs/ENET) -add_library(enet STATIC - ${ENET_DIR}/callbacks.c - ${ENET_DIR}/compress.c - ${ENET_DIR}/host.c - ${ENET_DIR}/list.c - ${ENET_DIR}/packet.c - ${ENET_DIR}/peer.c - ${ENET_DIR}/protocol.c - ${ENET_DIR}/win32.c -) -target_include_directories(enet PUBLIC ${ENET_DIR}/include) - -# === IUP(预构建导入库)=== -set(IUP_DIR ${CMAKE_SOURCE_DIR}/libs/IUP) -add_library(iup SHARED IMPORTED) -set_target_properties(iup PROPERTIES - IMPORTED_IMPLIB ${IUP_DIR}/libiup.a - IMPORTED_LOCATION ${IUP_DIR}/iup.dll - INTERFACE_INCLUDE_DIRECTORIES ${IUP_DIR}/include -) - -# === cJSON(JSON处理库)=== -add_library(cjson STATIC ${CMAKE_SOURCE_DIR}/libs/cJSON/cJSON.c) -target_include_directories(cjson PUBLIC ${CMAKE_SOURCE_DIR}/libs/cJSON) - -# === 主可执行文件 === -add_executable(gobang_gui - src/core/main.c - src/core/globals.c - src/core/config.c - src/core/gobang.c - src/core/ai.c - src/network/network.c - src/record/record.c - src/gui/gui_core.c - src/gui/gui_game.c - src/gui/gui_menu.c - src/gui/gui_replay.c - src/llm/llm_ai.c -) - -target_include_directories(gobang_gui PRIVATE ${CMAKE_SOURCE_DIR}/include) - -target_link_libraries(gobang_gui PRIVATE - enet - cjson - iup - winhttp - ws2_32 - winmm - gdi32 - comdlg32 - comctl32 - uuid - ole32 -) - -# === 构建后拷贝 iup.dll 到 bin/ === -add_custom_command(TARGET gobang_gui POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${IUP_DIR}/iup.dll - $ - COMMENT "拷贝 iup.dll 到输出目录" -) - -# === 快捷运行目标 === -add_custom_target(run - COMMAND gobang_gui - DEPENDS gobang_gui - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin - COMMENT "运行五子棋游戏" -) diff --git a/bin/gobang_gui.exe b/bin/gobang_gui.exe deleted file mode 100644 index f6ec03e..0000000 Binary files a/bin/gobang_gui.exe and /dev/null differ diff --git a/bin/iup.dll b/bin/iup.dll deleted file mode 100644 index aceb679..0000000 Binary files a/bin/iup.dll and /dev/null differ diff --git a/gobang_config.ini b/gobang_config.ini deleted file mode 100644 index 3b2123c..0000000 --- a/gobang_config.ini +++ /dev/null @@ -1,21 +0,0 @@ -# 五子棋游戏配置文件 -# 棋盘大小 (范围: 5-25) -BOARD_SIZE=15 - -# 禁手规则 (0=关闭, 1=开启) -USE_FORBIDDEN_MOVES=1 - -# 计时器 (0=关闭, 1=开启) -USE_TIMER=1 - -# 时间限制 (分钟) -TIME_LIMIT=60 - -# 网络端口 (范围: 1024-65535) -NETWORK_PORT=8888 - -# 网络超时时间 (毫秒) -NETWORK_TIMEOUT=5000 - -# AI难度 (1-5) -AI_DIFFICULTY=3 diff --git a/include/ai.h b/include/ai.h deleted file mode 100644 index 9079203..0000000 --- a/include/ai.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file ai.h - * @note 本文件定义了AI模块的函数和变量 - * @note 包括: - * 1. 评估一个落子位置的综合得分(结合进攻和防守) - * 2. 评估指定位置的价值 - * 3. 评估棋盘价值 - */ - -#ifndef AI_H -#define AI_H - -#include "gobang.h" -#include "type.h" - -/** - * @brief 评估一个落子位置的综合得分(结合进攻和防守) - * - * @param x 行坐标 - * @param y 列坐标 - * @return int 综合得分 - */ -int evaluate_move(int x, int y); - -/** - * @brief 评估指定位置的价值 - * - * @param x 位置x坐标 - * @param y 位置y坐标 - * @param player 玩家标识(PLAYER/AI) - * @return int 位置价值 - */ -int evaluate_pos(int x, int y, int player); - -/** - * @brief AI下棋 - * - * @param depth - */ -void ai_move(int depth); - -// ==================== AI增强:新增函数声明 ==================== - -/** - * @brief 生成候选移动并按评估分数排序 - * @param moves 存储候选移动的数组 - * @param player 当前玩家 - * @return 候选移动数量 - */ -int generate_candidate_moves(ScoredMove *moves, int player); - -/** - * @brief 检查位置是否在已有棋子附近 - * @param x, y 要检查的位置 - * @return 如果附近有棋子返回true - */ -bool is_near_stones(int x, int y); - -/** - * @brief 检测在指定位置落子的威胁等级 - * @param x, y 落子位置 - * @param player 落子玩家 - * @return 威胁等级 - */ -ThreatLevel detect_threat(int x, int y, int player); - - -#endif // AI_H \ No newline at end of file diff --git a/include/config.h b/include/config.h deleted file mode 100644 index b1db71f..0000000 --- a/include/config.h +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @file config.h - * @brief 五子棋游戏参数配置头文件 - * @note 本文件集中定义了五子棋游戏的所有参数配置,便于统一管理和修改 - */ - -#ifndef CONFIG_H -#define CONFIG_H - -//---------- 棋盘相关参数 ----------// -#define MAX_BOARD_SIZE 25 // 支持的最大棋盘尺寸 -#define MIN_BOARD_SIZE 5 // 支持的最小棋盘尺寸 -#define DEFAULT_BOARD_SIZE 15 // 默认棋盘尺寸 -#define MAX_STEPS (MAX_BOARD_SIZE * MAX_BOARD_SIZE) // 游戏最大步数 - -//---------- 游戏模式参数 ----------// -#define GAME_MODE_AI 1 // 人机对战模式 -#define GAME_MODE_PVP 2 // 双人对战模式 -#define GAME_MODE_NETWORK 3 // 网络对战模式 - -//---------- 玩家标识参数 ----------// -#define EMPTY 0 // 棋盘空位标识 -#define PLAYER 1 // 玩家标识 (用于人机对战模式) -#define AI 2 // AI标识 (用于人机对战模式) -#define PLAYER1 1 // 玩家1标识 (用于双人对战模式) -#define PLAYER2 2 // 玩家2标识 (用于双人对战模式) - -//---------- 特殊输入命令 ----------// -#define INPUT_UNDO -1 // 悔棋 -#define INPUT_SAVE -2 // 保存 -#define INPUT_EXIT -3 // 退出 -#define INPUT_SURRENDER -4 // 认输 - -//---------- 游戏设置默认值 ----------// -#define DEFAULT_USE_FORBIDDEN_MOVES false // 默认不启用禁手规则 -#define DEFAULT_USE_TIMER 0 // 默认不启用计时器 -#define DEFAULT_TIME_LIMIT 1800 // 默认时间限制为30分钟(内部以秒存储: 30*60) - -//---------- AI参数 ----------// -#define DEFAULT_AI_DEPTH 5 // 默认AI搜索深度 -#define DEFAULT_DEFENSE_COEFFICIENT 1.5 // 默认防守系数 - -//---------- 网络参数 ----------// -#define DEFAULT_NETWORK_PORT 8888 // 默认网络端口 -#define MIN_NETWORK_PORT 1024 // 最小网络端口 -#define MAX_NETWORK_PORT 65535 // 最大网络端口 -#define NETWORK_TIMEOUT_MS 5000 // 网络超时时间(毫秒) -#define NETWORK_BUFFER_SIZE 1024 // 网络缓冲区大小 - -// 网络配置 -#define MAX_IP_LENGTH 16 // 最大IP地址长度 - -// 网络消息类型 -#define MSG_MOVE 1 // 落子消息 -#define MSG_CHAT 2 // 聊天消息 -#define MSG_SURRENDER 3 // 认输消息 -#define MSG_UNDO_REQUEST 4 // 悔棋请求 -#define MSG_UNDO_RESPONSE 5 // 悔棋回应 -#define MSG_GAME_START 6 // 游戏开始 -#define MSG_GAME_END 7 // 游戏结束 -#define MSG_HEARTBEAT 8 // 心跳包 -#define MSG_DISCONNECT 9 // 断线消息 - -//---------- 评分参数 ----------// -// 棋型评分 - 用于calculate_step_score函数 -#define SCORE_FIVE 5000 // 五连 -#define SCORE_LIVE_FOUR 2000 // 活四 -#define SCORE_RUSH_FOUR 1000 // 冲四 -#define SCORE_DEAD_FOUR 300 // 死四 -#define SCORE_LIVE_THREE 500 // 活三 -#define SCORE_SLEEP_THREE 200 // 眠三 -#define SCORE_DEAD_THREE 80 // 死三 -#define SCORE_LIVE_TWO 100 // 活二 -#define SCORE_SLEEP_TWO 40 // 眠二 -#define SCORE_DEAD_TWO 15 // 死二 -#define SCORE_LIVE_ONE 15 // 开放单子 -#define SCORE_HALF_ONE 8 // 半开放单子 -#define SCORE_DEAD_ONE 2 // 封闭单子 - -// 位置奖励系数 -#define POSITION_BONUS_FACTOR 10 // 位置奖励因子 - -// AI评估参数 - 用于evaluate_pos函数 -#define AI_SCORE_FIVE 1000000 // AI评估-五连 -#define AI_SCORE_LIVE_FOUR 100000 // AI评估-活四 -#define AI_SCORE_RUSH_FOUR 10000 // AI评估-冲四 -#define AI_SCORE_DEAD_FOUR 500 // AI评估-死四 -#define AI_SCORE_LIVE_THREE 5000 // AI评估-活三 -#define AI_SCORE_SLEEP_THREE 1000 // AI评估-眠三 -#define AI_SCORE_DEAD_THREE 50 // AI评估-死三 -#define AI_SCORE_LIVE_TWO 500 // AI评估-活二 -#define AI_SCORE_SLEEP_TWO 100 // AI评估-眠二 -#define AI_SCORE_DEAD_TWO 10 // AI评估-死二 -#define AI_SCORE_LIVE_ONE 50 // AI评估-开放单子 -#define AI_SCORE_HALF_ONE 10 // AI评估-半开放单子 -#define AI_SCORE_DEAD_ONE 1 // AI评估-封闭单子 - -// AI位置奖励系数 -#define AI_POSITION_BONUS_FACTOR 50 // AI位置奖励因子 - -// 搜索算法参数 -#define SEARCH_MAX_SCORE 1000000 // 搜索最大分数 -#define SEARCH_WIN_BONUS 1000000 // 获胜奖励分数 -#define AI_NEARBY_RANGE 3 // AI搜索的邻近范围 -#define AI_SEARCH_RANGE_THRESHOLD 8 // AI开始限制搜索范围的步数阈值 - -// 组合棋型评分 - AI增强新增 -#define AI_SCORE_DOUBLE_THREE 50000 // 双三 -#define AI_SCORE_FOUR_THREE 200000 // 四三 -#define AI_SCORE_THREAT_SEQUENCE 80000 // 威胁序列 -#define AI_SCORE_POTENTIAL_FIVE 300000 // 潜在五连 - -// 评分权重参数 -#define TIME_WEIGHT_FACTOR 0.5 // 时间权重因子 -#define WIN_BONUS 2000 // 胜利奖励分数 - -//---------- GUI界面参数 ----------// -// 窗口和棋盘配置 -#define WINDOW_WIDTH 1000 -#define WINDOW_HEIGHT 800 -#define BOARD_OFFSET_X 45 -#define BOARD_OFFSET_Y 45 -#define CELL_SIZE 30 -#define STONE_RADIUS 13 - -// 配色方案 - 经典木纹风格 (RGB) -#define CLR_BOARD_BG_R 0xD4 // 棋盘背景 - 暖木色 -#define CLR_BOARD_BG_G 0xA5 -#define CLR_BOARD_BG_B 0x74 -#define CLR_BOARD_BORDER_R 0x8B // 棋盘边框 - 深木色 -#define CLR_BOARD_BORDER_G 0x5E -#define CLR_BOARD_BORDER_B 0x3C -#define CLR_WINDOW_BG "245 240 235" // 窗口背景 - 米白 -#define CLR_PANEL_BG "237 229 218" // 面板背景 - 浅米色 -#define CLR_GRID_LINE_R 0x5C // 网格线 - 深棕 -#define CLR_GRID_LINE_G 0x3D -#define CLR_GRID_LINE_B 0x2E -#define CLR_TEXT_TITLE "60 36 21" // 标题文字 - 深棕 -#define CLR_TEXT_NORMAL "74 55 40" // 正文文字 - 中棕 -#define CLR_TEXT_SECONDARY "139 115 85" // 次要文字 - 浅棕 -#define CLR_BTN_PRIMARY_BG "139 94 60" // 主按钮背景 - 深棕 -#define CLR_BTN_PRIMARY_FG "255 255 255" // 主按钮文字 - 白色 -#define CLR_BTN_NORMAL_BG "237 229 218" // 普通按钮背景 - 浅棕 -#define CLR_BTN_NORMAL_FG "107 66 38" // 普通按钮文字 - 深棕 -#define CLR_LAST_MOVE_R 0x2E // 最后落子标记 - 蓝色 -#define CLR_LAST_MOVE_G 0x86 -#define CLR_LAST_MOVE_B 0xAB -#define CLR_STAR_POINT_R 0x3C // 星位/天元 - 深棕 -#define CLR_STAR_POINT_G 0x24 -#define CLR_STAR_POINT_B 0x15 -// 黑子渐变色 -#define CLR_BLACK_STONE_R 0x10 // 黑子外圈 -#define CLR_BLACK_STONE_G 0x10 -#define CLR_BLACK_STONE_B 0x10 -#define CLR_BLACK_HIGHLIGHT_R 0x50 // 黑子高光 -#define CLR_BLACK_HIGHLIGHT_G 0x50 -#define CLR_BLACK_HIGHLIGHT_B 0x50 -// 白子渐变色 -#define CLR_WHITE_STONE_R 0xF0 // 白子外圈 -#define CLR_WHITE_STONE_G 0xF0 -#define CLR_WHITE_STONE_B 0xF0 -#define CLR_WHITE_HIGHLIGHT_R 0xFF // 白子高光 -#define CLR_WHITE_HIGHLIGHT_G 0xFF -#define CLR_WHITE_HIGHLIGHT_B 0xFF -#define CLR_WHITE_BORDER_R 0xA0 // 白子边框 -#define CLR_WHITE_BORDER_G 0xA0 -#define CLR_WHITE_BORDER_B 0xA0 - -//---------- 文件路径参数 ----------// -#define RECORDS_DIR "records" // 记录文件目录 -#define CONFIG_FILE "gobang_config.ini" // 配置文件路径 -#define MAX_PATH_LENGTH 256 // 最大路径长度 - -//---------- LLM大模型参数 ----------// -#define DEFAULT_LLM_USE 0 // 默认不使用LLM (0=算法AI, 1=大模型) -#define DEFAULT_LLM_ENDPOINT "https://api.minimax.chat/v1/chat/completions" // 默认API地址 -#define DEFAULT_LLM_API_KEY "" // 默认API Key (需用户填写) -#define DEFAULT_LLM_MODEL "MiniMax-Text-01" // 默认模型名 -#define MAX_LLM_ENDPOINT_LEN 256 // API地址最大长度 -#define MAX_LLM_API_KEY_LEN 128 // API Key最大长度 -#define MAX_LLM_MODEL_LEN 64 // 模型名最大长度 -#define LLM_MAX_RETRIES 3 // LLM返回非法坐标时最大重试次数 -#define LLM_TIMEOUT_MS 30000 // LLM HTTP请求超时(毫秒) - -//---------- 配置管理函数声明 ----------// -/** - * @brief 加载游戏配置 - */ -void load_game_config(); - -/** - * @brief 保存游戏配置 - */ -void save_game_config(); - -/** - * @brief 重置为默认配置 - */ -void reset_to_default_config(); - -#endif // CONFIG_H \ No newline at end of file diff --git a/include/globals.h b/include/globals.h deleted file mode 100644 index 2fcee43..0000000 --- a/include/globals.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file globals.h - * @brief 全局变量声明头文件 - * @note 集中管理所有全局变量的声明,提高代码可维护性 - */ - -#ifndef GLOBALS_H -#define GLOBALS_H - -#include "type.h" -#include "gobang.h" -#include - -// ==================== 游戏核心变量 ==================== -extern int BOARD_SIZE; // 当前实际使用的棋盘尺寸 -extern int board[MAX_BOARD_SIZE][MAX_BOARD_SIZE]; // 棋盘状态存储数组 -extern Step steps[MAX_STEPS]; // 存储所有落子步骤的数组 -extern const int direction[4][2]; // 四个方向:向下、向右、右下、左下 -extern int step_count; // 当前步数计数器 - -// ==================== 游戏配置变量 ==================== -extern bool use_forbidden_moves; // 是否启用禁手规则的标志 -extern int use_timer; // 是否启用计时器的标志 -extern int time_limit; // 每回合的时间限制(秒,内部存储) -extern int network_port; // 网络端口 -extern int network_timeout; // 网络超时时间 - -// ==================== AI相关变量 ==================== -extern double defense_coefficient; // 防守系数 -extern int ai_difficulty; // AI难度 (1-5) - -// ==================== LLM大模型相关变量 ==================== -extern int llm_use; // 是否使用LLM (0=算法AI, 1=大模型) -extern char llm_endpoint[MAX_LLM_ENDPOINT_LEN]; // API地址 -extern char llm_api_key[MAX_LLM_API_KEY_LEN]; // API Key -extern char llm_model[MAX_LLM_MODEL_LEN]; // 模型名 - -// ==================== 网络相关变量 ==================== -extern NetworkGameState network_state; // 网络游戏状态 - -// ==================== GUI相关变量 ==================== -extern int current_player_gui; // GUI当前玩家 -extern int game_over; // 游戏结束标志 -extern char status_message[256]; // 状态消息 - -// ==================== 记录相关变量 ==================== -extern int player1_final_score; // 玩家1最终得分 -extern int player2_final_score; // 玩家2最终得分 -extern int scores_calculated; // 评分计算标志 -extern char winner_info[50]; // 存储胜负信息 - -#endif // GLOBALS_H \ No newline at end of file diff --git a/include/gobang.h b/include/gobang.h deleted file mode 100644 index 2f0b8f3..0000000 --- a/include/gobang.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @file gobang.h - * @brief 五子棋游戏头文件 - * @note 本文件定义了五子棋游戏的主要数据结构、函数和全局变量。 - * 它包含了游戏棋盘的表示、玩家操作、规则检查以及AI决策等功能。 - */ - -#ifndef GOBANG_H -#define GOBANG_H - -#include -#include -#include "config.h" -#include "type.h" -#include -#include -#include -#include - -// 函数原型 - -// --- 游戏核心逻辑 --- -/** - * @brief 初始化棋盘,将所有位置设置为空(EMPTY) - */ -void empty_board(); - -/** - * @brief 检查指定坐标是否为有效落子点(在棋盘内且为空) - * @param x 待检查的行坐标 (0-based) - * @param y 待检查的列坐标 (0-based) - * @return 若位置有效且为空则返回true,否则返回false - */ -bool have_space(int x, int y); - -/** - * @brief 判断一个落子是否为禁手 - * @param x 落子的行坐标 (0-based) - * @param y 落子的列坐标 (0-based) - * @param player 当前玩家的标识 - * @return 如果是禁手则返回true,否则返回false - */ -bool is_forbidden_move(int x, int y, int player); - - -/** - * @brief 执行一次玩家落子操作 - * @param x 落子的行坐标 (0-based) - * @param y 落子的列坐标 (0-based) - * @param player 当前玩家的标识 - * @return 若落子成功则返回true,否则(位置无效或被占用)返回false - */ -bool player_move(int x, int y, int player); - -/** - * @brief 计算在特定方向上的棋子连续信息 - * @param x 起始点的行坐标 - * @param y 起始点的列坐标 - * @param dx x方向的增量 (-1, 0, or 1) - * @param dy y方向的增量 (-1, 0, or 1) - * @param player 玩家标识 - * @return 返回一个包含连续棋子信息的 DirInfo 结构体 - */ -DirInfo count_specific_direction(int x, int y, int dx, int dy, int player); - -/** - * @brief 检查在某点落子后,该玩家是否获胜 - * @param x 落子的行坐标 (0-based) - * @param y 落子的列坐标 (0-based) - * @param player 当前玩家的标识 - * @return 如果获胜则返回true,否则返回false - */ -bool check_win(int x, int y, int player); - -/** - * @brief 悔棋功能,撤销指定步数 - * @param steps_to_undo 要撤销的步数(每步包含双方各一次落子) - * @return 若悔棋成功则返回true,否则返回false - */ -bool return_move(int steps_to_undo); - -/** - * @brief 计算并返回一步棋的得分 - * @param x 落子的行坐标 - * @param y 落子的列坐标 - * @param player 玩家标识 - * @return 该步棋的得分 - */ -int calculate_step_score(int x, int y, int player); - -#endif // GOBANG_H \ No newline at end of file diff --git a/include/gui.h b/include/gui.h deleted file mode 100644 index dd503c9..0000000 --- a/include/gui.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file gui.h - * @brief 图形化用户界面头文件 - * @note 使用IUP库实现五子棋的图形化界面 - * @author 刘航宇 - */ - -#ifndef GUI_H -#define GUI_H - -#include "gobang.h" -#include "config.h" -#include "globals.h" - -// GUI函数声明 - -/** - * @brief 初始化GUI - * @details 初始化IUP图形库和游戏界面组件 - * @return 成功返回0,失败返回-1 - */ -int init_gui(); - -/** - * @brief 清理GUI资源 - */ -void cleanup_gui(); - -/** - * @brief 屏幕坐标转棋盘坐标 - */ -int screen_to_board(int screen_x, int screen_y, int *board_x, int *board_y); - -/** - * @brief 显示消息 - */ -void show_message(const char *message); - -/** - * @brief 启动玩家对战模式 - */ -void start_pvp_game_gui(); - -/** - * @brief 启动人机对战模式 - */ -void start_pve_game_gui(); - -/** - * @brief 启动复盘模式 - */ -void start_replay_gui(); - -/** - * @brief 运行图形化界面模式 - * @details 主循环处理事件、渲染画面和更新状态 - */ -void run_gui_mode(); - -#endif // GUI_H diff --git a/include/gui_internal.h b/include/gui_internal.h deleted file mode 100644 index d2a30c9..0000000 --- a/include/gui_internal.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef GUI_INTERNAL_H -#define GUI_INTERNAL_H - -#include - -// 全局变量声明 (在 gui_core.c 中定义) -extern Ihandle *dlg; -extern Ihandle *board_canvas; -extern Ihandle *lbl_player; -extern Ihandle *lbl_status; -extern int gui_game_mode; // 0: PvP, 1: PvE, 2: Replay, 3: Network -extern int replay_total_steps; // 复盘总步数 - -// 核心功能 (在 gui_core.c 中定义) -void update_ui_labels(); -int screen_to_board(int screen_x, int screen_y, int *board_x, int *board_y); - -// 游戏窗口 (在 gui_game.c 中定义) -void create_game_window(); -void start_pvp_game_gui(); -void start_pve_game_gui(); -void start_network_game_gui(); -int action_cb(Ihandle *ih); -int button_cb(Ihandle *ih, int button, int pressed, int x, int y, char *status); -int k_any_cb(Ihandle *ih, int c); -int btn_back_cb(Ihandle *ih); -int btn_undo_cb(Ihandle *ih); -int btn_save_cb(Ihandle *ih); - -// 复盘功能 (在 gui_replay.c 中定义) -void select_replay_file_gui(); -int btn_replay_prev_cb(Ihandle *ih); -int btn_replay_next_cb(Ihandle *ih); -int btn_replay_sel_ok_cb(Ihandle *ih); -int btn_replay_sel_cancel_cb(Ihandle *ih); - -#endif // GUI_INTERNAL_H diff --git a/include/gui_menu.h b/include/gui_menu.h deleted file mode 100644 index f953c12..0000000 --- a/include/gui_menu.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef GUI_MENU_H -#define GUI_MENU_H - -#include - -// 主菜单对话框句柄,需要暴露给其他模块(如返回菜单时) -extern Ihandle *menu_dlg; - -/** - * @brief 创建并显示主菜单 - */ -void create_main_menu(); - -/** - * @brief 显示主菜单 - */ -void show_main_menu(); - -/** - * @brief 隐藏主菜单 - */ -void hide_main_menu(); - -#endif // GUI_MENU_H diff --git a/include/llm_ai.h b/include/llm_ai.h deleted file mode 100644 index f8db9ea..0000000 --- a/include/llm_ai.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @file llm_ai.h - * @brief 大模型AI模块头文件 - * @note 通过OpenAI兼容API调用大模型进行五子棋对弈 - */ - -#ifndef LLM_AI_H -#define LLM_AI_H - -#include - -/** - * @brief 调用大模型获取落子坐标(同步,会阻塞) - * @param out_x 输出:落子行坐标 (0-based) - * @param out_y 输出:落子列坐标 (0-based) - * @return true 获取成功,坐标合法且位置为空 - * @return false 获取失败(网络错误/坐标非法/重试耗尽) - */ -bool llm_ai_move(int *out_x, int *out_y); - -/** - * @brief 异步启动大模型思考(后台线程) - * @note 调用后用 llm_ai_poll_result 轮询结果 - */ -void llm_ai_start_move(void); - -/** - * @brief 轮询大模型结果(非阻塞) - * @param out_x 输出:落子行坐标 - * @param out_y 输出:落子列坐标 - * @return 0 仍在思考, 1 成功获取坐标, -1 失败(应回退算法AI) - */ -int llm_ai_poll_result(int *out_x, int *out_y); - -#endif // LLM_AI_H diff --git a/include/network.h b/include/network.h deleted file mode 100644 index 3f4f45d..0000000 --- a/include/network.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file network.h - * @brief 五子棋网络对战模块头文件 - * @note 本文件定义了五子棋游戏的网络对战功能: - * 1. 服务器模式(主机) - * 2. 客户端模式(加入游戏) - * 3. 网络消息传输 - */ - -#ifndef NETWORK_H -#define NETWORK_H - -#include "type.h" -#include "config.h" -#include -#include - -// network_state 的 extern 声明在 globals.h 中 - -// 函数声明 - -/** - * @brief 初始化网络模块 - * @return true 初始化成功 - * @return false 初始化失败 - */ -bool init_network(); - -/** - * @brief 清理网络模块 - */ -void cleanup_network(); - -/** - * @brief 创建服务器(主机模式) - * @param port 监听端口 - * @return true 创建成功 - * @return false 创建失败 - */ -bool create_server(int port); - -/** - * @brief 连接到服务器(客户端模式) - * @param ip 服务器IP地址 - * @param port 服务器端口 - * @return true 连接成功 - * @return false 连接失败 - */ -bool connect_to_server(const char *ip, int port); - -/** - * @brief 发送网络消息 - * @param msg 要发送的消息 - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_network_message(const NetworkMessage *msg); - -/** - * @brief 接收网络消息 - * @param msg 接收消息的缓冲区 - * @param timeout_ms 超时时间(毫秒),0表示不阻塞等待 - * @return true 接收成功 - * @return false 接收失败或超时 - */ -bool receive_network_message(NetworkMessage *msg, int timeout_ms); - -/** - * @brief 断开网络连接 - */ -void disconnect_network(); - -/** - * @brief 检查网络连接状态 - * @return true 连接正常 - * @return false 连接断开 - */ -bool is_network_connected(); - -/** - * @brief 获取本机IP地址 - * @param ip_buffer 存储IP地址的缓冲区 - * @param buffer_size 缓冲区大小 - * @return true 获取成功 - * @return false 获取失败 - */ -bool get_local_ip(char *ip_buffer, int buffer_size); - -/** - * @brief 发送落子消息 - * @param x 行坐标 - * @param y 列坐标 - * @param player_id 玩家ID - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_move(int x, int y, int player_id); - -/** - * @brief 发送聊天消息 - * @param message 聊天内容 - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_chat_message(const char *message); - -/** - * @brief 发送认输消息 - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_surrender(); - -/** - * @brief 发送悔棋请求 - * @param steps 悔棋步数 - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_undo_request(int steps); - -/** - * @brief 发送悔棋回应 - * @param accepted 是否同意悔棋 - * @param steps 悔棋步数 - * @return true 发送成功 - * @return false 发送失败 - */ -bool send_undo_response(bool accepted, int steps); - -#endif // NETWORK_H \ No newline at end of file diff --git a/include/record.h b/include/record.h deleted file mode 100644 index 5eaf9d5..0000000 --- a/include/record.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file record.h - * @brief 游戏复盘与记录头文件 - * @note 本文件定义了游戏复盘与记录相关的函数和数据结构。 - * 它负责管理游戏的历史记录、加载和保存游戏文件、计算游戏评分等功能。 - */ -#ifndef RECORD_H -#define RECORD_H - -#include "gobang.h" - -// --- 复盘与记录功能 --- -/** - * @brief 将当前对局记录保存到文件 - * @param filename 要保存到的文件名 - * @param game_mode 游戏模式 - * @return 0表示成功,非0表示失败 - */ -int save_game_to_file(const char *filename, int game_mode); - -/** - * @brief 从文件加载游戏记录 - * @param filename 要加载的文件名 - * @return 游戏模式(1或2),0表示失败 - */ -int load_game_from_file(const char *filename); - -/** - * @brief 计算游戏评分 - */ -void calculate_game_scores(); - -/** - * @brief 显示游戏评分结果和MVP评选 - * @param game_mode 游戏模式(1-人机对战,2-双人对战) - */ -void display_game_scores(int game_mode); - -#endif // RECORD_H \ No newline at end of file diff --git a/include/type.h b/include/type.h deleted file mode 100644 index d3b5cbf..0000000 --- a/include/type.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file type.h - * @brief 五子棋游戏数据类型定义头文件 - * @note 本文件集中定义了五子棋游戏中使用的所有数据结构和枚举类型 - * @author 刘航宇 - */ - -#ifndef TYPE_H -#define TYPE_H - -#include -#include -#include - -// ==================== 游戏核心数据结构 ==================== - -/** - * @brief 记录一步棋的详细信息 - */ -typedef struct -{ - int player; // 执行该步的玩家标识 - int x; // 落子的行坐标 (0-based) - int y; // 落子的列坐标 (0-based) -} Step; - -/** - * @brief 存储在特定方向上棋子连续性的信息 - * @details 用于评估棋形,例如判断活三、冲四等关键形态 - */ -typedef struct -{ - int continuous_chess; // 连续同色棋子的数量 - bool check_start; // 棋子序列的起始端是否为空位(即是否开放) - bool check_end; // 棋子序列的末尾端是否为空位(即是否开放) -} DirInfo; - -// ==================== AI相关数据结构 ==================== - -/** - * @brief 移动排序结构体 - * @details 用于AI移动排序,存储候选移动及其评估分数 - */ -typedef struct -{ - int x, y; // 位置坐标 - int score; // 评估分数 -} ScoredMove; - -/** - * @brief 威胁类型枚举 - * @details 用于AI威胁检测系统 - */ -typedef enum -{ - THREAT_NONE = 0, // 无威胁 - THREAT_WIN = 5, // 直接获胜 - THREAT_FOUR = 4, // 活四/冲四 - THREAT_THREE = 3, // 活三 - THREAT_DOUBLE = 2, // 双威胁 - THREAT_POTENTIAL = 1 // 潜在威胁 -} ThreatLevel; - -// ==================== 网络相关数据结构 ==================== - -/** - * @brief 网络消息结构 - * @details 用于网络对战中的消息传输 - */ -typedef struct -{ - int type; // 消息类型 - int player_id; // 玩家ID - int x, y; // 坐标(用于落子) - char message[256]; // 消息内容(用于聊天等) - time_t timestamp; // 时间戳 -} NetworkMessage; - -/** - * @brief 网络游戏状态结构 - * @details 用于管理网络游戏状态 - */ -// ENet 头文件需要前置声明或直接包含,但在 type.h 中包含可能引起循环依赖 -// 我们可以使用 void* 来避免在 type.h 中包含 enet.h -typedef struct -{ - void *host; // ENetHost * (Server 或 Client) - void *peer; // ENetPeer * (连接的对象) - bool is_server; // 是否为服务器(主机) - bool is_connected; // 是否已连接 - int local_player_id; // 本地玩家ID - int remote_player_id; // 远程玩家ID - char remote_ip[64]; // 远程IP - int port; // 端口 -} NetworkGameState; - -#endif // TYPE_H \ No newline at end of file diff --git a/installer/installer.iss b/installer/installer.iss deleted file mode 100644 index 993cdad..0000000 --- a/installer/installer.iss +++ /dev/null @@ -1,43 +0,0 @@ -[Setup] -AppName=五子棋游戏 -AppVersion=8.3 -AppPublisher=LHY -AppPublisherURL=https://github.com/LHY0125/gobang.git -AppSupportURL=https://github.com/LHY0125/gobang.git -AppUpdatesURL=https://github.com/LHY0125/gobang.git -DefaultDirName={autopf}\Gobang -DefaultGroupName=五子棋游戏 -AllowNoIcons=yes -OutputDir=dist -OutputBaseFilename=Gobang_Inno_Setup -SetupIconFile= -Compression=lzma -SolidCompression=yes -WizardStyle=modern -PrivilegesRequired=lowest - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked - -[Files] -Source: "..\bin\gobang_gui.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\bin\iup.dll"; DestDir: "{app}"; Flags: ignoreversion -; 允许文件夹为空时不报错 -Source: "..\bin\records\*"; DestDir: "{app}\records"; Flags: ignoreversion recursesubdirs createallsubdirs skipifsourcedoesntexist - -[Icons] -Name: "{group}\五子棋游戏(图形界面版)"; Filename: "{app}\gobang_gui.exe"; WorkingDir: "{app}" -Name: "{group}\{cm:UninstallProgram,五子棋游戏}"; Filename: "{uninstallexe}" -Name: "{autodesktop}\五子棋游戏"; Filename: "{app}\gobang_gui.exe"; WorkingDir: "{app}"; Tasks: desktopicon - -[Run] -Filename: "{app}\gobang_gui.exe"; WorkingDir: "{app}"; Description: "{cm:LaunchProgram,五子棋游戏}"; Flags: nowait postinstall skipifsilent - -[UninstallDelete] -Type: filesandordirs; Name: "{app}\records" -Type: files; Name: "{app}\gobang_gui.exe" -Type: files; Name: "{app}\iup.dll" -Type: dirifempty; Name: "{app}" diff --git a/libs/IUP/freetype6.dll b/libs/IUP/freetype6.dll deleted file mode 100644 index e8c3c21..0000000 Binary files a/libs/IUP/freetype6.dll and /dev/null differ diff --git a/libs/IUP/ftgl.dll b/libs/IUP/ftgl.dll deleted file mode 100644 index 97fc44d..0000000 Binary files a/libs/IUP/ftgl.dll and /dev/null differ diff --git a/libs/IUP/include/iup.h b/libs/IUP/include/iup.h deleted file mode 100644 index 53d56e6..0000000 --- a/libs/IUP/include/iup.h +++ /dev/null @@ -1,516 +0,0 @@ -/** \file - * \brief User API - * IUP - A Portable User Interface Toolkit - * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil - * http://www.tecgraf.puc-rio.br/iup mailto:iup@tecgraf.puc-rio.br - * - * See Copyright Notice at the end of this file - */ - -#ifndef __IUP_H -#define __IUP_H - -#include "iupkey.h" -#include "iupdef.h" -#include "iup_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#define IUP_NAME "IUP - Portable User Interface" -#define IUP_DESCRIPTION "Multi-platform Toolkit for Building Graphical User Interfaces" -#define IUP_COPYRIGHT "Copyright (C) 1994-2023 Tecgraf/PUC-Rio" -#define IUP_VERSION "3.31" /* bug fixes are reported only by IupVersion functions */ -#define IUP_VERSION_NUMBER 331000 -#define IUP_VERSION_DATE "2023/10/13" /* does not include bug fix releases */ - -typedef struct Ihandle_ Ihandle; -typedef int (*Icallback)(Ihandle*); - - -/************************************************************************/ -/* Main API */ -/************************************************************************/ - -IUP_API int IupOpen (int *argc, char ***argv); -IUP_API void IupClose (void); -IUP_API int IupIsOpened (void); - -IUPIMGLIB_API void IupImageLibOpen(void); - -IUP_API int IupMainLoop (void); -IUP_API int IupLoopStep (void); -IUP_API int IupLoopStepWait (void); -IUP_API int IupMainLoopLevel (void); -IUP_API void IupFlush (void); -IUP_API void IupExitLoop (void); -IUP_API void IupPostMessage (Ihandle* ih, const char* s, int i, double d, void* p); - -IUP_API int IupRecordInput(const char* filename, int mode); -IUP_API int IupPlayInput(const char* filename); - -IUP_API void IupUpdate (Ihandle* ih); -IUP_API void IupUpdateChildren(Ihandle* ih); -IUP_API void IupRedraw (Ihandle* ih, int children); -IUP_API void IupRefresh (Ihandle* ih); -IUP_API void IupRefreshChildren(Ihandle* ih); - -IUP_API int IupExecute(const char *filename, const char* parameters); -IUP_API int IupExecuteWait(const char *filename, const char* parameters); -IUP_API int IupHelp(const char* url); -IUP_API void IupLog(const char* type, const char* format, ...); - -IUP_API char* IupLoad (const char *filename); -IUP_API char* IupLoadBuffer (const char *buffer); - -IUP_API char* IupVersion (void); -IUP_API char* IupVersionDate (void); -IUP_API int IupVersionNumber (void); -IUP_API void IupVersionShow (void); - -IUP_API void IupSetLanguage (const char *lng); -IUP_API char* IupGetLanguage (void); -IUP_API void IupSetLanguageString(const char* name, const char* str); -IUP_API void IupStoreLanguageString(const char* name, const char* str); -IUP_API char* IupGetLanguageString(const char* name); -IUP_API void IupSetLanguagePack(Ihandle* ih); - -IUP_API void IupDestroy (Ihandle* ih); -IUP_API void IupDetach (Ihandle* child); -IUP_API Ihandle* IupAppend (Ihandle* ih, Ihandle* child); -IUP_API Ihandle* IupInsert (Ihandle* ih, Ihandle* ref_child, Ihandle* child); -IUP_API Ihandle* IupGetChild (Ihandle* ih, int pos); -IUP_API int IupGetChildPos (Ihandle* ih, Ihandle* child); -IUP_API int IupGetChildCount(Ihandle* ih); -IUP_API Ihandle* IupGetNextChild (Ihandle* ih, Ihandle* child); -IUP_API Ihandle* IupGetBrother (Ihandle* ih); -IUP_API Ihandle* IupGetParent (Ihandle* ih); -IUP_API Ihandle* IupGetDialog (Ihandle* ih); -IUP_API Ihandle* IupGetDialogChild(Ihandle* ih, const char* name); -IUP_API int IupReparent (Ihandle* ih, Ihandle* new_parent, Ihandle* ref_child); - -IUP_API int IupPopup (Ihandle* ih, int x, int y); -IUP_API int IupShow (Ihandle* ih); -IUP_API int IupShowXY (Ihandle* ih, int x, int y); -IUP_API int IupHide (Ihandle* ih); -IUP_API int IupMap (Ihandle* ih); -IUP_API void IupUnmap (Ihandle* ih); - -IUP_API void IupResetAttribute(Ihandle* ih, const char* name); -IUP_API int IupGetAllAttributes(Ihandle* ih, char** names, int n); -IUP_API void IupCopyAttributes(Ihandle* src_ih, Ihandle* dst_ih); -IUP_API Ihandle* IupSetAtt(const char* handle_name, Ihandle* ih, const char* name, ...); -IUP_API Ihandle* IupSetAttributes (Ihandle* ih, const char *str); -IUP_API char* IupGetAttributes (Ihandle* ih); - -IUP_API void IupSetAttribute (Ihandle* ih, const char* name, const char* value); -IUP_API void IupSetStrAttribute(Ihandle* ih, const char* name, const char* value); -IUP_API void IupSetStrf (Ihandle* ih, const char* name, const char* format, ...); -IUP_API void IupSetInt (Ihandle* ih, const char* name, int value); -IUP_API void IupSetFloat (Ihandle* ih, const char* name, float value); -IUP_API void IupSetDouble (Ihandle* ih, const char* name, double value); -IUP_API void IupSetRGB (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b); -IUP_API void IupSetRGBA (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a); - -IUP_API char* IupGetAttribute(Ihandle* ih, const char* name); -IUP_API int IupGetInt (Ihandle* ih, const char* name); -IUP_API int IupGetInt2 (Ihandle* ih, const char* name); -IUP_API int IupGetIntInt (Ihandle* ih, const char* name, int *i1, int *i2); -IUP_API float IupGetFloat (Ihandle* ih, const char* name); -IUP_API double IupGetDouble(Ihandle* ih, const char* name); -IUP_API void IupGetRGB (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b); -IUP_API void IupGetRGBA (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a); - -IUP_API void IupSetAttributeId(Ihandle* ih, const char* name, int id, const char *value); -IUP_API void IupSetStrAttributeId(Ihandle* ih, const char* name, int id, const char *value); -IUP_API void IupSetStrfId(Ihandle* ih, const char* name, int id, const char* format, ...); -IUP_API void IupSetIntId(Ihandle* ih, const char* name, int id, int value); -IUP_API void IupSetFloatId(Ihandle* ih, const char* name, int id, float value); -IUP_API void IupSetDoubleId(Ihandle* ih, const char* name, int id, double value); -IUP_API void IupSetRGBId(Ihandle* ih, const char* name, int id, unsigned char r, unsigned char g, unsigned char b); - -IUP_API char* IupGetAttributeId(Ihandle* ih, const char* name, int id); -IUP_API int IupGetIntId(Ihandle* ih, const char* name, int id); -IUP_API float IupGetFloatId(Ihandle* ih, const char* name, int id); -IUP_API double IupGetDoubleId(Ihandle* ih, const char* name, int id); -IUP_API void IupGetRGBId(Ihandle* ih, const char* name, int id, unsigned char *r, unsigned char *g, unsigned char *b); - -IUP_API void IupSetAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); -IUP_API void IupSetStrAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); -IUP_API void IupSetStrfId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); -IUP_API void IupSetIntId2(Ihandle* ih, const char* name, int lin, int col, int value); -IUP_API void IupSetFloatId2(Ihandle* ih, const char* name, int lin, int col, float value); -IUP_API void IupSetDoubleId2(Ihandle* ih, const char* name, int lin, int col, double value); -IUP_API void IupSetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b); - -IUP_API char* IupGetAttributeId2(Ihandle* ih, const char* name, int lin, int col); -IUP_API int IupGetIntId2(Ihandle* ih, const char* name, int lin, int col); -IUP_API float IupGetFloatId2(Ihandle* ih, const char* name, int lin, int col); -IUP_API double IupGetDoubleId2(Ihandle* ih, const char* name, int lin, int col); -IUP_API void IupGetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char *r, unsigned char *g, unsigned char *b); - -IUP_API void IupSetGlobal (const char* name, const char* value); -IUP_API void IupSetStrGlobal(const char* name, const char* value); -IUP_API char* IupGetGlobal (const char* name); - -IUP_API Ihandle* IupSetFocus (Ihandle* ih); -IUP_API Ihandle* IupGetFocus (void); -IUP_API Ihandle* IupPreviousField(Ihandle* ih); -IUP_API Ihandle* IupNextField (Ihandle* ih); - -IUP_API Icallback IupGetCallback (Ihandle* ih, const char *name); -IUP_API Icallback IupSetCallback (Ihandle* ih, const char *name, Icallback func); -IUP_API Ihandle* IupSetCallbacks(Ihandle* ih, const char *name, Icallback func, ...); - -IUP_API Icallback IupGetFunction(const char *name); -IUP_API Icallback IupSetFunction(const char *name, Icallback func); - -IUP_API Ihandle* IupGetHandle (const char *name); -IUP_API Ihandle* IupSetHandle (const char *name, Ihandle* ih); -IUP_API int IupGetAllNames (char** names, int n); -IUP_API int IupGetAllDialogs(char** names, int n); -IUP_API char* IupGetName (Ihandle* ih); - -IUP_API void IupSetAttributeHandle(Ihandle* ih, const char* name, Ihandle* ih_named); -IUP_API Ihandle* IupGetAttributeHandle(Ihandle* ih, const char* name); -IUP_API void IupSetAttributeHandleId(Ihandle* ih, const char* name, int id, Ihandle* ih_named); -IUP_API Ihandle* IupGetAttributeHandleId(Ihandle* ih, const char* name, int id); -IUP_API void IupSetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col, Ihandle* ih_named); -IUP_API Ihandle* IupGetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col); - -IUP_API char* IupGetClassName(Ihandle* ih); -IUP_API char* IupGetClassType(Ihandle* ih); -IUP_API int IupGetAllClasses(char** names, int n); -IUP_API int IupGetClassAttributes(const char* classname, char** names, int n); -IUP_API int IupGetClassCallbacks(const char* classname, char** names, int n); -IUP_API void IupSaveClassAttributes(Ihandle* ih); -IUP_API void IupCopyClassAttributes(Ihandle* src_ih, Ihandle* dst_ih); -IUP_API void IupSetClassDefaultAttribute(const char* classname, const char *name, const char* value); -IUP_API int IupClassMatch(Ihandle* ih, const char* classname); - -IUP_API Ihandle* IupCreate (const char *classname); -IUP_API Ihandle* IupCreatev(const char *classname, void* *params); -IUP_API Ihandle* IupCreatep(const char *classname, void* first, ...); - -/************************************************************************/ -/* Elements */ -/************************************************************************/ - -IUP_API Ihandle* IupFill (void); -IUP_API Ihandle* IupSpace(void); - -IUP_API Ihandle* IupRadio (Ihandle* child); -IUP_API Ihandle* IupVbox (Ihandle* child, ...); -IUP_API Ihandle* IupVboxv (Ihandle* *children); -IUP_API Ihandle* IupZbox (Ihandle* child, ...); -IUP_API Ihandle* IupZboxv (Ihandle* *children); -IUP_API Ihandle* IupHbox (Ihandle* child, ...); -IUP_API Ihandle* IupHboxv (Ihandle* *children); - -IUP_API Ihandle* IupNormalizer (Ihandle* ih_first, ...); -IUP_API Ihandle* IupNormalizerv(Ihandle* *ih_list); - -IUP_API Ihandle* IupCbox (Ihandle* child, ...); -IUP_API Ihandle* IupCboxv (Ihandle* *children); -IUP_API Ihandle* IupSbox (Ihandle* child); -IUP_API Ihandle* IupSplit (Ihandle* child1, Ihandle* child2); -IUP_API Ihandle* IupScrollBox (Ihandle* child); -IUP_API Ihandle* IupFlatScrollBox(Ihandle* child); -IUP_API Ihandle* IupGridBox (Ihandle* child, ...); -IUP_API Ihandle* IupGridBoxv (Ihandle* *children); -IUP_API Ihandle* IupMultiBox (Ihandle* child, ...); -IUP_API Ihandle* IupMultiBoxv (Ihandle **children); -IUP_API Ihandle* IupExpander(Ihandle* child); -IUP_API Ihandle* IupDetachBox (Ihandle* child); -IUP_API Ihandle* IupBackgroundBox(Ihandle* child); - -IUP_API Ihandle* IupFrame (Ihandle* child); -IUP_API Ihandle* IupFlatFrame (Ihandle* child); - -IUP_API Ihandle* IupImage (int width, int height, const unsigned char* pixels); -IUP_API Ihandle* IupImageRGB (int width, int height, const unsigned char* pixels); -IUP_API Ihandle* IupImageRGBA (int width, int height, const unsigned char* pixels); - -IUP_API Ihandle* IupItem (const char* title, const char* action); -IUP_API Ihandle* IupSubmenu (const char* title, Ihandle* child); -IUP_API Ihandle* IupSeparator (void); -IUP_API Ihandle* IupMenu (Ihandle* child, ...); -IUP_API Ihandle* IupMenuv (Ihandle* *children); - -IUP_API Ihandle* IupButton (const char* title, const char* action); -IUP_API Ihandle* IupFlatButton (const char* title); -IUP_API Ihandle* IupFlatToggle (const char* title); -IUP_API Ihandle* IupDropButton (Ihandle* dropchild); -IUP_API Ihandle* IupFlatLabel (const char* title); -IUP_API Ihandle* IupFlatSeparator(void); -IUP_API Ihandle* IupCanvas (const char* action); -IUP_API Ihandle* IupDialog (Ihandle* child); -IUP_API Ihandle* IupUser (void); -IUP_API Ihandle* IupThread (void); -IUP_API Ihandle* IupLabel (const char* title); -IUP_API Ihandle* IupList (const char* action); -IUP_API Ihandle* IupFlatList (void); -IUP_API Ihandle* IupText (const char* action); -IUP_API Ihandle* IupMultiLine (const char* action); -IUP_API Ihandle* IupToggle (const char* title, const char* action); -IUP_API Ihandle* IupTimer (void); -IUP_API Ihandle* IupClipboard (void); -IUP_API Ihandle* IupProgressBar(void); -IUP_API Ihandle* IupVal (const char *type); -IUP_API Ihandle* IupFlatVal (const char *type); -IUP_API Ihandle* IupFlatTree (void); -IUP_API Ihandle* IupTabs (Ihandle* child, ...); -IUP_API Ihandle* IupTabsv (Ihandle* *children); -IUP_API Ihandle* IupFlatTabs (Ihandle* first, ...); -IUP_API Ihandle* IupFlatTabsv (Ihandle* *children); -IUP_API Ihandle* IupTree (void); -IUP_API Ihandle* IupLink (const char* url, const char* title); -IUP_API Ihandle* IupAnimatedLabel(Ihandle* animation); -IUP_API Ihandle* IupDatePick (void); -IUP_API Ihandle* IupCalendar (void); -IUP_API Ihandle* IupColorbar (void); -IUP_API Ihandle* IupGauge (void); -IUP_API Ihandle* IupDial (const char* type); -IUP_API Ihandle* IupColorBrowser(void); - -/* Old controls, use SPIN attribute of IupText */ -IUP_API Ihandle* IupSpin (void); -IUP_API Ihandle* IupSpinbox (Ihandle* child); - - -/************************************************************************/ -/* Utilities */ -/************************************************************************/ - -/* String compare utility */ -IUP_API int IupStringCompare(const char* str1, const char* str2, int casesensitive, int lexicographic); - -/* IupImage utilities */ -IUP_API int IupSaveImageAsText(Ihandle* ih, const char* filename, const char* format, const char* name); -IUP_API Ihandle* IupImageGetHandle(const char* name); - -/* IupText and IupScintilla utilities */ -IUP_API void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int *pos); -IUP_API void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int *lin, int *col); - -/* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */ -IUP_API int IupConvertXYToPos(Ihandle* ih, int x, int y); - -/* OLD names, kept for backward compatibility, will never be removed. */ -IUP_API void IupStoreGlobal(const char* name, const char* value); -IUP_API void IupStoreAttribute(Ihandle* ih, const char* name, const char* value); -IUP_API void IupSetfAttribute(Ihandle* ih, const char* name, const char* format, ...); -IUP_API void IupStoreAttributeId(Ihandle* ih, const char* name, int id, const char *value); -IUP_API void IupSetfAttributeId(Ihandle* ih, const char* name, int id, const char* f, ...); -IUP_API void IupStoreAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); -IUP_API void IupSetfAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); - -/* IupTree and IupFlatTree utilities (work for both) */ -IUP_API int IupTreeSetUserId(Ihandle* ih, int id, void* userid); -IUP_API void* IupTreeGetUserId(Ihandle* ih, int id); -IUP_API int IupTreeGetId(Ihandle* ih, void *userid); -IUP_API void IupTreeSetAttributeHandle(Ihandle* ih, const char* name, int id, Ihandle* ih_named); /* deprecated, use IupSetAttributeHandleId */ - - -/************************************************************************/ -/* Pre-defined dialogs */ -/************************************************************************/ - -IUP_API Ihandle* IupFileDlg(void); -IUP_API Ihandle* IupMessageDlg(void); -IUP_API Ihandle* IupColorDlg(void); -IUP_API Ihandle* IupFontDlg(void); -IUP_API Ihandle* IupProgressDlg(void); - -IUP_API int IupGetFile(char *arq); -IUP_API void IupMessage(const char *title, const char *msg); -IUP_API void IupMessagef(const char *title, const char *format, ...); -IUP_API void IupMessageError(Ihandle* parent, const char* message); -IUP_API int IupMessageAlarm(Ihandle* parent, const char* title, const char *message, const char *buttons); -IUP_API int IupAlarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3); -IUP_API int IupScanf(const char *format, ...); -IUP_API int IupListDialog(int type, const char *title, int size, const char** list, - int op, int max_col, int max_lin, int* marks); -IUP_API int IupGetText(const char* title, char* text, int maxsize); -IUP_API int IupGetColor(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b); - -typedef int (*Iparamcb)(Ihandle* dialog, int param_index, void* user_data); -IUP_API int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...); -IUP_API int IupGetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data); -IUP_API Ihandle* IupParam(const char* format); -IUP_API Ihandle* IupParamBox(Ihandle* param, ...); -IUP_API Ihandle* IupParamBoxv(Ihandle* *param_array); - -IUP_API Ihandle* IupLayoutDialog(Ihandle* dialog); -IUP_API Ihandle* IupElementPropertiesDialog(Ihandle* parent, Ihandle* elem); -IUP_API Ihandle* IupGlobalsDialog(void); -IUP_API Ihandle* IupClassInfoDialog(Ihandle* parent); - - -#ifdef __cplusplus -} -#endif - -/************************************************************************/ -/* Common Flags and Return Values */ -/************************************************************************/ -#define IUP_ERROR 1 -#define IUP_NOERROR 0 -#define IUP_OPENED -1 -#define IUP_INVALID -1 -#define IUP_INVALID_ID -10 - - -/************************************************************************/ -/* Callback Return Values */ -/************************************************************************/ -#define IUP_IGNORE -1 -#define IUP_DEFAULT -2 -#define IUP_CLOSE -3 -#define IUP_CONTINUE -4 - -/************************************************************************/ -/* IupPopup and IupShowXY Parameter Values */ -/************************************************************************/ -#define IUP_CENTER 0xFFFF /* 65535 */ -#define IUP_LEFT 0xFFFE /* 65534 */ -#define IUP_RIGHT 0xFFFD /* 65533 */ -#define IUP_MOUSEPOS 0xFFFC /* 65532 */ -#define IUP_CURRENT 0xFFFB /* 65531 */ -#define IUP_CENTERPARENT 0xFFFA /* 65530 */ -#define IUP_LEFTPARENT 0xFFF9 /* 65529 */ -#define IUP_RIGHTPARENT 0xFFF8 /* 65528 */ -#define IUP_TOP IUP_LEFT -#define IUP_BOTTOM IUP_RIGHT -#define IUP_TOPPARENT IUP_LEFTPARENT -#define IUP_BOTTOMPARENT IUP_RIGHTPARENT - -/************************************************************************/ -/* SHOW_CB Callback Values */ -/************************************************************************/ -enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE}; - -/************************************************************************/ -/* SCROLL_CB Callback Values */ -/************************************************************************/ -enum{IUP_SBUP, IUP_SBDN, IUP_SBPGUP, IUP_SBPGDN, IUP_SBPOSV, IUP_SBDRAGV, - IUP_SBLEFT, IUP_SBRIGHT, IUP_SBPGLEFT, IUP_SBPGRIGHT, IUP_SBPOSH, IUP_SBDRAGH}; - -/************************************************************************/ -/* Mouse Button Values and Macros */ -/************************************************************************/ -#define IUP_BUTTON1 '1' -#define IUP_BUTTON2 '2' -#define IUP_BUTTON3 '3' -#define IUP_BUTTON4 '4' -#define IUP_BUTTON5 '5' - -#define iup_isshift(_s) (_s[0]=='S') -#define iup_iscontrol(_s) (_s[1]=='C') -#define iup_isbutton1(_s) (_s[2]=='1') -#define iup_isbutton2(_s) (_s[3]=='2') -#define iup_isbutton3(_s) (_s[4]=='3') -#define iup_isdouble(_s) (_s[5]=='D') -#define iup_isalt(_s) (_s[6]=='A') -#define iup_issys(_s) (_s[7]=='Y') -#define iup_isbutton4(_s) (_s[8]=='4') -#define iup_isbutton5(_s) (_s[9]=='5') - -/* Old definitions for backward compatibility */ -#define isshift iup_isshift -#define iscontrol iup_iscontrol -#define isbutton1 iup_isbutton1 -#define isbutton2 iup_isbutton2 -#define isbutton3 iup_isbutton3 -#define isdouble iup_isdouble -#define isalt iup_isalt -#define issys iup_issys -#define isbutton4 iup_isbutton4 -#define isbutton5 iup_isbutton5 - - -/************************************************************************/ -/* Pre-Defined Masks */ -/************************************************************************/ -#define IUP_MASK_FLOAT "[+/-]?(/d+/.?/d*|/./d+)" -#define IUP_MASK_UFLOAT "(/d+/.?/d*|/./d+)" -#define IUP_MASK_EFLOAT "[+/-]?(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" -#define IUP_MASK_UEFLOAT "(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" -#define IUP_MASK_FLOATCOMMA "[+/-]?(/d+/,?/d*|/,/d+)" -#define IUP_MASK_UFLOATCOMMA "(/d+/,?/d*|/,/d+)" -#define IUP_MASK_INT "[+/-]?/d+" -#define IUP_MASK_UINT "/d+" - -/* Old definitions for backward compatibility */ -#define IUPMASK_FLOAT IUP_MASK_FLOAT -#define IUPMASK_UFLOAT IUP_MASK_UFLOAT -#define IUPMASK_EFLOAT IUP_MASK_EFLOAT -#define IUPMASK_INT IUP_MASK_INT -#define IUPMASK_UINT IUP_MASK_UINT - - -/************************************************************************/ -/* IupGetParam Callback situations */ -/************************************************************************/ -#define IUP_GETPARAM_BUTTON1 -1 -#define IUP_GETPARAM_INIT -2 -#define IUP_GETPARAM_BUTTON2 -3 -#define IUP_GETPARAM_BUTTON3 -4 -#define IUP_GETPARAM_CLOSE -5 -#define IUP_GETPARAM_MAP -6 -#define IUP_GETPARAM_OK IUP_GETPARAM_BUTTON1 -#define IUP_GETPARAM_CANCEL IUP_GETPARAM_BUTTON2 -#define IUP_GETPARAM_HELP IUP_GETPARAM_BUTTON3 - -/************************************************************************/ -/* Used by IupColorbar */ -/************************************************************************/ -#define IUP_PRIMARY -1 -#define IUP_SECONDARY -2 - -/************************************************************************/ -/* Record Input Modes */ -/************************************************************************/ -enum {IUP_RECBINARY, IUP_RECTEXT}; - - -/************************************************************************/ -/* Replacement for the WinMain in Windows, */ -/* this allows the application to start from "main". */ -/* Used only for Watcom. */ -/************************************************************************/ -#if defined (__WATCOMC__) -#ifdef __cplusplus -extern "C" { -int IupMain (int argc, char** argv); /* In C++ we have to declare the prototype */ -} -#endif -#define main IupMain /* this is the trick for Watcom and MetroWerks */ -#endif - -/****************************************************************************** -* Copyright (C) 1994-2019 Tecgraf/PUC-Rio. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to -* permit persons to whom the Software is furnished to do so, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - -#endif diff --git a/libs/IUP/include/iup_class_cbs.hpp b/libs/IUP/include/iup_class_cbs.hpp deleted file mode 100644 index 237ae9e..0000000 --- a/libs/IUP/include/iup_class_cbs.hpp +++ /dev/null @@ -1,464 +0,0 @@ -/** \file - * \brief Class Callback Utilities. - */ - -#ifndef __IUP_CLASS_CBS_HPP -#define __IUP_CLASS_CBS_HPP - - -#define IUP_CLASS_GET_OBJECT(__ih, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__ih, #__class "->this")) - - -#define IUP_CLASS_INITCALLBACK(__ih, __class) \ - IupSetAttribute(__ih, #__class "->this", (char*)this) - -#define IUP_CLASS_SETCALLBACK(__ih, __name, __cb) \ - IupSetCallback(__ih, __name, (Icallback)CB_##__cb) - - - -#ifdef __IUP_PLUS_H - -#define IUP_PLUS_GET_OBJECT(__elem, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__elem.GetHandle(), #__class "->this")) - -#define IUP_PLUS_INITCALLBACK(__elem, __class) \ - IupSetAttribute(__elem.GetHandle(), #__class "->this", (char*)this) - -#define IUP_PLUS_SETCALLBACK(__elem, __name, __cb) \ - IupSetCallback(__elem.GetHandle(), __name, (Icallback)CB_##__cb) - -#endif - - - -#define IUP_CLASS_DECLARECALLBACK_IFn(__class, __cb) \ - int __cb(Ihandle* ih); \ -static int CB_##__cb(Ihandle* ih) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFni(__class, __cb) \ - int __cb(Ihandle* ih, int i1); \ -static int CB_##__cb(Ihandle* ih, int i1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, i5); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiiii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, i5, i6); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, i5, i6, canvas); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnC(__class, __cb) \ - int __cb(Ihandle* ih, struct _cdCanvas* canvas); \ -static int CB_##__cb(Ihandle* ih, struct _cdCanvas* canvas) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, canvas); \ -} - -#define IUP_CLASS_DECLARECALLBACK_dIFnii(__class, __cb) \ - double __cb(Ihandle* ih, int i1, int i2); \ -static double CB_##__cb(Ihandle* ih, int i1, int i2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_sIFni(__class, __cb) \ - char* __cb(Ihandle* ih, int i1); \ -static char* CB_##__cb(Ihandle* ih, int i1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_sIFnii(__class, __cb) \ - char* __cb(Ihandle* ih, int i1, int i2); \ -static char* CB_##__cb(Ihandle* ih, int i1, int i2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_sIFniis(__class, __cb) \ - char* __cb(Ihandle* ih, int i1, int i2, char* s); \ -static char* CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnff(__class, __cb) \ - int __cb(Ihandle* ih, float f1, float f2); \ -static int CB_##__cb(Ihandle* ih, float f1, float f2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, f1, f2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniff(__class, __cb) \ - int __cb(Ihandle* ih, int i1, float f1, float f2); \ -static int CB_##__cb(Ihandle* ih, int i1, float f1, float f2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, f1, f2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnfiis(__class, __cb) \ - int __cb(Ihandle* ih, float f1, int i1, int i2, char* s); \ -static int CB_##__cb(Ihandle* ih, float f1, int i1, int i2, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, f1, i1, i2, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnd(__class, __cb) \ - int __cb(Ihandle* ih, double d1); \ -static int CB_##__cb(Ihandle* ih, double d1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, d1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFndds(__class, __cb) \ - int __cb(Ihandle* ih, double d1, double d2, char* s); \ -static int CB_##__cb(Ihandle* ih, double d1, double d2, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, d1, d2, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniid(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, double d1); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, d1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniidd(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, double d1, double d2); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, d1, d2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiddi(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, d1, d2, i3); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniidds(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, d1, d2, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiIII(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, I1, I2, I3); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniIIII(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4); \ -static int CB_##__cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, I1, I2, I3, I4); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnIi(__class, __cb) \ - int __cb(Ihandle* ih, int *I1, int i1); \ -static int CB_##__cb(Ihandle* ih, int *I1, int i1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, I1, i1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnccc(__class, __cb) \ - int __cb(Ihandle* ih, char c1, char c2, char c3); \ -static int CB_##__cb(Ihandle* ih, char c1, char c2, char c3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, c1, c2, c3); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiiis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, i5, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniiiiiis(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, i3, i4, i5, i6, s); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnss(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, char* s2); \ -static int CB_##__cb(Ihandle* ih, char* s1, char* s2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, s2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFns(__class, __cb) \ - int __cb(Ihandle* ih, char* s1); \ -static int CB_##__cb(Ihandle* ih, char* s1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnsi(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, int i1); \ -static int CB_##__cb(Ihandle* ih, char* s1, int i1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, i1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnsii(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, int i1, int i2); \ -static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, i1, i2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnsiii(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, int i1, int i2, int i3); \ -static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2, int i3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, i1, i2, i3); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnnii(__class, __cb) \ - int __cb(Ihandle* ih, Ihandle* ih1, int i1, int i2); \ -static int CB_##__cb(Ihandle* ih, Ihandle* ih1, int i1, int i2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, ih1, i1, i2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnnn(__class, __cb) \ - int __cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2); \ -static int CB_##__cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, ih1, ih2); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFniinsii(__class, __cb) \ - int __cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4); \ -static int CB_##__cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, i1, i2, ih1, s, i3, i4); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnsVi(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, void* V1, int i1); \ -static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, V1, i1); \ -} - -#define IUP_CLASS_DECLARECALLBACK_IFnsViii(__class, __cb) \ - int __cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3); \ -static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3) \ -{ \ - __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ - return obj->__cb(ih, s1, V1, i1, i2, i3); \ -} - - - -/* #define IUP_CLASS_DEBUG */ -#ifdef IUP_CLASS_DEBUG -class IUP_CLASS_DUMMY -{ - // Used to check for errors in the definitions - IUP_CLASS_DECLARECALLBACK_IFn(IUP_CLASS_DUMMY, IFn); - IUP_CLASS_DECLARECALLBACK_IFni(IUP_CLASS_DUMMY, IFni); - IUP_CLASS_DECLARECALLBACK_IFnii(IUP_CLASS_DUMMY, IFnii); - IUP_CLASS_DECLARECALLBACK_IFniii(IUP_CLASS_DUMMY, IFniii); - IUP_CLASS_DECLARECALLBACK_IFniiii(IUP_CLASS_DUMMY, IFniiii); - IUP_CLASS_DECLARECALLBACK_IFniiiii(IUP_CLASS_DUMMY, IFniiiii); - IUP_CLASS_DECLARECALLBACK_IFniiiiii(IUP_CLASS_DUMMY, IFniiiiii); - IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(IUP_CLASS_DUMMY, IFniiiiiiC); - IUP_CLASS_DECLARECALLBACK_IFnC(IUP_CLASS_DUMMY, IFnC); - IUP_CLASS_DECLARECALLBACK_dIFnii(IUP_CLASS_DUMMY, dIFnii); - IUP_CLASS_DECLARECALLBACK_sIFni(IUP_CLASS_DUMMY, sIFni); - IUP_CLASS_DECLARECALLBACK_sIFnii(IUP_CLASS_DUMMY, sIFnii); - IUP_CLASS_DECLARECALLBACK_sIFniis(IUP_CLASS_DUMMY, sIFniis); - IUP_CLASS_DECLARECALLBACK_IFnff(IUP_CLASS_DUMMY, IFnff); - IUP_CLASS_DECLARECALLBACK_IFniff(IUP_CLASS_DUMMY, IFniff); - IUP_CLASS_DECLARECALLBACK_IFnfiis(IUP_CLASS_DUMMY, IFnfiis); - IUP_CLASS_DECLARECALLBACK_IFnd(IUP_CLASS_DUMMY, IFnd); - IUP_CLASS_DECLARECALLBACK_IFndds(IUP_CLASS_DUMMY, IFndds); - IUP_CLASS_DECLARECALLBACK_IFniid(IUP_CLASS_DUMMY, IFniid); - IUP_CLASS_DECLARECALLBACK_IFniidd(IUP_CLASS_DUMMY, IFniidd); - IUP_CLASS_DECLARECALLBACK_IFniiddi(IUP_CLASS_DUMMY, IFniiddi); - IUP_CLASS_DECLARECALLBACK_IFniidds(IUP_CLASS_DUMMY, IFniidds); - IUP_CLASS_DECLARECALLBACK_IFniiIII(IUP_CLASS_DUMMY, IFniiIII); - IUP_CLASS_DECLARECALLBACK_IFniIIII(IUP_CLASS_DUMMY, IFniIIII); - IUP_CLASS_DECLARECALLBACK_IFnIi(IUP_CLASS_DUMMY, IFnIi); - IUP_CLASS_DECLARECALLBACK_IFnccc(IUP_CLASS_DUMMY, IFnccc); - IUP_CLASS_DECLARECALLBACK_IFnis(IUP_CLASS_DUMMY, IFnis); - IUP_CLASS_DECLARECALLBACK_IFniis(IUP_CLASS_DUMMY, IFniis); - IUP_CLASS_DECLARECALLBACK_IFniiis(IUP_CLASS_DUMMY, IFniiis); - IUP_CLASS_DECLARECALLBACK_IFniiiis(IUP_CLASS_DUMMY, IFniiiis); - IUP_CLASS_DECLARECALLBACK_IFniiiiis(IUP_CLASS_DUMMY, IFniiiiis); - IUP_CLASS_DECLARECALLBACK_IFniiiiiis(IUP_CLASS_DUMMY, IFniiiiiis); - IUP_CLASS_DECLARECALLBACK_IFnss(IUP_CLASS_DUMMY, IFnss); - IUP_CLASS_DECLARECALLBACK_IFns(IUP_CLASS_DUMMY, IFns); - IUP_CLASS_DECLARECALLBACK_IFnsi(IUP_CLASS_DUMMY, IFnsi); - IUP_CLASS_DECLARECALLBACK_IFnsii(IUP_CLASS_DUMMY, IFnsii); - IUP_CLASS_DECLARECALLBACK_IFnsiii(IUP_CLASS_DUMMY, IFnsiii); - IUP_CLASS_DECLARECALLBACK_IFnnii(IUP_CLASS_DUMMY, IFnnii); - IUP_CLASS_DECLARECALLBACK_IFnnn(IUP_CLASS_DUMMY, IFnnn); - IUP_CLASS_DECLARECALLBACK_IFniinsii(IUP_CLASS_DUMMY, IFniinsii); - IUP_CLASS_DECLARECALLBACK_IFnsVi(IUP_CLASS_DUMMY, IFnsVi); - IUP_CLASS_DECLARECALLBACK_IFnsViii(IUP_CLASS_DUMMY, IFnsViii); -}; - -class SampleClass -{ - int sample_count; - -public: - SampleClass() - { - sample_count = 0; - - Ihandle* button1 = IupButton("Inc", NULL); - Ihandle* button2 = IupButton("Dec", NULL); - Ihandle* dialog = IupDialog(IupHbox(button1, button2, NULL)); - - // 1) Register "this" object as a callback receiver (need only once) - IUP_CLASS_INITCALLBACK(dialog, SampleClass); - - // 2) Associate the callback with the button - IUP_CLASS_SETCALLBACK(button1, "ACTION", ButtonAction1); - IUP_CLASS_SETCALLBACK(button2, "ACTION", ButtonAction2); - - IupShow(dialog); - }; - -protected: - // 3) Declare the callback as a member function - IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction1); - IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction2); -}; - -// 4) Define the callback as a member function -int SampleClass::ButtonAction1(Ihandle*) -{ - sample_count++; - return IUP_DEFAULT; -} -int SampleClass::ButtonAction2(Ihandle*) -{ - sample_count--; - return IUP_DEFAULT; -} - -#endif // IUP_CLASS_DEBUG - -#endif diff --git a/libs/IUP/include/iup_config.h b/libs/IUP/include/iup_config.h deleted file mode 100644 index a70f7b5..0000000 --- a/libs/IUP/include/iup_config.h +++ /dev/null @@ -1,60 +0,0 @@ -/** \file - * \brief Configuration file Utilities - * - * See Copyright Notice in "iup.h" - */ - -#ifndef IUP_CONFIG_H -#define IUP_CONFIG_H - -#if defined(__cplusplus) -extern "C" { -#endif - - -IUP_API Ihandle* IupConfig(void); - -IUP_API int IupConfigLoad(Ihandle* ih); -IUP_API int IupConfigSave(Ihandle* ih); - -/****************************************************************/ - -IUP_API void IupConfigSetVariableStr(Ihandle* ih, const char* group, const char* key, const char* value); -IUP_API void IupConfigSetVariableStrId(Ihandle* ih, const char* group, const char* key, int id, const char* value); -IUP_API void IupConfigSetVariableInt(Ihandle* ih, const char* group, const char* key, int value); -IUP_API void IupConfigSetVariableIntId(Ihandle* ih, const char* group, const char* key, int id, int value); -IUP_API void IupConfigSetVariableDouble(Ihandle* ih, const char* group, const char* key, double value); -IUP_API void IupConfigSetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id, double value); - -IUP_API const char* IupConfigGetVariableStr(Ihandle* ih, const char* group, const char* key); -IUP_API const char* IupConfigGetVariableStrId(Ihandle* ih, const char* group, const char* key, int id); -IUP_API int IupConfigGetVariableInt(Ihandle* ih, const char* group, const char* key); -IUP_API int IupConfigGetVariableIntId(Ihandle* ih, const char* group, const char* key, int id); -IUP_API double IupConfigGetVariableDouble(Ihandle* ih, const char* group, const char* key); -IUP_API double IupConfigGetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id); - -IUP_API const char* IupConfigGetVariableStrDef(Ihandle* ih, const char* group, const char* key, const char* def); -IUP_API const char* IupConfigGetVariableStrIdDef(Ihandle* ih, const char* group, const char* key, int id, const char* def); -IUP_API int IupConfigGetVariableIntDef(Ihandle* ih, const char* group, const char* key, int def); -IUP_API int IupConfigGetVariableIntIdDef(Ihandle* ih, const char* group, const char* key, int id, int def); -IUP_API double IupConfigGetVariableDoubleDef(Ihandle* ih, const char* group, const char* key, double def); -IUP_API double IupConfigGetVariableDoubleIdDef(Ihandle* ih, const char* group, const char* key, int id, double def); - -IUP_API void IupConfigCopy(Ihandle* ih1, Ihandle* ih2, const char* exclude_prefix); - -/****************************************************************/ - -IUP_API void IupConfigSetListVariable(Ihandle* ih, const char *group, const char* key, const char* value, int add); - -IUP_API void IupConfigRecentInit(Ihandle* ih, Ihandle* menu, Icallback recent_cb, int max_recent); -IUP_API void IupConfigRecentUpdate(Ihandle* ih, const char* filename); - -IUP_API void IupConfigDialogShow(Ihandle* ih, Ihandle* dialog, const char* name); -IUP_API void IupConfigDialogClosed(Ihandle* ih, Ihandle* dialog, const char* name); - - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/libs/IUP/include/iup_export.h b/libs/IUP/include/iup_export.h deleted file mode 100644 index 9e1e208..0000000 --- a/libs/IUP/include/iup_export.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef __IUP_EXPORT_H -#define __IUP_EXPORT_H - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ - -/* Mark the official functions */ -#ifndef IUP_API -#ifdef IUP_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUP_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUP_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUP_API __attribute__ ((visibility("default"))) - #else - #define IUP_API - #endif -#else - #define IUP_API -#endif /* IUP_BUILD_LIBRARY */ -#endif /* IUP_API */ - -/* Mark the internal SDK functions (some not official but need to be exported) */ -#ifndef IUP_SDK_API -#ifdef IUP_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUP_SDK_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUP_SDK_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUP_SDK_API __attribute__ ((visibility("default"))) - #else - #define IUP_SDK_API - #endif -#else - #define IUP_SDK_API -#endif /* IUP_BUILD_LIBRARY */ -#endif /* IUP_SDK_API */ - -/* Mark the driver functions that need to be exported */ -#ifndef IUP_DRV_API -#ifdef IUP_BUILD_LIBRARY -#ifdef __EMSCRIPTEN__ -#include -#define IUP_DRV_API EMSCRIPTEN_KEEPALIVE -#elif WIN32 -#define IUP_DRV_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -#define IUP_DRV_API __attribute__ ((visibility("default"))) -#else -#define IUP_DRV_API -#endif -#else -#define IUP_DRV_API -#endif /* IUP_BUILD_LIBRARY */ -#endif /* IUP_DRV_API */ - -/* Mark the IupImageLib function, it does not have a header of its own */ -#ifndef IUPIMGLIB_API -#ifdef IUPIMGLIB_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUPIMGLIB_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUPIMGLIB_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUPIMGLIB_API __attribute__ ((visibility("default"))) - #else - #define IUPIMGLIB_API - #endif -#else - #define IUPIMGLIB_API -#endif /* IUPIMGLIB_BUILD_LIBRARY */ -#endif /* IUPIMGLIB_API */ - -/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - - -#endif /* __IUP_EXPORT_H */ diff --git a/libs/IUP/include/iup_mglplot.h b/libs/IUP/include/iup_mglplot.h deleted file mode 100644 index 058c2e8..0000000 --- a/libs/IUP/include/iup_mglplot.h +++ /dev/null @@ -1,70 +0,0 @@ -/** \file - * \brief Plot component for Iup. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUP_MGLPLOT_H -#define __IUP_MGLPLOT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initialize IupMglPlot widget class */ -void IupMglPlotOpen(void); - -/* Create an IupMglPlot widget instance */ -Ihandle* IupMglPlot(void); - -/***********************************************/ -/* Additional API */ - -/* Linear Data Only */ -void IupMglPlotBegin(Ihandle *ih, int dim); -void IupMglPlotAdd1D(Ihandle *ih, const char* name, double y); -void IupMglPlotAdd2D(Ihandle *ih, double x, double y); -void IupMglPlotAdd3D(Ihandle *ih, double x, double y, double z); -int IupMglPlotEnd(Ihandle *ih); - -/* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */ -int IupMglPlotNewDataSet(Ihandle *ih, int dim); - -/* Linear Data Only */ -void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const char** names, const double* y, int count); -void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, int count); -void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, const double* z, int count); - -/* Linear Data Only */ -void IupMglPlotSet1D(Ihandle* ih, int ds_index, const char** names, const double* y, int count); -void IupMglPlotSet2D(Ihandle* ih, int ds_index, const double* x, const double* y, int count); -void IupMglPlotSet3D(Ihandle* ih, int ds_index, const double* x, const double* y, const double* z, int count); -void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count); - -/* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */ -void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z); -void IupMglPlotLoadData(Ihandle* ih, int ds_index, const char* filename, int count_x, int count_y, int count_z); -void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const char* formula, int count_x, int count_y, int count_z); - -/* Only inside callbacks */ -void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy); -void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z); - -/* Only inside callbacks */ -void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z); -void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2); -void IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z); - -void IupMglPlotPaintTo(Ihandle *ih, const char* format, int w, int h, double dpi, void *data); - -/***********************************************/ - -/* Utility label for showing TeX labels */ -Ihandle* IupMglLabel(const char* title); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iup_plot.h b/libs/IUP/include/iup_plot.h deleted file mode 100644 index adef607..0000000 --- a/libs/IUP/include/iup_plot.h +++ /dev/null @@ -1,70 +0,0 @@ -/** \file - * \brief Plot component for Iup. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUP_PLOT_H -#define __IUP_PLOT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Initialize IupPlot widget class */ -void IupPlotOpen(void); - -/* Create an IupPlot widget instance */ -Ihandle* IupPlot(void); - -/***********************************************/ -/* Additional API */ - -void IupPlotBegin(Ihandle *ih, int strXdata); -void IupPlotAdd(Ihandle *ih, double x, double y); -void IupPlotAddStr(Ihandle *ih, const char* x, double y); -void IupPlotAddSegment(Ihandle *ih, double x, double y); -int IupPlotEnd(Ihandle *ih); - -int IupPlotLoadData(Ihandle* ih, const char* filename, int strXdata); - -/* available only when linking with "iupluaplot" */ -int IupPlotSetFormula(Ihandle* ih, int sample_count, const char* formula, const char* init); - -void IupPlotInsert(Ihandle *ih, int ds_index, int sample_index, double x, double y); -void IupPlotInsertStr(Ihandle *ih, int ds_index, int sample_index, const char* x, double y); -void IupPlotInsertSegment(Ihandle *ih, int ds_index, int sample_index, double x, double y); - -void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const char** x, double* y, int count); -void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double *x, double *y, int count); - -void IupPlotAddSamples(Ihandle* ih, int ds_index, double *x, double *y, int count); -void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const char** x, double* y, int count); - -void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double *x, double *y); -void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* *x, double *y); -int IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index); -double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index); -void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y); -void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* x, double y); -void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected); -void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra); - -void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y); -void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y); - -int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index); -int IupPlotFindSegment(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index1, int *sample_index2); - -struct _cdCanvas; - -void IupPlotPaintTo(Ihandle *ih, struct _cdCanvas* cnv); - -/***********************************************/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iup_plus.h b/libs/IUP/include/iup_plus.h deleted file mode 100644 index b86d797..0000000 --- a/libs/IUP/include/iup_plus.h +++ /dev/null @@ -1,1204 +0,0 @@ -/** \file - * \brief Name space for C++ high level API - * - * See Copyright Notice in iup.h - */ - -#ifndef __IUP_PLUS_H -#define __IUP_PLUS_H - - -#include "iup.h" -#include "iupkey.h" -#include "iupdraw.h" -#include "iup_class_cbs.hpp" -#include "iupcontrols.h" -#include "iupgl.h" -#include "iupglcontrols.h" -#include "iupim.h" -#include "iup_config.h" -#include "iup_mglplot.h" -#include "iup_plot.h" -#include "iupole.h" -#include "iupweb.h" -#include "iup_scintilla.h" -#include "iuptuio.h" - - - -/** \brief Name space for C++ high level API - * - * \par - * Defines wrapper classes for all C structures. - * - * See \ref iup_plus.h - */ -namespace Iup -{ - inline char* Version() { return IupVersion(); } - inline char* VersionDate() { return IupVersionDate(); } - inline int VersionNumber() { return IupVersionNumber(); } - - inline int Open(int &argc, char **&argv) { return IupOpen(&argc, &argv); } - inline void Close() { IupClose(); } - inline void ImageLibOpen() { IupImageLibOpen(); } - - inline int MainLoop() { return IupMainLoop(); } - inline int LoopStep() { return IupLoopStep(); } - inline int LoopStepWait() { return IupLoopStepWait(); } - inline int MainLoopLevel() { return IupMainLoopLevel(); } - inline void Flush() { IupFlush(); } - inline void ExitLoop() { IupExitLoop(); } - - inline int RecordInput(const char* filename, int mode) { return IupRecordInput(filename, mode); } - inline int PlayInput(const char* filename) { return IupPlayInput(filename); } - - inline int Help(const char* url) { return IupHelp(url); } - inline void Log(const char* type, const char* str) { IupLog(type, "%s", str); } - inline const char* Load(const char *filename) { return IupLoad(filename); } - inline const char* LoadBuffer(const char *buffer) { return IupLoadBuffer(buffer); } - - inline void SetLanguage(const char *lng) { IupSetLanguage(lng); } - inline const char* GetLanguage() { return IupGetLanguage(); } - inline void SetLanguageString(const char* name, const char* str) { IupSetLanguageString(name, str); } - inline void StoreLanguageString(const char* name, const char* str) { IupStoreLanguageString(name, str); } - inline const char* GetLanguageString(const char* name) { return IupGetLanguageString(name); } - - inline int GetAllClasses(char** names, int n) { return IupGetAllClasses(names, n); } - inline int GetClassAttributes(const char* classname, char** names, int n) { return IupGetClassAttributes(classname, names, n); } - inline int GetClassCallbacks(const char* classname, char** names, int n) { return IupGetClassCallbacks(classname, names, n); } - inline void SetClassDefaultAttribute(const char* classname, const char *name, const char* value) { IupSetClassDefaultAttribute(classname, name, value); } - - inline void SetGlobal(const char* name, const char* value) { IupSetGlobal(name, value); } - inline void SetStringGlobal(const char* name, const char* value) { IupSetStrGlobal(name, value); } - inline char* GetGlobal(const char* name) { return IupGetGlobal(name); } - - inline int GetFile(char* filename) { return IupGetFile(filename); } - inline void Message(const char *title, const char *msg) { IupMessage(title, msg); } - inline int Alarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3) { return IupAlarm(title, msg, b1, b2, b3); } - inline int ListDialog(int type, const char *title, int size, const char** list, int op, int max_col, int max_lin, int* marks) { return IupListDialog(type, title, size, list, op, max_col, max_lin, marks); } - inline int GetText(const char* title, char* text, int maxsize = 10240) { return IupGetText(title, text, maxsize); } - inline int GetColor(int x, int y, unsigned char &r, unsigned char &g, unsigned char &b) { return IupGetColor(x, y, &r, &g, &b); } - inline int GetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data) - { return IupGetParamv(title, action, user_data, format, param_count, param_extra, param_data); } - - inline int GetAllNames(char** names, int n) { return IupGetAllNames(names, n); } - inline int GetAllDialogs(char** names, int n) { return IupGetAllDialogs(names, n); } - - - class Element - { - protected: - Ihandle* ih; - - /* forbidden */ - Element() { ih = 0; }; - - public: - Element(Ihandle* ref_ih) { ih = ref_ih; } - Element(const Element& elem) : Element(elem.ih) {} - - virtual ~Element() - { - // The destructor does not destroy the element because all Iup::Element are just a reference to the Ihandle*, - // since several IUP elements are automatically destroyed when the dialog is destroyed. - // So to force an element to be destroyed explicitly call the Destroy method. - } - - Ihandle* GetHandle() const { return ih; } - - bool Failed() const { - return ih == 0; - } - - void SetAttribute(const char* name, const char* value) { IupSetAttribute(ih, name, value); } - char* GetAttribute(const char* name) { return IupGetAttribute(ih, name); } - void SetUserData(const char* name, void* data) { IupSetAttribute(ih, name, (char*)data); } - void* GetUserData(const char* name) { return (void*)IupGetAttribute(ih, name); } - void SetString(const char* name, const char* value) { IupSetStrAttribute(ih, name, value); } - const char* GetString(const char* name) { return IupGetAttribute(ih, name); } - void SetInteger(const char* name, int value) { IupSetInt(ih, name, value); } - int GetInteger(const char* name) { return IupGetInt(ih, name); } - void GetIntegerInteger(const char* name, int &i1, int &i2) { IupGetIntInt(ih, name, &i1, &i2); } - void SetNumber(const char* name, double value) { IupSetDouble(ih, name, value); } - double GetNumber(const char* name) { return IupGetDouble(ih, name); } - void SetRGB(const char* name, unsigned char r, unsigned char g, unsigned char b) { IupSetRGB(ih, name, r, g, b); } - void GetRGB(const char* name, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGB(ih, name, &r, &g, &b); } - void SetRGBA(const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { IupSetRGBA(ih, name, r, g, b, a); } - void GetRGBA(const char* name, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) { IupGetRGBA(ih, name, &r, &g, &b, &a); } - - void SetAttributeId(const char* name, int id, const char* value) { IupSetAttributeId(ih, name, id, value); } - char* GetAttributeId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } - void SetUserDataId(const char* name, int id, void* data) { IupSetAttributeId(ih, name, id, (char*)data); } - void* GetUserDataId(const char* name, int id) { return (void*)IupGetAttributeId(ih, name, id); } - void SetStringId(const char* name, int id, const char* value) { IupSetStrAttributeId(ih, name, id, value); } - const char* GetStringId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } - void SetIntegerId(const char* name, int id, int value) { IupSetIntId(ih, name, id, value); } - int GetIntegerId(const char* name, int id) { return IupGetIntId(ih, name, id); } - void SetNumberId(const char* name, int id, double value) { IupSetDoubleId(ih, name, id, value); } - double GetNumberId(const char* name, int id) { return IupGetDoubleId(ih, name, id); } - void SetRGBId(const char* name, int id, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId(ih, name, id, r, g, b); } - void GetRGBId(const char* name, int id, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId(ih, name, id, &r, &g, &b); } - - void SetAttributeId2(const char* name, int lin, int col, const char* value) { IupSetAttributeId2(ih, name, lin, col, value); } - char* GetAttributeId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } - void SetUserDataId2(const char* name, int lin, int col, void* data) { IupSetAttributeId2(ih, name, lin, col, (char*)data); } - void* GetUserDataId2(const char* name, int lin, int col) { return (void*)IupGetAttributeId2(ih, name, lin, col); } - void SetStringId2(const char* name, int lin, int col, const char* value) { IupSetStrAttributeId2(ih, name, lin, col, value); } - const char* GetStringId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } - void SetIntegerId2(const char* name, int lin, int col, int value) { IupSetIntId2(ih, name, lin, col, value); } - int GetIntegerId2(const char* name, int lin, int col) { return IupGetIntId2(ih, name, lin, col); } - void SetNumberId2(const char* name, int lin, int col, double value) { IupSetDoubleId2(ih, name, lin, col, value); } - double GetNumberId2(const char* name, int lin, int col) { return IupGetDoubleId2(ih, name, lin, col); } - void SetRGBId2(const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId2(ih, name, lin, col, r, g, b); } - void GetRGBId2(const char* name, int lin, int col, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId2(ih, name, lin, col, &r, &g, &b); } - - Element SetAttributes(const char* str) { return IupSetAttributes(ih, str); } - void ResetAttribute(const char* name) { IupResetAttribute(ih, name); } - int GetAllAttributes(char** names, int n) { return IupGetAllAttributes(ih, names, n); } - void CopyAttributes(Ihandle* dst_ih) { IupCopyAttributes(ih, dst_ih); } - void SetAttributeHandle(const char* name, const Element& elem) { IupSetAttributeHandle(ih, name, elem.GetHandle()); } - Element GetAttributeHandle(const char* name) { return IupGetAttributeHandle(ih, name); } - void SetAttributeHandleId(const char* name, int id, const Element& elem) { IupSetAttributeHandleId(ih, name, id, elem.GetHandle()); } - Element GetAttributeHandleId(const char* name, int id) { return IupGetAttributeHandleId(ih, name, id); } - void SetAttributeHandleId2(const char* name, int lin, int col, const Element& elem) { IupSetAttributeHandleId2(ih, name, lin, col, elem.GetHandle()); } - Element GetAttributeHandleId2(const char* name, int lin, int col) { return IupGetAttributeHandleId2(ih, name, lin, col); } - - Icallback GetCallback(const char *name) { return IupGetCallback(ih, name); } - Icallback SetCallback(const char *name, Icallback func) { return IupSetCallback(ih, name, func); } - - void Destroy() { IupDestroy(ih); } - - int Map() { return IupMap(ih); } - void Unmap() { IupUnmap(ih); } - - char* GetName() { return IupGetName(ih); } - - char* GetClassName() { return IupGetClassName(ih); } - char* GetClassType() { return IupGetClassType(ih); } - void SaveClassAttributes() { IupSaveClassAttributes(ih); } - void CopyClassAttributesTo(const Element& dst) { IupCopyClassAttributes(ih, dst.ih); } - int ClassMatch(const char* classname) { return IupClassMatch(ih, classname); } - - }; - - inline Icallback GetFunction(const char *name) { return IupGetFunction(name); } - inline Icallback SetFunction(const char *name, Icallback func) { return IupSetFunction(name, func); } - inline Element GetHandle(const char *name) { return Element(IupGetHandle(name)); } - inline Element SetHandle(const char *name, const Element& elem) { return Element(IupSetHandle(name, elem.GetHandle())); } - inline void SetLanguagePack(const Element& elem) { IupSetLanguagePack(elem.GetHandle()); } - - class Dialog; - class Container; - - class Control : public Element - { - public: - Control(Ihandle* _ih) : Element(_ih) {} - Control(const Control& control) : Element(control.ih) {} - Control(const Element& elem) : Element(elem.GetHandle()) {} - - Control SetAttributes(const char* str) { IupSetAttributes(ih, str); return *this; } - - void Update() { IupUpdate(ih); } - void Redraw() { IupRedraw(ih, 0); } - void Refresh() { IupRefresh(ih); } - - void Detach(const Control& child) { IupDetach(child.ih); } - - Control GetBrother() { return Control(IupGetBrother(ih)); } - Container GetParent(); - Dialog GetDialog(); - Control GetDialogChild(const char* name) { return Control(IupGetDialogChild(ih, name)); } - int Reparent(const Container& new_parent, const Control& ref_child); - - Control SetFocus() { return Control(IupSetFocus(ih)); } - Control PreviousField() { return Control(IupPreviousField(ih)); } - Control NextField() { return Control(IupNextField(ih)); } - - void ConvertLinColToPos(int lin, int col, int &pos) { IupTextConvertLinColToPos(ih, lin, col, &pos); } - void ConvertPosToLinCol(int pos, int &lin, int &col) { IupTextConvertPosToLinCol(ih, pos, &lin, &col); } - int ConvertXYToPos(int x, int y) { return IupConvertXYToPos(ih, x, y); } - }; - - inline Control GetFocus() { return Control(IupGetFocus()); } - - class Container : public Control - { - public: - Container(Ihandle* _ih) : Control(_ih) {} - Container(const Container& container) : Control(container.ih) {} - Container(const Control& control) : Control(control.GetHandle()) {} - Container(const Element& elem) : Control(elem.GetHandle()) {} - - Container(Ihandle* _ih, const Control* child_array, int count) : Control(_ih) { - for (int i = 0; i < count; i++) - IupAppend(ih, child_array[i].GetHandle()); - } - Container(Ihandle* _ih, Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Control(_ih) { - if (!child0.Failed()) IupAppend(ih, child0.GetHandle()); - if (!child1.Failed()) IupAppend(ih, child1.GetHandle()); - if (!child2.Failed()) IupAppend(ih, child2.GetHandle()); - if (!child3.Failed()) IupAppend(ih, child3.GetHandle()); - if (!child4.Failed()) IupAppend(ih, child4.GetHandle()); - if (!child5.Failed()) IupAppend(ih, child5.GetHandle()); - if (!child6.Failed()) IupAppend(ih, child6.GetHandle()); - if (!child7.Failed()) IupAppend(ih, child7.GetHandle()); - if (!child8.Failed()) IupAppend(ih, child8.GetHandle()); - if (!child9.Failed()) IupAppend(ih, child9.GetHandle()); - } - - Control Append(const Control& child) { return IupAppend(ih, child.GetHandle()); } - Control Insert(const Control& ref_child, const Control& child) { return IupInsert(ih, ref_child.GetHandle(), child.GetHandle()); } - Control GetChild(int pos) { return IupGetChild(ih, pos); } - int GetChildPos(const Control& child) { return IupGetChildPos(ih, child.GetHandle()); } - int GetChildCount() { return IupGetChildCount(ih); } - - Control GetFirstChild() { return Control(IupGetNextChild(ih, 0)); } - Control GetNextChild(const Control& ref_child) { return Control(IupGetNextChild(ih, ref_child.GetHandle())); } - - void UpdateChildren() { IupUpdateChildren(ih); } - void RedrawChildren() { IupRedraw(ih, 1); } - void RefreshChildren() { IupRefreshChildren(ih); } - }; - - class Dialog : public Container - { - public: - Dialog(const Dialog& dialog) : Container(dialog.GetHandle()) {} - Dialog(const Element& elem) : Container(elem.GetHandle()) {} - Dialog(Control child) : Container(IupDialog(child.GetHandle())) { } - Dialog(Container child) : Container(IupDialog(child.GetHandle())) { } - Dialog(Ihandle* _ih) : Container(_ih) {} - - int Popup(int x, int y) { return IupPopup(ih, x, y); } - int Show() { return IupShow(ih); } - int ShowXY(int x, int y) { return IupShowXY(ih, x, y); } - int Hide() { return IupHide(ih); } - }; - - inline Dialog Control::GetDialog() { return Dialog(IupGetDialog(ih)); } - inline Dialog LayoutDialog(const Dialog& dialog) { return Dialog(IupLayoutDialog(dialog.GetHandle())); } - inline Dialog GlobalsDialog() { return Dialog(IupGlobalsDialog()); } - inline Dialog ElementPropertiesDialog(const Dialog& parent, const Control& control) { return Dialog(IupElementPropertiesDialog(parent.GetHandle(), control.GetHandle())); } - inline Dialog ElementPropertiesDialog(const Control& control) { return Dialog(IupElementPropertiesDialog(0, control.GetHandle())); } - inline Dialog ClassInfoDialog(const Dialog& parent) { return Dialog(IupClassInfoDialog(parent.GetHandle())); } - inline Container Control::GetParent() { return Container(IupGetParent(ih)); } - inline int Control::Reparent(const Container& new_parent, const Control& ref_child) { return IupReparent(ih, new_parent.GetHandle(), ref_child.GetHandle()); } - - void MessageError(const Dialog& parent, const char* message) - { IupMessageError(parent.GetHandle(), message); } - int MessageAlarm(const Dialog& parent, const char* title, const char* message, const char* buttons) - { return IupMessageAlarm(parent.GetHandle(), title, message, buttons); } - - class Menu : public Container - { - public: - Menu() : Container(IupMenu(0)) {} - Menu(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupMenu(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Menu(const Control *child_array, int count) : Container(IupMenu(0), child_array, count) {} - Menu(const Menu& menu) : Container(menu.GetHandle()) {} - Menu(Ihandle* _ih) : Container(_ih) {} - - int Popup(int x, int y) { return IupPopup(ih, x, y); } - }; - - class Image : public Element - { - public: - Image(Ihandle* _ih) : Element(_ih) {} - Image(const Element& elem) : Element(elem.GetHandle()) {} - Image(const char* name) : Element(IupImageGetHandle(name)) {} - - int SaveAsText(const char* filename, const char* iup_format, const char* name) { return IupSaveImageAsText(ih, filename, iup_format, name); } - -#ifdef __IM_PLUS_H - Image(const im::Image& image) : Element(IupImageFromImImage(image.GetHandle())) {} - Image Load(const char* filename) { return Image(IupLoadImage(filename)); } - int Save(const char* filename, const char* im_format) { return IupSaveImage(ih, filename, im_format); } - im::Image ToImImage() { return im::Image(IupImageToImImage(GetHandle())); } -#endif - }; - class Clipboard : public Element - { - public: - Clipboard() : Element(IupClipboard()) {} - Clipboard(Ihandle* _ih) : Element(_ih) {} - Clipboard(const Element& elem) : Element(elem.GetHandle()) {} - -#ifdef __IM_PLUS_H - void SetImage(const im::Image& image) { SetUserData("NATIVEIMAGE", IupGetImageNativeHandle(image.GetHandle())); } - im::Image GetImage(void) { return im::Image(IupGetNativeHandleImage(GetUserData("NATIVEIMAGE"))); } -#endif - }; - class User : public Element - { - public: - User() : Element(IupUser()) {} - User(Ihandle* _ih) : Element(_ih) {} - User(const Element& elem) : Element(elem.GetHandle()) {} - }; - class Thread : public Element - { - public: - Thread() : Element(IupThread()) {} - Thread(Ihandle* _ih) : Element(_ih) {} - Thread(const Element& elem) : Element(elem.GetHandle()) {} - }; - class Param : public Element - { - public: - Param(const char* format) : Element(IupParam(format)) {} - Param(Ihandle* _ih) : Element(_ih) {} - Param(const Element& elem) : Element(elem.GetHandle()) {} - }; - class Timer : public Element - { - public: - Timer() : Element(IupTimer()) {} - Timer(Ihandle* _ih) : Element(_ih) {} - Timer(const Element& elem) : Element(elem.GetHandle()) {} - }; - class Separator : public Control - { - public: - Separator() : Control(IupSeparator()) {} - Separator(Ihandle* _ih) : Control(_ih) {} - Separator(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Item : public Control - { - public: - Item(const char* title = 0) : Control(IupItem(title, 0)) {} - Item(Ihandle* _ih) : Control(_ih) {} - Item(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Canvas : public Control - { - public: - Canvas() : Control(IupCanvas(0)) {} - Canvas(Ihandle* _ih) : Control(_ih) {} - Canvas(const Element& elem) : Control(elem.GetHandle()) {} - - void DrawBegin() { IupDrawBegin(ih); } - void DrawEnd() { IupDrawEnd(ih); } - void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } - void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } - void DrawResetClip() { IupDrawResetClip(ih); } - void DrawParentBackground() { IupDrawParentBackground(ih); } - void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } - void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } - void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } - void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } - void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } - void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } - void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } - void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } - void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } - void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } - void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } - }; - class Link : public Control - { - public: - Link(const char* url = 0, const char* title = 0) : Control(IupLink(url, title)) {} - Link(Ihandle* _ih) : Control(_ih) {} - Link(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Label : public Control - { - public: - Label(const char* title = 0) : Control(IupLabel(title)) {} - Label(Ihandle* _ih) : Control(_ih) {} - Label(const Element& elem) : Control(elem.GetHandle()) {} - }; - - class Button : public Control - { - public: - Button(const char* title = 0) : Control(IupButton(title, 0)) {} - Button(Ihandle* _ih) : Control(_ih) {} - Button(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatButton : public Control - { - public: - FlatButton(const char* title = 0) : Control(IupFlatButton(title)) {} - FlatButton(Ihandle* _ih) : Control(_ih) {} - FlatButton(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatToggle : public Control - { - public: - FlatToggle(const char* title = 0) : Control(IupFlatToggle(title)) {} - FlatToggle(Ihandle* _ih) : Control(_ih) {} - FlatToggle(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatSeparator : public Control - { - public: - FlatSeparator() : Control(IupFlatSeparator()) {} - FlatSeparator(Ihandle* _ih) : Control(_ih) {} - FlatSeparator(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Space : public Control - { - public: - Space() : Control(IupSpace()) {} - Space(Ihandle* _ih) : Control(_ih) {} - Space(const Element& elem) : Control(elem.GetHandle()) {} - }; - class DropButton : public Control - { - public: - DropButton() : Control(IupDropButton(0)) {} - DropButton(Control child) : Control(IupDropButton(child.GetHandle())) {} - DropButton(Ihandle* _ih) : Control(_ih) {} - DropButton(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatLabel : public Control - { - public: - FlatLabel(const char* title = 0) : Control(IupFlatLabel(title)) {} - FlatLabel(Ihandle* _ih) : Control(_ih) {} - FlatLabel(const Element& elem) : Control(elem.GetHandle()) {} - }; - class AnimatedLabel : public Control - { - public: - AnimatedLabel(Element animation = (Ihandle*)0) : Control(IupAnimatedLabel(animation.GetHandle())) {} - AnimatedLabel(Ihandle* _ih) : Control(_ih) {} - AnimatedLabel(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Toggle : public Control - { - public: - Toggle(const char* title = 0) : Control(IupToggle(title, 0)) {} - Toggle(Ihandle* _ih) : Control(_ih) {} - Toggle(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Fill: public Control - { - public: - Fill() : Control(IupFill()) {} - Fill(Ihandle* _ih) : Control(_ih) {} - Fill(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Spin: public Control - { - public: - Spin() : Control(IupSpin()) {} - Spin(Ihandle* _ih) : Control(_ih) {} - Spin(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Tree: public Control - { - public: - Tree() : Control(IupTree()) {} - Tree(Ihandle* _ih) : Control(_ih) {} - Tree(const Element& elem) : Control(elem.GetHandle()) {} - - int SetUserId(int id, void* userid) { return IupTreeSetUserId(ih, id, userid); } - void* GetUserId(int id) { return IupTreeGetUserId(ih, id); } - int GetId(void *userid) { return IupTreeGetId(ih, userid); } - }; - class Val : public Control - { - public: - Val(const char* orientation = 0) : Control(IupVal(orientation)) {} - Val(Ihandle* _ih) : Control(_ih) {} - Val(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatVal : public Control - { - public: - FlatVal(const char* orientation = 0) : Control(IupFlatVal(orientation)) {} - FlatVal(Ihandle* _ih) : Control(_ih) {} - FlatVal(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatTree : public Control - { - public: - FlatTree() : Control(IupFlatTree()) {} - FlatTree(Ihandle* _ih) : Control(_ih) {} - FlatTree(const Element& elem) : Control(elem.GetHandle()) {} - }; - class ProgressBar : public Control - { - public: - ProgressBar() : Control(IupProgressBar()) {} - ProgressBar(Ihandle* _ih) : Control(_ih) {} - ProgressBar(const Element& elem) : Control(elem.GetHandle()) {} - }; - class List: public Control - { - public: - List() : Control(IupList(0)) {} - List(Ihandle* _ih) : Control(_ih) {} - List(const Element& elem) : Control(elem.GetHandle()) {} - }; - class FlatList : public Control - { - public: - FlatList() : Control(IupFlatList()) {} - FlatList(Ihandle* _ih) : Control(_ih) {} - FlatList(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Text : public Control - { - public: - Text() : Control(IupText(0)) {} - Text(Ihandle* _ih) : Control(_ih) {} - Text(const Element& elem) : Control(elem.GetHandle()) {} - }; - - class Split : public Container - { - public: - Split() : Container(IupSplit(0, 0)) {} - Split(Control child) : Container(IupSplit(child.GetHandle(), 0)) {} - Split(Control child1, Control child2) : Container(IupSplit(child1.GetHandle(), child2.GetHandle())) {} - Split(const Split& split) : Container(split.GetHandle()) {} - Split(Ihandle* _ih) : Container(_ih) {} - }; - class Submenu : public Container - { - public: - Submenu(const char* title = 0) : Container(IupSubmenu(title, 0)) {} - Submenu(const char* title, Control child) : Container(IupSubmenu(title, child.GetHandle())) {} - Submenu(const Submenu& container) : Container(container.GetHandle()) {} - Submenu(Ihandle* _ih) : Container(_ih) {} - }; - class Radio : public Container - { - public: - Radio() : Container(IupRadio(0)) {} - Radio(Control child) : Container(IupRadio(child.GetHandle())) {} - Radio(const Radio& container) : Container(container.GetHandle()) {} - Radio(Ihandle* _ih) : Container(_ih) {} - }; - class Sbox : public Container - { - public: - Sbox() : Container(IupSbox(0)) {} - Sbox(Control child) : Container(IupSbox(child.GetHandle())) {} - Sbox(const Sbox& container) : Container(container.GetHandle()) {} - Sbox(Ihandle* _ih) : Container(_ih) {} - }; - class ScrollBox : public Container - { - public: - ScrollBox() : Container(IupScrollBox(0)) {} - ScrollBox(Control child) : Container(IupScrollBox(child.GetHandle())) {} - ScrollBox(const ScrollBox& container) : Container(container.GetHandle()) {} - ScrollBox(Ihandle* _ih) : Container(_ih) {} - }; - class FlatScrollBox : public Container - { - public: - FlatScrollBox() : Container(IupFlatScrollBox(0)) {} - FlatScrollBox(Control child) : Container(IupFlatScrollBox(child.GetHandle())) {} - FlatScrollBox(const FlatScrollBox& container) : Container(container.GetHandle()) {} - FlatScrollBox(Ihandle* _ih) : Container(_ih) {} - }; - class Expander : public Container - { - public: - Expander(const Expander& container) : Container(container.GetHandle()) {} - Expander() : Container(IupExpander(0)) {} - Expander(Control child) : Container(IupExpander(child.GetHandle())) {} - Expander(Ihandle* _ih) : Container(_ih) {} - }; - class DetachBox : public Container - { - public: - DetachBox(const DetachBox& container) : Container(container.GetHandle()) {} - DetachBox() : Container(IupDetachBox(0)) {} - DetachBox(Control child) : Container(IupDetachBox(child.GetHandle())) {} - DetachBox(Ihandle* _ih) : Container(_ih) {} - }; - class BackgroundBox : public Container - { - public: - BackgroundBox() : Container(IupBackgroundBox(0)) {} - BackgroundBox(Control child) : Container(IupBackgroundBox(child.GetHandle())) {} - BackgroundBox(const BackgroundBox& container) : Container(container.GetHandle()) {} - BackgroundBox(Ihandle* _ih) : Container(_ih) {} - - void DrawBegin() { IupDrawBegin(ih); } - void DrawEnd() { IupDrawEnd(ih); } - void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } - void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } - void DrawResetClip() { IupDrawResetClip(ih); } - void DrawParentBackground() { IupDrawParentBackground(ih); } - void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } - void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } - void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } - void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } - void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } - void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } - void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } - void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } - void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } - void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } - void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } - }; - - class Frame : public Container - { - public: - Frame() : Container(IupFrame(0)) {} - Frame(Control child) : Container(IupFrame(child.GetHandle())) {} - Frame(const Frame& container) : Container(container.GetHandle()) {} - Frame(Ihandle* _ih) : Container(_ih) {} - }; - class FlatFrame : public Container - { - public: - FlatFrame() : Container(IupFlatFrame(0)) {} - FlatFrame(Control child) : Container(IupFlatFrame(child.GetHandle())) {} - FlatFrame(const FlatFrame& container) : Container(container.GetHandle()) {} - FlatFrame(Ihandle* _ih) : Container(_ih) {} - }; - class Spinbox : public Container - { - public: - Spinbox() : Container(IupSpinbox(0)) {} - Spinbox(Control child) : Container(IupSpinbox(child.GetHandle())) {} - Spinbox(const Spinbox& container) : Container(container.GetHandle()) {} - Spinbox(Ihandle* _ih) : Container(_ih) {} - }; - - class Vbox : public Container - { - Vbox(const Vbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ - public: - Vbox() : Container(IupVbox(0)) {} - Vbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupVbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Vbox(const Control *child_array, int count) : Container(IupVbox(0), child_array, count) {} - Vbox(Ihandle* _ih) : Container(_ih) {} - }; - class Hbox : public Container - { - Hbox(const Hbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ - public: - Hbox() : Container(IupHbox(0)) {} - Hbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupHbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Hbox(const Control *child_array, int count) : Container(IupHbox(0), child_array, count) {} - Hbox(Ihandle* _ih) : Container(_ih) {} - }; - class Zbox : public Container - { - public: - Zbox() : Container(IupZbox(0)) {} - Zbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupZbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Zbox(const Control *child_array, int count) : Container(IupZbox(0), child_array, count) {} - Zbox(const Zbox& box) : Container(box.GetHandle()) {} - Zbox(Ihandle* _ih) : Container(_ih) {} - }; - class Cbox : public Container - { - public: - Cbox() : Container(IupCbox(0)) {} - Cbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupCbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Cbox(const Control *child_array, int count) : Container(IupCbox(0), child_array, count) {} - Cbox(const Cbox& box) : Container(box.GetHandle()) {} - Cbox(Ihandle* _ih) : Container(_ih) {} - }; - class Tabs : public Container - { - public: - Tabs() : Container(IupTabs(0)) {} - Tabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Tabs(const Control *child_array, int count) : Container(IupTabs(0), child_array, count) {} - Tabs(const Tabs& tabs) : Container(tabs.GetHandle()) {} - Tabs(Ihandle* _ih) : Container(_ih) {} - }; - class FlatTabs : public Container - { - public: - FlatTabs() : Container(IupFlatTabs(0)) {} - FlatTabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupFlatTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - FlatTabs(const Control *child_array, int count) : Container(IupFlatTabs(0), child_array, count) {} - FlatTabs(const FlatTabs& tabs) : Container(tabs.GetHandle()) {} - FlatTabs(Ihandle* _ih) : Container(_ih) {} - }; - class GridBox : public Container - { - public: - GridBox() : Container(IupGridBox(0)) {} - GridBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupGridBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - GridBox(const Control *child_array, int count) : Container(IupGridBox(0), child_array, count) {} - GridBox(const GridBox& box) : Container(box.GetHandle()) {} - GridBox(Ihandle* _ih) : Container(_ih) {} - }; - class MultiBox : public Container - { - public: - MultiBox() : Container(IupMultiBox(0)) {} - MultiBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupMultiBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - MultiBox(const Control *child_array, int count) : Container(IupMultiBox(0), child_array, count) {} - MultiBox(const MultiBox& box) : Container(box.GetHandle()) {} - MultiBox(Ihandle* _ih) : Container(_ih) {} - }; - class ParamBox : public Container - { - public: - ParamBox() : Container(IupParamBox(0)) {} - ParamBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupParamBox(child0.GetHandle(), child1.GetHandle(), child2.GetHandle(), child3.GetHandle(), child4.GetHandle(), child5.GetHandle(), child6.GetHandle(), child7.GetHandle(), child8.GetHandle(), child9.GetHandle(), 0)) {} - ParamBox(const Control *child_array, int count) : Container(IupParamBox(0), child_array, count) {} - ParamBox(const ParamBox& box) : Container(box.GetHandle()) {} - ParamBox(Ihandle* _ih) : Container(_ih) {} - }; - class Normalizer : public Container - { - public: - Normalizer() : Container(IupNormalizer(0)) {} - Normalizer(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupNormalizer(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - Normalizer(const Control *child_array, int count) : Container(IupNormalizer(0), child_array, count) {} - Normalizer(const Normalizer& elem) : Container(elem.GetHandle()) {} - Normalizer(Ihandle* _ih) : Container(_ih) {} - }; - - - class FileDlg : public Dialog - { - public: - FileDlg() : Dialog(IupFileDlg()) {} - }; - class MessageDlg : public Dialog - { - public: - MessageDlg() : Dialog(IupMessageDlg()) {} - }; - class ColorDlg : public Dialog - { - public: - ColorDlg() : Dialog(IupColorDlg()) {} - }; - class FontDlg : public Dialog - { - public: - FontDlg() : Dialog(IupFontDlg()) {} - }; - class ProgressDlg : public Dialog - { - public: - ProgressDlg() : Dialog(IupProgressDlg()) {} - }; - class ScintillaDlg : public Dialog - { - public: - ScintillaDlg() : Dialog(IupScintillaDlg()) {} - }; -#ifdef LUA_VERSION - public: - LuaScripterDlg(lua_State *L) : Dialog(IupLuaScripterDlg(L)) {} - }; -#endif - - class GLCanvas : public Control - { - public: - GLCanvas() : Control(IupGLCanvas(0)) {} - GLCanvas(Ihandle* _ih) : Control(_ih) {} - GLCanvas(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupGLCanvasOpen(); } - - void MakeCurrent() { IupGLMakeCurrent(ih); } - int IsCurrent() { return IupGLIsCurrent(ih); } - void SwapBuffers() { IupGLSwapBuffers(ih); } - void Palette(int index, float r, float g, float b) { IupGLPalette(ih, index, r, g, b); } - void UseFont(int first, int count, int list_base) { IupGLUseFont(ih, first, count, list_base); } - - static void Wait(int gl) { IupGLWait(gl); } - }; - class GLBackgroundBox : public Container - { - public: - GLBackgroundBox() : Container(IupGLBackgroundBox(0)) {} - GLBackgroundBox(Control child) : Container(IupGLBackgroundBox(child.GetHandle())) {} - GLBackgroundBox(const GLBackgroundBox& container) : Container(container.GetHandle()) {} - GLBackgroundBox(Ihandle* _ih) : Container(_ih) {} - }; - - class Controls - { - public: - static void Open() { IupControlsOpen(); } - }; - class Dial : public Control - { - public: - Dial(const char* orientation = 0) : Control(IupDial(orientation)) {} - Dial(Ihandle* _ih) : Control(_ih) {} - Dial(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Gauge : public Control - { - public: - Gauge() : Control(IupGauge()) {} - Gauge(Ihandle* _ih) : Control(_ih) {} - Gauge(const Element& elem) : Control(elem.GetHandle()) {} - }; - class ColorBrowser : public Control - { - public: - ColorBrowser() : Control(IupColorBrowser()) {} - ColorBrowser(Ihandle* _ih) : Control(_ih) {} - ColorBrowser(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Cells : public Control - { - public: - Cells() : Control(IupCells()) {} - Cells(Ihandle* _ih) : Control(_ih) {} - Cells(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Colorbar : public Control - { - public: - Colorbar() : Control(IupColorbar()) {} - Colorbar(Ihandle* _ih) : Control(_ih) {} - Colorbar(const Element& elem) : Control(elem.GetHandle()) {} - }; - class Matrix : public Control - { - public: - Matrix() : Control(IupMatrix(0)) {} - Matrix(Ihandle* _ih) : Control(_ih) {} - Matrix(const Element& elem) : Control(elem.GetHandle()) {} - - void SetFormula(int col, const char* formula, const char* init = 0) { IupMatrixSetFormula(ih, col, formula, init); } - void SetDynamic(const char* init = 0) { IupMatrixSetDynamic(ih, init); } - }; - class MatrixList : public Control - { - public: - MatrixList() : Control(IupMatrixList()) {} - MatrixList(Ihandle* _ih) : Control(_ih) {} - MatrixList(const Element& elem) : Control(elem.GetHandle()) {} - }; - class MatrixEx : public Control - { - public: - MatrixEx() : Control(IupMatrixEx()) {} - MatrixEx(Ihandle* _ih) : Control(_ih) {} - MatrixEx(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLControls - { - public: - static void Open() { IupGLControlsOpen(); } - }; - class GLSubCanvas : public Control - { - public: - GLSubCanvas() : Control(IupGLSubCanvas()) {} - GLSubCanvas(Ihandle* _ih) : Control(_ih) {} - GLSubCanvas(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLSeparator : public Control - { - public: - GLSeparator() : Control(IupGLSeparator()) {} - GLSeparator(Ihandle* _ih) : Control(_ih) {} - GLSeparator(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLProgressBar : public Control - { - public: - GLProgressBar() : Control(IupGLProgressBar()) {} - GLProgressBar(Ihandle* _ih) : Control(_ih) {} - GLProgressBar(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLVal : public Control - { - public: - GLVal() : Control(IupGLVal()) {} - GLVal(Ihandle* _ih) : Control(_ih) {} - GLVal(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLLabel : public Control - { - public: - GLLabel(const char* title = 0) : Control(IupGLLabel(title)) {} - GLLabel(Ihandle* _ih) : Control(_ih) {} - GLLabel(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLButton : public Control - { - public: - GLButton(const char* title = 0) : Control(IupGLButton(title)) {} - GLButton(Ihandle* _ih) : Control(_ih) {} - GLButton(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLToggle : public Control - { - public: - GLToggle(const char* title = 0) : Control(IupGLToggle(title)) {} - GLToggle(Ihandle* _ih) : Control(_ih) {} - GLToggle(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLLink : public Control - { - public: - GLLink(const char *url = 0, const char* title = 0) : Control(IupGLLink(url, title)) {} - GLLink(Ihandle* _ih) : Control(_ih) {} - GLLink(const Element& elem) : Control(elem.GetHandle()) {} - }; - class GLFrame : public Container - { - public: - GLFrame(Control child) : Container(IupGLFrame(child.GetHandle())) {} - GLFrame() : Container(IupGLFrame(0)) {} - GLFrame(const GLFrame& container) : Container(container.GetHandle()) {} - GLFrame(Ihandle* _ih) : Container(_ih) {} - }; - class GLExpander : public Container - { - public: - GLExpander(Control child) : Container(IupGLExpander(child.GetHandle())) {} - GLExpander() : Container(IupGLExpander(0)) {} - GLExpander(const GLExpander& container) : Container(container.GetHandle()) {} - GLExpander(Ihandle* _ih) : Container(_ih) {} - }; - class GLScrollBox : public Container - { - public: - GLScrollBox(Control child) : Container(IupGLScrollBox(child.GetHandle())) {} - GLScrollBox() : Container(IupGLScrollBox(0)) {} - GLScrollBox(const GLScrollBox& container) : Container(container.GetHandle()) {} - GLScrollBox(Ihandle* _ih) : Container(_ih) {} - }; - class GLSizeBox : public Container - { - public: - GLSizeBox(Control child) : Container(IupGLSizeBox(child.GetHandle())) {} - GLSizeBox() : Container(IupGLSizeBox(0)) {} - GLSizeBox(const GLSizeBox& container) : Container(container.GetHandle()) {} - GLSizeBox(Ihandle* _ih) : Container(_ih) {} - }; - class GLCanvasBox : public Container - { - public: - GLCanvasBox() : Container(IupGLCanvasBox(0)) {} - GLCanvasBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) - : Container(IupGLCanvasBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} - GLCanvasBox(const Control *child_array, int count) : Container(IupGLCanvasBox(0), child_array, count) {} - GLCanvasBox(const GLCanvasBox& container) : Container(container.GetHandle()) {} - GLCanvasBox(Ihandle* _ih) : Container(_ih) {} - }; - class Plot : public Control - { - public: - Plot() : Control(IupPlot()) {} - Plot(Ihandle* _ih) : Control(_ih) {} - Plot(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupPlotOpen(); } - - void Begin(int strXdata) { IupPlotBegin(ih, strXdata); } - void Add(double x, double y) { IupPlotAdd(ih, x, y); } - void AddStr(const char* x, double y) { IupPlotAddStr(ih, x, y); } - void AddSegment(double x, double y) { IupPlotAddSegment(ih, x, y); } - int End() { return IupPlotEnd(ih); } - - int LoadData(const char* filename, int strXdata) { return IupPlotLoadData(ih, filename, strXdata); } - - int SetFormula(int sample_count, const char* formula, const char* init) { return IupPlotSetFormula(ih, sample_count, formula, init); } - - void Insert(int ds_index, int sample_index, double x, double y) { IupPlotInsert(ih, ds_index, sample_index, x, y); } - void InsertStr(int ds_index, int sample_index, const char* x, double y) { IupPlotInsertStr(ih, ds_index, sample_index, x, y); } - void InsertSegment(int ds_index, int sample_index, double x, double y) { IupPlotInsertSegment(ih, ds_index, sample_index, x, y); } - - void InsertStrSamples(int ds_index, int sample_index, const char** x, double* y, int count) { IupPlotInsertStrSamples(ih, ds_index, sample_index, x, y, count); } - void InsertSamples(int ds_index, int sample_index, double *x, double *y, int count) { IupPlotInsertSamples(ih, ds_index, sample_index, x, y, count); } - - void AddSamples(int ds_index, double *x, double *y, int count) { IupPlotAddSamples(ih, ds_index, x, y, count); } - void AddStrSamples(int ds_index, const char** x, double* y, int count) { IupPlotAddStrSamples(ih, ds_index, x, y, count); } - - void GetSample(int ds_index, int sample_index, double &x, double &y) { IupPlotGetSample(ih, ds_index, sample_index, &x, &y); } - void GetSampleStr(int ds_index, int sample_index, const char* &x, double &y) { IupPlotGetSampleStr(ih, ds_index, sample_index, &x, &y); } - int GetSampleSelection(int ds_index, int sample_index) { return IupPlotGetSampleSelection(ih, ds_index, sample_index); } - double GetSampleExtra(int ds_index, int sample_index) { return IupPlotGetSampleExtra(ih, ds_index, sample_index); } - void SetSample(int ds_index, int sample_index, double x, double y) { IupPlotSetSample(ih, ds_index, sample_index, x, y); } - void SetSampleStr(int ds_index, int sample_index, const char* x, double y) { IupPlotSetSampleStr(ih, ds_index, sample_index, x, y); } - void SetSampleSelection(int ds_index, int sample_index, int selected) { IupPlotSetSampleSelection(ih, ds_index, sample_index, selected); } - void SetSampleExtra(int ds_index, int sample_index, double extra) { IupPlotSetSampleExtra(ih, ds_index, sample_index, extra); } - - void Transform(double x, double y, double &cnv_x, double &cnv_y) { IupPlotTransform(ih, x, y, &cnv_x, &cnv_y); } - void TransformTo(double cnv_x, double cnv_y, double &x, double &y) { IupPlotTransformTo(ih, cnv_x, cnv_y, &x, &y); } - - int FindSample(double cnv_x, double cnv_y, int &ds_index, int &sample_index) { return IupPlotFindSample(ih, cnv_x, cnv_y, &ds_index, &sample_index); } - -#ifdef __CD_PLUS_H - void PaintTo(cd::Canvas& cd_canvas) { IupPlotPaintTo(ih, cd_canvas.GetHandle()); } -#endif - }; - class MglPlot : public Control - { - public: - MglPlot() : Control(IupMglPlot()) {} - MglPlot(Ihandle* _ih) : Control(_ih) {} - MglPlot(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupMglPlotOpen(); } - - void Begin(int dim) { IupMglPlotBegin(ih, dim); } - void Add1D(const char* name, double y) { IupMglPlotAdd1D(ih, name, y); } - void Add2D(double x, double y) { IupMglPlotAdd2D(ih, x, y); } - void Add3D(double x, double y, double z) { IupMglPlotAdd3D(ih, x, y, z); } - int End() { return IupMglPlotEnd(ih); } - - int NewDataSet(int dim) { return IupMglPlotNewDataSet(ih, dim); } - - void Insert1D(int ds_index, int sample_index, const char** names, const double* y, int count) { IupMglPlotInsert1D(ih, ds_index, sample_index, names, y, count); } - void Insert2D(int ds_index, int sample_index, const double* x, const double* y, int count) { IupMglPlotInsert2D(ih, ds_index, sample_index, x, y, count); } - void Insert3D(int ds_index, int sample_index, const double* x, const double* y, const double* z, int count) { IupMglPlotInsert3D(ih, ds_index, sample_index, x, y, z, count); } - - void Set1D(int ds_index, const char** names, const double* y, int count) { IupMglPlotSet1D(ih, ds_index, names, y, count); } - void Set2D(int ds_index, const double* x, const double* y, int count) { IupMglPlotSet2D(ih, ds_index, x, y, count); } - void Set3D(int ds_index, const double* x, const double* y, const double* z, int count) { IupMglPlotSet3D(ih, ds_index, x, y, z, count); } - void SetFormula(int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count) { IupMglPlotSetFormula(ih, ds_index, formulaX, formulaY, formulaZ, count); } - - void SetData(int ds_index, const double* data, int count_x, int count_y, int count_z) { IupMglPlotSetData(ih, ds_index, data, count_x, count_y, count_z); } - void LoadData(int ds_index, const char* filename, int count_x, int count_y, int count_z) { IupMglPlotLoadData(ih, ds_index, filename, count_x, count_y, count_z); } - void SetFromFormula(int ds_index, const char* formula, int count_x, int count_y, int count_z) { IupMglPlotSetFromFormula(ih, ds_index, formula, count_x, count_y, count_z); } - - void Transform(double x, double y, double z, int &ix, int &iy) { IupMglPlotTransform(ih, x, y, z, &ix, &iy); } - void TransformTo(int ix, int iy, double &x, double &y, double &z) { IupMglPlotTransformTo(ih, ix, iy, &x, &y, &z); } - - void DrawMark(double x, double y, double z) { IupMglPlotDrawMark(ih, x, y, z); } - void DrawLine(double x1, double y1, double z1, double x2, double y2, double z2) { IupMglPlotDrawLine(ih, x1, y1, z1, x2, y2, z2); } - void DrawText(const char* text, double x, double y, double z) { IupMglPlotDrawText(ih, text, x, y, z); } - - void PaintTo(const char* format, int w, int h, double dpi, unsigned char* data) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)data); } - void PaintTo(const char* format, int w, int h, double dpi, const char* filename) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)filename); } - - }; - class MglLabel : public Control - { - public: - MglLabel(const char* title) : Control(IupMglLabel(title)) {} - MglLabel(Ihandle* _ih) : Control(_ih) {} - MglLabel(const Element& elem) : Control(elem.GetHandle()) {} - }; - class OleControl : public Control - { - public: - OleControl(const char* progid) : Control(IupOleControl(progid)) {} - OleControl(Ihandle* _ih) : Control(_ih) {} - OleControl(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupOleControlOpen(); } - }; - class WebBrowser : public Control - { - public: - WebBrowser() : Control(IupWebBrowser()) {} - WebBrowser(Ihandle* _ih) : Control(_ih) {} - WebBrowser(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupWebBrowserOpen(); } - }; - class Scintilla : public Control - { - public: - Scintilla(): Control(IupScintilla()) {} - Scintilla(Ihandle* _ih) : Control(_ih) {} - Scintilla(const Element& elem) : Control(elem.GetHandle()) {} - - static void Open() { IupScintillaOpen(); } - }; - class TuioClient : public Element - { - public: - TuioClient(int port) : Element(IupTuioClient(port)) {} - TuioClient(Ihandle* _ih) : Element(_ih) {} - TuioClient(const Element& elem) : Element(elem.GetHandle()) {} - - static void Open() { IupTuioOpen(); } - }; - - class Config: public Element - { - public: - Config(): Element(IupConfig()) { } - Config(Ihandle* _ih) : Element(_ih) {} - Config(const Element& elem) : Element(elem.GetHandle()) {} - - int LoadConfig() { return IupConfigLoad(ih); } - int SaveConfig() { return IupConfigSave(ih); } - - void SetVariableStrId(const char* group, const char* key, int id, const char* value) { IupConfigSetVariableStrId(ih, group, key, id, value); } - void SetVariableIntId(const char* group, const char* key, int id, int value) { IupConfigSetVariableIntId(ih, group, key, id, value); } - void SetVariableDoubleId(const char* group, const char* key, int id, double value) { IupConfigSetVariableDoubleId(ih, group, key, id, value); } - void SetVariableStr(const char* group, const char* key, const char* value) { IupConfigSetVariableStr(ih, group, key, value); } - void SetVariableInt(const char* group, const char* key, int value) { IupConfigSetVariableInt(ih, group, key, value); } - void SetVariableDouble(const char* group, const char* key, double value) { IupConfigSetVariableDouble(ih, group, key, value); } - - char* GetVariableStr(const char* group, const char* key) { return (char*)IupConfigGetVariableStr(ih, group, key); } - int GetVariableInt(const char* group, const char* key) { return IupConfigGetVariableInt(ih, group, key); } - double GetVariableDouble(const char* group, const char* key) { return IupConfigGetVariableDouble(ih, group, key); } - char* GetVariableStrId(const char* group, const char* key, int id) { return (char*)IupConfigGetVariableStrId(ih, group, key, id); } - int GetVariableIntId(const char* group, const char* key, int id) { return IupConfigGetVariableIntId(ih, group, key, id); } - double GetVariableDoubleId(const char* group, const char* key, int id) { return IupConfigGetVariableDoubleId(ih, group, key, id); } - - char* GetVariableStrDef(const char* group, const char* key, const char* def) { return (char*)IupConfigGetVariableStrDef(ih, group, key, def); } - int GetVariableIntDef(const char* group, const char* key, int def) { return IupConfigGetVariableIntDef(ih, group, key, def); } - double GetVariableDoubleDef(const char* group, const char* key, double def) { return IupConfigGetVariableDoubleDef(ih, group, key, def); } - char* GetVariableStrIdDef(const char* group, const char* key, int id, const char* def) { return (char*)IupConfigGetVariableStrIdDef(ih, group, key, id, def); } - int GetVariableIntIdDef(const char* group, const char* key, int id, int def) { return IupConfigGetVariableIntIdDef(ih, group, key, id, def); } - double GetVariableDoubleIdDef(const char* group, const char* key, int id, double def) { return IupConfigGetVariableDoubleIdDef(ih, group, key, id, def); } - - void Copy(const Config& config2, const char* exclude_prefix) { IupConfigCopy(ih, config2.GetHandle(), exclude_prefix); } - - void SetListVariable(const char *group, const char* key, const char* value, int add) { IupConfigSetListVariable(ih, group, key, value, add); } - - void RecentInit(Menu menu, Icallback recent_cb, int max_recent) { IupConfigRecentInit(ih, menu.GetHandle(), recent_cb, max_recent); } - void RecentUpdate(const char* filename) { IupConfigRecentUpdate(ih, filename); } - - void DialogShow(Dialog dialog, const char* name) { IupConfigDialogShow(ih, dialog.GetHandle(), name); } - void DialogClosed(Dialog dialog, const char* name) { IupConfigDialogClosed(ih, dialog.GetHandle(), name); } - }; -} - -#ifdef __CD_PLUS_H -namespace cd -{ - class CanvasIup : public Canvas - { - public: - CanvasIup(Iup::Canvas& iup_canvas) - : Canvas() { canvas = cdCreateCanvas(CD_IUP, iup_canvas.GetHandle()); } - }; - class CanvasIupDoubleBuffer : public Canvas - { - public: - CanvasIupDoubleBuffer(Iup::Canvas& iup_canvas) - : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFER, iup_canvas.GetHandle()); } - }; - class CanvasIupDoubleBufferRGB : public Canvas - { - public: - CanvasIupDoubleBufferRGB(Iup::Canvas& iup_canvas) - : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFERRGB, iup_canvas.GetHandle()); } - }; -} -#endif - -#endif diff --git a/libs/IUP/include/iup_scintilla.h b/libs/IUP/include/iup_scintilla.h deleted file mode 100644 index e78d308..0000000 --- a/libs/IUP/include/iup_scintilla.h +++ /dev/null @@ -1,29 +0,0 @@ -/** \file - * \brief Scintilla control. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUP_SCINTILLA_H -#define __IUP_SCINTILLA_H - -#ifdef __cplusplus -extern "C" { -#endif - - -void IupScintillaOpen(void); - -Ihandle *IupScintilla(void); -Ihandle *IupScintillaDlg(void); - -#ifdef SCINTILLA_H -sptr_t IupScintillaSendMessage(Ihandle* ih, unsigned int iMessage, uptr_t wParam, sptr_t lParam); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iup_varg.h b/libs/IUP/include/iup_varg.h deleted file mode 100644 index 0408bd3..0000000 --- a/libs/IUP/include/iup_varg.h +++ /dev/null @@ -1,52 +0,0 @@ -/** \file -* \brief IUP API with explicit variable argument parameters. -* -* See Copyright Notice in "iup.h" -*/ - -#ifndef __IUP_VARG_H -#define __IUP_VARG_H - -#include -#include "iup.h" - -#ifdef __cplusplus -extern "C" { -#endif - -IUP_API void IupLogV(const char* type, const char* format, va_list arglist); - -IUP_API Ihandle* IupSetAttV(const char* handle_name, Ihandle* ih, const char* name, va_list arglist); - -IUP_API void IupSetStrfV(Ihandle* ih, const char* name, const char* format, va_list arglist); -IUP_API void IupSetStrfIdV(Ihandle* ih, const char* name, int id, const char* format, va_list arglist); -IUP_API void IupSetStrfId2V(Ihandle* ih, const char* name, int lin, int col, const char* format, va_list arglist); - -IUP_API Ihandle* IupSetCallbacksV(Ihandle* ih, const char *name, Icallback func, va_list arglist); - -IUP_API Ihandle* IupCreateV(const char *classname, void* first, va_list arglist); -IUP_API Ihandle* IupVboxV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupZboxV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupHboxV(Ihandle* child,va_list arglist); -IUP_API Ihandle* IupNormalizerV(Ihandle* ih_first, va_list arglist); -IUP_API Ihandle* IupCboxV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupGridBoxV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupMultiBoxV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupMenuV(Ihandle* child,va_list arglist); -IUP_API Ihandle* IupTabsV(Ihandle* child, va_list arglist); -IUP_API Ihandle* IupFlatTabsV(Ihandle* child, va_list arglist); - -IUP_API void IupMessageV(const char *title, const char *format, va_list arglist); -IUP_API Ihandle* IupParamBoxV(Ihandle* param, va_list arglist); -IUP_API int IupGetParamV(const char* title, Iparamcb action, void* user_data, const char* format, va_list arglist); - -/* must include iupglcontrols before this file to enable this declaration */ -#ifdef __IUPGLCONTROLS_H -#ifndef IUP_GLCONTROLS_API -#define IUP_GLCONTROLS_API -#endif -IUP_GLCONTROLS_API Ihandle* IupGLCanvasBoxV(Ihandle* child, va_list arglist); -#endif - - -#endif diff --git a/libs/IUP/include/iupcbs.h b/libs/IUP/include/iupcbs.h deleted file mode 100644 index 17d1afa..0000000 --- a/libs/IUP/include/iupcbs.h +++ /dev/null @@ -1,79 +0,0 @@ -/** \file - * \brief Contains all function pointer typedefs. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPCBS_H -#define __IUPCBS_H - -struct _cdCanvas; - -typedef int (*IFidle)(void); /* idle */ -typedef void (*IFentry)(void); /* entry */ - -typedef void (*IFi)(int); /* globalentermodal_cb, globalleavemodal_cb, */ -typedef void (*IFs)(char*); /* openurl_cb */ -typedef void (*IFii)(int, int); /* globalkeypress_cb */ -typedef void (*IFiis)(int, int, char*); /* globalmotion_cb, openfiles_cb */ -typedef void (*IFiiiis)(int, int, int, int, char*); /* globalbutton_cb */ -typedef void (*IFfiis)(float,int,int,char*); /* globalwheel_cb */ -typedef void (*IFvs)(void*, char*); /* handleadd_cb, handleremove_cb, imagecreate_cb, imagedestroy_cb */ - -typedef int (*IFn)(Ihandle*); /* default definition, same as Icallback */ -typedef int (*IFni)(Ihandle*, int); /* k_any, show_cb, toggle_action, spin_cb, branchopen_cb, branchclose_cb, executeleaf_cb, showrename_cb, rightclick_cb, extended_cb, height_cb, width_cb */ -typedef int (*IFnii)(Ihandle*, int, int); /* resize_cb, caret_cb, matrix_mousemove_cb, enteritem_cb, leaveitem_cb, scrolltop_cb, dropcheck_cb, selection_cb, select_cb, switch_cb, scrolling_cb, vspan_cb, hspan_cb */ -typedef int (*IFniii)(Ihandle*, int, int, int); /* trayclick_cb, edition_cb */ -typedef int (*IFniiii)(Ihandle*, int, int, int, int); /* dragdrop_cb */ -typedef int (*IFniiiiiiC)(Ihandle*, int, int, int, int, int, int, struct _cdCanvas*); /* draw_cb */ -typedef int (*IFniiiiii)(Ihandle*, int, int, int, int, int, int); /* OLD draw_cb */ -typedef int (*IFnsidv)(Ihandle*, char*, int, double, void*); /* postmessage_cb */ - -typedef int (*IFnff)(Ihandle*, float, float); /* canvas_action */ -typedef int (*IFniff)(Ihandle*,int,float,float); /* scroll_cb */ -typedef int (*IFnfiis)(Ihandle*,float,int,int,char*); /* wheel_cb */ - -typedef int (*IFnsVi)(Ihandle*, char*, void*, int); /* dragdata_cb */ -typedef int (*IFnsViii)(Ihandle*, char*, void*, int, int, int); /* dropdata_cb */ -typedef int (*IFnsiii)(Ihandle*, char*, int, int, int); /* dropfiles_cb */ -typedef int (*IFnssi)(Ihandle*, char*, char*, int); /* dragfilecreatename_cb */ - -typedef int (*IFnnii)(Ihandle*, Ihandle*, int, int); /* drop_cb */ -typedef int (*IFnn)(Ihandle*, Ihandle*); /* savemarkers_cb, restoremarkers_cb */ -typedef int (*IFnnn)(Ihandle*, Ihandle*, Ihandle*); /* tabchange_cb */ -typedef int (*IFnss)(Ihandle*, char *, char *); /* file_cb */ -typedef int (*IFns)(Ihandle*, char *); /* multiselect_cb */ -typedef int (*IFnsi)(Ihandle*, char *, int); /* copydata_cb */ -typedef int (*IFnis)(Ihandle*, int, char *); /* text_action, multiline_action, edit_cb, rename_cb */ -typedef int (*IFnsii)(Ihandle*, char*, int, int); /* list_action */ -typedef int (*IFniis)(Ihandle*, int, int, char*); /* motion_cb, click_cb, value_edit_cb */ -typedef int (*IFniiis)(Ihandle*, int, int, int, char*); /* touch_cb, dblclick_cb */ -typedef int (*IFniiiis)(Ihandle*, int, int, int, int, char*); /* button_cb, matrix_action, mousemotion_cb */ -typedef int (*IFniiiiiis)(Ihandle*, int, int, int, int, int, int, char*); /* mouseclick_cb */ - -typedef int (*IFnIi)(Ihandle*, int*, int); /* multiselection_cb, multiunselection_cb */ -typedef int (*IFnd)(Ihandle*, double); /* mousemove_cb, button_press_cb, button_release_cb */ -typedef int (*IFniiIII)(Ihandle*, int, int, int*, int*, int*); /* fgcolor_cb, bgcolor_cb */ -typedef int (*IFniinsii)(Ihandle*, int, int, Ihandle*, char*, int, int); /* dropselect_cb */ -typedef int (*IFnccc)(Ihandle*, unsigned char, unsigned char, unsigned char); /* drag_cb, change_cb */ -typedef int (*IFniIIII)(Ihandle*, int, int*, int*, int*, int*); /* multitouch_cb */ - -typedef int (*IFnC)(Ihandle*, struct _cdCanvas*); /* postdraw_cb, predraw_cb */ -typedef int (*IFniidd)(Ihandle*, int, int, double, double); /* delete_cb */ -typedef int (*IFniiddi)(Ihandle*, int, int, double, double, int); /* select_cb */ -typedef int (*IFniiddiddi)(Ihandle*, int, int, double, double, int, double, double, int); /* clicksegment_cb */ -typedef int (*IFniidds)(Ihandle*, int, int, double, double, char*); /* plotbutton_cb */ -typedef int (*IFndds)(Ihandle*, double, double, char*); /* plotmotion_cb */ -typedef int (*IFnssds)(Ihandle*, char*, char*, double, char*); /* plottickformat_cb */ -typedef int (*IFnni)(Ihandle*, Ihandle*, int); - -typedef char* (*sIFnii)(Ihandle*, int, int); /* value_cb, font_cb */ -typedef char* (*sIFni)(Ihandle*, int); /* cell_cb */ -typedef char* (*sIFniis)(Ihandle*, int, int, char*); /* translatevalue_cb */ - -typedef double (*dIFnii)(Ihandle*, int, int); /* numericgetvalue_cb */ -typedef int (*IFniid)(Ihandle*, int, int, double); /* numericsetvalue_cb */ - -typedef void (*IFniiv)(Ihandle*, int, int, void*); /* android_onactivityresult_cb */ - -#endif diff --git a/libs/IUP/include/iupcontrols.h b/libs/IUP/include/iupcontrols.h deleted file mode 100644 index 7675d52..0000000 --- a/libs/IUP/include/iupcontrols.h +++ /dev/null @@ -1,31 +0,0 @@ -/** \file - * \brief initializes dial, gauge, colorbrowser, colorbar controls. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPCONTROLS_H -#define __IUPCONTROLS_H - -#ifdef __cplusplus -extern "C" { -#endif - - -int IupControlsOpen(void); - -Ihandle* IupCells(void); -Ihandle* IupMatrix(const char *action); -Ihandle* IupMatrixList(void); -Ihandle* IupMatrixEx(void); - -/* available only when linking with "iupluamatrix" */ -void IupMatrixSetFormula(Ihandle* ih, int col, const char* formula, const char* init); -void IupMatrixSetDynamic(Ihandle* ih, const char* init); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupdef.h b/libs/IUP/include/iupdef.h deleted file mode 100644 index 8f427b1..0000000 --- a/libs/IUP/include/iupdef.h +++ /dev/null @@ -1,683 +0,0 @@ -/** \file - * \brief Callbacks, Attributes and Attribute Values definitions. - * Avoid using these definitions. Use the strings instead. - * - * See Copyright Notice in iup.h - */ - -#ifndef __IUPDEF_H -#define __IUPDEF_H - -/* ATTENTION: these are OLD definitions and they are NOT updated anymore since IUP 3.0 */ -/* Avoid using them, directly use the strings instead. */ -/* Define __IUPDEF_H to avoid the inclusion of this header */ - -#define IUP_RUN "RUN" -#define IUP_ENGLISH "ENGLISH" -#define IUP_PORTUGUESE "PORTUGUESE" -#define IUP_SBH "SBH" -#define IUP_SBV "SBV" - -/************************************************************************/ -/* Callbacks */ -/************************************************************************/ - -#define IUP_IDLE_ACTION "IDLE_ACTION" - -#define IUP_ACTION "ACTION" -#define IUP_GETFOCUS_CB "GETFOCUS_CB" -#define IUP_KILLFOCUS_CB "KILLFOCUS_CB" -#define IUP_K_ANY "K_ANY" -#define IUP_KEYPRESS_CB "KEYPRESS_CB" -#define IUP_HELP_CB "HELP_CB" - -#define IUP_SCROLL_CB "SCROLL_CB" -#define IUP_RESIZE_CB "RESIZE_CB" -#define IUP_MOTION_CB "MOTION_CB" -#define IUP_BUTTON_CB "BUTTON_CB" -#define IUP_ENTERWINDOW_CB "ENTERWINDOW_CB" -#define IUP_LEAVEWINDOW_CB "LEAVEWINDOW_CB" -#define IUP_WHEEL_CB "WHEEL_CB" - -#define IUP_MASK_CB "MASK_CB" -#define IUP_OPEN_CB "OPEN_CB" -#define IUP_HIGHLIGHT_CB "HIGHLIGHT_CB" -#define IUP_MENUCLOSE_CB "MENUCLOSE_CB" - -#define IUP_MAP_CB "MAP_CB" -#define IUP_CLOSE_CB "CLOSE_CB" -#define IUP_SHOW_CB "SHOW_CB" - -#define IUP_DROPFILES_CB "DROPFILES_CB" -#define IUP_WOM_CB "WOM_CB" - -/************************************************************************/ -/* Attributes */ -/************************************************************************/ - -#define IUP_DIRECTION "DIRECTION" -#define IUP_ACTIVE "ACTIVE" -#define IUP_BGCOLOR "BGCOLOR" -#define IUP_FRAMECOLOR "FRAMECOLOR" -#define IUP_FGCOLOR "FGCOLOR" -#define IUP_COLOR "COLOR" -#define IUP_WID "WID" -#define IUP_SIZE "SIZE" -#define IUP_RASTERSIZE "RASTERSIZE" -#define IUP_TITLE "TITLE" -#define IUP_VALUE "VALUE" -#define IUP_VISIBLE "VISIBLE" -#define IUP_FONT "FONT" -#define IUP_TIP "TIP" -#define IUP_EXPAND "EXPAND" -#define IUP_SEPARATOR "SEPARATOR" - -#define IUP_HOTSPOT "HOTSPOT" -#define IUP_HEIGHT "HEIGHT" -#define IUP_WIDTH "WIDTH" - -#define IUP_KEY "KEY" - -#define IUP_MULTIPLE "MULTIPLE" -#define IUP_DROPDOWN "DROPDOWN" -#define IUP_VISIBLE_ITEMS "VISIBLE_ITEMS" - -#define IUP_MARGIN "MARGIN" -#define IUP_GAP "GAP" -#define IUP_ALIGNMENT "ALIGNMENT" - -#define IUP_IMAGE "IMAGE" -#define IUP_IMINACTIVE "IMINACTIVE" -#define IUP_IMPRESS "IMPRESS" -#define IUP_WIN_SAVEBITS "WIN_SAVEBITS" - -#define IUP_NC "NC" -#define IUP_MASK "MASK" - -#define IUP_APPEND "APPEND" -#define IUP_BORDER "BORDER" - -#define IUP_CARET "CARET" -#define IUP_SELECTION "SELECTION" -#define IUP_SELECTEDTEXT "SELECTEDTEXT" -#define IUP_INSERT "INSERT" - -#define IUP_CONID "CONID" -#define IUP_CURSOR "CURSOR" - -#define IUP_ICON "ICON" -#define IUP_MENUBOX "MENUBOX" -#define IUP_MINBOX "MINBOX" -#define IUP_MAXBOX "MAXBOX" -#define IUP_RESIZE "RESIZE" -#define IUP_MENU "MENU" -#define IUP_STARTFOCUS "STARTFOCUS" -#define IUP_PARENTDIALOG "PARENTDIALOG" -#define IUP_SHRINK "SHRINK" -#define IUP_DEFAULTENTER "DEFAULTENTER" -#define IUP_DEFAULTESC "DEFAULTESC" -#define IUP_X "X" -#define IUP_Y "Y" -#define IUP_TOOLBOX "TOOLBOX" -#define IUP_CONTROL "CONTROL" -#define IUP_READONLY "READONLY" - -#define IUP_SCROLLBAR "SCROLLBAR" -#define IUP_POSY "POSY" -#define IUP_POSX "POSX" -#define IUP_DX "DX" -#define IUP_DY "DY" -#define IUP_XMAX "XMAX" -#define IUP_XMIN "XMIN" -#define IUP_YMAX "YMAX" -#define IUP_YMIN "YMIN" - -#define IUP_RED "255 0 0" -#define IUP_GREEN "0 255 0" -#define IUP_BLUE "0 0 255" - -#define IUP_MIN "MIN" -#define IUP_MAX "MAX" - -#define IUP_TIME "TIME" -#define IUP_DRAG "DRAG" -#define IUP_DROP "DROP" -#define IUP_REPAINT "REPAINT" -#define IUP_TOPMOST "TOPMOST" -#define IUP_CLIPCHILDREN "CLIPCHILDREN" - -#define IUP_DIALOGTYPE "DIALOGTYPE" -#define IUP_FILE "FILE" -#define IUP_MULTIPLEFILES "MULTIPLEFILES" -#define IUP_FILTER "FILTER" -#define IUP_FILTERUSED "FILTERUSED" -#define IUP_FILTERINFO "FILTERINFO" -#define IUP_EXTFILTER "EXTFILTER" -#define IUP_DIRECTORY "DIRECTORY" -#define IUP_ALLOWNEW "ALLOWNEW" -#define IUP_NOOVERWRITEPROMPT "NOOVERWRITEPROMPT" -#define IUP_NOCHANGEDIR "NOCHANGEDIR" -#define IUP_FILEEXIST "FILEEXIST" -#define IUP_STATUS "STATUS" - -#define IUP_LOCKLOOP "LOCKLOOP" -#define IUP_SYSTEM "SYSTEM" -#define IUP_DRIVER "DRIVER" -#define IUP_SCREENSIZE "SCREENSIZE" -#define IUP_SYSTEMLANGUAGE "SYSTEMLANGUAGE" -#define IUP_COMPUTERNAME "COMPUTERNAME" -#define IUP_USERNAME "USERNAME" - -#define IUP_OPEN "OPEN" -#define IUP_SAVE "SAVE" -#define IUP_DIR "DIR" - -#define IUP_HORIZONTAL "HORIZONTAL" -#define IUP_VERTICAL "VERTICAL" - -/************************************************************************/ -/* Attribute Values */ -/************************************************************************/ - -#define IUP_YES "YES" -#define IUP_NO "NO" -#define IUP_ON "ON" -#define IUP_OFF "OFF" - -#define IUP_ACENTER "ACENTER" -#define IUP_ALEFT "ALEFT" -#define IUP_ARIGHT "ARIGHT" -#define IUP_ATOP "ATOP" -#define IUP_ABOTTOM "ABOTTOM" - -#define IUP_NORTH "NORTH" -#define IUP_SOUTH "SOUTH" -#define IUP_WEST "WEST" -#define IUP_EAST "EAST" -#define IUP_NE "NE" -#define IUP_SE "SE" -#define IUP_NW "NW" -#define IUP_SW "SW" - -#define IUP_FULLSCREEN "FULLSCREEN" -#define IUP_FULL "FULL" -#define IUP_HALF "HALF" -#define IUP_THIRD "THIRD" -#define IUP_QUARTER "QUARTER" -#define IUP_EIGHTH "EIGHTH" - -#define IUP_ARROW "ARROW" -#define IUP_BUSY "BUSY" -#define IUP_RESIZE_N "RESIZE_N" -#define IUP_RESIZE_S "RESIZE_S" -#define IUP_RESIZE_E "RESIZE_E" -#define IUP_RESIZE_W "RESIZE_W" -#define IUP_RESIZE_NE "RESIZE_NE" -#define IUP_RESIZE_NW "RESIZE_NW" -#define IUP_RESIZE_SE "RESIZE_SE" -#define IUP_RESIZE_SW "RESIZE_SW" -#define IUP_MOVE "MOVE" -#define IUP_HAND "HAND" -#define IUP_NONE "NONE" -#define IUP_IUP "IUP" -#define IUP_CROSS "CROSS" -#define IUP_PEN "PEN" -#define IUP_TEXT "TEXT" -#define IUP_RESIZE_C "RESIZE_C" -#define IUP_OPENHAND "OPENHAND" - -/************************************************************************/ -/* Keys */ -/************************************************************************/ - -#define IUP_K_exclam "K_exclam" -#define IUP_K_quotedbl "K_quotedbl" -#define IUP_K_numbersign "K_numbersign" -#define IUP_K_dollar "K_dollar" -#define IUP_K_percent "K_percent" -#define IUP_K_ampersand "K_ampersand" -#define IUP_K_quoteright "K_quoteright" -#define IUP_K_parentleft "K_parentleft" -#define IUP_K_parentright "K_parentright" -#define IUP_K_asterisk "K_asterisk" -#define IUP_K_plus "K_plus" -#define IUP_K_comma "K_comma" -#define IUP_K_minus "K_minus" -#define IUP_K_period "K_period" -#define IUP_K_slash "K_slash" -#define IUP_K_0 "K_0" -#define IUP_K_1 "K_1" -#define IUP_K_2 "K_2" -#define IUP_K_3 "K_3" -#define IUP_K_4 "K_4" -#define IUP_K_5 "K_5" -#define IUP_K_6 "K_6" -#define IUP_K_7 "K_7" -#define IUP_K_8 "K_8" -#define IUP_K_9 "K_9" -#define IUP_K_colon "K_colon" -#define IUP_K_semicolon "K_semicolon " -#define IUP_K_less "K_less" -#define IUP_K_equal "K_equal" -#define IUP_K_greater "K_greater" -#define IUP_K_question "K_question" -#define IUP_K_at "K_at" -#define IUP_K_A "K_A" -#define IUP_K_B "K_B" -#define IUP_K_C "K_C" -#define IUP_K_D "K_D" -#define IUP_K_E "K_E" -#define IUP_K_F "K_F" -#define IUP_K_G "K_G" -#define IUP_K_H "K_H" -#define IUP_K_I "K_I" -#define IUP_K_J "K_J" -#define IUP_K_K "K_K" -#define IUP_K_L "K_L" -#define IUP_K_M "K_M" -#define IUP_K_N "K_N" -#define IUP_K_O "K_O" -#define IUP_K_P "K_P" -#define IUP_K_Q "K_Q" -#define IUP_K_R "K_R" -#define IUP_K_S "K_S" -#define IUP_K_T "K_T" -#define IUP_K_U "K_U" -#define IUP_K_V "K_V" -#define IUP_K_W "K_W" -#define IUP_K_X "K_X" -#define IUP_K_Y "K_Y" -#define IUP_K_Z "K_Z" -#define IUP_K_bracketleft "K_bracketleft" -#define IUP_K_backslash "K_backslash" -#define IUP_K_bracketright "K_bracketright" -#define IUP_K_circum "K_circum" -#define IUP_K_underscore "K_underscore" -#define IUP_K_quoteleft "K_quoteleft" -#define IUP_K_a "K_a" -#define IUP_K_b "K_b" -#define IUP_K_c "K_c" -#define IUP_K_d "K_d" -#define IUP_K_e "K_e" -#define IUP_K_f "K_f" -#define IUP_K_g "K_g" -#define IUP_K_h "K_h" -#define IUP_K_i "K_i" -#define IUP_K_j "K_j" -#define IUP_K_k "K_k" -#define IUP_K_l "K_l" -#define IUP_K_m "K_m" -#define IUP_K_n "K_n" -#define IUP_K_o "K_o" -#define IUP_K_p "K_p" -#define IUP_K_q "K_q" -#define IUP_K_r "K_r" -#define IUP_K_s "K_s" -#define IUP_K_t "K_t" -#define IUP_K_u "K_u" -#define IUP_K_v "K_v" -#define IUP_K_w "K_w" -#define IUP_K_x "K_x" -#define IUP_K_y "K_y" -#define IUP_K_z "K_z" -#define IUP_K_braceleft "K_braceleft" -#define IUP_K_bar "K_bar" -#define IUP_K_braceright "K_braceright" -#define IUP_K_tilde "K_tilde" - -#define IUP_K_cA "K_cA" -#define IUP_K_cB "K_cB" -#define IUP_K_cC "K_cC" -#define IUP_K_cD "K_cD" -#define IUP_K_cE "K_cE" -#define IUP_K_cF "K_cF" -#define IUP_K_cG "K_cG" -#define IUP_K_cJ "K_cJ" -#define IUP_K_cK "K_cK" -#define IUP_K_cL "K_cL" -#define IUP_K_cN "K_cN" -#define IUP_K_cO "K_cO" -#define IUP_K_cP "K_cP" -#define IUP_K_cQ "K_cQ" -#define IUP_K_cR "K_cR" -#define IUP_K_cS "K_cS" -#define IUP_K_cT "K_cT" -#define IUP_K_cU "K_cU" -#define IUP_K_cV "K_cV" -#define IUP_K_cW "K_cW" -#define IUP_K_cX "K_cX" -#define IUP_K_cY "K_cY" -#define IUP_K_cZ "K_cZ" -#define IUP_K_mA "K_mA" -#define IUP_K_mB "K_mB" -#define IUP_K_mC "K_mC" -#define IUP_K_mD "K_mD" -#define IUP_K_mE "K_mE" -#define IUP_K_mF "K_mF" -#define IUP_K_mG "K_mG" -#define IUP_K_mH "K_mH" -#define IUP_K_mI "K_mI" -#define IUP_K_mJ "K_mJ" -#define IUP_K_mK "K_mK" -#define IUP_K_mL "K_mL" -#define IUP_K_mM "K_mM" -#define IUP_K_mN "K_mN" -#define IUP_K_mO "K_mO" -#define IUP_K_mP "K_mP" -#define IUP_K_mQ "K_mQ" -#define IUP_K_mR "K_mR" -#define IUP_K_mS "K_mS" -#define IUP_K_mT "K_mT" -#define IUP_K_mU "K_mU" -#define IUP_K_mV "K_mV" -#define IUP_K_mW "K_mW" -#define IUP_K_mX "K_mX" -#define IUP_K_mY "K_mY" -#define IUP_K_mZ "K_mZ" -#define IUP_K_BS "K_BS" -#define IUP_K_TAB "K_TAB" -#define IUP_K_CR "K_CR" -#define IUP_K_SP "K_SP" -#define IUP_K_ESC "K_ESC" -#define IUP_K_sCR "K_sCR" -#define IUP_K_sTAB "K_sTAB" -#define IUP_K_cTAB "K_cTAB" -#define IUP_K_mTAB "K_mTAB" -#define IUP_K_HOME "K_HOME" -#define IUP_K_UP "K_UP" -#define IUP_K_PGUP "K_PGUP" -#define IUP_K_LEFT "K_LEFT" -#define IUP_K_RIGHT "K_RIGHT" -#define IUP_K_END "K_END" -#define IUP_K_DOWN "K_DOWN" -#define IUP_K_PGDN "K_PGDN" -#define IUP_K_MIDDLE "K_MIDDLE" -#define IUP_K_INS "K_INS" -#define IUP_K_DEL "K_DEL" -#define IUP_K_sHOME "K_sHOME" -#define IUP_K_sUP "K_sUP" -#define IUP_K_sPGUP "K_sPGUP" -#define IUP_K_sLEFT "K_sLEFT" -#define IUP_K_sRIGHT "K_sRIGHT" -#define IUP_K_sEND "K_sEND" -#define IUP_K_sDOWN "K_sDOWN" -#define IUP_K_sPGDN "K_sPGDN" -#define IUP_K_cHOME "K_cHOME" -#define IUP_K_cPGUP "K_cPGUP" -#define IUP_K_cLEFT "K_cLEFT" -#define IUP_K_cRIGHT "K_cRIGHT" -#define IUP_K_cEND "K_cEND" -#define IUP_K_cPGDN "K_cPGDN" -#define IUP_K_cUP "K_cUP" -#define IUP_K_cDOWN "K_cDOWN" -#define IUP_K_cMIDDLE "K_cMIDDLE" -#define IUP_K_cINS "K_cINS" -#define IUP_K_cDEL "K_cDEL" -#define IUP_K_mHOME "K_mHOME" -#define IUP_K_mPGUP "K_mPGUP" -#define IUP_K_mLEFT "K_mLEFT" -#define IUP_K_mRIGHT "K_mRIGHT" -#define IUP_K_mEND "K_mEND" -#define IUP_K_mPGDN "K_mPGDN" -#define IUP_K_mUP "K_mUP" -#define IUP_K_mDOWN "K_mDOWN" -#define IUP_K_mINS "K_mINS" -#define IUP_K_mDEL "K_mDEL" -#define IUP_K_F1 "K_F1" -#define IUP_K_F2 "K_F2" -#define IUP_K_F3 "K_F3" -#define IUP_K_F4 "K_F4" -#define IUP_K_F5 "K_F5" -#define IUP_K_F6 "K_F6" -#define IUP_K_F7 "K_F7" -#define IUP_K_F8 "K_F8" -#define IUP_K_F9 "K_F9" -#define IUP_K_F10 "K_F10" -#define IUP_K_F11 "K_F11" -#define IUP_K_F12 "K_F12" -#define IUP_K_sF1 "K_sF1" -#define IUP_K_sF2 "K_sF2" -#define IUP_K_sF3 "K_sF3" -#define IUP_K_sF4 "K_sF4" -#define IUP_K_sF5 "K_sF5" -#define IUP_K_sF6 "K_sF6" -#define IUP_K_sF7 "K_sF7" -#define IUP_K_sF8 "K_sF8" -#define IUP_K_sF9 "K_sF9" -#define IUP_K_sF10 "K_sF10" -#define IUP_K_sF11 "K_sF11" -#define IUP_K_sF12 "K_sF12" -#define IUP_K_cF1 "K_cF1" -#define IUP_K_cF2 "K_cF2" -#define IUP_K_cF3 "K_cF3" -#define IUP_K_cF4 "K_cF4" -#define IUP_K_cF5 "K_cF5" -#define IUP_K_cF6 "K_cF6" -#define IUP_K_cF7 "K_cF7" -#define IUP_K_cF8 "K_cF8" -#define IUP_K_cF9 "K_cF9" -#define IUP_K_cF10 "K_cF10" -#define IUP_K_cF11 "K_cF11" -#define IUP_K_cF12 "K_cF12" -#define IUP_K_mF1 "K_mF1" -#define IUP_K_mF2 "K_mF2" -#define IUP_K_mF3 "K_mF3" -#define IUP_K_mF4 "K_mF4" -#define IUP_K_mF5 "K_mF5" -#define IUP_K_mF6 "K_mF6" -#define IUP_K_mF7 "K_mF7" -#define IUP_K_mF8 "K_mF8" -#define IUP_K_mF9 "K_mF9" -#define IUP_K_mF10 "K_mF10" -#define IUP_K_m1 "K_m1" -#define IUP_K_m2 "K_m2" -#define IUP_K_m3 "K_m3" -#define IUP_K_m4 "K_m4" -#define IUP_K_m5 "K_m5" -#define IUP_K_m6 "K_m6" -#define IUP_K_m7 "K_m7" -#define IUP_K_m8 "K_m8" -#define IUP_K_m9 "K_m9" -#define IUP_K_m0 "K_m0" - -/************/ -/* Colorbar */ -/************/ - -#define IUP_NUM_PARTS "NUM_PARTS" -#define IUP_NUM_CELLS "NUM_CELLS" -#define IUP_CELL "CELL" -#define IUP_PREVIEW_SIZE "PREVIEW_SIZE" -#define IUP_SHOW_PREVIEW "SHOW_PREVIEW" -#define IUP_SHOW_SECONDARY "SHOW_SECONDARY" -#define IUP_PRIMARY_CELL "PRIMARY_CELL" -#define IUP_SECONDARY_CELL "SECONDARY_CELL" -#define IUP_ORIENTATION "ORIENTATION" -#define IUP_SQUARED "SQUARED" -#define IUP_SHADOWED "SHADOWED" -#define IUP_BUFFERIZE "BUFFERIZE" -#define IUP_TRANSPARENCY "TRANSPARENCY" -#define IUP_CELL_CB "CELL_CB" -#define IUP_EXTENDED_CB "EXTENDED_CB" -#define IUP_SELECT_CB "SELECT_CB" -#define IUP_SWITCH_CB "SWITCH_CB" -#define IUP_VERTICAL "VERTICAL" -#define IUP_HORIZONTAL "HORIZONTAL" - -/************/ -/* Cells */ -/************/ - -#define IUP_ALL "ALL" -#define IUP_BOXED "BOXED" -#define IUP_CLIPPED "CLIPPED" -#define IUP_TRANSPARENT "TRANSPARENT" -#define IUP_NON_SCROLLABLE_LINES "NON_SCROLLABLE_LINES" -#define IUP_NON_SCROLLABLE_COLS "NON_SCROLLABLE_COLS" -#define IUP_ORIGIN "ORIGIN" -#define IUP_NO_COLOR "NO_COLOR" -#define IUP_FIRST_LINE "FIRST_LINE" -#define IUP_FIRST_COL "FIRST_COL" -#define IUP_DOUBLE_BUFFER "DOUBLE_BUFFER" -#define IUP_LIMITS "LIMITS" -#define IUP_CANVAS "CANVAS" -#define IUP_IMAGE_CANVAS "IMAGE_CANVAS" -#define IUP_FULL_VISIBLE "FULL_VISIBLE" -#define IUP_MOUSECLICK_CB "MOUSECLICK_CB" -#define IUP_MOUSEMOTION_CB "MOUSEMOTION_CB" -#define IUP_DRAW_CB "DRAW_CB" -#define IUP_WIDTH_CB "WIDTH_CB" -#define IUP_HEIGHT_CB "HEIGHT_CB" -#define IUP_NLINES_CB "NLINES_CB" -#define IUP_NCOLS_CB "NCOLS_CB" -#define IUP_HSPAN_CB "HSPAN_CB" -#define IUP_VSPAN_CB "VSPAN_CB" -#define IUP_SCROLLING_CB "SCROLLING_CB" - -/*****************/ -/* ColorBrowser */ -/*****************/ - -#define IUP_RGB "RGB" -#define IUP_CHANGE_CB "CHANGE_CB" -#define IUP_DRAG_CB "DRAG_CB" - -/*****************/ -/* Val */ -/*****************/ - -#define ICTL_MOUSEMOVE_CB "MOUSEMOVE_CB" -#define ICTL_BUTTON_PRESS_CB "BUTTON_PRESS_CB" -#define ICTL_BUTTON_RELEASE_CB "BUTTON_RELEASE_CB" -#define ICTL_HORIZONTAL "HORIZONTAL" -#define ICTL_VERTICAL "VERTICAL" -#define ICTL_SHOWTICKS "SHOWTICKS" - -/*****************/ -/* Tabs */ -/*****************/ - -#define ICTL_TOP "TOP" -#define ICTL_BOTTOM "BOTTOM" -#define ICTL_LEFT "LEFT" -#define ICTL_RIGHT "RIGHT" -#define ICTL_TABTYPE "TABTYPE" -#define ICTL_TABTITLE "TABTITLE" -#define ICTL_TABSIZE "TABSIZE" -#define ICTL_TABCHANGE_CB "TABCHANGE_CB" -#define ICTL_FONT "FONT" -#define ICTL_FONT_ACTIVE "FONT_ACTIVE" -#define ICTL_FONT_INACTIVE "FONT_INACTIVE" - -/*****************/ -/* Gauge */ -/*****************/ - -#define ICTL_SHOW_TEXT "SHOW_TEXT" -#define ICTL_DASHED "DASHED" -#define ICTL_MARGIN "MARGIN" -#define ICTL_TEXT "TEXT" - -/*****************/ -/* Dial */ -/*****************/ - -#define ICTL_DENSITY "DENSITY" -#define ICTL_HORIZONTAL "HORIZONTAL" -#define ICTL_VERTICAL "VERTICAL" -#define ICTL_CIRCULAR "CIRCULAR" -#define ICTL_UNIT "UNIT" - -/*****************/ -/* Matrix */ -/*****************/ - -#define IUP_ENTERITEM_CB "ENTERITEM_CB" -#define IUP_LEAVEITEM_CB "LEAVEITEM_CB" -#define IUP_EDITION_CB "EDITION_CB" -#define IUP_CLICK_CB "CLICK_CB" -#define IUP_DROP_CB "DROP_CB" -#define IUP_DROPSELECT_CB "DROPSELECT_CB" -#define IUP_DROPCHECK_CB "DROPCHECK_CB" -#define IUP_SCROLL_CB "SCROLL_CB" -#define IUP_VALUE_CB "VALUE_CB" -#define IUP_VALUE_EDIT_CB "VALUE_EDIT_CB" -#define IUP_FIELD_CB "FIELD_CB" -#define IUP_RESIZEMATRIX "RESIZEMATRIX" -#define IUP_ADDLIN "ADDLIN" -#define IUP_ADDCOL "ADDCOL" -#define IUP_DELLIN "DELLIN" -#define IUP_DELCOL "DELCOL" -#define IUP_NUMLIN "NUMLIN" -#define IUP_NUMCOL "NUMCOL" -#define IUP_NUMLIN_VISIBLE "NUMLIN_VISIBLE" -#define IUP_NUMCOL_VISIBLE "NUMCOL_VISIBLE" -#define IUP_MARKED "MARKED" -#define IUP_WIDTHDEF "WIDTHDEF" -#define IUP_HEIGHTDEF "HEIGHTDEF" -#define IUP_AREA "AREA" -#define IUP_MARK_MODE "MARK_MODE" -#define IUP_LIN "LIN" -#define IUP_COL "COL" -#define IUP_LINCOL "LINCOL" -#define IUP_CELL "CELL" -#define IUP_EDIT_MODE "EDIT_MODE" -#define IUP_FOCUS_CELL "FOCUS_CELL" -#define IUP_ORIGIN "ORIGIN" -#define IUP_REDRAW "REDRAW" -#define IUP_PREVIOUSVALUE "PREVIOUSVALUE" -#define IUP_MOUSEMOVE_CB "MOUSEMOVE_CB" - -/*****************/ -/* Tree */ -/*****************/ - -#define IUP_ADDLEAF "ADDLEAF" -#define IUP_ADDBRANCH "ADDBRANCH" -#define IUP_DELNODE "DELNODE" -#define IUP_IMAGELEAF "IMAGELEAF" -#define IUP_IMAGEBRANCHCOLLAPSED "IMAGEBRANCHCOLLAPSED" -#define IUP_IMAGEBRANCHEXPANDED "IMAGEBRANCHEXPANDED" -#define IUP_IMAGEEXPANDED "IMAGEEXPANDED" -#define IUP_KIND "KIND" -#define IUP_PARENT "PARENT" -#define IUP_DEPTH "DEPTH" -#define IUP_MARKED "MARKED" -#define IUP_ADDEXPANDED "ADDEXPANDED" -#define IUP_CTRL "CTRL" -#define IUP_SHIFT "SHIFT" -#define IUP_STATE "STATE" -#define IUP_STARTING "STARTING" -#define IUP_LEAF "LEAF" -#define IUP_BRANCH "BRANCH" -#define IUP_SELECTED "SELECTED" -#define IUP_CHILDREN "CHILDREN" -#define IUP_MARKED "MARKED" -#define IUP_ROOT "ROOT" -#define IUP_LAST "LAST" -#define IUP_PGUP "PGUP" -#define IUP_PGDN "PGDN" -#define IUP_NEXT "NEXT" -#define IUP_PREVIOUS "PREVIOUS" -#define IUP_INVERT "INVERT" -#define IUP_BLOCK "BLOCK" -#define IUP_CLEARALL "CLEARALL" -#define IUP_MARKALL "MARKALL" -#define IUP_INVERTALL "INVERTALL" -#define IUP_REDRAW "REDRAW" -#define IUP_COLLAPSED "COLLAPSED" -#define IUP_EXPANDED "EXPANDED" -#define IUP_SELECTION_CB "SELECTION_CB" -#define IUP_BRANCHOPEN_CB "BRANCHOPEN_CB" -#define IUP_BRANCHCLOSE_CB "BRANCHCLOSE_CB" -#define IUP_RIGHTCLICK_CB "RIGHTCLICK_CB" -#define IUP_EXECUTELEAF_CB "EXECUTELEAF_CB" -#define IUP_RENAMENODE_CB "RENAMENODE_CB" -#define IUP_IMGLEAF "IMGLEAF" -#define IUP_IMGCOLLAPSED "IMGCOLLAPSED" -#define IUP_IMGEXPANDED "IMGEXPANDED" -#define IUP_IMGBLANK "IMGBLANK" -#define IUP_IMGPAPER "IMGPAPER" - -#endif - diff --git a/libs/IUP/include/iupdraw.h b/libs/IUP/include/iupdraw.h deleted file mode 100644 index 5e9c079..0000000 --- a/libs/IUP/include/iupdraw.h +++ /dev/null @@ -1,47 +0,0 @@ -/** \file - * \brief Canvas Draw API - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPDRAW_H -#define __IUPDRAW_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* all functions can be used only in IUP canvas and inside the ACTION callback */ - -IUP_API void IupDrawBegin(Ihandle* ih); -IUP_API void IupDrawEnd(Ihandle* ih); - -/* all functions can be called only between calls to Begin and End */ - -IUP_API void IupDrawSetClipRect(Ihandle* ih, int x1, int y1, int x2, int y2); -IUP_API void IupDrawGetClipRect(Ihandle* ih, int *x1, int *y1, int *x2, int *y2); -IUP_API void IupDrawResetClip(Ihandle* ih); - -/* color controlled by the attribute DRAWCOLOR */ -/* line style or fill controlled by the attribute DRAWSTYLE */ - -IUP_API void IupDrawParentBackground(Ihandle* ih); -IUP_API void IupDrawLine(Ihandle* ih, int x1, int y1, int x2, int y2); -IUP_API void IupDrawRectangle(Ihandle* ih, int x1, int y1, int x2, int y2); -IUP_API void IupDrawArc(Ihandle* ih, int x1, int y1, int x2, int y2, double a1, double a2); -IUP_API void IupDrawPolygon(Ihandle* ih, int* points, int count); -IUP_API void IupDrawText(Ihandle* ih, const char* text, int len, int x, int y, int w, int h); -IUP_API void IupDrawImage(Ihandle* ih, const char* name, int x, int y, int w, int h); -IUP_API void IupDrawSelectRect(Ihandle* ih, int x1, int y1, int x2, int y2); -IUP_API void IupDrawFocusRect(Ihandle* ih, int x1, int y1, int x2, int y2); - -IUP_API void IupDrawGetSize(Ihandle* ih, int *w, int *h); -IUP_API void IupDrawGetTextSize(Ihandle* ih, const char* text, int len, int *w, int *h); -IUP_API void IupDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupdraw_cd.h b/libs/IUP/include/iupdraw_cd.h deleted file mode 100644 index 554fe69..0000000 --- a/libs/IUP/include/iupdraw_cd.h +++ /dev/null @@ -1,21 +0,0 @@ -/** \file - * \brief IupDraw CD driver - * - * See Copyright Notice in iup.h - */ - -#ifndef __CD_IUPDRAW_H -#define __CD_IUPDRAW_H - -#ifdef __cplusplus -extern "C" { -#endif - -cdContext* cdContextIupDraw(void); -#define CD_IUPDRAW cdContextIupDraw() - -#ifdef __cplusplus -} -#endif - -#endif /* ifndef __CD_IUPDRAW_ */ diff --git a/libs/IUP/include/iupfiledlg.h b/libs/IUP/include/iupfiledlg.h deleted file mode 100644 index 48a37b9..0000000 --- a/libs/IUP/include/iupfiledlg.h +++ /dev/null @@ -1,24 +0,0 @@ -/** \file - * \brief New FileDlg (Windows Only). - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPFILEDLG_H -#define __IUPFILEDLG_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* the only exported function, - once called it will replace regular IupFileDlg */ - -int IupNewFileDlgOpen(void); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupgl.h b/libs/IUP/include/iupgl.h deleted file mode 100644 index fa0f869..0000000 --- a/libs/IUP/include/iupgl.h +++ /dev/null @@ -1,97 +0,0 @@ -/** \file - * \brief OpenGL canvas for Iup. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPGL_H -#define __IUPGL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Attributes -** To set the appropriate visual (pixel format) the following -** attributes may be specified. Their values should be set -** before the canvas is mapped to the scrren. -** After mapping, changing their values has no effect. -*/ -#ifndef IUP_BUFFER /* IUP_SINGLE (defaut) or IUP_DOUBLE */ -#define IUP_BUFFER "BUFFER" -#endif -#ifndef IUP_STEREO /* IUP_NO (defaut) or IUP_YES */ -#define IUP_STEREO "STEREO" -#endif -#ifndef IUP_BUFFER_SIZE /* Number of bits if index mode */ -#define IUP_BUFFER_SIZE "BUFFER_SIZE" -#endif -#ifndef IUP_RED_SIZE /* Number of red bits */ -#define IUP_RED_SIZE "RED_SIZE" -#endif -#ifndef IUP_GREEN_SIZE /* Number of green bits */ -#define IUP_GREEN_SIZE "GREEN_SIZE" -#endif -#ifndef IUP_BLUE_SIZE /* Number of blue bits */ -#define IUP_BLUE_SIZE "BLUE_SIZE" -#endif -#ifndef IUP_ALPHA_SIZE /* Number of alpha bits */ -#define IUP_ALPHA_SIZE "ALPHA_SIZE" -#endif -#ifndef IUP_DEPTH_SIZE /* Number of bits in depth buffer */ -#define IUP_DEPTH_SIZE "DEPTH_SIZE" -#endif -#ifndef IUP_STENCIL_SIZE /* Number of bits in stencil buffer */ -#define IUP_STENCIL_SIZE "STENCIL_SIZE" -#endif -#ifndef IUP_ACCUM_RED_SIZE /* Number of red bits in accum. buffer */ -#define IUP_ACCUM_RED_SIZE "ACCUM_RED_SIZE" -#endif -#ifndef IUP_ACCUM_GREEN_SIZE /* Number of green bits in accum. buffer */ -#define IUP_ACCUM_GREEN_SIZE "ACCUM_GREEN_SIZE" -#endif -#ifndef IUP_ACCUM_BLUE_SIZE /* Number of blue bits in accum. buffer */ -#define IUP_ACCUM_BLUE_SIZE "ACCUM_BLUE_SIZE" -#endif -#ifndef IUP_ACCUM_ALPHA_SIZE /* Number of alpha bits in accum. buffer */ -#define IUP_ACCUM_ALPHA_SIZE "ACCUM_ALPHA_SIZE" -#endif - - -/* Attribute values */ -#ifndef IUP_DOUBLE -#define IUP_DOUBLE "DOUBLE" -#endif -#ifndef IUP_SINGLE -#define IUP_SINGLE "SINGLE" -#endif -#ifndef IUP_INDEX -#define IUP_INDEX "INDEX" -#endif -#ifndef IUP_RGBA -#define IUP_RGBA "RGBA" -#endif -#ifndef IUP_YES -#define IUP_YES "YES" -#endif -#ifndef IUP_NO -#define IUP_NO "NO" -#endif - -void IupGLCanvasOpen(void); - -Ihandle *IupGLCanvas(const char *action); -Ihandle* IupGLBackgroundBox(Ihandle* child); - -void IupGLMakeCurrent(Ihandle* ih); -int IupGLIsCurrent(Ihandle* ih); -void IupGLSwapBuffers(Ihandle* ih); -void IupGLPalette(Ihandle* ih, int index, float r, float g, float b); -void IupGLUseFont(Ihandle* ih, int first, int count, int list_base); -void IupGLWait(int gl); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupglcontrols.h b/libs/IUP/include/iupglcontrols.h deleted file mode 100644 index 0132608..0000000 --- a/libs/IUP/include/iupglcontrols.h +++ /dev/null @@ -1,47 +0,0 @@ -/** \file - * \brief GL Controls. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPGLCONTROLS_H -#define __IUPGLCONTROLS_H - -#ifdef __cplusplus -extern "C" { -#endif - - -int IupGLControlsOpen(void); - -Ihandle* IupGLCanvasBoxv(Ihandle** children); -Ihandle* IupGLCanvasBox(Ihandle* child, ...); - -Ihandle* IupGLSubCanvas(void); - -Ihandle* IupGLLabel(const char* title); -Ihandle* IupGLSeparator(void); -Ihandle* IupGLButton(const char* title); -Ihandle* IupGLToggle(const char* title); -Ihandle* IupGLLink(const char *url, const char * title); -Ihandle* IupGLProgressBar(void); -Ihandle* IupGLVal(void); -Ihandle* IupGLFrame(Ihandle* child); -Ihandle* IupGLExpander(Ihandle* child); -Ihandle* IupGLScrollBox(Ihandle* child); -Ihandle* IupGLSizeBox(Ihandle* child); -Ihandle* IupGLText(void); - - -/* Utilities */ -void IupGLDrawImage(Ihandle* ih, const char* name, int x, int y, int active); -void IupGLDrawText(Ihandle* ih, const char* str, int len, int x, int y); -void IupGLDrawGetTextSize(Ihandle* ih, const char* str, int *w, int *h); -void IupGLDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupim.h b/libs/IUP/include/iupim.h deleted file mode 100644 index 185660a..0000000 --- a/libs/IUP/include/iupim.h +++ /dev/null @@ -1,36 +0,0 @@ -/** \file - * \brief Utilities using IM - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPIM_H -#define __IUPIM_H - -#if defined(__cplusplus) -extern "C" { -#endif - - -void IupImOpen(void); /* optional */ - -Ihandle* IupLoadImage(const char* filename); -int IupSaveImage(Ihandle* ih, const char* filename, const char* format); - -Ihandle* IupLoadAnimation(const char* filename); -Ihandle* IupLoadAnimationFrames(const char** filename_list, int file_count); - -#ifdef __IM_IMAGE_H -imImage* IupGetNativeHandleImage(void* handle); -void* IupGetImageNativeHandle(const imImage* image); - -Ihandle* IupImageFromImImage(const imImage* image); -imImage* IupImageToImImage(Ihandle* iup_image); -#endif - - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/libs/IUP/include/iupkey.h b/libs/IUP/include/iupkey.h deleted file mode 100644 index 42d8f17..0000000 --- a/libs/IUP/include/iupkey.h +++ /dev/null @@ -1,533 +0,0 @@ -/** \file - * \brief Keyboard Keys definitions. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPKEY_H -#define __IUPKEY_H - -/* from 32 to 126, all character sets are equal, - the key code is the same as the ASCii character code. */ - -#define K_SP ' ' /* 32 (0x20) */ -#define K_exclam '!' /* 33 */ -#define K_quotedbl '\"' /* 34 */ -#define K_numbersign '#' /* 35 */ -#define K_dollar '$' /* 36 */ -#define K_percent '%' /* 37 */ -#define K_ampersand '&' /* 38 */ -#define K_apostrophe '\'' /* 39 */ -#define K_parentleft '(' /* 40 */ -#define K_parentright ')' /* 41 */ -#define K_asterisk '*' /* 42 */ -#define K_plus '+' /* 43 */ -#define K_comma ',' /* 44 */ -#define K_minus '-' /* 45 */ -#define K_period '.' /* 46 */ -#define K_slash '/' /* 47 */ -#define K_0 '0' /* 48 (0x30) */ -#define K_1 '1' /* 49 */ -#define K_2 '2' /* 50 */ -#define K_3 '3' /* 51 */ -#define K_4 '4' /* 52 */ -#define K_5 '5' /* 53 */ -#define K_6 '6' /* 54 */ -#define K_7 '7' /* 55 */ -#define K_8 '8' /* 56 */ -#define K_9 '9' /* 57 */ -#define K_colon ':' /* 58 */ -#define K_semicolon ';' /* 59 */ -#define K_less '<' /* 60 */ -#define K_equal '=' /* 61 */ -#define K_greater '>' /* 62 */ -#define K_question '?' /* 63 */ -#define K_at '@' /* 64 */ -#define K_A 'A' /* 65 (0x41) */ -#define K_B 'B' /* 66 */ -#define K_C 'C' /* 67 */ -#define K_D 'D' /* 68 */ -#define K_E 'E' /* 69 */ -#define K_F 'F' /* 70 */ -#define K_G 'G' /* 71 */ -#define K_H 'H' /* 72 */ -#define K_I 'I' /* 73 */ -#define K_J 'J' /* 74 */ -#define K_K 'K' /* 75 */ -#define K_L 'L' /* 76 */ -#define K_M 'M' /* 77 */ -#define K_N 'N' /* 78 */ -#define K_O 'O' /* 79 */ -#define K_P 'P' /* 80 */ -#define K_Q 'Q' /* 81 */ -#define K_R 'R' /* 82 */ -#define K_S 'S' /* 83 */ -#define K_T 'T' /* 84 */ -#define K_U 'U' /* 85 */ -#define K_V 'V' /* 86 */ -#define K_W 'W' /* 87 */ -#define K_X 'X' /* 88 */ -#define K_Y 'Y' /* 89 */ -#define K_Z 'Z' /* 90 */ -#define K_bracketleft '[' /* 91 */ -#define K_backslash '\\' /* 92 */ -#define K_bracketright ']' /* 93 */ -#define K_circum '^' /* 94 */ -#define K_underscore '_' /* 95 */ -#define K_grave '`' /* 96 */ -#define K_a 'a' /* 97 (0x61) */ -#define K_b 'b' /* 98 */ -#define K_c 'c' /* 99 */ -#define K_d 'd' /* 100 */ -#define K_e 'e' /* 101 */ -#define K_f 'f' /* 102 */ -#define K_g 'g' /* 103 */ -#define K_h 'h' /* 104 */ -#define K_i 'i' /* 105 */ -#define K_j 'j' /* 106 */ -#define K_k 'k' /* 107 */ -#define K_l 'l' /* 108 */ -#define K_m 'm' /* 109 */ -#define K_n 'n' /* 110 */ -#define K_o 'o' /* 111 */ -#define K_p 'p' /* 112 */ -#define K_q 'q' /* 113 */ -#define K_r 'r' /* 114 */ -#define K_s 's' /* 115 */ -#define K_t 't' /* 116 */ -#define K_u 'u' /* 117 */ -#define K_v 'v' /* 118 */ -#define K_w 'w' /* 119 */ -#define K_x 'x' /* 120 */ -#define K_y 'y' /* 121 */ -#define K_z 'z' /* 122 */ -#define K_braceleft '{' /* 123 */ -#define K_bar '|' /* 124 */ -#define K_braceright '}' /* 125 */ -#define K_tilde '~' /* 126 (0x7E) */ - -/* Printable ASCii keys */ - -#define iup_isprint(_c) ((_c) > 31 && (_c) < 127) - -/* also define the escape sequences that have keys associated */ - -#define K_BS '\b' /* 8 */ -#define K_TAB '\t' /* 9 */ -#define K_LF '\n' /* 10 (0x0A) not a real key, is a combination of CR with a modifier, just to document */ -#define K_CR '\r' /* 13 (0x0D) */ - -/* backward compatible definitions */ - -#define K_quoteleft K_grave -#define K_quoteright K_apostrophe -#define isxkey iup_isXkey - -/* IUP Extended Key Codes, range start at 128 */ - -#define iup_isXkey(_c) ((_c) >= 128) - -/* These use the same definition as X11 and GDK. - This also means that any X11 or GDK definition can also be used. */ - -#define K_PAUSE 0xFF13 -#define K_ESC 0xFF1B -#define K_HOME 0xFF50 -#define K_LEFT 0xFF51 -#define K_UP 0xFF52 -#define K_RIGHT 0xFF53 -#define K_DOWN 0xFF54 -#define K_PGUP 0xFF55 -#define K_PGDN 0xFF56 -#define K_END 0xFF57 -#define K_MIDDLE 0xFF0B -#define K_Print 0xFF61 -#define K_INS 0xFF63 -#define K_Menu 0xFF67 -#define K_DEL 0xFFFF -#define K_F1 0xFFBE -#define K_F2 0xFFBF -#define K_F3 0xFFC0 -#define K_F4 0xFFC1 -#define K_F5 0xFFC2 -#define K_F6 0xFFC3 -#define K_F7 0xFFC4 -#define K_F8 0xFFC5 -#define K_F9 0xFFC6 -#define K_F10 0xFFC7 -#define K_F11 0xFFC8 -#define K_F12 0xFFC9 -#define K_F13 0xFFCA -#define K_F14 0xFFCB -#define K_F15 0xFFCC -#define K_F16 0xFFCD -#define K_F17 0xFFCE -#define K_F18 0xFFCF -#define K_F19 0xFFD0 -#define K_F20 0xFFD1 - -/* no Shift/Ctrl/Alt */ -#define K_LSHIFT 0xFFE1 -#define K_RSHIFT 0xFFE2 -#define K_LCTRL 0xFFE3 -#define K_RCTRL 0xFFE4 -#define K_LALT 0xFFE9 -#define K_RALT 0xFFEA - -#define K_NUM 0xFF7F -#define K_SCROLL 0xFF14 -#define K_CAPS 0xFFE5 - -/* Mac clear button. Value randomly picked trying to avoid clashing with an existing value. */ -#define K_CLEAR 0xFFD2 -/* Help button if anybody has it. Value randomly picked trying to avoid clashing with an existing value. */ -#define K_HELP 0xFFD3 - -/* Also, these are the same as the Latin-1 definition */ - -#define K_ccedilla 0x00E7 -#define K_Ccedilla 0x00C7 -#define K_acute 0x00B4 /* no Shift/Ctrl/Alt */ -#define K_diaeresis 0x00A8 - -/******************************************************/ -/* Modifiers use last 4 bits. Since IUP 3.9 */ -/* These modifiers definitions are specific to IUP */ -/******************************************************/ - -#define iup_isShiftXkey(_c) (((_c) & 0x10000000) != 0) -#define iup_isCtrlXkey(_c) (((_c) & 0x20000000) != 0) -#define iup_isAltXkey(_c) (((_c) & 0x40000000) != 0) -#define iup_isSysXkey(_c) (((_c) & 0x80000000) != 0) - -#define iup_XkeyBase(_c) ((_c) & 0x0FFFFFFF) -#define iup_XkeyShift(_c) ((_c) | 0x10000000) /* Shift */ -#define iup_XkeyCtrl(_c) ((_c) | 0x20000000) /* Ctrl */ -#define iup_XkeyAlt(_c) ((_c) | 0x40000000) /* Alt */ -#define iup_XkeySys(_c) ((_c) | 0x80000000) /* Sys (Win or Apple) - notice that using "int" will display a negative value */ - -/* These definitions are here for backward compatibility - and to simplify some key combination usage. - But since IUP 3.9, modifiers can be combined with any key - and they can be mixed together. */ - -#define K_sHOME iup_XkeyShift(K_HOME ) -#define K_sUP iup_XkeyShift(K_UP ) -#define K_sPGUP iup_XkeyShift(K_PGUP ) -#define K_sLEFT iup_XkeyShift(K_LEFT ) -#define K_sMIDDLE iup_XkeyShift(K_MIDDLE ) -#define K_sRIGHT iup_XkeyShift(K_RIGHT ) -#define K_sEND iup_XkeyShift(K_END ) -#define K_sDOWN iup_XkeyShift(K_DOWN ) -#define K_sPGDN iup_XkeyShift(K_PGDN ) -#define K_sINS iup_XkeyShift(K_INS ) -#define K_sDEL iup_XkeyShift(K_DEL ) -#define K_sSP iup_XkeyShift(K_SP ) -#define K_sTAB iup_XkeyShift(K_TAB ) -#define K_sCR iup_XkeyShift(K_CR ) -#define K_sBS iup_XkeyShift(K_BS ) -#define K_sPAUSE iup_XkeyShift(K_PAUSE ) -#define K_sESC iup_XkeyShift(K_ESC ) -#define K_sCLEAR iup_XkeyShift(K_CLEAR ) -#define K_sF1 iup_XkeyShift(K_F1 ) -#define K_sF2 iup_XkeyShift(K_F2 ) -#define K_sF3 iup_XkeyShift(K_F3 ) -#define K_sF4 iup_XkeyShift(K_F4 ) -#define K_sF5 iup_XkeyShift(K_F5 ) -#define K_sF6 iup_XkeyShift(K_F6 ) -#define K_sF7 iup_XkeyShift(K_F7 ) -#define K_sF8 iup_XkeyShift(K_F8 ) -#define K_sF9 iup_XkeyShift(K_F9 ) -#define K_sF10 iup_XkeyShift(K_F10 ) -#define K_sF11 iup_XkeyShift(K_F11 ) -#define K_sF12 iup_XkeyShift(K_F12 ) -#define K_sF13 iup_XkeyShift(K_F13 ) -#define K_sF14 iup_XkeyShift(K_F14 ) -#define K_sF15 iup_XkeyShift(K_F15 ) -#define K_sF16 iup_XkeyShift(K_F16 ) -#define K_sF17 iup_XkeyShift(K_F17 ) -#define K_sF18 iup_XkeyShift(K_F18 ) -#define K_sF19 iup_XkeyShift(K_F19 ) -#define K_sF20 iup_XkeyShift(K_F20 ) -#define K_sPrint iup_XkeyShift(K_Print ) -#define K_sMenu iup_XkeyShift(K_Menu ) - -#define K_cHOME iup_XkeyCtrl(K_HOME ) -#define K_cUP iup_XkeyCtrl(K_UP ) -#define K_cPGUP iup_XkeyCtrl(K_PGUP ) -#define K_cLEFT iup_XkeyCtrl(K_LEFT ) -#define K_cMIDDLE iup_XkeyCtrl(K_MIDDLE ) -#define K_cRIGHT iup_XkeyCtrl(K_RIGHT ) -#define K_cEND iup_XkeyCtrl(K_END ) -#define K_cDOWN iup_XkeyCtrl(K_DOWN ) -#define K_cPGDN iup_XkeyCtrl(K_PGDN ) -#define K_cINS iup_XkeyCtrl(K_INS ) -#define K_cDEL iup_XkeyCtrl(K_DEL ) -#define K_cSP iup_XkeyCtrl(K_SP ) -#define K_cTAB iup_XkeyCtrl(K_TAB ) -#define K_cCR iup_XkeyCtrl(K_CR ) -#define K_cBS iup_XkeyCtrl(K_BS ) -#define K_cPAUSE iup_XkeyCtrl(K_PAUSE ) -#define K_cESC iup_XkeyCtrl(K_ESC ) -#define K_cCLEAR iup_XkeyCtrl(K_CLEAR ) -#define K_cCcedilla iup_XkeyCtrl(K_Ccedilla) -#define K_cF1 iup_XkeyCtrl(K_F1 ) -#define K_cF2 iup_XkeyCtrl(K_F2 ) -#define K_cF3 iup_XkeyCtrl(K_F3 ) -#define K_cF4 iup_XkeyCtrl(K_F4 ) -#define K_cF5 iup_XkeyCtrl(K_F5 ) -#define K_cF6 iup_XkeyCtrl(K_F6 ) -#define K_cF7 iup_XkeyCtrl(K_F7 ) -#define K_cF8 iup_XkeyCtrl(K_F8 ) -#define K_cF9 iup_XkeyCtrl(K_F9 ) -#define K_cF10 iup_XkeyCtrl(K_F10 ) -#define K_cF11 iup_XkeyCtrl(K_F11 ) -#define K_cF12 iup_XkeyCtrl(K_F12 ) -#define K_cF13 iup_XkeyCtrl(K_F13 ) -#define K_cF14 iup_XkeyCtrl(K_F14 ) -#define K_cF15 iup_XkeyCtrl(K_F15 ) -#define K_cF16 iup_XkeyCtrl(K_F16 ) -#define K_cF17 iup_XkeyCtrl(K_F17 ) -#define K_cF18 iup_XkeyCtrl(K_F18 ) -#define K_cF19 iup_XkeyCtrl(K_F19 ) -#define K_cF20 iup_XkeyCtrl(K_F20 ) -#define K_cPrint iup_XkeyCtrl(K_Print ) -#define K_cMenu iup_XkeyCtrl(K_Menu ) - -#define K_mHOME iup_XkeyAlt(K_HOME ) -#define K_mUP iup_XkeyAlt(K_UP ) -#define K_mPGUP iup_XkeyAlt(K_PGUP ) -#define K_mLEFT iup_XkeyAlt(K_LEFT ) -#define K_mMIDDLE iup_XkeyAlt(K_MIDDLE ) -#define K_mRIGHT iup_XkeyAlt(K_RIGHT ) -#define K_mEND iup_XkeyAlt(K_END ) -#define K_mDOWN iup_XkeyAlt(K_DOWN ) -#define K_mPGDN iup_XkeyAlt(K_PGDN ) -#define K_mINS iup_XkeyAlt(K_INS ) -#define K_mDEL iup_XkeyAlt(K_DEL ) -#define K_mSP iup_XkeyAlt(K_SP ) -#define K_mTAB iup_XkeyAlt(K_TAB ) -#define K_mCR iup_XkeyAlt(K_CR ) -#define K_mBS iup_XkeyAlt(K_BS ) -#define K_mPAUSE iup_XkeyAlt(K_PAUSE ) -#define K_mESC iup_XkeyAlt(K_ESC ) -#define K_mCLEAR iup_XkeyAlt(K_CLEAR ) -#define K_mCcedilla iup_XkeyAlt(K_Ccedilla) -#define K_mF1 iup_XkeyAlt(K_F1 ) -#define K_mF2 iup_XkeyAlt(K_F2 ) -#define K_mF3 iup_XkeyAlt(K_F3 ) -#define K_mF4 iup_XkeyAlt(K_F4 ) -#define K_mF5 iup_XkeyAlt(K_F5 ) -#define K_mF6 iup_XkeyAlt(K_F6 ) -#define K_mF7 iup_XkeyAlt(K_F7 ) -#define K_mF8 iup_XkeyAlt(K_F8 ) -#define K_mF9 iup_XkeyAlt(K_F9 ) -#define K_mF10 iup_XkeyAlt(K_F10 ) -#define K_mF11 iup_XkeyAlt(K_F11 ) -#define K_mF12 iup_XkeyAlt(K_F12 ) -#define K_mF13 iup_XkeyAlt(K_F13 ) -#define K_mF14 iup_XkeyAlt(K_F14 ) -#define K_mF15 iup_XkeyAlt(K_F15 ) -#define K_mF16 iup_XkeyAlt(K_F16 ) -#define K_mF17 iup_XkeyAlt(K_F17 ) -#define K_mF18 iup_XkeyAlt(K_F18 ) -#define K_mF19 iup_XkeyAlt(K_F19 ) -#define K_mF20 iup_XkeyAlt(K_F20 ) -#define K_mPrint iup_XkeyAlt(K_Print ) -#define K_mMenu iup_XkeyAlt(K_Menu ) - -#define K_yHOME iup_XkeySys(K_HOME ) -#define K_yUP iup_XkeySys(K_UP ) -#define K_yPGUP iup_XkeySys(K_PGUP ) -#define K_yLEFT iup_XkeySys(K_LEFT ) -#define K_yMIDDLE iup_XkeySys(K_MIDDLE ) -#define K_yRIGHT iup_XkeySys(K_RIGHT ) -#define K_yEND iup_XkeySys(K_END ) -#define K_yDOWN iup_XkeySys(K_DOWN ) -#define K_yPGDN iup_XkeySys(K_PGDN ) -#define K_yINS iup_XkeySys(K_INS ) -#define K_yDEL iup_XkeySys(K_DEL ) -#define K_ySP iup_XkeySys(K_SP ) -#define K_yTAB iup_XkeySys(K_TAB ) -#define K_yCR iup_XkeySys(K_CR ) -#define K_yBS iup_XkeySys(K_BS ) -#define K_yPAUSE iup_XkeySys(K_PAUSE ) -#define K_yESC iup_XkeySys(K_ESC ) -#define K_yCLEAR iup_XkeySys(K_CLEAR ) -#define K_yCcedilla iup_XkeySys(K_Ccedilla) -#define K_yF1 iup_XkeySys(K_F1 ) -#define K_yF2 iup_XkeySys(K_F2 ) -#define K_yF3 iup_XkeySys(K_F3 ) -#define K_yF4 iup_XkeySys(K_F4 ) -#define K_yF5 iup_XkeySys(K_F5 ) -#define K_yF6 iup_XkeySys(K_F6 ) -#define K_yF7 iup_XkeySys(K_F7 ) -#define K_yF8 iup_XkeySys(K_F8 ) -#define K_yF9 iup_XkeySys(K_F9 ) -#define K_yF10 iup_XkeySys(K_F10 ) -#define K_yF11 iup_XkeySys(K_F11 ) -#define K_yF12 iup_XkeySys(K_F12 ) -#define K_yF13 iup_XkeySys(K_F13 ) -#define K_yF14 iup_XkeySys(K_F14 ) -#define K_yF15 iup_XkeySys(K_F15 ) -#define K_yF16 iup_XkeySys(K_F16 ) -#define K_yF17 iup_XkeySys(K_F17 ) -#define K_yF18 iup_XkeySys(K_F18 ) -#define K_yF19 iup_XkeySys(K_F19 ) -#define K_yF20 iup_XkeySys(K_F20 ) -#define K_yPrint iup_XkeySys(K_Print ) -#define K_yMenu iup_XkeySys(K_Menu ) - -#define K_sPlus iup_XkeyShift(K_plus ) -#define K_sComma iup_XkeyShift(K_comma ) -#define K_sMinus iup_XkeyShift(K_minus ) -#define K_sPeriod iup_XkeyShift(K_period ) -#define K_sSlash iup_XkeyShift(K_slash ) -#define K_sAsterisk iup_XkeyShift(K_asterisk) - -#define K_cA iup_XkeyCtrl(K_A) -#define K_cB iup_XkeyCtrl(K_B) -#define K_cC iup_XkeyCtrl(K_C) -#define K_cD iup_XkeyCtrl(K_D) -#define K_cE iup_XkeyCtrl(K_E) -#define K_cF iup_XkeyCtrl(K_F) -#define K_cG iup_XkeyCtrl(K_G) -#define K_cH iup_XkeyCtrl(K_H) -#define K_cI iup_XkeyCtrl(K_I) -#define K_cJ iup_XkeyCtrl(K_J) -#define K_cK iup_XkeyCtrl(K_K) -#define K_cL iup_XkeyCtrl(K_L) -#define K_cM iup_XkeyCtrl(K_M) -#define K_cN iup_XkeyCtrl(K_N) -#define K_cO iup_XkeyCtrl(K_O) -#define K_cP iup_XkeyCtrl(K_P) -#define K_cQ iup_XkeyCtrl(K_Q) -#define K_cR iup_XkeyCtrl(K_R) -#define K_cS iup_XkeyCtrl(K_S) -#define K_cT iup_XkeyCtrl(K_T) -#define K_cU iup_XkeyCtrl(K_U) -#define K_cV iup_XkeyCtrl(K_V) -#define K_cW iup_XkeyCtrl(K_W) -#define K_cX iup_XkeyCtrl(K_X) -#define K_cY iup_XkeyCtrl(K_Y) -#define K_cZ iup_XkeyCtrl(K_Z) -#define K_c1 iup_XkeyCtrl(K_1) -#define K_c2 iup_XkeyCtrl(K_2) -#define K_c3 iup_XkeyCtrl(K_3) -#define K_c4 iup_XkeyCtrl(K_4) -#define K_c5 iup_XkeyCtrl(K_5) -#define K_c6 iup_XkeyCtrl(K_6) -#define K_c7 iup_XkeyCtrl(K_7) -#define K_c8 iup_XkeyCtrl(K_8) -#define K_c9 iup_XkeyCtrl(K_9) -#define K_c0 iup_XkeyCtrl(K_0) -#define K_cPlus iup_XkeyCtrl(K_plus ) -#define K_cComma iup_XkeyCtrl(K_comma ) -#define K_cMinus iup_XkeyCtrl(K_minus ) -#define K_cPeriod iup_XkeyCtrl(K_period ) -#define K_cSlash iup_XkeyCtrl(K_slash ) -#define K_cSemicolon iup_XkeyCtrl(K_semicolon ) -#define K_cEqual iup_XkeyCtrl(K_equal ) -#define K_cBracketleft iup_XkeyCtrl(K_bracketleft ) -#define K_cBracketright iup_XkeyCtrl(K_bracketright) -#define K_cBackslash iup_XkeyCtrl(K_backslash ) -#define K_cAsterisk iup_XkeyCtrl(K_asterisk ) - -#define K_mA iup_XkeyAlt(K_A) -#define K_mB iup_XkeyAlt(K_B) -#define K_mC iup_XkeyAlt(K_C) -#define K_mD iup_XkeyAlt(K_D) -#define K_mE iup_XkeyAlt(K_E) -#define K_mF iup_XkeyAlt(K_F) -#define K_mG iup_XkeyAlt(K_G) -#define K_mH iup_XkeyAlt(K_H) -#define K_mI iup_XkeyAlt(K_I) -#define K_mJ iup_XkeyAlt(K_J) -#define K_mK iup_XkeyAlt(K_K) -#define K_mL iup_XkeyAlt(K_L) -#define K_mM iup_XkeyAlt(K_M) -#define K_mN iup_XkeyAlt(K_N) -#define K_mO iup_XkeyAlt(K_O) -#define K_mP iup_XkeyAlt(K_P) -#define K_mQ iup_XkeyAlt(K_Q) -#define K_mR iup_XkeyAlt(K_R) -#define K_mS iup_XkeyAlt(K_S) -#define K_mT iup_XkeyAlt(K_T) -#define K_mU iup_XkeyAlt(K_U) -#define K_mV iup_XkeyAlt(K_V) -#define K_mW iup_XkeyAlt(K_W) -#define K_mX iup_XkeyAlt(K_X) -#define K_mY iup_XkeyAlt(K_Y) -#define K_mZ iup_XkeyAlt(K_Z) -#define K_m1 iup_XkeyAlt(K_1) -#define K_m2 iup_XkeyAlt(K_2) -#define K_m3 iup_XkeyAlt(K_3) -#define K_m4 iup_XkeyAlt(K_4) -#define K_m5 iup_XkeyAlt(K_5) -#define K_m6 iup_XkeyAlt(K_6) -#define K_m7 iup_XkeyAlt(K_7) -#define K_m8 iup_XkeyAlt(K_8) -#define K_m9 iup_XkeyAlt(K_9) -#define K_m0 iup_XkeyAlt(K_0) -#define K_mPlus iup_XkeyAlt(K_plus ) -#define K_mComma iup_XkeyAlt(K_comma ) -#define K_mMinus iup_XkeyAlt(K_minus ) -#define K_mPeriod iup_XkeyAlt(K_period ) -#define K_mSlash iup_XkeyAlt(K_slash ) -#define K_mSemicolon iup_XkeyAlt(K_semicolon ) -#define K_mEqual iup_XkeyAlt(K_equal ) -#define K_mBracketleft iup_XkeyAlt(K_bracketleft ) -#define K_mBracketright iup_XkeyAlt(K_bracketright) -#define K_mBackslash iup_XkeyAlt(K_backslash ) -#define K_mAsterisk iup_XkeyAlt(K_asterisk ) - -#define K_yA iup_XkeySys(K_A) -#define K_yB iup_XkeySys(K_B) -#define K_yC iup_XkeySys(K_C) -#define K_yD iup_XkeySys(K_D) -#define K_yE iup_XkeySys(K_E) -#define K_yF iup_XkeySys(K_F) -#define K_yG iup_XkeySys(K_G) -#define K_yH iup_XkeySys(K_H) -#define K_yI iup_XkeySys(K_I) -#define K_yJ iup_XkeySys(K_J) -#define K_yK iup_XkeySys(K_K) -#define K_yL iup_XkeySys(K_L) -#define K_yM iup_XkeySys(K_M) -#define K_yN iup_XkeySys(K_N) -#define K_yO iup_XkeySys(K_O) -#define K_yP iup_XkeySys(K_P) -#define K_yQ iup_XkeySys(K_Q) -#define K_yR iup_XkeySys(K_R) -#define K_yS iup_XkeySys(K_S) -#define K_yT iup_XkeySys(K_T) -#define K_yU iup_XkeySys(K_U) -#define K_yV iup_XkeySys(K_V) -#define K_yW iup_XkeySys(K_W) -#define K_yX iup_XkeySys(K_X) -#define K_yY iup_XkeySys(K_Y) -#define K_yZ iup_XkeySys(K_Z) -#define K_y1 iup_XkeySys(K_1) -#define K_y2 iup_XkeySys(K_2) -#define K_y3 iup_XkeySys(K_3) -#define K_y4 iup_XkeySys(K_4) -#define K_y5 iup_XkeySys(K_5) -#define K_y6 iup_XkeySys(K_6) -#define K_y7 iup_XkeySys(K_7) -#define K_y8 iup_XkeySys(K_8) -#define K_y9 iup_XkeySys(K_9) -#define K_y0 iup_XkeySys(K_0) -#define K_yPlus iup_XkeySys(K_plus ) -#define K_yComma iup_XkeySys(K_comma ) -#define K_yMinus iup_XkeySys(K_minus ) -#define K_yPeriod iup_XkeySys(K_period ) -#define K_ySlash iup_XkeySys(K_slash ) -#define K_ySemicolon iup_XkeySys(K_semicolon ) -#define K_yEqual iup_XkeySys(K_equal ) -#define K_yBracketleft iup_XkeySys(K_bracketleft ) -#define K_yBracketright iup_XkeySys(K_bracketright) -#define K_yBackslash iup_XkeySys(K_backslash ) -#define K_yAsterisk iup_XkeySys(K_asterisk ) - - -#endif diff --git a/libs/IUP/include/iuplua.h b/libs/IUP/include/iuplua.h deleted file mode 100644 index 5893d13..0000000 --- a/libs/IUP/include/iuplua.h +++ /dev/null @@ -1,54 +0,0 @@ -/** \file - * \brief IUP Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUA_H -#define __IUPLUA_H - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ -#ifndef IUPLUA_API -#ifdef IUPLUA_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUPLUA_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUPLUA_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUPLUA_API __attribute__ ((visibility("default"))) - #else - #define IUPLUA_API - #endif -#else - #define IUPLUA_API -#endif /* IUPLUA_BUILD_LIBRARY */ -#endif /* IUPLUA_API */ -/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - - -IUPLUA_API int iuplua_open(lua_State *L); -IUPLUA_API int iupkey_open(lua_State *L); /* does nothing, kept for backward compatibility */ -IUPLUA_API int iuplua_close(lua_State * L); - -/* utilities */ -IUPLUA_API int iuplua_isihandle(lua_State *L, int pos); -IUPLUA_API Ihandle* iuplua_checkihandle(lua_State *L, int pos); -IUPLUA_API void iuplua_pushihandle(lua_State *L, Ihandle *n); -IUPLUA_API int iuplua_dofile(lua_State *L, const char *filename); -IUPLUA_API int iuplua_dostring(lua_State *L, const char *string, const char *chunk_name); -IUPLUA_API int iuplua_dobuffer(lua_State *L, const char *buffer, int len, const char *chunk_name); -IUPLUA_API void iuplua_show_error_message(const char *pname, const char* msg); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iuplua_mglplot.h b/libs/IUP/include/iuplua_mglplot.h deleted file mode 100644 index 75355c7..0000000 --- a/libs/IUP/include/iuplua_mglplot.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief IupMglPlot Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUA_MGLPLOT_H -#define __IUPLUA_MGLPLOT_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iup_mglplotlua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iuplua_plot.h b/libs/IUP/include/iuplua_plot.h deleted file mode 100644 index 1a84c92..0000000 --- a/libs/IUP/include/iuplua_plot.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief iup_plot Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUA_PLOT_H -#define __IUPLUA_PLOT_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iup_plotlua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iuplua_scintilla.h b/libs/IUP/include/iuplua_scintilla.h deleted file mode 100644 index 86618d6..0000000 --- a/libs/IUP/include/iuplua_scintilla.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief IupScintilla Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUA_SCINTILLA_H -#define __IUPLUA_SCINTILLA_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iup_scintillalua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluacontrols.h b/libs/IUP/include/iupluacontrols.h deleted file mode 100644 index 1244607..0000000 --- a/libs/IUP/include/iupluacontrols.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief iupcontrols Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUACONTROLS_H -#define __IUPLUACONTROLS_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupcontrolslua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluafiledlg.h b/libs/IUP/include/iupluafiledlg.h deleted file mode 100644 index 465886f..0000000 --- a/libs/IUP/include/iupluafiledlg.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief Binding of new iupfiledlg to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAFILEDLG_H -#define __IUPLUAFILEDLG_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupfiledlglua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluagl.h b/libs/IUP/include/iupluagl.h deleted file mode 100644 index db71d26..0000000 --- a/libs/IUP/include/iupluagl.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief Binding of iupglcanvas to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAGL_H -#define __IUPLUAGL_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupgllua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluaglcontrols.h b/libs/IUP/include/iupluaglcontrols.h deleted file mode 100644 index ebec46b..0000000 --- a/libs/IUP/include/iupluaglcontrols.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief iupglcontrols Binding for Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAGLCONTROLS_H -#define __IUPLUAGLCONTROLS_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupglcontrolslua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluaim.h b/libs/IUP/include/iupluaim.h deleted file mode 100644 index 77c7670..0000000 --- a/libs/IUP/include/iupluaim.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief Bindig of iupim functions to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAIM_H -#define __IUPLUAIM_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupimlua_open(lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluaole.h b/libs/IUP/include/iupluaole.h deleted file mode 100644 index 6c3a23f..0000000 --- a/libs/IUP/include/iupluaole.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief Binding of iupolecontrol to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAOLE_H -#define __IUPLUAOLE_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iupolelua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluascripterdlg.h b/libs/IUP/include/iupluascripterdlg.h deleted file mode 100644 index 695ee29..0000000 --- a/libs/IUP/include/iupluascripterdlg.h +++ /dev/null @@ -1,25 +0,0 @@ -/** \file - * \brief IupLuaScripterDlg dialog and Lua binding - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUASCRIPTERDLG_H -#define __IUPLUASCRIPTERDLG_H - -#ifdef __cplusplus -extern "C" { -#endif - -void IupLuaScripterDlgOpen(lua_State * L); - -Ihandle* IupLuaScripterDlg(void); - -/* Lua binding */ -int iupluascripterdlglua_open(lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluatuio.h b/libs/IUP/include/iupluatuio.h deleted file mode 100644 index 334de4b..0000000 --- a/libs/IUP/include/iupluatuio.h +++ /dev/null @@ -1,20 +0,0 @@ -/** \file - * \brief Binding of iuptuio to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUATUIO_H -#define __IUPLUATUIO_H - -#ifdef __cplusplus -extern "C" { -#endif - -int iuptuiolua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupluaweb.h b/libs/IUP/include/iupluaweb.h deleted file mode 100644 index 0556d98..0000000 --- a/libs/IUP/include/iupluaweb.h +++ /dev/null @@ -1,42 +0,0 @@ -/** \file - * \brief Binding of iupwebbrowser to Lua. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPLUAWEB_H -#define __IUPLUAWEB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ -#ifndef IUPLUAWEB_API -#ifdef IUPLUAWEB_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUPLUAWEB_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUPLUAWEB_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUPLUAWEB_API __attribute__ ((visibility("default"))) - #else - #define IUPLUAWEB_API - #endif -#else - #define IUPLUAWEB_API -#endif /* IUPLUAWEB_BUILD_LIBRARY */ -#endif /* IUPLUAWEB_API */ -/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - - -IUPLUAWEB_API int iupweblua_open (lua_State * L); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iupole.h b/libs/IUP/include/iupole.h deleted file mode 100644 index 4e7aed3..0000000 --- a/libs/IUP/include/iupole.h +++ /dev/null @@ -1,45 +0,0 @@ -/** \file - * \brief Ole control. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPOLE_H -#define __IUPOLE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS - /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ -#ifndef IUPOLE_API -#ifdef IUPOLE_BUILD_LIBRARY -#ifdef __EMSCRIPTEN__ -#include -#define IUPOLE_API EMSCRIPTEN_KEEPALIVE -#elif WIN32 -#define IUPOLE_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -#define IUPOLE_API __attribute__ ((visibility("default"))) -#else -#define IUPOLE_API -#endif -#else -#define IUPOLE_API -#endif /* IUP_BUILD_LIBRARY */ -#endif /* IUPOLE_API */ - /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - - -IUPOLE_API Ihandle *IupOleControl(const char* progid); - -IUPOLE_API int IupOleControlOpen(void); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/include/iuptuio.h b/libs/IUP/include/iuptuio.h deleted file mode 100644 index 4638181..0000000 --- a/libs/IUP/include/iuptuio.h +++ /dev/null @@ -1,21 +0,0 @@ -/** \file - * \brief IupTuioClient control - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPTUIO_H -#define __IUPTUIO_H - -#if defined(__cplusplus) -extern "C" { -#endif - -int IupTuioOpen(void); -Ihandle* IupTuioClient(int port); - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/libs/IUP/include/iupweb.h b/libs/IUP/include/iupweb.h deleted file mode 100644 index 3b72838..0000000 --- a/libs/IUP/include/iupweb.h +++ /dev/null @@ -1,45 +0,0 @@ -/** \file - * \brief Web control. - * - * See Copyright Notice in "iup.h" - */ - -#ifndef __IUPWEB_H -#define __IUPWEB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef DOXYGEN_SHOULD_IGNORE_THIS -/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ -#ifndef IUPWEB_API -#ifdef IUPWEB_BUILD_LIBRARY - #ifdef __EMSCRIPTEN__ - #include - #define IUPWEB_API EMSCRIPTEN_KEEPALIVE - #elif WIN32 - #define IUPWEB_API __declspec(dllexport) - #elif defined(__GNUC__) && __GNUC__ >= 4 - #define IUPWEB_API __attribute__ ((visibility("default"))) - #else - #define IUPWEB_API - #endif -#else - #define IUPWEB_API -#endif /* IUP_BUILD_LIBRARY */ -#endif /* IUPWEB_API */ -/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ -#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ - - -IUPWEB_API int IupWebBrowserOpen(void); - -IUPWEB_API Ihandle *IupWebBrowser(void); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/IUP/iup.dll b/libs/IUP/iup.dll deleted file mode 100644 index aceb679..0000000 Binary files a/libs/IUP/iup.dll and /dev/null differ diff --git a/libs/IUP/iup_mglplot.dll b/libs/IUP/iup_mglplot.dll deleted file mode 100644 index 81afca5..0000000 Binary files a/libs/IUP/iup_mglplot.dll and /dev/null differ diff --git a/libs/IUP/iup_plot.dll b/libs/IUP/iup_plot.dll deleted file mode 100644 index 3bc153e..0000000 Binary files a/libs/IUP/iup_plot.dll and /dev/null differ diff --git a/libs/IUP/iup_scintilla.dll b/libs/IUP/iup_scintilla.dll deleted file mode 100644 index 96a09b8..0000000 Binary files a/libs/IUP/iup_scintilla.dll and /dev/null differ diff --git a/libs/IUP/iupcd.dll b/libs/IUP/iupcd.dll deleted file mode 100644 index a0c78a0..0000000 Binary files a/libs/IUP/iupcd.dll and /dev/null differ diff --git a/libs/IUP/iupcontrols.dll b/libs/IUP/iupcontrols.dll deleted file mode 100644 index 89a2aef..0000000 Binary files a/libs/IUP/iupcontrols.dll and /dev/null differ diff --git a/libs/IUP/iupgl.dll b/libs/IUP/iupgl.dll deleted file mode 100644 index daeb402..0000000 Binary files a/libs/IUP/iupgl.dll and /dev/null differ diff --git a/libs/IUP/iupglcontrols.dll b/libs/IUP/iupglcontrols.dll deleted file mode 100644 index 43b6a94..0000000 Binary files a/libs/IUP/iupglcontrols.dll and /dev/null differ diff --git a/libs/IUP/iupim.dll b/libs/IUP/iupim.dll deleted file mode 100644 index 34909fe..0000000 Binary files a/libs/IUP/iupim.dll and /dev/null differ diff --git a/libs/IUP/iupimglib.dll b/libs/IUP/iupimglib.dll deleted file mode 100644 index 221ff24..0000000 Binary files a/libs/IUP/iupimglib.dll and /dev/null differ diff --git a/libs/IUP/iupole.dll b/libs/IUP/iupole.dll deleted file mode 100644 index 47719a5..0000000 Binary files a/libs/IUP/iupole.dll and /dev/null differ diff --git a/libs/IUP/iuptuio.dll b/libs/IUP/iuptuio.dll deleted file mode 100644 index 1b56326..0000000 Binary files a/libs/IUP/iuptuio.dll and /dev/null differ diff --git a/libs/IUP/libfreetype6.a b/libs/IUP/libfreetype6.a deleted file mode 100644 index 1d193ad..0000000 Binary files a/libs/IUP/libfreetype6.a and /dev/null differ diff --git a/libs/IUP/libftgl.a b/libs/IUP/libftgl.a deleted file mode 100644 index 85302b5..0000000 Binary files a/libs/IUP/libftgl.a and /dev/null differ diff --git a/libs/IUP/libiup.a b/libs/IUP/libiup.a deleted file mode 100644 index 17d243c..0000000 Binary files a/libs/IUP/libiup.a and /dev/null differ diff --git a/libs/IUP/libiup_mglplot.a b/libs/IUP/libiup_mglplot.a deleted file mode 100644 index a026158..0000000 Binary files a/libs/IUP/libiup_mglplot.a and /dev/null differ diff --git a/libs/IUP/libiup_plot.a b/libs/IUP/libiup_plot.a deleted file mode 100644 index e7b9279..0000000 Binary files a/libs/IUP/libiup_plot.a and /dev/null differ diff --git a/libs/IUP/libiup_scintilla.a b/libs/IUP/libiup_scintilla.a deleted file mode 100644 index 9b6c80f..0000000 Binary files a/libs/IUP/libiup_scintilla.a and /dev/null differ diff --git a/libs/IUP/libiupcd.a b/libs/IUP/libiupcd.a deleted file mode 100644 index dbf9567..0000000 Binary files a/libs/IUP/libiupcd.a and /dev/null differ diff --git a/libs/IUP/libiupcontrols.a b/libs/IUP/libiupcontrols.a deleted file mode 100644 index 842d09a..0000000 Binary files a/libs/IUP/libiupcontrols.a and /dev/null differ diff --git a/libs/IUP/libiupgl.a b/libs/IUP/libiupgl.a deleted file mode 100644 index 098c5e8..0000000 Binary files a/libs/IUP/libiupgl.a and /dev/null differ diff --git a/libs/IUP/libiupglcontrols.a b/libs/IUP/libiupglcontrols.a deleted file mode 100644 index 4c4c213..0000000 Binary files a/libs/IUP/libiupglcontrols.a and /dev/null differ diff --git a/libs/IUP/libiupim.a b/libs/IUP/libiupim.a deleted file mode 100644 index 2402a07..0000000 Binary files a/libs/IUP/libiupim.a and /dev/null differ diff --git a/libs/IUP/libiupimglib.a b/libs/IUP/libiupimglib.a deleted file mode 100644 index 75bf426..0000000 Binary files a/libs/IUP/libiupimglib.a and /dev/null differ diff --git a/libs/IUP/libiupole.a b/libs/IUP/libiupole.a deleted file mode 100644 index 972ec66..0000000 Binary files a/libs/IUP/libiupole.a and /dev/null differ diff --git a/libs/IUP/libiuptuio.a b/libs/IUP/libiuptuio.a deleted file mode 100644 index 4f3ac3b..0000000 Binary files a/libs/IUP/libiuptuio.a and /dev/null differ diff --git a/libs/IUP/libzlib1.a b/libs/IUP/libzlib1.a deleted file mode 100644 index 72265f6..0000000 Binary files a/libs/IUP/libzlib1.a and /dev/null differ diff --git a/libs/IUP/zlib1.dll b/libs/IUP/zlib1.dll deleted file mode 100644 index 4f435eb..0000000 Binary files a/libs/IUP/zlib1.dll and /dev/null differ diff --git a/libs/cJSON/cJSON.c b/libs/cJSON/cJSON.c deleted file mode 100644 index 61483d9..0000000 --- a/libs/cJSON/cJSON.c +++ /dev/null @@ -1,3143 +0,0 @@ -/* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -/* cJSON */ -/* JSON parser in C. */ - -/* disable warnings about old C89 functions in MSVC */ -#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) -#define _CRT_SECURE_NO_DEPRECATE -#endif - -#ifdef __GNUC__ -#pragma GCC visibility push(default) -#endif -#if defined(_MSC_VER) -#pragma warning (push) -/* disable warning about single line comments in system headers */ -#pragma warning (disable : 4001) -#endif - -#include -#include -#include -#include -#include -#include -#include - -#ifdef ENABLE_LOCALES -#include -#endif - -#if defined(_MSC_VER) -#pragma warning (pop) -#endif -#ifdef __GNUC__ -#pragma GCC visibility pop -#endif - -#include "cJSON.h" - -/* define our own boolean type */ -#ifdef true -#undef true -#endif -#define true ((cJSON_bool)1) - -#ifdef false -#undef false -#endif -#define false ((cJSON_bool)0) - -/* define isnan and isinf for ANSI C, if in C99 or above, isnan and isinf has been defined in math.h */ -#ifndef isinf -#define isinf(d) (isnan((d - d)) && !isnan(d)) -#endif -#ifndef isnan -#define isnan(d) (d != d) -#endif - -#ifndef NAN -#ifdef _WIN32 -#define NAN sqrt(-1.0) -#else -#define NAN 0.0/0.0 -#endif -#endif - -typedef struct { - const unsigned char *json; - size_t position; -} error; -static error global_error = { NULL, 0 }; - -CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) -{ - return (const char*) (global_error.json + global_error.position); -} - -CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item) -{ - if (!cJSON_IsString(item)) - { - return NULL; - } - - return item->valuestring; -} - -CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) -{ - if (!cJSON_IsNumber(item)) - { - return (double) NAN; - } - - return item->valuedouble; -} - -/* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ -#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 18) - #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. -#endif - -CJSON_PUBLIC(const char*) cJSON_Version(void) -{ - static char version[15]; - sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); - - return version; -} - -/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ -static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) -{ - if ((string1 == NULL) || (string2 == NULL)) - { - return 1; - } - - if (string1 == string2) - { - return 0; - } - - for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) - { - if (*string1 == '\0') - { - return 0; - } - } - - return tolower(*string1) - tolower(*string2); -} - -typedef struct internal_hooks -{ - void *(CJSON_CDECL *allocate)(size_t size); - void (CJSON_CDECL *deallocate)(void *pointer); - void *(CJSON_CDECL *reallocate)(void *pointer, size_t size); -} internal_hooks; - -#if defined(_MSC_VER) -/* work around MSVC error C2322: '...' address of dllimport '...' is not static */ -static void * CJSON_CDECL internal_malloc(size_t size) -{ - return malloc(size); -} -static void CJSON_CDECL internal_free(void *pointer) -{ - free(pointer); -} -static void * CJSON_CDECL internal_realloc(void *pointer, size_t size) -{ - return realloc(pointer, size); -} -#else -#define internal_malloc malloc -#define internal_free free -#define internal_realloc realloc -#endif - -/* strlen of character literals resolved at compile time */ -#define static_strlen(string_literal) (sizeof(string_literal) - sizeof("")) - -static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; - -static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) -{ - size_t length = 0; - unsigned char *copy = NULL; - - if (string == NULL) - { - return NULL; - } - - length = strlen((const char*)string) + sizeof(""); - copy = (unsigned char*)hooks->allocate(length); - if (copy == NULL) - { - return NULL; - } - memcpy(copy, string, length); - - return copy; -} - -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) -{ - if (hooks == NULL) - { - /* Reset hooks */ - global_hooks.allocate = malloc; - global_hooks.deallocate = free; - global_hooks.reallocate = realloc; - return; - } - - global_hooks.allocate = malloc; - if (hooks->malloc_fn != NULL) - { - global_hooks.allocate = hooks->malloc_fn; - } - - global_hooks.deallocate = free; - if (hooks->free_fn != NULL) - { - global_hooks.deallocate = hooks->free_fn; - } - - /* use realloc only if both free and malloc are used */ - global_hooks.reallocate = NULL; - if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) - { - global_hooks.reallocate = realloc; - } -} - -/* Internal constructor. */ -static cJSON *cJSON_New_Item(const internal_hooks * const hooks) -{ - cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); - if (node) - { - memset(node, '\0', sizeof(cJSON)); - } - - return node; -} - -/* Delete a cJSON structure. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) -{ - cJSON *next = NULL; - while (item != NULL) - { - next = item->next; - if (!(item->type & cJSON_IsReference) && (item->child != NULL)) - { - cJSON_Delete(item->child); - } - if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) - { - global_hooks.deallocate(item->valuestring); - item->valuestring = NULL; - } - if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) - { - global_hooks.deallocate(item->string); - item->string = NULL; - } - global_hooks.deallocate(item); - item = next; - } -} - -/* get the decimal point character of the current locale */ -static unsigned char get_decimal_point(void) -{ -#ifdef ENABLE_LOCALES - struct lconv *lconv = localeconv(); - return (unsigned char) lconv->decimal_point[0]; -#else - return '.'; -#endif -} - -typedef struct -{ - const unsigned char *content; - size_t length; - size_t offset; - size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ - internal_hooks hooks; -} parse_buffer; - -/* check if the given size is left to read in a given parse buffer (starting with 1) */ -#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) -/* check if the buffer can be accessed at the given index (starting with 0) */ -#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) -#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) -/* get a pointer to the buffer at the position */ -#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) - -/* Parse the input text to generate a number, and populate the result into item. */ -static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) -{ - double number = 0; - unsigned char *after_end = NULL; - unsigned char number_c_string[64]; - unsigned char decimal_point = get_decimal_point(); - size_t i = 0; - - if ((input_buffer == NULL) || (input_buffer->content == NULL)) - { - return false; - } - - /* copy the number into a temporary buffer and replace '.' with the decimal point - * of the current locale (for strtod) - * This also takes care of '\0' not necessarily being available for marking the end of the input */ - for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) - { - switch (buffer_at_offset(input_buffer)[i]) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '+': - case '-': - case 'e': - case 'E': - number_c_string[i] = buffer_at_offset(input_buffer)[i]; - break; - - case '.': - number_c_string[i] = decimal_point; - break; - - default: - goto loop_end; - } - } -loop_end: - number_c_string[i] = '\0'; - - number = strtod((const char*)number_c_string, (char**)&after_end); - if (number_c_string == after_end) - { - return false; /* parse_error */ - } - - item->valuedouble = number; - - /* use saturation in case of overflow */ - if (number >= INT_MAX) - { - item->valueint = INT_MAX; - } - else if (number <= (double)INT_MIN) - { - item->valueint = INT_MIN; - } - else - { - item->valueint = (int)number; - } - - item->type = cJSON_Number; - - input_buffer->offset += (size_t)(after_end - number_c_string); - return true; -} - -/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) -{ - if (number >= INT_MAX) - { - object->valueint = INT_MAX; - } - else if (number <= (double)INT_MIN) - { - object->valueint = INT_MIN; - } - else - { - object->valueint = (int)number; - } - - return object->valuedouble = number; -} - -/* Note: when passing a NULL valuestring, cJSON_SetValuestring treats this as an error and return NULL */ -CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring) -{ - char *copy = NULL; - /* if object's type is not cJSON_String or is cJSON_IsReference, it should not set valuestring */ - if ((object == NULL) || !(object->type & cJSON_String) || (object->type & cJSON_IsReference)) - { - return NULL; - } - /* return NULL if the object is corrupted or valuestring is NULL */ - if (object->valuestring == NULL || valuestring == NULL) - { - return NULL; - } - if (strlen(valuestring) <= strlen(object->valuestring)) - { - strcpy(object->valuestring, valuestring); - return object->valuestring; - } - copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks); - if (copy == NULL) - { - return NULL; - } - if (object->valuestring != NULL) - { - cJSON_free(object->valuestring); - } - object->valuestring = copy; - - return copy; -} - -typedef struct -{ - unsigned char *buffer; - size_t length; - size_t offset; - size_t depth; /* current nesting depth (for formatted printing) */ - cJSON_bool noalloc; - cJSON_bool format; /* is this print a formatted print */ - internal_hooks hooks; -} printbuffer; - -/* realloc printbuffer if necessary to have at least "needed" bytes more */ -static unsigned char* ensure(printbuffer * const p, size_t needed) -{ - unsigned char *newbuffer = NULL; - size_t newsize = 0; - - if ((p == NULL) || (p->buffer == NULL)) - { - return NULL; - } - - if ((p->length > 0) && (p->offset >= p->length)) - { - /* make sure that offset is valid */ - return NULL; - } - - if (needed > INT_MAX) - { - /* sizes bigger than INT_MAX are currently not supported */ - return NULL; - } - - needed += p->offset + 1; - if (needed <= p->length) - { - return p->buffer + p->offset; - } - - if (p->noalloc) { - return NULL; - } - - /* calculate new buffer size */ - if (needed > (INT_MAX / 2)) - { - /* overflow of int, use INT_MAX if possible */ - if (needed <= INT_MAX) - { - newsize = INT_MAX; - } - else - { - return NULL; - } - } - else - { - newsize = needed * 2; - } - - if (p->hooks.reallocate != NULL) - { - /* reallocate with realloc if available */ - newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); - if (newbuffer == NULL) - { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - } - else - { - /* otherwise reallocate manually */ - newbuffer = (unsigned char*)p->hooks.allocate(newsize); - if (!newbuffer) - { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - - memcpy(newbuffer, p->buffer, p->offset + 1); - p->hooks.deallocate(p->buffer); - } - p->length = newsize; - p->buffer = newbuffer; - - return newbuffer + p->offset; -} - -/* calculate the new length of the string in a printbuffer and update the offset */ -static void update_offset(printbuffer * const buffer) -{ - const unsigned char *buffer_pointer = NULL; - if ((buffer == NULL) || (buffer->buffer == NULL)) - { - return; - } - buffer_pointer = buffer->buffer + buffer->offset; - - buffer->offset += strlen((const char*)buffer_pointer); -} - -/* securely comparison of floating-point variables */ -static cJSON_bool compare_double(double a, double b) -{ - double maxVal = fabs(a) > fabs(b) ? fabs(a) : fabs(b); - return (fabs(a - b) <= maxVal * DBL_EPSILON); -} - -/* Render the number nicely from the given item into a string. */ -static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) -{ - unsigned char *output_pointer = NULL; - double d = item->valuedouble; - int length = 0; - size_t i = 0; - unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */ - unsigned char decimal_point = get_decimal_point(); - double test = 0.0; - - if (output_buffer == NULL) - { - return false; - } - - /* This checks for NaN and Infinity */ - if (isnan(d) || isinf(d)) - { - length = sprintf((char*)number_buffer, "null"); - } - else if(d == (double)item->valueint) - { - length = sprintf((char*)number_buffer, "%d", item->valueint); - } - else - { - /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = sprintf((char*)number_buffer, "%1.15g", d); - - /* Check whether the original double can be recovered */ - if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) - { - /* If not, print with 17 decimal places of precision */ - length = sprintf((char*)number_buffer, "%1.17g", d); - } - } - - /* sprintf failed or buffer overrun occurred */ - if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) - { - return false; - } - - /* reserve appropriate space in the output */ - output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); - if (output_pointer == NULL) - { - return false; - } - - /* copy the printed number to the output and replace locale - * dependent decimal point with '.' */ - for (i = 0; i < ((size_t)length); i++) - { - if (number_buffer[i] == decimal_point) - { - output_pointer[i] = '.'; - continue; - } - - output_pointer[i] = number_buffer[i]; - } - output_pointer[i] = '\0'; - - output_buffer->offset += (size_t)length; - - return true; -} - -/* parse 4 digit hexadecimal number */ -static unsigned parse_hex4(const unsigned char * const input) -{ - unsigned int h = 0; - size_t i = 0; - - for (i = 0; i < 4; i++) - { - /* parse digit */ - if ((input[i] >= '0') && (input[i] <= '9')) - { - h += (unsigned int) input[i] - '0'; - } - else if ((input[i] >= 'A') && (input[i] <= 'F')) - { - h += (unsigned int) 10 + input[i] - 'A'; - } - else if ((input[i] >= 'a') && (input[i] <= 'f')) - { - h += (unsigned int) 10 + input[i] - 'a'; - } - else /* invalid */ - { - return 0; - } - - if (i < 3) - { - /* shift left to make place for the next nibble */ - h = h << 4; - } - } - - return h; -} - -/* converts a UTF-16 literal to UTF-8 - * A literal can be one or two sequences of the form \uXXXX */ -static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) -{ - long unsigned int codepoint = 0; - unsigned int first_code = 0; - const unsigned char *first_sequence = input_pointer; - unsigned char utf8_length = 0; - unsigned char utf8_position = 0; - unsigned char sequence_length = 0; - unsigned char first_byte_mark = 0; - - if ((input_end - first_sequence) < 6) - { - /* input ends unexpectedly */ - goto fail; - } - - /* get the first utf16 sequence */ - first_code = parse_hex4(first_sequence + 2); - - /* check that the code is valid */ - if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) - { - goto fail; - } - - /* UTF16 surrogate pair */ - if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) - { - const unsigned char *second_sequence = first_sequence + 6; - unsigned int second_code = 0; - sequence_length = 12; /* \uXXXX\uXXXX */ - - if ((input_end - second_sequence) < 6) - { - /* input ends unexpectedly */ - goto fail; - } - - if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) - { - /* missing second half of the surrogate pair */ - goto fail; - } - - /* get the second utf16 sequence */ - second_code = parse_hex4(second_sequence + 2); - /* check that the code is valid */ - if ((second_code < 0xDC00) || (second_code > 0xDFFF)) - { - /* invalid second half of the surrogate pair */ - goto fail; - } - - - /* calculate the unicode codepoint from the surrogate pair */ - codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); - } - else - { - sequence_length = 6; /* \uXXXX */ - codepoint = first_code; - } - - /* encode as UTF-8 - * takes at maximum 4 bytes to encode: - * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ - if (codepoint < 0x80) - { - /* normal ascii, encoding 0xxxxxxx */ - utf8_length = 1; - } - else if (codepoint < 0x800) - { - /* two bytes, encoding 110xxxxx 10xxxxxx */ - utf8_length = 2; - first_byte_mark = 0xC0; /* 11000000 */ - } - else if (codepoint < 0x10000) - { - /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ - utf8_length = 3; - first_byte_mark = 0xE0; /* 11100000 */ - } - else if (codepoint <= 0x10FFFF) - { - /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ - utf8_length = 4; - first_byte_mark = 0xF0; /* 11110000 */ - } - else - { - /* invalid unicode codepoint */ - goto fail; - } - - /* encode as utf8 */ - for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) - { - /* 10xxxxxx */ - (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); - codepoint >>= 6; - } - /* encode first byte */ - if (utf8_length > 1) - { - (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); - } - else - { - (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); - } - - *output_pointer += utf8_length; - - return sequence_length; - -fail: - return 0; -} - -/* Parse the input text into an unescaped cinput, and populate item. */ -static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) -{ - const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; - const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; - unsigned char *output_pointer = NULL; - unsigned char *output = NULL; - - /* not a string */ - if (buffer_at_offset(input_buffer)[0] != '\"') - { - goto fail; - } - - { - /* calculate approximate size of the output (overestimate) */ - size_t allocation_length = 0; - size_t skipped_bytes = 0; - while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) - { - /* is escape sequence */ - if (input_end[0] == '\\') - { - if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) - { - /* prevent buffer overflow when last input character is a backslash */ - goto fail; - } - skipped_bytes++; - input_end++; - } - input_end++; - } - if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) - { - goto fail; /* string ended unexpectedly */ - } - - /* This is at most how much we need for the output */ - allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; - output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); - if (output == NULL) - { - goto fail; /* allocation failure */ - } - } - - output_pointer = output; - /* loop through the string literal */ - while (input_pointer < input_end) - { - if (*input_pointer != '\\') - { - *output_pointer++ = *input_pointer++; - } - /* escape sequence */ - else - { - unsigned char sequence_length = 2; - if ((input_end - input_pointer) < 1) - { - goto fail; - } - - switch (input_pointer[1]) - { - case 'b': - *output_pointer++ = '\b'; - break; - case 'f': - *output_pointer++ = '\f'; - break; - case 'n': - *output_pointer++ = '\n'; - break; - case 'r': - *output_pointer++ = '\r'; - break; - case 't': - *output_pointer++ = '\t'; - break; - case '\"': - case '\\': - case '/': - *output_pointer++ = input_pointer[1]; - break; - - /* UTF-16 literal */ - case 'u': - sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); - if (sequence_length == 0) - { - /* failed to convert UTF16-literal to UTF-8 */ - goto fail; - } - break; - - default: - goto fail; - } - input_pointer += sequence_length; - } - } - - /* zero terminate the output */ - *output_pointer = '\0'; - - item->type = cJSON_String; - item->valuestring = (char*)output; - - input_buffer->offset = (size_t) (input_end - input_buffer->content); - input_buffer->offset++; - - return true; - -fail: - if (output != NULL) - { - input_buffer->hooks.deallocate(output); - output = NULL; - } - - if (input_pointer != NULL) - { - input_buffer->offset = (size_t)(input_pointer - input_buffer->content); - } - - return false; -} - -/* Render the cstring provided to an escaped version that can be printed. */ -static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) -{ - const unsigned char *input_pointer = NULL; - unsigned char *output = NULL; - unsigned char *output_pointer = NULL; - size_t output_length = 0; - /* numbers of additional characters needed for escaping */ - size_t escape_characters = 0; - - if (output_buffer == NULL) - { - return false; - } - - /* empty string */ - if (input == NULL) - { - output = ensure(output_buffer, sizeof("\"\"")); - if (output == NULL) - { - return false; - } - strcpy((char*)output, "\"\""); - - return true; - } - - /* set "flag" to 1 if something needs to be escaped */ - for (input_pointer = input; *input_pointer; input_pointer++) - { - switch (*input_pointer) - { - case '\"': - case '\\': - case '\b': - case '\f': - case '\n': - case '\r': - case '\t': - /* one character escape sequence */ - escape_characters++; - break; - default: - if (*input_pointer < 32) - { - /* UTF-16 escape sequence uXXXX */ - escape_characters += 5; - } - break; - } - } - output_length = (size_t)(input_pointer - input) + escape_characters; - - output = ensure(output_buffer, output_length + sizeof("\"\"")); - if (output == NULL) - { - return false; - } - - /* no characters have to be escaped */ - if (escape_characters == 0) - { - output[0] = '\"'; - memcpy(output + 1, input, output_length); - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; - } - - output[0] = '\"'; - output_pointer = output + 1; - /* copy the string */ - for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) - { - if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) - { - /* normal character, copy */ - *output_pointer = *input_pointer; - } - else - { - /* character needs to be escaped */ - *output_pointer++ = '\\'; - switch (*input_pointer) - { - case '\\': - *output_pointer = '\\'; - break; - case '\"': - *output_pointer = '\"'; - break; - case '\b': - *output_pointer = 'b'; - break; - case '\f': - *output_pointer = 'f'; - break; - case '\n': - *output_pointer = 'n'; - break; - case '\r': - *output_pointer = 'r'; - break; - case '\t': - *output_pointer = 't'; - break; - default: - /* escape and print as unicode codepoint */ - sprintf((char*)output_pointer, "u%04x", *input_pointer); - output_pointer += 4; - break; - } - } - } - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; -} - -/* Invoke print_string_ptr (which is useful) on an item. */ -static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) -{ - return print_string_ptr((unsigned char*)item->valuestring, p); -} - -/* Predeclare these prototypes. */ -static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); -static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); -static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); -static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); -static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); -static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); - -/* Utility to jump whitespace and cr/lf */ -static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) -{ - if ((buffer == NULL) || (buffer->content == NULL)) - { - return NULL; - } - - if (cannot_access_at_index(buffer, 0)) - { - return buffer; - } - - while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) - { - buffer->offset++; - } - - if (buffer->offset == buffer->length) - { - buffer->offset--; - } - - return buffer; -} - -/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ -static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) -{ - if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) - { - return NULL; - } - - if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) - { - buffer->offset += 3; - } - - return buffer; -} - -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) -{ - size_t buffer_length; - - if (NULL == value) - { - return NULL; - } - - /* Adding null character size due to require_null_terminated. */ - buffer_length = strlen(value) + sizeof(""); - - return cJSON_ParseWithLengthOpts(value, buffer_length, return_parse_end, require_null_terminated); -} - -/* Parse an object - create a new root, and populate. */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated) -{ - parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; - cJSON *item = NULL; - - /* reset error position */ - global_error.json = NULL; - global_error.position = 0; - - if (value == NULL || 0 == buffer_length) - { - goto fail; - } - - buffer.content = (const unsigned char*)value; - buffer.length = buffer_length; - buffer.offset = 0; - buffer.hooks = global_hooks; - - item = cJSON_New_Item(&global_hooks); - if (item == NULL) /* memory fail */ - { - goto fail; - } - - if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) - { - /* parse failure. ep is set. */ - goto fail; - } - - /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ - if (require_null_terminated) - { - buffer_skip_whitespace(&buffer); - if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') - { - goto fail; - } - } - if (return_parse_end) - { - *return_parse_end = (const char*)buffer_at_offset(&buffer); - } - - return item; - -fail: - if (item != NULL) - { - cJSON_Delete(item); - } - - if (value != NULL) - { - error local_error; - local_error.json = (const unsigned char*)value; - local_error.position = 0; - - if (buffer.offset < buffer.length) - { - local_error.position = buffer.offset; - } - else if (buffer.length > 0) - { - local_error.position = buffer.length - 1; - } - - if (return_parse_end != NULL) - { - *return_parse_end = (const char*)local_error.json + local_error.position; - } - - global_error = local_error; - } - - return NULL; -} - -/* Default options for cJSON_Parse */ -CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) -{ - return cJSON_ParseWithOpts(value, 0, 0); -} - -CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length) -{ - return cJSON_ParseWithLengthOpts(value, buffer_length, 0, 0); -} - -#define cjson_min(a, b) (((a) < (b)) ? (a) : (b)) - -static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) -{ - static const size_t default_buffer_size = 256; - printbuffer buffer[1]; - unsigned char *printed = NULL; - - memset(buffer, 0, sizeof(buffer)); - - /* create buffer */ - buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); - buffer->length = default_buffer_size; - buffer->format = format; - buffer->hooks = *hooks; - if (buffer->buffer == NULL) - { - goto fail; - } - - /* print the value */ - if (!print_value(item, buffer)) - { - goto fail; - } - update_offset(buffer); - - /* check if reallocate is available */ - if (hooks->reallocate != NULL) - { - printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); - if (printed == NULL) { - goto fail; - } - buffer->buffer = NULL; - } - else /* otherwise copy the JSON over to a new buffer */ - { - printed = (unsigned char*) hooks->allocate(buffer->offset + 1); - if (printed == NULL) - { - goto fail; - } - memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); - printed[buffer->offset] = '\0'; /* just to be sure */ - - /* free the buffer */ - hooks->deallocate(buffer->buffer); - buffer->buffer = NULL; - } - - return printed; - -fail: - if (buffer->buffer != NULL) - { - hooks->deallocate(buffer->buffer); - buffer->buffer = NULL; - } - - if (printed != NULL) - { - hooks->deallocate(printed); - printed = NULL; - } - - return NULL; -} - -/* Render a cJSON item/entity/structure to text. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) -{ - return (char*)print(item, true, &global_hooks); -} - -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) -{ - return (char*)print(item, false, &global_hooks); -} - -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) -{ - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - - if (prebuffer < 0) - { - return NULL; - } - - p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); - if (!p.buffer) - { - return NULL; - } - - p.length = (size_t)prebuffer; - p.offset = 0; - p.noalloc = false; - p.format = fmt; - p.hooks = global_hooks; - - if (!print_value(item, &p)) - { - global_hooks.deallocate(p.buffer); - p.buffer = NULL; - return NULL; - } - - return (char*)p.buffer; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format) -{ - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - - if ((length < 0) || (buffer == NULL)) - { - return false; - } - - p.buffer = (unsigned char*)buffer; - p.length = (size_t)length; - p.offset = 0; - p.noalloc = true; - p.format = format; - p.hooks = global_hooks; - - return print_value(item, &p); -} - -/* Parser core - when encountering text, process appropriately. */ -static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) -{ - if ((input_buffer == NULL) || (input_buffer->content == NULL)) - { - return false; /* no input */ - } - - /* parse the different types of values */ - /* null */ - if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) - { - item->type = cJSON_NULL; - input_buffer->offset += 4; - return true; - } - /* false */ - if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) - { - item->type = cJSON_False; - input_buffer->offset += 5; - return true; - } - /* true */ - if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) - { - item->type = cJSON_True; - item->valueint = 1; - input_buffer->offset += 4; - return true; - } - /* string */ - if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) - { - return parse_string(item, input_buffer); - } - /* number */ - if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) - { - return parse_number(item, input_buffer); - } - /* array */ - if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) - { - return parse_array(item, input_buffer); - } - /* object */ - if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) - { - return parse_object(item, input_buffer); - } - - return false; -} - -/* Render a value to text. */ -static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) -{ - unsigned char *output = NULL; - - if ((item == NULL) || (output_buffer == NULL)) - { - return false; - } - - switch ((item->type) & 0xFF) - { - case cJSON_NULL: - output = ensure(output_buffer, 5); - if (output == NULL) - { - return false; - } - strcpy((char*)output, "null"); - return true; - - case cJSON_False: - output = ensure(output_buffer, 6); - if (output == NULL) - { - return false; - } - strcpy((char*)output, "false"); - return true; - - case cJSON_True: - output = ensure(output_buffer, 5); - if (output == NULL) - { - return false; - } - strcpy((char*)output, "true"); - return true; - - case cJSON_Number: - return print_number(item, output_buffer); - - case cJSON_Raw: - { - size_t raw_length = 0; - if (item->valuestring == NULL) - { - return false; - } - - raw_length = strlen(item->valuestring) + sizeof(""); - output = ensure(output_buffer, raw_length); - if (output == NULL) - { - return false; - } - memcpy(output, item->valuestring, raw_length); - return true; - } - - case cJSON_String: - return print_string(item, output_buffer); - - case cJSON_Array: - return print_array(item, output_buffer); - - case cJSON_Object: - return print_object(item, output_buffer); - - default: - return false; - } -} - -/* Build an array from input text. */ -static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) -{ - cJSON *head = NULL; /* head of the linked list */ - cJSON *current_item = NULL; - - if (input_buffer->depth >= CJSON_NESTING_LIMIT) - { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if (buffer_at_offset(input_buffer)[0] != '[') - { - /* not an array */ - goto fail; - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) - { - /* empty array */ - goto success; - } - - /* check if we skipped to the end of the buffer */ - if (cannot_access_at_index(input_buffer, 0)) - { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do - { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if (new_item == NULL) - { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if (head == NULL) - { - /* start the linked list */ - current_item = head = new_item; - } - else - { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - /* parse next value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if (!parse_value(current_item, input_buffer)) - { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } - while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); - - if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') - { - goto fail; /* expected end of array */ - } - -success: - input_buffer->depth--; - - if (head != NULL) { - head->prev = current_item; - } - - item->type = cJSON_Array; - item->child = head; - - input_buffer->offset++; - - return true; - -fail: - if (head != NULL) - { - cJSON_Delete(head); - } - - return false; -} - -/* Render an array to text */ -static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) -{ - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_element = item->child; - - if (output_buffer == NULL) - { - return false; - } - - /* Compose the output array. */ - /* opening square bracket */ - output_pointer = ensure(output_buffer, 1); - if (output_pointer == NULL) - { - return false; - } - - *output_pointer = '['; - output_buffer->offset++; - output_buffer->depth++; - - while (current_element != NULL) - { - if (!print_value(current_element, output_buffer)) - { - return false; - } - update_offset(output_buffer); - if (current_element->next) - { - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length + 1); - if (output_pointer == NULL) - { - return false; - } - *output_pointer++ = ','; - if(output_buffer->format) - { - *output_pointer++ = ' '; - } - *output_pointer = '\0'; - output_buffer->offset += length; - } - current_element = current_element->next; - } - - output_pointer = ensure(output_buffer, 2); - if (output_pointer == NULL) - { - return false; - } - *output_pointer++ = ']'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; -} - -/* Build an object from the text. */ -static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) -{ - cJSON *head = NULL; /* linked list head */ - cJSON *current_item = NULL; - - if (input_buffer->depth >= CJSON_NESTING_LIMIT) - { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) - { - goto fail; /* not an object */ - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) - { - goto success; /* empty object */ - } - - /* check if we skipped to the end of the buffer */ - if (cannot_access_at_index(input_buffer, 0)) - { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do - { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if (new_item == NULL) - { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if (head == NULL) - { - /* start the linked list */ - current_item = head = new_item; - } - else - { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - if (cannot_access_at_index(input_buffer, 1)) - { - goto fail; /* nothing comes after the comma */ - } - - /* parse the name of the child */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if (!parse_string(current_item, input_buffer)) - { - goto fail; /* failed to parse name */ - } - buffer_skip_whitespace(input_buffer); - - /* swap valuestring and string, because we parsed the name */ - current_item->string = current_item->valuestring; - current_item->valuestring = NULL; - - if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) - { - goto fail; /* invalid object */ - } - - /* parse the value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if (!parse_value(current_item, input_buffer)) - { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } - while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); - - if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) - { - goto fail; /* expected end of object */ - } - -success: - input_buffer->depth--; - - if (head != NULL) { - head->prev = current_item; - } - - item->type = cJSON_Object; - item->child = head; - - input_buffer->offset++; - return true; - -fail: - if (head != NULL) - { - cJSON_Delete(head); - } - - return false; -} - -/* Render an object to text. */ -static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) -{ - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_item = item->child; - - if (output_buffer == NULL) - { - return false; - } - - /* Compose the output: */ - length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ - output_pointer = ensure(output_buffer, length + 1); - if (output_pointer == NULL) - { - return false; - } - - *output_pointer++ = '{'; - output_buffer->depth++; - if (output_buffer->format) - { - *output_pointer++ = '\n'; - } - output_buffer->offset += length; - - while (current_item) - { - if (output_buffer->format) - { - size_t i; - output_pointer = ensure(output_buffer, output_buffer->depth); - if (output_pointer == NULL) - { - return false; - } - for (i = 0; i < output_buffer->depth; i++) - { - *output_pointer++ = '\t'; - } - output_buffer->offset += output_buffer->depth; - } - - /* print key */ - if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) - { - return false; - } - update_offset(output_buffer); - - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length); - if (output_pointer == NULL) - { - return false; - } - *output_pointer++ = ':'; - if (output_buffer->format) - { - *output_pointer++ = '\t'; - } - output_buffer->offset += length; - - /* print value */ - if (!print_value(current_item, output_buffer)) - { - return false; - } - update_offset(output_buffer); - - /* print comma if not last */ - length = ((size_t)(output_buffer->format ? 1 : 0) + (size_t)(current_item->next ? 1 : 0)); - output_pointer = ensure(output_buffer, length + 1); - if (output_pointer == NULL) - { - return false; - } - if (current_item->next) - { - *output_pointer++ = ','; - } - - if (output_buffer->format) - { - *output_pointer++ = '\n'; - } - *output_pointer = '\0'; - output_buffer->offset += length; - - current_item = current_item->next; - } - - output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); - if (output_pointer == NULL) - { - return false; - } - if (output_buffer->format) - { - size_t i; - for (i = 0; i < (output_buffer->depth - 1); i++) - { - *output_pointer++ = '\t'; - } - } - *output_pointer++ = '}'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; -} - -/* Get Array size/item / object item. */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) -{ - cJSON *child = NULL; - size_t size = 0; - - if (array == NULL) - { - return 0; - } - - child = array->child; - - while(child != NULL) - { - size++; - child = child->next; - } - - /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ - - return (int)size; -} - -static cJSON* get_array_item(const cJSON *array, size_t index) -{ - cJSON *current_child = NULL; - - if (array == NULL) - { - return NULL; - } - - current_child = array->child; - while ((current_child != NULL) && (index > 0)) - { - index--; - current_child = current_child->next; - } - - return current_child; -} - -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) -{ - if (index < 0) - { - return NULL; - } - - return get_array_item(array, (size_t)index); -} - -static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) -{ - cJSON *current_element = NULL; - - if ((object == NULL) || (name == NULL)) - { - return NULL; - } - - current_element = object->child; - if (case_sensitive) - { - while ((current_element != NULL) && (current_element->string != NULL) && (strcmp(name, current_element->string) != 0)) - { - current_element = current_element->next; - } - } - else - { - while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) - { - current_element = current_element->next; - } - } - - if ((current_element == NULL) || (current_element->string == NULL)) { - return NULL; - } - - return current_element; -} - -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) -{ - return get_object_item(object, string, false); -} - -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) -{ - return get_object_item(object, string, true); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) -{ - return cJSON_GetObjectItem(object, string) ? 1 : 0; -} - -/* Utility for array list handling. */ -static void suffix_object(cJSON *prev, cJSON *item) -{ - prev->next = item; - item->prev = prev; -} - -/* Utility for handling references. */ -static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) -{ - cJSON *reference = NULL; - if (item == NULL) - { - return NULL; - } - - reference = cJSON_New_Item(hooks); - if (reference == NULL) - { - return NULL; - } - - memcpy(reference, item, sizeof(cJSON)); - reference->string = NULL; - reference->type |= cJSON_IsReference; - reference->next = reference->prev = NULL; - return reference; -} - -static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) -{ - cJSON *child = NULL; - - if ((item == NULL) || (array == NULL) || (array == item)) - { - return false; - } - - child = array->child; - /* - * To find the last item in array quickly, we use prev in array - */ - if (child == NULL) - { - /* list is empty, start new one */ - array->child = item; - item->prev = item; - item->next = NULL; - } - else - { - /* append to the end */ - if (child->prev) - { - suffix_object(child->prev, item); - array->child->prev = item; - } - } - - return true; -} - -/* Add item to array/object. */ -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item) -{ - return add_item_to_array(array, item); -} - -#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) - #pragma GCC diagnostic push -#endif -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif -/* helper function to cast away const */ -static void* cast_away_const(const void* string) -{ - return (void*)string; -} -#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) - #pragma GCC diagnostic pop -#endif - - -static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) -{ - char *new_key = NULL; - int new_type = cJSON_Invalid; - - if ((object == NULL) || (string == NULL) || (item == NULL) || (object == item)) - { - return false; - } - - if (constant_key) - { - new_key = (char*)cast_away_const(string); - new_type = item->type | cJSON_StringIsConst; - } - else - { - new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); - if (new_key == NULL) - { - return false; - } - - new_type = item->type & ~cJSON_StringIsConst; - } - - if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) - { - hooks->deallocate(item->string); - } - - item->string = new_key; - item->type = new_type; - - return add_item_to_array(object, item); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) -{ - return add_item_to_object(object, string, item, &global_hooks, false); -} - -/* Add an item to an object with constant string as key */ -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) -{ - return add_item_to_object(object, string, item, &global_hooks, true); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) -{ - if (array == NULL) - { - return false; - } - - return add_item_to_array(array, create_reference(item, &global_hooks)); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) -{ - if ((object == NULL) || (string == NULL)) - { - return false; - } - - return add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); -} - -CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) -{ - cJSON *null = cJSON_CreateNull(); - if (add_item_to_object(object, name, null, &global_hooks, false)) - { - return null; - } - - cJSON_Delete(null); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) -{ - cJSON *true_item = cJSON_CreateTrue(); - if (add_item_to_object(object, name, true_item, &global_hooks, false)) - { - return true_item; - } - - cJSON_Delete(true_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) -{ - cJSON *false_item = cJSON_CreateFalse(); - if (add_item_to_object(object, name, false_item, &global_hooks, false)) - { - return false_item; - } - - cJSON_Delete(false_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) -{ - cJSON *bool_item = cJSON_CreateBool(boolean); - if (add_item_to_object(object, name, bool_item, &global_hooks, false)) - { - return bool_item; - } - - cJSON_Delete(bool_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) -{ - cJSON *number_item = cJSON_CreateNumber(number); - if (add_item_to_object(object, name, number_item, &global_hooks, false)) - { - return number_item; - } - - cJSON_Delete(number_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) -{ - cJSON *string_item = cJSON_CreateString(string); - if (add_item_to_object(object, name, string_item, &global_hooks, false)) - { - return string_item; - } - - cJSON_Delete(string_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) -{ - cJSON *raw_item = cJSON_CreateRaw(raw); - if (add_item_to_object(object, name, raw_item, &global_hooks, false)) - { - return raw_item; - } - - cJSON_Delete(raw_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) -{ - cJSON *object_item = cJSON_CreateObject(); - if (add_item_to_object(object, name, object_item, &global_hooks, false)) - { - return object_item; - } - - cJSON_Delete(object_item); - return NULL; -} - -CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) -{ - cJSON *array = cJSON_CreateArray(); - if (add_item_to_object(object, name, array, &global_hooks, false)) - { - return array; - } - - cJSON_Delete(array); - return NULL; -} - -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) -{ - if ((parent == NULL) || (item == NULL)) - { - return NULL; - } - - if (item != parent->child) - { - /* not the first element */ - item->prev->next = item->next; - } - if (item->next != NULL) - { - /* not the last element */ - item->next->prev = item->prev; - } - - if (item == parent->child) - { - /* first element */ - parent->child = item->next; - } - else if (item->next == NULL) - { - /* last element */ - parent->child->prev = item->prev; - } - - /* make sure the detached item doesn't point anywhere anymore */ - item->prev = NULL; - item->next = NULL; - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) -{ - if (which < 0) - { - return NULL; - } - - return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); -} - -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) -{ - cJSON_Delete(cJSON_DetachItemFromArray(array, which)); -} - -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) -{ - cJSON *to_detach = cJSON_GetObjectItem(object, string); - - return cJSON_DetachItemViaPointer(object, to_detach); -} - -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) -{ - cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); - - return cJSON_DetachItemViaPointer(object, to_detach); -} - -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) -{ - cJSON_Delete(cJSON_DetachItemFromObject(object, string)); -} - -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) -{ - cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); -} - -/* Replace array/object items with new ones. */ -CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) -{ - cJSON *after_inserted = NULL; - - if (which < 0 || newitem == NULL) - { - return false; - } - - after_inserted = get_array_item(array, (size_t)which); - if (after_inserted == NULL) - { - return add_item_to_array(array, newitem); - } - - if (after_inserted != array->child && after_inserted->prev == NULL) { - /* return false if after_inserted is a corrupted array item */ - return false; - } - - newitem->next = after_inserted; - newitem->prev = after_inserted->prev; - after_inserted->prev = newitem; - if (after_inserted == array->child) - { - array->child = newitem; - } - else - { - newitem->prev->next = newitem; - } - return true; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) -{ - if ((parent == NULL) || (parent->child == NULL) || (replacement == NULL) || (item == NULL)) - { - return false; - } - - if (replacement == item) - { - return true; - } - - replacement->next = item->next; - replacement->prev = item->prev; - - if (replacement->next != NULL) - { - replacement->next->prev = replacement; - } - if (parent->child == item) - { - if (parent->child->prev == parent->child) - { - replacement->prev = replacement; - } - parent->child = replacement; - } - else - { /* - * To find the last item in array quickly, we use prev in array. - * We can't modify the last item's next pointer where this item was the parent's child - */ - if (replacement->prev != NULL) - { - replacement->prev->next = replacement; - } - if (replacement->next == NULL) - { - parent->child->prev = replacement; - } - } - - item->next = NULL; - item->prev = NULL; - cJSON_Delete(item); - - return true; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) -{ - if (which < 0) - { - return false; - } - - return cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); -} - -static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) -{ - if ((replacement == NULL) || (string == NULL)) - { - return false; - } - - /* replace the name in the replacement */ - if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) - { - cJSON_free(replacement->string); - } - replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); - if (replacement->string == NULL) - { - return false; - } - - replacement->type &= ~cJSON_StringIsConst; - - return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) -{ - return replace_item_in_object(object, string, newitem, false); -} - -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) -{ - return replace_item_in_object(object, string, newitem, true); -} - -/* Create basic types: */ -CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_NULL; - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_True; - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_False; - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = boolean ? cJSON_True : cJSON_False; - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_Number; - item->valuedouble = num; - - /* use saturation in case of overflow */ - if (num >= INT_MAX) - { - item->valueint = INT_MAX; - } - else if (num <= (double)INT_MIN) - { - item->valueint = INT_MIN; - } - else - { - item->valueint = (int)num; - } - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_String; - item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); - if(!item->valuestring) - { - cJSON_Delete(item); - return NULL; - } - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if (item != NULL) - { - item->type = cJSON_String | cJSON_IsReference; - item->valuestring = (char*)cast_away_const(string); - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if (item != NULL) { - item->type = cJSON_Object | cJSON_IsReference; - item->child = (cJSON*)cast_away_const(child); - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { - cJSON *item = cJSON_New_Item(&global_hooks); - if (item != NULL) { - item->type = cJSON_Array | cJSON_IsReference; - item->child = (cJSON*)cast_away_const(child); - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type = cJSON_Raw; - item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); - if(!item->valuestring) - { - cJSON_Delete(item); - return NULL; - } - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) - { - item->type=cJSON_Array; - } - - return item; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) -{ - cJSON *item = cJSON_New_Item(&global_hooks); - if (item) - { - item->type = cJSON_Object; - } - - return item; -} - -/* Create Arrays: */ -CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) -{ - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if ((count < 0) || (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && (i < (size_t)count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if (!n) - { - cJSON_Delete(a); - return NULL; - } - if(!i) - { - a->child = n; - } - else - { - suffix_object(p, n); - } - p = n; - } - - if (a && a->child) { - a->child->prev = n; - } - - return a; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) -{ - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if ((count < 0) || (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && (i < (size_t)count); i++) - { - n = cJSON_CreateNumber((double)numbers[i]); - if(!n) - { - cJSON_Delete(a); - return NULL; - } - if(!i) - { - a->child = n; - } - else - { - suffix_object(p, n); - } - p = n; - } - - if (a && a->child) { - a->child->prev = n; - } - - return a; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) -{ - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if ((count < 0) || (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && (i < (size_t)count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if(!n) - { - cJSON_Delete(a); - return NULL; - } - if(!i) - { - a->child = n; - } - else - { - suffix_object(p, n); - } - p = n; - } - - if (a && a->child) { - a->child->prev = n; - } - - return a; -} - -CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count) -{ - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if ((count < 0) || (strings == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for (i = 0; a && (i < (size_t)count); i++) - { - n = cJSON_CreateString(strings[i]); - if(!n) - { - cJSON_Delete(a); - return NULL; - } - if(!i) - { - a->child = n; - } - else - { - suffix_object(p,n); - } - p = n; - } - - if (a && a->child) { - a->child->prev = n; - } - - return a; -} - -/* Duplication */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) -{ - cJSON *newitem = NULL; - cJSON *child = NULL; - cJSON *next = NULL; - cJSON *newchild = NULL; - - /* Bail on bad ptr */ - if (!item) - { - goto fail; - } - /* Create new item */ - newitem = cJSON_New_Item(&global_hooks); - if (!newitem) - { - goto fail; - } - /* Copy over all vars */ - newitem->type = item->type & (~cJSON_IsReference); - newitem->valueint = item->valueint; - newitem->valuedouble = item->valuedouble; - if (item->valuestring) - { - newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); - if (!newitem->valuestring) - { - goto fail; - } - } - if (item->string) - { - newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); - if (!newitem->string) - { - goto fail; - } - } - /* If non-recursive, then we're done! */ - if (!recurse) - { - return newitem; - } - /* Walk the ->next chain for the child. */ - child = item->child; - while (child != NULL) - { - newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ - if (!newchild) - { - goto fail; - } - if (next != NULL) - { - /* If newitem->child already set, then crosswire ->prev and ->next and move on */ - next->next = newchild; - newchild->prev = next; - next = newchild; - } - else - { - /* Set newitem->child and move to it */ - newitem->child = newchild; - next = newchild; - } - child = child->next; - } - if (newitem && newitem->child) - { - newitem->child->prev = newchild; - } - - return newitem; - -fail: - if (newitem != NULL) - { - cJSON_Delete(newitem); - } - - return NULL; -} - -static void skip_oneline_comment(char **input) -{ - *input += static_strlen("//"); - - for (; (*input)[0] != '\0'; ++(*input)) - { - if ((*input)[0] == '\n') { - *input += static_strlen("\n"); - return; - } - } -} - -static void skip_multiline_comment(char **input) -{ - *input += static_strlen("/*"); - - for (; (*input)[0] != '\0'; ++(*input)) - { - if (((*input)[0] == '*') && ((*input)[1] == '/')) - { - *input += static_strlen("*/"); - return; - } - } -} - -static void minify_string(char **input, char **output) { - (*output)[0] = (*input)[0]; - *input += static_strlen("\""); - *output += static_strlen("\""); - - - for (; (*input)[0] != '\0'; (void)++(*input), ++(*output)) { - (*output)[0] = (*input)[0]; - - if ((*input)[0] == '\"') { - (*output)[0] = '\"'; - *input += static_strlen("\""); - *output += static_strlen("\""); - return; - } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { - (*output)[1] = (*input)[1]; - *input += static_strlen("\""); - *output += static_strlen("\""); - } - } -} - -CJSON_PUBLIC(void) cJSON_Minify(char *json) -{ - char *into = json; - - if (json == NULL) - { - return; - } - - while (json[0] != '\0') - { - switch (json[0]) - { - case ' ': - case '\t': - case '\r': - case '\n': - json++; - break; - - case '/': - if (json[1] == '/') - { - skip_oneline_comment(&json); - } - else if (json[1] == '*') - { - skip_multiline_comment(&json); - } else { - json++; - } - break; - - case '\"': - minify_string(&json, (char**)&into); - break; - - default: - into[0] = json[0]; - json++; - into++; - } - } - - /* and null-terminate. */ - *into = '\0'; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_Invalid; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_False; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xff) == cJSON_True; -} - - -CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & (cJSON_True | cJSON_False)) != 0; -} -CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_NULL; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_Number; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_String; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_Array; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_Object; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) -{ - if (item == NULL) - { - return false; - } - - return (item->type & 0xFF) == cJSON_Raw; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) -{ - if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF))) - { - return false; - } - - /* check if type is valid */ - switch (a->type & 0xFF) - { - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - case cJSON_Number: - case cJSON_String: - case cJSON_Raw: - case cJSON_Array: - case cJSON_Object: - break; - - default: - return false; - } - - /* identical objects are equal */ - if (a == b) - { - return true; - } - - switch (a->type & 0xFF) - { - /* in these cases and equal type is enough */ - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - return true; - - case cJSON_Number: - if (compare_double(a->valuedouble, b->valuedouble)) - { - return true; - } - return false; - - case cJSON_String: - case cJSON_Raw: - if ((a->valuestring == NULL) || (b->valuestring == NULL)) - { - return false; - } - if (strcmp(a->valuestring, b->valuestring) == 0) - { - return true; - } - - return false; - - case cJSON_Array: - { - cJSON *a_element = a->child; - cJSON *b_element = b->child; - - for (; (a_element != NULL) && (b_element != NULL);) - { - if (!cJSON_Compare(a_element, b_element, case_sensitive)) - { - return false; - } - - a_element = a_element->next; - b_element = b_element->next; - } - - /* one of the arrays is longer than the other */ - if (a_element != b_element) { - return false; - } - - return true; - } - - case cJSON_Object: - { - cJSON *a_element = NULL; - cJSON *b_element = NULL; - cJSON_ArrayForEach(a_element, a) - { - /* TODO This has O(n^2) runtime, which is horrible! */ - b_element = get_object_item(b, a_element->string, case_sensitive); - if (b_element == NULL) - { - return false; - } - - if (!cJSON_Compare(a_element, b_element, case_sensitive)) - { - return false; - } - } - - /* doing this twice, once on a and b to prevent true comparison if a subset of b - * TODO: Do this the proper way, this is just a fix for now */ - cJSON_ArrayForEach(b_element, b) - { - a_element = get_object_item(a, b_element->string, case_sensitive); - if (a_element == NULL) - { - return false; - } - - if (!cJSON_Compare(b_element, a_element, case_sensitive)) - { - return false; - } - } - - return true; - } - - default: - return false; - } -} - -CJSON_PUBLIC(void *) cJSON_malloc(size_t size) -{ - return global_hooks.allocate(size); -} - -CJSON_PUBLIC(void) cJSON_free(void *object) -{ - global_hooks.deallocate(object); - object = NULL; -} diff --git a/libs/cJSON/cJSON.h b/libs/cJSON/cJSON.h deleted file mode 100644 index 88cf0bc..0000000 --- a/libs/cJSON/cJSON.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#ifndef cJSON__h -#define cJSON__h - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) -#define __WINDOWS__ -#endif - -#ifdef __WINDOWS__ - -/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 3 define options: - -CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols -CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) -CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol - -For *nix builds that support visibility attribute, you can define similar behavior by - -setting default visibility to hidden by adding --fvisibility=hidden (for gcc) -or --xldscope=hidden (for sun cc) -to CFLAGS - -then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does - -*/ - -#define CJSON_CDECL __cdecl -#define CJSON_STDCALL __stdcall - -/* export symbols by default, this is necessary for copy pasting the C and header file */ -#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_EXPORT_SYMBOLS -#endif - -#if defined(CJSON_HIDE_SYMBOLS) -#define CJSON_PUBLIC(type) type CJSON_STDCALL -#elif defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL -#elif defined(CJSON_IMPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL -#endif -#else /* !__WINDOWS__ */ -#define CJSON_CDECL -#define CJSON_STDCALL - -#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) -#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type -#else -#define CJSON_PUBLIC(type) type -#endif -#endif - -/* project version */ -#define CJSON_VERSION_MAJOR 1 -#define CJSON_VERSION_MINOR 7 -#define CJSON_VERSION_PATCH 18 - -#include - -/* cJSON Types: */ -#define cJSON_Invalid (0) -#define cJSON_False (1 << 0) -#define cJSON_True (1 << 1) -#define cJSON_NULL (1 << 2) -#define cJSON_Number (1 << 3) -#define cJSON_String (1 << 4) -#define cJSON_Array (1 << 5) -#define cJSON_Object (1 << 6) -#define cJSON_Raw (1 << 7) /* raw json */ - -#define cJSON_IsReference 256 -#define cJSON_StringIsConst 512 - -/* The cJSON structure: */ -typedef struct cJSON -{ - /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *next; - struct cJSON *prev; - /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - struct cJSON *child; - - /* The type of the item, as above. */ - int type; - - /* The item's string, if type==cJSON_String and type == cJSON_Raw */ - char *valuestring; - /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ - int valueint; - /* The item's number, if type==cJSON_Number */ - double valuedouble; - - /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ - char *string; -} cJSON; - -typedef struct cJSON_Hooks -{ - /* malloc/free are CDECL on Windows regardless of the default calling convention of the compiler, so ensure the hooks allow passing those functions directly. */ - void *(CJSON_CDECL *malloc_fn)(size_t sz); - void (CJSON_CDECL *free_fn)(void *ptr); -} cJSON_Hooks; - -typedef int cJSON_bool; - -/* Limits how deeply nested arrays/objects can be before cJSON rejects to parse them. - * This is to prevent stack overflows. */ -#ifndef CJSON_NESTING_LIMIT -#define CJSON_NESTING_LIMIT 1000 -#endif - -/* returns the version of cJSON as a string */ -CJSON_PUBLIC(const char*) cJSON_Version(void); - -/* Supply malloc, realloc and free functions to cJSON */ -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); - -/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ -/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ -CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); -CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length); -/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ -/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); -CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated); - -/* Render a cJSON entity to text for transfer/storage. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); -/* Render a cJSON entity to text for transfer/storage without any formatting. */ -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); -/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); -/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ -/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); -/* Delete a cJSON entity and all subentities. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON *item); - -/* Returns the number of items in an array (or object). */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); -/* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); -/* Get item "string" from object. Case insensitive. */ -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); -/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ -CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); - -/* Check item type and return its value */ -CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item); -CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item); - -/* These functions check the type of an item */ -CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); -CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); - -/* These calls create a cJSON item of the appropriate type. */ -CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); -CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); -CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); -/* raw json */ -CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); -CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); -CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); - -/* Create a string where valuestring references a string so - * it will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); -/* Create an object/array that only references it's elements so - * they will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); - -/* These utilities create an Array of count items. - * The parameter count cannot be greater than the number of elements in the number array, otherwise array access will be out of bounds.*/ -CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); -CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count); - -/* Append item to the specified array/object. */ -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item); -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); -/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. - * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before - * writing to `item->string` */ -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); -/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); -CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); - -/* Remove/Detach items from Arrays/Objects. */ -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); - -/* Update array items. */ -CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); - -/* Duplicate a cJSON item */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); -/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will - * need to be released. With recurse!=0, it will duplicate any children connected to the item. - * The item->next and ->prev pointers are always zero on return from Duplicate. */ -/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. - * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); - -/* Minify a strings, remove blank characters(such as ' ', '\t', '\r', '\n') from strings. - * The input pointer json cannot point to a read-only address area, such as a string constant, - * but should point to a readable and writable address area. */ -CJSON_PUBLIC(void) cJSON_Minify(char *json); - -/* Helper functions for creating and adding items to an object at the same time. - * They return the added item or NULL on failure. */ -CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); -CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); -CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); -CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); -CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); -CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); - -/* When assigning an integer value, it needs to be propagated to valuedouble too. */ -#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) -/* helper for the cJSON_SetNumberValue macro */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); -#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) -/* Change the valuestring of a cJSON_String object, only takes effect when type of object is cJSON_String */ -CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring); - -/* If the object is not a boolean type this does nothing and returns cJSON_Invalid else it returns the new type*/ -#define cJSON_SetBoolValue(object, boolValue) ( \ - (object != NULL && ((object)->type & (cJSON_False|cJSON_True))) ? \ - (object)->type=((object)->type &(~(cJSON_False|cJSON_True)))|((boolValue)?cJSON_True:cJSON_False) : \ - cJSON_Invalid\ -) - -/* Macro for iterating over an array or object */ -#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) - -/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ -CJSON_PUBLIC(void *) cJSON_malloc(size_t size); -CJSON_PUBLIC(void) cJSON_free(void *object); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/enet/.github/workflows/cmake.yml b/libs/enet/.github/workflows/cmake.yml deleted file mode 100644 index 721d430..0000000 --- a/libs/enet/.github/workflows/cmake.yml +++ /dev/null @@ -1,21 +0,0 @@ -on: [push, pull_request] - -name: CMake - -jobs: - cmake-build: - name: CMake ${{ matrix.os }} ${{ matrix.build_type }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "windows-latest", "macos-latest"] - build_type: ["Debug", "Release"] - steps: - - uses: actions/checkout@v3 - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} diff --git a/libs/enet/.gitignore b/libs/enet/.gitignore deleted file mode 100644 index 6d7cdbf..0000000 --- a/libs/enet/.gitignore +++ /dev/null @@ -1,70 +0,0 @@ -# Potential build directories -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -[Bb]in/ -[Dd]ebug/ -[Dd]ebugPublic/ -[Ll]og/ -[Ll]ogs/ -[Oo]bj/ -[Rr]elease/ -[Rr]eleases/ -[Ww][Ii][Nn]32/ -bld/ -build/ -builds/ -out/ -x64/ -x86/ - -# VS -.vs/ -.vscode/ -!.vscode/extensions.json -!.vscode/launch.json -!.vscode/settings.json -!.vscode/tasks.json - -# CMake -_deps -CMakeCache.txt -CMakeFiles -CMakeLists.txt.user -CMakeScripts -CMakeUserPresets.json -CTestTestfile.cmake -cmake_install.cmake -compile_commands.json -install_manifest.txt - -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects -*.dll -*.so -*.so.* -*.dylib - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb diff --git a/libs/enet/CMakeLists.txt b/libs/enet/CMakeLists.txt deleted file mode 100644 index cbe06d7..0000000 --- a/libs/enet/CMakeLists.txt +++ /dev/null @@ -1,119 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12...3.20) - -project(enet) - -# The "configure" step. -include(CheckFunctionExists) -include(CheckStructHasMember) -include(CheckTypeSize) -check_function_exists("fcntl" HAS_FCNTL) -check_function_exists("poll" HAS_POLL) -check_function_exists("getaddrinfo" HAS_GETADDRINFO) -check_function_exists("getnameinfo" HAS_GETNAMEINFO) -check_function_exists("gethostbyname_r" HAS_GETHOSTBYNAME_R) -check_function_exists("gethostbyaddr_r" HAS_GETHOSTBYADDR_R) -check_function_exists("inet_pton" HAS_INET_PTON) -check_function_exists("inet_ntop" HAS_INET_NTOP) -check_c_source_compiles(" - #include - struct S { int a; double b; }; - int main() { - return (int)offsetof(struct S, b); - } -" HAS_OFFSETOF) -check_struct_has_member("struct msghdr" "msg_flags" "sys/types.h;sys/socket.h" HAS_MSGHDR_FLAGS) -set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h") -check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY) -unset(CMAKE_EXTRA_INCLUDE_FILES) -if(MSVC) - add_definitions(-W3) -else() - add_definitions(-Wno-error) -endif() - -if(HAS_FCNTL) - add_definitions(-DHAS_FCNTL=1) -endif() -if(HAS_POLL) - add_definitions(-DHAS_POLL=1) -endif() -if(HAS_GETNAMEINFO) - add_definitions(-DHAS_GETNAMEINFO=1) -endif() -if(HAS_GETADDRINFO) - add_definitions(-DHAS_GETADDRINFO=1) -endif() -if(HAS_GETHOSTBYNAME_R) - add_definitions(-DHAS_GETHOSTBYNAME_R=1) -endif() -if(HAS_GETHOSTBYADDR_R) - add_definitions(-DHAS_GETHOSTBYADDR_R=1) -endif() -if(HAS_INET_PTON) - add_definitions(-DHAS_INET_PTON=1) -endif() -if(HAS_INET_NTOP) - add_definitions(-DHAS_INET_NTOP=1) -endif() -if(HAS_OFFSETOF) - add_definitions(-DHAS_OFFSETOF=1) -endif() -if(HAS_MSGHDR_FLAGS) - add_definitions(-DHAS_MSGHDR_FLAGS=1) -endif() -if(HAS_SOCKLEN_T) - add_definitions(-DHAS_SOCKLEN_T=1) -endif() - -include_directories(${PROJECT_SOURCE_DIR}/include) - -set(INCLUDE_FILES_PREFIX include/enet) -set(INCLUDE_FILES - ${INCLUDE_FILES_PREFIX}/callbacks.h - ${INCLUDE_FILES_PREFIX}/enet.h - ${INCLUDE_FILES_PREFIX}/list.h - ${INCLUDE_FILES_PREFIX}/protocol.h - ${INCLUDE_FILES_PREFIX}/time.h - ${INCLUDE_FILES_PREFIX}/types.h - ${INCLUDE_FILES_PREFIX}/unix.h - ${INCLUDE_FILES_PREFIX}/utility.h - ${INCLUDE_FILES_PREFIX}/win32.h -) - -set(SOURCE_FILES - callbacks.c - compress.c - host.c - list.c - packet.c - peer.c - protocol.c - unix.c - win32.c) - -source_group(include FILES ${INCLUDE_FILES}) -source_group(source FILES ${SOURCE_FILES}) - -if(WIN32 AND BUILD_SHARED_LIBS AND (MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_definitions(-DENET_DLL=1) - add_definitions(-DENET_BUILDING_LIB) -endif() - -add_library(enet - ${INCLUDE_FILES} - ${SOURCE_FILES} -) - -if (WIN32) - target_link_libraries(enet winmm ws2_32) -endif() - -include(GNUInstallDirs) -install(TARGETS enet - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) diff --git a/libs/enet/ChangeLog b/libs/enet/ChangeLog deleted file mode 100644 index 0fc45d3..0000000 --- a/libs/enet/ChangeLog +++ /dev/null @@ -1,209 +0,0 @@ -ENet 1.3.18 (April 14, 2024): - -* Packet sending performance improvements -* MTU negotiation fixes -* Checksum alignment fix -* No more dynamic initialization of checksum table -* ENET_SOCKOPT_TTL -* Other miscellaneous small improvements - -ENet 1.3.17 (November 15, 2020): - -* fixes for sender getting too far ahead of receiver that can cause instability with reliable packets - -ENet 1.3.16 (September 8, 2020): - -* fix bug in unreliable fragment queuing -* use single output queue for reliable and unreliable packets for saner ordering -* revert experimental throttle changes that were less stable than prior algorithm - -ENet 1.3.15 (April 20, 2020): - -* quicker RTT initialization -* use fractional precision for RTT calculations -* fixes for packet throttle with low RTT variance -* miscellaneous socket bug fixes - -ENet 1.3.14 (January 27, 2019): - -* bug fix for enet_peer_disconnect_later() -* use getaddrinfo and getnameinfo where available -* miscellaneous cleanups - -ENet 1.3.13 (April 30, 2015): - -* miscellaneous bug fixes -* added premake and cmake support -* miscellaneous documentation cleanups - -ENet 1.3.12 (April 24, 2014): - -* added maximumPacketSize and maximumWaitingData fields to ENetHost to limit the amount of -data waiting to be delivered on a peer (beware that the default maximumPacketSize is -32MB and should be set higher if desired as should maximumWaitingData) - -ENet 1.3.11 (December 26, 2013): - -* allow an ENetHost to connect to itself -* fixed possible bug with disconnect notifications during connect attempts -* fixed some preprocessor definition bugs - -ENet 1.3.10 (October 23, 2013); - -* doubled maximum reliable window size -* fixed RCVTIMEO/SNDTIMEO socket options and also added NODELAY - -ENet 1.3.9 (August 19, 2013): - -* added duplicatePeers option to ENetHost which can limit the number of peers from duplicate IPs -* added enet_socket_get_option() and ENET_SOCKOPT_ERROR -* added enet_host_random_seed() platform stub - -ENet 1.3.8 (June 2, 2013): - -* added enet_linked_version() for checking the linked version -* added enet_socket_get_address() for querying the local address of a socket -* silenced some debugging prints unless ENET_DEBUG is defined during compilation -* handle EINTR in enet_socket_wait() so that enet_host_service() doesn't propagate errors from signals -* optimized enet_host_bandwidth_throttle() to be less expensive for large numbers of peers - -ENet 1.3.7 (March 6, 2013): - -* added ENET_PACKET_FLAG_SENT to indicate that a packet is being freed because it has been sent -* added userData field to ENetPacket -* changed how random seed is generated on Windows to avoid import warnings -* fixed case where disconnects could be generated with no preceding connect event - -ENet 1.3.6 (December 11, 2012): - -* added support for intercept callback in ENetHost that can be used to process raw packets before ENet -* added enet_socket_shutdown() for issuing shutdown on a socket -* fixed enet_socket_connect() to not error on non-blocking connects -* fixed bug in MTU negotiation during connections - -ENet 1.3.5 (July 31, 2012): - -* fixed bug in unreliable packet fragment queuing - -ENet 1.3.4 (May 29, 2012): - -* added enet_peer_ping_interval() for configuring per-peer ping intervals -* added enet_peer_timeout() for configuring per-peer timeouts -* added protocol packet size limits - -ENet 1.3.3 (June 28, 2011): - -* fixed bug with simultaneous disconnects not dispatching events - -ENet 1.3.2 (May 31, 2011): - -* added support for unreliable packet fragmenting via the packet flag -ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT -* fixed regression in unreliable packet queuing -* added check against received port to limit some forms of IP-spoofing - -ENet 1.3.1 (February 10, 2011): - -* fixed bug in tracking of reliable data in transit -* reliable data window size now scales with the throttle -* fixed bug in fragment length calculation when checksums are used - -ENet 1.3.0 (June 5, 2010): - -* enet_host_create() now requires the channel limit to be specified as -a parameter -* enet_host_connect() now accepts a data parameter which is supplied -to the receiving receiving host in the event data field for a connect event -* added an adaptive order-2 PPM range coder as a built-in compressor option -which can be set with enet_host_compress_with_range_coder() -* added support for packet compression configurable with a callback -* improved session number handling to not rely on the packet checksum -field, saving 4 bytes per packet unless the checksum option is used -* removed the dependence on the rand callback for session number handling - -Caveats: This version is not protocol compatible with the 1.2 series or -earlier. The enet_host_connect and enet_host_create API functions require -supplying additional parameters. - -ENet 1.2.5 (June 28, 2011): - -* fixed bug with simultaneous disconnects not dispatching events - -ENet 1.2.4 (May 31, 2011): - -* fixed regression in unreliable packet queuing -* added check against received port to limit some forms of IP-spoofing - -ENet 1.2.3 (February 10, 2011): - -* fixed bug in tracking reliable data in transit - -ENet 1.2.2 (June 5, 2010): - -* checksum functionality is now enabled by setting a checksum callback -inside ENetHost instead of being a configure script option -* added totalSentData, totalSentPackets, totalReceivedData, and -totalReceivedPackets counters inside ENetHost for getting usage -statistics -* added enet_host_channel_limit() for limiting the maximum number of -channels allowed by connected peers -* now uses dispatch queues for event dispatch rather than potentially -unscalable array walking -* added no_memory callback that is called when a malloc attempt fails, -such that if no_memory returns rather than aborts (the default behavior), -then the error is propagated to the return value of the API calls -* now uses packed attribute for protocol structures on platforms with -strange alignment rules -* improved autoconf build system contributed by Nathan Brink allowing -for easier building as a shared library - -Caveats: If you were using the compile-time option that enabled checksums, -make sure to set the checksum callback inside ENetHost to enet_crc32 to -regain the old behavior. The ENetCallbacks structure has added new fields, -so make sure to clear the structure to zero before use if -using enet_initialize_with_callbacks(). - -ENet 1.2.1 (November 12, 2009): - -* fixed bug that could cause disconnect events to be dropped -* added thin wrapper around select() for portable usage -* added ENET_SOCKOPT_REUSEADDR socket option -* factored enet_socket_bind()/enet_socket_listen() out of enet_socket_create() -* added contributed Code::Blocks build file - -ENet 1.2 (February 12, 2008): - -* fixed bug in VERIFY_CONNECT acknowledgement that could cause connect -attempts to occasionally timeout -* fixed acknowledgements to check both the outgoing and sent queues -when removing acknowledged packets -* fixed accidental bit rot in the MSVC project file -* revised sequence number overflow handling to address some possible -disconnect bugs -* added enet_host_check_events() for getting only local queued events -* factored out socket option setting into enet_socket_set_option() so -that socket options are now set separately from enet_socket_create() - -Caveats: While this release is superficially protocol compatible with 1.1, -differences in the sequence number overflow handling can potentially cause -random disconnects. - -ENet 1.1 (June 6, 2007): - -* optional CRC32 just in case someone needs a stronger checksum than UDP -provides (--enable-crc32 configure option) -* the size of packet headers are half the size they used to be (so less -overhead when sending small packets) -* enet_peer_disconnect_later() that waits till all queued outgoing -packets get sent before issuing an actual disconnect -* freeCallback field in individual packets for notification of when a -packet is about to be freed -* ENET_PACKET_FLAG_NO_ALLOCATE for supplying pre-allocated data to a -packet (can be used in concert with freeCallback to support some custom -allocation schemes that the normal memory allocation callbacks would -normally not allow) -* enet_address_get_host_ip() for printing address numbers -* promoted the enet_socket_*() functions to be part of the API now -* a few stability/crash fixes - - diff --git a/libs/enet/Doxyfile b/libs/enet/Doxyfile deleted file mode 100644 index b72cb50..0000000 --- a/libs/enet/Doxyfile +++ /dev/null @@ -1,2303 +0,0 @@ -# Doxyfile 1.8.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "ENet" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = v1.3.18 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Reliable UDP networking library" - -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = YES - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = YES - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = YES - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = YES - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = YES - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = YES - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = YES - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = DoxygenLayout.xml - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c *.h *.dox - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = ${CMAKE_CURRENT_SOURCE_DIR} - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = NO - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 1 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 118 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 240 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 0 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = YES - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 1 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /