cleanup function declaration.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@465 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
5e82a9a022
commit
86f3868852
|
@ -27,10 +27,12 @@ typedef struct rtgui_checkbox rtgui_checkbox_t;
|
|||
|
||||
rtgui_type_t *rtgui_checkbox_type_get(void);
|
||||
|
||||
rtgui_checkbox_t* rtgui_checkbox_create(unsigned char* text);
|
||||
rtgui_checkbox_t* rtgui_checkbox_create(unsigned char* text, rt_bool_t checked);
|
||||
void rtgui_checkbox_destroy(rtgui_checkbox_t* checkbox);
|
||||
|
||||
void rtgui_checkbox_ondraw(rtgui_checkbox_t* checkbox);
|
||||
void rtgui_checkbox_set_checked(rtgui_checkbox_t* checkbox, rt_bool_t checked);
|
||||
rt_bool_t rtgui_checkbox_get_checked(rtgui_checkbox_t* checkbox);
|
||||
|
||||
rt_bool_t rtgui_checkbox_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -48,8 +48,6 @@ 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);
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ rtgui_list_view_t* rtgui_list_view_create(const struct rtgui_list_item* items, r
|
|||
rtgui_rect_t *rect);
|
||||
void rtgui_list_view_destroy(rtgui_list_view_t* view);
|
||||
|
||||
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
|
||||
|
|
|
@ -42,3 +42,4 @@ rt_bool_t rtgui_radiobox_event_handler(struct rtgui_widget* widget, struct rtgui
|
|||
void rtgui_radiobox_set_orientation(struct rtgui_radiobox* radiobox, int orientation);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -61,7 +61,9 @@ struct rtgui_textbox
|
|||
};
|
||||
typedef struct rtgui_textbox rtgui_textbox_t;
|
||||
|
||||
struct rtgui_textbox* rtgui_textbox_create(const char* text);
|
||||
rtgui_type_t *rtgui_textbox_type_get(void);
|
||||
|
||||
struct rtgui_textbox* rtgui_textbox_create(const char* text, rt_uint8_t flag);
|
||||
void rtgui_textbox_destroy(struct rtgui_textbox* box);
|
||||
|
||||
rt_bool_t rtgui_textbox_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
|
||||
|
@ -69,6 +71,6 @@ rt_bool_t rtgui_textbox_event_handler(struct rtgui_widget* widget, struct rtgui_
|
|||
void rtgui_textbox_set_value(struct rtgui_textbox* box, const char* text);
|
||||
const char* rtgui_textbox_get_value(struct rtgui_textbox* box);
|
||||
|
||||
void rtgui_widget_set_line_length(struct rtgui_textbox* box, rt_size_t length);
|
||||
void rtgui_textbox_set_line_length(struct rtgui_textbox* box, rt_size_t length);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -49,7 +49,9 @@ void rtgui_view_destroy(rtgui_view_t* view);
|
|||
|
||||
rt_bool_t rtgui_view_event_handler(struct rtgui_widget* widget, struct rtgui_event* event);
|
||||
|
||||
#ifndef RTGUI_USING_SMALL_SIZE
|
||||
void rtgui_view_set_box(rtgui_view_t* view, rtgui_box_t* box);
|
||||
#endif
|
||||
|
||||
rtgui_modal_code_t rtgui_view_show(rtgui_view_t* view, rt_bool_t is_modal);
|
||||
void rtgui_view_hide(rtgui_view_t* view);
|
||||
|
|
|
@ -127,27 +127,11 @@ rtgui_type_t *rtgui_widget_type_get(void);
|
|||
rtgui_widget_t *rtgui_widget_create(rtgui_type_t *widget_type);
|
||||
void rtgui_widget_destroy(rtgui_widget_t* widget);
|
||||
|
||||
/* initial a widget */
|
||||
void rtgui_widget_init(rtgui_widget_t* widget, rtgui_type_t type, rtgui_rect_t* rect);
|
||||
/* detach a widget */
|
||||
void rtgui_widget_detach(rtgui_widget_t* widget);
|
||||
|
||||
/* update toplevel widget */
|
||||
void rtgui_widget_update_toplevel(rtgui_widget_t* widget);
|
||||
|
||||
/* set the event handler of widget */
|
||||
void rtgui_widget_set_event_handler(rtgui_widget_t* widget, rtgui_event_handler_ptr handler);
|
||||
/* widget default event handler */
|
||||
rt_bool_t rtgui_widget_event_handler(rtgui_widget_t* widget, rtgui_event_t* event);
|
||||
|
||||
/* dispatch event to child widget */
|
||||
rt_bool_t rtgui_widget_dispatch_event(rtgui_widget_t* widget, rtgui_event_t* event);
|
||||
rt_bool_t rtgui_widget_dispatch_mouse_event(rtgui_widget_t* widget, struct rtgui_event_mouse* event);
|
||||
|
||||
/* set and get widget label */
|
||||
char* rtgui_widget_get_label(rtgui_widget_t* widget);
|
||||
void rtgui_widget_set_label(rtgui_widget_t* widget, const char* label);
|
||||
|
||||
/* focus and unfocus */
|
||||
void rtgui_widget_focus(rtgui_widget_t * widget);
|
||||
void rtgui_widget_unfocus(rtgui_widget_t *widget);
|
||||
|
|
|
@ -85,7 +85,10 @@ void rtgui_win_move(struct rtgui_win* win, int x, int y);
|
|||
|
||||
/* reset extent of window */
|
||||
void rtgui_win_set_rect(rtgui_win_t* win, rtgui_rect_t* rect);
|
||||
|
||||
#ifndef RTGUI_USING_SMALL_SIZE
|
||||
void rtgui_win_set_box(rtgui_win_t* win, rtgui_box_t* box);
|
||||
#endif
|
||||
|
||||
void rtgui_win_set_onactivate(rtgui_win_t* win, rtgui_event_handler_ptr handler);
|
||||
void rtgui_win_set_ondeactivate(rtgui_win_t* win, rtgui_event_handler_ptr handler);
|
||||
|
|
|
@ -60,11 +60,11 @@ struct rtgui_workbench
|
|||
rtgui_view_t* current_view;
|
||||
};
|
||||
|
||||
rtgui_type_t* rtgui_workbench_type_get(void);
|
||||
|
||||
rtgui_workbench_t *rtgui_workbench_create(const char* panel_name, const unsigned char* title);
|
||||
void rtgui_workbench_destroy(rtgui_workbench_t* workbench);
|
||||
|
||||
rtgui_type_t* rtgui_workbench_type_get(void);
|
||||
|
||||
rt_bool_t rtgui_workbench_event_handler(rtgui_widget_t* widget, rtgui_event_t* event);
|
||||
|
||||
void rtgui_workbench_set_flag(rtgui_workbench_t* workbench, rt_uint8_t flag);
|
||||
|
|
|
@ -87,7 +87,7 @@ rt_bool_t rtgui_checkbox_event_handler(struct rtgui_widget* widget, struct rtgui
|
|||
return RT_FALSE;
|
||||
}
|
||||
|
||||
struct rtgui_checkbox* rtgui_checkbox_create(unsigned char* text)
|
||||
struct rtgui_checkbox* rtgui_checkbox_create(unsigned char* text, rt_bool_t checked)
|
||||
{
|
||||
struct rtgui_checkbox* box;
|
||||
|
||||
|
@ -103,6 +103,11 @@ struct rtgui_checkbox* rtgui_checkbox_create(unsigned char* text)
|
|||
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(box), &rect);
|
||||
rtgui_label_set_text(RTGUI_LABEL(box), text);
|
||||
|
||||
if (checked == RT_TRUE)
|
||||
box->status_down = RTGUI_CHECKBOX_STATUS_CHECKED;
|
||||
else
|
||||
box->status_down = RTGUI_CHECKBOX_STATUS_UNCHECKED;
|
||||
}
|
||||
|
||||
return box;
|
||||
|
@ -113,3 +118,23 @@ void rtgui_checkbox_destroy(rtgui_checkbox_t* box)
|
|||
rtgui_widget_destroy(RTGUI_WIDGET(box));
|
||||
}
|
||||
|
||||
void rtgui_checkbox_set_checked(rtgui_checkbox_t* checkbox, rt_bool_t checked)
|
||||
{
|
||||
RT_ASSERT(checkbox != RT_NULL);
|
||||
if (checked == RT_TRUE)
|
||||
checkbox->status_down = RTGUI_CHECKBOX_STATUS_CHECKED;
|
||||
else
|
||||
checkbox->status_down = RTGUI_CHECKBOX_STATUS_UNCHECKED;
|
||||
|
||||
}
|
||||
|
||||
rt_bool_t rtgui_checkbox_get_checked(rtgui_checkbox_t* checkbox)
|
||||
{
|
||||
RT_ASSERT(checkbox != RT_NULL);
|
||||
|
||||
if (checkbox->status_down == RTGUI_CHECKBOX_STATUS_CHECKED)
|
||||
return RT_TRUE;
|
||||
|
||||
return RT_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ const static char * folder_xpm[] = {
|
|||
|
||||
/* image for file and folder */
|
||||
static rtgui_image_t *file_image, *folder_image;
|
||||
static static void rtgui_filelist_view_clear(rtgui_filelist_view_t* view);
|
||||
|
||||
static void _rtgui_filelist_view_constructor(struct rtgui_filelist_view *view)
|
||||
{
|
||||
|
@ -591,7 +592,7 @@ void rtgui_filelist_view_destroy(rtgui_filelist_view_t* view)
|
|||
}
|
||||
|
||||
/* clear all file items */
|
||||
void rtgui_filelist_view_clear(rtgui_filelist_view_t* view)
|
||||
static void rtgui_filelist_view_clear(rtgui_filelist_view_t* view)
|
||||
{
|
||||
rt_uint32_t index;
|
||||
struct rtgui_file_item* item;
|
||||
|
|
|
@ -295,7 +295,7 @@ rt_bool_t rtgui_textbox_event_handler(struct rtgui_widget* widget, struct rtgui_
|
|||
return RT_FALSE;
|
||||
}
|
||||
|
||||
struct rtgui_textbox* rtgui_textbox_create(const char* text)
|
||||
struct rtgui_textbox* rtgui_textbox_create(const char* text, rt_uint8_t flag)
|
||||
{
|
||||
struct rtgui_textbox* box;
|
||||
|
||||
|
@ -306,6 +306,7 @@ struct rtgui_textbox* rtgui_textbox_create(const char* text)
|
|||
|
||||
/* allocate default line buffer */
|
||||
rtgui_textbox_set_value(box, text);
|
||||
box->flag = flag;
|
||||
|
||||
rtgui_font_get_metrics(RTGUI_WIDGET(box)->gc.font, "h", &rect);
|
||||
}
|
||||
|
@ -354,7 +355,7 @@ const char* rtgui_textbox_get_value(struct rtgui_textbox* box)
|
|||
return (const char*)box->text;
|
||||
}
|
||||
|
||||
void rtgui_widget_set_line_length(struct rtgui_textbox* box, rt_size_t length)
|
||||
void rtgui_textbox_set_line_length(struct rtgui_textbox* box, rt_size_t length)
|
||||
{
|
||||
rt_uint8_t* new_line;
|
||||
|
||||
|
|
|
@ -122,6 +122,7 @@ void rtgui_view_destroy(rtgui_view_t* view)
|
|||
rtgui_widget_destroy(RTGUI_WIDGET(view));
|
||||
}
|
||||
|
||||
#ifndef RTGUI_USING_SMALL_SIZE
|
||||
void rtgui_view_set_box(rtgui_view_t* view, rtgui_box_t* box)
|
||||
{
|
||||
if (view == RT_NULL ||
|
||||
|
@ -130,6 +131,7 @@ void rtgui_view_set_box(rtgui_view_t* view, rtgui_box_t* box)
|
|||
rtgui_container_add_child(RTGUI_CONTAINER(view), RTGUI_WIDGET(box));
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(box), &(RTGUI_WIDGET(view)->extent));
|
||||
}
|
||||
#endif
|
||||
|
||||
rtgui_modal_code_t rtgui_view_show(rtgui_view_t* view, rt_bool_t is_modal)
|
||||
{
|
||||
|
|
|
@ -568,6 +568,7 @@ void rtgui_win_set_rect(rtgui_win_t* win, rtgui_rect_t* rect)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef RTGUI_USING_SMALL_SIZE
|
||||
void rtgui_win_set_box(rtgui_win_t* win, rtgui_box_t* box)
|
||||
{
|
||||
if (win == RT_NULL || box == RT_NULL) return;
|
||||
|
@ -575,6 +576,7 @@ void rtgui_win_set_box(rtgui_win_t* win, rtgui_box_t* box)
|
|||
rtgui_container_add_child(RTGUI_CONTAINER(win), RTGUI_WIDGET(box));
|
||||
rtgui_widget_set_rect(RTGUI_WIDGET(box), &(RTGUI_WIDGET(win)->extent));
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtgui_win_set_onactivate(rtgui_win_t* win, rtgui_event_handler_ptr handler)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue