提交 445da145 编写于 作者: B bernard.xiong

fix compiling error if there is no DFS file system.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@818 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 b9fcbfc3
...@@ -68,6 +68,7 @@ static struct rtgui_image_engine* rtgui_image_get_engine(const char* type) ...@@ -68,6 +68,7 @@ static struct rtgui_image_engine* rtgui_image_get_engine(const char* type)
return RT_NULL; return RT_NULL;
} }
#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* filename, rt_bool_t load) struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* filename, rt_bool_t load)
{ {
struct rtgui_filerw* filerw; struct rtgui_filerw* filerw;
...@@ -114,6 +115,7 @@ struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* f ...@@ -114,6 +115,7 @@ struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* f
return image; return image;
} }
#endif
struct rtgui_image* rtgui_image_create_from_mem(const char* type, const rt_uint8_t* data, rt_size_t length, rt_bool_t load) struct rtgui_image* rtgui_image_create_from_mem(const char* type, const rt_uint8_t* data, rt_size_t length, rt_bool_t load)
{ {
......
...@@ -49,7 +49,9 @@ typedef struct rtgui_image rtgui_image_t; ...@@ -49,7 +49,9 @@ typedef struct rtgui_image rtgui_image_t;
/* init rtgui image system */ /* init rtgui image system */
void rtgui_system_image_init(void); void rtgui_system_image_init(void);
#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* filename, rt_bool_t load); struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* filename, rt_bool_t load);
#endif
struct rtgui_image* rtgui_image_create_from_mem(const char* type, const rt_uint8_t* data, rt_size_t length, rt_bool_t load); struct rtgui_image* rtgui_image_create_from_mem(const char* type, const rt_uint8_t* data, rt_size_t length, rt_bool_t load);
void rtgui_image_destroy(struct rtgui_image* image); void rtgui_image_destroy(struct rtgui_image* image);
......
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
#define RTGUI_USING_HZ_BMP #define RTGUI_USING_HZ_BMP
#define RTGUI_MEM_TRACE #define RTGUI_MEM_TRACE
#define RTGUI_USING_WINMOVE #define RTGUI_USING_WINMOVE
#else
/* native running under RT-Thread */
#ifndef RT_USING_DFS
#undef RTGUI_USING_DFS_FILERW
#undef RTGUI_USING_HZ_FILE
#endif
#endif #endif
#if RTGUI_DEFAULT_FONT_SIZE == 0 #if RTGUI_DEFAULT_FONT_SIZE == 0
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <rtgui/widgets/view.h> #include <rtgui/widgets/view.h>
#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
#define RTGUI_FITEM_FILE 0x0 #define RTGUI_FITEM_FILE 0x0
#define RTGUI_FITEM_DIR 0x1 #define RTGUI_FITEM_DIR 0x1
struct rtgui_file_item struct rtgui_file_item
...@@ -52,5 +53,6 @@ rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct ...@@ -52,5 +53,6 @@ rt_bool_t rtgui_filelist_view_event_handler(struct rtgui_widget* widget, struct
void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory); void rtgui_filelist_view_set_directory(rtgui_filelist_view_t* view, const char* directory);
void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len); void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
#endif
#endif #endif
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <rtgui/widgets/listbox.h> #include <rtgui/widgets/listbox.h>
#include <rtgui/widgets/window.h> #include <rtgui/widgets/window.h>
#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
#ifdef _WIN32 #ifdef _WIN32
#include <io.h> #include <io.h>
#include <dirent.h> #include <dirent.h>
...@@ -835,3 +836,4 @@ void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, r ...@@ -835,3 +836,4 @@ void rtgui_filelist_view_get_fullpath(rtgui_filelist_view_t* view, char* path, r
rt_snprintf(path, len, "%s%s",view->current_directory, rt_snprintf(path, len, "%s%s",view->current_directory,
view->items[view->current_item].name); view->items[view->current_item].name);
} }
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册