mirror of
https://gitee.com/idea4good/GuiLite.git
synced 2025-04-05 17:37:55 +08:00
!34 refactor display.h
1. 刪除了 c_surface_no_fb, 重构了 c_display, c_surface 受影响文件: GuiLite.h, display.h 2. 重构了GuiLite/src下的目录结构,删除了 core_include, widgets_include 文件夹 3. 简化了:GuiLite.h 代码量(4338 -> 4286) 4. 受影响项目:GuiLiteSamples,请一并更新
This commit is contained in:
parent
cd2f8b2863
commit
4eba1d2b13
627
GuiLite.h
627
GuiLite.h
@ -1,107 +1,94 @@
|
||||
#pragma once
|
||||
|
||||
#define REAL_TIME_TASK_CYCLE_MS 50
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
#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) ((0xFF << 24) | ((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8))
|
||||
|
||||
#define ALIGN_HCENTER 0x00000000L
|
||||
#define ALIGN_LEFT 0x01000000L
|
||||
#define ALIGN_RIGHT 0x02000000L
|
||||
#define ALIGN_HMASK 0x03000000L
|
||||
|
||||
#define ALIGN_VCENTER 0x00000000L
|
||||
#define ALIGN_TOP 0x00100000L
|
||||
#define ALIGN_BOTTOM 0x00200000L
|
||||
#define ALIGN_VMASK 0x00300000L
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short year;
|
||||
unsigned short month;
|
||||
unsigned short date;
|
||||
unsigned short day;
|
||||
unsigned short hour;
|
||||
unsigned short minute;
|
||||
unsigned short second;
|
||||
}T_TIME;
|
||||
|
||||
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);
|
||||
|
||||
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* param), void* param);
|
||||
|
||||
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);
|
||||
|
||||
#define FIFO_BUFFER_LEN 1024
|
||||
class c_fifo
|
||||
{
|
||||
public:
|
||||
c_fifo();
|
||||
int read(void* buf, int len);
|
||||
int write(void* buf, int len);
|
||||
private:
|
||||
unsigned char m_buf[FIFO_BUFFER_LEN];
|
||||
int m_head;
|
||||
int m_tail;
|
||||
void* m_read_sem;
|
||||
void* m_write_mutex;
|
||||
};
|
||||
|
||||
class c_rect
|
||||
{
|
||||
public:
|
||||
c_rect(){ m_left = m_top = m_right = m_bottom = -1; }
|
||||
c_rect(int left, int top, int width, int height)
|
||||
{
|
||||
set_rect(left, top, width, height);
|
||||
}
|
||||
void set_rect(int left, int top, int width, int height)
|
||||
{
|
||||
ASSERT(width > 0 && height > 0);
|
||||
m_left = left;
|
||||
m_top = top;
|
||||
m_right = left + width - 1;
|
||||
m_bottom = top + height -1;
|
||||
}
|
||||
bool pt_in_rect(int x, int y) const
|
||||
{
|
||||
return x >= m_left && x <= m_right && y >= m_top && y <= m_bottom;
|
||||
}
|
||||
int operator==(const c_rect& rect) const
|
||||
{
|
||||
return (m_left == rect.m_left) && (m_top == rect.m_top) && (m_right == rect.m_right) && (m_bottom == rect.m_bottom);
|
||||
}
|
||||
int width() const { return m_right - m_left + 1; }
|
||||
int height() const { return m_bottom - m_top + 1 ; }
|
||||
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
};
|
||||
#define REAL_TIME_TASK_CYCLE_MS 50
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#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) ((0xFF << 24) | ((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8))
|
||||
#define ALIGN_HCENTER 0x00000000L
|
||||
#define ALIGN_LEFT 0x01000000L
|
||||
#define ALIGN_RIGHT 0x02000000L
|
||||
#define ALIGN_HMASK 0x03000000L
|
||||
#define ALIGN_VCENTER 0x00000000L
|
||||
#define ALIGN_TOP 0x00100000L
|
||||
#define ALIGN_BOTTOM 0x00200000L
|
||||
#define ALIGN_VMASK 0x00300000L
|
||||
typedef struct
|
||||
{
|
||||
unsigned short year;
|
||||
unsigned short month;
|
||||
unsigned short date;
|
||||
unsigned short day;
|
||||
unsigned short hour;
|
||||
unsigned short minute;
|
||||
unsigned short second;
|
||||
}T_TIME;
|
||||
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);
|
||||
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* param), void* param);
|
||||
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);
|
||||
#define FIFO_BUFFER_LEN 1024
|
||||
class c_fifo
|
||||
{
|
||||
public:
|
||||
c_fifo();
|
||||
int read(void* buf, int len);
|
||||
int write(void* buf, int len);
|
||||
private:
|
||||
unsigned char m_buf[FIFO_BUFFER_LEN];
|
||||
int m_head;
|
||||
int m_tail;
|
||||
void* m_read_sem;
|
||||
void* m_write_mutex;
|
||||
};
|
||||
class c_rect
|
||||
{
|
||||
public:
|
||||
c_rect(){ m_left = m_top = m_right = m_bottom = -1; }
|
||||
c_rect(int left, int top, int width, int height)
|
||||
{
|
||||
set_rect(left, top, width, height);
|
||||
}
|
||||
void set_rect(int left, int top, int width, int height)
|
||||
{
|
||||
ASSERT(width > 0 && height > 0);
|
||||
m_left = left;
|
||||
m_top = top;
|
||||
m_right = left + width - 1;
|
||||
m_bottom = top + height -1;
|
||||
}
|
||||
bool pt_in_rect(int x, int y) const
|
||||
{
|
||||
return x >= m_left && x <= m_right && y >= m_top && y <= m_bottom;
|
||||
}
|
||||
int operator==(const c_rect& rect) const
|
||||
{
|
||||
return (m_left == rect.m_left) && (m_top == rect.m_top) && (m_right == rect.m_right) && (m_bottom == rect.m_bottom);
|
||||
}
|
||||
int width() const { return m_right - m_left + 1; }
|
||||
int height() const { return m_bottom - m_top + 1 ; }
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
};
|
||||
//BITMAP
|
||||
typedef struct struct_bitmap_info
|
||||
{
|
||||
@ -238,7 +225,7 @@ typedef enum
|
||||
Z_ORDER_LEVEL_2,//highest graphic level
|
||||
Z_ORDER_LEVEL_MAX
|
||||
}Z_ORDER_LEVEL;
|
||||
struct EXTERNAL_GFX_OP
|
||||
struct DISPLAY_DRIVER
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb);
|
||||
void(*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb);
|
||||
@ -247,18 +234,19 @@ class c_surface;
|
||||
class c_display {
|
||||
friend class c_surface;
|
||||
public:
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op = 0);//multiple surface or surface_no_fb
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, c_surface* surface);//single custom surface
|
||||
inline c_surface* alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect = c_rect());//for multiple surfaces
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, c_surface* surface, DISPLAY_DRIVER* driver = 0);//single custom surface
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, DISPLAY_DRIVER* driver = 0);//multiple surface
|
||||
inline c_surface* alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect = c_rect());//for slide group
|
||||
inline int swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset);
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
void* get_phy_fb() { return m_phy_fb; }
|
||||
void* get_updated_fb(int* width, int* height, bool force_update = false)
|
||||
{
|
||||
if (width && height)
|
||||
{
|
||||
*width = get_width();
|
||||
*height = get_height();
|
||||
*width = m_width;
|
||||
*height = m_height;
|
||||
}
|
||||
if (force_update)
|
||||
{
|
||||
@ -277,35 +265,123 @@ public:
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int width = get_width();
|
||||
int height = get_height();
|
||||
//16 bits framebuffer
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
return build_bmp(file_name, width, height, (unsigned char*)m_phy_fb);
|
||||
return build_bmp(file_name, m_width, m_height, (unsigned char*)m_phy_fb);
|
||||
}
|
||||
//32 bits framebuffer
|
||||
unsigned short* p_bmp565_data = new unsigned short[width * height];
|
||||
unsigned short* p_bmp565_data = new unsigned short[m_width * m_height];
|
||||
unsigned int* p_raw_data = (unsigned int*)m_phy_fb;
|
||||
for (int i = 0; i < width * height; i++)
|
||||
for (int i = 0; i < m_width * m_height; i++)
|
||||
{
|
||||
unsigned int rgb = *p_raw_data++;
|
||||
p_bmp565_data[i] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
int ret = build_bmp(file_name, width, height, (unsigned char*)p_bmp565_data);
|
||||
int ret = build_bmp(file_name, m_width, m_height, (unsigned char*)p_bmp565_data);
|
||||
delete[]p_bmp565_data;
|
||||
return ret;
|
||||
}
|
||||
private:
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16 bits, 32 bits only
|
||||
void* m_phy_fb; //physical framebuffer
|
||||
protected:
|
||||
virtual void draw_pixel(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if ((x >= m_width) || (y >= m_height)) { return; }
|
||||
if (m_driver && m_driver->draw_pixel)
|
||||
{
|
||||
return m_driver->draw_pixel(x, y, rgb);
|
||||
}
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned short*)m_phy_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned int*)m_phy_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
}
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
if (m_driver && m_driver->fill_rect)
|
||||
{
|
||||
return m_driver->fill_rect(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
if (m_driver && m_driver->draw_pixel)
|
||||
{
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
m_driver->draw_pixel(x, y, rgb);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
register int _width = m_width;
|
||||
register int _height = m_height;
|
||||
int x, y;
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
unsigned short* phy_fb;
|
||||
unsigned int rgb_16 = GL_RGB_32_to_16(rgb);
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
phy_fb = &((unsigned short*)m_phy_fb)[y * _width + x0];
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if ((x < _width) && (y < _height))
|
||||
{
|
||||
*phy_fb++ = rgb_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int* phy_fb;
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
phy_fb = &((unsigned int*)m_phy_fb)[y * _width + x0];
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if ((x < _width) && (y < _height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual int flush_screen(int left, int top, int right, int bottom, void* fb, int fb_width)
|
||||
{
|
||||
if ((0 == m_phy_fb) || (0 == fb))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
register int _width = m_width;
|
||||
register int _height = m_height;
|
||||
left = (left >= _width) ? (_width - 1) : left;
|
||||
right = (right >= _width) ? (_width - 1) : right;
|
||||
top = (top >= _height) ? (_height - 1) : top;
|
||||
bottom = (bottom >= _height) ? (_height - 1) : bottom;
|
||||
for (int y = top; y < bottom; y++)
|
||||
{
|
||||
void* s_addr = (char*)fb + ((y * fb_width + left) * m_color_bytes);
|
||||
void* d_addr = (char*)m_phy_fb + ((y * _width + left) * m_color_bytes);
|
||||
memcpy(d_addr, s_addr, (right - left) * m_color_bytes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16/32 bits for default
|
||||
void* m_phy_fb; //physical framebuffer for default
|
||||
struct DISPLAY_DRIVER* m_driver; //Rendering by external method without default physical framebuffer
|
||||
int m_phy_read_index;
|
||||
int m_phy_write_index;
|
||||
c_surface* m_surface_group[SURFACE_CNT_MAX];
|
||||
int m_surface_cnt; //surface count
|
||||
int m_surface_index;
|
||||
|
||||
};
|
||||
class c_layer
|
||||
{
|
||||
@ -317,12 +393,10 @@ public:
|
||||
class c_surface {
|
||||
friend class c_display; friend class c_bitmap_operator;
|
||||
public:
|
||||
c_surface(unsigned int width, unsigned int height, unsigned int color_bytes, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : m_width(width), m_height(height), m_color_bytes(color_bytes), m_fb(0), m_is_active(false), m_top_zorder(Z_ORDER_LEVEL_0), m_phy_fb(0), m_phy_write_index(0), m_display(0)
|
||||
c_surface(unsigned int width, unsigned int height, unsigned int color_bytes, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : m_width(width), m_height(height), m_color_bytes(color_bytes), m_fb(0), m_is_active(false), m_top_zorder(Z_ORDER_LEVEL_0), m_phy_write_index(0), m_display(0)
|
||||
{
|
||||
(overlpa_rect == c_rect()) ? set_surface(max_zorder, c_rect(0, 0, width - 1, height - 1)) : set_surface(max_zorder, overlpa_rect);
|
||||
}
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
unsigned int get_pixel(int x, int y, unsigned int z_order)
|
||||
{
|
||||
if (x >= m_width || y >= m_height || x < 0 || y < 0 || z_order >= Z_ORDER_LEVEL_MAX)
|
||||
@ -332,15 +406,15 @@ public:
|
||||
}
|
||||
if (m_layers[z_order].fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)(m_layers[z_order].fb))[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)(m_layers[z_order].fb))[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)(m_layers[z_order].fb))[y * m_width + x]) : ((unsigned int*)(m_layers[z_order].fb))[y * m_width + x];
|
||||
}
|
||||
else if (m_fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]) : ((unsigned int*)m_fb)[y * m_width + x];
|
||||
}
|
||||
else if (m_phy_fb)
|
||||
else if (m_display->m_phy_fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)m_phy_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_phy_fb)[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)m_display->m_phy_fb)[y * m_width + x]) : ((unsigned int*)m_display->m_phy_fb)[y * m_width + x];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -357,7 +431,7 @@ public:
|
||||
}
|
||||
if (z_order == m_max_zorder)
|
||||
{
|
||||
return draw_pixel_on_fb(x, y, rgb);
|
||||
return draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
|
||||
if (z_order > (unsigned int)m_top_zorder)
|
||||
@ -367,19 +441,19 @@ public:
|
||||
if (m_layers[z_order].rect.pt_in_rect(x, y))
|
||||
{
|
||||
c_rect layer_rect = m_layers[z_order].rect;
|
||||
if (m_color_bytes == 4)
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned int*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = rgb;
|
||||
((unsigned short*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = GL_RGB_32_to_16(rgb);
|
||||
((unsigned int*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
if (z_order == m_top_zorder)
|
||||
{
|
||||
return draw_pixel_on_fb(x, y, rgb);
|
||||
return draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
bool be_overlapped = false;
|
||||
for (unsigned int tmp_z_order = Z_ORDER_LEVEL_MAX - 1; tmp_z_order > z_order; tmp_z_order--)
|
||||
@ -392,7 +466,7 @@ public:
|
||||
}
|
||||
if (!be_overlapped)
|
||||
{
|
||||
draw_pixel_on_fb(x, y, rgb);
|
||||
draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
}
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order)
|
||||
@ -403,7 +477,7 @@ public:
|
||||
y1 = (y1 > (m_height - 1)) ? (m_height - 1) : y1;
|
||||
if (z_order == m_max_zorder)
|
||||
{
|
||||
return fill_rect_on_fb(x0, y0, x1, y1, rgb);
|
||||
return fill_rect_low_level(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
if (z_order == m_top_zorder)
|
||||
{
|
||||
@ -416,18 +490,18 @@ public:
|
||||
{
|
||||
if (layer_rect.pt_in_rect(x, y))
|
||||
{
|
||||
if (m_color_bytes == 4)
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned int*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb;
|
||||
((unsigned short*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb_16;
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb_16;
|
||||
((unsigned int*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return fill_rect_on_fb(x0, y0, x1, y1, rgb);
|
||||
return fill_rect_low_level(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
for (; y0 <= y1; y0++)
|
||||
{
|
||||
@ -499,27 +573,16 @@ public:
|
||||
}
|
||||
int flush_screen(int left, int top, int right, int bottom)
|
||||
{
|
||||
if (!m_is_active)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (left < 0 || left >= m_width || right < 0 || right >= m_width ||
|
||||
top < 0 || top >= m_height || bottom < 0 || bottom >= m_height)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
if (!m_is_active || (0 == m_phy_fb) || (0 == m_fb))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
int display_width = m_display->get_width();
|
||||
int display_height = m_display->get_height();
|
||||
left = (left >= display_width) ? (display_width - 1) : left;
|
||||
right = (right >= display_width) ? (display_width - 1) : right;
|
||||
top = (top >= display_height) ? (display_height - 1) : top;
|
||||
bottom = (bottom >= display_height) ? (display_height - 1) : bottom;
|
||||
for (int y = top; y < bottom; y++)
|
||||
{
|
||||
void* s_addr = (char*)m_fb + ((y * m_width + left) * m_color_bytes);
|
||||
void* d_addr = (char*)m_phy_fb + ((y * display_width + left) * m_color_bytes);
|
||||
memcpy(d_addr, s_addr, (right - left) * m_color_bytes);
|
||||
}
|
||||
m_display->flush_screen(left, top, right, bottom, m_fb, m_width);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
return 0;
|
||||
}
|
||||
@ -537,90 +600,62 @@ public:
|
||||
{
|
||||
for (int x = rect.m_left; x <= rect.m_right; x++)
|
||||
{
|
||||
unsigned int rgb = (m_color_bytes == 4) ? ((unsigned int*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width] : GL_RGB_16_to_32(((unsigned short*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width]);
|
||||
draw_pixel_on_fb(x, y, rgb);
|
||||
unsigned int rgb = (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width]) : ((unsigned int*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width];
|
||||
draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
void set_active(bool flag) { m_is_active = flag; }
|
||||
protected:
|
||||
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
int display_width = m_display->get_width();
|
||||
int display_height = m_display->get_height();
|
||||
if (m_color_bytes == 4)
|
||||
virtual void fill_rect_low_level(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{//fill rect on framebuffer of surface
|
||||
int x, y;
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
int x;
|
||||
unsigned int* fb, * phy_fb;
|
||||
for (; y0 <= y1; y0++)
|
||||
unsigned short* fb;
|
||||
unsigned int rgb_16 = GL_RGB_32_to_16(rgb);
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
x = x0;
|
||||
fb = m_fb ? &((unsigned int*)m_fb)[y0 * m_width + x] : 0;
|
||||
phy_fb = &((unsigned int*)m_phy_fb)[y0 * display_width + x];
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
for (; x <= x1; x++)
|
||||
fb = m_fb ? &((unsigned short*)m_fb)[y * m_width + x0] : 0;
|
||||
if (!fb) { break; }
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if (fb)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
if (m_is_active && (x < display_width) && (y0 < display_height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
*fb++ = rgb_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
else
|
||||
{
|
||||
int x;
|
||||
unsigned short* fb, * phy_fb;
|
||||
rgb = GL_RGB_32_to_16(rgb);
|
||||
for (; y0 <= y1; y0++)
|
||||
unsigned int* fb;
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
x = x0;
|
||||
fb = m_fb ? &((unsigned short*)m_fb)[y0 * m_width + x] : 0;
|
||||
phy_fb = &((unsigned short*)m_phy_fb)[y0 * display_width + x];
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
for (; x <= x1; x++)
|
||||
fb = m_fb ? &((unsigned int*)m_fb)[y * m_width + x0] : 0;
|
||||
if (!fb) { break; }
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if (fb)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
if (m_is_active && (x < display_width) && (y0 < display_height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_is_active) { return; }
|
||||
m_display->fill_rect(x0, y0, x1, y1, rgb);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
}
|
||||
virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb)
|
||||
virtual void draw_pixel_low_level(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if (m_fb)
|
||||
{
|
||||
(m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] = rgb : ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
if (m_is_active && (x < m_display->get_width()) && (y < m_display->get_height()))
|
||||
{
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
((unsigned int*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb;
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)m_phy_fb)[y * (m_display->get_width()) + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
{//draw pixel on framebuffer of surface
|
||||
(m_color_bytes == 2) ? ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb): ((unsigned int*)m_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
if (!m_is_active) { return; }
|
||||
m_display->draw_pixel(x, y, rgb);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
}
|
||||
void attach_display(c_display* display)
|
||||
{
|
||||
ASSERT(display);
|
||||
m_display = display;
|
||||
m_phy_fb = display->m_phy_fb;
|
||||
m_phy_write_index = &display->m_phy_write_index;
|
||||
}
|
||||
void set_surface(Z_ORDER_LEVEL max_z_order, c_rect layer_rect)
|
||||
@ -638,87 +673,22 @@ protected:
|
||||
}
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16 bits, 32 bits only
|
||||
int m_color_bytes; //16 bits, 32 bits for default
|
||||
void* m_fb; //frame buffer you could see
|
||||
c_layer m_layers[Z_ORDER_LEVEL_MAX];//all graphic layers
|
||||
bool m_is_active; //active flag
|
||||
Z_ORDER_LEVEL m_max_zorder; //the highest graphic layer the surface will have
|
||||
Z_ORDER_LEVEL m_top_zorder; //the current highest graphic layer the surface have
|
||||
void* m_phy_fb; //physical framebufer
|
||||
int* m_phy_write_index;
|
||||
c_display* m_display;
|
||||
};
|
||||
class c_surface_no_fb : public c_surface {//No physical framebuffer, render with external graphic interface
|
||||
friend class c_display;
|
||||
public:
|
||||
c_surface_no_fb(unsigned int width, unsigned int height, unsigned int color_bytes, struct EXTERNAL_GFX_OP* gfx_op, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : c_surface(width, height, color_bytes, max_zorder, overlpa_rect), m_gfx_op(gfx_op) {}
|
||||
protected:
|
||||
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
if (!m_gfx_op)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_gfx_op->fill_rect)
|
||||
{
|
||||
return m_gfx_op->fill_rect(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
if (m_gfx_op->draw_pixel && m_is_active)
|
||||
{
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
m_gfx_op->draw_pixel(x, y, rgb);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_fb) { return; }
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
unsigned int* fb;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = &((unsigned int*)m_fb)[y0 * m_width + x0];
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
unsigned short* fb;
|
||||
rgb = GL_RGB_32_to_16(rgb);
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = &((unsigned short*)m_fb)[y0 * m_width + x0];
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if (m_gfx_op && m_gfx_op->draw_pixel && m_is_active)
|
||||
{
|
||||
m_gfx_op->draw_pixel(x, y, rgb);
|
||||
}
|
||||
if (!m_fb) { return; }
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
((unsigned int*)m_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
}
|
||||
struct EXTERNAL_GFX_OP* m_gfx_op;//Rendering by external method
|
||||
};
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op) : m_width(display_width), m_height(display_height), m_color_bytes(color_bytes), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(surface_cnt), m_surface_index(0)
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface, DISPLAY_DRIVER* driver) : m_phy_fb(phy_fb), m_width(display_width), m_height(display_height), m_driver(driver), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0)
|
||||
{
|
||||
m_color_bytes = surface->m_color_bytes;
|
||||
surface->m_is_active = true;
|
||||
(m_surface_group[0] = surface)->attach_display(this);
|
||||
}
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, DISPLAY_DRIVER* driver) : m_phy_fb(phy_fb), m_width(display_width), m_height(display_height), m_color_bytes(color_bytes), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(surface_cnt), m_driver(driver), m_surface_index(0)
|
||||
{
|
||||
ASSERT(color_bytes == 2 || color_bytes == 4);
|
||||
ASSERT(m_surface_cnt <= SURFACE_CNT_MAX);
|
||||
@ -726,16 +696,10 @@ inline c_display::c_display(void* phy_fb, int display_width, int display_height,
|
||||
|
||||
for (int i = 0; i < m_surface_cnt; i++)
|
||||
{
|
||||
m_surface_group[i] = (phy_fb) ? new c_surface(surface_width, surface_height, color_bytes) : new c_surface_no_fb(surface_width, surface_height, color_bytes, gfx_op);
|
||||
m_surface_group[i] = new c_surface(surface_width, surface_height, color_bytes);
|
||||
m_surface_group[i]->attach_display(this);
|
||||
}
|
||||
}
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface) : m_width(display_width), m_height(display_height), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0)
|
||||
{
|
||||
m_color_bytes = surface->m_color_bytes;
|
||||
surface->m_is_active = true;
|
||||
(m_surface_group[0] = surface)->attach_display(this);
|
||||
}
|
||||
inline c_surface* c_display::alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect)
|
||||
{
|
||||
ASSERT(max_zorder < Z_ORDER_LEVEL_MAX && m_surface_index < m_surface_cnt);
|
||||
@ -744,8 +708,8 @@ inline c_surface* c_display::alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect laye
|
||||
}
|
||||
inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset)
|
||||
{
|
||||
int surface_width = s0->get_width();
|
||||
int surface_height = s0->get_height();
|
||||
register int surface_width = s0->m_width;
|
||||
register int surface_height = s0->m_height;
|
||||
if (offset < 0 || offset > surface_width || y0 < 0 || y0 >= surface_height ||
|
||||
y1 < 0 || y1 >= surface_height || x0 < 0 || x0 >= surface_width || x1 < 0 || x1 >= surface_width)
|
||||
{
|
||||
@ -767,35 +731,18 @@ inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
char* addr_s = ((char*)(s0->m_fb) + (y * (s0->get_width()) + x0 + offset) * m_color_bytes);
|
||||
char* addr_s = ((char*)(s0->m_fb) + (y * surface_width + x0 + offset) * m_color_bytes);
|
||||
char* addr_d = ((char*)(m_phy_fb)+(y * m_width + x0) * m_color_bytes);
|
||||
memcpy(addr_d, addr_s, (width - offset) * m_color_bytes);
|
||||
//Right surface
|
||||
addr_s = ((char*)(s1->m_fb) + (y * (s1->get_width()) + x0) * m_color_bytes);
|
||||
addr_s = ((char*)(s1->m_fb) + (y * surface_width + x0) * m_color_bytes);
|
||||
addr_d = ((char*)(m_phy_fb)+(y * m_width + x0 + (width - offset)) * m_color_bytes);
|
||||
memcpy(addr_d, addr_s, offset * m_color_bytes);
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 4)
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
for (int x = x0; x <= (x1 - offset); x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s0->m_fb)[y * m_width + x + offset]);
|
||||
}
|
||||
//Right surface
|
||||
for (int x = x1 - offset; x <= x1; x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s1->m_fb)[y * m_width + x + offset - x1 + x0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel;
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = m_driver->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
@ -810,6 +757,23 @@ inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1
|
||||
}
|
||||
}
|
||||
}
|
||||
else //m_color_bytes == 3/4...
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = m_driver->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
for (int x = x0; x <= (x1 - offset); x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s0->m_fb)[y * m_width + x + offset]);
|
||||
}
|
||||
//Right surface
|
||||
for (int x = x1 - offset; x <= x1; x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s1->m_fb)[y * m_width + x + offset - x1 + x0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_phy_write_index++;
|
||||
return 0;
|
||||
}
|
||||
@ -3407,22 +3371,12 @@ private:
|
||||
#ifdef GUILITE_ON
|
||||
c_bitmap_operator the_bitmap_op = c_bitmap_operator();
|
||||
c_image_operator* c_image::image_operator = &the_bitmap_op;
|
||||
const void* c_theme::s_font_map[FONT_MAX];
|
||||
const void* c_theme::s_image_map[IMAGE_MAX];
|
||||
unsigned int c_theme::s_color_map[COLOR_MAX];
|
||||
c_lattice_font_op the_lattice_font_op = c_lattice_font_op();
|
||||
c_font_operator* c_word::fontOperator = &the_lattice_font_op;
|
||||
#endif
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
const void* c_theme::s_font_map[FONT_MAX];
|
||||
const void* c_theme::s_image_map[IMAGE_MAX];
|
||||
unsigned int c_theme::s_color_map[COLOR_MAX];
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
c_lattice_font_op the_lattice_font_op = c_lattice_font_op();
|
||||
c_font_operator* c_word::fontOperator = &the_lattice_font_op;
|
||||
|
||||
#endif
|
||||
#ifdef GUILITE_ON
|
||||
#if (defined __linux__) || (defined __APPLE__)
|
||||
#include <unistd.h>
|
||||
@ -4264,11 +4218,7 @@ int c_fifo::write(void* buf, int len)
|
||||
#endif
|
||||
#ifdef GUILITE_ON
|
||||
DIALOG_ARRAY c_dialog::ms_the_dialogs[SURFACE_CNT_MAX];
|
||||
#endif
|
||||
#ifdef GUILITE_ON
|
||||
c_keyboard c_edit::s_keyboard;
|
||||
#endif
|
||||
#ifdef GUILITE_ON
|
||||
static c_keyboard_button s_key_0, s_key_1, s_key_2, s_key_3, s_key_4, s_key_5, s_key_6, s_key_7, s_key_8, s_key_9;
|
||||
static c_keyboard_button s_key_A, s_key_B, s_key_C, s_key_D, s_key_E, s_key_F, s_key_G, s_key_H, s_key_I, s_key_J;
|
||||
static c_keyboard_button s_key_K, s_key_L, s_key_M, s_key_N, s_key_O, s_key_P, s_key_Q, s_key_R, s_key_S, s_key_T;
|
||||
@ -4306,12 +4256,12 @@ WND_TREE g_key_board_children[] =
|
||||
{&s_key_B, 'B', 0, ((KEY_WIDTH / 2) + POS_X(5)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_N, 'N', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_M, 'M', 0, ((KEY_WIDTH / 2) + POS_X(7)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_del, 0x7F, 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(2), DEL_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_del,0x7F, 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(2), DEL_WIDTH, KEY_HEIGHT},
|
||||
//Row 4
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), ESC_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), ESC_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_num_switch, 0x90, 0, POS_X(2), POS_Y(3), SWITCH_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_space, ' ', 0, ((KEY_WIDTH / 2) + POS_X(3)), POS_Y(3), SPACE_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(3), DOT_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(3), DOT_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_enter, '\n', 0, POS_X(8), POS_Y(3), ENTER_WIDTH, KEY_HEIGHT},
|
||||
{0,0,0,0,0,0,0}
|
||||
};
|
||||
@ -4326,12 +4276,11 @@ WND_TREE g_number_board_children[] =
|
||||
{&s_key_7, '7', 0, POS_X(0), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_8, '8', 0, POS_X(1), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_9, '9', 0, POS_X(2), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_esc,0x1B, 0, POS_X(0), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_0, '0', 0, POS_X(1), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, POS_X(2), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot,'.', 0, POS_X(2), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_del, 0x7F, 0, POS_X(3), POS_Y(0), KEY_WIDTH, KEY_HEIGHT * 2 + 2},
|
||||
{&s_key_enter,'\n', 0, POS_X(3), POS_Y(2), KEY_WIDTH, KEY_HEIGHT * 2 + 2},
|
||||
{0,0,0,0,0,0,0}
|
||||
};
|
||||
#endif
|
||||
#endif
|
@ -12,8 +12,8 @@ ADD_DEFINITIONS(-DGUILITE_ON)
|
||||
FILE(GLOB CORE_SRC core/*.cpp)
|
||||
FILE(GLOB CORE_ADAPTER core/adapter/api_linux.cpp
|
||||
core/adapter/audio_linux.cpp)
|
||||
# gui
|
||||
FILE(GLOB WIDGETS_SRC widgets/*.cpp)
|
||||
# widgets
|
||||
FILE(GLOB WIDGETS_SRC widgets/*.cpp)
|
||||
|
||||
# build static library
|
||||
ADD_LIBRARY(GuiLite STATIC ${CORE_SRC} ${CORE_ADAPTER} ${WIDGETS_SRC})
|
||||
|
@ -1,42 +1,37 @@
|
||||
echo "Build header-only library: GuiLite.h"
|
||||
|
||||
# build GuiLiteRaw.h
|
||||
cd core_include
|
||||
cd core
|
||||
cat api.h resource.h theme.h display.h word.h image.h wnd.h > core.h
|
||||
mv core.h ../
|
||||
cd ..
|
||||
|
||||
cd ../widgets_include
|
||||
cd widgets
|
||||
cat button.h dialog.h keyboard.h edit.h label.h list_box.h slide_group.h spinbox.h table.h wave_buffer.h wave_ctrl.h > widgets.h
|
||||
mv widgets.h ../
|
||||
|
||||
cd ..
|
||||
|
||||
cat core.h widgets.h > GuiLiteRaw.h
|
||||
|
||||
# build GuiLiteRaw.cpp
|
||||
cd core
|
||||
cat *.cpp > core.cpp
|
||||
mv core.cpp ../
|
||||
cp core/core.cpp ./
|
||||
cp widgets/widgets.cpp ./
|
||||
|
||||
cd adapter
|
||||
cd core/adapter
|
||||
cat *.cpp > adapter.cpp
|
||||
mv adapter.cpp ../../
|
||||
cd ../..
|
||||
|
||||
cd ../../widgets
|
||||
cat *.cpp > widgets.cpp
|
||||
mv widgets.cpp ../
|
||||
|
||||
cd ..
|
||||
cat core.cpp adapter.cpp widgets.cpp > GuiLiteRaw.cpp
|
||||
|
||||
# remove include core_include widgets_include from GuiLiteRaw.h
|
||||
sed -i '/^#include.*core_include\|widgets_include.*/d' GuiLiteRaw.h
|
||||
# remove include core widgets from GuiLiteRaw.h
|
||||
sed -i '/^#include.*core\|widgets.*/d' GuiLiteRaw.h
|
||||
# remove all #pragma once
|
||||
sed -i '/^#pragma once/d' GuiLiteRaw.h
|
||||
# add #pragma once for 1st line
|
||||
sed -i '1 s/^/#pragma once\n/' GuiLiteRaw.h
|
||||
|
||||
# remove include core_include widgets_include from GuiLiteRaw.cpp
|
||||
sed -i '/^#include.*core_include\|widgets_include.*/d' GuiLiteRaw.cpp
|
||||
# remove include core widgets from GuiLiteRaw.cpp
|
||||
sed -i '/^#include.*core\|widgets.*/d' GuiLiteRaw.cpp
|
||||
|
||||
# Delete empty lines or blank lines
|
||||
sed '/^$/d' GuiLiteRaw.h > GuiLite.h
|
||||
@ -52,7 +47,7 @@ gcc -c -D GUILITE_ON test.cpp
|
||||
mv GuiLite.h ../
|
||||
echo "Done!"
|
||||
echo "You could find GuiLite.h in root folder"
|
||||
./.sync.sh GuiLite-header
|
||||
|
||||
# clean
|
||||
rm *.h *.cpp *.o
|
||||
./.sync.sh GuiLite-header
|
6
src/Gradle/.gitattributes
vendored
6
src/Gradle/.gitattributes
vendored
@ -1,6 +0,0 @@
|
||||
#
|
||||
# https://help.github.com/articles/dealing-with-line-endings/
|
||||
#
|
||||
# These are explicitly windows files and should use crlf
|
||||
*.bat text eol=crlf
|
||||
|
10
src/Gradle/.gitignore
vendored
10
src/Gradle/.gitignore
vendored
@ -1,10 +0,0 @@
|
||||
# Ignore Gradle project-specific cache directory
|
||||
.gradle
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
# Ignore IDEA project-specific configuration directory
|
||||
.idea
|
||||
|
||||
.DS_Store
|
@ -1,24 +0,0 @@
|
||||
## 使用Gradle编译Guilite ###
|
||||
|
||||
* ### Windows平台: ###
|
||||
* 兼容VS各大版本,自动选择最新版本。
|
||||
* 兼容Cygwin或MinGW,确保gcc在path中。目前不支持Clang。
|
||||
* 按`win+R`输入`cmd`打开命令行运行:`g++ -v`,有打印出版本则正常。
|
||||
* 编译Guilite:
|
||||
```powershell
|
||||
cd $GUILITE\workspace\Gradle\
|
||||
gradlew produce
|
||||
```
|
||||
* 输出位置:$GRADLE\build\lib\main\release\shared(static)\
|
||||
|
||||
* ### Linux和Mac平台: ###
|
||||
* 将使用系统PATH发现GCC或Clang,请确保已经安装GCC或Clang。
|
||||
* 打开终端运行:`g++ -v`,有打印出版本则正常。
|
||||
* 编译Guilite:
|
||||
```shell
|
||||
cd $GUILITE/workspace/Gradle/
|
||||
gradlew produce
|
||||
```
|
||||
* 输出位置:$GRADLE/build/lib/main/release/shared(static)/
|
||||
|
||||
对单片机系统不了解,未支持!
|
@ -1,36 +0,0 @@
|
||||
plugins {
|
||||
id("org.gradle.cpp-library")
|
||||
}
|
||||
|
||||
library {
|
||||
/**
|
||||
* Gradle stipulates that the source directory is: $project/src/main/cpp/,
|
||||
* specifies the `.cpp` source file directory according to the project.
|
||||
* */
|
||||
source.from(
|
||||
"../core",
|
||||
"../widgets"
|
||||
)
|
||||
/**
|
||||
* Gradle conventions the header file directory is: $project/src/main/headers/,
|
||||
* specify the `.h` header file directory according to the project.
|
||||
*/
|
||||
privateHeaders.from(
|
||||
"../core_include",
|
||||
"../widgets_include"
|
||||
)
|
||||
/**
|
||||
* Gradle only exports shared libraries(dynamic libraries) by default,
|
||||
* adds support for static libraries.
|
||||
* */
|
||||
linkage.add(Linkage.STATIC)
|
||||
}
|
||||
/**
|
||||
* Compile tasks for custom release type dynamic and static libraries
|
||||
* */
|
||||
tasks.register("produce") {
|
||||
dependsOn(
|
||||
"assembleReleaseShared",
|
||||
"assembleReleaseStatic"
|
||||
)
|
||||
}
|
BIN
src/Gradle/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
src/Gradle/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
#Thu Jan 23 20:09:34 CST 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
183
src/Gradle/gradlew
vendored
183
src/Gradle/gradlew
vendored
@ -1,183 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
100
src/Gradle/gradlew.bat
vendored
100
src/Gradle/gradlew.bat
vendored
@ -1,100 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
@ -1 +0,0 @@
|
||||
rootProject.name = "GuiLite"
|
@ -382,35 +382,15 @@
|
||||
<Group>
|
||||
<GroupName>core</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>display.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\display.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>theme.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\theme.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wnd.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\wnd.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>word.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\word.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>api_unknow.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\adapter\api_unknow.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>image.cpp</FileName>
|
||||
<FileName>core.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\core\image.cpp</FilePath>
|
||||
<FilePath>.\core\core.cpp</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
@ -418,24 +398,9 @@
|
||||
<GroupName>widgets</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>button.cpp</FileName>
|
||||
<FileName>widgets.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\widgets\button.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>label.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\widgets\label.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wave_buffer.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\widgets\wave_buffer.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wave_ctrl.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\widgets\wave_ctrl.cpp</FilePath>
|
||||
<FilePath>.\widgets\widgets.cpp</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
|
@ -182,7 +182,8 @@
|
||||
<AdditionalOptions>%(AdditionalOptions) /machine:X64</AdditionalOptions>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>call "$(SolutionDir)sync_build.bat" "GuiLite"</Command>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -389,22 +390,28 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="core\adapter\api_win.cpp" />
|
||||
<ClCompile Include="core\display.cpp" />
|
||||
<ClCompile Include="core\image.cpp" />
|
||||
<ClCompile Include="core\theme.cpp" />
|
||||
<ClCompile Include="core\wnd.cpp" />
|
||||
<ClCompile Include="core\word.cpp" />
|
||||
<ClCompile Include="widgets\button.cpp" />
|
||||
<ClCompile Include="widgets\dialog.cpp" />
|
||||
<ClCompile Include="widgets\edit.cpp" />
|
||||
<ClCompile Include="widgets\keyboard.cpp" />
|
||||
<ClCompile Include="widgets\label.cpp" />
|
||||
<ClCompile Include="widgets\list_box.cpp" />
|
||||
<ClCompile Include="widgets\slide_group.cpp" />
|
||||
<ClCompile Include="widgets\spinbox.cpp" />
|
||||
<ClCompile Include="widgets\table.cpp" />
|
||||
<ClCompile Include="widgets\wave_buffer.cpp" />
|
||||
<ClCompile Include="widgets\wave_ctrl.cpp" />
|
||||
<ClCompile Include="core\core.cpp" />
|
||||
<ClCompile Include="widgets\widgets.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core\api.h" />
|
||||
<ClInclude Include="core\display.h" />
|
||||
<ClInclude Include="core\image.h" />
|
||||
<ClInclude Include="core\resource.h" />
|
||||
<ClInclude Include="core\theme.h" />
|
||||
<ClInclude Include="core\wnd.h" />
|
||||
<ClInclude Include="core\word.h" />
|
||||
<ClInclude Include="widgets\button.h" />
|
||||
<ClInclude Include="widgets\dialog.h" />
|
||||
<ClInclude Include="widgets\edit.h" />
|
||||
<ClInclude Include="widgets\keyboard.h" />
|
||||
<ClInclude Include="widgets\label.h" />
|
||||
<ClInclude Include="widgets\list_box.h" />
|
||||
<ClInclude Include="widgets\slide_group.h" />
|
||||
<ClInclude Include="widgets\spinbox.h" />
|
||||
<ClInclude Include="widgets\table.h" />
|
||||
<ClInclude Include="widgets\wave_buffer.h" />
|
||||
<ClInclude Include="widgets\wave_ctrl.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
@ -1,55 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="widgets\button.cpp">
|
||||
<ClCompile Include="widgets\widgets.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\dialog.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\edit.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\keyboard.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\label.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\list_box.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\slide_group.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\spinbox.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\table.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\wave_buffer.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="widgets\wave_ctrl.cpp">
|
||||
<Filter>widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\display.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\theme.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\wnd.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\word.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\adapter\api_win.cpp">
|
||||
<Filter>core\adapter</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="core\image.cpp">
|
||||
<ClCompile Include="core\core.cpp">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
@ -64,4 +22,60 @@
|
||||
<UniqueIdentifier>{691801eb-7076-4af6-aa0c-5ce5b0fcb21c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="core\api.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\display.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\image.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\resource.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\theme.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\wnd.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="core\word.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\button.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\dialog.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\edit.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\keyboard.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\label.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\list_box.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\slide_group.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\spinbox.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\table.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\wave_buffer.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="widgets\wave_ctrl.h">
|
||||
<Filter>widgets</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,7 +1,7 @@
|
||||
#ifdef GUILITE_ON
|
||||
#if (defined __linux__) || (defined __APPLE__)
|
||||
|
||||
#include "../../core_include/api.h"
|
||||
#include "../../core/api.h"
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifdef GUILITE_ON
|
||||
#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && (!defined __APPLE__)
|
||||
|
||||
#include "../../core_include/api.h"
|
||||
#include "../../core/api.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void(*do_assert)(const char* file, int line);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifdef GUILITE_ON
|
||||
#if (defined _WIN32) || (defined WIN32) || (defined _WIN64) || (defined WIN64)
|
||||
|
||||
#include "../../core_include/api.h"
|
||||
#include "../../core/api.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
@ -1,104 +1,104 @@
|
||||
#pragma once
|
||||
|
||||
#define REAL_TIME_TASK_CYCLE_MS 50
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
#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) ((0xFF << 24) | ((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8))
|
||||
|
||||
#define ALIGN_HCENTER 0x00000000L
|
||||
#define ALIGN_LEFT 0x01000000L
|
||||
#define ALIGN_RIGHT 0x02000000L
|
||||
#define ALIGN_HMASK 0x03000000L
|
||||
|
||||
#define ALIGN_VCENTER 0x00000000L
|
||||
#define ALIGN_TOP 0x00100000L
|
||||
#define ALIGN_BOTTOM 0x00200000L
|
||||
#define ALIGN_VMASK 0x00300000L
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short year;
|
||||
unsigned short month;
|
||||
unsigned short date;
|
||||
unsigned short day;
|
||||
unsigned short hour;
|
||||
unsigned short minute;
|
||||
unsigned short second;
|
||||
}T_TIME;
|
||||
|
||||
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);
|
||||
|
||||
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* param), void* param);
|
||||
|
||||
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);
|
||||
|
||||
#define FIFO_BUFFER_LEN 1024
|
||||
class c_fifo
|
||||
{
|
||||
public:
|
||||
c_fifo();
|
||||
int read(void* buf, int len);
|
||||
int write(void* buf, int len);
|
||||
private:
|
||||
unsigned char m_buf[FIFO_BUFFER_LEN];
|
||||
int m_head;
|
||||
int m_tail;
|
||||
void* m_read_sem;
|
||||
void* m_write_mutex;
|
||||
};
|
||||
|
||||
class c_rect
|
||||
{
|
||||
public:
|
||||
c_rect(){ m_left = m_top = m_right = m_bottom = -1; }
|
||||
c_rect(int left, int top, int width, int height)
|
||||
{
|
||||
set_rect(left, top, width, height);
|
||||
}
|
||||
void set_rect(int left, int top, int width, int height)
|
||||
{
|
||||
ASSERT(width > 0 && height > 0);
|
||||
m_left = left;
|
||||
m_top = top;
|
||||
m_right = left + width - 1;
|
||||
m_bottom = top + height -1;
|
||||
}
|
||||
bool pt_in_rect(int x, int y) const
|
||||
{
|
||||
return x >= m_left && x <= m_right && y >= m_top && y <= m_bottom;
|
||||
}
|
||||
int operator==(const c_rect& rect) const
|
||||
{
|
||||
return (m_left == rect.m_left) && (m_top == rect.m_top) && (m_right == rect.m_right) && (m_bottom == rect.m_bottom);
|
||||
}
|
||||
int width() const { return m_right - m_left + 1; }
|
||||
int height() const { return m_bottom - m_top + 1 ; }
|
||||
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
};
|
||||
#pragma once
|
||||
|
||||
#define REAL_TIME_TASK_CYCLE_MS 50
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
#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) ((0xFF << 24) | ((((unsigned int)(rgb)) & 0x1F) << 3) | ((((unsigned int)(rgb)) & 0x7E0) << 5) | ((((unsigned int)(rgb)) & 0xF800) << 8))
|
||||
|
||||
#define ALIGN_HCENTER 0x00000000L
|
||||
#define ALIGN_LEFT 0x01000000L
|
||||
#define ALIGN_RIGHT 0x02000000L
|
||||
#define ALIGN_HMASK 0x03000000L
|
||||
|
||||
#define ALIGN_VCENTER 0x00000000L
|
||||
#define ALIGN_TOP 0x00100000L
|
||||
#define ALIGN_BOTTOM 0x00200000L
|
||||
#define ALIGN_VMASK 0x00300000L
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short year;
|
||||
unsigned short month;
|
||||
unsigned short date;
|
||||
unsigned short day;
|
||||
unsigned short hour;
|
||||
unsigned short minute;
|
||||
unsigned short second;
|
||||
}T_TIME;
|
||||
|
||||
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);
|
||||
|
||||
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* param), void* param);
|
||||
|
||||
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);
|
||||
|
||||
#define FIFO_BUFFER_LEN 1024
|
||||
class c_fifo
|
||||
{
|
||||
public:
|
||||
c_fifo();
|
||||
int read(void* buf, int len);
|
||||
int write(void* buf, int len);
|
||||
private:
|
||||
unsigned char m_buf[FIFO_BUFFER_LEN];
|
||||
int m_head;
|
||||
int m_tail;
|
||||
void* m_read_sem;
|
||||
void* m_write_mutex;
|
||||
};
|
||||
|
||||
class c_rect
|
||||
{
|
||||
public:
|
||||
c_rect(){ m_left = m_top = m_right = m_bottom = -1; }
|
||||
c_rect(int left, int top, int width, int height)
|
||||
{
|
||||
set_rect(left, top, width, height);
|
||||
}
|
||||
void set_rect(int left, int top, int width, int height)
|
||||
{
|
||||
ASSERT(width > 0 && height > 0);
|
||||
m_left = left;
|
||||
m_top = top;
|
||||
m_right = left + width - 1;
|
||||
m_bottom = top + height -1;
|
||||
}
|
||||
bool pt_in_rect(int x, int y) const
|
||||
{
|
||||
return x >= m_left && x <= m_right && y >= m_top && y <= m_bottom;
|
||||
}
|
||||
int operator==(const c_rect& rect) const
|
||||
{
|
||||
return (m_left == rect.m_left) && (m_top == rect.m_top) && (m_right == rect.m_right) && (m_bottom == rect.m_bottom);
|
||||
}
|
||||
int width() const { return m_right - m_left + 1; }
|
||||
int height() const { return m_bottom - m_top + 1 ; }
|
||||
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
};
|
17
src/core/core.cpp
Normal file
17
src/core/core.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "../core/display.h"
|
||||
#include "../core//image.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/word.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
c_bitmap_operator the_bitmap_op = c_bitmap_operator();
|
||||
c_image_operator* c_image::image_operator = &the_bitmap_op;
|
||||
|
||||
const void* c_theme::s_font_map[FONT_MAX];
|
||||
const void* c_theme::s_image_map[IMAGE_MAX];
|
||||
unsigned int c_theme::s_color_map[COLOR_MAX];
|
||||
|
||||
c_lattice_font_op the_lattice_font_op = c_lattice_font_op();
|
||||
c_font_operator* c_word::fontOperator = &the_lattice_font_op;
|
||||
#endif
|
@ -1 +0,0 @@
|
||||
#include "../core_include/display.h"
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core/api.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -15,7 +15,7 @@ typedef enum
|
||||
Z_ORDER_LEVEL_MAX
|
||||
}Z_ORDER_LEVEL;
|
||||
|
||||
struct EXTERNAL_GFX_OP
|
||||
struct DISPLAY_DRIVER
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb);
|
||||
void(*fill_rect)(int x0, int y0, int x1, int y1, unsigned int rgb);
|
||||
@ -25,19 +25,20 @@ class c_surface;
|
||||
class c_display {
|
||||
friend class c_surface;
|
||||
public:
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op = 0);//multiple surface or surface_no_fb
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, c_surface* surface);//single custom surface
|
||||
inline c_surface* alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect = c_rect());//for multiple surfaces
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, c_surface* surface, DISPLAY_DRIVER* driver = 0);//single custom surface
|
||||
inline c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, DISPLAY_DRIVER* driver = 0);//multiple surface
|
||||
inline c_surface* alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect = c_rect());//for slide group
|
||||
inline int swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset);
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
void* get_phy_fb() { return m_phy_fb; }
|
||||
|
||||
void* get_updated_fb(int* width, int* height, bool force_update = false)
|
||||
{
|
||||
if (width && height)
|
||||
{
|
||||
*width = get_width();
|
||||
*height = get_height();
|
||||
*width = m_width;
|
||||
*height = m_height;
|
||||
}
|
||||
if (force_update)
|
||||
{
|
||||
@ -58,40 +59,138 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int width = get_width();
|
||||
int height = get_height();
|
||||
|
||||
//16 bits framebuffer
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
return build_bmp(file_name, width, height, (unsigned char*)m_phy_fb);
|
||||
return build_bmp(file_name, m_width, m_height, (unsigned char*)m_phy_fb);
|
||||
}
|
||||
|
||||
//32 bits framebuffer
|
||||
unsigned short* p_bmp565_data = new unsigned short[width * height];
|
||||
unsigned short* p_bmp565_data = new unsigned short[m_width * m_height];
|
||||
unsigned int* p_raw_data = (unsigned int*)m_phy_fb;
|
||||
|
||||
for (int i = 0; i < width * height; i++)
|
||||
for (int i = 0; i < m_width * m_height; i++)
|
||||
{
|
||||
unsigned int rgb = *p_raw_data++;
|
||||
p_bmp565_data[i] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
|
||||
int ret = build_bmp(file_name, width, height, (unsigned char*)p_bmp565_data);
|
||||
int ret = build_bmp(file_name, m_width, m_height, (unsigned char*)p_bmp565_data);
|
||||
delete[]p_bmp565_data;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16 bits, 32 bits only
|
||||
void* m_phy_fb; //physical framebuffer
|
||||
protected:
|
||||
virtual void draw_pixel(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if ((x >= m_width) || (y >= m_height)) { return; }
|
||||
|
||||
if (m_driver && m_driver->draw_pixel)
|
||||
{
|
||||
return m_driver->draw_pixel(x, y, rgb);
|
||||
}
|
||||
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned short*)m_phy_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned int*)m_phy_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
if (m_driver && m_driver->fill_rect)
|
||||
{
|
||||
return m_driver->fill_rect(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
|
||||
if (m_driver && m_driver->draw_pixel)
|
||||
{
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
m_driver->draw_pixel(x, y, rgb);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
register int _width = m_width;
|
||||
register int _height = m_height;
|
||||
int x, y;
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
unsigned short* phy_fb;
|
||||
unsigned int rgb_16 = GL_RGB_32_to_16(rgb);
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
phy_fb = &((unsigned short*)m_phy_fb)[y * _width + x0];
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if ((x < _width) && (y < _height))
|
||||
{
|
||||
*phy_fb++ = rgb_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int* phy_fb;
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
phy_fb = &((unsigned int*)m_phy_fb)[y * _width + x0];
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
if ((x < _width) && (y < _height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual int flush_screen(int left, int top, int right, int bottom, void* fb, int fb_width)
|
||||
{
|
||||
if ((0 == m_phy_fb) || (0 == fb))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
register int _width = m_width;
|
||||
register int _height = m_height;
|
||||
|
||||
left = (left >= _width) ? (_width - 1) : left;
|
||||
right = (right >= _width) ? (_width - 1) : right;
|
||||
top = (top >= _height) ? (_height - 1) : top;
|
||||
bottom = (bottom >= _height) ? (_height - 1) : bottom;
|
||||
|
||||
for (int y = top; y < bottom; y++)
|
||||
{
|
||||
void* s_addr = (char*)fb + ((y * fb_width + left) * m_color_bytes);
|
||||
void* d_addr = (char*)m_phy_fb + ((y * _width + left) * m_color_bytes);
|
||||
memcpy(d_addr, s_addr, (right - left) * m_color_bytes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16/32 bits for default
|
||||
void* m_phy_fb; //physical framebuffer for default
|
||||
struct DISPLAY_DRIVER* m_driver; //Rendering by external method without default physical framebuffer
|
||||
|
||||
int m_phy_read_index;
|
||||
int m_phy_write_index;
|
||||
c_surface* m_surface_group[SURFACE_CNT_MAX];
|
||||
int m_surface_cnt; //surface count
|
||||
int m_surface_index;
|
||||
|
||||
};
|
||||
|
||||
class c_layer
|
||||
@ -105,14 +204,11 @@ public:
|
||||
class c_surface {
|
||||
friend class c_display; friend class c_bitmap_operator;
|
||||
public:
|
||||
c_surface(unsigned int width, unsigned int height, unsigned int color_bytes, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : m_width(width), m_height(height), m_color_bytes(color_bytes), m_fb(0), m_is_active(false), m_top_zorder(Z_ORDER_LEVEL_0), m_phy_fb(0), m_phy_write_index(0), m_display(0)
|
||||
c_surface(unsigned int width, unsigned int height, unsigned int color_bytes, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : m_width(width), m_height(height), m_color_bytes(color_bytes), m_fb(0), m_is_active(false), m_top_zorder(Z_ORDER_LEVEL_0), m_phy_write_index(0), m_display(0)
|
||||
{
|
||||
(overlpa_rect == c_rect()) ? set_surface(max_zorder, c_rect(0, 0, width - 1, height - 1)) : set_surface(max_zorder, overlpa_rect);
|
||||
}
|
||||
|
||||
int get_width() { return m_width; }
|
||||
int get_height() { return m_height; }
|
||||
|
||||
unsigned int get_pixel(int x, int y, unsigned int z_order)
|
||||
{
|
||||
if (x >= m_width || y >= m_height || x < 0 || y < 0 || z_order >= Z_ORDER_LEVEL_MAX)
|
||||
@ -122,15 +218,15 @@ public:
|
||||
}
|
||||
if (m_layers[z_order].fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)(m_layers[z_order].fb))[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)(m_layers[z_order].fb))[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)(m_layers[z_order].fb))[y * m_width + x]) : ((unsigned int*)(m_layers[z_order].fb))[y * m_width + x];
|
||||
}
|
||||
else if (m_fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)m_fb)[y * m_width + x]) : ((unsigned int*)m_fb)[y * m_width + x];
|
||||
}
|
||||
else if (m_phy_fb)
|
||||
else if (m_display->m_phy_fb)
|
||||
{
|
||||
return (m_color_bytes == 4) ? ((unsigned int*)m_phy_fb)[y * m_width + x] : GL_RGB_16_to_32(((unsigned short*)m_phy_fb)[y * m_width + x]);
|
||||
return (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)m_display->m_phy_fb)[y * m_width + x]) : ((unsigned int*)m_display->m_phy_fb)[y * m_width + x];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -149,7 +245,7 @@ public:
|
||||
|
||||
if (z_order == m_max_zorder)
|
||||
{
|
||||
return draw_pixel_on_fb(x, y, rgb);
|
||||
return draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
|
||||
if (z_order > (unsigned int)m_top_zorder)
|
||||
@ -160,19 +256,19 @@ public:
|
||||
if (m_layers[z_order].rect.pt_in_rect(x, y))
|
||||
{
|
||||
c_rect layer_rect = m_layers[z_order].rect;
|
||||
if (m_color_bytes == 4)
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned int*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = rgb;
|
||||
((unsigned short*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = GL_RGB_32_to_16(rgb);
|
||||
((unsigned int*)(m_layers[z_order].fb))[(x - layer_rect.m_left) + (y - layer_rect.m_top) * layer_rect.width()] = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
if (z_order == m_top_zorder)
|
||||
{
|
||||
return draw_pixel_on_fb(x, y, rgb);
|
||||
return draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
|
||||
bool be_overlapped = false;
|
||||
@ -187,7 +283,7 @@ public:
|
||||
|
||||
if (!be_overlapped)
|
||||
{
|
||||
draw_pixel_on_fb(x, y, rgb);
|
||||
draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,7 +296,7 @@ public:
|
||||
|
||||
if (z_order == m_max_zorder)
|
||||
{
|
||||
return fill_rect_on_fb(x0, y0, x1, y1, rgb);
|
||||
return fill_rect_low_level(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
|
||||
if (z_order == m_top_zorder)
|
||||
@ -214,18 +310,18 @@ public:
|
||||
{
|
||||
if (layer_rect.pt_in_rect(x, y))
|
||||
{
|
||||
if (m_color_bytes == 4)
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned int*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb;
|
||||
((unsigned short*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb_16;
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb_16;
|
||||
((unsigned int*)m_layers[z_order].fb)[(y - layer_rect.m_top) * layer_rect.width() + (x - layer_rect.m_left)] = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return fill_rect_on_fb(x0, y0, x1, y1, rgb);
|
||||
return fill_rect_low_level(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
|
||||
for (; y0 <= y1; y0++)
|
||||
@ -308,31 +404,18 @@ public:
|
||||
|
||||
int flush_screen(int left, int top, int right, int bottom)
|
||||
{
|
||||
if (!m_is_active)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (left < 0 || left >= m_width || right < 0 || right >= m_width ||
|
||||
top < 0 || top >= m_height || bottom < 0 || bottom >= m_height)
|
||||
{
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
if (!m_is_active || (0 == m_phy_fb) || (0 == m_fb))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int display_width = m_display->get_width();
|
||||
int display_height = m_display->get_height();
|
||||
|
||||
left = (left >= display_width) ? (display_width - 1) : left;
|
||||
right = (right >= display_width) ? (display_width - 1) : right;
|
||||
top = (top >= display_height) ? (display_height - 1) : top;
|
||||
bottom = (bottom >= display_height) ? (display_height - 1) : bottom;
|
||||
|
||||
for (int y = top; y < bottom; y++)
|
||||
{
|
||||
void* s_addr = (char*)m_fb + ((y * m_width + left) * m_color_bytes);
|
||||
void* d_addr = (char*)m_phy_fb + ((y * display_width + left) * m_color_bytes);
|
||||
memcpy(d_addr, s_addr, (right - left) * m_color_bytes);
|
||||
}
|
||||
m_display->flush_screen(left, top, right, bottom, m_fb, m_width);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
return 0;
|
||||
}
|
||||
@ -354,94 +437,65 @@ public:
|
||||
{
|
||||
for (int x = rect.m_left; x <= rect.m_right; x++)
|
||||
{
|
||||
unsigned int rgb = (m_color_bytes == 4) ? ((unsigned int*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width] : GL_RGB_16_to_32(((unsigned short*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width]);
|
||||
draw_pixel_on_fb(x, y, rgb);
|
||||
unsigned int rgb = (m_color_bytes == 2) ? GL_RGB_16_to_32(((unsigned short*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width]) : ((unsigned int*)fb)[(x - layer_rect.m_left) + (y - layer_rect.m_top) * width];
|
||||
draw_pixel_low_level(x, y, rgb);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
void set_active(bool flag) { m_is_active = flag; }
|
||||
protected:
|
||||
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
int display_width = m_display->get_width();
|
||||
int display_height = m_display->get_height();
|
||||
virtual void fill_rect_low_level(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{//fill rect on framebuffer of surface
|
||||
int x, y;
|
||||
if (m_color_bytes == 2)
|
||||
{
|
||||
unsigned short* fb;
|
||||
unsigned int rgb_16 = GL_RGB_32_to_16(rgb);
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = m_fb ? &((unsigned short*)m_fb)[y * m_width + x0] : 0;
|
||||
if (!fb) { break; }
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int* fb;
|
||||
for (y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = m_fb ? &((unsigned int*)m_fb)[y * m_width + x0] : 0;
|
||||
if (!fb) { break; }
|
||||
for (x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
int x;
|
||||
unsigned int* fb, * phy_fb;
|
||||
for (; y0 <= y1; y0++)
|
||||
{
|
||||
x = x0;
|
||||
fb = m_fb ? &((unsigned int*)m_fb)[y0 * m_width + x] : 0;
|
||||
phy_fb = &((unsigned int*)m_phy_fb)[y0 * display_width + x];
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
for (; x <= x1; x++)
|
||||
{
|
||||
if (fb)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
if (m_is_active && (x < display_width) && (y0 < display_height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
int x;
|
||||
unsigned short* fb, * phy_fb;
|
||||
rgb = GL_RGB_32_to_16(rgb);
|
||||
for (; y0 <= y1; y0++)
|
||||
{
|
||||
x = x0;
|
||||
fb = m_fb ? &((unsigned short*)m_fb)[y0 * m_width + x] : 0;
|
||||
phy_fb = &((unsigned short*)m_phy_fb)[y0 * display_width + x];
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
for (; x <= x1; x++)
|
||||
{
|
||||
if (fb)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
if (m_is_active && (x < display_width) && (y0 < display_height))
|
||||
{
|
||||
*phy_fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_is_active) { return; }
|
||||
m_display->fill_rect(x0, y0, x1, y1, rgb);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
}
|
||||
|
||||
virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb)
|
||||
virtual void draw_pixel_low_level(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if (m_fb)
|
||||
{
|
||||
(m_color_bytes == 4) ? ((unsigned int*)m_fb)[y * m_width + x] = rgb : ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
|
||||
if (m_is_active && (x < m_display->get_width()) && (y < m_display->get_height()))
|
||||
{
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
((unsigned int*)m_phy_fb)[y * (m_display->get_width()) + x] = rgb;
|
||||
}
|
||||
else
|
||||
{
|
||||
((unsigned short*)m_phy_fb)[y * (m_display->get_width()) + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
{//draw pixel on framebuffer of surface
|
||||
(m_color_bytes == 2) ? ((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb): ((unsigned int*)m_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
if (!m_is_active) { return; }
|
||||
m_display->draw_pixel(x, y, rgb);
|
||||
*m_phy_write_index = *m_phy_write_index + 1;
|
||||
}
|
||||
|
||||
void attach_display(c_display* display)
|
||||
{
|
||||
ASSERT(display);
|
||||
m_display = display;
|
||||
m_phy_fb = display->m_phy_fb;
|
||||
m_phy_write_index = &display->m_phy_write_index;
|
||||
}
|
||||
|
||||
@ -462,93 +516,24 @@ protected:
|
||||
|
||||
int m_width; //in pixels
|
||||
int m_height; //in pixels
|
||||
int m_color_bytes; //16 bits, 32 bits only
|
||||
int m_color_bytes; //16 bits, 32 bits for default
|
||||
void* m_fb; //frame buffer you could see
|
||||
c_layer m_layers[Z_ORDER_LEVEL_MAX];//all graphic layers
|
||||
bool m_is_active; //active flag
|
||||
Z_ORDER_LEVEL m_max_zorder; //the highest graphic layer the surface will have
|
||||
Z_ORDER_LEVEL m_top_zorder; //the current highest graphic layer the surface have
|
||||
void* m_phy_fb; //physical framebufer
|
||||
int* m_phy_write_index;
|
||||
c_display* m_display;
|
||||
};
|
||||
|
||||
class c_surface_no_fb : public c_surface {//No physical framebuffer, render with external graphic interface
|
||||
friend class c_display;
|
||||
public:
|
||||
c_surface_no_fb(unsigned int width, unsigned int height, unsigned int color_bytes, struct EXTERNAL_GFX_OP* gfx_op, Z_ORDER_LEVEL max_zorder = Z_ORDER_LEVEL_0, c_rect overlpa_rect = c_rect()) : c_surface(width, height, color_bytes, max_zorder, overlpa_rect), m_gfx_op(gfx_op) {}
|
||||
protected:
|
||||
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb)
|
||||
{
|
||||
if (!m_gfx_op)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_gfx_op->fill_rect)
|
||||
{
|
||||
return m_gfx_op->fill_rect(x0, y0, x1, y1, rgb);
|
||||
}
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface, DISPLAY_DRIVER* driver) : m_phy_fb(phy_fb), m_width(display_width), m_height(display_height), m_driver(driver), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0)
|
||||
{
|
||||
m_color_bytes = surface->m_color_bytes;
|
||||
surface->m_is_active = true;
|
||||
(m_surface_group[0] = surface)->attach_display(this);
|
||||
}
|
||||
|
||||
if (m_gfx_op->draw_pixel && m_is_active)
|
||||
{
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
m_gfx_op->draw_pixel(x, y, rgb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_fb) { return; }
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
unsigned int* fb;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = &((unsigned int*)m_fb)[y0 * m_width + x0];
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
unsigned short* fb;
|
||||
rgb = GL_RGB_32_to_16(rgb);
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
fb = &((unsigned short*)m_fb)[y0 * m_width + x0];
|
||||
for (int x = x0; x <= x1; x++)
|
||||
{
|
||||
*fb++ = rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void draw_pixel_on_fb(int x, int y, unsigned int rgb)
|
||||
{
|
||||
if (m_gfx_op && m_gfx_op->draw_pixel && m_is_active)
|
||||
{
|
||||
m_gfx_op->draw_pixel(x, y, rgb);
|
||||
}
|
||||
|
||||
if (!m_fb) { return; }
|
||||
if (m_color_bytes == 4)
|
||||
{
|
||||
((unsigned int*)m_fb)[y * m_width + x] = rgb;
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
((unsigned short*)m_fb)[y * m_width + x] = GL_RGB_32_to_16(rgb);
|
||||
}
|
||||
}
|
||||
struct EXTERNAL_GFX_OP* m_gfx_op;//Rendering by external method
|
||||
};
|
||||
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, EXTERNAL_GFX_OP* gfx_op) : m_width(display_width), m_height(display_height), m_color_bytes(color_bytes), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(surface_cnt), m_surface_index(0)
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, int surface_width, int surface_height, unsigned int color_bytes, int surface_cnt, DISPLAY_DRIVER* driver) : m_phy_fb(phy_fb), m_width(display_width), m_height(display_height), m_color_bytes(color_bytes), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(surface_cnt), m_driver(driver), m_surface_index(0)
|
||||
{
|
||||
ASSERT(color_bytes == 2 || color_bytes == 4);
|
||||
ASSERT(m_surface_cnt <= SURFACE_CNT_MAX);
|
||||
@ -556,18 +541,11 @@ inline c_display::c_display(void* phy_fb, int display_width, int display_height,
|
||||
|
||||
for (int i = 0; i < m_surface_cnt; i++)
|
||||
{
|
||||
m_surface_group[i] = (phy_fb) ? new c_surface(surface_width, surface_height, color_bytes) : new c_surface_no_fb(surface_width, surface_height, color_bytes, gfx_op);
|
||||
m_surface_group[i] = new c_surface(surface_width, surface_height, color_bytes);
|
||||
m_surface_group[i]->attach_display(this);
|
||||
}
|
||||
}
|
||||
|
||||
inline c_display::c_display(void* phy_fb, int display_width, int display_height, c_surface* surface) : m_width(display_width), m_height(display_height), m_phy_fb(phy_fb), m_phy_read_index(0), m_phy_write_index(0), m_surface_cnt(1), m_surface_index(0)
|
||||
{
|
||||
m_color_bytes = surface->m_color_bytes;
|
||||
surface->m_is_active = true;
|
||||
(m_surface_group[0] = surface)->attach_display(this);
|
||||
}
|
||||
|
||||
inline c_surface* c_display::alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect layer_rect)
|
||||
{
|
||||
ASSERT(max_zorder < Z_ORDER_LEVEL_MAX && m_surface_index < m_surface_cnt);
|
||||
@ -577,8 +555,8 @@ inline c_surface* c_display::alloc_surface(Z_ORDER_LEVEL max_zorder, c_rect laye
|
||||
|
||||
inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1, int y0, int y1, int offset)
|
||||
{
|
||||
int surface_width = s0->get_width();
|
||||
int surface_height = s0->get_height();
|
||||
register int surface_width = s0->m_width;
|
||||
register int surface_height = s0->m_height;
|
||||
|
||||
if (offset < 0 || offset > surface_width || y0 < 0 || y0 >= surface_height ||
|
||||
y1 < 0 || y1 >= surface_height || x0 < 0 || x0 >= surface_width || x1 < 0 || x1 >= surface_width)
|
||||
@ -604,35 +582,18 @@ inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
char* addr_s = ((char*)(s0->m_fb) + (y * (s0->get_width()) + x0 + offset) * m_color_bytes);
|
||||
char* addr_s = ((char*)(s0->m_fb) + (y * surface_width + x0 + offset) * m_color_bytes);
|
||||
char* addr_d = ((char*)(m_phy_fb)+(y * m_width + x0) * m_color_bytes);
|
||||
memcpy(addr_d, addr_s, (width - offset) * m_color_bytes);
|
||||
//Right surface
|
||||
addr_s = ((char*)(s1->m_fb) + (y * (s1->get_width()) + x0) * m_color_bytes);
|
||||
addr_s = ((char*)(s1->m_fb) + (y * surface_width + x0) * m_color_bytes);
|
||||
addr_d = ((char*)(m_phy_fb)+(y * m_width + x0 + (width - offset)) * m_color_bytes);
|
||||
memcpy(addr_d, addr_s, offset * m_color_bytes);
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 4)
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
for (int x = x0; x <= (x1 - offset); x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s0->m_fb)[y * m_width + x + offset]);
|
||||
}
|
||||
//Right surface
|
||||
for (int x = x1 - offset; x <= x1; x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s1->m_fb)[y * m_width + x + offset - x1 + x0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_color_bytes == 2)
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = ((c_surface_no_fb*)s0)->m_gfx_op->draw_pixel;
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = m_driver->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
@ -647,6 +608,23 @@ inline int c_display::swipe_surface(c_surface* s0, c_surface* s1, int x0, int x1
|
||||
}
|
||||
}
|
||||
}
|
||||
else //m_color_bytes == 3/4...
|
||||
{
|
||||
void(*draw_pixel)(int x, int y, unsigned int rgb) = m_driver->draw_pixel;
|
||||
for (int y = y0; y <= y1; y++)
|
||||
{
|
||||
//Left surface
|
||||
for (int x = x0; x <= (x1 - offset); x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s0->m_fb)[y * m_width + x + offset]);
|
||||
}
|
||||
//Right surface
|
||||
for (int x = x1 - offset; x <= x1; x++)
|
||||
{
|
||||
draw_pixel(x, y, ((unsigned int*)s1->m_fb)[y * m_width + x + offset - x1 + x0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_phy_write_index++;
|
||||
return 0;
|
@ -1,8 +0,0 @@
|
||||
#include "../core_include/image.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
c_bitmap_operator the_bitmap_op = c_bitmap_operator();
|
||||
c_image_operator* c_image::image_operator = &the_bitmap_op;
|
||||
|
||||
#endif
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/display.h"
|
||||
|
||||
#define DEFAULT_MASK_COLOR 0xFF080408
|
||||
class c_surface;
|
@ -1,9 +0,0 @@
|
||||
#include "../core_include/theme.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
const void* c_theme::s_font_map[FONT_MAX];
|
||||
const void* c_theme::s_image_map[IMAGE_MAX];
|
||||
unsigned int c_theme::s_color_map[COLOR_MAX];
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
|
||||
//Rebuild gui library once you change this file
|
||||
enum FONT_LIST
|
@ -1 +0,0 @@
|
||||
#include "../core_include/wnd.h"
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/display.h"
|
||||
|
||||
class c_wnd;
|
||||
class c_surface;
|
@ -1,8 +0,0 @@
|
||||
#include "../core_include/word.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
c_lattice_font_op the_lattice_font_op = c_lattice_font_op();
|
||||
c_font_operator* c_word::fontOperator = &the_lattice_font_op;
|
||||
|
||||
#endif
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/display.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/button.h"
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/theme.h"
|
||||
|
||||
class c_button : public c_wnd
|
||||
{
|
@ -1,7 +0,0 @@
|
||||
#include "../widgets_include/dialog.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
DIALOG_ARRAY c_dialog::ms_the_dialogs[SURFACE_CNT_MAX];
|
||||
|
||||
#endif
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/theme.h"
|
||||
|
||||
class c_surface;
|
||||
class c_dialog;
|
@ -1,7 +0,0 @@
|
||||
#include "../widgets_include/edit.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
|
||||
c_keyboard c_edit::s_keyboard;
|
||||
|
||||
#endif
|
@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../widgets_include/button.h"
|
||||
#include "../widgets_include/label.h"
|
||||
#include "../widgets_include/keyboard.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../widgets/button.h"
|
||||
#include "../widgets/label.h"
|
||||
#include "../widgets/keyboard.h"
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_EDIT_STRLEN 32
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../widgets_include/button.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../widgets/button.h"
|
||||
#include <string.h>
|
||||
|
||||
//Changing key width/height will change the width/height of keyboard
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/label.h"
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../core/word.h"
|
||||
|
||||
class c_label : public c_wnd
|
||||
{
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/list_box.h"
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../widgets_include/button.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../widgets/button.h"
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_ITEM_NUM 4
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/slide_group.h"
|
@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../widgets_include/dialog.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../widgets/dialog.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAX_PAGES 5
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/spinbox.h"
|
@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../widgets_include/button.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../widgets/button.h"
|
||||
|
||||
#define ID_BT_ARROW_UP 0x1111
|
||||
#define ID_BT_ARROW_DOWN 0x2222
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/table.h"
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/theme.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/theme.h"
|
||||
#include "../core/wnd.h"
|
||||
|
||||
#define MAX_COL_NUM 30
|
||||
#define MAX_ROW_NUM 30
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/wave_buffer.h"
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core/api.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -1 +0,0 @@
|
||||
#include "../widgets_include/wave_ctrl.h"
|
@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "../core_include/api.h"
|
||||
#include "../core_include/wnd.h"
|
||||
#include "../core_include/display.h"
|
||||
#include "../core_include/resource.h"
|
||||
#include "../core_include/word.h"
|
||||
#include "../widgets_include/wave_buffer.h"
|
||||
#include "../core/api.h"
|
||||
#include "../core/wnd.h"
|
||||
#include "../core/display.h"
|
||||
#include "../core/resource.h"
|
||||
#include "../core/word.h"
|
||||
#include "../widgets/wave_buffer.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -1,6 +1,18 @@
|
||||
#include "../widgets_include/keyboard.h"
|
||||
#include "../widgets/button.h"
|
||||
#include "../widgets/dialog.h"
|
||||
#include "../widgets/keyboard.h"
|
||||
#include "../widgets/label.h"
|
||||
#include "../widgets/list_box.h"
|
||||
#include "../widgets/slide_group.h"
|
||||
#include "../widgets/spinbox.h"
|
||||
#include "../widgets/table.h"
|
||||
#include "../widgets/wave_buffer.h"
|
||||
#include "../widgets/wave_ctrl.h"
|
||||
#include "../widgets/edit.h"
|
||||
|
||||
#ifdef GUILITE_ON
|
||||
DIALOG_ARRAY c_dialog::ms_the_dialogs[SURFACE_CNT_MAX];
|
||||
c_keyboard c_edit::s_keyboard;
|
||||
|
||||
static c_keyboard_button s_key_0, s_key_1, s_key_2, s_key_3, s_key_4, s_key_5, s_key_6, s_key_7, s_key_8, s_key_9;
|
||||
static c_keyboard_button s_key_A, s_key_B, s_key_C, s_key_D, s_key_E, s_key_F, s_key_G, s_key_H, s_key_I, s_key_J;
|
||||
@ -40,12 +52,12 @@ WND_TREE g_key_board_children[] =
|
||||
{&s_key_B, 'B', 0, ((KEY_WIDTH / 2) + POS_X(5)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_N, 'N', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_M, 'M', 0, ((KEY_WIDTH / 2) + POS_X(7)), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_del, 0x7F, 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(2), DEL_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_del,0x7F, 0, ((KEY_WIDTH / 2) + POS_X(8)), POS_Y(2), DEL_WIDTH, KEY_HEIGHT},
|
||||
//Row 4
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), ESC_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), ESC_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_num_switch, 0x90, 0, POS_X(2), POS_Y(3), SWITCH_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_space, ' ', 0, ((KEY_WIDTH / 2) + POS_X(3)), POS_Y(3), SPACE_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(3), DOT_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, ((KEY_WIDTH / 2) + POS_X(6)), POS_Y(3), DOT_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_enter, '\n', 0, POS_X(8), POS_Y(3), ENTER_WIDTH, KEY_HEIGHT},
|
||||
{0,0,0,0,0,0,0}
|
||||
};
|
||||
@ -63,13 +75,14 @@ WND_TREE g_number_board_children[] =
|
||||
{&s_key_7, '7', 0, POS_X(0), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_8, '8', 0, POS_X(1), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_9, '9', 0, POS_X(2), POS_Y(2), KEY_WIDTH, KEY_HEIGHT},
|
||||
|
||||
{&s_key_esc, 0x1B, 0, POS_X(0), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
|
||||
{&s_key_esc,0x1B, 0, POS_X(0), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_0, '0', 0, POS_X(1), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot, '.', 0, POS_X(2), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
{&s_key_dot,'.', 0, POS_X(2), POS_Y(3), KEY_WIDTH, KEY_HEIGHT},
|
||||
|
||||
{&s_key_del, 0x7F, 0, POS_X(3), POS_Y(0), KEY_WIDTH, KEY_HEIGHT * 2 + 2},
|
||||
{&s_key_enter,'\n', 0, POS_X(3), POS_Y(2), KEY_WIDTH, KEY_HEIGHT * 2 + 2},
|
||||
{0,0,0,0,0,0,0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user