fixed compiling error related to rtgui in mini2440 branch
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2155 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
070e54a17b
commit
07b910be8f
|
@ -16,6 +16,7 @@
|
||||||
/**
|
/**
|
||||||
* @addtogroup mini2440
|
* @addtogroup mini2440
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
@ -60,9 +61,9 @@ extern void rt_hw_touch_init(void);
|
||||||
static int argc = 1;
|
static int argc = 1;
|
||||||
static char* argv[] = {"ftk", NULL};
|
static char* argv[] = {"ftk", NULL};
|
||||||
|
|
||||||
void rt_ftk_thread_entry(void* parameter)
|
void rt_ftk_thread_entry(void *parameter)
|
||||||
{
|
{
|
||||||
int FTK_MAIN(int argc, char* argv[]);
|
int FTK_MAIN(int argc, char *argv[]);
|
||||||
|
|
||||||
FTK_MAIN(argc, argv);
|
FTK_MAIN(argc, argv);
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ void rt_ftk_thread_entry(void* parameter)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void rt_init_thread_entry(void* parameter)
|
void rt_init_thread_entry(void *parameter)
|
||||||
{
|
{
|
||||||
/* Filesystem Initialization */
|
/* Filesystem Initialization */
|
||||||
#ifdef RT_USING_DFS
|
#ifdef RT_USING_DFS
|
||||||
|
@ -129,7 +130,7 @@ void rt_init_thread_entry(void* parameter)
|
||||||
dfs_uffs_init();
|
dfs_uffs_init();
|
||||||
|
|
||||||
/* mount flash device as flash directory */
|
/* mount flash device as flash directory */
|
||||||
if(dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0)
|
if (dfs_mount("nand0", "/nand0", "uffs", 0, 0) == 0)
|
||||||
rt_kprintf("UFFS File System initialized!\n");
|
rt_kprintf("UFFS File System initialized!\n");
|
||||||
else
|
else
|
||||||
rt_kprintf("UFFS File System initialzation failed!\n");
|
rt_kprintf("UFFS File System initialzation failed!\n");
|
||||||
|
@ -159,8 +160,8 @@ void rt_init_thread_entry(void* parameter)
|
||||||
/* set lcd device as rtgui graphic driver */
|
/* set lcd device as rtgui graphic driver */
|
||||||
rtgui_graphic_set_device(lcd);
|
rtgui_graphic_set_device(lcd);
|
||||||
|
|
||||||
/* startup rtgui */
|
/* initalize rtgui system server */
|
||||||
rtgui_startup();
|
rtgui_system_server_init();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -204,15 +205,15 @@ void rt_init_thread_entry(void* parameter)
|
||||||
10 * 1024, 8, 20);
|
10 * 1024, 8, 20);
|
||||||
|
|
||||||
/* startup ftk thread */
|
/* startup ftk thread */
|
||||||
if(ftk_thread != RT_NULL)
|
if (ftk_thread != RT_NULL)
|
||||||
rt_thread_startup(ftk_thread);
|
rt_thread_startup(ftk_thread);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rt_led_thread_entry(void* parameter)
|
void rt_led_thread_entry(void *parameter)
|
||||||
{
|
{
|
||||||
while(1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* light on leds for one second */
|
/* light on leds for one second */
|
||||||
rt_hw_led_on(LED2|LED3);
|
rt_hw_led_on(LED2|LED3);
|
||||||
|
@ -226,7 +227,7 @@ void rt_led_thread_entry(void* parameter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int rt_application_init()
|
int rt_application_init(void)
|
||||||
{
|
{
|
||||||
rt_thread_t init_thread;
|
rt_thread_t init_thread;
|
||||||
rt_thread_t led_thread;
|
rt_thread_t led_thread;
|
||||||
|
@ -252,7 +253,7 @@ int rt_application_init()
|
||||||
if (init_thread != RT_NULL)
|
if (init_thread != RT_NULL)
|
||||||
rt_thread_startup(init_thread);
|
rt_thread_startup(init_thread);
|
||||||
|
|
||||||
if(led_thread != RT_NULL)
|
if (led_thread != RT_NULL)
|
||||||
rt_thread_startup(led_thread);
|
rt_thread_startup(led_thread);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include <rtgui/dc.h>
|
#include <rtgui/dc.h>
|
||||||
#include <rtgui/rtgui_system.h>
|
#include <rtgui/rtgui_system.h>
|
||||||
#include <rtgui/widgets/window.h>
|
#include <rtgui/widgets/window.h>
|
||||||
|
#include <rtgui/rtgui_application.h>
|
||||||
|
|
||||||
#include "touch.h"
|
#include "touch.h"
|
||||||
|
|
||||||
|
@ -107,7 +108,7 @@ static void calibration_data_post(rt_uint16_t x, rt_uint16_t y)
|
||||||
calibration_ptr->data.max_x,
|
calibration_ptr->data.max_x,
|
||||||
calibration_ptr->data.min_y,
|
calibration_ptr->data.min_y,
|
||||||
calibration_ptr->data.max_y);
|
calibration_ptr->data.max_y);
|
||||||
rtgui_thread_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
rtgui_application_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +121,7 @@ static void calibration_data_post(rt_uint16_t x, rt_uint16_t y)
|
||||||
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
RTGUI_EVENT_COMMAND_INIT(&ecmd);
|
||||||
ecmd.command_id = TOUCH_WIN_UPDATE;
|
ecmd.command_id = TOUCH_WIN_UPDATE;
|
||||||
|
|
||||||
rtgui_thread_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
rtgui_application_send(calibration_ptr->tid, &ecmd.parent, sizeof(struct rtgui_event_command));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -208,7 +209,7 @@ rt_bool_t calibration_event_handler(struct rtgui_widget* widget, struct rtgui_ev
|
||||||
return RT_TRUE;
|
return RT_TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rtgui_win_event_handler(widget, event);
|
rtgui_win_event_handler(RTGUI_OBJECT(widget), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RT_FALSE;
|
return RT_FALSE;
|
||||||
|
@ -216,14 +217,13 @@ rt_bool_t calibration_event_handler(struct rtgui_widget* widget, struct rtgui_ev
|
||||||
|
|
||||||
void calibration_entry(void* parameter)
|
void calibration_entry(void* parameter)
|
||||||
{
|
{
|
||||||
rt_mq_t mq;
|
struct rtgui_application *app;
|
||||||
rtgui_win_t* win;
|
rtgui_win_t* win;
|
||||||
struct rtgui_rect rect;
|
struct rtgui_rect rect;
|
||||||
|
|
||||||
mq = rt_mq_create("cali", 40, 8, RT_IPC_FLAG_FIFO);
|
app = rtgui_application_create(rt_thread_self(), "cali");
|
||||||
if (mq == RT_NULL) return;
|
if (app == RT_NULL)
|
||||||
|
return;
|
||||||
rtgui_thread_register(rt_thread_self(), mq);
|
|
||||||
|
|
||||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect);
|
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &rect);
|
||||||
|
|
||||||
|
@ -234,16 +234,21 @@ void calibration_entry(void* parameter)
|
||||||
/* create calibration window */
|
/* create calibration window */
|
||||||
win = rtgui_win_create(RT_NULL,
|
win = rtgui_win_create(RT_NULL,
|
||||||
"calibration", &rect, RTGUI_WIN_STYLE_NO_TITLE | RTGUI_WIN_STYLE_NO_BORDER);
|
"calibration", &rect, RTGUI_WIN_STYLE_NO_TITLE | RTGUI_WIN_STYLE_NO_BORDER);
|
||||||
rtgui_widget_set_event_handler(RTGUI_WIDGET(win), calibration_event_handler);
|
if (win == RT_NULL)
|
||||||
|
{
|
||||||
|
rtgui_application_destroy(app);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rtgui_win_set_onkey(win, calibration_event_handler);
|
||||||
if (win != RT_NULL)
|
if (win != RT_NULL)
|
||||||
{
|
{
|
||||||
rtgui_win_show(win, RT_FALSE);
|
rtgui_win_show(win, RT_FALSE);
|
||||||
// rtgui_widget_update(RTGUI_WIDGET(win));
|
rtgui_widget_update(RTGUI_WIDGET(win));
|
||||||
rtgui_win_event_loop(win);
|
rtgui_application_run(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
rtgui_thread_deregister(rt_thread_self());
|
rtgui_application_destroy(app);
|
||||||
rt_mq_delete(mq);
|
|
||||||
|
|
||||||
/* set calibration data */
|
/* set calibration data */
|
||||||
rt_device_control(calibration_ptr->device, RT_TOUCH_CALIBRATION_DATA, &calibration_ptr->data);
|
rt_device_control(calibration_ptr->device, RT_TOUCH_CALIBRATION_DATA, &calibration_ptr->data);
|
||||||
|
@ -256,7 +261,7 @@ void calibration_entry(void* parameter)
|
||||||
calibration_ptr = RT_NULL;
|
calibration_ptr = RT_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void calibration_init()
|
void calibration_init(void)
|
||||||
{
|
{
|
||||||
rt_device_t device;
|
rt_device_t device;
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,7 @@ static void rtgui_filelist_view_menu_pop(rtgui_widget_t *parent)
|
||||||
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &screen);
|
rtgui_graphic_driver_get_rect(rtgui_graphic_driver_get_default(), &screen);
|
||||||
rtgui_rect_moveto_align(&screen, &rect, RTGUI_ALIGN_CENTER_HORIZONTAL | RTGUI_ALIGN_CENTER_VERTICAL);
|
rtgui_rect_moveto_align(&screen, &rect, RTGUI_ALIGN_CENTER_HORIZONTAL | RTGUI_ALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
menu = rtgui_win_create(RTGUI_TOPLEVEL(rtgui_widget_get_toplevel(parent)),
|
menu = rtgui_win_create(rtgui_widget_get_toplevel(parent),
|
||||||
"Folder Menu", &rect, RTGUI_WIN_STYLE_DEFAULT);
|
"Folder Menu", &rect, RTGUI_WIN_STYLE_DEFAULT);
|
||||||
if (menu != RT_NULL)
|
if (menu != RT_NULL)
|
||||||
{
|
{
|
||||||
|
@ -319,7 +319,7 @@ static void _rtgui_filelist_view_constructor(struct rtgui_filelist_view *view)
|
||||||
struct rtgui_rect rect = {0, 0, 200, 200};
|
struct rtgui_rect rect = {0, 0, 200, 200};
|
||||||
|
|
||||||
/* set default widget rect and set event handler */
|
/* set default widget rect and set event handler */
|
||||||
rtgui_object_set_event_handler(RTGUI_WIDGET(view), rtgui_filelist_view_event_handler);
|
rtgui_object_set_event_handler(RTGUI_OBJECT(view), rtgui_filelist_view_event_handler);
|
||||||
rtgui_widget_set_rect(RTGUI_WIDGET(view), &rect);
|
rtgui_widget_set_rect(RTGUI_WIDGET(view), &rect);
|
||||||
|
|
||||||
RTGUI_WIDGET(view)->flag |= RTGUI_WIDGET_FLAG_FOCUSABLE;
|
RTGUI_WIDGET(view)->flag |= RTGUI_WIDGET_FLAG_FOCUSABLE;
|
||||||
|
@ -650,7 +650,7 @@ rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use view event handler */
|
/* use view event handler */
|
||||||
return rtgui_container_event_handler(widget, event);
|
return rtgui_container_event_handler(RTGUI_OBJECT(widget), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
rtgui_filelist_view_t* rtgui_filelist_view_create(const char* directory,
|
rtgui_filelist_view_t* rtgui_filelist_view_create(const char* directory,
|
||||||
|
|
17
src/rtm.c
17
src/rtm.c
|
@ -228,8 +228,6 @@ RTM_EXPORT(stat);
|
||||||
#include <rtgui/dc.h>
|
#include <rtgui/dc.h>
|
||||||
#include <rtgui/rtgui_server.h>
|
#include <rtgui/rtgui_server.h>
|
||||||
#include <rtgui/rtgui_system.h>
|
#include <rtgui/rtgui_system.h>
|
||||||
#include <rtgui/widgets/view.h>
|
|
||||||
#include <rtgui/widgets/workbench.h>
|
|
||||||
#include <rtgui/widgets/widget.h>
|
#include <rtgui/widgets/widget.h>
|
||||||
#include <rtgui/widgets/button.h>
|
#include <rtgui/widgets/button.h>
|
||||||
#include <rtgui/widgets/label.h>
|
#include <rtgui/widgets/label.h>
|
||||||
|
@ -238,34 +236,19 @@ RTM_EXPORT(stat);
|
||||||
#include <rtgui/widgets/filelist_view.h>
|
#include <rtgui/widgets/filelist_view.h>
|
||||||
|
|
||||||
RTM_EXPORT(rtgui_label_create);
|
RTM_EXPORT(rtgui_label_create);
|
||||||
RTM_EXPORT(rtgui_view_show);
|
|
||||||
RTM_EXPORT(rtgui_view_create);
|
|
||||||
RTM_EXPORT(rtgui_view_destroy);
|
|
||||||
RTM_EXPORT(rtgui_view_event_handler);
|
|
||||||
RTM_EXPORT(rtgui_dc_draw_text);
|
RTM_EXPORT(rtgui_dc_draw_text);
|
||||||
RTM_EXPORT(rtgui_dc_begin_drawing);
|
RTM_EXPORT(rtgui_dc_begin_drawing);
|
||||||
RTM_EXPORT(rtgui_dc_end_drawing);
|
RTM_EXPORT(rtgui_dc_end_drawing);
|
||||||
RTM_EXPORT(rtgui_workbench_event_loop);
|
|
||||||
RTM_EXPORT(rtgui_workbench_event_handler);
|
|
||||||
RTM_EXPORT(rtgui_workbench_add_view);
|
|
||||||
RTM_EXPORT(rtgui_workbench_create);
|
|
||||||
RTM_EXPORT(rtgui_workbench_destroy);
|
|
||||||
RTM_EXPORT(rtgui_workbench_close);
|
|
||||||
RTM_EXPORT(rtgui_timer_start);
|
RTM_EXPORT(rtgui_timer_start);
|
||||||
RTM_EXPORT(rtgui_timer_create);
|
RTM_EXPORT(rtgui_timer_create);
|
||||||
RTM_EXPORT(rtgui_timer_destory);
|
RTM_EXPORT(rtgui_timer_destory);
|
||||||
RTM_EXPORT(rtgui_timer_stop);
|
RTM_EXPORT(rtgui_timer_stop);
|
||||||
RTM_EXPORT(rtgui_thread_register);
|
|
||||||
RTM_EXPORT(rtgui_thread_deregister);
|
|
||||||
RTM_EXPORT(rtgui_widget_focus);
|
RTM_EXPORT(rtgui_widget_focus);
|
||||||
RTM_EXPORT(rtgui_widget_set_event_handler);
|
|
||||||
RTM_EXPORT(rtgui_widget_rect_to_device);
|
RTM_EXPORT(rtgui_widget_rect_to_device);
|
||||||
RTM_EXPORT(rtgui_widget_update);
|
RTM_EXPORT(rtgui_widget_update);
|
||||||
RTM_EXPORT(rtgui_widget_get_rect);
|
RTM_EXPORT(rtgui_widget_get_rect);
|
||||||
RTM_EXPORT(rtgui_widget_set_rect);
|
RTM_EXPORT(rtgui_widget_set_rect);
|
||||||
RTM_EXPORT(rtgui_widget_get_toplevel);
|
RTM_EXPORT(rtgui_widget_get_toplevel);
|
||||||
RTM_EXPORT(rtgui_panel_register);
|
|
||||||
RTM_EXPORT(rtgui_panel_set_default_focused);
|
|
||||||
RTM_EXPORT(rtgui_button_create);
|
RTM_EXPORT(rtgui_button_create);
|
||||||
RTM_EXPORT(rtgui_button_destroy);
|
RTM_EXPORT(rtgui_button_destroy);
|
||||||
RTM_EXPORT(rtgui_button_set_onbutton);
|
RTM_EXPORT(rtgui_button_set_onbutton);
|
||||||
|
|
Loading…
Reference in New Issue