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:
bernard.xiong
2010-05-08 15:50:45 +00:00
parent cfe7e91b95
commit e7fb7e6c14
14 changed files with 372 additions and 29 deletions
@@ -0,0 +1,34 @@
#ifndef __RTGUI_XML_H__
#define __RTGUI_XML_H__
#include <rtgui/rtgui.h>
/* Types of events: start element, end element, text, attr name, attr
val and start/end document. Other events can be ignored! */
enum {
EVENT_START = 0, /* Start tag */
EVENT_END, /* End tag */
EVENT_TEXT, /* Text */
EVENT_NAME, /* Attribute name */
EVENT_VAL, /* Attribute value */
EVENT_END_DOC, /* End of document */
EVENT_COPY, /* Internal only; copies to internal buffer */
EVENT_NONE /* Internal only; should never see this event */
};
/* xml structure typedef */
typedef struct rtgui_xml rtgui_xml_t;
typedef int (*rtgui_xml_event_handler_t)(rt_uint8_t event, const char* text, rt_size_t len, void* user);
/* create a xml parser context */
rtgui_xml_t* rtgui_xml_create(rt_size_t buffer_size, rtgui_xml_event_handler_t handler, void* user);
/* destroy a xml parser context */
void rtgui_xml_destroy(rtgui_xml_t* rtgui_xml);
/* parse xml buffer */
int rtgui_xml_parse(rtgui_xml_t* rtgui_xml, const char* buf, rt_size_t len);
/* event string */
const char* rtgui_xml_event_str(rt_uint8_t event);
#endif
@@ -90,7 +90,6 @@ struct rtgui_widget
/* the rect clip */
rtgui_region_t clip;
rt_uint16_t clip_sync;
/* the event handler */
rt_bool_t (*event_handler) (struct rtgui_widget* widget, struct rtgui_event* event);
@@ -10,6 +10,7 @@
* Change Logs:
* Date Author Notes
* 2009-10-04 Bernard first version
* 2010-05-03 Bernard add win close function
*/
#ifndef __RTGUI_WINDOW_H__
#define __RTGUI_WINDOW_H__
@@ -74,6 +75,7 @@ rtgui_type_t *rtgui_win_type_get(void);
rtgui_win_t* rtgui_win_create(rtgui_toplevel_t* parent_toplevel, const char* title,
rtgui_rect_t *rect, rt_uint8_t flag);
void rtgui_win_destroy(rtgui_win_t* win);
void rtgui_win_close(struct rtgui_win* win);
rtgui_modal_code_t rtgui_win_show(rtgui_win_t* win, rt_bool_t is_modal);
void rtgui_win_hiden(rtgui_win_t* win);