From 565ef43706c2b21676728fd3dd34d9a1278687b6 Mon Sep 17 00:00:00 2001 From: idea4good Date: Wed, 13 Dec 2017 22:29:28 +0800 Subject: [PATCH] support 16 bits, 32 bits color, framebuffer map; remove redundant files --- .gitignore | 14 +- CMakeLists.txt | 6 + GuiLite.sln | 58 +++++ core/CMakeLists.txt | 2 + core/core.vcxproj | 1 - core/core.vcxproj.filters | 3 - core/core_include/api.h | 10 +- core/core_include/display.h | 11 +- core/core_include/surface.h | 33 ++- core/core_include/wnd.h | 2 +- core/src/bitmap.cpp | 12 +- core/src/display.cpp | 89 ++++--- core/src/rgb.cpp | 19 -- core/src/surface.cpp | 399 +++++++++++++++++++++---------- core/src/wave_ctrl.cpp | 2 +- gui/CMakeLists.txt | 4 +- gui/core_include/api.h | 45 ---- gui/core_include/audio.h | 19 -- gui/core_include/bitmap.h | 21 -- gui/core_include/cmd_target.h | 81 ------- gui/core_include/display.h | 31 --- gui/core_include/msg.h | 46 ---- gui/core_include/rect.h | 37 --- gui/core_include/resource_type.h | 72 ------ gui/core_include/surface.h | 71 ------ gui/core_include/wave_buffer.h | 35 --- gui/core_include/wave_ctrl.h | 85 ------- gui/core_include/wnd.h | 168 ------------- gui/core_include/word.h | 44 ---- gui/gui.vcxproj | 33 ++- gui/gui.vcxproj.filters | 75 +++--- gui/gui_include/slide_group.h | 2 - gui/src/button.cpp | 16 +- gui/src/dialog.cpp | 19 +- gui/src/edit.cpp | 14 +- gui/src/gesture.cpp | 14 +- gui/src/keyboard.cpp | 14 +- gui/src/label.cpp | 16 +- gui/src/list_box.cpp | 16 +- gui/src/shape_resource.cpp | 6 +- gui/src/slide_group.cpp | 13 +- gui/src/spinbox.cpp | 14 +- gui/src/table.cpp | 14 +- 43 files changed, 590 insertions(+), 1096 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 GuiLite.sln delete mode 100644 core/src/rgb.cpp delete mode 100644 gui/core_include/api.h delete mode 100644 gui/core_include/audio.h delete mode 100644 gui/core_include/bitmap.h delete mode 100644 gui/core_include/cmd_target.h delete mode 100644 gui/core_include/display.h delete mode 100644 gui/core_include/msg.h delete mode 100644 gui/core_include/rect.h delete mode 100644 gui/core_include/resource_type.h delete mode 100644 gui/core_include/surface.h delete mode 100644 gui/core_include/wave_buffer.h delete mode 100644 gui/core_include/wave_ctrl.h delete mode 100644 gui/core_include/wnd.h delete mode 100644 gui/core_include/word.h diff --git a/.gitignore b/.gitignore index 517c86e..fcff337 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,15 @@ *.app # Visual studio -/core/Debug -/core/.vs/core/v15 +Debug +Release +.vs + +# cmake +CMakeCache.txt +CMakeFiles +cmake_install.cmake +Makefile + +libcore.a +libgui.a \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..56d0fac --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8) + +PROJECT(GuiLite) + +ADD_SUBDIRECTORY(core) +ADD_SUBDIRECTORY(gui) diff --git a/GuiLite.sln b/GuiLite.sln new file mode 100644 index 0000000..fd3f586 --- /dev/null +++ b/GuiLite.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.9 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core\core.vcxproj", "{8C80C76D-F437-4C69-BC94-252AC44171C2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gui", "gui\gui.vcxproj", "{89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + MinSizeRel|x64 = MinSizeRel|x64 + MinSizeRel|x86 = MinSizeRel|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + RelWithDebInfo|x64 = RelWithDebInfo|x64 + RelWithDebInfo|x86 = RelWithDebInfo|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x64.ActiveCfg = Debug|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x64.Build.0 = Debug|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x86.ActiveCfg = Debug|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Debug|x86.Build.0 = Debug|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.MinSizeRel|x64.ActiveCfg = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.MinSizeRel|x64.Build.0 = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.MinSizeRel|x86.ActiveCfg = Release|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.MinSizeRel|x86.Build.0 = Release|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x64.ActiveCfg = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x64.Build.0 = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x86.ActiveCfg = Release|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.Release|x86.Build.0 = Release|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.RelWithDebInfo|x64.ActiveCfg = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.RelWithDebInfo|x64.Build.0 = Release|x64 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 + {8C80C76D-F437-4C69-BC94-252AC44171C2}.RelWithDebInfo|x86.Build.0 = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Debug|x64.ActiveCfg = Debug|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Debug|x64.Build.0 = Debug|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Debug|x86.ActiveCfg = Debug|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Debug|x86.Build.0 = Debug|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.MinSizeRel|x64.ActiveCfg = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.MinSizeRel|x64.Build.0 = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.MinSizeRel|x86.ActiveCfg = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.MinSizeRel|x86.Build.0 = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Release|x64.ActiveCfg = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Release|x64.Build.0 = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Release|x86.ActiveCfg = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.Release|x86.Build.0 = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.RelWithDebInfo|x64.ActiveCfg = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.RelWithDebInfo|x64.Build.0 = Release|x64 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6}.RelWithDebInfo|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b804062..d2dc6dd 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8) PROJECT(Core) +SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/..) + ADD_DEFINITIONS(-fpermissive) INCLUDE_DIRECTORIES(core_include) diff --git a/core/core.vcxproj b/core/core.vcxproj index 6d54ec1..20976cb 100644 --- a/core/core.vcxproj +++ b/core/core.vcxproj @@ -150,7 +150,6 @@ - diff --git a/core/core.vcxproj.filters b/core/core.vcxproj.filters index 1200ffc..1f823b5 100644 --- a/core/core.vcxproj.filters +++ b/core/core.vcxproj.filters @@ -23,9 +23,6 @@ Source Files - - Source Files - Source Files diff --git a/core/core_include/api.h b/core/core_include/api.h index 541573f..e7e7262 100644 --- a/core/core_include/api.h +++ b/core/core_include/api.h @@ -15,10 +15,12 @@ void do_assert(const char* file, int line); void log_out(const char* log); -unsigned int GLT_RGB(unsigned char r, unsigned char g, unsigned char b); -unsigned char GLT_RGB_R(unsigned int color); -unsigned char GLT_RGB_G(unsigned int color); -unsigned char GLT_RGB_B(unsigned int color); +#define GLT_RGB(r, g, b) ((r << 16) | (g << 8) | b) +#define GLT_RGB_R(rgb) ((rgb >> 16) & 0xFF) +#define GLT_RGB_G(rgb) ((rgb >> 8) & 0xFF) +#define GLT_RGB_B(rgb) (rgb & 0xFF) +#define GLT_RGB_32_to_16(rgb) (((rgb & 0xFF) >> 3) | ((rgb & 0xFC00) >> 5) | ((rgb & 0xF80000) >> 8)) +#define GLT_RGB_16_to_32(rgb) (((rgb & 0x1F) << 3) | ((rgb & 0x7E0) << 5) | ((rgb & 0xF800) << 8)) typedef struct _T_TIME { diff --git a/core/core_include/display.h b/core/core_include/display.h index aa468f2..9cdd2f0 100644 --- a/core/core_include/display.h +++ b/core/core_include/display.h @@ -9,9 +9,11 @@ class c_surface; class c_display { public: - c_display(void* phy_fb, unsigned int width, unsigned int height, unsigned int slides_cnt); + c_display(void* phy_fb, unsigned int display_width, unsigned int display_height, + unsigned int surface_width, unsigned int surface_height, + unsigned int color_bytes, unsigned int slides_cnt); c_surface* create_surface(void* usr, Z_ORDER_LEVEL max_zorder); - int merge_surface(c_surface* s1, c_surface* s2, int x1, int x2, int y1, int y2, int offset); + int merge_surface(c_surface* s1, c_surface* s2, int x0, int x1, int y0, int y2, int offset); c_hid_pipe* get_hid_pipe() { return m_hid_pipe; } unsigned int get_width() { return m_width; } unsigned int get_height() { return m_height; } @@ -19,8 +21,9 @@ public: static void* get_frame_buffer(unsigned int display_id, int* width, int* height); static int snap_shot(unsigned int display_id); private: - unsigned int m_width; //in pixels - unsigned int m_height; //in pixels + unsigned int m_width; //in pixels + unsigned int m_height; //in pixels + unsigned int m_color_bytes; //16 bits, 32 bits only void* m_phy_fb; c_hid_pipe* m_hid_pipe; c_surface* m_surface_group[SURFACE_CNT_MAX]; diff --git a/core/core_include/surface.h b/core/core_include/surface.h index 461b0d3..b8fcdf7 100644 --- a/core/core_include/surface.h +++ b/core/core_include/surface.h @@ -32,15 +32,16 @@ class c_display; class c_surface { friend class c_display; public: - c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height); + virtual void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order); + virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); + virtual unsigned int get_pixel(int x, int y, unsigned int z_order); - void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order); - unsigned int get_pixel(int x, int y, unsigned int z_order); + int get_width() { return m_width; } + int get_height() { return m_height; } void draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order); void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order); void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); - void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order); int flush_scrren(int left, int top, int right, int bottom); @@ -50,14 +51,16 @@ public: int set_frame_layer(c_rect& rect, unsigned int z_order); void set_active(bool flag){m_is_active = flag;} -private: +protected: + virtual void set_pixel_on_fb(int x, int y, unsigned int rgb); + virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb); + void set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order); int copy_layer_pixel_2_fb(int x, int y, unsigned int z_order); - void do_quick_set_pixel(int x,int y,unsigned int rgb); - void do_quick_fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb); - - unsigned int m_width; //in pixels - unsigned int m_height; //in pixels + c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes); + int m_width; //in pixels + int m_height; //in pixels + int m_color_bytes; //16 bits, 32 bits only void* m_fb; struct FRAME_LAYER m_frame_layers[Z_ORDER_LEVEL_MAX]; void* m_usr; @@ -68,4 +71,14 @@ private: c_display* m_display; }; +class c_surface_16bits : public c_surface { + friend class c_display; + c_surface_16bits(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes) : + c_surface(display, phy_fb, width, height, color_bytes) {}; + virtual void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order); + virtual void set_pixel_on_fb(int x, int y, unsigned int rgb); + virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); + virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb); + virtual unsigned int get_pixel(int x, int y, unsigned int z_order); +}; #endif diff --git a/core/core_include/wnd.h b/core/core_include/wnd.h index 87813aa..3e4f38c 100644 --- a/core/core_include/wnd.h +++ b/core/core_include/wnd.h @@ -108,7 +108,7 @@ public: WND_STATUS get_status() { return m_status; } c_surface* get_surface() { return m_surface; } - void set_surface(c_surface* gal) { m_surface = gal; } + void set_surface(c_surface* surface) { m_surface = surface; } protected: virtual void pre_create_wnd(); virtual void display_window(); diff --git a/core/src/bitmap.cpp b/core/src/bitmap.cpp index eb4c911..eed6586 100644 --- a/core/src/bitmap.cpp +++ b/core/src/bitmap.cpp @@ -95,7 +95,8 @@ void c_bitmap::draw_bitmap_565(c_surface* surface, int z_order, int x, int y, in const unsigned short * p = pData; for (int i = 0; i < xsize; i++) { - surface->set_pixel(x + i, y + j, *p++, z_order); + unsigned int rgb = *p++; + surface->set_pixel(x + i, y + j, GLT_RGB_16_to_32(rgb), z_order); } pData += BytesPerLine; } @@ -113,8 +114,13 @@ void c_bitmap::draw_bitmap_565_inrect(c_surface* surface, int z_order, int x, in const unsigned short * p = pData; for (int i = 0; i < xsize; i++) { - if(i >= width)break; - surface->set_pixel(x + i, y + j, *p++, z_order); + if (i >= width) + { + break; + } + + unsigned int rgb = *p++; + surface->set_pixel(x + i, y + j, GLT_RGB_16_to_32(rgb), z_order); } pData += BytesPerLine; } diff --git a/core/src/display.cpp b/core/src/display.cpp index b8ecdea..ab5e89c 100644 --- a/core/src/display.cpp +++ b/core/src/display.cpp @@ -10,10 +10,19 @@ c_display* c_display::ms_displays[MAX_DISPLAY]; -c_display::c_display(void* phy_fb, unsigned int width, unsigned int height, unsigned int slides_cnt) +c_display::c_display(void* phy_fb, unsigned int display_width, unsigned int display_height, + unsigned int surface_width, unsigned int surface_height, + unsigned int color_bytes, unsigned int slides_cnt) { - m_width = width; - m_height = height; + if (color_bytes != 2 && color_bytes != 4) + { + log_out("Support 16 bits, 32 bits color only!"); + ASSERT(FALSE); + } + + m_width = display_width; + m_height = display_height; + m_color_bytes = color_bytes; m_phy_fb = phy_fb; m_hid_pipe = new c_hid_pipe(NULL); for (int i = 0; i < MAX_DISPLAY; i++) @@ -33,7 +42,8 @@ c_display::c_display(void* phy_fb, unsigned int width, unsigned int height, unsi memset(m_surface_group, 0, sizeof(m_surface_group)); for (int i = 0; i < m_surface_cnt; i++) { - m_surface_group[i] = new c_surface(this, m_phy_fb, width, height); + m_surface_group[i] = (color_bytes == 4) ? new c_surface(this, m_phy_fb, surface_width, surface_height, color_bytes) : + new c_surface_16bits(this, m_phy_fb, surface_width, surface_height, color_bytes); } } @@ -70,51 +80,39 @@ c_surface* c_display::create_surface(void* usr, Z_ORDER_LEVEL max_zorder) return NULL; } -int c_display::merge_surface(c_surface* s1, c_surface* s2, int x1, int x2, int y1, int y2, int offset) +int c_display::merge_surface(c_surface* s1, c_surface* s2, int x0, int x1, int y0, int y1, int offset) { - if (offset < 0 || offset >= m_width) - { - ASSERT(FALSE); - return -1; - } - if (y1 < 0 || y1 >= m_height) - { - ASSERT(FALSE); - return -1; - } - if (y2 < 0 || y2 >= m_height) - { - ASSERT(FALSE); - return -1; - } - if (x1 < 0 || x1 >= m_width) - { - ASSERT(FALSE); - return -1; - } - if (x2 < 0 || x2 >= m_width) + int surface_width = s1->get_width(); + int surface_height = s1->get_height(); + + if (offset < 0 || offset >= surface_width || y0 < 0 || y0 >= surface_height || + y1 < 0 || y1 >= surface_height || x0 < 0 || x0 >= surface_width || x1 < 0 || x1 >= surface_width) { ASSERT(FALSE); return -1; } - int width = (x2 - x1 + 1); - if (width < 0 || width >= m_width || width < offset) + int width = (x1 - x0 + 1); + if (width < 0 || width >= surface_width || width < offset) { ASSERT(FALSE); return -1; } - for (int y = y1; y <= y2; y++) + x0 = (x0 >= m_width) ? (m_width - 1) : x0; + x1 = (x1 >= m_width) ? (m_width - 1) : x1; + y0 = (y0 >= m_height) ? (m_height - 1) : y0; + y1 = (y1 >= m_height) ? (m_height - 1) : y1; + for (int y = y0; y <= y1; y++) { //Left surface - char* addr_s = ((char*)(s1->m_fb) + (y * m_width + x1 + offset) * 2); - char* addr_d = ((char*)(m_phy_fb) + (y * m_width + x1) * 2); - memcpy(addr_d, addr_s, (width - offset) * 2); + char* addr_s = ((char*)(s1->m_fb) + (y * (s1->get_width()) + x0 + offset) * m_color_bytes); + char* addr_d = ((char*)(m_phy_fb) + (y * m_width + x0) * m_color_bytes); + memcpy(addr_d, addr_s, (width - offset) * m_color_bytes); //Right surface - addr_s = ((char*)(s2->m_fb) + (y * m_width + x1) * 2); - addr_d = ((char*)(m_phy_fb) + (y * m_width + x1 + (width - offset)) * 2); - memcpy(addr_d, addr_s, offset * 2); + addr_s = ((char*)(s2->m_fb) + (y * (s2->get_width()) + x0) * m_color_bytes); + addr_d = ((char*)(m_phy_fb) + (y * m_width + x0 + (width - offset)) * m_color_bytes); + memcpy(addr_d, addr_s, offset * m_color_bytes); } return 0; } @@ -157,5 +155,24 @@ int c_display::snap_shot(unsigned int display_id) unsigned int width = ms_displays[display_id]->get_width(); unsigned int height = ms_displays[display_id]->get_height(); - return build_bmp(path, width, height, (unsigned char*)ms_displays[display_id]->m_phy_fb); + + //16 bits framebuffer + if (ms_displays[display_id]->m_color_bytes == 2) + { + return build_bmp(path, width, height, (unsigned char*)ms_displays[display_id]->m_phy_fb); + } + + //32 bits framebuffer + unsigned short* p_bmp565_data = new unsigned short[width * height]; + unsigned int* p_raw_data = (unsigned int*)ms_displays[display_id]->m_phy_fb; + + for (int i = 0; i < width * height; i++) + { + unsigned int rgb = *p_raw_data++; + p_bmp565_data[i] = GLT_RGB_32_to_16(rgb); + } + + int ret = build_bmp(path, width, height, (unsigned char*)p_bmp565_data); + delete []p_bmp565_data; + return ret; } \ No newline at end of file diff --git a/core/src/rgb.cpp b/core/src/rgb.cpp deleted file mode 100644 index edbc50a..0000000 --- a/core/src/rgb.cpp +++ /dev/null @@ -1,19 +0,0 @@ -unsigned int GLT_RGB(unsigned char r, unsigned char g, unsigned char b) -{ - return (((b >> 3) & 0x0000001F) | (((g >> 2) << 5) & 0x00007e0) | (((r >> 3) << 11) & 0xf800)); -} - -unsigned char GLT_RGB_R(unsigned int rgb) -{ - return ((rgb >> 8 )&0xF8); -} - -unsigned char GLT_RGB_G(unsigned int rgb) -{ - return ((rgb >> 3 )&0xFC); -} - -unsigned char GLT_RGB_B(unsigned int rgb) -{ - return ((rgb << 3)&0xF8); -} diff --git a/core/src/surface.cpp b/core/src/surface.cpp index 0515b12..afdaf4d 100644 --- a/core/src/surface.cpp +++ b/core/src/surface.cpp @@ -3,21 +3,23 @@ #include "../core_include/cmd_target.h" #include "../core_include/wnd.h" #include "../core_include/surface.h" +#include "../core_include/display.h" #include #include -c_surface::c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height) +c_surface::c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes) { m_width = width; m_height = height; + m_color_bytes = color_bytes; m_display = display; m_phy_fb = phy_fb; m_fb = m_usr = NULL; m_top_zorder = m_max_zorder = Z_ORDER_LEVEL_0; m_is_active = false; - m_fb = calloc(m_width * m_height * 2, 1); - m_frame_layers[Z_ORDER_LEVEL_0].rect = c_rect(0,0,m_width,m_height); + m_fb = calloc(m_width * m_height, color_bytes); + m_frame_layers[Z_ORDER_LEVEL_0].rect = c_rect(0, 0, m_width, m_height); } void c_surface::set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order) @@ -26,69 +28,29 @@ void c_surface::set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order) m_max_zorder = max_z_order; for(int i = 0; i <= m_max_zorder; i++) { - m_frame_layers[i].fb = calloc(m_width * m_height * 2, 1); + m_frame_layers[i].fb = calloc(m_width * m_height, m_color_bytes); ASSERT(NULL != m_frame_layers[i].fb); } } -void c_surface::do_quick_set_pixel(int x, int y, unsigned int rgb) -{ - ((short*)m_fb)[y * m_width + x] = rgb; - if(m_is_active) - { - ((short*)m_phy_fb)[y * m_width + x] = rgb; - } -} - -void c_surface::do_quick_fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb) -{ - if (x0 < 0 || y0 < 0 || x1 < 0 || y1 < 0) - { - ASSERT(FALSE); - } - - if (x0 >= m_width || x1 >= m_width || y0 >= m_height || y1 >= m_height) - { - ASSERT(FALSE); - } - - int x; - short *fb, *phy_fb; - for(;y0 <= y1; y0++) - { - x = x0; - fb = &((short*)m_fb)[y0 * m_width + x]; - phy_fb = &((short*)m_phy_fb)[y0 * m_width + x]; - for(; x <= x1; x++) - { - *fb++ = rgb; - if(m_is_active) - { - *phy_fb++ = rgb; - } - } - } -} - void c_surface::set_pixel(int x, int y, unsigned int rgb, unsigned int z_order) { - if ( x >= m_width || y >= m_height || x < 0 || y < 0) + if (x >= m_width || y >= m_height || x < 0 || y < 0) { return; } - if (z_order > m_max_zorder) { ASSERT(FALSE); return; } - if(z_order > m_top_zorder) + if (z_order > m_top_zorder) { m_top_zorder = (Z_ORDER_LEVEL)z_order; } - if(0 == m_frame_layers[z_order].rect.PtInRect(x, y)) + if (0 == m_frame_layers[z_order].rect.PtInRect(x, y)) { ASSERT(FALSE); return; @@ -96,20 +58,20 @@ void c_surface::set_pixel(int x, int y, unsigned int rgb, unsigned int z_order) if (z_order == m_max_zorder) { - return do_quick_set_pixel(x, y, rgb); + return set_pixel_on_fb(x, y, rgb); } - ((short*)(m_frame_layers[z_order].fb))[x + y * m_width] = rgb; + ((unsigned int*)(m_frame_layers[z_order].fb))[x + y * m_width] = rgb; - if(z_order == m_top_zorder) + if (z_order == m_top_zorder) { - return do_quick_set_pixel(x, y, rgb); + return set_pixel_on_fb(x, y, rgb); } bool is_covered = false; for (int tmp_z_order = Z_ORDER_LEVEL_MAX - 1; tmp_z_order > z_order; tmp_z_order--) { - if(1 == m_frame_layers[tmp_z_order].rect.PtInRect(x, y)) + if (1 == m_frame_layers[tmp_z_order].rect.PtInRect(x, y)) { is_covered = true; break; @@ -118,10 +80,75 @@ void c_surface::set_pixel(int x, int y, unsigned int rgb, unsigned int z_order) if (!is_covered) { - ((short*)m_fb)[y * m_width + x] = rgb; - if(m_is_active) + set_pixel_on_fb(x, y, rgb); + } +} + +void c_surface::set_pixel_on_fb(int x, int y, unsigned int rgb) +{ + ((unsigned int*)m_fb)[y * m_width + x] = rgb; + + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + if (m_is_active && (x < display_width) && (y < display_height)) + { + ((unsigned int*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb; + } +} + +void c_surface::fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order) +{ + if (z_order == m_max_zorder) + { + return fill_rect_on_fb(x0, y0, x1, y1, rgb); + } + + if (z_order == m_top_zorder) + { + int x, y; + unsigned int *mem_fb; + for (y = y0; y <= y1; y++) { - ((short*)m_phy_fb)[y * m_width + x] = rgb; + x = x0; + mem_fb = &((unsigned int*)m_frame_layers[z_order].fb)[y * m_width + x]; + for (; x <= x1; x++) + { + *mem_fb++ = rgb; + } + } + return fill_rect_on_fb(x0, y0, x1, y1, rgb); + } + + for (; y0 <= y1; y0++) + { + draw_hline(x0, x1, y0, rgb, z_order); + } +} + +void c_surface::fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb) +{ + if (x0 < 0 || y0 < 0 || x1 < 0 || y1 < 0 || + x0 >= m_width || x1 >= m_width || y0 >= m_height || y1 >= m_height) + { + ASSERT(FALSE); + } + + int x; + unsigned int *fb, *phy_fb; + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + for (; y0 <= y1; y0++) + { + x = x0; + fb = &((unsigned int*)m_fb)[y0 * m_width + x]; + phy_fb = &((unsigned int*)m_phy_fb)[y0 * display_width + x]; + for (; x <= x1; x++) + { + *fb++ = rgb; + if (m_is_active && (x < display_width) && (y0 < display_height)) + { + *phy_fb++ = rgb; + } } } } @@ -137,10 +164,10 @@ unsigned int c_surface::get_pixel(int x, int y, unsigned int z_order) if (z_order == m_max_zorder) { - return ((unsigned short*)m_fb)[y * m_width + x]; + return ((unsigned int*)m_fb)[y * m_width + x]; } - return ((unsigned short*)(m_frame_layers[z_order].fb))[y * m_width + x]; + return ((unsigned int*)(m_frame_layers[z_order].fb))[y * m_width + x]; } void c_surface::draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order) @@ -277,55 +304,6 @@ void c_surface::draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsi draw_vline(x1, y0, y1, rgb, z_order); } -void c_surface::fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order) -{ - if (z_order == m_max_zorder) - { - return do_quick_fill_rect(x0, y0, x1, y1, rgb); - } - - if(z_order == m_top_zorder) - { - int x,y; - short *mem_fb; - for(y = y0; y <= y1; y++) - { - x = x0; - mem_fb = &((short*)m_frame_layers[z_order].fb)[y * m_width + x]; - for(; x <= x1; x++) - { - *mem_fb++ = rgb; - } - } - return do_quick_fill_rect(x0, y0, x1, y1, rgb); - } - - for (; y0 <= y1; y0++) - { - draw_hline(x0, x1, y0, rgb, z_order); - } -} - -int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order) -{ - if (x >= m_width || y >= m_height || x < 0 || y < 0 || - z_order >= Z_ORDER_LEVEL_MAX) - { - ASSERT(FALSE); - return 0; - } - - char* des_addr,* src_addr; - - short rgb = ((short*)(m_frame_layers[z_order].fb))[x + y * m_width]; - ((short*)m_fb)[y * m_width + x] = rgb; - if(m_is_active) - { - ((short*)m_phy_fb)[y * m_width + x] = rgb; - } - return 0; -} - int c_surface::set_frame_layer(c_rect& rect, unsigned int z_order) { if (z_order <= Z_ORDER_LEVEL_0 || z_order >= Z_ORDER_LEVEL_MAX) @@ -363,6 +341,39 @@ int c_surface::set_frame_layer(c_rect& rect, unsigned int z_order) return 1; } +int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order) +{ + if (x >= m_width || y >= m_height || x < 0 || y < 0 || + z_order >= Z_ORDER_LEVEL_MAX) + { + ASSERT(FALSE); + return 0; + } + + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + + if (m_color_bytes == 4) + { + unsigned int rgb = ((unsigned int*)(m_frame_layers[z_order].fb))[x + y * m_width]; + ((unsigned int*)m_fb)[y * m_width + x] = rgb; + if (m_is_active && (x < display_width) && (y < display_height)) + { + ((unsigned int*)m_phy_fb)[y * display_width + x] = rgb; + } + } + else//16 bits + { + short rgb = ((short*)(m_frame_layers[z_order].fb))[x + y * m_width]; + ((short*)m_fb)[y * m_width + x] = rgb; + if (m_is_active && (x < display_width) && (y < display_height)) + { + ((short*)m_phy_fb)[y * display_width + x] = rgb; + } + } + return 0; +} + void c_surface::draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order) { int i = 0; @@ -395,39 +406,30 @@ void c_surface::draw_custom_shape(int l, int t, int r, int b, unsigned int color int c_surface::flush_scrren(int left, int top, int right, int bottom) { - if(left < 0 || left >= m_width) - { - ASSERT(FALSE); - } - if(right < 0 || right >= m_width) + if(left < 0 || left >= m_width || right < 0 || right >= m_width || + top < 0 || top >= m_height || bottom < 0 || bottom >= m_height) { ASSERT(FALSE); } - if(top < 0 || top >= m_height) - { - ASSERT(FALSE); - } - - if(bottom < 0 || bottom >= m_height) - { - ASSERT(FALSE); - } - - if(!m_is_active) + if(!m_is_active || (0 == m_phy_fb) || (0 == m_fb)) { return -1; } - if((0 == m_phy_fb) || (0 == m_fb)) - { - return -2; - } + + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + + left = (left >= display_width) ? (display_width - 1) : left; + right = (right >= display_width) ? (display_width - 1) : right; + top = (top >= display_height) ? (display_height - 1) : top; + bottom = (bottom >= display_height) ? (display_height - 1) : bottom; for (int y = top; y < bottom; y++) { - void* s_addr = (char*)m_fb + ((y * m_width + left) * 2); - void* d_addr = (char*)m_phy_fb + ((y * m_width + left) * 2); - memcpy(d_addr, s_addr, (right - left) * 2); + void* s_addr = (char*)m_fb + ((y * m_width + left) * m_color_bytes); + void* d_addr = (char*)m_phy_fb + ((y * display_width + left) * m_color_bytes); + memcpy(d_addr, s_addr, (right - left) * m_color_bytes); } return 0; } @@ -444,4 +446,143 @@ bool c_surface::is_valid(c_rect rect) return false; } return true; +} + +////////////////////////////////////////////////////////////////////////////////////// +void c_surface_16bits::set_pixel(int x, int y, unsigned int rgb, unsigned int z_order) +{ + if (x >= m_width || y >= m_height || x < 0 || y < 0) + { + return; + } + if (z_order > m_max_zorder) + { + ASSERT(FALSE); + return; + } + + if (z_order > m_top_zorder) + { + m_top_zorder = (Z_ORDER_LEVEL)z_order; + } + + if (0 == m_frame_layers[z_order].rect.PtInRect(x, y)) + { + ASSERT(FALSE); + return; + } + + rgb = GLT_RGB_32_to_16(rgb); + if (z_order == m_max_zorder) + { + return set_pixel_on_fb(x, y, rgb); + } + + ((unsigned short*)(m_frame_layers[z_order].fb))[x + y * m_width] = rgb; + + if (z_order == m_top_zorder) + { + return set_pixel_on_fb(x, y, rgb); + } + + bool is_covered = false; + for (int tmp_z_order = Z_ORDER_LEVEL_MAX - 1; tmp_z_order > z_order; tmp_z_order--) + { + if (1 == m_frame_layers[tmp_z_order].rect.PtInRect(x, y)) + { + is_covered = true; + break; + } + } + + if (!is_covered) + { + set_pixel_on_fb(x, y, rgb); + } +} + +void c_surface_16bits::set_pixel_on_fb(int x, int y, unsigned int rgb) +{ + ((unsigned short*)m_fb)[y * m_width + x] = rgb; + + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + if (m_is_active && (x < display_width) && (y < display_height)) + { + ((unsigned short*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb; + } +} + +void c_surface_16bits::fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order) +{ + rgb = GLT_RGB_32_to_16(rgb); + if (z_order == m_max_zorder) + { + return fill_rect_on_fb(x0, y0, x1, y1, rgb); + } + if (z_order == m_top_zorder) + { + int x, y; + unsigned short *mem_fb; + for (y = y0; y <= y1; y++) + { + x = x0; + mem_fb = &((unsigned short*)m_frame_layers[z_order].fb)[y * m_width + x]; + for (; x <= x1; x++) + { + *mem_fb++ = rgb; + } + } + return fill_rect_on_fb(x0, y0, x1, y1, rgb); + } + + for (; y0 <= y1; y0++) + { + draw_hline(x0, x1, y0, rgb, z_order); + } +} + +void c_surface_16bits::fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb) +{ + if (x0 < 0 || y0 < 0 || x1 < 0 || y1 < 0 || + x0 >= m_width || x1 >= m_width || y0 >= m_height || y1 >= m_height) + { + ASSERT(FALSE); + } + + int x; + unsigned short *fb, *phy_fb; + int display_width = m_display->get_width(); + int display_height = m_display->get_height(); + for (; y0 <= y1; y0++) + { + x = x0; + fb = &((unsigned short*)m_fb)[y0 * m_width + x]; + phy_fb = &((unsigned short*)m_phy_fb)[y0 * display_width + x]; + for (; x <= x1; x++) + { + *fb++ = rgb; + if (m_is_active && (x < display_width) && (y0 < display_height)) + { + *phy_fb++ = rgb; + } + } + } +} + +unsigned int c_surface_16bits::get_pixel(int x, int y, unsigned int z_order) +{ + if (x >= m_width || y >= m_height || x < 0 || y < 0 || + z_order >= Z_ORDER_LEVEL_MAX) + { + ASSERT(FALSE); + return 0; + } + + if (z_order == m_max_zorder) + { + return GLT_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]); + } + + return GLT_RGB_16_to_32(((unsigned short*)(m_frame_layers[z_order].fb))[y * m_width + x]); } \ No newline at end of file diff --git a/core/src/wave_ctrl.cpp b/core/src/wave_ctrl.cpp index 7714cd6..6a96777 100644 --- a/core/src/wave_ctrl.cpp +++ b/core/src/wave_ctrl.cpp @@ -48,7 +48,7 @@ void c_wave_ctrl::on_init_children() m_wave_bottom = rect.m_bottom - 4; m_wave_cursor = m_wave_left; - m_bg_fb = calloc(rect.Width() * rect.Height() * 2, 1); + m_bg_fb = calloc(rect.Width() * rect.Height(), 2); } void c_wave_ctrl::set_max_min_base(short max_data, short min_data, short data_base) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 34e875f..b4272c9 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8) PROJECT(Gui) -INCLUDE_DIRECTORIES(core_include +SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/..) + +INCLUDE_DIRECTORIES(../core gui_include) FILE(GLOB SRC src/*.cpp) diff --git a/gui/core_include/api.h b/gui/core_include/api.h deleted file mode 100644 index 541573f..0000000 --- a/gui/core_include/api.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _API_H_ -#define _API_H_ - -#define REAL_TIME_TASK_CYCLE_MS 50 -#define XXX -999 -#define NULL 0 -#define TRUE 1 -#define FALSE 0 - -void do_assert(const char* file, int line); -#define ASSERT(condition) \ - do{ \ - if(!(condition))do_assert(__FILE__, __LINE__);\ - }while(0) - -void log_out(const char* log); - -unsigned int GLT_RGB(unsigned char r, unsigned char g, unsigned char b); -unsigned char GLT_RGB_R(unsigned int color); -unsigned char GLT_RGB_G(unsigned int color); -unsigned char GLT_RGB_B(unsigned int color); - -typedef struct _T_TIME -{ - unsigned short year; - unsigned short month; - unsigned short date; - unsigned short day; - unsigned short hour; - unsigned short minute; - unsigned short second; -}T_TIME; - -long get_time_in_second(); -T_TIME second_to_day(long second); -T_TIME get_time(); - -void start_real_timer(void (*func)(void* arg)); -void register_timer(int milli_second, void func(void* ptmr, void* parg)); - -unsigned int get_cur_thread_id(); -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg); -void thread_sleep(unsigned int milli_seconds); -int build_bmp(char *filename, unsigned int width, unsigned int height, unsigned char *data); -#endif diff --git a/gui/core_include/audio.h b/gui/core_include/audio.h deleted file mode 100644 index 7d9702a..0000000 --- a/gui/core_include/audio.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __AUDIO_MANGE_H__ -#define __AUDIO_MANGE_H__ - -enum AUDIO_TYPE -{ - AUDIO_HEART_BEAT, - AUDIO_ALARM, - AUDIO_MAX -}; - -class c_audio -{ -public: - static int play(AUDIO_TYPE type); -private: - static void init(); -}; - -#endif diff --git a/gui/core_include/bitmap.h b/gui/core_include/bitmap.h deleted file mode 100644 index a0cdf0c..0000000 --- a/gui/core_include/bitmap.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _BITMAP_UNIT_H_ -#define _BITMAP_UNIT_H_ - -class c_surface; -class c_bitmap -{ -public: - static void draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, int x, int y); - static void draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type); -private: - static void draw_bitmap_565(c_surface* surface, int z_order, int x, int y, int xsize, int ysize, const unsigned char* pPixel); - static void get_bitmap_pos(const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y); - static void draw_bitmap_565_inrect(c_surface* surface, int z_order, int x, int y, int width, int height, int xsize, int ysize, const unsigned char* pPixel); - - c_bitmap(){} - c_bitmap(const c_bitmap&); - c_bitmap& operator=(const c_bitmap&); - ~c_bitmap(){} -}; - -#endif diff --git a/gui/core_include/cmd_target.h b/gui/core_include/cmd_target.h deleted file mode 100644 index 2b8dcc6..0000000 --- a/gui/core_include/cmd_target.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef CMD_TARGET_H -#define CMD_TARGET_H - -class c_cmd_target; - -#define MSG_TYPE_INVALID 0xFFFF -#define MSG_TYPE_WND 0x0001 -#define MSG_TYPE_USR 0x0002 -#define USR_MSG_MAX 1024 - -typedef void (c_cmd_target::*MsgFuncVV)(); - -enum MSG_CALLBACK_TYPE -{ - MSG_CALLBACK_NULL = 0, - MSG_CALLBACK_VV, - MSG_CALLBACK_IWL, - MSG_CALLBACK_IWV, - MSG_CALLBACK_VWV, - MSG_CALLBACK_VVL, - MSG_CALLBACK_VWL, - MSG_CALLBACK_IVV -}; - -typedef union -{ - void (c_cmd_target::*func)(); - void (c_cmd_target::*func_vwv)(unsigned int w_param); - int (c_cmd_target::*func_iwl)(unsigned int w_param, long l_param); - int (c_cmd_target::*func_iwv)(unsigned int w_param); - void (c_cmd_target::*func_vvl)(long l_param); - void (c_cmd_target::*func_vwl)(unsigned int w_param, long l_param); - int (c_cmd_target::*func_ivv)(); -}MSGFUNCS; - -struct GLT_MSG_ENTRY -{ - unsigned int msgType; - unsigned int msgId; - c_cmd_target* pObject; - MSG_CALLBACK_TYPE callbackType; - MsgFuncVV func; -}; - -#define ON_GLT_USER_MSG(msgId, func) \ -{MSG_TYPE_USR, msgId, 0, MSG_CALLBACK_VWL, (MsgFuncVV)(static_cast(&func))}, - -#define GLT_DECLARE_MESSAGE_MAP() \ -protected: \ -virtual const GLT_MSG_ENTRY* GetMSgEntries() const; \ -private: \ -static const GLT_MSG_ENTRY mMsgEntries[]; - -#define GLT_BEGIN_MESSAGE_MAP(theClass) \ -const GLT_MSG_ENTRY* theClass::GetMSgEntries() const \ -{ \ - return theClass::mMsgEntries; \ -} \ -const GLT_MSG_ENTRY theClass::mMsgEntries[] = \ -{ - -#define GLT_END_MESSAGE_MAP() \ -{MSG_TYPE_INVALID, 0, (c_cmd_target*)0, MSG_CALLBACK_NULL, (MsgFuncVV)0}}; - -class c_cmd_target -{ -public: - c_cmd_target(); - virtual ~c_cmd_target(); - static int handle_usr_msg(unsigned int msgId, unsigned int wParam, unsigned int lParam); -protected: - void load_cmd_msg(); - const GLT_MSG_ENTRY* FindMsgEntry(const GLT_MSG_ENTRY *pEntry, - unsigned int msgType, unsigned short msgId, unsigned short ctrlId); -private: - static GLT_MSG_ENTRY ms_usr_map_entries[USR_MSG_MAX]; - static unsigned short ms_user_map_size; - GLT_DECLARE_MESSAGE_MAP() -}; - -#endif diff --git a/gui/core_include/display.h b/gui/core_include/display.h deleted file mode 100644 index aa468f2..0000000 --- a/gui/core_include/display.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _DISPLAY_H_ -#define _DISPLAY_H_ - -#define MAX_DISPLAY 9 -#define SURFACE_CNT_MAX 6//root + pages - -class c_hid_pipe; -class c_surface; - -class c_display { -public: - c_display(void* phy_fb, unsigned int width, unsigned int height, unsigned int slides_cnt); - c_surface* create_surface(void* usr, Z_ORDER_LEVEL max_zorder); - int merge_surface(c_surface* s1, c_surface* s2, int x1, int x2, int y1, int y2, int offset); - c_hid_pipe* get_hid_pipe() { return m_hid_pipe; } - unsigned int get_width() { return m_width; } - unsigned int get_height() { return m_height; } - - static void* get_frame_buffer(unsigned int display_id, int* width, int* height); - static int snap_shot(unsigned int display_id); -private: - unsigned int m_width; //in pixels - unsigned int m_height; //in pixels - void* m_phy_fb; - c_hid_pipe* m_hid_pipe; - c_surface* m_surface_group[SURFACE_CNT_MAX]; - unsigned int m_surface_cnt; - - static c_display* ms_displays[MAX_DISPLAY]; -}; -#endif \ No newline at end of file diff --git a/gui/core_include/msg.h b/gui/core_include/msg.h deleted file mode 100644 index b87100a..0000000 --- a/gui/core_include/msg.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _MSG_H -#define _MSG_H - -typedef struct -{ - unsigned int dwMsgId; - unsigned int dwParam1; - unsigned int dwParam2; -}MSG_INFO; - -int read_usr_msg(MSG_INFO* msg); -int write_usr_msg(MSG_INFO* msg); - -#define FIFO_BUFFER_LEN 1024 -#define FIFO_NAME_LEN 16 -class c_fifo -{ -public: - c_fifo(const char* name); - int read(void* buf, int len); - int write(void* buf, int len); - -private: - unsigned char m_buf[FIFO_BUFFER_LEN]; - char m_name[FIFO_NAME_LEN]; - int m_head; - int m_tail; - void* m_read_sem; - void* m_write_mutex; -}; - -#define MAX_HID_PIPES 9 -class c_hid_pipe -{ -public: - c_hid_pipe(void* id); - - static int read_hid_msg(); - static int write_hid_msg(MSG_INFO* msg, unsigned int display_id = 0); - MSG_INFO m_msg; - int m_fd; -private: - static c_hid_pipe* ms_pipes[MAX_HID_PIPES]; - static int ms_max_fd; -}; -#endif diff --git a/gui/core_include/rect.h b/gui/core_include/rect.h deleted file mode 100644 index fe538f8..0000000 --- a/gui/core_include/rect.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _RECT_H -#define _RECT_H - -#define ALIGN_HCENTER 0x00000000L -#define ALIGN_LEFT 0x01000000L -#define ALIGN_RIGHT 0x02000000L -#define ALIGN_HMASK 0x03000000L - -#define ALIGN_VCENTER 0x00000000L -#define ALIGN_TOP 0x00100000L -#define ALIGN_BOTTOM 0x00200000L -#define ALIGN_VMASK 0x00300000L - -class c_rect -{ -public: - c_rect(){Empty();} - c_rect(int left, int top, int right, int bottom){m_left = left;m_top = top;m_right = right;m_bottom = bottom;}; - void SetRect( int left, int top, int right, int bottom); - c_rect(const c_rect&); - c_rect& operator=(const c_rect&); - void Empty(); - void Offset(int x, int y); - int IsEmpty() const ; - int PtInRect(int x, int y) const ; - int operator==(const c_rect& ) const; - c_rect operator&(const c_rect& aRect) const; - int Width() const {return m_right - m_left + 1;} - int Height() const {return m_bottom - m_top + 1;} - - int m_left; - int m_top; - int m_right; - int m_bottom; -}; - -#endif diff --git a/gui/core_include/resource_type.h b/gui/core_include/resource_type.h deleted file mode 100644 index caab830..0000000 --- a/gui/core_include/resource_type.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _RESOURCE_TYPE_H_ -#define _RESOURCE_TYPE_H_ - -typedef struct struct_gui_bitmap -{ - unsigned short XSize; - unsigned short YSize; - unsigned short BytesPerLine; - unsigned short BitsPerPixel; - const unsigned char* pData; /* Pointer to picture data (indices) */ -} GUI_BITMAP; - -typedef struct -{ - unsigned char XSize; - unsigned char XDist; - unsigned char BytesPerLine; - void* pData; -} GUI_CHARINFO; - -typedef struct -{ - unsigned short First; /* first character */ - unsigned short Last; /* last character */ - const GUI_CHARINFO* paCharInfo; /* address of first character */ - void* pNext; /* pointer to next */ -} GUI_FONT_PROP; - -typedef struct struct_gui_font -{ - unsigned char YSize; - unsigned char YDist; - unsigned char XMag; - unsigned char YMag; - union - { - void *pFontData; - const GUI_FONT_PROP* pProp; - } p; - unsigned char Baseline; -} GUI_FONT; - -typedef enum -{ - LANGUAGE_BEGIN = 0, - ENGLISH = LANGUAGE_BEGIN, - CHINESE, - LANGUAGE_MAX -}LANGUAGE_TYPE; - -typedef struct struct_multi_lan_strings -{ - unsigned int index; - const char* text[LANGUAGE_MAX]; -}MULTI_LAN_STRINGS; - -typedef struct struct_unicode_lan_strings -{ - unsigned int index; - const char* unicodes; -}MULTI_LAN_UNICODES; - -#define ADD_STRING( index, english) \ -{ \ - index, \ - { \ - english, \ - 0 \ - } \ -} - -#endif diff --git a/gui/core_include/surface.h b/gui/core_include/surface.h deleted file mode 100644 index 461b0d3..0000000 --- a/gui/core_include/surface.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef _GAL_H_ -#define _GAL_H_ - -struct FRAME_LAYER -{ - void* fb; - c_rect rect; -}; - -typedef enum -{ - Z_ORDER_LEVEL_0,//view/wave/page - Z_ORDER_LEVEL_1,//dialog - Z_ORDER_LEVEL_2,//editbox/spinbox/listbox/keyboard - Z_ORDER_LEVEL_MAX -}Z_ORDER_LEVEL; - -#define INVALID_RGN 0xFFFFFF -#define COLOR_USERDEF GLT_RGB(41,49,49) -#define DUMMY_COLOR GLT_RGB(0,0,0) - -typedef struct struct_custom_shape -{ - int l; - int t; - int r; - int b; - unsigned int color; -}CUSTOM_SHAPE; - -class c_display; -class c_surface { - friend class c_display; -public: - c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height); - - void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order); - unsigned int get_pixel(int x, int y, unsigned int z_order); - void draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order); - void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order); - void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); - void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); - void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); - void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order); - int flush_scrren(int left, int top, int right, int bottom); - - bool is_valid(c_rect rect); - bool is_active() { return m_is_active; } - c_display* get_display() { return m_display; } - - int set_frame_layer(c_rect& rect, unsigned int z_order); - void set_active(bool flag){m_is_active = flag;} -private: - void set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order); - int copy_layer_pixel_2_fb(int x, int y, unsigned int z_order); - void do_quick_set_pixel(int x,int y,unsigned int rgb); - void do_quick_fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb); - - unsigned int m_width; //in pixels - unsigned int m_height; //in pixels - void* m_fb; - struct FRAME_LAYER m_frame_layers[Z_ORDER_LEVEL_MAX]; - void* m_usr; - bool m_is_active; - Z_ORDER_LEVEL m_max_zorder; - Z_ORDER_LEVEL m_top_zorder; - void* m_phy_fb; - c_display* m_display; -}; - -#endif diff --git a/gui/core_include/wave_buffer.h b/gui/core_include/wave_buffer.h deleted file mode 100644 index f40e539..0000000 --- a/gui/core_include/wave_buffer.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _XT_GUI_WAVE_H_ -#define _XT_GUI_WAVE_H_ - -#define WAVE_BUFFER_LEN 64 -#define WAVE_FRAME_LEN 8 -#define BUFFER_EMPTY -1111 -#define BUFFER_FULL -2222; -class c_wave_buffer -{ -public: - c_wave_buffer(); - int write_wave_data(short data); - int read_wave_data_by_frame(short &max, short &min, short len, unsigned int seq); - void reset(); - void clear_data(); - short get_cnt(); -private: - int read_data(); - short m_wave_buf[WAVE_BUFFER_LEN]; - short m_head; - short m_tail; - - int m_min_old; - int m_max_old; - int m_min_older; - int m_max_older; - int m_last_data; - - short m_fb_min[WAVE_FRAME_LEN]; - short m_fb_mid[WAVE_FRAME_LEN]; - short m_fb_max[WAVE_FRAME_LEN]; - unsigned int m_refresh_sqence; -}; - -#endif diff --git a/gui/core_include/wave_ctrl.h b/gui/core_include/wave_ctrl.h deleted file mode 100644 index bb21ab6..0000000 --- a/gui/core_include/wave_ctrl.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef _WAVE_CTRL_H_ -#define _WAVE_CTRL_H_ - -typedef enum -{ - FILL_MODE, - SCAN_MODE -}E_WAVE_DRAW_MODE; - -typedef enum -{ - GAIN_025, - GAIN_050, - GAIN_100, - GAIN_200 -}E_WAVE_GAIN; - -class c_wave_buffer; -class c_wave_ctrl : public c_wnd -{ -public: - c_wave_ctrl(); - virtual c_wnd* clone(){return new c_wave_ctrl();} - virtual void on_init_children(); - virtual void on_paint(); - - void set_wave_name(unsigned short wave_name_id){ m_wave_name = wave_name_id;} - unsigned short get_wave_name(){return m_wave_name;} - void set_wave_unit(unsigned short wave_unit_id){ m_wave_unit = wave_unit_id;} - - void set_wave_name_font_type(const GUI_FONT* wave_name_font_type){ m_wave_name_font_type = wave_name_font_type;} - void set_wave_unit_font_type(const GUI_FONT* wave_unit_font_type){ m_wave_unit_font_type = wave_unit_font_type;} - - void set_wave_name_color(unsigned int wave_name_color){ m_wave_name_color = wave_name_color;} - void set_wave_unit_color(unsigned int wave_unit_color){ m_wave_unit_color = wave_unit_color;} - void set_wave_color(unsigned int color){ m_wave_color = color;} - void set_wave_sample_rate(unsigned int rate);//speed = module sample rate - void set_wave_speed(unsigned int speed); - - void set_max_min_base(short max_data, short min_data, short data_base); - void set_wave_gain(E_WAVE_GAIN gain); - void set_wave(c_wave_buffer* wave){m_wave = wave;} - c_wave_buffer* get_wave(){return m_wave;} - void clear_data(); - bool is_data_enough(); - void refresh_wave(unsigned char frame); - void clear_wave(); - -protected: - void draw_smooth_vline(int y_min, int y_max, int mid, unsigned int rgb); - void erase_oldest_vline(); - void save_foreground(); - - unsigned short m_wave_name; - unsigned short m_wave_unit; - - const GUI_FONT* m_wave_name_font_type; - const GUI_FONT* m_wave_unit_font_type; - - unsigned int m_wave_name_color; - unsigned int m_wave_unit_color; - - unsigned int m_wave_color; - unsigned int m_back_color; - - int m_wave_left; - int m_wave_right; - int m_wave_top; - int m_wave_bottom; - - short m_max_data; - short m_min_data; - short m_pivot_data; //for wave gain and fill mode - E_WAVE_GAIN m_gain; //wave gain - -private: - c_wave_buffer* m_wave; - void* m_bg_fb; //background frame buffer, could be used to draw scale line. - int m_wave_cursor; - int m_wave_speed; //pixels per refresh - int m_wave_sample_rate; - unsigned char m_frame_len_map[64]; - unsigned char m_frame_len_map_index; -}; -#endif diff --git a/gui/core_include/wnd.h b/gui/core_include/wnd.h deleted file mode 100644 index 87813aa..0000000 --- a/gui/core_include/wnd.h +++ /dev/null @@ -1,168 +0,0 @@ -#ifndef XT_GUI_WND_H -#define XT_GUI_WND_H - -//Window attribution -#define GLT_WIN_SHOW 0x00000001 -#define GLT_WIN_HIDE 0x00000002 - -#define GLT_ATTR_VISIBLE 0x80000000L -#define GLT_ATTR_DISABLED 0x40000000L -#define GLT_ATTR_FOCUS 0x20000000L - -typedef struct struct_gui_bitmap GUI_BITMAP; -typedef struct struct_gui_font GUI_FONT; -typedef struct struct_custom_shape CUSTOM_SHAPE; -typedef const GUI_FONT* (*PTR_FUNC_GET_FONT)(); - -class c_wnd; -class c_surface; - -typedef enum -{ - STATUS_NORMAL, - STATUS_PUSHED, - STATUS_FOCUSED, - STATUS_DISABLED -}WND_STATUS; - -typedef struct struct_wnd_tree -{ - c_wnd* p_wnd; - unsigned int resource_id; - unsigned int caption_id; - short x; - short y; - short width; - short height; - struct struct_wnd_tree* p_child_tree; -}WND_TREE; - -class c_wnd : public c_cmd_target -{ - friend class c_dialog; -public: - c_wnd(); - virtual ~c_wnd(); - virtual const char* get_class_name() const { return "c_wnd"; } - virtual int connect(c_wnd *parent, unsigned short resource_id, unsigned short str_id, - short x, short y, short width, short height, WND_TREE* p_child_tree = NULL); - virtual c_wnd* connect_clone(c_wnd *parent, unsigned short resource_id, unsigned short str_id, - short x, short y, short width, short height, WND_TREE* p_child_tree = NULL); - void disconnect(); - virtual c_wnd* clone() = 0; - virtual void on_init_children() {} - virtual void on_paint() {} - void show_window(int show_type = GLT_WIN_SHOW); - - unsigned short get_id() const { return m_resource_id; } - int get_z_order() { return m_z_order; } - c_wnd* get_wnd_ptr(unsigned short id) const; - unsigned int get_style() const { return m_style; } - virtual void modify_style(unsigned int add_style = 0, unsigned int remove_style = 0); - - void set_str_id(unsigned short str_id) { m_str_id = str_id; } - unsigned short get_str_id() const { return m_str_id; } - - void set_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap = pBitmap; } - void set_focus_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_focus = pBitmap; } - void set_pushed_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_pushed = pBitmap; } - void set_disable_bitmap(const GUI_BITMAP *pBitmap) { m_bitmap_disable = pBitmap; } - - bool is_visible() const { return m_is_visible_now; } - bool is_foreground(); - void set_visible(bool visible); - virtual void enable_wnd(int enable = TRUE); - int is_wnd_enable() const; - void enable_focus(int enable = TRUE); - int is_focus_wnd() const; - const int is_active_wnd() const; - - void set_font_color(unsigned int color) { m_font_color = color; } - unsigned int get_font_color() { return m_font_color; } - void set_bg_color(unsigned int color) { m_bg_color = color; } - unsigned int get_bg_color() { return m_bg_color; } - void set_font_type(const GUI_FONT *font_type) { m_font_type = font_type; } - const GUI_FONT* get_font_type() { return m_font_type; } - - void set_wnd_pos(short x, short y, short width, short height); - void get_wnd_rect(c_rect &rect) const; - void get_screen_rect(c_rect &rect) const; - - c_wnd* set_focus(c_wnd *new_active_child); - - c_wnd* get_parent() const { return m_parent; } - c_wnd* get_last_child() const; - int unlink_child(c_wnd *child); - c_wnd* get_prev_sibling() const { return m_prev_sibling; } - c_wnd* get_next_sibling() const { return m_next_sibling; } - - void notify_parent(unsigned short msg_id, unsigned int w_param, long l_param); - virtual int on_notify(unsigned short notify_code, unsigned short ctrl_id, long l_param); - - virtual void on_touch_up(int x, int y); - virtual void on_touch_down(int x, int y); - - c_wnd* get_active_child() const { return m_active_child; } - - void modify_status(WND_STATUS status) { m_status = status; } - WND_STATUS get_status() { return m_status; } - - c_surface* get_surface() { return m_surface; } - void set_surface(c_surface* gal) { m_surface = gal; } -protected: - virtual void pre_create_wnd(); - virtual void display_window(); - void hide_widow(); - void add_child_2_head(c_wnd *child); - void add_child_2_tail(c_wnd *child); - - void wnd2screen(int &x, int &y) const; - void wnd2screen(c_rect &rect) const; - void screen2wnd(short &x, short &y) const; - void screen2wnd(c_rect &rect) const; - - int load_child_wnd(WND_TREE *p_child_tree); - int load_clone_child_wnd(WND_TREE *p_child_tree); - void set_active_child(c_wnd* child) { m_active_child = child; } - - virtual void on_focus(); - virtual void on_kill_focus(); - - void set_pixel(int x, int y, unsigned int rgb); - void draw_hline(int x0, int x1, int y, unsigned int rgb); - void draw_vline(int x, int y0, int y1, unsigned int rgb); - void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb); - void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb); - void draw_rect(c_rect rect, unsigned int rgb); - void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb); - void fill_rect(c_rect rect, unsigned int rgb); - void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[]); -protected: - WND_STATUS m_status; - unsigned int m_style; - c_rect m_wnd_rect;//position relative to parent wnd. - c_wnd* m_parent; - c_wnd* m_top_child; - c_wnd* m_prev_sibling; - c_wnd* m_next_sibling; - unsigned short m_str_id; - - const GUI_BITMAP* m_bitmap; - const GUI_BITMAP* m_bitmap_focus; - const GUI_BITMAP* m_bitmap_pushed; - const GUI_BITMAP* m_bitmap_disable; - const GUI_FONT* m_font_type; - unsigned int m_font_color; - unsigned int m_bg_color; - - bool m_is_visible_now; - unsigned short m_resource_id; - - int m_z_order; - c_wnd* m_active_child; - c_surface* m_surface; -private: - c_wnd(const c_wnd &win); - c_wnd& operator=(const c_wnd &win); -}; -#endif diff --git a/gui/core_include/word.h b/gui/core_include/word.h deleted file mode 100644 index b3c7f33..0000000 --- a/gui/core_include/word.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _WORD_UNIT_H_ -#define _WORD_UNIT_H_ - -#define COLOR_TRANPARENT 0xFF000000 - -class c_surface; -class c_word -{ -public: - static void initiallize(LANGUAGE_TYPE language); - static void draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void draw_string(c_surface* surface, int z_order, unsigned long str_id, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void draw_string_in_rect(c_surface* surface, int z_order, unsigned long str_id, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type = ALIGN_LEFT); - static void value_2_string(int value, int dot_position, char* buf, int len); - - static int get_str_pixel_length(const char *s, const GUI_FONT* font); - static const int get_font_ysize(const GUI_FONT* font_type); - static const char* get_string(unsigned long str_id); - -private: - static int get_char_cnt_in_single_line(const char *s); - static void draw_single_line_string(c_surface* surface, int z_order, const char *s, int x, int y, int len, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color); - static int draw_single_char(c_surface* surface, int z_order, unsigned short code, int x, int y, const GUI_FONT* font, unsigned int font_color, unsigned int bg_color); - static void draw_lattice(c_surface* surface, int z_order, int x, int y, int width, int height, int bytes_per_line, const unsigned char* pData, unsigned int font_color, unsigned int bg_color, unsigned int font_aa_flag); - static void draw_bit_line(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color); - static void draw_bit_line_AA(c_surface* surface, int z_order, int x, int y, unsigned char const*p, int width, unsigned int font_color, unsigned int bg_color); - - static const GUI_FONT_PROP* find_font_prop(const GUI_FONT_PROP* pProp, unsigned short code); - static void get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, unsigned int align_type, int &x, int &y); - static bool is_AA_font(const GUI_CHARINFO* pCharInfo); - - static const MULTI_LAN_STRINGS *m_lang_map; - static LANGUAGE_TYPE m_lang_type; -private: - c_word(){}; - c_word(const c_word&); - c_word& operator=(const c_word&); - ~c_word(){} -}; - -#endif diff --git a/gui/gui.vcxproj b/gui/gui.vcxproj index b14fc42..a1218fd 100644 --- a/gui/gui.vcxproj +++ b/gui/gui.vcxproj @@ -72,10 +72,18 @@ $(SolutionDir)$(Configuration)\ $(Configuration)\ + ..\core;$(IncludePath) $(SolutionDir)\$(Configuration)\ $(Configuration)\ + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); @@ -148,18 +156,19 @@ - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/gui/gui.vcxproj.filters b/gui/gui.vcxproj.filters index b459cc7..c185b9e 100644 --- a/gui/gui.vcxproj.filters +++ b/gui/gui.vcxproj.filters @@ -17,39 +17,6 @@ - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - - - Header Files\core_include - Header Files\gui_include @@ -83,12 +50,48 @@ Header Files\gui_include - - Header Files\core_include - Header Files\gui_include + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + + + Header Files\core_include + diff --git a/gui/gui_include/slide_group.h b/gui/gui_include/slide_group.h index 4619072..c3dd91d 100644 --- a/gui/gui_include/slide_group.h +++ b/gui/gui_include/slide_group.h @@ -3,8 +3,6 @@ #define MAX_PAGES 5 -#include "../core_include/surface.h" - class c_slide_group : public c_wnd { public: c_slide_group(); diff --git a/gui/src/button.cpp b/gui/src/button.cpp index 34d3212..cfa6b54 100644 --- a/gui/src/button.cpp +++ b/gui/src/button.cpp @@ -1,14 +1,14 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/resource_type.h" -#include "../core_include/bitmap.h" -#include "../core_include/word.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/resource_type.h" +#include "core_include/bitmap.h" +#include "core_include/word.h" +#include "core_include/surface.h" #include "../gui_include/font.h" #include "../gui_include/button.h" #include "../gui_include/dialog.h" -#include "../core_include/surface.h" #include "../gui_include/shape_resource.h" void c_button::pre_create_wnd() diff --git a/gui/src/dialog.cpp b/gui/src/dialog.cpp index 461e654..8f9106b 100644 --- a/gui/src/dialog.cpp +++ b/gui/src/dialog.cpp @@ -1,16 +1,17 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/msg.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/msg.h" +#include "core_include/surface.h" +#include "core_include/resource_type.h" +#include "core_include/bitmap.h" +#include "core_include/word.h" #include "../gui_include/button.h" #include "../gui_include/font.h" #include "../gui_include/dialog.h" -#include "../core_include/surface.h" #include "../gui_include/shape_resource.h" -#include "../core_include/resource_type.h" -#include "../core_include/bitmap.h" -#include "../core_include/word.h" + #include DIALOG_ARRAY c_dialog::ms_the_dialogs[MAX_DIALOG]; diff --git a/gui/src/edit.cpp b/gui/src/edit.cpp index ce9052d..4335b92 100644 --- a/gui/src/edit.cpp +++ b/gui/src/edit.cpp @@ -1,13 +1,13 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/resource_type.h" -#include "../core_include/word.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/resource_type.h" +#include "core_include/word.h" +#include "core_include/surface.h" #include "../gui_include/button.h" #include "../gui_include/label.h" #include "../gui_include/edit.h" -#include "../core_include/surface.h" #include "../gui_include/shape_resource.h" #include "../gui_include/font.h" #include "../gui_include/dialog.h" diff --git a/gui/src/gesture.cpp b/gui/src/gesture.cpp index e60bd65..993d426 100644 --- a/gui/src/gesture.cpp +++ b/gui/src/gesture.cpp @@ -1,10 +1,10 @@ -#include "../core_include/api.h" -#include "../core_include/msg.h" -#include "../core_include/rect.h" -#include "../core_include/surface.h" -#include "../core_include/display.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" +#include "core_include/api.h" +#include "core_include/msg.h" +#include "core_include/rect.h" +#include "core_include/surface.h" +#include "core_include/display.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" #include "../gui_include/dialog.h" #include "../gui_include/gesture.h" #include "../gui_include/slide_group.h" diff --git a/gui/src/keyboard.cpp b/gui/src/keyboard.cpp index c87896f..7248917 100644 --- a/gui/src/keyboard.cpp +++ b/gui/src/keyboard.cpp @@ -1,10 +1,10 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/resource_type.h" -#include "../core_include/word.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/surface.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/resource_type.h" +#include "core_include/word.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/surface.h" #include "../gui_include/button.h" #include "../gui_include/shape_resource.h" #include "../gui_include/keyboard.h" diff --git a/gui/src/label.cpp b/gui/src/label.cpp index 81d32d6..6eb6d05 100644 --- a/gui/src/label.cpp +++ b/gui/src/label.cpp @@ -1,11 +1,11 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/surface.h" -#include "../core_include/resource_type.h" -#include "../core_include/bitmap.h" -#include "../core_include/word.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/surface.h" +#include "core_include/resource_type.h" +#include "core_include/bitmap.h" +#include "core_include/word.h" #include "../gui_include/font.h" #include "../gui_include/label.h" diff --git a/gui/src/list_box.cpp b/gui/src/list_box.cpp index 75e88b4..52dab8c 100644 --- a/gui/src/list_box.cpp +++ b/gui/src/list_box.cpp @@ -1,11 +1,11 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/resource_type.h" -#include "../core_include/wnd.h" -#include "../core_include/surface.h" -#include "../core_include/bitmap.h" -#include "../core_include/word.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/resource_type.h" +#include "core_include/wnd.h" +#include "core_include/surface.h" +#include "core_include/bitmap.h" +#include "core_include/word.h" #include "../gui_include/button.h" #include "../gui_include/font.h" diff --git a/gui/src/shape_resource.cpp b/gui/src/shape_resource.cpp index 13dab3c..afa36d2 100644 --- a/gui/src/shape_resource.cpp +++ b/gui/src/shape_resource.cpp @@ -1,6 +1,6 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/surface.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/surface.h" #include "../gui_include/shape_resource.h" #define LIST_BOX_SELECT \ diff --git a/gui/src/slide_group.cpp b/gui/src/slide_group.cpp index 58c3f3d..cfa015d 100644 --- a/gui/src/slide_group.cpp +++ b/gui/src/slide_group.cpp @@ -1,9 +1,10 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/surface.h" -#include "../core_include/display.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/surface.h" +#include "core_include/display.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/surface.h" #include "../gui_include/dialog.h" #include "../gui_include/slide_group.h" diff --git a/gui/src/spinbox.cpp b/gui/src/spinbox.cpp index 8f68e81..30d2864 100644 --- a/gui/src/spinbox.cpp +++ b/gui/src/spinbox.cpp @@ -1,13 +1,13 @@ -#include "../core_include/api.h" -#include "../core_include/rect.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" -#include "../core_include/resource_type.h" -#include "../core_include/word.h" +#include "core_include/api.h" +#include "core_include/rect.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" +#include "core_include/resource_type.h" +#include "core_include/word.h" +#include "core_include/surface.h" #include "../gui_include/button.h" #include "../gui_include/font.h" #include "../gui_include/spinbox.h" -#include "../core_include/surface.h" #include "../gui_include/shape_resource.h" #define ARROW_BT_HEIGHT 55 diff --git a/gui/src/table.cpp b/gui/src/table.cpp index 58fb66d..cdbc02d 100644 --- a/gui/src/table.cpp +++ b/gui/src/table.cpp @@ -1,10 +1,10 @@ -#include "../core_include/api.h" -#include "../core_include/resource_type.h" -#include "../core_include/rect.h" -#include "../core_include/word.h" -#include "../core_include/surface.h" -#include "../core_include/cmd_target.h" -#include "../core_include/wnd.h" +#include "core_include/api.h" +#include "core_include/resource_type.h" +#include "core_include/rect.h" +#include "core_include/word.h" +#include "core_include/surface.h" +#include "core_include/cmd_target.h" +#include "core_include/wnd.h" #include "../gui_include/font.h" #include "../gui_include/table.h"