diff --git a/components/rtgui/common/image.c b/components/rtgui/common/image.c index 85fc6485f945c9ea81bac11eff2462e03b3842c3..7393856300d45989f83ba12296bceadbd3c9fb07 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 5c63747f13d1198526bb0ebf47016cf8490d7213..e0a68592466cac39c29ec52a9dce99b3eebc5e26 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 cb6fa8c3730f28e3d7b28fde0171cbcc2afb2dcf..415cfd05c84a728bef031887da200b064a11fe56 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 105b9f35544c3c26fed602f8c7dd64a4dc2a1e89..0249f31c3e5bf6ae92c00e282fe38cf4916c0ae7 100644 --- a/components/rtgui/include/rtgui/widgets/filelist_view.h +++ b/components/rtgui/include/rtgui/widgets/filelist_view.h @@ -3,6 +3,7 @@ #include +#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 1a8108b196a241a6f9c25620d07b51a13bfa82af..9edceac898bfa580eb1a7b5af299a2603bf9a437 100644 --- a/components/rtgui/widgets/filelist_view.c +++ b/components/rtgui/widgets/filelist_view.c @@ -24,6 +24,7 @@ #include #include +#if defined(RTGUI_USING_DFS_FILERW) || defined(RTGUI_USING_STDIO_FILERW) #ifdef _WIN32 #include #include @@ -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