summaryrefslogtreecommitdiff
path: root/components/gui/src/rtgui_system.c
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-10-10 00:17:58 +0800
committerbernard <[email protected]>2017-10-10 00:17:58 +0800
commit01108b525294e1019fcab893dc991e8e17d1fa86 (patch)
treef52214cb4f76cffaeb8f4f5cf3c22f5c90604684 /components/gui/src/rtgui_system.c
parentf8a1bf6fd809be4ce53d17bde1a367aa6bae8187 (diff)
[GUI] Update GUI engine code and add Kconfig file.
Diffstat (limited to 'components/gui/src/rtgui_system.c')
-rw-r--r--components/gui/src/rtgui_system.c58
1 files changed, 38 insertions, 20 deletions
diff --git a/components/gui/src/rtgui_system.c b/components/gui/src/rtgui_system.c
index f5403adbec..f5da07ea4f 100644
--- a/components/gui/src/rtgui_system.c
+++ b/components/gui/src/rtgui_system.c
@@ -1,16 +1,26 @@
/*
* File : rtgui_system.c
- * This file is part of RTGUI in RT-Thread RTOS
- * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
+ * This file is part of RT-Thread GUI Engine
+ * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
- * 2016-03-23 Bernard fix the default font initialization issue.
+ * 2016-03-23 Bernard fix the default font initialization issue.
*/
#include <rtgui/rtgui.h>
@@ -22,6 +32,10 @@
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/window.h>
+#ifdef RTGUI_USING_TTF
+#include <rtgui/font_freetype.h>
+#endif
+
#ifdef _WIN32_NATIVE
#define RTGUI_MEM_TRACE
#endif
@@ -60,6 +74,10 @@ int rtgui_system_server_init(void)
rtgui_font_set_defaut(&rtgui_font_asc12);
#endif
+#ifdef RTGUI_USING_TTF
+ rtgui_ttf_system_init();
+#endif
+
return 0;
}
INIT_APP_EXPORT(rtgui_system_server_init);
@@ -413,7 +431,7 @@ const char *rtgui_event_string[] =
"TIMER", /* timer */
"UPDATE_TOPLVL", /* update toplevel */
- "VPAINT_REQ", /* virtual paint request */
+ "VPAINT_REQ", /* virtual paint request */
/* clip rect information */
"CLIP_INFO", /* clip rect info */
@@ -423,7 +441,7 @@ const char *rtgui_event_string[] =
"MOUSE_BUTTON", /* mouse button info */
"KBD", /* keyboard info */
"TOUCH", /* touch info */
- "GESTURE", /* gesture */
+ "GESTURE", /* gesture */
"FOCUSED", /* widget got focuse */
"SCROLLED", /* scroll bar scrolled */
@@ -599,7 +617,7 @@ static void rtgui_event_dump(struct rtgui_app* app, rtgui_event_t *event)
break;
default:
- break;
+ break;
}
rt_kprintf("\n");
@@ -722,7 +740,7 @@ RTM_EXPORT(rtgui_recv);
rt_err_t rtgui_recv_filter(rt_uint32_t type, rtgui_event_t *event, rt_size_t event_size)
{
- rtgui_event_t *e;
+ rtgui_event_t *e;
struct rtgui_app *app;
RT_ASSERT(event != RT_NULL);
@@ -732,7 +750,7 @@ rt_err_t rtgui_recv_filter(rt_uint32_t type, rtgui_event_t *event, rt_size_t eve
if (app == RT_NULL)
return -RT_ERROR;
- e = (rtgui_event_t*)&app->event_buffer[0];
+ e = (rtgui_event_t*)&app->event_buffer[0];
while (rt_mq_recv(app->mq, e, sizeof(union rtgui_event_generic), RT_WAITING_FOREVER) == RT_EOK)
{
if (e->type == type)
@@ -785,23 +803,23 @@ RTM_EXPORT(rtgui_screen_unlock);
int rtgui_screen_lock_freeze(void)
{
- int hold = 0;
+ int hold = 0;
- if (_screen_lock.owner == rt_thread_self())
- {
- int index;
+ if (_screen_lock.owner == rt_thread_self())
+ {
+ int index;
- index = hold = _screen_lock.hold;
- while (index --) rt_mutex_release(&_screen_lock);
- }
+ index = hold = _screen_lock.hold;
+ while (index --) rt_mutex_release(&_screen_lock);
+ }
- return hold;
+ return hold;
}
RTM_EXPORT(rtgui_screen_lock_freeze);
void rtgui_screen_lock_thaw(int value)
{
- while (value--) rt_mutex_take(&_screen_lock, RT_WAITING_FOREVER);
+ while (value--) rt_mutex_take(&_screen_lock, RT_WAITING_FOREVER);
}
RTM_EXPORT(rtgui_screen_lock_thaw);