diff --git a/README.md b/README.md index 3eaecb9..fb27e90 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,16 @@ - GuiLite可以嵌入在iOS、Android、MFC、QT等其他UI系统中,让你的界面集百家之长,又不失个性。 - GuiLite鼓励混合编程,开发者可以用GuiLite接管UI部分,用Swift,Java,Go,C#,Python发开业务部分。 -## 新功能:自我监控 -**上报“编译/运行”情况至“云端”:** +相比QT、MFC,GuiLite不预设开发者的使用场景,不在具体功能上,大包大揽;用框架的简洁,换取开发的自由;GuiLite在图形绘制上面,力图一步到位,运行效率感人。 -![BuildInfo](doc/BuildInfo.png) +## 新功能:支持多种文字:Unicode +![unicode](doc/unicode.jpg) -**同步“本地数据”至“云端”:** +[如何制作多种文字资源?](https://github.com/idea4good/GuiLiteToolkit) -![DataOnCloud](doc/data_on_cloud.png) +[如何绘制Unicode文字?](https://github.com/idea4good/GuiLite/blob/master/core/src/word.cpp) + +[如何在你的APP中输入unicode字符?](https://github.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/ui_tree/Dialog/patient_setup/patient_setup_dlg_xml.cpp) ## 卓越的跨平台能力 在Mac, iOS下的运行效果: @@ -25,7 +27,19 @@ ![Win MR](doc/WinMR.gif) ![QQ group: 527251257](doc/qq.group.jpg) -相比QT、MFC,GuiLite不预设开发者的使用场景,不在具体功能上,大包大揽;用框架的简洁,换取开发的自由;GuiLite在图形绘制上面,力图一步到位,运行效率感人。 +## “换肤”功能 +![multi-theme](doc/multi-theme.png) + +[如何“换肤”?](https://github.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/SampleCode/source/resource/resource.cpp) + +## 自我监控 +**上报“编译/运行”情况至“云端”:** + +![BuildInfo](doc/BuildInfo.png) + +**同步“本地数据”至“云端”:** + +![DataOnCloud](doc/data_on_cloud.png) ## 为什么开发GuiLite?如何使用? 任何UI框架都不是为你我而生的,只有掌握核心原理,对其深度定制,才能真正掌握自己的命运!因此,我们开发了GuiLite,希望用这6千行代码揭示UI的核心原理和定制方法。 diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 856215c..1713f95 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -16,10 +16,6 @@ FILE(GLOB ADAPTER src/adapter/api_linux.cpp ADD_LIBRARY(core ${MAIN} ${ADAPTER}) -TARGET_LINK_LIBRARIES(core - pthread - dl - sample) execute_process( COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh Core diff --git a/core/core.vcxproj b/core/core.vcxproj index bf96764..d411f63 100644 --- a/core/core.vcxproj +++ b/core/core.vcxproj @@ -1,184 +1,184 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {8C80C76D-F437-4C69-BC94-252AC44171C2} - Win32Proj - core - 10.0.16299.0 - - - - StaticLibrary - true - v141 - Unicode - - - StaticLibrary - false - v141 - true - Unicode - - - StaticLibrary - true - v141 - Unicode - - - StaticLibrary - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - - - Windows - - - call "$(SolutionDir)sync.bat" "Core" - - - - - - - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - - - call "$(SolutionDir)sync.bat" "Core" - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - true - true - - - call "$(SolutionDir)sync.bat" "Core" - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - true - true - - - call "$(SolutionDir)sync.bat" "Core" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {8C80C76D-F437-4C69-BC94-252AC44171C2} + Win32Proj + core + 10.0.16299.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + + + Windows + + + call "$(SolutionDir)sync.bat" "Core" + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + + + call "$(SolutionDir)sync.bat" "Core" + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + + + call "$(SolutionDir)sync.bat" "Core" + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + + + call "$(SolutionDir)sync.bat" "Core" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/core.vcxproj.filters b/core/core.vcxproj.filters index 1f823b5..10f98a3 100644 --- a/core/core.vcxproj.filters +++ b/core/core.vcxproj.filters @@ -1,95 +1,95 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {3a033a7f-d656-4871-b7fe-f0a16aca7c8d} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - 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 - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {3a033a7f-d656-4871-b7fe-f0a16aca7c8d} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + 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 + + \ No newline at end of file diff --git a/core/core.vcxproj.user b/core/core.vcxproj.user new file mode 100644 index 0000000..6e2aec7 --- /dev/null +++ b/core/core.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/core/core_include/api.h b/core/core_include/api.h index 4c521f1..2029404 100644 --- a/core/core_include/api.h +++ b/core/core_include/api.h @@ -15,6 +15,7 @@ void do_assert(const char* file, int line); void log_out(const char* log); +#define COLOR_TRANPARENT 0xFF000000 #define GLT_RGB(r, g, b) ((0xFF << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) #define GLT_RGB_R(rgb) ((((unsigned int)(rgb)) >> 16) & 0xFF) #define GLT_RGB_G(rgb) ((((unsigned int)(rgb)) >> 8) & 0xFF) diff --git a/core/core_include/bitmap.h b/core/core_include/bitmap.h index a0cdf0c..3b9cee4 100644 --- a/core/core_include/bitmap.h +++ b/core/core_include/bitmap.h @@ -5,11 +5,11 @@ 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); + static void draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y); + static void draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *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 get_bitmap_pos(const BITMAP_INFO *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(){} diff --git a/core/core_include/resource.h b/core/core_include/resource.h new file mode 100644 index 0000000..92bdc3e --- /dev/null +++ b/core/core_include/resource.h @@ -0,0 +1,41 @@ +#ifndef _RESOURCE_H_ +#define _RESOURCE_H_ + +//BITMAP +typedef struct struct_bitmap_info +{ + unsigned short XSize; + unsigned short YSize; + unsigned short BytesPerLine; + unsigned short BitsPerPixel; + const unsigned char* pData; /* Pointer to picture data (indices) */ +} BITMAP_INFO; + +//FONT +typedef struct struct_lattice +{ + unsigned int utf8_code; + unsigned char width; + const unsigned char* p_data; +} LATTICE; + +typedef struct struct_font_info +{ + unsigned char height; + unsigned int count; + LATTICE* lattice_array; +} FONT_INFO; + +//SHAPE +#define INVALID_RGN 0xFFFFFF +#define COLOR_USERDEF GLT_RGB(41,49,49) +typedef struct struct_color_rect +{ + int l; + int t; + int r; + int b; + unsigned int color; +}COLOR_RECT; + +#endif diff --git a/core/core_include/resource_type.h b/core/core_include/resource_type.h deleted file mode 100644 index caab830..0000000 --- a/core/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/core/core_include/surface.h b/core/core_include/surface.h index b8fcdf7..0e53c39 100644 --- a/core/core_include/surface.h +++ b/core/core_include/surface.h @@ -15,26 +15,16 @@ typedef enum 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; +typedef struct struct_color_rect COLOR_RECT; class c_display; class c_surface { friend class c_display; public: 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); + virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order); + void fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects, int z_order); int get_width() { return m_width; } int get_height() { return m_height; } @@ -42,7 +32,6 @@ public: 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 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); diff --git a/core/core_include/wave_ctrl.h b/core/core_include/wave_ctrl.h index 9343aa2..fd823d1 100644 --- a/core/core_include/wave_ctrl.h +++ b/core/core_include/wave_ctrl.h @@ -24,12 +24,11 @@ public: 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(char* wave_name){ m_wave_name = wave_name;} + void set_wave_unit(char* wave_unit){ m_wave_unit = wave_unit;} - 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_font_type(const FONT_INFO* wave_name_font_type){ m_wave_name_font_type = wave_name_font_type;} + void set_wave_unit_font_type(const FONT_INFO* 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;} @@ -51,11 +50,11 @@ protected: void erase_oldest_vline(); void save_foreground(); - unsigned short m_wave_name; - unsigned short m_wave_unit; + char* m_wave_name; + char* m_wave_unit; - const GUI_FONT* m_wave_name_font_type; - const GUI_FONT* m_wave_unit_font_type; + const FONT_INFO* m_wave_name_font_type; + const FONT_INFO* m_wave_unit_font_type; unsigned int m_wave_name_color; unsigned int m_wave_unit_color; diff --git a/core/core_include/wnd.h b/core/core_include/wnd.h index 3e4f38c..4f296a1 100644 --- a/core/core_include/wnd.h +++ b/core/core_include/wnd.h @@ -1,5 +1,5 @@ -#ifndef XT_GUI_WND_H -#define XT_GUI_WND_H +#ifndef _GUI_WND_H_ +#define _GUI_WND_H_ //Window attribution #define GLT_WIN_SHOW 0x00000001 @@ -9,10 +9,8 @@ #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)(); +typedef struct struct_font_info FONT_INFO; +typedef struct struct_color_rect COLOR_RECT; class c_wnd; class c_surface; @@ -29,7 +27,7 @@ typedef struct struct_wnd_tree { c_wnd* p_wnd; unsigned int resource_id; - unsigned int caption_id; + char* str; short x; short y; short width; @@ -44,9 +42,9 @@ 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, + virtual int connect(c_wnd *parent, unsigned short resource_id, char* str, 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, + virtual c_wnd* connect_clone(c_wnd *parent, unsigned short resource_id, char* str, short x, short y, short width, short height, WND_TREE* p_child_tree = NULL); void disconnect(); virtual c_wnd* clone() = 0; @@ -60,13 +58,8 @@ public: 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; } + void set_str(char* str) { m_str = str; } + char* get_str_id() const { return m_str; } bool is_visible() const { return m_is_visible_now; } bool is_foreground(); @@ -81,8 +74,8 @@ public: 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_font_type(const FONT_INFO *font_type) { m_font_type = font_type; } + const FONT_INFO* 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; @@ -136,7 +129,8 @@ protected: 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[]); + void fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects); + void fill_rect_ex(c_rect rect, unsigned int color, const COLOR_RECT* extend_rects); protected: WND_STATUS m_status; unsigned int m_style; @@ -145,13 +139,9 @@ protected: c_wnd* m_top_child; c_wnd* m_prev_sibling; c_wnd* m_next_sibling; - unsigned short m_str_id; + char* m_str; - 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; + const FONT_INFO* m_font_type; unsigned int m_font_color; unsigned int m_bg_color; diff --git a/core/core_include/word.h b/core/core_include/word.h index b3c7f33..e87eca6 100644 --- a/core/core_include/word.h +++ b/core/core_include/word.h @@ -1,39 +1,23 @@ #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 draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const FONT_INFO* 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 FONT_INFO* 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 FONT_INFO* 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 FONT_INFO* 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); - + static int get_str_pixel_length(const char *s, const FONT_INFO* font); 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; + static int draw_single_char(c_surface* surface, int z_order, unsigned int utf8_code, int x, int y, const FONT_INFO* 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, const unsigned char* p_data, unsigned int font_color, unsigned int bg_color); + + static const LATTICE* get_lattice(const FONT_INFO* font, unsigned int utf8_code); + static void get_string_pos(const char *s, const FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y); private: c_word(){}; c_word(const c_word&); diff --git a/core/src/bitmap.cpp b/core/src/bitmap.cpp index eed6586..4206837 100644 --- a/core/src/bitmap.cpp +++ b/core/src/bitmap.cpp @@ -1,10 +1,10 @@ #include "../core_include/api.h" -#include "../core_include/resource_type.h" +#include "../core_include/resource.h" #include "../core_include/rect.h" #include "../core_include/bitmap.h" #include "../core_include/surface.h" -void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, int x, int y) +void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y) { if (0 == pBitmap) { @@ -15,7 +15,7 @@ void c_bitmap::draw_bitmap(c_surface* surface, int z_order, const GUI_BITMAP *pB (unsigned char const *)pBitmap->pData); } -void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type) +void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type) { if (0 == pBitmap) { @@ -28,7 +28,7 @@ void c_bitmap::draw_bitmap_in_rect(c_surface* surface, int z_order, const GUI_BI pBitmap->XSize, pBitmap->YSize, (unsigned char const *)pBitmap->pData); } -void c_bitmap::get_bitmap_pos(const GUI_BITMAP *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y) +void c_bitmap::get_bitmap_pos(const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y) { int x_size = pBitmap->XSize; int y_size = pBitmap->YSize; diff --git a/core/src/surface.cpp b/core/src/surface.cpp index afdaf4d..7d24c6f 100644 --- a/core/src/surface.cpp +++ b/core/src/surface.cpp @@ -4,6 +4,7 @@ #include "../core_include/wnd.h" #include "../core_include/surface.h" #include "../core_include/display.h" +#include "../core_include/resource.h" #include #include @@ -374,24 +375,28 @@ int c_surface::copy_layer_pixel_2_fb(int x, int y, unsigned int z_order) 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) +void c_surface::fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects, int z_order) { - int i = 0; - int templ, tempt, tempr, tempb; - unsigned int tempcolor; - while (INVALID_RGN != pRgn[i].l) + if (NULL == extend_rects) { - templ = (pRgn[i].l < 0) ? (r + 1 + pRgn[i].l) : pRgn[i].l + l; - tempt = (pRgn[i].t < 0) ? (b + 1 + pRgn[i].t) : pRgn[i].t + t; - tempr = (pRgn[i].r < 0) ? (r + 1 + pRgn[i].r) : pRgn[i].r + l; - tempb = (pRgn[i].b < 0) ? (b + 1 + pRgn[i].b) : pRgn[i].b + t; + return fill_rect(l, t, r, b, color, z_order); + } + + COLOR_RECT* p_item = (COLOR_RECT*)extend_rects; + int templ, tempt, tempr, tempb; + for(int i = 0; INVALID_RGN != p_item[i].l; i++) + { + templ = (p_item[i].l < 0) ? (r + 1 + p_item[i].l) : p_item[i].l + l; + tempt = (p_item[i].t < 0) ? (b + 1 + p_item[i].t) : p_item[i].t + t; + tempr = (p_item[i].r < 0) ? (r + 1 + p_item[i].r) : p_item[i].r + l; + tempb = (p_item[i].b < 0) ? (b + 1 + p_item[i].b) : p_item[i].b + t; if (templ >= tempr) tempr = templ; if (tempt >= tempb) tempb = tempt; - tempcolor = (COLOR_USERDEF == pRgn[i].color) ? (color) : pRgn[i].color; + unsigned int tempcolor = (COLOR_USERDEF == p_item[i].color) ? (color) : p_item[i].color; for (int y = tempt ; y <= tempb; y++) { @@ -400,7 +405,6 @@ void c_surface::draw_custom_shape(int l, int t, int r, int b, unsigned int color set_pixel(x , y, tempcolor, z_order); } } - i++; } } diff --git a/core/src/wave_ctrl.cpp b/core/src/wave_ctrl.cpp index ed667e2..698acf1 100644 --- a/core/src/wave_ctrl.cpp +++ b/core/src/wave_ctrl.cpp @@ -4,7 +4,7 @@ #include "../core_include/wnd.h" #include "../core_include/wave_buffer.h" #include "../core_include/surface.h" -#include "../core_include/resource_type.h" +#include "../core_include/resource.h" #include "../core_include/word.h" #include "../core_include/wave_ctrl.h" #include diff --git a/core/src/wnd.cpp b/core/src/wnd.cpp index 2deb55d..e906b8d 100644 --- a/core/src/wnd.cpp +++ b/core/src/wnd.cpp @@ -1,15 +1,13 @@ #include "../core_include/rect.h" #include "../core_include/cmd_target.h" #include "../core_include/api.h" -#include "../core_include/resource_type.h" +#include "../core_include/resource.h" #include "../core_include/bitmap.h" #include "../core_include/surface.h" #include "../core_include/wnd.h" c_wnd::c_wnd(): m_status(STATUS_NORMAL), m_style(GLT_ATTR_VISIBLE), m_parent(NULL), m_top_child(NULL), m_prev_sibling(NULL), m_next_sibling(NULL), - m_str_id(0),m_bitmap(NULL), m_bitmap_focus(NULL), m_bitmap_pushed(NULL), m_bitmap_disable(NULL), - m_font_type(NULL), m_font_color(0), m_bg_color(0), m_is_visible_now(false),m_resource_id(0), - m_z_order(Z_ORDER_LEVEL_0), m_active_child(NULL), m_surface(NULL) + m_str(0), m_font_color(0), m_bg_color(0), m_is_visible_now(false),m_resource_id(0), m_z_order(Z_ORDER_LEVEL_0), m_active_child(NULL), m_surface(NULL) { m_wnd_rect.Empty(); } @@ -23,7 +21,7 @@ void c_wnd::pre_create_wnd() m_style = GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS; } -int c_wnd::connect(c_wnd *parent, unsigned short resource_id, unsigned short str_id, +int c_wnd::connect(c_wnd *parent, unsigned short resource_id, char* str, short x, short y, short width, short height, WND_TREE* p_child_tree ) { if(0 == resource_id) @@ -58,7 +56,7 @@ int c_wnd::connect(c_wnd *parent, unsigned short resource_id, unsigned short str ASSERT(m_surface->is_valid(rect)); pre_create_wnd(); - set_str_id(str_id); + set_str(str); if ( 0 != parent ) { @@ -91,7 +89,7 @@ int c_wnd::load_child_wnd(WND_TREE *p_child_tree) } else { - p_cur->p_wnd->connect(this, p_cur->resource_id, p_cur->caption_id, + p_cur->p_wnd->connect(this, p_cur->resource_id, p_cur->str, p_cur->x, p_cur->y, p_cur->width, p_cur->height,p_cur->p_child_tree); } p_cur++; @@ -100,7 +98,7 @@ int c_wnd::load_child_wnd(WND_TREE *p_child_tree) return sum; } -c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, unsigned short str_id, +c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, char* str, short x, short y, short width, short height, WND_TREE* p_child_tree ) { if(0 == resource_id) @@ -140,7 +138,7 @@ c_wnd* c_wnd::connect_clone(c_wnd *parent, unsigned short resource_id, unsigned ASSERT(wnd->m_surface->is_valid(rect)); wnd->pre_create_wnd(); - wnd->set_str_id(str_id); + wnd->set_str(str); if ( 0 != parent ) { @@ -166,7 +164,7 @@ int c_wnd::load_clone_child_wnd(WND_TREE *p_child_tree) WND_TREE* p_cur = p_child_tree; while(p_cur->p_wnd) { - p_cur->p_wnd->connect_clone(this, p_cur->resource_id, p_cur->caption_id, + p_cur->p_wnd->connect_clone(this, p_cur->resource_id, p_cur->str, p_cur->x, p_cur->y, p_cur->width, p_cur->height,p_cur->p_child_tree); p_cur++; sum++; @@ -787,7 +785,12 @@ void c_wnd::fill_rect(c_rect rect, unsigned int rgb) m_surface->fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, rgb, m_z_order); } -void c_wnd::draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[]) +void c_wnd::fill_rect_ex(int l, int t, int r, int b, unsigned int color, const COLOR_RECT* extend_rects) { - m_surface->draw_custom_shape(l, t, r, b, color, pRgn, m_z_order); + m_surface->fill_rect_ex(l, t, r, b, color, extend_rects, m_z_order); } + +void c_wnd::fill_rect_ex(c_rect rect, unsigned int color, const COLOR_RECT* extend_rects) +{ + m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, color, extend_rects, m_z_order); +} \ No newline at end of file diff --git a/core/src/word.cpp b/core/src/word.cpp index 7807b98..6700d66 100644 --- a/core/src/word.cpp +++ b/core/src/word.cpp @@ -1,120 +1,110 @@ #include "../core_include/api.h" #include "../core_include/rect.h" -#include "../core_include/resource_type.h" +#include "../core_include/resource.h" #include "../core_include/word.h" #include "../core_include/surface.h" #include #include #define BUFFER_LEN 16 - -const MULTI_LAN_STRINGS * c_word::m_lang_map; -LANGUAGE_TYPE c_word::m_lang_type; - -extern const MULTI_LAN_STRINGS *get_multi_lan_pointer(); -extern const MULTI_LAN_UNICODES *get_unicode_lan_pointer(); -void c_word::initiallize(LANGUAGE_TYPE language) +unsigned char s_utf8_length_table[256] = { - m_lang_type = language; - m_lang_map = get_multi_lan_pointer(); + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 +}; + +inline static int get_utf8_code(const char* s, unsigned int& output_utf8_code) +{ + unsigned char* us = (unsigned char*)s; + int utf8_bytes = s_utf8_length_table[*us]; + switch (utf8_bytes) + { + case 1: + output_utf8_code = *us; + break; + case 2: + output_utf8_code = (*us << 8) | (*(us + 1)); + break; + case 3: + output_utf8_code = (*us << 16) | ((*(us + 1)) << 8) | *(us + 2); + break; + case 4: + output_utf8_code = (*us << 24) | ((*(us + 1)) << 16) | (*(us + 2) << 8) | *(us + 3); + break; + default: + ASSERT(FALSE); + break; + } + return utf8_bytes; } -void c_word::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) +void c_word::draw_value_in_rect(c_surface* surface, int z_order, int value, int dot_position, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type) { char buf[BUFFER_LEN]; value_2_string(value, dot_position, buf, BUFFER_LEN); draw_string_in_rect(surface, z_order, buf, rect, font, font_color, bg_color, align_type); } -void c_word::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) +void c_word::draw_value(c_surface* surface, int z_order, int value, int dot_position, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type) { char buf[BUFFER_LEN]; value_2_string(value, dot_position, buf, BUFFER_LEN); draw_string(surface, z_order, buf, x, y, font, font_color, bg_color, align_type); } -void c_word::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) -{ - const char* s = get_string(str_id); - if (NULL == s) - { - return; - } - draw_string_in_rect(surface, z_order, s, rect, font, font_color, bg_color, align_type); -} - -void c_word::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) +void c_word::draw_string_in_rect(c_surface* surface, int z_order, const char *s, c_rect rect, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type) { if(NULL == s) { return; } + if (NULL == font) + { + ASSERT(FALSE); + } int x, y; get_string_pos(s, font, rect, align_type, x, y); draw_string(surface, z_order, s, rect.m_left + x, rect.m_top + y, font, font_color, bg_color, ALIGN_LEFT); } -void c_word::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) +void c_word::draw_string(c_surface* surface, int z_order, const char *s, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color, unsigned int align_type) { - const char* s = get_string(str_id); if (NULL == s) { return; } - draw_string(surface, z_order, s, x, y, font, font_color, bg_color, align_type); -} - -void c_word::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) -{ - if(0 == s) - { - return; - } - for (; *s; s++) - { - int line_len = get_char_cnt_in_single_line(s); - int str_pixel_length = get_str_pixel_length(s, font); - if (align_type == ALIGN_RIGHT) - { - x = x - str_pixel_length + 1; - } - else if (align_type == ALIGN_HCENTER) - { - x = x - str_pixel_length / 2; - } - draw_single_line_string(surface, z_order, s, x, y , line_len, font, font_color, bg_color); - s += line_len; - if (*s == '\n') - { - y += font->YSize; - } - if (*s==0) - break; - } -} - -const char* c_word::get_string(unsigned long str_id) -{ - if(NULL == m_lang_map) - { - return NULL; - } - - if(str_id != m_lang_map[str_id].index) + if (NULL == font) { ASSERT(FALSE); - return NULL; } - return m_lang_map[str_id].text[m_lang_type]; -} -const int c_word::get_font_ysize(const GUI_FONT* font_type) -{ - if (!font_type) - { - return 0; + int offset = 0; + unsigned int utf8_code; + while (*s) + { + if (*s == '\n') + { + y += font->height; + offset = 0; + continue; + } + s += get_utf8_code(s, utf8_code); + offset += draw_single_char(surface, z_order, utf8_code, (x + offset), y, font, font_color, bg_color); } - return font_type->YSize; } void c_word::value_2_string(int value, int dot_position, char* buf, int len) @@ -145,50 +135,30 @@ void c_word::value_2_string(int value, int dot_position, char* buf, int len) } } -int c_word::get_char_cnt_in_single_line(const char *s) +const LATTICE* c_word::get_lattice(const FONT_INFO* font, unsigned int utf8_code) { - int len = 0; - unsigned char code_high; - while (((code_high = *(unsigned char*)s) != 0)) - { - if (code_high > 127) - { - len++; s++; - } - else - { - switch (code_high) - { - case '\n': return len; - } - } - len++; - s++; - } - return len; + int first = 0; + int last = font->count - 1; + int middle = (first + last) / 2; + + while (first <= last) + { + if (font->lattice_array[middle].utf8_code < utf8_code) + first = middle + 1; + else if (font->lattice_array[middle].utf8_code == utf8_code) + { + return &font->lattice_array[middle]; + } + else + { + last = middle - 1; + } + middle = (first + last) / 2; + } + return NULL; } -void c_word::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) -{ - int offset = 0; - while (--len >= 0) - { - offset = draw_single_char(surface, z_order, *s++, x, y, font, font_color, bg_color); - x += offset; - } -} - -const GUI_FONT_PROP* c_word::find_font_prop(const GUI_FONT_PROP* pProp, unsigned short code) -{ - for (; pProp; pProp=(GUI_FONT_PROP*) pProp->pNext) - { - if ((code>=pProp->First) && (code<=pProp->Last)) - break; - } - return pProp; -} - -int c_word::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) +int c_word::draw_single_char(c_surface* surface, int z_order, unsigned int utf8_code, int x, int y, const FONT_INFO* font, unsigned int font_color, unsigned int bg_color) { if (NULL == font) { @@ -196,137 +166,83 @@ int c_word::draw_single_char(c_surface* surface, int z_order, unsigned short cod return 0; } - const GUI_FONT_PROP* pProp = find_font_prop(font->p.pProp, code); - if (pProp) + const LATTICE* p_lattice = get_lattice(font, utf8_code); + if (p_lattice) { - const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(code - pProp->First); - int bytes_per_line = pCharInfo->BytesPerLine; - draw_lattice(surface, z_order, x, y, pCharInfo->XSize, font->YSize, - bytes_per_line, (unsigned char const *)pCharInfo->pData, font_color, bg_color, is_AA_font(pCharInfo)); - return pCharInfo->XDist; + draw_lattice(surface, z_order, x, y, p_lattice->width, font->height, p_lattice->p_data, font_color, bg_color); + return p_lattice->width; } - return 0; + + int len = font->height; + for (int y_ = 0; y_ < len; y_++) + { + for (int x_ = 0; x_ < len; x_++) + { + ((y_ % 4) == 0) ? surface->set_pixel((x + x_), (y + y_), 0, z_order) : + surface->set_pixel((x + x_), (y + y_), 0xFFFFFFFF, z_order); + } + } + return len; } void c_word::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) + const unsigned char* p_data, unsigned int font_color, unsigned int bg_color) { - int i; - if (!font_aa_flag) + unsigned int r, g, b; + unsigned int bg_color_set = (COLOR_TRANPARENT == bg_color) ? surface->get_pixel(x, y, z_order) : bg_color; + + for (int y_ = 0; y_ < height; y_++) { - for (i = 0; i < height; i++) + for (int x_ = 0; x_ < width; x_++) { - draw_bit_line(surface, z_order, x, i + y, pData, width, font_color, bg_color); - pData += bytes_per_line; - } - } - else - { - for (i = 0; i < height; i++) - { - draw_bit_line_AA(surface, z_order, x, i + y, pData, width, font_color, bg_color); - pData += bytes_per_line; - } - } -} - -void c_word::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) -{ - unsigned int color; - int diff = 0; - do - { - color = (*p & (0x80>>diff)) ? font_color : bg_color; - - if (COLOR_TRANPARENT != color) - { - surface->set_pixel(x, y, color, z_order); - } - - x++; - if (++diff == 8) - { - diff = 0; - p++; - } - } while (--width); -} - -void c_word::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) -{ - unsigned int color, current_bg_color; - unsigned int b, g, r; - - if(COLOR_TRANPARENT == bg_color) - { - current_bg_color = surface->get_pixel(x, y, z_order); - } - else - { - current_bg_color = bg_color; - } - - do - { - if (0x00 == *p) - { - if(bg_color != COLOR_TRANPARENT) + unsigned char value = *p_data; + if (0x00 == value) { - surface->set_pixel(x, y, current_bg_color, z_order); + if (bg_color != COLOR_TRANPARENT) + { + surface->set_pixel(x + x_, y + y_, bg_color_set, z_order); + } } - } - else - { - b = (GLT_RGB_B(font_color) * (*p) + GLT_RGB_B(current_bg_color) * (255 - *p)) >> 8; - g = (GLT_RGB_G(font_color) * (*p) + GLT_RGB_G(current_bg_color) * (255 - *p)) >> 8; - r = (GLT_RGB_R(font_color) * (*p) + GLT_RGB_R(current_bg_color) * (255 - *p)) >> 8; - color = GLT_RGB(r, g, b); - surface->set_pixel(x, y, color, z_order); - } - x++; - p++; - } while (--width); -} - -int c_word::get_str_pixel_length(const char *s, const GUI_FONT* font) -{ - int ret = 0; - if(0 == s) - { - return ret; - } - - for (; *s; s++) - { - int len = get_char_cnt_in_single_line(s); - - unsigned char code_high; - int last_char_xdist = 0; - - while (--len >= 0) - { - const GUI_FONT_PROP* pProp = find_font_prop(font->p.pProp, *s); - if (pProp) + else { - const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(*s - pProp->First); - - last_char_xdist = pCharInfo->XDist; + b = (GLT_RGB_B(font_color) * value + GLT_RGB_B(bg_color_set) * (255 - value)) >> 8; + g = (GLT_RGB_G(font_color) * value + GLT_RGB_G(bg_color_set) * (255 - value)) >> 8; + r = (GLT_RGB_R(font_color) * value + GLT_RGB_R(bg_color_set) * (255 - value)) >> 8; + surface->set_pixel((x + x_), (y + y_), GLT_RGB(r, g, b), z_order); } - ret += last_char_xdist; - s++; + p_data++; } - if (*s==0) - break; } - - return ret; } -void c_word::get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, unsigned int align_type, int &x, int &y) +int c_word::get_str_pixel_length(const char *s, const FONT_INFO* font) +{ + if(NULL == s) + { + return 0; + } + if (NULL == font) + { + ASSERT(FALSE); + } + + int lattice_width = 0; + unsigned int utf8_code; + int utf8_bytes; + while (*s) + { + utf8_bytes = get_utf8_code(s, utf8_code); + const LATTICE* p_lattice = get_lattice(font, utf8_code); + lattice_width += p_lattice?p_lattice->width:font->height; + s += utf8_bytes; + } + return lattice_width; +} + +void c_word::get_string_pos(const char *s, const FONT_INFO* font, c_rect rect, unsigned int align_type, int &x, int &y) { int x_size = get_str_pixel_length(s, font); - int y_size = get_font_ysize(font); + int y_size = font->height; int height = rect.m_bottom - rect.m_top + 1; int width = rect.m_right - rect.m_left + 1; @@ -387,8 +303,3 @@ void c_word::get_string_pos(const char *s, const GUI_FONT* font, c_rect rect, un break; } } - -bool c_word::is_AA_font(const GUI_CHARINFO* pCharInfo) -{ - return (pCharInfo->XSize == pCharInfo->BytesPerLine) ? true : false; -} diff --git a/doc/multi-theme.png b/doc/multi-theme.png new file mode 100644 index 0000000..de91713 Binary files /dev/null and b/doc/multi-theme.png differ diff --git a/doc/unicode.jpg b/doc/unicode.jpg new file mode 100644 index 0000000..5f6ac4a Binary files /dev/null and b/doc/unicode.jpg differ diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 7624bbb..39b4210 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -11,8 +11,6 @@ FILE(GLOB SRC src/*.cpp) ADD_LIBRARY(gui ${SRC}) -TARGET_LINK_LIBRARIES(gui core sample) - execute_process( COMMAND ${CMAKE_SOURCE_DIR}/.sync.sh Gui ) diff --git a/gui/gui.vcxproj b/gui/gui.vcxproj index c325370..5f5d365 100644 --- a/gui/gui.vcxproj +++ b/gui/gui.vcxproj @@ -1,209 +1,208 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6} - Win32Proj - gui - 10.0.16299.0 - - - - StaticLibrary - true - v141 - Unicode - - - StaticLibrary - false - v141 - true - Unicode - - - StaticLibrary - true - v141 - Unicode - - - StaticLibrary - false - v141 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - ..\core;$(IncludePath) - - - $(SolutionDir)\$(Configuration)\ - $(Configuration)\ - ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - false - true - false - Sync - - - - - Windows - - - call "$(SolutionDir)sync.bat" "Gui" - - - - - - - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - - - call "$(SolutionDir)sync.bat" "Gui" - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - true - true - - - call "$(SolutionDir)sync.bat" "Gui" - - - - - Level3 - - - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - - - Windows - true - true - - - call "$(SolutionDir)sync.bat" "Gui" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {89DB54E6-EFE1-4722-BD31-27FEBE39DFC6} + Win32Proj + gui + 10.0.16299.0 + + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + StaticLibrary + true + v141 + Unicode + + + StaticLibrary + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + ..\core;$(IncludePath) + + + $(SolutionDir)\$(Configuration)\ + $(Configuration)\ + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + ..\core;$(VC_IncludePath);$(WindowsSDK_IncludePath); + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + false + true + false + Sync + + + + + Windows + + + call "$(SolutionDir)sync.bat" "Gui" + + + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + + + call "$(SolutionDir)sync.bat" "Gui" + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + + + call "$(SolutionDir)sync.bat" "Gui" + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + true + + + call "$(SolutionDir)sync.bat" "Gui" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gui/gui.vcxproj.filters b/gui/gui.vcxproj.filters index c185b9e..8528b31 100644 --- a/gui/gui.vcxproj.filters +++ b/gui/gui.vcxproj.filters @@ -1,131 +1,128 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {ee075da6-cdde-4d0a-8c3e-4f969486d78a} - - - {545b674c-c3e9-476a-b488-f4b0cb591cfc} - - - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_include - - - Header Files\gui_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 - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {ee075da6-cdde-4d0a-8c3e-4f969486d78a} + + + {545b674c-c3e9-476a-b488-f4b0cb591cfc} + + + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_include + + + Header Files\gui_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 + + + Header Files\gui_include + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + \ No newline at end of file diff --git a/gui/gui.vcxproj.user b/gui/gui.vcxproj.user new file mode 100644 index 0000000..6e2aec7 --- /dev/null +++ b/gui/gui.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/gui/gui_include/button.h b/gui/gui_include/button.h index 3da5305..50b6859 100644 --- a/gui/gui_include/button.h +++ b/gui/gui_include/button.h @@ -2,15 +2,20 @@ #define _BUTTON_H_ #define GLT_BN_CLICKED 0x1111 - #define ON_GLT_BN_CLICKED(ctrlId, func) \ {MSG_TYPE_WND, GLT_BN_CLICKED, (c_cmd_target*)ctrlId, MSG_CALLBACK_VWV, (MsgFuncVV)(static_cast(&func))}, +typedef struct struct_bitmap_info BITMAP_INFO; class c_button : public c_wnd { public: virtual const char* get_class_name() const {return "c_button";} virtual c_wnd* clone(){return new c_button();} + + void set_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_normal = pBitmap; } + void set_focus_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_focus = pBitmap; } + void set_pushed_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_pushed = pBitmap; } + void set_disable_bitmap(const BITMAP_INFO *pBitmap) { m_bitmap_disable = pBitmap; } protected: virtual void on_paint(); virtual void on_focus(); @@ -18,7 +23,11 @@ protected: virtual void on_touch_down(int x, int y); virtual void on_touch_up(int x, int y); virtual void pre_create_wnd(); -private: + + const BITMAP_INFO* m_bitmap_normal; + const BITMAP_INFO* m_bitmap_focus; + const BITMAP_INFO* m_bitmap_pushed; + const BITMAP_INFO* m_bitmap_disable; }; #endif diff --git a/gui/gui_include/font.h b/gui/gui_include/font.h deleted file mode 100644 index ed4b05d..0000000 --- a/gui/gui_include/font.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _FONT_H_ -#define _FONT_H_ - -#define FONT_ENG_S font_language_s -#define FONT_ENG_SB font_language_sb -#define FONT_ENG_SBM font_language_sbm -#define FONT_ENG_SMB font_language_smb -#define FONT_ENG_SMB_AA font_language_smb_aa -#define FONT_ENG_MB_AA font_language_mb_aa -#define FONT_ENG_MMB_AA font_language_mmb_aa -#define FONT_ENG_MB font_language_mb -#define FONT_ENG_LLB font_language_llb -#define FONT_ENG_LLLB font_language_lllb -#define FONT_ENG_LLLLB font_language_llllb - -const GUI_FONT * font_language_s(); -const GUI_FONT * font_language_sb(); -const GUI_FONT * font_language_sbm(); -const GUI_FONT * font_language_smb(); -const GUI_FONT * font_language_smb_aa(); -const GUI_FONT * font_language_mb_aa(); -const GUI_FONT * font_language_mmb_aa(); -const GUI_FONT * font_language_mb(); -const GUI_FONT * font_language_llb(); -const GUI_FONT * font_language_lllb(); -const GUI_FONT * font_language_llllb(); - -#endif diff --git a/gui/gui_include/keyboard.h b/gui/gui_include/keyboard.h index b904227..033896c 100644 --- a/gui/gui_include/keyboard.h +++ b/gui/gui_include/keyboard.h @@ -27,7 +27,7 @@ typedef enum class c_keyboard: public c_wnd { public: - virtual int create(c_wnd *parent, unsigned short resource_id, unsigned short str_id, + virtual int create(c_wnd *parent, unsigned short resource_id, char* str, short x, short y, short width, short height, WND_TREE* p_child_tree = NULL); KEYBOARD_STATUS get_cap_status(){return m_cap_status;} void set_style(KEYBOARD_STYLE style) { m_style = style; } diff --git a/gui/gui_include/list_box.h b/gui/gui_include/list_box.h index 46d2604..0398d05 100644 --- a/gui/gui_include/list_box.h +++ b/gui/gui_include/list_box.h @@ -19,7 +19,7 @@ class c_list_box : public c_wnd { public: - int add_item(unsigned short str_id); + int add_item(char* str); void clear_item(); short get_item_count() { return m_item_total; } void select_item(short index); @@ -40,7 +40,7 @@ private: short m_selected_item; short m_item_total; - unsigned short m_item_array[MAX_ITEM_NUM]; + char* m_item_array[MAX_ITEM_NUM]; c_rect m_list_wnd_rect; //rect relative to parent wnd. c_rect m_list_screen_rect; //rect relative to physical screen(frame buffer) }; diff --git a/gui/gui_include/my_resource.h b/gui/gui_include/my_resource.h new file mode 100644 index 0000000..c1b3835 --- /dev/null +++ b/gui/gui_include/my_resource.h @@ -0,0 +1,81 @@ +#ifndef _MY_RESOURCE_H_ +#define _MY_RESOURCE_H_ + +typedef struct struct_font_info FONT_INFO; +typedef struct struct_color_rect COLOR_RECT; +typedef struct struct_bitmap_info BITMAP_INFO; + +//Redefine them to meet your need. +#define DEFAULT_NORMAL_COLOR GLT_RGB(211, 211, 211) +#define DEFAULT_FOCUS_COLOR GLT_RGB(188, 185, 182) +#define DEFAULT_PUSH_COLOR GLT_RGB(165, 162, 159) +#define DEFAULT_FONT_COLOR GLT_RGB(0, 0, 0) + +enum FONT_TYPE +{ + FONT_ENG_S, + FONT_ENG_SB, + FONT_ENG_SBM, + FONT_ENG_SMB, + FONT_ENG_SMB_AA, + FONT_ENG_MB_AA, + FONT_ENG_MMB_AA, + FONT_ENG_MB, + FONT_ENG_LLB, + FONT_ENG_LLLB, + FONT_ENG_LLLLB, + + FONT_MAX +}; + +enum BITMAP_TYPE +{ + BITMAP_UP_BT_NORMAL, + BITMAP_UP_BT_FOCUS, + BITMAP_DOWN_BT_NORMAL, + BITMAP_DOWN_BT_FOCUS, + + BITMAP_MAX +}; + +enum SHAPE_TYPE +{ + BUTTON_NORMAL, + BUTTON_FOCUS, + BUTTON_PUSH, + + LIST_BOX_SELECT, + LIST_BOX_PUSH, + LIST_BOX_EXTEND, + + KEY_BUTTON_NORMAL, + KEY_BUTTON_PUSH, + + SHAPE_MAX +}; + +enum COLOR_TYPE +{ + CTRL_BACK_GROUND, + CTRL_FORE_GROUND, + + COLOR_MAX +}; + +class c_my_resource +{ +public: + static int add_font(FONT_TYPE index, const FONT_INFO* font); + static const FONT_INFO* get_font(FONT_TYPE index); + + static int add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp); + static const BITMAP_INFO* get_bmp(BITMAP_TYPE index); + + static int add_shape(SHAPE_TYPE index, const COLOR_RECT* shape); + static const COLOR_RECT* get_shape(SHAPE_TYPE index); + + static int add_color(COLOR_TYPE index, const unsigned int color); + static const unsigned int get_color(COLOR_TYPE index); +}; + +#endif diff --git a/gui/gui_include/shape_resource.h b/gui/gui_include/shape_resource.h deleted file mode 100644 index 4f0fdf1..0000000 --- a/gui/gui_include/shape_resource.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SHAPE_RESOURCE_H_ -#define _SHAPE_RESOURCE_H_ - -extern const CUSTOM_SHAPE g_shape_btn_focus[]; -extern const CUSTOM_SHAPE g_shape_btn_normal[]; -extern const CUSTOM_SHAPE g_shape_btn_push[]; -extern const CUSTOM_SHAPE g_shape_btn_disable[]; - -extern const CUSTOM_SHAPE g_shape_listbox_select[]; -extern const CUSTOM_SHAPE g_shape_listbox_push[]; -extern const CUSTOM_SHAPE g_shape_listbox_push_top[]; -extern const CUSTOM_SHAPE g_shape_listbox_extend[]; - -extern const CUSTOM_SHAPE g_shape_keyboard_btn_normal[]; -extern const CUSTOM_SHAPE g_shape_keyboard_btn_push[]; - -#endif diff --git a/gui/gui_include/spinbox.h b/gui/gui_include/spinbox.h index f8b4632..b4c5f2a 100644 --- a/gui/gui_include/spinbox.h +++ b/gui/gui_include/spinbox.h @@ -58,10 +58,10 @@ protected: short m_min; short m_digit; - c_button m_bt_arrow_up; - c_button m_bt_arrow_down; - c_rect m_bt_arrow_up_rect; - c_rect m_bt_arrow_down_rect; + c_button m_bt_up; + c_button m_bt_down; + c_rect m_bt_up_rect; + c_rect m_bt_down_rect; }; #endif diff --git a/gui/gui_include/table.h b/gui/gui_include/table.h index 4dc9b58..880560e 100644 --- a/gui/gui_include/table.h +++ b/gui/gui_include/table.h @@ -17,7 +17,6 @@ public: int set_col_width(unsigned int index, unsigned int width); int set_item(int row, int col, char* str, unsigned int with_bg_color = -1); - int set_item(int row, int col, unsigned int str_id, unsigned int with_bg_color = -1); unsigned int get_row_num(){ return m_row_num;} unsigned int get_col_num(){ return m_col_num;} @@ -26,7 +25,6 @@ protected: virtual void pre_create_wnd(); void draw_item(int col, int row, const char* str, unsigned int with_bg_color = -1); - void draw_item(int col, int row, unsigned int str_id, unsigned int with_bg_color = -1); unsigned int m_align_type; unsigned int m_row_num; diff --git a/gui/src/button.cpp b/gui/src/button.cpp index cfa6b54..74d317b 100644 --- a/gui/src/button.cpp +++ b/gui/src/button.cpp @@ -2,21 +2,20 @@ #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/resource.h" #include "core_include/bitmap.h" #include "core_include/word.h" #include "core_include/surface.h" -#include "../gui_include/font.h" +#include "../gui_include/my_resource.h" #include "../gui_include/button.h" #include "../gui_include/dialog.h" -#include "../gui_include/shape_resource.h" void c_button::pre_create_wnd() { m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; - m_font_type = FONT_ENG_SMB_AA(); - m_font_color = GLT_RGB(255,255,255); - m_bg_color = GLT_RGB(36,36,36); + m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA); + m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); + m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); } void c_button::on_focus() @@ -56,16 +55,15 @@ void c_button::on_paint() switch(m_status) { - case STATUS_PUSHED: - if (m_bitmap_pushed) + case STATUS_NORMAL: + if (m_bitmap_normal) { - c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_pushed, rect, m_style); + c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_normal, rect, m_style); } else { - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_push); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL)); } - m_font_color = GLT_RGB(255,255,255); break; case STATUS_FOCUSED: if (m_bitmap_focus) @@ -74,39 +72,26 @@ void c_button::on_paint() } else { - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS)); } - m_font_color = GLT_RGB(255,255,255); break; - case STATUS_NORMAL: - if (m_bitmap) + case STATUS_PUSHED: + if (m_bitmap_pushed) { - c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap, rect, m_style); + c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_pushed, rect, m_style); } else { - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_PUSH)); } - m_font_color = GLT_RGB(255,255,255); - break; - case STATUS_DISABLED: - if (m_bitmap_disable) - { - c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_disable, rect, m_style); - } - else - { - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_disable); - } - m_font_color = GLT_RGB(70,73,76); break; default: ASSERT(FALSE); break; } - if (m_str_id) + if (m_str) { - c_word::draw_string_in_rect(m_surface, m_z_order, m_str_id, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style); + c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style); } } diff --git a/gui/src/dialog.cpp b/gui/src/dialog.cpp index 8f9106b..ababc29 100644 --- a/gui/src/dialog.cpp +++ b/gui/src/dialog.cpp @@ -4,13 +4,12 @@ #include "core_include/wnd.h" #include "core_include/msg.h" #include "core_include/surface.h" -#include "core_include/resource_type.h" +#include "core_include/resource.h" #include "core_include/bitmap.h" #include "core_include/word.h" #include "../gui_include/button.h" -#include "../gui_include/font.h" +#include "../gui_include/my_resource.h" #include "../gui_include/dialog.h" -#include "../gui_include/shape_resource.h" #include @@ -40,9 +39,9 @@ void c_dialog::on_paint() } } - if (m_str_id) + if (m_str) { - c_word::draw_string(m_surface, m_z_order, m_str_id, rect.m_left+35, rect.m_top, FONT_ENG_MB_AA(), GLT_RGB(255, 255, 255), COLOR_TRANPARENT, ALIGN_LEFT); + c_word::draw_string(m_surface, m_z_order, m_str, rect.m_left+35, rect.m_top, c_my_resource::get_font(FONT_ENG_MB_AA), GLT_RGB(255, 255, 255), COLOR_TRANPARENT, ALIGN_LEFT); } } diff --git a/gui/src/edit.cpp b/gui/src/edit.cpp index 4335b92..43ff273 100644 --- a/gui/src/edit.cpp +++ b/gui/src/edit.cpp @@ -2,14 +2,13 @@ #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/resource.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 "../gui_include/shape_resource.h" -#include "../gui_include/font.h" +#include "../gui_include/my_resource.h" #include "../gui_include/dialog.h" #include "../gui_include/keyboard.h" #include @@ -27,9 +26,9 @@ static c_keyboard s_keyboard; void c_edit::pre_create_wnd() { m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER | KEY_BOARD_STYLE; - m_font_type = FONT_ENG_SMB_AA(); - m_font_color = GLT_RGB(33,41,57); - m_bg_color = GLT_RGB(2,124,165); + m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA); + m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); + m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); memset(m_str_input, 0, sizeof(m_str_input)); memset(m_str, 0, sizeof(m_str)); @@ -114,14 +113,14 @@ void c_edit::on_paint() empty_rect.Empty(); switch(m_status) { - case STATUS_PUSHED: - if (m_z_order == m_parent->get_z_order()) + case STATUS_NORMAL: + if (m_z_order > m_parent->get_z_order()) { - m_z_order++; - show_keyboard(); + s_keyboard.disconnect(); + m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order()); + m_z_order = m_parent->get_z_order(); } - m_surface->draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_select, m_parent->get_z_order()); - m_font_color = GLT_RGB(255,255,255); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL)); break; case STATUS_FOCUSED: if (m_z_order > m_parent->get_z_order()) @@ -130,18 +129,15 @@ void c_edit::on_paint() m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order()); m_z_order = m_parent->get_z_order(); } - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus); - m_font_color = GLT_RGB(255,255,255); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS)); break; - case STATUS_NORMAL: - if (m_z_order > m_parent->get_z_order()) + case STATUS_PUSHED: + if (m_z_order == m_parent->get_z_order()) { - s_keyboard.disconnect(); - m_surface->set_frame_layer(empty_rect, s_keyboard.get_z_order()); - m_z_order = m_parent->get_z_order(); + m_z_order++; + show_keyboard(); } - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal); - m_font_color = GLT_RGB(255,255,255); + m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_bg_color, c_my_resource::get_shape(LIST_BOX_SELECT), m_parent->get_z_order()); break; default: ASSERT(FALSE); diff --git a/gui/src/keyboard.cpp b/gui/src/keyboard.cpp index 7248917..d10a818 100644 --- a/gui/src/keyboard.cpp +++ b/gui/src/keyboard.cpp @@ -1,12 +1,12 @@ #include "core_include/api.h" #include "core_include/rect.h" -#include "core_include/resource_type.h" +#include "core_include/resource.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/my_resource.h" #include "../gui_include/keyboard.h" #include @@ -145,16 +145,16 @@ ON_GLT_BN_CLICKED('\n', c_keyboard::on_enter_clicked) ON_GLT_BN_CLICKED(0x1B, c_keyboard::on_esc_clicked) GLT_END_MESSAGE_MAP() -int c_keyboard::create(c_wnd *parent, unsigned short resource_id, unsigned short str_id, +int c_keyboard::create(c_wnd *parent, unsigned short resource_id, char* str, short x, short y, short width, short height, WND_TREE* p_child_tree) { if (m_style == STYLE_ALL_BOARD) { - return c_wnd::connect(parent, resource_id, str_id, (0 - x), (height - y - KEYBOARD_HEIGHT), KEYBOARD_WIDTH, KEYBOARD_HEIGHT, g_key_board_children); + return c_wnd::connect(parent, resource_id, str, (0 - x), (height - y - KEYBOARD_HEIGHT), KEYBOARD_WIDTH, KEYBOARD_HEIGHT, g_key_board_children); } else if(m_style == STYLE_NUM_BOARD) { - return c_wnd::connect(parent, resource_id, str_id, x, y, NUM_BOARD_WIDTH, NUM_BOARD_HEIGHT, g_number_board_children); + return c_wnd::connect(parent, resource_id, str, x, y, NUM_BOARD_WIDTH, NUM_BOARD_HEIGHT, g_number_board_children); } else { @@ -230,14 +230,14 @@ void c_keyboard_button::on_paint() get_screen_rect(rect); switch(m_status) { - case STATUS_PUSHED: - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_keyboard_btn_push); + case STATUS_NORMAL: + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(KEY_BUTTON_NORMAL)); break; case STATUS_FOCUSED: - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS)); break; - case STATUS_NORMAL: - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_keyboard_btn_normal); + case STATUS_PUSHED: + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(KEY_BUTTON_PUSH)); break; default: ASSERT(FALSE); diff --git a/gui/src/label.cpp b/gui/src/label.cpp index 6eb6d05..6b2cfa1 100644 --- a/gui/src/label.cpp +++ b/gui/src/label.cpp @@ -3,10 +3,10 @@ #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/resource.h" #include "core_include/bitmap.h" #include "core_include/word.h" -#include "../gui_include/font.h" +#include "../gui_include/my_resource.h" #include "../gui_include/label.h" void c_label::pre_create_wnd() @@ -14,7 +14,7 @@ void c_label::pre_create_wnd() m_style = GLT_ATTR_VISIBLE | ALIGN_LEFT | ALIGN_VCENTER; m_font_color = GLT_RGB(255,255,255); - m_font_type = FONT_ENG_SMB_AA(); + m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA); m_bg_color = get_parent()->get_bg_color(); } @@ -23,15 +23,9 @@ void c_label::on_paint() c_rect rect; get_screen_rect(rect); - if (m_bitmap) + if (m_str) { fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom,m_bg_color); - c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap, rect, m_style); - } - - if (m_str_id) - { - fill_rect(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom,m_bg_color); - c_word::draw_string_in_rect(m_surface, m_z_order, m_str_id, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style); + c_word::draw_string_in_rect(m_surface, m_z_order, m_str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_style); } } diff --git a/gui/src/list_box.cpp b/gui/src/list_box.cpp index 52dab8c..b2d1cd3 100644 --- a/gui/src/list_box.cpp +++ b/gui/src/list_box.cpp @@ -1,17 +1,16 @@ #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/resource.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" +#include "../gui_include/my_resource.h" #include "../gui_include/dialog.h" #include "../gui_include/list_box.h" -#include "../gui_include/shape_resource.h" #include #define ITEM_HEIGHT 45 @@ -21,15 +20,16 @@ void c_list_box::pre_create_wnd() m_style |= GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; memset(m_item_array, 0, sizeof(m_item_array)); m_item_total = 0; + m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); } void c_list_box::on_init_children() { m_item_total = 0; m_selected_item = 0; - m_font_type = FONT_ENG_SMB_AA(); - m_font_color = GLT_RGB(255,255,255); - m_bg_color = GLT_RGB(33,41,57); + m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA); + m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); + m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); } void c_list_box::on_focus() @@ -52,10 +52,25 @@ void c_list_box::on_paint() switch(m_status) { + case STATUS_NORMAL: + if (m_z_order > m_parent->get_z_order()) + { + m_surface->set_frame_layer(empty_rect, m_z_order); + m_z_order = m_parent->get_z_order(); + } + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL)); + break; + case STATUS_FOCUSED: + if (m_z_order > m_parent->get_z_order()) + { + m_surface->set_frame_layer(empty_rect, m_z_order); + m_z_order = m_parent->get_z_order(); + } + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS)); + break; case STATUS_PUSHED: - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_push); - m_font_color = GLT_RGB(2,124,165); - c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font_type, m_font_color, COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(LIST_BOX_PUSH)); + c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], rect, m_font_type, GLT_RGB(2, 124, 165), COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER); //draw list if (m_item_total > 0) { @@ -68,35 +83,6 @@ void c_list_box::on_paint() return; } break; - case STATUS_FOCUSED: - if (m_z_order > m_parent->get_z_order()) - { - m_surface->set_frame_layer(empty_rect, m_z_order); - m_z_order = m_parent->get_z_order(); - } - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus); - m_font_color = GLT_RGB(255,255,255); - break; - case STATUS_NORMAL: - if (m_z_order > m_parent->get_z_order()) - { - m_surface->set_frame_layer(empty_rect, m_z_order); - m_z_order = m_parent->get_z_order(); - } - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal); - m_font_color = GLT_RGB(255,255,255); - break; - case STATUS_DISABLED: - if (m_bitmap_disable) - { - c_bitmap::draw_bitmap_in_rect(m_surface, m_z_order, m_bitmap_disable, rect, m_style); - } - else - { - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_disable); - } - m_font_color = GLT_RGB(70,73,76); - break; default: ASSERT(FALSE); break; @@ -175,7 +161,7 @@ void c_list_box::update_list_size() void c_list_box::show_list() { - draw_custom_shape(m_list_screen_rect.m_left, m_list_screen_rect.m_top, m_list_screen_rect.m_right, m_list_screen_rect.m_bottom, m_bg_color, g_shape_listbox_extend); + fill_rect_ex(m_list_screen_rect, m_bg_color, c_my_resource::get_shape(LIST_BOX_EXTEND)); m_font_color = GLT_RGB(255, 255, 255); //draw all items @@ -195,20 +181,20 @@ void c_list_box::show_list() tmp_rect.m_top = m_list_screen_rect.m_top + m_selected_item * ITEM_HEIGHT; tmp_rect.m_bottom = tmp_rect.m_top + ITEM_HEIGHT; - draw_custom_shape(tmp_rect.m_left, tmp_rect.m_top, tmp_rect.m_right, tmp_rect.m_bottom, GLT_RGB(0, 255, 0), g_shape_listbox_select); + fill_rect_ex(tmp_rect, GLT_RGB(0, 255, 0), c_my_resource::get_shape(LIST_BOX_SELECT)); m_font_color = GLT_RGB(255, 255, 255); c_word::draw_string_in_rect(m_surface, m_z_order, m_item_array[m_selected_item], tmp_rect, m_font_type, m_font_color, COLOR_TRANPARENT, ALIGN_HCENTER | ALIGN_VCENTER); } -int c_list_box::add_item(unsigned short str_id) +int c_list_box::add_item(char* str) { if (m_item_total >= MAX_ITEM_NUM) { ASSERT(FALSE); return -1; } - m_item_array[m_item_total++] = str_id; + m_item_array[m_item_total++] = str; update_list_size(); return 0; } diff --git a/gui/src/my_resource.cpp b/gui/src/my_resource.cpp new file mode 100644 index 0000000..e63f304 --- /dev/null +++ b/gui/src/my_resource.cpp @@ -0,0 +1,52 @@ +#include "core_include/rect.h" +#include "core_include/resource.h" +#include "../gui_include/my_resource.h" + +static const FONT_INFO* s_font_map[FONT_MAX]; +static const BITMAP_INFO* s_bmp_map[BITMAP_MAX]; +static const COLOR_RECT* s_shape_map[SHAPE_MAX]; +static unsigned int s_color_map[COLOR_MAX]; + +int c_my_resource::add_font(FONT_TYPE index, const FONT_INFO* font) +{ + s_font_map[index] = font; + return 0; +} + +const FONT_INFO* c_my_resource::get_font(FONT_TYPE index) +{ + return s_font_map[index]; +} + +int c_my_resource::add_bitmap(BITMAP_TYPE index, const BITMAP_INFO* bmp) +{ + s_bmp_map[index] = bmp; + return 0; +} + +const BITMAP_INFO* c_my_resource::get_bmp(BITMAP_TYPE index) +{ + return s_bmp_map[index]; +} + +int c_my_resource::add_shape(SHAPE_TYPE index, const COLOR_RECT* shape) +{ + s_shape_map[index] = shape; + return 0; +} + +const COLOR_RECT* c_my_resource::get_shape(SHAPE_TYPE index) +{ + return s_shape_map[index]; +} + +int c_my_resource::add_color(COLOR_TYPE index, const unsigned int color) +{ + s_color_map[index] = color; + return 0; +} + +const unsigned int c_my_resource::get_color(COLOR_TYPE index) +{ + return s_color_map[index]; +} \ No newline at end of file diff --git a/gui/src/shape_resource.cpp b/gui/src/shape_resource.cpp deleted file mode 100644 index afa36d2..0000000 --- a/gui/src/shape_resource.cpp +++ /dev/null @@ -1,1291 +0,0 @@ -#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 \ -{ \ - {0,0,0,-1, GLT_RGB(2,124,165)}, \ - {1,1,1,-2, GLT_RGB(2,124,165)}, \ - {2,2,2,-3, GLT_RGB(2,124,165)}, \ - \ - {-1,0,-1,-1, GLT_RGB(2,124,165)}, \ - {-2,1,-2,-2, GLT_RGB(2,124,165)}, \ - {-3,2,-3,-3, GLT_RGB(2,124,165)}, \ - \ - {1,0,-2,0, GLT_RGB(2,124,165)}, \ - {2,1,-3,1, GLT_RGB(2,124,165)}, \ - {3,2,-4,2, GLT_RGB(2,124,165)}, \ - \ - {1,-1,-2,-1, GLT_RGB(2,124,165)}, \ - {2,-2,-3,-2, GLT_RGB(2,124,165)}, \ - {3,-3,-4,-3, GLT_RGB(2,124,165)}, \ - \ - {3,3,-4,-4, GLT_RGB(2,124,165)}, \ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define BUTTON_NORMAL \ -{\ - {4,0,-5,0, GLT_RGB(2,124,165)}, \ - {0,4,0,-5, GLT_RGB(2,124,165)}, \ - {4,-1,-5,-1, GLT_RGB(2,124,165)}, \ - {-1,4,-1,-5, GLT_RGB(2,124,165)}, \ - \ - {4,1,-5,1, COLOR_USERDEF}, \ - {3,2,-4,2, COLOR_USERDEF}, \ - {2,3,-3,3, COLOR_USERDEF}, \ - {1,4,-2,4, COLOR_USERDEF}, \ - \ - {4,-2,-5,-2, COLOR_USERDEF}, \ - {3,-3,-4,-3, COLOR_USERDEF}, \ - {2,-4,-3,-4, COLOR_USERDEF}, \ - {1,-5,-2,-5, COLOR_USERDEF}, \ - \ - {1,4,-2,-5, COLOR_USERDEF}, \ - \ - {-4,0,-4,0, GLT_RGB(2,124,165)}, \ - {-4,1,-4,1, GLT_RGB(2,124,165)}, \ - {-3,0,-3,0, GLT_RGB(2,124,165)}, \ - {-3,1,-3,1, GLT_RGB(2,124,165)}, \ - {-3,2,-3,2, GLT_RGB(2,124,165)}, \ - {-2,1,-2,1, GLT_RGB(2,124,165)}, \ - {-2,2,-2,2, GLT_RGB(2,124,165)}, \ - {-2,3,-2,3, GLT_RGB(2,124,165)}, \ - {-1,2,-1,2, GLT_RGB(2,124,165)}, \ - {-1,3,-1,3, GLT_RGB(2,124,165)}, \ - \ - {3,0,3,0, GLT_RGB(2,124,165)}, \ - {3,1,3,1, GLT_RGB(2,124,165)}, \ - {2,0,2,0, GLT_RGB(2,124,165)}, \ - {2,1,2,1, GLT_RGB(2,124,165)}, \ - {2,2,2,2, GLT_RGB(2,124,165)}, \ - {1,1,1,1, GLT_RGB(2,124,165)}, \ - {1,2,1,2, GLT_RGB(2,124,165)}, \ - {1,3,1,3, GLT_RGB(2,124,165)}, \ - {0,2,0,2, GLT_RGB(2,124,165)}, \ - {0,3,0,3, GLT_RGB(2,124,165)}, \ - \ - {3,-1,3,-1, GLT_RGB(2,124,165)}, \ - {3,-2,3,-2, GLT_RGB(2,124,165)}, \ - {2,-1,2,-1, GLT_RGB(2,124,165)}, \ - {2,-2,2,-2, GLT_RGB(2,124,165)}, \ - {2,-3,2,-3, GLT_RGB(2,124,165)}, \ - {1,-2,1,-2, GLT_RGB(2,124,165)}, \ - {1,-3,1,-3, GLT_RGB(2,124,165)}, \ - {1,-4,1,-4, GLT_RGB(2,124,165)}, \ - {0,-3,0,-3, GLT_RGB(2,124,165)}, \ - {0,-4,0,-4, GLT_RGB(2,124,165)}, \ - \ - {-4,-1,-4,-1, GLT_RGB(2,124,165)}, \ - {-4,-2,-4,-2, GLT_RGB(2,124,165)}, \ - {-3,-1,-3,-1, GLT_RGB(2,124,165)}, \ - {-3,-2,-3,-2, GLT_RGB(2,124,165)}, \ - {-3,-3,-3,-3, GLT_RGB(2,124,165)}, \ - {-2,-2,-2,-2, GLT_RGB(2,124,165)}, \ - {-2,-3,-2,-3, GLT_RGB(2,124,165)}, \ - {-2,-4,-2,-4, GLT_RGB(2,124,165)}, \ - {-1,-3,-1,-3, GLT_RGB(2,124,165)}, \ - {-1,-4,-1,-4, GLT_RGB(2,124,165)}, \ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define BUTTON_FOCUS \ -{ \ - {4,0,-5,0, GLT_RGB(2,124,165)}, \ - {0,4,0,-5, GLT_RGB(2,124,165)}, \ - {4,-1,-5,-1, GLT_RGB(2,124,165)}, \ - {-1,4,-1,-5, GLT_RGB(2,124,165)}, \ - \ - {4,1,-5,1, GLT_RGB(2,124,165)}, \ - {3,2,-4,2, GLT_RGB(2,124,165)}, \ - {2,3,-3,3, GLT_RGB(2,124,165)}, \ - {1,4,-2,4, GLT_RGB(2,124,165)}, \ - \ - {4,-2,-5,-2, GLT_RGB(2,124,165)}, \ - {3,-3,-4,-3, GLT_RGB(2,124,165)}, \ - {2,-4,-3,-4, GLT_RGB(2,124,165)}, \ - {1,-5,-2,-5, GLT_RGB(2,124,165)}, \ - \ - {1,4,-2,-5, GLT_RGB(2,124,165) }, \ - \ - {-4,0,-4,0, GLT_RGB(2,124,165)}, \ - {-4,1,-4,1, GLT_RGB(2,124,165)}, \ - {-3,0,-3,0, GLT_RGB(2,124,165)}, \ - {-3,1,-3,1, GLT_RGB(2,124,165)}, \ - {-3,2,-3,2, GLT_RGB(2,124,165)}, \ - {-2,1,-2,1, GLT_RGB(2,124,165)}, \ - {-2,2,-2,2, GLT_RGB(2,124,165)}, \ - {-2,3,-2,3, GLT_RGB(2,124,165)}, \ - {-1,2,-1,2, GLT_RGB(2,124,165)}, \ - {-1,3,-1,3, GLT_RGB(2,124,165)}, \ - \ - {3,0,3,0, GLT_RGB(2,124,165)}, \ - {3,1,3,1, GLT_RGB(2,124,165)}, \ - {2,0,2,0, GLT_RGB(2,124,165)}, \ - {2,1,2,1, GLT_RGB(2,124,165)}, \ - {2,2,2,2, GLT_RGB(2,124,165)}, \ - {1,1,1,1, GLT_RGB(2,124,165)}, \ - {1,2,1,2, GLT_RGB(2,124,165)}, \ - {1,3,1,3, GLT_RGB(2,124,165)}, \ - {0,2,0,2, GLT_RGB(2,124,165)}, \ - {0,3,0,3, GLT_RGB(2,124,165)}, \ - \ - {3,-1,3,-1, GLT_RGB(2,124,165)}, \ - {3,-2,3,-2, GLT_RGB(2,124,165)}, \ - {2,-1,2,-1, GLT_RGB(2,124,165)}, \ - {2,-2,2,-2, GLT_RGB(2,124,165)}, \ - {2,-3,2,-3, GLT_RGB(2,124,165)}, \ - {1,-2,1,-2, GLT_RGB(2,124,165)}, \ - {1,-3,1,-3, GLT_RGB(2,124,165)}, \ - {1,-4,1,-4, GLT_RGB(2,124,165)}, \ - {0,-3,0,-3, GLT_RGB(2,124,165)}, \ - {0,-4,0,-4, GLT_RGB(2,124,165)}, \ - \ - {-4,-1,-4,-1, GLT_RGB(2,124,165)}, \ - {-4,-2,-4,-2, GLT_RGB(2,124,165)}, \ - {-3,-1,-3,-1, GLT_RGB(2,124,165)}, \ - {-3,-2,-3,-2, GLT_RGB(2,124,165)}, \ - {-3,-3,-3,-3, GLT_RGB(2,124,165)}, \ - {-2,-2,-2,-2, GLT_RGB(2,124,165)}, \ - {-2,-3,-2,-3, GLT_RGB(2,124,165)}, \ - {-2,-4,-2,-4, GLT_RGB(2,124,165)}, \ - {-1,-3,-1,-3, GLT_RGB(2,124,165)}, \ - {-1,-4,-1,-4, GLT_RGB(2,124,165)}, \ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - - -#define BUTTON_PUSH \ -{ \ - {4,0,-5,0, GLT_RGB(0,255,0)}, \ - {0,4,0,-5, GLT_RGB(0,255,0)}, \ - {4,-1,-5,-1, GLT_RGB(0,255,0)}, \ - {-1,4,-1,-5, GLT_RGB(0,255,0)}, \ - \ - {4,1,-5,1, COLOR_USERDEF}, \ - {3,2,-4,2, COLOR_USERDEF}, \ - {2,3,-3,3, COLOR_USERDEF}, \ - {1,4,-2,4, COLOR_USERDEF}, \ - \ - {4,-2,-5,-2, COLOR_USERDEF}, \ - {3,-3,-4,-3, COLOR_USERDEF}, \ - {2,-4,-3,-4, COLOR_USERDEF}, \ - {1,-5,-2,-5, COLOR_USERDEF}, \ - \ - {1,4,-2,-5, COLOR_USERDEF }, \ - \ - {-4,0,-4,0, GLT_RGB(0,255,0)}, \ - {-4,1,-4,1, GLT_RGB(0,255,0)}, \ - {-3,0,-3,0, GLT_RGB(0,255,0)}, \ - {-3,1,-3,1, GLT_RGB(0,255,0)}, \ - {-3,2,-3,2, GLT_RGB(0,255,0)}, \ - {-2,1,-2,1, GLT_RGB(0,255,0)}, \ - {-2,2,-2,2, GLT_RGB(0,255,0)}, \ - {-2,3,-2,3, GLT_RGB(0,255,0)}, \ - {-1,2,-1,2, GLT_RGB(0,255,0)}, \ - {-1,3,-1,3, GLT_RGB(0,255,0)}, \ - \ - {3,0,3,0, GLT_RGB(0,255,0)}, \ - {3,1,3,1, GLT_RGB(0,255,0)}, \ - {2,0,2,0, GLT_RGB(0,255,0)}, \ - {2,1,2,1, GLT_RGB(0,255,0)}, \ - {2,2,2,2, GLT_RGB(0,255,0)}, \ - {1,1,1,1, GLT_RGB(0,255,0)}, \ - {1,2,1,2, GLT_RGB(0,255,0)}, \ - {1,3,1,3, GLT_RGB(0,255,0)}, \ - {0,2,0,2, GLT_RGB(0,255,0)}, \ - {0,3,0,3, GLT_RGB(0,255,0)}, \ - \ - {3,-1,3,-1, GLT_RGB(0,255,0)}, \ - {3,-2,3,-2, GLT_RGB(0,255,0)}, \ - {2,-1,2,-1, GLT_RGB(0,255,0)}, \ - {2,-2,2,-2, GLT_RGB(0,255,0)}, \ - {2,-3,2,-3, GLT_RGB(0,255,0)}, \ - {1,-2,1,-2, GLT_RGB(0,255,0)}, \ - {1,-3,1,-3, GLT_RGB(0,255,0)}, \ - {1,-4,1,-4, GLT_RGB(0,255,0)}, \ - {0,-3,0,-3, GLT_RGB(0,255,0)}, \ - {0,-4,0,-4, GLT_RGB(0,255,0)}, \ - \ - {-4,-1,-4,-1, GLT_RGB(0,255,0)}, \ - {-4,-2,-4,-2, GLT_RGB(0,255,0)}, \ - {-3,-1,-3,-1, GLT_RGB(0,255,0)}, \ - {-3,-2,-3,-2, GLT_RGB(0,255,0)}, \ - {-3,-3,-3,-3, GLT_RGB(0,255,0)}, \ - {-2,-2,-2,-2, GLT_RGB(0,255,0)}, \ - {-2,-3,-2,-3, GLT_RGB(0,255,0)}, \ - {-2,-4,-2,-4, GLT_RGB(0,255,0)}, \ - {-1,-3,-1,-3, GLT_RGB(0,255,0)}, \ - {-1,-4,-1,-4, GLT_RGB(0,255,0)}, \ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define LIST_BOX_PUSH \ -{ \ - {4,0,-5,0, GLT_RGB(2,124,165)}, \ - {0,4,0,-5, GLT_RGB(2,124,165)}, \ - {4,-1,-5,-1, GLT_RGB(2,124,165)}, \ - {-1,4,-1,-5, GLT_RGB(2,124,165)}, \ - \ - {4,1,-5,1, COLOR_USERDEF}, \ - {3,2,-4,2, COLOR_USERDEF}, \ - {2,3,-3,3, COLOR_USERDEF}, \ - {1,4,-2,4, COLOR_USERDEF}, \ - \ - {4,-2,-5,-2, COLOR_USERDEF}, \ - {3,-3,-4,-3, COLOR_USERDEF}, \ - {2,-4,-3,-4, COLOR_USERDEF}, \ - {1,-5,-2,-5, COLOR_USERDEF}, \ - \ - {1,4,-2,-5, COLOR_USERDEF}, \ - \ - /**/\ - {-4,0,-4,0, GLT_RGB(2,124,165)}, \ - {-4,1,-4,1, GLT_RGB(2,124,165)}, \ - {-3,0,-3,0, GLT_RGB(2,124,165)}, \ - {-3,1,-3,1, GLT_RGB(2,124,165)}, \ - {-3,2,-3,2, GLT_RGB(2,124,165)}, \ - {-2,1,-2,1, GLT_RGB(2,124,165)}, \ - {-2,2,-2,2, GLT_RGB(2,124,165)}, \ - {-2,3,-2,3, GLT_RGB(2,124,165)}, \ - {-1,2,-1,2, GLT_RGB(2,124,165)}, \ - {-1,3,-1,3, GLT_RGB(2,124,165)}, \ - /**/\ - {3,0,3,0, GLT_RGB(2,124,165)}, \ - {3,1,3,1, GLT_RGB(2,124,165)}, \ - {2,0,2,0, GLT_RGB(2,124,165)}, \ - {2,1,2,1, GLT_RGB(2,124,165)}, \ - {2,2,2,2, GLT_RGB(2,124,165)}, \ - {1,1,1,1, GLT_RGB(2,124,165)}, \ - {1,2,1,2, GLT_RGB(2,124,165)}, \ - {1,3,1,3, GLT_RGB(2,124,165)}, \ - {0,2,0,2, GLT_RGB(2,124,165)}, \ - {0,3,0,3, GLT_RGB(2,124,165)}, \ - /**/\ - {3,-1,3,-1, GLT_RGB(2,124,165)}, \ - {3,-2,3,-2, GLT_RGB(2,124,165)}, \ - {2,-1,2,-1, GLT_RGB(2,124,165)}, \ - {2,-2,2,-2, GLT_RGB(2,124,165)}, \ - {2,-3,2,-3, GLT_RGB(2,124,165)}, \ - {1,-2,1,-2, GLT_RGB(2,124,165)}, \ - {1,-3,1,-3, GLT_RGB(2,124,165)}, \ - {1,-4,1,-4, GLT_RGB(2,124,165)}, \ - {0,-3,0,-3, GLT_RGB(2,124,165)}, \ - {0,-4,0,-4, GLT_RGB(2,124,165)}, \ - /**/\ - {-4,-1,-4,-1, GLT_RGB(2,124,165)}, \ - {-4,-2,-4,-2, GLT_RGB(2,124,165)}, \ - {-3,-1,-3,-1, GLT_RGB(2,124,165)}, \ - {-3,-2,-3,-2, GLT_RGB(2,124,165)}, \ - {-3,-3,-3,-3, GLT_RGB(2,124,165)}, \ - {-2,-2,-2,-2, GLT_RGB(2,124,165)}, \ - {-2,-3,-2,-3, GLT_RGB(2,124,165)}, \ - {-2,-4,-2,-4, GLT_RGB(2,124,165)}, \ - {-1,-3,-1,-3, GLT_RGB(2,124,165)}, \ - {-1,-4,-1,-4, GLT_RGB(2,124,165)}, \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - - -#define LIST_BOX_EXTEND \ -{\ - {0,0,-1,0, GLT_RGB(70,73,76)}, \ - {0,0,0,-1, GLT_RGB(70,73,76)}, \ - {0,-1,-1,-1, GLT_RGB(70,73,76)}, \ - {-1,0,-1,-1, GLT_RGB(70,73,76)}, \ - {1,1,-2,-2, GLT_RGB(70,73,76)}, \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define BUTTON_DISABLE \ -{\ - {4,0,-5,0, GLT_RGB(70,73,76)}, \ - {0,4,0,-5, GLT_RGB(70,73,76)}, \ - {4,-1,-5,-1, GLT_RGB(70,73,76)}, \ - {-1,4,-1,-5, GLT_RGB(70,73,76)}, \ - {4,1,-5,1, COLOR_USERDEF}, \ - {3,2,-4,2, COLOR_USERDEF}, \ - {2,3,-3,3, COLOR_USERDEF}, \ - {1,4,-2,4, COLOR_USERDEF}, \ - {4,-2,-5,-2, COLOR_USERDEF}, \ - {3,-3,-4,-3, COLOR_USERDEF}, \ - {2,-4,-3,-4, COLOR_USERDEF}, \ - {1,-5,-2,-5, COLOR_USERDEF}, \ - {1,4,-2,-5, COLOR_USERDEF}, \ - {-4,0,-4,0, GLT_RGB(70,73,76)}, \ - {-4,1,-4,1, GLT_RGB(70,73,76)}, \ - {-3,0,-3,0, GLT_RGB(70,73,76)}, \ - {-3,1,-3,1, GLT_RGB(70,73,76)}, \ - {-3,2,-3,2, GLT_RGB(70,73,76)}, \ - {-2,1,-2,1, GLT_RGB(70,73,76)}, \ - {-2,2,-2,2, GLT_RGB(70,73,76)}, \ - {-2,3,-2,3, GLT_RGB(70,73,76)}, \ - {-1,2,-1,2, GLT_RGB(70,73,76)}, \ - {-1,3,-1,3, GLT_RGB(70,73,76)}, \ - \ - {3,0,3,0, GLT_RGB(70,73,76)}, \ - {3,1,3,1, GLT_RGB(70,73,76)}, \ - {2,0,2,0, GLT_RGB(70,73,76)}, \ - {2,1,2,1, GLT_RGB(70,73,76)}, \ - {2,2,2,2, GLT_RGB(70,73,76)}, \ - {1,1,1,1, GLT_RGB(70,73,76)}, \ - {1,2,1,2, GLT_RGB(70,73,76)}, \ - {1,3,1,3, GLT_RGB(70,73,76)}, \ - {0,2,0,2, GLT_RGB(70,73,76)}, \ - {0,3,0,3, GLT_RGB(70,73,76)}, \ - \ - {3,-1,3,-1, GLT_RGB(70,73,76)}, \ - {3,-2,3,-2, GLT_RGB(70,73,76)}, \ - {2,-1,2,-1, GLT_RGB(70,73,76)}, \ - {2,-2,2,-2, GLT_RGB(70,73,76)}, \ - {2,-3,2,-3, GLT_RGB(70,73,76)}, \ - {1,-2,1,-2, GLT_RGB(70,73,76)}, \ - {1,-3,1,-3, GLT_RGB(70,73,76)}, \ - {1,-4,1,-4, GLT_RGB(70,73,76)}, \ - {0,-3,0,-3, GLT_RGB(70,73,76)}, \ - {0,-4,0,-4, GLT_RGB(70,73,76)}, \ - \ - {-4,-1,-4,-1, GLT_RGB(70,73,76)}, \ - {-4,-2,-4,-2, GLT_RGB(70,73,76)}, \ - {-3,-1,-3,-1, GLT_RGB(70,73,76)}, \ - {-3,-2,-3,-2, GLT_RGB(70,73,76)}, \ - {-3,-3,-3,-3, GLT_RGB(70,73,76)}, \ - {-2,-2,-2,-2, GLT_RGB(70,73,76)}, \ - {-2,-3,-2,-3, GLT_RGB(70,73,76)}, \ - {-2,-4,-2,-4, GLT_RGB(70,73,76)}, \ - {-1,-3,-1,-3, GLT_RGB(70,73,76)}, \ - {-1,-4,-1,-4, GLT_RGB(70,73,76)}, \ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define KEYBOARD_BUTTON_NORAML_RGN \ -{ \ - {0,0,0,0, GLT_RGB(38,38,38)},\ - {1,0,1,0, GLT_RGB(32,32,32)},\ - {2,0,2,0, GLT_RGB(28,28,28)},\ - {3,0,-4,0, GLT_RGB(27,27,27)},\ - {-3,0,-3,0, GLT_RGB(28,28,28)},\ - {-2,0,-2,0, GLT_RGB(32,32,32)},\ - {-1,0,-1,0, GLT_RGB(38,38,38)},\ - \ - {0,1,0,1, GLT_RGB(30,30,30)},\ - {1,1,1,1, GLT_RGB(84,84,84)},\ - {2,1,2,1, GLT_RGB(123,123,123)},\ - {3,1,3,1, GLT_RGB(127,127,127)},\ - {4,1,4,1, GLT_RGB(125,125,125)},\ - {5,1,-6,1, GLT_RGB(124,124,124)},\ - {-5,1,-5,1, GLT_RGB(125,125,125)},\ - {-4,1,-4,1, GLT_RGB(127,127,127)},\ - {-3,1,-3,1, GLT_RGB(123,123,123)},\ - {-2,1,-2,1, GLT_RGB(84,84,84)},\ - {-1,1,-1,1, GLT_RGB(30,30,30)},\ - \ - {0,2,0,2, GLT_RGB(25,25,25)},\ - {1,2,1,2, GLT_RGB(130,130,130)},\ - {2,2,2,2, GLT_RGB(123,123,123)},\ - {3,2,3,2, GLT_RGB(118,118,118)},\ - {4,2,-5,2, GLT_RGB(115,115,115)},\ - {-4,2,-4,2, GLT_RGB(118,118,118)},\ - {-3,2,-3,2, GLT_RGB(123,123,123)},\ - {-2,2,-2,2, GLT_RGB(130,130,130)},\ - {-1,2,-1,2, GLT_RGB(25,25,25)},\ - \ - {0,3,0,3, GLT_RGB(25,25,25)},\ - {1,3,1,3, GLT_RGB(124,124,124)},\ - {2,3,2,3, GLT_RGB(117,117,117)},\ - {3,3,3,3, GLT_RGB(112,112,112)},\ - {4,3,-5,3, GLT_RGB(109,109,109)},\ - {-4,3,-4,3, GLT_RGB(112,112,112)},\ - {-3,3,-3,3, GLT_RGB(117,117,117)},\ - {-2,3,-2,3, GLT_RGB(124,124,124)},\ - {-1,3,-1,3, GLT_RGB(25,25,25)},\ - \ - {0,4,0,4, GLT_RGB(24,24,24)},\ - {1,4,1,4, GLT_RGB(121,121,121)},\ - {2,4,2,4, GLT_RGB(113,113,113)},\ - {3,4,3,4, GLT_RGB(107,107,107)},\ - {4,4,-5,4, GLT_RGB(105,105,105)},\ - {-4,4,-4,4, GLT_RGB(107,107,107)},\ - {-3,4,-3,4, GLT_RGB(113,113,113)},\ - {-2,4,-2,4, GLT_RGB(121,121,121)},\ - {-1,4,-1,4, GLT_RGB(24,24,24)},\ - \ - {0,5,0,5, GLT_RGB(24,24,24)},\ - {1,5,1,5, GLT_RGB(119,119,119)},\ - {2,5,2,5, GLT_RGB(111,111,111)},\ - {3,5,3,5, GLT_RGB(106,106,106)},\ - {4,5,-5,5, GLT_RGB(103,103,103)},\ - {-4,5,-4,5, GLT_RGB(106,106,106)},\ - {-3,5,-3,5, GLT_RGB(111,111,111)},\ - {-2,5,-2,5, GLT_RGB(119,119,119)},\ - {-1,5,-1,5, GLT_RGB(24,24,24)},\ - \ - {0,6,0,6, GLT_RGB(23,23,23)},\ - {1,6,1,6, GLT_RGB(117,117,117)},\ - {2,6,2,6, GLT_RGB(109,109,109)},\ - {3,6,3,6, GLT_RGB(104,104,104)},\ - {4,6,-5,6, GLT_RGB(102,102,102)},\ - {-4,6,-4,6, GLT_RGB(104,104,104)},\ - {-3,6,-3,6, GLT_RGB(109,109,109)},\ - {-2,6,-2,6, GLT_RGB(117,117,117)},\ - {-1,6,-1,6, GLT_RGB(23,23,23)},\ - \ - {0,7,0,7, GLT_RGB(23,23,23)},\ - {1,7,1,7, GLT_RGB(116,116,116)},\ - {2,7,2,7, GLT_RGB(108,108,108)},\ - {3,7,3,7, GLT_RGB(103,103,103)},\ - {4,7,-5,7, GLT_RGB(100,100,100)},\ - {-4,7,-4,7, GLT_RGB(103,103,103)},\ - {-3,7,-3,7, GLT_RGB(108,108,108)},\ - {-2,7,-2,7, GLT_RGB(116,116,116)},\ - {-1,7,-1,7, GLT_RGB(23,23,23)},\ - \ - {0,8,0,8, GLT_RGB(22,22,22)},\ - {1,8,1,8, GLT_RGB(115,115,115)},\ - {2,8,2,8, GLT_RGB(107,107,107)},\ - {3,8,3,8, GLT_RGB(101,101,101)},\ - {4,8,-5,8, GLT_RGB(99,99,99)},\ - {-4,8,-4,8, GLT_RGB(101,101,101)},\ - {-3,8,-3,8, GLT_RGB(107,107,107)},\ - {-2,8,-2,8, GLT_RGB(115,115,115)},\ - {-1,8,-1,8, GLT_RGB(22,22,22)},\ - \ - {0,9,0,9, GLT_RGB(22,22,22)},\ - {1,9,1,9, GLT_RGB(114,114,114)},\ - {2,9,2,9, GLT_RGB(105,105,105)},\ - {3,9,3,9, GLT_RGB(99,99,99)},\ - {4,9,-5,9, GLT_RGB(96,96,96)},\ - {-4,9,-4,9, GLT_RGB(99,99,99)},\ - {-3,9,-3,9, GLT_RGB(105,105,105)},\ - {-2,9,-2,9, GLT_RGB(114,114,114)},\ - {-1,9,-1,9, GLT_RGB(22,22,22)},\ - \ - {0,10,0,10, GLT_RGB(21,21,21)},\ - {1,10,1,10, GLT_RGB(112,112,112)},\ - {2,10,2,10, GLT_RGB(103,103,103)},\ - {3,10,3,10, GLT_RGB(97,97,97)},\ - {4,10,4,10, GLT_RGB(94,94,94)},\ - {5,10,-6,10, GLT_RGB(93,93,93)},\ - {-5,10,-5,10, GLT_RGB(94,94,94)},\ - {-4,10,-4,10, GLT_RGB(97,97,97)},\ - {-3,10,-3,10, GLT_RGB(103,103,103)},\ - {-2,10,-2,10, GLT_RGB(112,112,112)},\ - {-1,10,-1,10, GLT_RGB(21,21,21)},\ - \ - {0,11,0,11, GLT_RGB(21,21,21)},\ - {1,11,1,11, GLT_RGB(110,110,110)},\ - {2,11,2,11, GLT_RGB(101,101,101)},\ - {3,11,3,11, GLT_RGB(94,94,94)},\ - {4,11,4,11, GLT_RGB(91,91,91)},\ - {5,11,5,11, GLT_RGB(90,90,90)},\ - {6,11,6,11, GLT_RGB(89,89,89)},\ - {7,11,-8,11, GLT_RGB(88,88,88)},\ - {-7,11,-7,11, GLT_RGB(89,89,89)},\ - {-6,11,-6,11, GLT_RGB(90,90,90)},\ - {-5,11,-5,11, GLT_RGB(91,91,91)},\ - {-4,11,-4,11, GLT_RGB(94,94,94)},\ - {-3,11,-3,11, GLT_RGB(101,101,101)},\ - {-2,11,-2,11, GLT_RGB(110,110,110)},\ - {-1,11,-1,11, GLT_RGB(21,21,21)},\ - \ - {0,12,0,12, GLT_RGB(21,21,21)},\ - {1,12,1,12, GLT_RGB(107,107,107)},\ - {2,12,2,12, GLT_RGB(98,98,98)},\ - {3,12,3,12, GLT_RGB(91,91,91)},\ - {4,12,4,12, GLT_RGB(88,88,88)},\ - {5,12,5,12, GLT_RGB(87,87,87)},\ - {6,12,-7,12, GLT_RGB(86,86,86)},\ - {-6,12,-6,12, GLT_RGB(87,87,87)},\ - {-5,12,-5,12, GLT_RGB(88,88,88)},\ - {-4,12,-4,12, GLT_RGB(91,91,91)},\ - {-3,12,-3,12, GLT_RGB(98,98,98)},\ - {-2,12,-2,12, GLT_RGB(107,107,107)},\ - {-1,12,-1,12, GLT_RGB(21,21,21)},\ - \ - {0,13,0,13, GLT_RGB(20,20,20)},\ - {1,13,1,13, GLT_RGB(105,105,105)},\ - {2,13,2,13, GLT_RGB(95,95,95)},\ - {3,13,3,13, GLT_RGB(89,89,89)},\ - {4,13,4,13, GLT_RGB(85,85,85)},\ - {5,13,5,13, GLT_RGB(84,84,84)},\ - {6,13,-7,13, GLT_RGB(83,83,83)},\ - {-6,13,-6,13, GLT_RGB(84,84,84)},\ - {-5,13,-5,13, GLT_RGB(85,85,85)},\ - {-4,13,-4,13, GLT_RGB(89,89,89)},\ - {-3,13,-3,13, GLT_RGB(95,95,95)},\ - {-2,13,-2,13, GLT_RGB(105,105,105)},\ - {-1,13,-1,13, GLT_RGB(20,20,20)},\ - \ - {0,14,0,14, GLT_RGB(20,20,20)},\ - {1,14,1,14, GLT_RGB(103,103,103)},\ - {2,14,2,14, GLT_RGB(93,93,93)},\ - {3,14,3,14, GLT_RGB(86,86,86)},\ - {4,14,4,14, GLT_RGB(82,82,82)},\ - {5,14,-6,14, GLT_RGB(81,81,81)},\ - {-5,14,-5,14, GLT_RGB(82,82,82)},\ - {-4,14,-4,14, GLT_RGB(86,86,86)},\ - {-3,14,-3,14, GLT_RGB(93,93,93)},\ - {-2,14,-2,14, GLT_RGB(103,103,103)},\ - {-1,14,-1,14, GLT_RGB(20,20,20)},\ - \ - {0,15,0,15, GLT_RGB(20,20,20)},\ - {1,15,1,15, GLT_RGB(101,101,101)},\ - {2,15,2,15, GLT_RGB(91,91,91)},\ - {3,15,3,15, GLT_RGB(84,84,84)},\ - {4,15,4,15, GLT_RGB(80,80,80)},\ - {5,15,-6,15, GLT_RGB(79,79,79)},\ - {-5,15,-5,15, GLT_RGB(80,80,80)},\ - {-4,15,-4,15, GLT_RGB(84,84,84)},\ - {-3,15,-3,15, GLT_RGB(91,91,91)},\ - {-2,15,-2,15, GLT_RGB(101,101,101)},\ - {-1,15,-1,15, GLT_RGB(20,20,20)},\ - \ - {0,16,0,16, GLT_RGB(19,19,19)},\ - {1,16,1,16, GLT_RGB(99,99,99)},\ - {2,16,2,16, GLT_RGB(89,89,89)},\ - {3,16,3,16, GLT_RGB(82,82,82)},\ - {4,16,4,16, GLT_RGB(78,78,78)},\ - {5,16,-6,16, GLT_RGB(77,77,77)},\ - {-5,16,-5,16, GLT_RGB(78,78,78)},\ - {-4,16,-4,16, GLT_RGB(82,82,82)},\ - {-3,16,-3,16, GLT_RGB(89,89,89)},\ - {-2,16,-2,16, GLT_RGB(99,99,99)},\ - {-1,16,-1,16, GLT_RGB(19,19,19)},\ - \ - {0,17,0,17, GLT_RGB(19,19,19)},\ - {1,17,1,17, GLT_RGB(97,97,97)},\ - {2,17,2,17, GLT_RGB(86,86,86)},\ - {3,17,3,17, GLT_RGB(80,80,80)},\ - {4,17,4,17, GLT_RGB(76,76,76)},\ - {5,17,-6,17, GLT_RGB(75,75,75)},\ - {-5,17,-5,17, GLT_RGB(76,76,76)},\ - {-4,17,-4,17, GLT_RGB(80,80,80)},\ - {-3,17,-3,17, GLT_RGB(86,86,86)},\ - {-2,17,-2,17, GLT_RGB(97,97,97)},\ - {-1,17,-1,17, GLT_RGB(19,19,19)},\ - \ - {0,18,0,18, GLT_RGB(19,19,19)},\ - {1,18,1,18, GLT_RGB(95,95,95)},\ - {2,18,2,18, GLT_RGB(84,84,84)},\ - {3,18,3,18, GLT_RGB(78,78,78)},\ - {4,18,-5,18, GLT_RGB(74,74,74)},\ - {-4,18,-4,18, GLT_RGB(78,78,78)},\ - {-3,18,-3,18, GLT_RGB(84,84,84)},\ - {-2,18,-2,18, GLT_RGB(95,95,95)},\ - {-1,18,-1,18, GLT_RGB(19,19,19)},\ - \ - {0,19,0,19, GLT_RGB(18,18,18)},\ - {1,19,1,19, GLT_RGB(93,93,93)},\ - {2,19,2,19, GLT_RGB(83,83,83)},\ - {3,19,3,19, GLT_RGB(76,76,76)},\ - {4,19,-5,19, GLT_RGB(72,72,72)},\ - {-4,19,-4,19, GLT_RGB(76,76,76)},\ - {-3,19,-3,19, GLT_RGB(83,83,83)},\ - {-2,19,-2,19, GLT_RGB(93,93,93)},\ - {-1,19,-1,19, GLT_RGB(18,18,18)},\ - \ - {0,20,0,20, GLT_RGB(18,18,18)},\ - {1,20,1,20, GLT_RGB(92,92,92)},\ - {2,20,2,20, GLT_RGB(81,81,81)},\ - {3,20,3,20, GLT_RGB(75,75,75)},\ - {4,20,-5,20, GLT_RGB(71,71,71)},\ - {-4,20,-4,20, GLT_RGB(75,75,75)},\ - {-3,20,-3,20, GLT_RGB(81,81,81)},\ - {-2,20,-2,20, GLT_RGB(92,92,92)},\ - {-1,20,-1,20, GLT_RGB(18,18,18)},\ - \ - {0,21,0,21, GLT_RGB(17,17,17)},\ - {1,21,1,21, GLT_RGB(91,91,91)},\ - {2,21,2,21, GLT_RGB(81,81,81)},\ - {3,21,3,21, GLT_RGB(74,74,74)},\ - {4,21,-5,21, GLT_RGB(70,70,70)},\ - {-4,21,-4,21, GLT_RGB(74,74,74)},\ - {-3,21,-3,21, GLT_RGB(81,81,81)},\ - {-2,21,-2,21, GLT_RGB(91,91,91)},\ - {-1,21,-1,21, GLT_RGB(17,17,17)},\ - \ - {0,22,0,-16, GLT_RGB(17,17,17)},\ - {-1,22,-1,-16, GLT_RGB(17,17,17)},\ - \ - {1,22,1,-16, GLT_RGB(91,91,91)},\ - {-2,22,-2,-16, GLT_RGB(91,91,91)},\ - \ - {2,21,2,-16, GLT_RGB(81,81,81)},\ - {-3,21,-3,-16, GLT_RGB(81,81,81)},\ - \ - {3,20,3,-16, GLT_RGB(75,75,75)},\ - {-4,20,-4,-16, GLT_RGB(75,75,75)},\ - \ - {4,21,4,-16, GLT_RGB(70,70,70)},\ - {-5,21,-5,-16, GLT_RGB(70,70,70)},\ - \ - {5,21,5,-16, GLT_RGB(69,69,69)},\ - {-6,21,-6,-16, GLT_RGB(69,69,69)},\ - \ - {6,21,6,-16, GLT_RGB(69,69,69)},\ - {-7,21,-7,-16, GLT_RGB(69,69,69)},\ - \ - {7,21,7,-16, GLT_RGB(69,69,69)},\ - {-8,21,-8,-16, GLT_RGB(69,69,69)},\ - \ - {8,22,-9,-16, GLT_RGB(68,68,68)},\ - \ - {0,-1,0,-1, GLT_RGB(31,31,31)},\ - {1,-1,1,-1, GLT_RGB(19,19,19)},\ - {2,-1,2,-1, GLT_RGB(12,12,12)},\ - {3,-1,-4,-1, GLT_RGB(10,10,10)},\ - {-3,-1,-3,-1, GLT_RGB(12,12,12)},\ - {-2,-1,-2,-1, GLT_RGB(19,19,19)},\ - {-1,-1,-1,-1, GLT_RGB(31,31,31)},\ - \ - {0,-2,0,-2, GLT_RGB(18,18,18)},\ - {1,-2,1,-2, GLT_RGB(67,67,67)},\ - {2,-2,2,-2, GLT_RGB(106,106,106)},\ - {3,-2,3,-2, GLT_RGB(109,109,109)},\ - {4,-2,4,-2, GLT_RGB(106,106,106)},\ - {5,-2,-6,-2, GLT_RGB(105,105,105)},\ - {-5,-2,-5,-2, GLT_RGB(106,106,106)},\ - {-4,-2,-4,-2, GLT_RGB(109,109,109)},\ - {-3,-2,-3,-2, GLT_RGB(106,106,106)},\ - {-2,-2,-2,-2, GLT_RGB(67,67,67)},\ - {-1,-2,-1,-2, GLT_RGB(18,18,18)},\ - \ - {0,-3,0,-3, GLT_RGB(11,11,11)},\ - {1,-3,1,-3, GLT_RGB(106,106,106)},\ - {2,-3,2,-3, GLT_RGB(101,101,101)},\ - {3,-3,3,-3, GLT_RGB(95,95,95)},\ - {4,-3,-5,-3, GLT_RGB(92,92,92)},\ - {-4,-3,-4,-3, GLT_RGB(95,95,95)},\ - {-3,-3,-3,-3, GLT_RGB(101,101,101)},\ - {-2,-3,-2,-3, GLT_RGB(106,106,106)},\ - {-1,-3,-1,-3, GLT_RGB(11,11,11)},\ - \ - {0,-4,0,-4, GLT_RGB(11,11,11)},\ - {1,-4,1,-4, GLT_RGB(100,100,100)},\ - {2,-4,2,-4, GLT_RGB(91,91,91)},\ - {3,-4,3,-4, GLT_RGB(85,85,85)},\ - {4,-4,4,-4, GLT_RGB(82,82,82)},\ - {5,-4,-6,-4, GLT_RGB(81,81,81)},\ - {-5,-4,-5,-4, GLT_RGB(82,82,82)},\ - {-4,-4,-4,-4, GLT_RGB(85,85,85)},\ - {-3,-4,-3,-4, GLT_RGB(91,91,91)},\ - {-2,-4,-2,-4, GLT_RGB(100,100,100)},\ - {-1,-4,-1,-4, GLT_RGB(11,11,11)},\ - \ - {0,-5,0,-5, GLT_RGB(11,11,11)},\ - {1,-5,1,-5, GLT_RGB(94,94,94)},\ - {2,-5,2,-5, GLT_RGB(85,85,85)},\ - {3,-5,3,-5, GLT_RGB(79,79,79)},\ - {4,-5,4,-5, GLT_RGB(76,76,76)},\ - {5,-5,-6,-5, GLT_RGB(75,75,75)},\ - {-5,-5,-5,-5, GLT_RGB(76,76,76)},\ - {-4,-5,-4,-5, GLT_RGB(79,79,79)},\ - {-3,-5,-3,-5, GLT_RGB(85,85,85)},\ - {-2,-5,-2,-5, GLT_RGB(94,94,94)},\ - {-1,-5,-1,-5, GLT_RGB(11,11,11)},\ - \ - {0,-6,0,-6, GLT_RGB(12,12,12)},\ - {1,-6,1,-6, GLT_RGB(93,93,93)},\ - {2,-6,2,-6, GLT_RGB(84,84,84)},\ - {3,-6,3,-6, GLT_RGB(78,78,78)},\ - {4,-6,-5,-6, GLT_RGB(75,75,75)},\ - {-4,-6,-4,-6, GLT_RGB(78,78,78)},\ - {-3,-6,-3,-6, GLT_RGB(84,84,84)},\ - {-2,-6,-2,-6, GLT_RGB(93,93,93)},\ - {-1,-6,-1,-6, GLT_RGB(12,12,12)},\ - \ - {0,-7,0,-7, GLT_RGB(12,12,12)},\ - {1,-7,1,-7, GLT_RGB(93,93,93)},\ - {2,-7,2,-7, GLT_RGB(83,83,83)},\ - {3,-7,3,-7, GLT_RGB(77,77,77)},\ - {4,-7,-5,-7, GLT_RGB(74,74,74)},\ - {-4,-7,-4,-7, GLT_RGB(77,77,77)},\ - {-3,-7,-3,-7, GLT_RGB(83,83,83)},\ - {-2,-7,-2,-7, GLT_RGB(93,93,93)},\ - {-1,-7,-1,-7, GLT_RGB(12,12,12)},\ - \ - {0,-8,0,-8, GLT_RGB(12,12,12)},\ - {1,-8,1,-8, GLT_RGB(92,92,92)},\ - {2,-8,2,-8, GLT_RGB(83,83,83)},\ - {3,-8,3,-8, GLT_RGB(77,77,77)},\ - {4,-8,4,-8, GLT_RGB(74,74,74)},\ - {5,-8,-6,-8, GLT_RGB(73,73,73)},\ - {-5,-8,-5,-8, GLT_RGB(74,74,74)},\ - {-4,-8,-4,-8, GLT_RGB(77,77,77)},\ - {-3,-8,-3,-8, GLT_RGB(83,83,83)},\ - {-2,-8,-2,-8, GLT_RGB(92,92,92)},\ - {-1,-8,-1,-8, GLT_RGB(12,12,12)},\ - \ - {0,-9,0,-9, GLT_RGB(13,13,13)},\ - {1,-9,1,-9, GLT_RGB(92,92,92)},\ - {2,-9,2,-9, GLT_RGB(83,83,83)},\ - {3,-9,3,-9, GLT_RGB(76,76,76)},\ - {4,-9,4,-9, GLT_RGB(73,73,73)},\ - {5,-9,-6,-9, GLT_RGB(72,72,72)},\ - {-5,-9,-5,-9, GLT_RGB(73,73,73)},\ - {-4,-9,-4,-9, GLT_RGB(76,76,76)},\ - {-3,-9,-3,-9, GLT_RGB(83,83,83)},\ - {-2,-9,-2,-9, GLT_RGB(92,92,92)},\ - {-1,-9,-1,-9, GLT_RGB(13,13,13)},\ - \ - {0,-10,0,-10, GLT_RGB(13,13,13)},\ - {1,-10,1,-10, GLT_RGB(92,92,92)},\ - {2,-10,2,-10, GLT_RGB(82,82,82)},\ - {3,-10,3,-10, GLT_RGB(76,76,76)},\ - {4,-10,4,-10, GLT_RGB(72,72,72)},\ - {5,-10,-6,-10, GLT_RGB(71,71,71)},\ - {-5,-10,-5,-10, GLT_RGB(72,72,72)},\ - {-4,-10,-4,-10, GLT_RGB(76,76,76)},\ - {-3,-10,-3,-10, GLT_RGB(82,82,82)},\ - {-2,-10,-2,-10, GLT_RGB(92,92,92)},\ - {-1,-10,-1,-10, GLT_RGB(13,13,13)},\ - \ - {0,-11,0,-11, GLT_RGB(14,14,14)},\ - {1,-11,1,-11, GLT_RGB(92,92,92)},\ - {2,-11,2,-11, GLT_RGB(82,82,82)},\ - {3,-11,3,-11, GLT_RGB(75,75,75)},\ - {4,-11,4,-11, GLT_RGB(71,71,71)},\ - {5,-11,5,-11, GLT_RGB(70,70,70)},\ - {6,-11,-7,-11, GLT_RGB(69,69,69)},\ - {-6,-11,-6,-11, GLT_RGB(70,70,70)},\ - {-5,-11,-5,-11, GLT_RGB(71,71,71)},\ - {-4,-11,-4,-11, GLT_RGB(75,75,75)},\ - {-3,-11,-3,-11, GLT_RGB(82,82,82)},\ - {-2,-11,-2,-11, GLT_RGB(92,92,92)},\ - {-1,-11,-1,-11, GLT_RGB(14,14,14)},\ - \ - {0,-12,0,-12, GLT_RGB(14,14,14)},\ - {1,-12,1,-12, GLT_RGB(91,91,91)},\ - {2,-12,2,-12, GLT_RGB(81,81,81)},\ - {3,-12,3,-12, GLT_RGB(74,74,74)},\ - {4,-12,4,-12, GLT_RGB(70,70,70)},\ - {5,-12,5,-12, GLT_RGB(69,69,69)},\ - {6,-12,6,-12, GLT_RGB(68,68,68)},\ - {7,-12,-8,-12, GLT_RGB(67,67,67)},\ - {-7,-12,-7,-12, GLT_RGB(68,68,68)},\ - {-6,-12,-6,-12, GLT_RGB(69,69,69)},\ - {-5,-12,-5,-12, GLT_RGB(70,70,70)},\ - {-4,-12,-4,-12, GLT_RGB(74,74,74)},\ - {-3,-12,-3,-12, GLT_RGB(81,81,81)},\ - {-2,-12,-2,-12, GLT_RGB(91,91,91)},\ - {-1,-12,-1,-12, GLT_RGB(14,14,14)},\ - \ - {0,-13,0,-13, GLT_RGB(15,15,15)},\ - {1,-13,1,-13, GLT_RGB(91,91,91)},\ - {2,-13,2,-13, GLT_RGB(81,81,81)},\ - {3,-13,3,-13, GLT_RGB(73,73,73)},\ - {4,-13,4,-13, GLT_RGB(69,69,69)},\ - {5,-13,5,-13, GLT_RGB(68,68,68)},\ - {6,-13,-7,-13, GLT_RGB(67,67,67)},\ - {-6,-13,-6,-13, GLT_RGB(68,68,68)},\ - {-5,-13,-5,-13, GLT_RGB(69,69,69)},\ - {-4,-13,-4,-13, GLT_RGB(73,73,73)},\ - {-3,-13,-3,-13, GLT_RGB(81,81,81)},\ - {-2,-13,-2,-13, GLT_RGB(91,91,91)},\ - {-1,-13,-1,-13, GLT_RGB(15,15,15)},\ - \ - {0,-14,0,-14, GLT_RGB(15,15,15)},\ - {1,-14,1,-14, GLT_RGB(91,91,91)},\ - {2,-14,2,-14, GLT_RGB(80,80,80)},\ - {3,-14,3,-14, GLT_RGB(73,73,73)},\ - {4,-14,4,-14, GLT_RGB(69,69,69)},\ - {5,-14,5,-14, GLT_RGB(68,68,68)},\ - {6,-14,-7,-14, GLT_RGB(67,67,67)},\ - {-6,-14,-6,-14, GLT_RGB(68,68,68)},\ - {-5,-14,-5,-14, GLT_RGB(69,69,69)},\ - {-4,-14,-4,-14, GLT_RGB(73,73,73)},\ - {-3,-14,-3,-14, GLT_RGB(80,80,80)},\ - {-2,-14,-2,-14, GLT_RGB(91,91,91)},\ - {-1,-14,-1,-14, GLT_RGB(15,15,15)},\ - \ - {0,-15,0,-15, GLT_RGB(15,15,15)},\ - {1,-15,1,-15, GLT_RGB(91,91,91)},\ - {2,-15,2,-15, GLT_RGB(80,80,80)},\ - {3,-15,3,-15, GLT_RGB(73,73,73)},\ - {4,-15,4,-15, GLT_RGB(69,69,69)},\ - {5,-15,5,-15, GLT_RGB(68,68,68)},\ - {6,-15,-7,-15, GLT_RGB(67,67,67)},\ - {-6,-15,-6,-15, GLT_RGB(68,68,68)},\ - {-5,-15,-5,-15, GLT_RGB(69,69,69)},\ - {-4,-15,-4,-15, GLT_RGB(73,73,73)},\ - {-3,-15,-3,-15, GLT_RGB(80,80,80)},\ - {-2,-15,-2,-15, GLT_RGB(91,91,91)},\ - {-1,-15,-1,-15, GLT_RGB(15,15,15)},\ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -#define KEYBOARD_BUTTON_PUSHED_RGN \ -{ \ - {0,0,0,0, GLT_RGB(38,38,38)},\ - {1,0,1,0, GLT_RGB(32,32,32)},\ - {2,0,2,0, GLT_RGB(28,28,28)},\ - {3,0,-4,0, GLT_RGB(27,27,27)},\ - {-3,0,-3,0, GLT_RGB(28,28,28)},\ - {-2,0,-2,0, GLT_RGB(32,32,32)},\ - {-1,0,-1,0, GLT_RGB(38,38,38)},\ - \ - {0,1,0,1, GLT_RGB(30,30,30)},\ - {1,1,1,1, GLT_RGB(69,69,69)},\ - {2,1,2,1, GLT_RGB(108,108,108)},\ - {3,1,3,1, GLT_RGB(169,169,169)},\ - {4,1,4,1, GLT_RGB(174,174,174)},\ - {5,1,-6,1, GLT_RGB(177,177,177)},\ - {-5,1,-5,1, GLT_RGB(174,174,174)},\ - {-4,1,-4,1, GLT_RGB(169,169,169)},\ - {-3,1,-3,1, GLT_RGB(108,108,108)},\ - {-2,1,-2,1, GLT_RGB(69,69,69)},\ - {-1,1,-1,1, GLT_RGB(30,30,30)},\ - \ - {0,2,0,2, GLT_RGB(28,28,28)},\ - {1,2,1,2, GLT_RGB(108,108,108)},\ - {2,2,2,2, GLT_RGB(138,138,138)},\ - {3,2,3,2, GLT_RGB(169,169,169)},\ - {4,2,-5,2, GLT_RGB(177,177,177)},\ - {-4,2,-4,2, GLT_RGB(169,169,169)},\ - {-3,2,-3,2, GLT_RGB(138,138,138)},\ - {-2,2,-2,2, GLT_RGB(108,108,108)},\ - {-1,2,-1,2, GLT_RGB(30,30,30)},\ - \ - {0,3,0,3, GLT_RGB(25,25,25)},\ - {1,3,1,3, GLT_RGB(102,102,102)},\ - {2,3,2,3, GLT_RGB(179,179,179)},\ - {3,3,3,3, GLT_RGB(174,174,174)},\ - {4,3,-5,3, GLT_RGB(171,171,171)},\ - {-4,3,-4,3, GLT_RGB(174,174,174)},\ - {-3,3,-3,3, GLT_RGB(179,179,179)},\ - {-2,3,-2,3, GLT_RGB(102,102,102)},\ - {-1,3,-1,3, GLT_RGB(25,25,25)},\ - \ - {0,4,0,4, GLT_RGB(25,25,25)},\ - {1,4,1,4, GLT_RGB(100,100,100)},\ - {2,4,2,4, GLT_RGB(176,176,176)},\ - {3,4,3,4, GLT_RGB(171,171,171)},\ - {4,4,-5,4, GLT_RGB(166,166,166)},\ - {-4,4,-4,4, GLT_RGB(171,171,171)},\ - {-3,4,-3,4, GLT_RGB(176,176,176)},\ - {-2,4,-2,4, GLT_RGB(100,100,100)},\ - {-1,4,-1,4, GLT_RGB(25,25,25)},\ - \ - {0,5,0,5, GLT_RGB(24,24,24)},\ - {1,5,1,5, GLT_RGB(99,99,99)},\ - {2,5,2,5, GLT_RGB(174,174,174)},\ - {3,5,3,5, GLT_RGB(169,169,169)},\ - {4,5,-5,5, GLT_RGB(163,163,163)},\ - {-4,5,-4,5, GLT_RGB(169,169,169)},\ - {-3,5,-3,5, GLT_RGB(174,174,174)},\ - {-2,5,-2,5, GLT_RGB(99,99,99)},\ - {-1,5,-1,5, GLT_RGB(24,24,24)},\ - \ - {0,6,0,6, GLT_RGB(24,24,24)},\ - {1,6,1,6, GLT_RGB(98,98,98)},\ - {2,6,2,6, GLT_RGB(173,173,173)},\ - {3,6,3,6, GLT_RGB(169,169,169)},\ - {4,6,-5,6, GLT_RGB(163,163,163)},\ - {-4,6,-4,6, GLT_RGB(169,169,169)},\ - {-3,6,-3,6, GLT_RGB(173,173,173)},\ - {-2,6,-2,6, GLT_RGB(98,98,98)},\ - {-1,6,-1,6, GLT_RGB(24,24,24)},\ - \ - {0,7,0,7, GLT_RGB(24,24,24)},\ - {1,7,1,7, GLT_RGB(97,97,97)},\ - {2,7,2,7, GLT_RGB(171,171,171)},\ - {3,7,3,7, GLT_RGB(166,166,166)},\ - {4,7,-5,7, GLT_RGB(161,161,161)},\ - {-4,7,-4,7, GLT_RGB(166,166,166)},\ - {-3,7,-3,7, GLT_RGB(171,171,171)},\ - {-2,7,-2,7, GLT_RGB(97,97,97)},\ - {-1,7,-1,7, GLT_RGB(24,24,24)},\ - \ - {0,8,0,8, GLT_RGB(23,23,23)},\ - {1,8,1,8, GLT_RGB(96,96,96)},\ - {2,8,2,8, GLT_RGB(170,170,170)},\ - {3,8,3,8, GLT_RGB(163,163,163)},\ - {4,8,-5,8, GLT_RGB(160,160,160)},\ - {-4,8,-4,8, GLT_RGB(163,163,163)},\ - {-3,8,-3,8, GLT_RGB(170,170,170)},\ - {-2,8,-2,8, GLT_RGB(96,96,96)},\ - {-1,8,-1,8, GLT_RGB(23,23,23)},\ - \ - {0,9,0,9, GLT_RGB(23,23,23)},\ - {1,9,1,9, GLT_RGB(96,96,96)},\ - {2,9,2,9, GLT_RGB(169,169,169)},\ - {3,9,3,9, GLT_RGB(164,164,164)},\ - {4,9,-5,9, GLT_RGB(159,159,159)},\ - {-4,9,-4,9, GLT_RGB(164,164,164)},\ - {-3,9,-3,9, GLT_RGB(169,169,169)},\ - {-2,9,-2,9, GLT_RGB(96,96,96)},\ - {-1,9,-1,9, GLT_RGB(23,23,23)},\ - \ - {0,10,0,10, GLT_RGB(23,23,23)},\ - {1,10,1,10, GLT_RGB(95,95,95)},\ - {2,10,2,10, GLT_RGB(167,167,167)},\ - {3,10,3,10, GLT_RGB(162,162,162)},\ - {4,10,4,10, GLT_RGB(160,160,160)},\ - {5,10,-6,10, GLT_RGB(157,157,157)},\ - {-5,10,-5,10, GLT_RGB(160,160,160)},\ - {-4,10,-4,10, GLT_RGB(162,162,162)},\ - {-3,10,-3,10, GLT_RGB(167,167,167)},\ - {-2,10,-2,10, GLT_RGB(95,95,95)},\ - {-1,10,-1,10, GLT_RGB(23,23,23)},\ - \ - {0,11,0,11, GLT_RGB(22,22,22)},\ - {1,11,1,11, GLT_RGB(94,94,94)},\ - {2,11,2,11, GLT_RGB(166,166,166)},\ - {3,11,3,11, GLT_RGB(164,164,164)},\ - {4,11,4,11, GLT_RGB(159,159,159)},\ - {5,11,5,11, GLT_RGB(158,158,158)},\ - {6,11,6,11, GLT_RGB(157,157,157)},\ - {7,11,-8,11, GLT_RGB(156,156,156)},\ - {-7,11,-7,11, GLT_RGB(157,157,157)},\ - {-6,11,-6,11, GLT_RGB(158,158,158)},\ - {-5,11,-5,11, GLT_RGB(159,159,159)},\ - {-4,11,-4,11, GLT_RGB(164,164,164)},\ - {-3,11,-3,11, GLT_RGB(166,166,166)},\ - {-2,11,-2,11, GLT_RGB(94,94,94)},\ - {-1,11,-1,11, GLT_RGB(22,22,22)},\ - \ - {0,12,0,12, GLT_RGB(22,22,22)},\ - {1,12,1,12, GLT_RGB(94,94,94)},\ - {2,12,2,12, GLT_RGB(166,166,166)},\ - {3,12,3,12, GLT_RGB(164,164,164)},\ - {4,12,4,12, GLT_RGB(160,160,160)},\ - {5,12,5,12, GLT_RGB(158,158,158)},\ - {6,12,-7,12, GLT_RGB(155,155,155)},\ - {-6,12,-6,12, GLT_RGB(158,158,158)},\ - {-5,12,-5,12, GLT_RGB(160,160,160)},\ - {-4,12,-4,12, GLT_RGB(164,164,164)},\ - {-3,12,-3,12, GLT_RGB(166,166,166)},\ - {-2,12,-2,12, GLT_RGB(94,94,94)},\ - {-1,12,-1,12, GLT_RGB(22,22,22)},\ - \ - {0,13,0,13, GLT_RGB(22,22,22)},\ - {1,13,1,13, GLT_RGB(93,93,93)},\ - {2,13,2,13, GLT_RGB(164,164,164)},\ - {3,13,3,13, GLT_RGB(157,157,157)},\ - {4,13,4,13, GLT_RGB(156,156,156)},\ - {5,13,5,13, GLT_RGB(153,153,153)},\ - {6,13,-7,13, GLT_RGB(152,152,152)},\ - {-6,13,-6,13, GLT_RGB(153,153,153)},\ - {-5,13,-5,13, GLT_RGB(156,156,156)},\ - {-4,13,-4,13, GLT_RGB(157,157,157)},\ - {-3,13,-3,13, GLT_RGB(164,164,164)},\ - {-2,13,-2,13, GLT_RGB(93,93,93)},\ - {-1,13,-1,13, GLT_RGB(22,22,22)},\ - \ - {0,14,0,14, GLT_RGB(21,21,21)},\ - {1,14,1,14, GLT_RGB(92,92,92)},\ - {2,14,2,14, GLT_RGB(163,163,163)},\ - {3,14,3,14, GLT_RGB(157,157,157)},\ - {4,14,4,14, GLT_RGB(153,153,153)},\ - {5,14,-6,14, GLT_RGB(150,150,150)},\ - {-5,14,-5,14, GLT_RGB(153,153,153)},\ - {-4,14,-4,14, GLT_RGB(157,157,157)},\ - {-3,14,-3,14, GLT_RGB(163,163,163)},\ - {-2,14,-2,14, GLT_RGB(92,92,92)},\ - {-1,14,-1,14, GLT_RGB(21,21,21)},\ - \ - {0,15,0,15, GLT_RGB(21,21,21)},\ - {1,15,1,15, GLT_RGB(91,91,91)},\ - {2,15,2,15, GLT_RGB(162,162,162)},\ - {3,15,3,15, GLT_RGB(156,156,156)},\ - {4,15,4,15, GLT_RGB(151,151,151)},\ - {5,15,-6,15, GLT_RGB(149,149,149)},\ - {-5,15,-5,15, GLT_RGB(151,151,151)},\ - {-4,15,-4,15, GLT_RGB(156,156,156)},\ - {-3,15,-3,15, GLT_RGB(162,162,162)},\ - {-2,15,-2,15, GLT_RGB(91,91,91)},\ - {-1,15,-1,15, GLT_RGB(21,21,21)},\ - \ - {0,16,0,16, GLT_RGB(21,21,21)},\ - {1,16,1,16, GLT_RGB(90,90,90)},\ - {2,16,2,16, GLT_RGB(160,160,160)},\ - {3,16,3,16, GLT_RGB(154,154,154)},\ - {4,16,4,16, GLT_RGB(150,150,150)},\ - {5,16,-6,16, GLT_RGB(146,146,146)},\ - {-5,16,-5,16, GLT_RGB(150,150,150)},\ - {-4,16,-4,16, GLT_RGB(154,154,154)},\ - {-3,16,-3,16, GLT_RGB(160,160,160)},\ - {-2,16,-2,16, GLT_RGB(90,90,90)},\ - {-1,16,-1,16, GLT_RGB(21,21,21)},\ - \ - {0,17,0,17, GLT_RGB(21,21,21)},\ - {1,17,1,17, GLT_RGB(89,89,89)},\ - {2,17,2,17, GLT_RGB(158,158,158)},\ - {3,17,3,17, GLT_RGB(152,152,152)},\ - {4,17,4,17, GLT_RGB(148,148,148)},\ - {5,17,-6,17, GLT_RGB(144,144,144)},\ - {-5,17,-5,17, GLT_RGB(148,148,148)},\ - {-4,17,-4,17, GLT_RGB(152,152,152)},\ - {-3,17,-3,17, GLT_RGB(158,158,158)},\ - {-2,17,-2,17, GLT_RGB(89,89,89)},\ - {-1,17,-1,17, GLT_RGB(21,21,21)},\ - \ - {0,18,0,18, GLT_RGB(21,21,21)},\ - {1,18,1,18, GLT_RGB(89,89,89)},\ - {2,18,2,18, GLT_RGB(157,157,157)},\ - {3,18,3,18, GLT_RGB(151,151,151)},\ - {4,18,-5,18, GLT_RGB(143,143,143)},\ - {-4,18,-4,18, GLT_RGB(151,151,151)},\ - {-3,18,-3,18, GLT_RGB(157,157,157)},\ - {-2,18,-2,18, GLT_RGB(89,89,89)},\ - {-1,18,-1,18, GLT_RGB(21,21,21)},\ - \ - {0,19,0,19, GLT_RGB(20,20,20)},\ - {1,19,1,19, GLT_RGB(87,87,87)},\ - {2,19,2,19, GLT_RGB(155,155,155)},\ - {3,19,3,19, GLT_RGB(145,145,145)},\ - {4,19,-5,19, GLT_RGB(140,140,140)},\ - {-4,19,-4,19, GLT_RGB(145,145,145)},\ - {-3,19,-3,19, GLT_RGB(155,155,155)},\ - {-2,19,-2,19, GLT_RGB(87,87,87)},\ - {-1,19,-1,19, GLT_RGB(20,20,20)},\ - \ - {0,20,0,20, GLT_RGB(20,20,20)},\ - {1,20,1,20, GLT_RGB(86,86,86)},\ - {2,20,2,20, GLT_RGB(153,153,153)},\ - {3,20,3,20, GLT_RGB(147,147,147)},\ - {4,20,-5,20, GLT_RGB(138,138,138)},\ - {-4,20,-4,20, GLT_RGB(147,147,147)},\ - {-3,20,-3,20, GLT_RGB(153,153,153)},\ - {-2,20,-2,20, GLT_RGB(86,86,86)},\ - {-1,20,-1,20, GLT_RGB(20,20,20)},\ - \ - {0,21,0,21, GLT_RGB(20,20,20)},\ - {1,21,1,21, GLT_RGB(86,86,86)},\ - {2,21,2,21, GLT_RGB(152,152,152)},\ - {3,21,3,21, GLT_RGB(146,146,146)},\ - {4,21,-5,21, GLT_RGB(137,137,137)},\ - {-4,21,-4,21, GLT_RGB(146,146,146)},\ - {-3,21,-3,21, GLT_RGB(152,152,152)},\ - {-2,21,-2,21, GLT_RGB(86,86,86)},\ - {-1,21,-1,21, GLT_RGB(20,20,20)},\ - \ - {0,22,0,-16, GLT_RGB(20,20,20)},\ - {-1,22,-1,-16, GLT_RGB(20,20,20)},\ - \ - {1,22,1,-16, GLT_RGB(85,85,85)},\ - {-2,22,-2,-16, GLT_RGB(85,85,85)},\ - \ - {2,21,2,-16, GLT_RGB(150,150,150)},\ - {-3,21,-3,-16, GLT_RGB(150,150,150)},\ - \ - {3,20,3,-16, GLT_RGB(143,143,143)},\ - {-4,20,-4,-16, GLT_RGB(143,143,143)},\ - \ - {4,21,4,-16, GLT_RGB(140,140,140)},\ - {-5,21,-5,-16, GLT_RGB(140,140,140)},\ - \ - {5,21,5,-16, GLT_RGB(138,138,138)},\ - {-6,21,-6,-16, GLT_RGB(138,138,138)},\ - \ - {6,21,6,-16, GLT_RGB(137,137,137)},\ - {-7,21,-7,-16, GLT_RGB(137,137,137)},\ - \ - {7,21,7,-16, GLT_RGB(137,137,137)},\ - {-8,21,-8,-16, GLT_RGB(137,137,137)},\ - \ - {8,22,-9,-16, GLT_RGB(136,136,136)},\ - \ - {0,-1,0,-1, GLT_RGB(31,31,31)},\ - {1,-1,1,-1, GLT_RGB(25,25,25)},\ - {2,-1,2,-1, GLT_RGB(15,15,15)},\ - {3,-1,-4,-1, GLT_RGB(10,10,10)},\ - {-3,-1,-3,-1, GLT_RGB(15,15,15)},\ - {-2,-1,-2,-1, GLT_RGB(25,25,25)},\ - {-1,-1,-1,-1, GLT_RGB(31,31,31)},\ - \ - {0,-2,0,-2, GLT_RGB(24,24,24)},\ - {1,-2,1,-2, GLT_RGB(38,38,38)},\ - {2,-2,2,-2, GLT_RGB(53,53,53)},\ - {3,-2,3,-2, GLT_RGB(77,77,77)},\ - {4,-2,4,-2, GLT_RGB(80,80,80)},\ - {5,-2,-6,-2, GLT_RGB(79,79,79)},\ - {-5,-2,-5,-2, GLT_RGB(80,80,80)},\ - {-4,-2,-4,-2, GLT_RGB(77,77,77)},\ - {-3,-2,-3,-2, GLT_RGB(53,53,53)},\ - {-2,-2,-2,-2, GLT_RGB(38,38,38)},\ - {-1,-2,-1,-2, GLT_RGB(24,24,24)},\ - \ - {0,-3,0,-3, GLT_RGB(18,18,18)},\ - {1,-3,1,-3, GLT_RGB(52,52,52)},\ - {2,-3,2,-3, GLT_RGB(87,87,87)},\ - {3,-3,3,-3, GLT_RGB(142,142,142)},\ - {4,-3,-5,-3, GLT_RGB(148,148,148)},\ - {-4,-3,-4,-3, GLT_RGB(142,142,142)},\ - {-3,-3,-3,-3, GLT_RGB(87,87,87)},\ - {-2,-3,-2,-3, GLT_RGB(52,52,52)},\ - {-1,-3,-1,-3, GLT_RGB(18,18,18)},\ - \ - {0,-4,0,-4, GLT_RGB(11,11,11)},\ - {1,-4,1,-4, GLT_RGB(77,77,77)},\ - {2,-4,2,-4, GLT_RGB(143,143,143)},\ - {3,-4,3,-4, GLT_RGB(141,141,141)},\ - {4,-4,4,-4, GLT_RGB(138,138,138)},\ - {5,-4,-6,-4, GLT_RGB(135,135,135)},\ - {-5,-4,-5,-4, GLT_RGB(138,138,138)},\ - {-4,-4,-4,-4, GLT_RGB(141,141,141)},\ - {-3,-4,-3,-4, GLT_RGB(143,143,143)},\ - {-2,-4,-2,-4, GLT_RGB(77,77,77)},\ - {-1,-4,-1,-4, GLT_RGB(11,11,11)},\ - \ - {0,-5,0,-5, GLT_RGB(11,11,11)},\ - {1,-5,1,-5, GLT_RGB(75,75,75)},\ - {2,-5,2,-5, GLT_RGB(140,140,140)},\ - {3,-5,3,-5, GLT_RGB(136,136,136)},\ - {4,-5,4,-5, GLT_RGB(133,133,133)},\ - {5,-5,-6,-5, GLT_RGB(129,129,129)},\ - {-5,-5,-5,-5, GLT_RGB(133,133,133)},\ - {-4,-5,-4,-5, GLT_RGB(136,136,136)},\ - {-3,-5,-3,-5, GLT_RGB(140,140,140)},\ - {-2,-5,-2,-5, GLT_RGB(75,75,75)},\ - {-1,-5,-1,-5, GLT_RGB(11,11,11)},\ - \ - {0,-6,0,-6, GLT_RGB(11,11,11)},\ - {1,-6,1,-6, GLT_RGB(74,74,74)},\ - {2,-6,2,-6, GLT_RGB(138,138,138)},\ - {3,-6,3,-6, GLT_RGB(129,129,129)},\ - {4,-6,-5,-6, GLT_RGB(124,124,124)},\ - {-4,-6,-4,-6, GLT_RGB(129,129,129)},\ - {-3,-6,-3,-6, GLT_RGB(138,138,138)},\ - {-2,-6,-2,-6, GLT_RGB(74,74,74)},\ - {-1,-6,-1,-6, GLT_RGB(11,11,11)},\ - \ - {0,-7,0,-7, GLT_RGB(11,11,11)},\ - {1,-7,1,-7, GLT_RGB(71,71,71)},\ - {2,-7,2,-7, GLT_RGB(132,132,132)},\ - {3,-7,3,-7, GLT_RGB(128,128,128)},\ - {4,-7,-5,-7, GLT_RGB(118,118,118)},\ - {-4,-7,-4,-7, GLT_RGB(128,128,128)},\ - {-3,-7,-3,-7, GLT_RGB(132,132,132)},\ - {-2,-7,-2,-7, GLT_RGB(71,71,71)},\ - {-1,-7,-1,-7, GLT_RGB(11,11,11)},\ - \ - {0,-8,0,-8, GLT_RGB(11,11,11)},\ - {1,-8,1,-8, GLT_RGB(71,71,71)},\ - {2,-8,2,-8, GLT_RGB(131,131,131)},\ - {3,-8,3,-8, GLT_RGB(124,124,124)},\ - {4,-8,4,-8, GLT_RGB(119,119,119)},\ - {5,-8,-6,-8, GLT_RGB(117,117,117)},\ - {-5,-8,-5,-8, GLT_RGB(119,119,119)},\ - {-4,-8,-4,-8, GLT_RGB(124,124,124)},\ - {-3,-8,-3,-8, GLT_RGB(131,131,131)},\ - {-2,-8,-2,-8, GLT_RGB(71,71,71)},\ - {-1,-8,-1,-8, GLT_RGB(11,11,11)},\ - \ - {0,-9,0,-9, GLT_RGB(12,12,12)},\ - {1,-9,1,-9, GLT_RGB(71,71,71)},\ - {2,-9,2,-9, GLT_RGB(131,131,131)},\ - {3,-9,3,-9, GLT_RGB(124,124,124)},\ - {4,-9,4,-9, GLT_RGB(119,119,119)},\ - {5,-9,-6,-9, GLT_RGB(117,117,117)},\ - {-5,-9,-5,-9, GLT_RGB(119,119,119)},\ - {-4,-9,-4,-9, GLT_RGB(124,124,124)},\ - {-3,-9,-3,-9, GLT_RGB(131,131,131)},\ - {-2,-9,-2,-9, GLT_RGB(71,71,71)},\ - {-1,-9,-1,-9, GLT_RGB(12,12,12)},\ - \ - {0,-10,0,-10, GLT_RGB(12,12,12)},\ - {1,-10,1,-10, GLT_RGB(71,71,71)},\ - {2,-10,2,-10, GLT_RGB(130,130,130)},\ - {3,-10,3,-10, GLT_RGB(123,123,123)},\ - {4,-10,4,-10, GLT_RGB(118,118,118)},\ - {5,-10,-6,-10, GLT_RGB(117,117,117)},\ - {-5,-10,-5,-10, GLT_RGB(118,118,118)},\ - {-4,-10,-4,-10, GLT_RGB(123,123,123)},\ - {-3,-10,-3,-10, GLT_RGB(130,130,130)},\ - {-2,-10,-2,-10, GLT_RGB(71,71,71)},\ - {-1,-10,-1,-10, GLT_RGB(12,12,12)},\ - \ - {0,-11,0,-11, GLT_RGB(12,12,12)},\ - {1,-11,1,-11, GLT_RGB(71,71,71)},\ - {2,-11,2,-11, GLT_RGB(130,130,130)},\ - {3,-11,3,-11, GLT_RGB(123,123,123)},\ - {4,-11,4,-11, GLT_RGB(129,129,129)},\ - {5,-11,5,-11, GLT_RGB(119,119,119)},\ - {6,-11,-7,-11, GLT_RGB(116,116,116)},\ - {-6,-11,-6,-11, GLT_RGB(119,119,119)},\ - {-5,-11,-5,-11, GLT_RGB(129,129,129)},\ - {-4,-11,-4,-11, GLT_RGB(123,123,123)},\ - {-3,-11,-3,-11, GLT_RGB(130,130,130)},\ - {-2,-11,-2,-11, GLT_RGB(71,71,71)},\ - {-1,-11,-1,-11, GLT_RGB(12,12,12)},\ - \ - {0,-12,0,-12, GLT_RGB(12,12,12)},\ - {1,-12,1,-12, GLT_RGB(71,71,71)},\ - {2,-12,2,-12, GLT_RGB(130,130,130)},\ - {3,-12,3,-12, GLT_RGB(123,123,123)},\ - {4,-12,4,-12, GLT_RGB(120,120,120)},\ - {5,-12,5,-12, GLT_RGB(118,118,118)},\ - {6,-12,6,-12, GLT_RGB(117,117,117)},\ - {7,-12,-8,-12, GLT_RGB(116,116,116)},\ - {-7,-12,-7,-12, GLT_RGB(117,117,117)},\ - {-6,-12,-6,-12, GLT_RGB(118,118,118)},\ - {-5,-12,-5,-12, GLT_RGB(120,120,120)},\ - {-4,-12,-4,-12, GLT_RGB(123,123,123)},\ - {-3,-12,-3,-12, GLT_RGB(130,130,130)},\ - {-2,-12,-2,-12, GLT_RGB(71,71,71)},\ - {-1,-12,-1,-12, GLT_RGB(12,12,12)},\ - \ - {0,-13,0,-13, GLT_RGB(13,13,13)},\ - {1,-13,1,-13, GLT_RGB(71,71,71)},\ - {2,-13,2,-13, GLT_RGB(130,130,130)},\ - {3,-13,3,-13, GLT_RGB(123,123,123)},\ - {4,-13,4,-13, GLT_RGB(120,120,120)},\ - {5,-13,5,-13, GLT_RGB(117,117,117)},\ - {6,-13,-7,-13, GLT_RGB(115,115,115)},\ - {-6,-13,-6,-13, GLT_RGB(117,117,117)},\ - {-5,-13,-5,-13, GLT_RGB(120,120,120)},\ - {-4,-13,-4,-13, GLT_RGB(123,123,123)},\ - {-3,-13,-3,-13, GLT_RGB(130,130,130)},\ - {-2,-13,-2,-13, GLT_RGB(71,71,71)},\ - {-1,-13,-1,-13, GLT_RGB(13,13,13)},\ - \ - {0,-14,0,-14, GLT_RGB(13,13,13)},\ - {1,-14,1,-14, GLT_RGB(71,71,71)},\ - {2,-14,2,-14, GLT_RGB(130,130,130)},\ - {3,-14,3,-14, GLT_RGB(123,123,123)},\ - {4,-14,4,-14, GLT_RGB(120,120,120)},\ - {5,-14,5,-14, GLT_RGB(116,116,116)},\ - {6,-14,-7,-14, GLT_RGB(114,114,114)},\ - {-6,-14,-6,-14, GLT_RGB(116,116,116)},\ - {-5,-14,-5,-14, GLT_RGB(120,120,120)},\ - {-4,-14,-4,-14, GLT_RGB(123,123,123)},\ - {-3,-14,-3,-14, GLT_RGB(130,130,130)},\ - {-2,-14,-2,-14, GLT_RGB(71,71,71)},\ - {-1,-14,-1,-14, GLT_RGB(13,13,13)},\ - \ - {0,-15,0,-15, GLT_RGB(13,13,13)},\ - {1,-15,1,-15, GLT_RGB(72,72,72)},\ - {2,-15,2,-15, GLT_RGB(131,131,131)},\ - {3,-15,3,-15, GLT_RGB(123,123,123)},\ - {4,-15,4,-15, GLT_RGB(120,120,120)},\ - {5,-15,5,-15, GLT_RGB(116,116,116)},\ - {6,-15,-7,-15, GLT_RGB(114,114,114)},\ - {-6,-15,-6,-15, GLT_RGB(116,116,116)},\ - {-5,-15,-5,-15, GLT_RGB(120,120,120)},\ - {-4,-15,-4,-15, GLT_RGB(123,123,123)},\ - {-3,-15,-3,-15, GLT_RGB(131,131,131)},\ - {-2,-15,-2,-15, GLT_RGB(72,72,72)},\ - {-1,-15,-1,-15, GLT_RGB(13,13,13)},\ - \ - { INVALID_RGN, 0, 0, 0, 0}\ -} - -const CUSTOM_SHAPE g_shape_btn_normal[] = BUTTON_NORMAL; -const CUSTOM_SHAPE g_shape_btn_focus[] = BUTTON_FOCUS; -const CUSTOM_SHAPE g_shape_btn_push[] = BUTTON_PUSH; -const CUSTOM_SHAPE g_shape_btn_disable[] = BUTTON_DISABLE; - -const CUSTOM_SHAPE g_shape_listbox_select[] = LIST_BOX_SELECT; -const CUSTOM_SHAPE g_shape_listbox_push[] = LIST_BOX_PUSH; -const CUSTOM_SHAPE g_shape_listbox_extend[] = LIST_BOX_EXTEND; - -const CUSTOM_SHAPE g_shape_keyboard_btn_normal[] = KEYBOARD_BUTTON_NORAML_RGN; -const CUSTOM_SHAPE g_shape_keyboard_btn_push[] = KEYBOARD_BUTTON_PUSHED_RGN; diff --git a/gui/src/spinbox.cpp b/gui/src/spinbox.cpp index 30d2864..84c4e10 100644 --- a/gui/src/spinbox.cpp +++ b/gui/src/spinbox.cpp @@ -2,13 +2,12 @@ #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/resource.h" #include "core_include/word.h" #include "core_include/surface.h" #include "../gui_include/button.h" -#include "../gui_include/font.h" +#include "../gui_include/my_resource.h" #include "../gui_include/spinbox.h" -#include "../gui_include/shape_resource.h" #define ARROW_BT_HEIGHT 55 #define ID_BT_ARROW_UP 1 @@ -22,9 +21,9 @@ GLT_END_MESSAGE_MAP() void c_spin_box::pre_create_wnd() { m_style = GLT_ATTR_VISIBLE | GLT_ATTR_FOCUS | ALIGN_HCENTER | ALIGN_VCENTER; - m_font_type = FONT_ENG_SMB_AA(); - m_font_color = GLT_RGB(33,41,57); - m_bg_color = GLT_RGB(255,255,255); + m_font_type = c_my_resource::get_font(FONT_ENG_SMB_AA); + m_bg_color = c_my_resource::get_color(CTRL_BACK_GROUND); + m_font_color = c_my_resource::get_color(CTRL_FORE_GROUND); m_max = 6; m_min = 1; @@ -35,22 +34,22 @@ void c_spin_box::pre_create_wnd() c_rect rect; get_screen_rect(rect); - m_bt_arrow_up_rect.m_left = rect.m_left; - m_bt_arrow_up_rect.m_right = rect.m_left + rect.Width() / 2 - 1; - m_bt_arrow_up_rect.m_top = rect.m_bottom + 1; - m_bt_arrow_up_rect.m_bottom = m_bt_arrow_up_rect.m_top + ARROW_BT_HEIGHT; + m_bt_up_rect.m_left = rect.m_left; + m_bt_up_rect.m_right = rect.m_left + rect.Width() / 2 - 1; + m_bt_up_rect.m_top = rect.m_bottom + 1; + m_bt_up_rect.m_bottom = m_bt_up_rect.m_top + ARROW_BT_HEIGHT; - m_bt_arrow_down_rect.m_left = rect.m_left + rect.Width() / 2; - m_bt_arrow_down_rect.m_right = rect.m_right; - m_bt_arrow_down_rect.m_top = rect.m_bottom + 1; - m_bt_arrow_down_rect.m_bottom = m_bt_arrow_down_rect.m_top + ARROW_BT_HEIGHT; + m_bt_down_rect.m_left = rect.m_left + rect.Width() / 2; + m_bt_down_rect.m_right = rect.m_right; + m_bt_down_rect.m_top = rect.m_bottom + 1; + m_bt_down_rect.m_bottom = m_bt_down_rect.m_top + ARROW_BT_HEIGHT; } void c_spin_box::on_touch_down(int x, int y) { c_rect arrow_rect = m_wnd_rect; - arrow_rect.m_right = m_bt_arrow_down_rect.m_right; - arrow_rect.m_bottom = m_bt_arrow_down_rect.m_bottom; + arrow_rect.m_right = m_bt_down_rect.m_right; + arrow_rect.m_bottom = m_bt_down_rect.m_bottom; if ( TRUE == m_wnd_rect.PtInRect(x, y) ) {//click spin box @@ -120,30 +119,25 @@ void c_spin_box::on_kill_focus() void c_spin_box::show_arrow_button() { - extern const GUI_BITMAP bmspin_up_button_normal; - extern const GUI_BITMAP bmspin_up_button_focus; - extern const GUI_BITMAP bmspin_down_button_normal; - extern const GUI_BITMAP bmspin_down_button_focus; - - fill_rect(m_bt_arrow_up_rect.m_left, m_bt_arrow_up_rect.m_top, m_bt_arrow_down_rect.m_right, m_bt_arrow_down_rect.m_bottom, GLT_RGB(99,108,124)); + fill_rect(m_bt_up_rect.m_left, m_bt_up_rect.m_top, m_bt_down_rect.m_right, m_bt_down_rect.m_bottom, GLT_RGB(99,108,124)); - m_bt_arrow_up.connect(this, ID_BT_ARROW_UP, 0, 0, m_wnd_rect.Height(), m_bt_arrow_up_rect.Width(),m_bt_arrow_up_rect.Height()); - m_bt_arrow_up.set_bitmap(&bmspin_up_button_normal); - m_bt_arrow_up.set_focus_bitmap(&bmspin_up_button_focus); - m_bt_arrow_up.set_pushed_bitmap(&bmspin_up_button_focus); - m_bt_arrow_up.show_window(); + m_bt_up.connect(this, ID_BT_ARROW_UP, 0, 0, m_wnd_rect.Height(), m_bt_up_rect.Width(),m_bt_up_rect.Height()); + m_bt_up.set_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_NORMAL)); + m_bt_up.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS)); + m_bt_up.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_UP_BT_FOCUS)); + m_bt_up.show_window(); - m_bt_arrow_down.connect(this, ID_BT_ARROW_DOWN, 0, m_bt_arrow_up_rect.Width(), m_wnd_rect.Height(), m_bt_arrow_down_rect.Width(),m_bt_arrow_down_rect.Height()); - m_bt_arrow_down.set_bitmap(&bmspin_down_button_normal); - m_bt_arrow_down.set_focus_bitmap(&bmspin_down_button_focus); - m_bt_arrow_down.set_pushed_bitmap(&bmspin_down_button_focus); - m_bt_arrow_down.show_window(); + m_bt_down.connect(this, ID_BT_ARROW_DOWN, 0, m_bt_up_rect.Width(), m_wnd_rect.Height(), m_bt_down_rect.Width(),m_bt_down_rect.Height()); + m_bt_down.set_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_NORMAL)); + m_bt_down.set_focus_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS)); + m_bt_down.set_pushed_bitmap(c_my_resource::get_bmp(BITMAP_DOWN_BT_FOCUS)); + m_bt_down.show_window(); } void c_spin_box::hide_arrow_button() { - m_bt_arrow_up.disconnect(); - m_bt_arrow_down.disconnect(); + m_bt_up.disconnect(); + m_bt_down.disconnect(); } void c_spin_box::on_paint() @@ -155,18 +149,15 @@ void c_spin_box::on_paint() switch(m_status) { - case STATUS_PUSHED: - if (m_z_order == m_parent->get_z_order()) + case STATUS_NORMAL: + if (m_z_order > m_parent->get_z_order()) { - m_z_order++; + hide_arrow_button(); + tmp_rect.Empty(); + m_surface->set_frame_layer(tmp_rect, m_z_order); + m_z_order = m_parent->get_z_order(); } - tmp_rect.m_top = m_bt_arrow_down_rect.m_top; - tmp_rect.m_bottom = m_bt_arrow_down_rect.m_bottom; - m_surface->set_frame_layer(tmp_rect, m_z_order); - show_arrow_button(); - - m_surface->draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_listbox_push,m_parent->get_z_order()); - m_font_color = GLT_RGB(2,124,165); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_NORMAL)); break; case STATUS_FOCUSED: if (m_z_order > m_parent->get_z_order()) @@ -176,21 +167,21 @@ void c_spin_box::on_paint() m_surface->set_frame_layer(tmp_rect, m_z_order); m_z_order = m_parent->get_z_order(); } - - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_focus); - m_font_color = GLT_RGB(255,255,255); + fill_rect_ex(rect, m_bg_color, c_my_resource::get_shape(BUTTON_FOCUS)); break; - case STATUS_NORMAL: - if (m_z_order > m_parent->get_z_order()) + case STATUS_PUSHED: + if (m_z_order == m_parent->get_z_order()) { - hide_arrow_button(); - tmp_rect.Empty(); - m_surface->set_frame_layer(tmp_rect, m_z_order); - m_z_order = m_parent->get_z_order(); + m_z_order++; } + tmp_rect.m_top = m_bt_down_rect.m_top; + tmp_rect.m_bottom = m_bt_down_rect.m_bottom; + m_surface->set_frame_layer(tmp_rect, m_z_order); + show_arrow_button(); - draw_custom_shape(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_parent->get_bg_color(), g_shape_btn_normal); - m_font_color = GLT_RGB(255,255,255); + m_surface->fill_rect_ex(rect.m_left, rect.m_top, rect.m_right, rect.m_bottom, m_bg_color, c_my_resource::get_shape(LIST_BOX_PUSH),m_parent->get_z_order()); + c_word::draw_value_in_rect(m_surface, m_parent->get_z_order(), m_cur_value, m_digit, rect, m_font_type, GLT_RGB(2, 124, 165), COLOR_TRANPARENT, m_style); + return; break; default: ASSERT(FALSE); diff --git a/gui/src/table.cpp b/gui/src/table.cpp index cdbc02d..b64d12c 100644 --- a/gui/src/table.cpp +++ b/gui/src/table.cpp @@ -1,11 +1,11 @@ #include "core_include/api.h" -#include "core_include/resource_type.h" +#include "core_include/resource.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/my_resource.h" #include "../gui_include/table.h" @@ -16,13 +16,7 @@ void c_table::pre_create_wnd() int c_table::set_item(int row, int col, char* str, unsigned int with_bg_color) { - draw_item( row, col,str, with_bg_color); - return 1; -} - -int c_table::set_item(int row, int col, unsigned int str_id, unsigned int with_bg_color) -{ - draw_item(row, col, str_id, with_bg_color); + draw_item( row, col, str, with_bg_color); return 1; } @@ -44,11 +38,6 @@ void c_table::draw_item(int row, int col, const char* str, unsigned int with_bg_ c_word::draw_string_in_rect(m_surface, m_z_order, str, rect, m_font_type, m_font_color, COLOR_TRANPARENT, m_align_type); } -void c_table::draw_item(int row, int col, unsigned int str_id, unsigned int with_bg_color) -{ - draw_item(row, col, c_word::get_string(str_id), with_bg_color); -} - void c_table::set_row_height(unsigned int height) { for (unsigned int i = 0; i < m_row_num; i ++)