diff options
| author | bernard.xiong <[email protected]> | 2010-01-26 09:38:38 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-01-26 09:38:38 +0000 |
| commit | 4c70ff59d335f332e9afc47705dce0173cc2a111 (patch) | |
| tree | 6779f0e86f886076c1872fee3ecb37edb3634869 /rtgui/include | |
| parent | 43082e9e546b054362651d0b13445a500e677c8b (diff) | |
update more GUI examples.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@339 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'rtgui/include')
| -rw-r--r-- | rtgui/include/rtgui/widgets/about_view.h | 45 | ||||
| -rw-r--r-- | rtgui/include/rtgui/widgets/filelist_view.h | 56 | ||||
| -rw-r--r-- | rtgui/include/rtgui/widgets/list_view.h | 66 |
3 files changed, 167 insertions, 0 deletions
diff --git a/rtgui/include/rtgui/widgets/about_view.h b/rtgui/include/rtgui/widgets/about_view.h new file mode 100644 index 0000000000..52f6ca23a0 --- /dev/null +++ b/rtgui/include/rtgui/widgets/about_view.h @@ -0,0 +1,45 @@ +/*
+ * File : list_view.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2010, 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
+ * 2010-01-06 Bernard first version
+ */
+
+#ifndef __RTGUI_ABOUT_VIEW_H__
+#define __RTGUI_ABOUT_VIEW_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/image.h>
+#include <rtgui/rtgui_system.h>
+#include <rtgui/widgets/view.h>
+
+/** Gets the type of a about view */
+#define RTGUI_ABOUT_VIEW_TYPE (rtgui_about_view_type_get())
+/** Casts the object to a about view */
+#define RTGUI_ABOUT_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_ABOUT_VIEW_TYPE, rtgui_about_view_t))
+/** Checks if the object is a about view */
+#define RTGUI_IS_ABOUT_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_ABOUT_VIEW_TYPE))
+
+struct rtgui_about_view
+{
+ struct rtgui_view parent;
+
+ /* widget private data */
+ rtgui_image_t* logo;
+ const char* description;
+};
+typedef struct rtgui_about_view rtgui_about_view_t;
+
+rtgui_type_t *rtgui_about_view_type_get(void);
+
+rtgui_about_view_t* rtgui_about_view_create(rtgui_image_t *logo, const char* description);
+rt_bool_t rtgui_about_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
+
+#endif
diff --git a/rtgui/include/rtgui/widgets/filelist_view.h b/rtgui/include/rtgui/widgets/filelist_view.h new file mode 100644 index 0000000000..c34b1e2032 --- /dev/null +++ b/rtgui/include/rtgui/widgets/filelist_view.h @@ -0,0 +1,56 @@ +#ifndef __RTGUI_FILELIST_VIEW_H__
+#define __RTGUI_FILELIST_VIEW_H__
+
+#include <rtgui/widgets/view.h>
+
+#define RTGUI_FITEM_FILE 0x0
+#define RTGUI_FITEM_DIR 0x1
+struct rtgui_file_item
+{
+ rt_uint8_t* name;
+
+ rt_uint32_t type;
+ rt_uint32_t size;
+};
+
+/** Gets the type of a filelist view */
+#define RTGUI_FILELIST_VIEW_TYPE (rtgui_filelist_view_type_get())
+/** Casts the object to a filelist */
+#define RTGUI_FILELIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_FILELIST_VIEW_TYPE, rtgui_filelist_view_t))
+/** Checks if the object is a filelist view */
+#define RTGUI_IS_FILELIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_FILELIST_VIEW_TYPE))
+
+struct rtgui_filelist_view
+{
+ struct rtgui_view parent;
+
+ /* widget private data */
+
+ /* current directory */
+ rt_uint8_t* current_directory;
+ rt_uint8_t* pattern;
+
+ /* the number of item in a page */
+ rt_uint16_t page_items;
+ rt_uint16_t items_count;
+
+ /* the selected item */
+ rt_uint16_t current_item;
+
+ /* items array */
+ struct rtgui_file_item *items;
+};
+typedef struct rtgui_filelist_view rtgui_filelist_view_t;
+
+rtgui_type_t *rtgui_filelist_view_type_get(void);
+
+rtgui_filelist_view_t* rtgui_filelist_view_create(rtgui_workbench_t* workbench,
+ const char* directory, const char* pattern, const rtgui_rect_t* rect);
+void rtgui_filelist_view_destroy(rtgui_filelist_view_t* view);
+
+void rtgui_filelist_view_clear(rtgui_filelist_view_t* view);
+
+rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
+void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory);
+
+#endif
diff --git a/rtgui/include/rtgui/widgets/list_view.h b/rtgui/include/rtgui/widgets/list_view.h new file mode 100644 index 0000000000..69463eb98b --- /dev/null +++ b/rtgui/include/rtgui/widgets/list_view.h @@ -0,0 +1,66 @@ +/*
+ * File : list_view.h
+ * This file is part of RTGUI in RT-Thread RTOS
+ * COPYRIGHT (C) 2010, 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
+ * 2010-01-06 Bernard first version
+ */
+
+#ifndef __RTGUI_LIST_VIEW_H__
+#define __RTGUI_LIST_VIEW_H__
+
+#include <rtgui/rtgui.h>
+#include <rtgui/image.h>
+#include <rtgui/rtgui_system.h>
+
+#include <rtgui/widgets/view.h>
+
+typedef void (*item_action)(void* parameter);
+struct rtgui_list_item
+{
+ char* name;
+ rtgui_image_t *image;
+
+ item_action action;
+ void *parameter;
+};
+
+/** Gets the type of a list view */
+#define RTGUI_LIST_VIEW_TYPE (rtgui_list_view_type_get())
+/** Casts the object to a filelist */
+#define RTGUI_LIST_VIEW(obj) (RTGUI_OBJECT_CAST((obj), RTGUI_LIST_VIEW_TYPE, rtgui_list_view_t))
+/** Checks if the object is a filelist view */
+#define RTGUI_IS_LIST_VIEW(obj) (RTGUI_OBJECT_CHECK_TYPE((obj), RTGUI_LIST_VIEW_TYPE))
+
+struct rtgui_list_view
+{
+ struct rtgui_view parent;
+
+ /* widget private data */
+ /* list item */
+ struct rtgui_list_item* items;
+
+ /* total number of items */
+ rt_uint16_t items_count;
+ /* the number of item in a page */
+ rt_uint16_t page_items;
+ /* current item */
+ rt_uint16_t current_item;
+};
+typedef struct rtgui_list_view rtgui_list_view_t;
+
+rtgui_type_t *rtgui_list_view_type_get(void);
+
+rtgui_list_view_t* rtgui_list_view_create(struct rtgui_list_item* items, rt_uint16_t count,
+ rtgui_rect_t *rect);
+void rtgui_list_view_clear(rtgui_list_view_t* view);
+
+rt_bool_t rtgui_list_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
+
+#endif
|
