2009-10-16 08:03:50 +08:00
|
|
|
/*
|
|
|
|
* File : mouse.h
|
|
|
|
* This file is part of RT-Thread RTOS
|
|
|
|
* COPYRIGHT (C) 2006 - 2009, 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
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2009-10-16 Bernard first version
|
|
|
|
*/
|
|
|
|
#ifndef __RTGUI_MOUSE_H__
|
|
|
|
#define __RTGUI_MOUSE_H__
|
|
|
|
|
|
|
|
#include <rtgui/rtgui.h>
|
|
|
|
#include <rtgui/image.h>
|
|
|
|
#include "topwin.h"
|
|
|
|
|
|
|
|
struct rtgui_mouse_monitor
|
|
|
|
{
|
2012-11-26 10:42:52 +08:00
|
|
|
/* event rect */
|
|
|
|
rtgui_rect_t rect;
|
2009-10-16 08:03:50 +08:00
|
|
|
|
2012-11-26 10:42:52 +08:00
|
|
|
/* node list */
|
|
|
|
rtgui_list_t list;
|
2009-10-16 08:03:50 +08:00
|
|
|
};
|
|
|
|
typedef struct rtgui_mouse_monitor rtgui_mouse_monitor_t;
|
|
|
|
|
|
|
|
void rtgui_mouse_init(void);
|
2012-08-13 14:30:05 +08:00
|
|
|
void rtgui_mouse_fini(void);
|
2009-10-16 08:03:50 +08:00
|
|
|
void rtgui_mouse_moveto(int x, int y);
|
|
|
|
|
|
|
|
void rtgui_mouse_set_cursor_enable(rt_bool_t enable);
|
2012-11-26 10:42:52 +08:00
|
|
|
void rtgui_mouse_set_cursor(rtgui_image_t *cursor);
|
|
|
|
void rtgui_mouse_get_cursor_rect(rtgui_rect_t *rect);
|
2009-10-16 08:03:50 +08:00
|
|
|
|
|
|
|
void rtgui_mouse_show_cursor(void);
|
|
|
|
void rtgui_mouse_hide_cursor(void);
|
|
|
|
|
2012-11-26 10:42:52 +08:00
|
|
|
rt_bool_t rtgui_mouse_is_intersect(rtgui_rect_t *r);
|
2009-10-16 08:03:50 +08:00
|
|
|
|
2010-05-08 23:50:45 +08:00
|
|
|
#ifdef RTGUI_USING_WINMOVE
|
2009-10-16 08:03:50 +08:00
|
|
|
rt_bool_t rtgui_winrect_is_moved(void);
|
2012-11-26 10:42:52 +08:00
|
|
|
void rtgui_winrect_set(struct rtgui_topwin *topwin);
|
|
|
|
rt_bool_t rtgui_winrect_moved_done(rtgui_rect_t *winrect, struct rtgui_topwin **topwin);
|
2010-05-08 23:50:45 +08:00
|
|
|
#endif
|
2009-10-16 08:03:50 +08:00
|
|
|
|
2012-11-26 10:42:52 +08:00
|
|
|
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);
|
|
|
|
rt_bool_t rtgui_mouse_monitor_contains_point(rtgui_list_t *head, int x, int y);
|
2009-10-16 08:03:50 +08:00
|
|
|
|
|
|
|
#endif
|