From b4ceabfc9279809508ca6d01c0e8edafb6490fb7 Mon Sep 17 00:00:00 2001 From: idea4good Date: Sat, 2 Feb 2019 11:30:40 +0800 Subject: [PATCH] fix identifier violation --- README.md | 2 +- core/core_include/api.h | 98 ++++++++++++++++----------------- core/core_include/audio.h | 4 +- core/core_include/bitmap.h | 4 +- core/core_include/display.h | 6 +- core/core_include/msg.h | 4 +- core/core_include/rect.h | 4 +- core/core_include/resource.h | 4 +- core/core_include/surface.h | 4 +- core/core_include/wave_buffer.h | 4 +- core/core_include/wave_ctrl.h | 4 +- core/core_include/wnd.h | 4 +- core/core_include/word.h | 4 +- gui/gui_include/button.h | 4 +- gui/gui_include/dialog.h | 4 +- gui/gui_include/edit.h | 4 +- gui/gui_include/gesture.h | 4 +- gui/gui_include/keyboard.h | 4 +- gui/gui_include/label.h | 4 +- gui/gui_include/list_box.h | 4 +- gui/gui_include/my_resource.h | 4 +- gui/gui_include/slide_group.h | 4 +- gui/gui_include/spinbox.h | 4 +- gui/gui_include/table.h | 4 +- 24 files changed, 95 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index ad4ebc1..2c293ac 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ GuiLite只是一个框架,本身并不能生成UI。为了能够展示如何 | HelloAnimation | Windows, Linux | 动画的应用 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloAnimation/README.md) | 初级 | | HelloParticle | Windows, Linux, STM32F103, STM32F429 | 粒子效果的应用 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloParticle/README.md) | 初级 | | HelloSlide | Windows, Linux | 滑屏界面的应用 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloSlide/README.md) | 中级 | -| HelloWave | Windows, Linux, STM32F103, STM32F429 | 波形控件的应用 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloWave/README.md) | 中级 | +| HelloWave | Windows, Linux, STM32F103, STM32F429 | 波形控件的应用,及单片机移植办法 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HelloWave/README.md) | 中级 | | HostMonitor | iOS, Mac, Android, Windows, Linux | 创建复杂界面,扩展自定义控件,适配全平台 | [编译/运行](https://gitee.com/idea4good/GuiLiteSamples/blob/master/HostMonitor/README.md) | 高级 | ## 开发文档 diff --git a/core/core_include/api.h b/core/core_include/api.h index f3485ef..5961e1d 100644 --- a/core/core_include/api.h +++ b/core/core_include/api.h @@ -1,50 +1,50 @@ -#ifndef _API_H_ -#define _API_H_ - -#define REAL_TIME_TASK_CYCLE_MS 50 -#define XXX -999 -#define NULL 0 -#define TRUE 1 -#define FALSE 0 - -void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)); -void _assert(const char* file, int line); -#define ASSERT(condition) \ - do{ \ - if(!(condition))_assert(__FILE__, __LINE__);\ - }while(0) -void log_out(const char* log); - +#ifndef API_H +#define API_H + +#define REAL_TIME_TASK_CYCLE_MS 50 +#define XXX -999 +#define NULL 0 +#define TRUE 1 +#define FALSE 0 + +void register_debug_function(void(*my_assert)(const char* file, int line), void(*my_log_out)(const char* log)); +void _assert(const char* file, int line); +#define ASSERT(condition) \ + do{ \ + if(!(condition))_assert(__FILE__, __LINE__);\ + }while(0) +void log_out(const char* log); + #define GL_ARGB(a, r, g, b) ((((unsigned int)(a)) << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) -#define GL_ARGB_A(rgb) ((((unsigned int)(rgb)) >> 24) & 0xFF) - -#define GL_RGB(r, g, b) ((0xFF << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) -#define GL_RGB_R(rgb) ((((unsigned int)(rgb)) >> 16) & 0xFF) -#define GL_RGB_G(rgb) ((((unsigned int)(rgb)) >> 8) & 0xFF) -#define GL_RGB_B(rgb) (((unsigned int)(rgb)) & 0xFF) -#define GL_RGB_32_to_16(rgb) (((((unsigned int)(rgb)) & 0xFF) >> 3) | ((((unsigned int)(rgb)) & 0xFC00) >> 5) | ((((unsigned int)(rgb)) & 0xF80000) >> 8)) -#define GL_RGB_16_to_32(rgb) (((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8)) - -typedef struct _T_TIME -{ - unsigned short year; - unsigned short month; - unsigned short date; - unsigned short day; - unsigned short hour; - unsigned short minute; - unsigned short second; -}T_TIME; - -long get_time_in_second(); -T_TIME second_to_day(long second); -T_TIME get_time(); - -void start_real_timer(void (*func)(void* arg)); -void register_timer(int milli_second, void func(void* ptmr, void* parg)); - -unsigned int get_cur_thread_id(); -void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg); -void thread_sleep(unsigned int milli_seconds); -int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data); -#endif +#define GL_ARGB_A(rgb) ((((unsigned int)(rgb)) >> 24) & 0xFF) + +#define GL_RGB(r, g, b) ((0xFF << 24) | (((unsigned int)(r)) << 16) | (((unsigned int)(g)) << 8) | ((unsigned int)(b))) +#define GL_RGB_R(rgb) ((((unsigned int)(rgb)) >> 16) & 0xFF) +#define GL_RGB_G(rgb) ((((unsigned int)(rgb)) >> 8) & 0xFF) +#define GL_RGB_B(rgb) (((unsigned int)(rgb)) & 0xFF) +#define GL_RGB_32_to_16(rgb) (((((unsigned int)(rgb)) & 0xFF) >> 3) | ((((unsigned int)(rgb)) & 0xFC00) >> 5) | ((((unsigned int)(rgb)) & 0xF80000) >> 8)) +#define GL_RGB_16_to_32(rgb) (((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8)) + +typedef struct _T_TIME +{ + unsigned short year; + unsigned short month; + unsigned short date; + unsigned short day; + unsigned short hour; + unsigned short minute; + unsigned short second; +}T_TIME; + +long get_time_in_second(); +T_TIME second_to_day(long second); +T_TIME get_time(); + +void start_real_timer(void (*func)(void* arg)); +void register_timer(int milli_second, void func(void* ptmr, void* parg)); + +unsigned int get_cur_thread_id(); +void create_thread(unsigned long* thread_id, void* attr, void *(*start_routine) (void *), void* arg); +void thread_sleep(unsigned int milli_seconds); +int build_bmp(const char *filename, unsigned int width, unsigned int height, unsigned char *data); +#endif diff --git a/core/core_include/audio.h b/core/core_include/audio.h index 7d9702a..18d7cff 100644 --- a/core/core_include/audio.h +++ b/core/core_include/audio.h @@ -1,5 +1,5 @@ -#ifndef __AUDIO_MANGE_H__ -#define __AUDIO_MANGE_H__ +#ifndef AUDIO_MANGE_H +#define AUDIO_MANGE_H enum AUDIO_TYPE { diff --git a/core/core_include/bitmap.h b/core/core_include/bitmap.h index 5f87b27..33af8b3 100644 --- a/core/core_include/bitmap.h +++ b/core/core_include/bitmap.h @@ -1,5 +1,5 @@ -#ifndef _BITMAP_UNIT_H_ -#define _BITMAP_UNIT_H_ +#ifndef BITMAP_UNIT_H +#define BITMAP_UNIT_H class c_surface; class c_bitmap diff --git a/core/core_include/display.h b/core/core_include/display.h index 90f6477..10a1288 100644 --- a/core/core_include/display.h +++ b/core/core_include/display.h @@ -1,5 +1,5 @@ -#ifndef _DISPLAY_H_ -#define _DISPLAY_H_ +#ifndef DISPLAY_H +#define DISPLAY_H #define SURFACE_CNT_MAX 6//root + pages @@ -29,4 +29,4 @@ private: c_surface* m_surface_group[SURFACE_CNT_MAX]; unsigned int m_surface_cnt; }; -#endif \ No newline at end of file +#endif diff --git a/core/core_include/msg.h b/core/core_include/msg.h index b7e5f49..9614cf9 100644 --- a/core/core_include/msg.h +++ b/core/core_include/msg.h @@ -1,5 +1,5 @@ -#ifndef _MSG_H -#define _MSG_H +#ifndef MSG_H +#define MSG_H typedef struct { diff --git a/core/core_include/rect.h b/core/core_include/rect.h index fe538f8..8c043fd 100644 --- a/core/core_include/rect.h +++ b/core/core_include/rect.h @@ -1,5 +1,5 @@ -#ifndef _RECT_H -#define _RECT_H +#ifndef RECT_H +#define RECT_H #define ALIGN_HCENTER 0x00000000L #define ALIGN_LEFT 0x01000000L diff --git a/core/core_include/resource.h b/core/core_include/resource.h index 4b6a69b..5ba50b1 100644 --- a/core/core_include/resource.h +++ b/core/core_include/resource.h @@ -1,5 +1,5 @@ -#ifndef _RESOURCE_H_ -#define _RESOURCE_H_ +#ifndef RESOURCE_H +#define RESOURCE_H //BITMAP typedef struct struct_bitmap_info diff --git a/core/core_include/surface.h b/core/core_include/surface.h index af41daf..351c2bc 100644 --- a/core/core_include/surface.h +++ b/core/core_include/surface.h @@ -1,5 +1,5 @@ -#ifndef _GAL_H_ -#define _GAL_H_ +#ifndef GAL_H +#define GAL_H struct FRAME_LAYER { diff --git a/core/core_include/wave_buffer.h b/core/core_include/wave_buffer.h index bb85e12..35df65b 100644 --- a/core/core_include/wave_buffer.h +++ b/core/core_include/wave_buffer.h @@ -1,5 +1,5 @@ -#ifndef _WAVE_BUFFER_H_ -#define _WAVE_BUFFER_H_ +#ifndef WAVE_BUFFER_H +#define WAVE_BUFFER_H #define WAVE_BUFFER_LEN 1024 #define WAVE_READ_CACHE_LEN 8 diff --git a/core/core_include/wave_ctrl.h b/core/core_include/wave_ctrl.h index 3770061..9b042ac 100644 --- a/core/core_include/wave_ctrl.h +++ b/core/core_include/wave_ctrl.h @@ -1,5 +1,5 @@ -#ifndef _WAVE_CTRL_H_ -#define _WAVE_CTRL_H_ +#ifndef WAVE_CTRL_H +#define WAVE_CTRL_H typedef enum { diff --git a/core/core_include/wnd.h b/core/core_include/wnd.h index b253de4..85b3844 100644 --- a/core/core_include/wnd.h +++ b/core/core_include/wnd.h @@ -1,5 +1,5 @@ -#ifndef _GUI_WND_H_ -#define _GUI_WND_H_ +#ifndef GUI_WND_H +#define GUI_WND_H //Window attribution #define GL_ATTR_VISIBLE 0x80000000L diff --git a/core/core_include/word.h b/core/core_include/word.h index 41c58cb..d9d5b56 100644 --- a/core/core_include/word.h +++ b/core/core_include/word.h @@ -1,5 +1,5 @@ -#ifndef _WORD_UNIT_H_ -#define _WORD_UNIT_H_ +#ifndef WORD_UNIT_H +#define WORD_UNIT_H class c_surface; class c_word diff --git a/gui/gui_include/button.h b/gui/gui_include/button.h index 6579ab8..b9a4c39 100644 --- a/gui/gui_include/button.h +++ b/gui/gui_include/button.h @@ -1,5 +1,5 @@ -#ifndef _BUTTON_H_ -#define _BUTTON_H_ +#ifndef BUTTON_H +#define BUTTON_H #define GL_BN_CLICKED 0x1111 #define ON_GL_BN_CLICKED(ctrlId, func) \ diff --git a/gui/gui_include/dialog.h b/gui/gui_include/dialog.h index 7f5ac27..bbe1bdc 100644 --- a/gui/gui_include/dialog.h +++ b/gui/gui_include/dialog.h @@ -1,5 +1,5 @@ -#ifndef _DIALOG_H_ -#define _DIALOG_H_ +#ifndef DIALOG_H +#define DIALOG_H class c_surface; class c_dialog; diff --git a/gui/gui_include/edit.h b/gui/gui_include/edit.h index ccd691f..91904a7 100644 --- a/gui/gui_include/edit.h +++ b/gui/gui_include/edit.h @@ -1,5 +1,5 @@ -#ifndef _EDIT_H_ -#define _EDIT_H_ +#ifndef EDIT_H +#define EDIT_H #define KEY_BOARD_STYLE 0x00001000L #define NUM_BOARD_STYLE 0x00002000L diff --git a/gui/gui_include/gesture.h b/gui/gui_include/gesture.h index d2b8507..0c92695 100644 --- a/gui/gui_include/gesture.h +++ b/gui/gui_include/gesture.h @@ -1,5 +1,5 @@ -#ifndef _GESTURE_H_ -#define _GESTURE_H_ +#ifndef GESTURE_H +#define GESTURE_H typedef enum{ TOUCH_MOVE, diff --git a/gui/gui_include/keyboard.h b/gui/gui_include/keyboard.h index 8df9947..a09fd33 100644 --- a/gui/gui_include/keyboard.h +++ b/gui/gui_include/keyboard.h @@ -1,5 +1,5 @@ -#ifndef _KEYBOARD_H_ -#define _KEYBOARD_H_ +#ifndef KEYBOARD_H +#define KEYBOARD_H #define KEYBORAD_CLICK 0x5014 #define ON_KEYBORAD_UPDATE(ctrlId, func) \ diff --git a/gui/gui_include/label.h b/gui/gui_include/label.h index a34ab80..9fbbbaf 100644 --- a/gui/gui_include/label.h +++ b/gui/gui_include/label.h @@ -1,5 +1,5 @@ -#ifndef _LABEL_H_ -#define _LABEL_H_ +#ifndef LABEL_H +#define LABEL_H class c_label : public c_wnd { diff --git a/gui/gui_include/list_box.h b/gui/gui_include/list_box.h index 54b9818..eb4bccc 100644 --- a/gui/gui_include/list_box.h +++ b/gui/gui_include/list_box.h @@ -1,5 +1,5 @@ -#ifndef _LIST_BOX_H_ -#define _LIST_BOX_H_ +#ifndef LIST_BOX_H +#define LIST_BOX_H #define MAX_ITEM_NUM 12 diff --git a/gui/gui_include/my_resource.h b/gui/gui_include/my_resource.h index fb821db..1281624 100644 --- a/gui/gui_include/my_resource.h +++ b/gui/gui_include/my_resource.h @@ -1,5 +1,5 @@ -#ifndef _MY_RESOURCE_H_ -#define _MY_RESOURCE_H_ +#ifndef MY_RESOURCE_H +#define MY_RESOURCE_H typedef struct struct_font_info FONT_INFO; typedef struct struct_color_rect COLOR_RECT; diff --git a/gui/gui_include/slide_group.h b/gui/gui_include/slide_group.h index b188c37..db72131 100644 --- a/gui/gui_include/slide_group.h +++ b/gui/gui_include/slide_group.h @@ -1,5 +1,5 @@ -#ifndef PAGE_GROUP_H_ -#define PAGE_GROUP_H_ +#ifndef PAGE_GROUP_H +#define PAGE_GROUP_H #define MAX_PAGES 5 diff --git a/gui/gui_include/spinbox.h b/gui/gui_include/spinbox.h index 7992fa6..176a9e8 100644 --- a/gui/gui_include/spinbox.h +++ b/gui/gui_include/spinbox.h @@ -1,5 +1,5 @@ -#ifndef _SPIN_BOX_H_ -#define _SPIN_BOX_H_ +#ifndef SPIN_BOX_H +#define SPIN_BOX_H #define GL_SPIN_SELECT 0x2222 #define GL_SPIN_CONFIRM 0x3333 diff --git a/gui/gui_include/table.h b/gui/gui_include/table.h index 8c74c59..e9024d4 100644 --- a/gui/gui_include/table.h +++ b/gui/gui_include/table.h @@ -1,5 +1,5 @@ -#ifndef _TABLE_H_ -#define _TABLE_H_ +#ifndef TABLE_H +#define TABLE_H #define MAX_COL_NUM 30 #define MAX_ROW_NUM 30