mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
move the basic routine of dc to inline; add hdc memory image type; move event buffer from stack to gui thread structure.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@755 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -522,16 +522,20 @@ rt_bool_t rtgui_win_event_handler(struct rtgui_widget* widget, struct rtgui_even
|
||||
/* windows event loop */
|
||||
void rtgui_win_event_loop(rtgui_win_t* wnd)
|
||||
{
|
||||
/* the buffer uses to receive event */
|
||||
char event_buf[256];
|
||||
rtgui_thread_t* tid;
|
||||
struct rtgui_event* event;
|
||||
|
||||
struct rtgui_event* event = (struct rtgui_event*)&event_buf[0];
|
||||
tid = rtgui_thread_self();
|
||||
RT_ASSERT(tid != RT_NULL);
|
||||
|
||||
/* point to event buffer */
|
||||
event = (struct rtgui_event*)tid->event_buffer;
|
||||
|
||||
if (wnd->style & RTGUI_WIN_STYLE_UNDER_MODAL)
|
||||
{
|
||||
while (wnd->style & RTGUI_WIN_STYLE_UNDER_MODAL)
|
||||
{
|
||||
if (rtgui_thread_recv(event, sizeof(event_buf)) == RT_EOK)
|
||||
if (rtgui_thread_recv(event, RTGUI_EVENT_BUFFER_SIZE) == RT_EOK)
|
||||
{
|
||||
/* perform event handler */
|
||||
RTGUI_WIDGET(wnd)->event_handler(RTGUI_WIDGET(wnd), event);
|
||||
@@ -542,7 +546,7 @@ void rtgui_win_event_loop(rtgui_win_t* wnd)
|
||||
{
|
||||
while (!(wnd->style & RTGUI_WIN_STYLE_CLOSED))
|
||||
{
|
||||
if (rtgui_thread_recv(event, sizeof(event_buf)) == RT_EOK)
|
||||
if (rtgui_thread_recv(event, RTGUI_EVENT_BUFFER_SIZE) == RT_EOK)
|
||||
{
|
||||
/* perform event handler */
|
||||
RTGUI_WIDGET(wnd)->event_handler(RTGUI_WIDGET(wnd), event);
|
||||
|
||||
Reference in New Issue
Block a user