mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
update according 0.3.1 series and add XML parser.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@699 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
@@ -44,12 +44,14 @@ struct rtgui_cursor
|
||||
rt_uint8_t *cursor_saved;
|
||||
#endif
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
/* move window rect and border */
|
||||
struct rtgui_topwin *topwin;
|
||||
rtgui_rect_t win_rect;
|
||||
rt_uint8_t *win_left, *win_right;
|
||||
rt_uint8_t *win_top, *win_bottom;
|
||||
rt_bool_t win_rect_show, win_rect_has_saved;
|
||||
#endif
|
||||
|
||||
/* screen framebuffer */
|
||||
rt_uint8_t* framebuffer;
|
||||
@@ -118,9 +120,11 @@ static void rtgui_cursor_save (void);
|
||||
static void rtgui_cursor_show (void);
|
||||
#endif
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
static void rtgui_winrect_restore (void);
|
||||
static void rtgui_winrect_save (void);
|
||||
static void rtgui_winrect_show (void);
|
||||
#endif
|
||||
|
||||
#define WIN_MOVE_BORDER 4
|
||||
void rtgui_mouse_init()
|
||||
@@ -163,6 +167,7 @@ void rtgui_mouse_init()
|
||||
_rtgui_cursor->cursor_image->h * _rtgui_cursor->bpp);
|
||||
#endif
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
/* init window move save image */
|
||||
_rtgui_cursor->win_rect_has_saved = RT_FALSE;
|
||||
_rtgui_cursor->win_rect_show = RT_FALSE;
|
||||
@@ -171,6 +176,7 @@ void rtgui_mouse_init()
|
||||
_rtgui_cursor->win_right = rtgui_malloc(_rtgui_cursor->bpp * gd->height * WIN_MOVE_BORDER);
|
||||
_rtgui_cursor->win_top = rtgui_malloc(_rtgui_cursor->bpp * gd->width * WIN_MOVE_BORDER);
|
||||
_rtgui_cursor->win_bottom = rtgui_malloc(_rtgui_cursor->bpp * gd->width * WIN_MOVE_BORDER);
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtgui_mouse_moveto(int x, int y)
|
||||
@@ -182,6 +188,7 @@ void rtgui_mouse_moveto(int x, int y)
|
||||
if (x != _rtgui_cursor->cx ||
|
||||
y != _rtgui_cursor->cy)
|
||||
{
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
if (_rtgui_cursor->win_rect_show)
|
||||
{
|
||||
if (_rtgui_cursor->win_rect_has_saved == RT_TRUE)
|
||||
@@ -210,6 +217,7 @@ void rtgui_mouse_moveto(int x, int y)
|
||||
rtgui_winrect_show();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef RTGUI_USING_MOUSE_CURSOR
|
||||
rtgui_mouse_hide_cursor();
|
||||
@@ -371,6 +379,7 @@ static void rtgui_cursor_show()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
void rtgui_winrect_set(struct rtgui_topwin* topwin)
|
||||
{
|
||||
/* set win rect show */
|
||||
@@ -562,6 +571,7 @@ static void rtgui_winrect_save()
|
||||
display_direct_memcpy(fb_ptr, winrect_ptr, _rtgui_cursor->screen_pitch, winrect_pitch,
|
||||
WIN_MOVE_BORDER, winrect_pitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtgui_mouse_monitor_append(rtgui_list_t* head, rtgui_rect_t* rect)
|
||||
{
|
||||
|
||||
@@ -40,9 +40,11 @@ void rtgui_mouse_hide_cursor(void);
|
||||
|
||||
rt_bool_t rtgui_mouse_is_intersect(rtgui_rect_t* r);
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
rt_bool_t rtgui_winrect_is_moved(void);
|
||||
void rtgui_winrect_set(struct rtgui_topwin* topwin);
|
||||
rt_bool_t rtgui_winrect_moved_done(rtgui_rect_t* winrect, struct rtgui_topwin** topwin);
|
||||
#endif
|
||||
|
||||
void rtgui_mouse_monitor_append(rtgui_list_t* head, rtgui_rect_t* rect);
|
||||
void rtgui_mouse_monitor_remove(rtgui_list_t* head, rtgui_rect_t* rect);
|
||||
|
||||
@@ -225,6 +225,7 @@ void rtgui_server_handle_mouse_btn(struct rtgui_event_mouse* event)
|
||||
/* re-init to server thread */
|
||||
RTGUI_EVENT_MOUSE_BUTTON_INIT(event);
|
||||
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
if (rtgui_winrect_is_moved() &&
|
||||
event->button & (RTGUI_MOUSE_BUTTON_LEFT | RTGUI_MOUSE_BUTTON_UP))
|
||||
{
|
||||
@@ -259,6 +260,7 @@ void rtgui_server_handle_mouse_btn(struct rtgui_event_mouse* event)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* get the wnd which contains the mouse */
|
||||
wnd = rtgui_topwin_get_wnd(event->x, event->y);
|
||||
@@ -464,9 +466,9 @@ void rtgui_server_handle_kbd(struct rtgui_event_kbd* event)
|
||||
{
|
||||
/* send to focus panel */
|
||||
event->wid = RT_NULL;
|
||||
|
||||
|
||||
/* send keyboard event to thread */
|
||||
rtgui_thread_send(tid, (struct rtgui_event*)event, sizeof(struct rtgui_event_kbd));
|
||||
rtgui_thread_send(tid, (struct rtgui_event*)event, sizeof(struct rtgui_event_kbd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -946,11 +946,13 @@ void rtgui_topwin_title_onmouse(struct rtgui_topwin* win, struct rtgui_event_mou
|
||||
win->flag |= WINTITLE_CB_PRESSED;
|
||||
rtgui_theme_draw_win(win);
|
||||
}
|
||||
#ifdef RTGUI_USING_WINMOVE
|
||||
else
|
||||
{
|
||||
/* maybe move window */
|
||||
rtgui_winrect_set(win);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (event->button & RTGUI_MOUSE_BUTTON_UP)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user