Skip to content

Commit 7056c12

Browse files
committed
feat: lib/platform -> lib/ptk
BREAKING CHANGE: lib/platform -> lib/ptk, and the naming style of libplatform has changed to have a `ptk_` prefix.
1 parent a994fdb commit 7056c12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2176
-2299
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Over time LCUI has been built up to be based on various libraries:
6868
- [lib/yutil](./lib/yutil): Utility library providing common data structures and functions.
6969
- [lib/pandagl](./lib/pandagl): PandaGL (Panda Graphics Library), offering font management, text layout, image I/O, graphics processing, and rendering capabilities.
7070
- [lib/css](./lib/css): CSS parser and selector engine providing CSS parsing and selection capabilities.
71-
- [lib/platform](./lib/platform): Platform library offering cross-platform unified system-related APIs, including message loop, window management, input method, etc.
71+
- [lib/ptk](./lib/ptk): Platform Toolkit library offering cross-platform unified system-related APIs, including message loop, window management, input method, etc.
7272
- [lib/thread](./lib/thread): Thread library providing cross-platform multithreading capabilities.
7373
- [lib/timer](./ui/timer): Timer library providing the ability to execute tasks at regular intervals.
7474
- [lib/ui](./lib/ui): UI core library providing essential UI capabilities such as UI component management, event queue, style computation, and drawing.
@@ -127,7 +127,7 @@ Here are the upcoming items:
127127
- LCUI
128128
- Improve API design.
129129
- Enhance the CSS engine to support `inherit`, `!important`, and escape characters.
130-
- Add [SDL](https://www.libsdl.org/) backend to replace the lib/platform library.
130+
- Add [SDL](https://www.libsdl.org/) backend to replace the lib/ptk library.
131131
- Adapt to other open-source graphics libraries for better rendering performance.
132132
- Command-line Tools
133133
- `lcui build --watch`: Continuously monitor file changes and automatically rebuild.

README.zh-cn.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ LCUI 建立在各种库的基础之上:
6666
- [lib/yutil](./lib/yutil): 实用工具库,提供常用的数据结构和函数。
6767
- [lib/pandagl](./lib/pandagl): PandaGL (Panda Graphics Library) 图形库,提供字体管理、文字排版、图片读写、图形处理和渲染能力。
6868
- [lib/css](./lib/css): CSS 解析器和选择引擎,提供 CSS 解析和选择能力。
69-
- [lib/platform](./lib/platform): 平台库,提供跨平台统一的系统相关 API,包括消息循环、窗口管理、输入法等。
69+
- [lib/ptk](./lib/ptk): 平台库**P**ing **T**ai **K**u),提供跨平台统一的系统相关 API,包括消息循环、窗口管理、输入法等。
7070
- [lib/thread](./lib/thread): 线程库,提供跨平台的多线程能力。
7171
- [lib/timer](./ui/timer): 定时器库,提供定时执行任务的能力。
7272
- [lib/ui](./lib/ui): UI 核心库,提供 UI 组件管理、事件队列、样式计算、绘制等 UI 必要能力。
@@ -125,7 +125,7 @@ LCUI 及相关项目的部分功能设计参考了其它开源项目,你可以
125125
- LCUI
126126
- 改进 API 设计。
127127
- 改进 CSS 引擎,增加支持 `inherit``!important`、转义字符。
128-
- 添加 [SDL](https://www.libsdl.org/) 后端,代替 lib/platform 库。
128+
- 添加 [SDL](https://www.libsdl.org/) 后端,代替 lib/ptk 库。
129129
- 适配其它开源图形库,以获得更好的渲染性能。
130130
- 命令行工具
131131
- `lcui build --watch`:持续监听文件变更并自动重新构建。

examples/hello/src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <LCUI.h>
2-
#include <platform/main.h>
2+
#include <ptk/main.h>
33

44
static void on_btn_click(ui_widget_t *self, ui_event_t *e, void *arg)
55
{

examples/todolist/src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Reference from: https://codepen.io/knyttneve/details/mddGVjB
22
#include <stdio.h>
33
#include <LCUI.h>
4-
#include <platform/main.h>
4+
#include <ptk/main.h>
55

66
typedef struct task_t {
77
unsigned id;

include/LCUI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <ui_server.h>
1919
#include <ui_xml.h>
2020
#include <thread.h>
21-
#include <platform.h>
21+
#include <ptk.h>
2222
#include <worker.h>
2323
#include <timer.h>
2424
#include <LCUI/app.h>

include/LCUI/app.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define LCUI_INCLUDE_LCUI_APP_H
1414

1515
#include "common.h"
16-
#include <platform.h>
16+
#include <ptk.h>
1717
#include <worker.h>
1818

1919
#define LCUI_MAX_FRAMES_PER_SEC 120
@@ -71,18 +71,18 @@ LCUI_API void lcui_destroy_ui(void);
7171
LCUI_API void lcui_update_ui(void);
7272
LCUI_API size_t lcui_render_ui(void);
7373
LCUI_API void lcui_preset_ui(void);
74-
LCUI_API void lcui_dispatch_ui_event(app_event_t *app_event);
74+
LCUI_API void lcui_dispatch_ui_event(ptk_event_t *app_event);
7575
LCUI_API void lcui_set_ui_display_mode(lcui_display_mode_t mode);
7676

7777
// Event
7878

79-
LCUI_API int lcui_get_event(app_event_t *e);
80-
LCUI_API int lcui_process_event(app_event_t *e);
81-
LCUI_API int lcui_process_events(app_process_events_option_t option);
79+
LCUI_API int lcui_get_event(ptk_event_t *e);
80+
LCUI_API int lcui_process_event(ptk_event_t *e);
81+
LCUI_API int lcui_process_events(ptk_process_events_option_t option);
8282

8383
INLINE int lcui_process_all_events(void)
8484
{
85-
return lcui_process_events(APP_PROCESS_EVENTS_ALL_IF_PRESENT);
85+
return lcui_process_events(PTK_PROCESS_EVENTS_ALL_IF_PRESENT);
8686
}
8787

8888
// Base

include/LCUI/common.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
#endif
3636

3737
#ifdef _WIN32
38-
#define LIBPLAT_WIN32
38+
#define PTK_WIN32
3939
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
40-
#define LIBPLAT_UWP
40+
#define PTK_UWP
4141
#else
42-
#define LIBPLAT_WIN_DESKTOP
42+
#define PTK_WIN_DESKTOP
4343
#endif
4444
#else
45-
#define LIBPLAT_LINUX
45+
#define PTK_LINUX
4646
#endif
4747

4848
#ifdef __cplusplus

include/LCUI/main.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
* LICENSE.TXT file in the root directory of this source tree.
1010
*/
1111

12-
#include <platform/main.h>
12+
#include <ptk/main.h>

lib/i18n/include/i18n.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* lib/i18n/include/i18n.h
33
*
44
* Copyright (c) 2023-2024, Liu Chao <i@lc-soft.io> All rights reserved.

lib/platform/README.md

-135
This file was deleted.

lib/platform/include/platform.h

-24
This file was deleted.

lib/platform/include/platform/app.h

-31
This file was deleted.

lib/platform/include/platform/clipboard.h

-40
This file was deleted.

0 commit comments

Comments
 (0)