Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dgr6878
rt-thread
提交
ceefcb97
R
rt-thread
项目概览
dgr6878
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ceefcb97
编写于
1月 19, 2018
作者:
Y
yangfasheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gui 引擎优化;
上级
973a5fb8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
13 deletion
+27
-13
components/gui/include/rtgui/event.h
components/gui/include/rtgui/event.h
+3
-3
components/gui/include/rtgui/rtgui.h
components/gui/include/rtgui/rtgui.h
+1
-1
components/gui/src/font_freetype.c
components/gui/src/font_freetype.c
+5
-1
components/gui/src/rtgui_app.c
components/gui/src/rtgui_app.c
+1
-1
components/gui/src/rtgui_system.c
components/gui/src/rtgui_system.c
+9
-4
components/gui/src/server.c
components/gui/src/server.c
+8
-3
未找到文件。
components/gui/include/rtgui/event.h
浏览文件 @
ceefcb97
...
...
@@ -343,7 +343,7 @@ struct rtgui_event_gesture
enum
rtgui_gesture_type
type
;
rt_uint32_t
win_acti_cnt
;
/* win
id
*/
rt_uint32_t
win_acti_cnt
;
/* win
dow activate count
*/
};
/*
...
...
@@ -362,7 +362,7 @@ struct rtgui_event_mouse
* different id. id should never be 0. */
rt_uint32_t
id
;
rt_uint32_t
win_acti_cnt
;
/* win
id
*/
rt_uint32_t
win_acti_cnt
;
/* win
dow activate count
*/
};
#define RTGUI_MOUSE_BUTTON_LEFT 0x01
#define RTGUI_MOUSE_BUTTON_RIGHT 0x02
...
...
@@ -383,7 +383,7 @@ struct rtgui_event_kbd
{
_RTGUI_EVENT_WIN_ELEMENTS
rt_uint32_t
win_acti_cnt
;
/* win
id
*/
rt_uint32_t
win_acti_cnt
;
/* win
dow activate count
*/
rt_uint16_t
type
;
/* key down or up */
rt_uint16_t
key
;
/* current key */
...
...
components/gui/include/rtgui/rtgui.h
浏览文件 @
ceefcb97
...
...
@@ -173,7 +173,7 @@ enum RTGUI_MODAL_CODE
{
RTGUI_MODAL_OK
,
RTGUI_MODAL_CANCEL
,
RTGUI_MODAL_MAX
=
0xFFFF
FFFF
,
RTGUI_MODAL_MAX
=
0xFFFF
,
};
typedef
enum
RTGUI_MODAL_CODE
rtgui_modal_code_t
;
...
...
components/gui/src/font_freetype.c
浏览文件 @
ceefcb97
...
...
@@ -62,6 +62,8 @@ extern unsigned short ff_convert(unsigned short wch, int direction);
#define gb2312tounicode(code) ff_convert(code, 1)
#endif
#ifndef UTF8_TO_UNICODE
static
void
gbk_to_unicode
(
rt_uint16_t
*
unicode
,
const
char
*
text
,
int
len
)
{
int
i
;
...
...
@@ -91,6 +93,8 @@ static void gbk_to_unicode(rt_uint16_t *unicode, const char *text, int len)
*
unicode
=
'\0'
;
}
#else
static
rt_uint16_t
_get_unicode
(
const
char
*
str
,
int
n
)
{
int
i
;
...
...
@@ -244,6 +248,7 @@ static int utf8_to_unicode(rt_uint16_t* unicode, const char* utf8, int len)
return
index
;
}
#endif
static
void
_rtgui_rect_move_to_align
(
const
rtgui_rect_t
*
rect
,
rtgui_rect_t
*
to
,
rt_uint16_t
height
,
int
align
)
{
...
...
@@ -574,7 +579,6 @@ static void ftc_draw_text(struct rtgui_font *font,
struct
rtgui_ttf_font
*
ttf_font
;
rt_int16_t
begin_x
,
btm_y
;
rt_int16_t
topy
;
rt_uint8_t
a
,
r
,
g
,
b
;
rtgui_color_t
fgc
;
struct
rtgui_rect
text_rect
;
...
...
components/gui/src/rtgui_app.c
浏览文件 @
ceefcb97
...
...
@@ -286,7 +286,7 @@ rt_bool_t rtgui_app_event_handler(struct rtgui_object *object, rtgui_event_t *ev
case
RTGUI_EVENT_WIN_ACTIVATE
:
{
app
->
win_acti_cnt
++
;
app
->
win_acti_cnt
++
;
_rtgui_application_dest_handle
(
app
,
event
);
}
break
;
...
...
components/gui/src/rtgui_system.c
浏览文件 @
ceefcb97
...
...
@@ -87,6 +87,7 @@ INIT_APP_EXPORT(rtgui_system_server_init);
/************************************************************************/
static
void
rtgui_time_out
(
void
*
parameter
)
{
rt_err_t
result
;
rtgui_timer_t
*
timer
;
rtgui_event_timer_t
event
;
timer
=
(
rtgui_timer_t
*
)
parameter
;
...
...
@@ -103,7 +104,11 @@ static void rtgui_time_out(void *parameter)
event
.
timer
=
timer
;
timer
->
pending_cnt
++
;
rtgui_send
(
timer
->
app
,
&
(
event
.
parent
),
sizeof
(
rtgui_event_timer_t
));
result
=
rtgui_send
(
timer
->
app
,
&
(
event
.
parent
),
sizeof
(
rtgui_event_timer_t
));
if
(
result
==
RT_EOK
)
{
timer
->
pending_cnt
++
;
}
}
rtgui_timer_t
*
rtgui_timer_create
(
rt_int32_t
time
,
rt_int32_t
flag
,
rtgui_timeout_func
timeout
,
void
*
parameter
)
...
...
@@ -417,7 +422,7 @@ const char *rtgui_event_string[] =
"WIN_CLOSE"
,
/* close a window */
"WIN_MOVE"
,
/* move a window */
"WIN_RESIZE"
,
/* resize a window */
"WIN_UPDATE_END"
,
"WIN_UPDATE_END"
,
"WIN_MODAL_ENTER"
,
/* a window modals */
"SET_WM"
,
/* set window manager */
...
...
@@ -547,8 +552,8 @@ static void rtgui_event_dump(struct rtgui_app* app, rtgui_event_t *event)
break
;
case
RTGUI_EVENT_WIN_ACTIVATE
:
case
RTGUI_EVENT_WIN_DESTROY
:
case
RTGUI_EVENT_WIN_CLOSE
:
case
RTGUI_EVENT_WIN_DESTROY
:
case
RTGUI_EVENT_WIN_CLOSE
:
case
RTGUI_EVENT_WIN_DEACTIVATE
:
case
RTGUI_EVENT_WIN_SHOW
:
case
RTGUI_EVENT_WIN_HIDE
:
...
...
components/gui/src/server.c
浏览文件 @
ceefcb97
...
...
@@ -115,6 +115,7 @@ void rtgui_server_handle_mouse_btn(struct rtgui_event_mouse *event)
return
;
event
->
wid
=
wnd
->
wid
;
event
->
win_acti_cnt
=
rtgui_app_get_win_acti_cnt
();
/* only raise window if the button is pressed down */
if
(
event
->
button
&
RTGUI_MOUSE_BUTTON_DOWN
&&
...
...
@@ -124,9 +125,10 @@ void rtgui_server_handle_mouse_btn(struct rtgui_event_mouse *event)
}
/* send mouse event to thread */
rtgui_send
(
wnd
->
app
,
(
struct
rtgui_event
*
)
event
,
sizeof
(
struct
rtgui_event_mouse
));
while
(
rtgui_send
(
wnd
->
app
,
(
struct
rtgui_event
*
)
event
,
sizeof
(
struct
rtgui_event_mouse
))
!=
RT_EOK
)
{
rt_thread_delay
(
RT_TICK_PER_SECOND
/
50
);
}
}
void
rtgui_server_handle_mouse_motion
(
struct
rtgui_event_mouse
*
event
)
...
...
@@ -152,6 +154,8 @@ void rtgui_server_handle_mouse_motion(struct rtgui_event_mouse *event)
if
(
win
)
{
event
->
wid
=
win
->
wid
;
event
->
win_acti_cnt
=
rtgui_app_get_win_acti_cnt
();
rtgui_send
(
win
->
wid
->
app
,
&
(
event
->
parent
),
sizeof
(
*
event
));
}
...
...
@@ -175,6 +179,7 @@ void rtgui_server_handle_kbd(struct rtgui_event_kbd *event)
/* send to focus window */
event
->
wid
=
wnd
->
wid
;
event
->
win_acti_cnt
=
rtgui_app_get_win_acti_cnt
();
/* send keyboard event to thread */
rtgui_send
(
wnd
->
app
,
(
struct
rtgui_event
*
)
event
,
sizeof
(
struct
rtgui_event_kbd
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录