summaryrefslogtreecommitdiff
path: root/components/rtgui
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-07-30 09:47:56 +0000
committerbernard.xiong <[email protected]>2010-07-30 09:47:56 +0000
commit445da145e267d3998965f2edccda04c2c08e0a66 (patch)
tree78c6527df54352c816649700ac99da7731c7668d /components/rtgui
parentb9fcbfc34489856a06554c0a3c453ad60e20cecd (diff)
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
Diffstat (limited to 'components/rtgui')
-rw-r--r--components/rtgui/common/image.c2
-rw-r--r--components/rtgui/include/rtgui/image.h2
-rw-r--r--components/rtgui/include/rtgui/rtgui_config.h6
-rw-r--r--components/rtgui/include/rtgui/widgets/filelist_view.h2
-rw-r--r--components/rtgui/widgets/filelist_view.c2
5 files changed, 14 insertions, 0 deletions
diff --git a/components/rtgui/common/image.c b/components/rtgui/common/image.c
index 85fc6485f9..7393856300 100644
--- a/components/rtgui/common/image.c
+++ b/components/rtgui/common/image.c
@@ -68,6 +68,7 @@ static struct rtgui_image_engine* rtgui_image_get_engine(const char* type)
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_filerw* filerw;
@@ -114,6 +115,7 @@ struct rtgui_image* rtgui_image_create_from_file(const char* type, const char* f
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)
{
diff --git a/components/rtgui/include/rtgui/image.h b/components/rtgui/include/rtgui/image.h
index 5c63747f13..e0a6859246 100644
--- a/components/rtgui/include/rtgui/image.h
+++ b/components/rtgui/include/rtgui/image.h
@@ -49,7 +49,9 @@ typedef struct rtgui_image rtgui_image_t;
/* init rtgui image system */
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);
+#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);
void rtgui_image_destroy(struct rtgui_image* image);
diff --git a/components/rtgui/include/rtgui/rtgui_config.h b/components/rtgui/include/rtgui/rtgui_config.h
index cb6fa8c373..415cfd05c8 100644
--- a/components/rtgui/include/rtgui/rtgui_config.h
+++ b/components/rtgui/include/rtgui/rtgui_config.h
@@ -39,6 +39,12 @@
#define RTGUI_USING_HZ_BMP
#define RTGUI_MEM_TRACE
#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
#if RTGUI_DEFAULT_FONT_SIZE == 0
diff --git a/components/rtgui/include/rtgui/widgets/filelist_view.h b/components/rtgui/include/rtgui/widgets/filelist_view.h
index 105b9f3554..0249f31c3e 100644
--- a/components/rtgui/include/rtgui/widgets/filelist_view.h
+++ b/components/rtgui/include/rtgui/widgets/filelist_view.h
@@ -3,6 +3,7 @@
#include <rtgui/widgets/view.h>
+#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
#define RTGUI_FITEM_FILE 0x0
#define RTGUI_FITEM_DIR 0x1
struct rtgui_file_item
@@ -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_get_fullpath(rtgui_filelist_view_t* view, char* path, rt_size_t len);
+#endif
#endif
diff --git a/components/rtgui/widgets/filelist_view.c b/components/rtgui/widgets/filelist_view.c
index 1a8108b196..9edceac898 100644
--- a/components/rtgui/widgets/filelist_view.c
+++ b/components/rtgui/widgets/filelist_view.c
@@ -24,6 +24,7 @@
#include <rtgui/widgets/listbox.h>
#include <rtgui/widgets/window.h>
+#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW)
#ifdef _WIN32
#include <io.h>
#include <dirent.h>
@@ -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,
view->items[view->current_item].name);
}
+#endif