summaryrefslogtreecommitdiff
path: root/components/gui/include
diff options
context:
space:
mode:
authoryangfasheng <[email protected]>2018-01-02 11:50:17 +0800
committeryangfasheng <[email protected]>2018-01-02 11:50:17 +0800
commitc4e8c922d38ad213c92ae130dbc5f0890f98dd79 (patch)
treedc5575c0f766bfe9f2762aaf24aa323ca5f425dd /components/gui/include
parent2c145743cb5526b5027d375a9731ddd0e7a4015e (diff)
gui 引擎已知问题优化修复;
Diffstat (limited to 'components/gui/include')
-rw-r--r--components/gui/include/rtgui/event.h8
-rw-r--r--components/gui/include/rtgui/rtgui_app.h5
-rw-r--r--components/gui/include/rtgui/widgets/window.h17
3 files changed, 22 insertions, 8 deletions
diff --git a/components/gui/include/rtgui/event.h b/components/gui/include/rtgui/event.h
index 1113da10ad..78f269a239 100644
--- a/components/gui/include/rtgui/event.h
+++ b/components/gui/include/rtgui/event.h
@@ -329,7 +329,7 @@ enum rtgui_gesture_type
RTGUI_GESTURE_PINCH = 0x0002,
RTGUI_GESTURE_DRAG = 0x0004,
RTGUI_GESTURE_LONGPRESS = 0x0008,
- RTGUI_GESTURE_DRAGGED = 0x0001 | 0x0004 | 0x0008,
+ RTGUI_GESTURE_DRAGGED = 0x0001 | 0x0004 | 0x0008,
/* PINCH, DRAG finished. */
RTGUI_GESTURE_FINISH = 0x8000,
/* The corresponding gesture should be canceled. */
@@ -342,6 +342,8 @@ struct rtgui_event_gesture
_RTGUI_EVENT_WIN_ELEMENTS
enum rtgui_gesture_type type;
+
+ rt_uint32_t win_acti_cnt; /* win id */
};
/*
@@ -359,6 +361,8 @@ struct rtgui_event_mouse
/* id of touch session(from down to up). Different session should have
* different id. id should never be 0. */
rt_uint32_t id;
+
+ rt_uint32_t win_acti_cnt; /* win id */
};
#define RTGUI_MOUSE_BUTTON_LEFT 0x01
#define RTGUI_MOUSE_BUTTON_RIGHT 0x02
@@ -379,6 +383,8 @@ struct rtgui_event_kbd
{
_RTGUI_EVENT_WIN_ELEMENTS
+ rt_uint32_t win_acti_cnt; /* win id */
+
rt_uint16_t type; /* key down or up */
rt_uint16_t key; /* current key */
rt_uint16_t mod; /* current key modifiers */
diff --git a/components/gui/include/rtgui/rtgui_app.h b/components/gui/include/rtgui/rtgui_app.h
index 5cb2c83acc..8d17c9a21d 100644
--- a/components/gui/include/rtgui/rtgui_app.h
+++ b/components/gui/include/rtgui/rtgui_app.h
@@ -81,6 +81,8 @@ struct rtgui_app
rtgui_idle_func_t on_idle;
unsigned int window_cnt;
+ /* window activate count */
+ unsigned int win_acti_cnt;
void *user_data;
};
@@ -115,6 +117,9 @@ rt_err_t rtgui_app_set_as_wm(struct rtgui_app *app);
void rtgui_app_set_main_win(struct rtgui_app *app, struct rtgui_win *win);
struct rtgui_win* rtgui_app_get_main_win(struct rtgui_app *app);
+/* get the topwin belong app window activate count */
+unsigned int rtgui_app_get_win_acti_cnt(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/components/gui/include/rtgui/widgets/window.h b/components/gui/include/rtgui/widgets/window.h
index d9a0d2447b..1ef59a3d44 100644
--- a/components/gui/include/rtgui/widgets/window.h
+++ b/components/gui/include/rtgui/widgets/window.h
@@ -54,6 +54,8 @@ DECLARE_CLASS_TYPE(win);
#define RTGUI_WIN_STYLE_ONBTM 0x0080 /* window is in the bottom layer */
#define RTGUI_WIN_STYLE_MAINWIN 0x0106 /* window is a main window */
+#define RTGUI_WIN_MAGIC 0xA5A55A5A /* win magic flag */
+
#define RTGUI_WIN_STYLE_DEFAULT (RTGUI_WIN_STYLE_CLOSEBOX | RTGUI_WIN_STYLE_MINIBOX)
#define WINTITLE_HEIGHT 20
@@ -88,8 +90,8 @@ struct rtgui_win
/* inherit from container */
rtgui_container_t parent;
- /* update count */
- rt_base_t update;
+ /* update count */
+ rt_base_t update;
/* drawing count */
rt_base_t drawing;
@@ -140,11 +142,12 @@ struct rtgui_win
/* Private data. */
rt_base_t (*_do_show)(struct rtgui_win *win);
-
- /* app ref_count */
- rt_uint16_t app_ref_count;
- /* win magic flag, magic value is 0xA5A55A5A */
- rt_uint32_t magic;
+
+ /* app ref_count */
+ rt_uint16_t app_ref_count;
+
+ /* win magic flag, magic value is 0xA5A55A5A */
+ rt_uint32_t magic;
};
rtgui_win_t *rtgui_win_create(struct rtgui_win *parent_window, const char *title,