diff --git a/components/rtgui/common/blit.c b/components/rtgui/common/blit.c index 655ed78ec3..39d0e32823 100644 --- a/components/rtgui/common/blit.c +++ b/components/rtgui/common/blit.c @@ -49,7 +49,6 @@ static void rtgui_blit_line_1_2(rt_uint8_t* dst_ptr, rt_uint8_t* src_ptr, int li static void rtgui_blit_line_3_2(rt_uint8_t* dst_ptr, rt_uint8_t* src_ptr, int line) { rt_uint16_t* dst; - rt_uint32_t* src; dst = (rt_uint16_t*)dst_ptr; line = line / 3; @@ -299,7 +298,7 @@ static const rtgui_blit_line_func _blit_table[5][5] = {RT_NULL, rtgui_blit_line_1_4, rtgui_blit_line_2_4, rtgui_blit_line_3_4, rtgui_blit_line_direct }, }; -const rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp) +rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp) { RT_ASSERT(dst_bpp>0 && dst_bpp < 5); RT_ASSERT(src_bpp>0 && src_bpp < 5); diff --git a/components/rtgui/common/dc.c b/components/rtgui/common/dc.c index 08acafb872..6398e136ff 100644 --- a/components/rtgui/common/dc.c +++ b/components/rtgui/common/dc.c @@ -180,7 +180,8 @@ void rtgui_dc_draw_round_rect(struct rtgui_dc* dc, struct rtgui_rect* rect, int if(r == 0) { - return rtgui_dc_draw_rect(dc, rect); + rtgui_dc_draw_rect(dc, rect); + return; } if(((rect->x2 - rect->x1)/2 >= r)&&((rect->y2-rect->y1)/2 >= r)) @@ -981,7 +982,6 @@ void rtgui_dc_fill_sector(struct rtgui_dc *dc, rt_int16_t x, rt_int16_t y, rt_in { int start_x, start_y; int end_x, end_y; - float start_f; /* Sanity check radius */ if (r < 0) return ; diff --git a/components/rtgui/common/dc_buffer.c b/components/rtgui/common/dc_buffer.c index 7eec372733..730156e89c 100644 --- a/components/rtgui/common/dc_buffer.c +++ b/components/rtgui/common/dc_buffer.c @@ -216,7 +216,6 @@ static void rtgui_dc_buffer_fill_rect (struct rtgui_dc* self, struct rtgui_rect* static void rtgui_dc_buffer_blit(struct rtgui_dc* self, struct rtgui_point* dc_point, struct rtgui_dc* dest, rtgui_rect_t* rect) { struct rtgui_dc_buffer* dc = (struct rtgui_dc_buffer*)self; - struct rtgui_dc* hw = dest; if (dc_point == RT_NULL) dc_point = &rtgui_empty_point; if (rtgui_dc_get_visible(dest) == RT_FALSE) return; diff --git a/components/rtgui/include/rtgui/blit.h b/components/rtgui/include/rtgui/blit.h index 8be0b21949..615e5b6d7e 100644 --- a/components/rtgui/include/rtgui/blit.h +++ b/components/rtgui/include/rtgui/blit.h @@ -4,6 +4,6 @@ #include typedef void (*rtgui_blit_line_func)(rt_uint8_t* dst, rt_uint8_t* src, int line); -const rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp); +rtgui_blit_line_func rtgui_blit_line_get(int dst_bpp, int src_bpp); #endif diff --git a/components/rtgui/include/rtgui/rtgui_system.h b/components/rtgui/include/rtgui/rtgui_system.h index ef2bd5da84..4b963a3529 100644 --- a/components/rtgui/include/rtgui/rtgui_system.h +++ b/components/rtgui/include/rtgui/rtgui_system.h @@ -70,7 +70,7 @@ void rtgui_timer_stop (rtgui_timer_t* timer); rtgui_thread_t* rtgui_thread_register(rt_thread_t tid, rt_mq_t mq); void rtgui_thread_deregister(rt_thread_t tid); void rtgui_thread_set_onidle(rtgui_idle_func onidle); -rtgui_idle_func rtgui_thread_get_onidle(); +rtgui_idle_func rtgui_thread_get_onidle(void); rtgui_thread_t* rtgui_thread_self(void); rt_thread_t rtgui_thread_get_server(void); diff --git a/components/rtgui/include/rtgui/rtgui_theme.h b/components/rtgui/include/rtgui/rtgui_theme.h index 1bbcfcdb04..27f09d0079 100644 --- a/components/rtgui/include/rtgui/rtgui_theme.h +++ b/components/rtgui/include/rtgui/rtgui_theme.h @@ -1,66 +1,67 @@ -/* - * File : rtgui_theme.h - * This file is part of RTGUI in 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-04 Bernard first version - */ -#ifndef __RTGUI_THEME_H__ -#define __RTGUI_THEME_H__ - -#include -#include - -#define CHECK_BOX_W 13 -#define CHECK_BOX_H 13 - -#define RADIO_BOX_W 12 -#define RADIO_BOX_H 12 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void rtgui_system_theme_init(void); - -void rtgui_theme_draw_win(struct rtgui_topwin* win); -void rtgui_theme_draw_button(rtgui_button_t* btn); -void rtgui_theme_draw_label(rtgui_label_t* label); -void rtgui_theme_draw_textbox(rtgui_textbox_t* box); -void rtgui_theme_draw_iconbox(rtgui_iconbox_t* iconbox); -void rtgui_theme_draw_checkbox(rtgui_checkbox_t* checkbox); +/* + * File : rtgui_theme.h + * This file is part of RTGUI in 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-04 Bernard first version + */ +#ifndef __RTGUI_THEME_H__ +#define __RTGUI_THEME_H__ + +#include +#include + +#define CHECK_BOX_W 13 +#define CHECK_BOX_H 13 + +#define RADIO_BOX_W 12 +#define RADIO_BOX_H 12 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void rtgui_system_theme_init(void); + +void rtgui_theme_draw_win(struct rtgui_topwin* win); +void rtgui_theme_draw_button(rtgui_button_t* btn); +void rtgui_theme_draw_label(rtgui_label_t* label); +void rtgui_theme_draw_textbox(rtgui_textbox_t* box); +void rtgui_theme_draw_iconbox(rtgui_iconbox_t* iconbox); +void rtgui_theme_draw_checkbox(rtgui_checkbox_t* checkbox); void rtgui_theme_draw_radiobutton(struct rtgui_radiobox* radiobox, rt_uint16_t item); -void rtgui_theme_draw_radiobox(struct rtgui_radiobox* radiobox); -void rtgui_theme_draw_slider(struct rtgui_slider* slider); -void rtgui_theme_draw_scrollbar(struct rtgui_scrollbar* bar); -void rtgui_theme_draw_progressbar(struct rtgui_progressbar* bar); -void rtgui_theme_draw_staticline(struct rtgui_staticline* staticline); - -rt_uint16_t rtgui_theme_get_selected_height(void); -void rtgui_theme_draw_selected(struct rtgui_dc* dc, rtgui_rect_t *rect); - -rtgui_color_t rtgui_theme_default_bc(void); -rtgui_color_t rtgui_theme_default_fc(void); - -#ifdef __cplusplus -} -#endif - -#endif + +void rtgui_theme_draw_radiobox(struct rtgui_radiobox* radiobox); +void rtgui_theme_draw_slider(struct rtgui_slider* slider); +void rtgui_theme_draw_scrollbar(struct rtgui_scrollbar* bar); +void rtgui_theme_draw_progressbar(struct rtgui_progressbar* bar); +void rtgui_theme_draw_staticline(struct rtgui_staticline* staticline); + +rt_uint16_t rtgui_theme_get_selected_height(void); +void rtgui_theme_draw_selected(struct rtgui_dc* dc, rtgui_rect_t *rect); + +rtgui_color_t rtgui_theme_default_bc(void); +rtgui_color_t rtgui_theme_default_fc(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/components/rtgui/widgets/scrollbar.c b/components/rtgui/widgets/scrollbar.c index df585193dd..9cb4bfd73b 100644 --- a/components/rtgui/widgets/scrollbar.c +++ b/components/rtgui/widgets/scrollbar.c @@ -12,6 +12,7 @@ * 2010-08-09 Bernard first version */ #include +#include #include static void _rtgui_scrollbar_constructor(rtgui_scrollbar_t *bar) @@ -103,7 +104,7 @@ rtgui_type_t *rtgui_scrollbar_type_get(void) static void _rtgui_scrollbar_on_mouseclick(struct rtgui_widget * widget, struct rtgui_event * event) { - rtgui_rect_t rect, btn_rect, bar_rect; + rtgui_rect_t btn_rect, bar_rect; rt_uint32_t thumb_size, thumb_position; struct rtgui_scrollbar* bar = (struct rtgui_scrollbar*)widget; struct rtgui_event_mouse* mouse = (struct rtgui_event_mouse*)event;