⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpc.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifndef _GPC_H_
#define _GPC_H_

#include <asixdef.h>
// longn_qi 2001/11/27 added
#include <sys\cdevice.h>		// in that header, phyiscal screen size
								// and pixel size are defined.

///////////////////////////////////////////////////////////////
//  Define Declare Section 
///////////////////////////////////////////////////////////////
// GPC Library Version */
#define GPC_VERSION         (0x13)  // ver 1.3

// longn_qi 2001/11/27 revised
#define PHY_LCD_W     LCD_WIDTH			// 物理屏幕宽度
#define PHY_LCD_H     LCD_HEIGHT		// 物理屏幕高度

// 预定义 RGB 色
#ifndef GPC_COLOR_TABLE
#define GPC_COLOR_TABLE

#define GPC_BLACK        	0x000000
#define GPC_RED          	0x800000
#define GPC_GREEN        	0x008000
#define GPC_YELLOW       	0x808000
#define GPC_BLUE         	0x000080
#define GPC_MAGENTA      	0x800080
#define GPC_CYAN         	0x008080
#define GPC_LIGHTGREY    	0x808080

#define GPC_DARKGREY     	0x303030
#define GPC_LIGHTRED     	0xff0000
#define GPC_LIGHTGREEN   	0x00ff00
#define GPC_LIGHTYELLOW  	0xffff00
#define GPC_LIGHTBLUE    	0x0000ff
#define GPC_LIGHTMAGENTA 	0xff00ff
#define GPC_LIGHTCYAN    	0x00ffff
#define GPC_WHITE        	0xffffff

#define GPC_ALICEBLUE	 	0xF0F8FF
#define GPC_ANTIQUEWHITE	0xFAEBD7
#define GPC_BURLYWOOD		0xDEB887
#define GPC_CADETBLUE		0x5F9EA0
#define GPC_CORNFLOWERBLUE	0x6495ED
#define GPC_CORNSILK		0xFFF8DC
#define GPC_CORAL			0xFF7F50
#define GPC_CRIMSON			0xDC143C
#define GPC_DARKBLUE		0x00008B
#define GPC_DARKCYAN		0x008B8B
#define GPC_DARKKHAKI		0xBDB76B
#define GPC_DARKMAGENTA		0x8B008B
#define GPC_DARKORANGE		0xFF8C00
#define GPC_DARKORCHID		0x9932CC
#define GPC_DARKRED			0x8B0000
#define GPC_DARKSALMON		0xE9967A
#define GPC_DARKSLATEBLUE	0x483D8B
#define GPC_DARKSEAGREAN	0x8FBC8F
#define GPC_DODGERBLUE		0x1E90FF
#define GPC_FIREBRICK		0xB22222
#define GPC_FLORALWHITE		0xFFFAF0
#define GPC_GAINSBORO		0xDCDCDC
#define GPC_GREENYELLOW		0xADFF2F
#define GPC_HOTPINK			0xFF69B4
#define GPC_INDIANRED		0xCD5C5C
#define GPC_INDIGO			0x4B0082
#define GPC_KHAKI			0xF0E68C
#define GPC_LAVENDER		0xE6E6FA
#define GPC_LEMONCHIFFON	0xFFFACD
#define GPC_LIGHTCORAL		0xF08080
#define GPC_LIGHTPINK		0xFFB6C1
#define GPC_LIGHTSTEELBLUE	0xB0C4DE
#define GPC_MAROON			0x800000
#define GPC_MEDIUMORCHID	0xBA55D3
#define GPC_OLIVEDRAB		0x6B8E23
#define GPC_ORANGE			0xFFA500
#define GPC_ORANGERED		0xFF4500
#define GPC_PALEGOLDENROD	0xEEE8AA
#define GPC_PALEVIOLETRED	0xD87093
#define GPC_PLUM			0xDDA0DD
#define GPC_POWDERBLUE		0xB0E0E6
#define GPC_SEAGREEN		0x2E8B57
#define GPC_SLATEBLUE		0x6A5ACD
#define GPC_THISTLE			0xD8BFD8
#define GPC_TEAL			0x008080
#define GPC_VIOLETRED		0xD02090
#define GPC_YELLOWGREEN		0x9ACD32


//#define GPC_BLACK                     0x000000                                                          
//#define GPC_WHITE                     0xffffff     
#define GPC_LIGHT_BEIGE               0xcbf7cd  // _RGB(203, 247, 205)  
#define GPC_MIDNIGHT_BLUE             0x35517e  // _RGB( 53,  81, 126)    
#define GPC_RED                       0xff0000  // _RGB(255,   0,   0)                                                              
#define GPC_CYAN                      0x00ffff  // _RGB(  0, 255, 255)                                                            
#define GPC_GREEN                     0x77b009  // _RGB(119, 176,   9)                                     
#define GPC_DARK_GREEN                0x006d00  // _RGB(  0, 109,   0)                                                                      
#define GPC_GRAY                      0x917c91  // _RGB(145, 124, 145)
#define GPC_EMERALD_GREEN             0xc6f9f1  // _RGB(198, 249, 241)
#define GPC_NAVY_BLUE                 0x08376f  // _RGB(  8,  55, 111)
#define GPC_BLUE                      0x035690  // _RGB(  3,  86, 144)
#define GPC_CERULEAN_BLUE             0x1271f2  // _RGB( 18, 113, 242)
#define GPC_FRENCH_BLUE               0x2274b9  // _RGB( 34, 116, 185)
#define GPC_YELLOW                    0xf9e830  // _RGB(249, 232,  48)
#define GPC_DEEP_BLUE                 0x2b5cac  // _RGB( 43,  92, 172)
#define GPC_DARK_BLUE                 0x0a508b  // _RGB( 10,  80, 139)
#define GPC_LIGHT_YELLOW              0xf7fdb8  // _RGB(247, 253, 184)
#define GPC_MIDNIGHT                  0x1e467a  // _RGB( 30,  70, 122)
#define GPC_SKY_BLUE                  0x97d3f2  // _RGB(151, 211, 242)
#define GPC_LIGHT_BLUE                0xabe3f5  // _RGB(171, 227, 245)
#define GPC_LIGHT_GRAY                0xe9e9e9  // _RGB(233, 233, 233)
#define GPC_MIDDLE_GRAY               0xa9a9a9  // _RGB(169, 169, 169)
#define GPC_MISTY_GRAY                0x767676  // _RGB(118, 118, 118)
#define GPC_SMOKY_GRAY                0xa6a6a6  // _RGB(166, 166, 166)
#define GPC_AQUA_BLUE                 0x3a65cf  // _RGB( 58, 101, 207)
#define GPC_RED_PINK                  0xcf3a6f  // _RGB(207,  58, 111)
#define GPC_BLUE_VIOLET               0x808fe1  // _RGB(128, 143, 225)
#define GPC_LIGHT_BLUE_VIOLET         0xacb8fb  // _RGB(172, 184, 251)
#define GPC_DARK_GRAY                 0x5c5c5c  // _RGB( 92,  92,  92)
#define GPC_VERDITER_BLUE             0x9bc0f4  // _RGB(155, 192, 244)
#define GPC_CORAL                     0xf9bfbf  // _RGB(249, 191, 191)
#define GPC_BRIGHT_BLUE               0x055cbe  // _RGB(  5,  92, 190)
#define GPC_BLUE_MARINE               0x2274b9  // _RGB( 34, 116, 185)
#define GPC_COBALT_BLUE               0xc0d4eb  // _RGB(192, 212, 235)
#define GPC_MANAGANESE_BLUE           0x1e4d7a  // _RGB( 30,  77, 122)
#define GPC_PRUSSIAN_BLUE             0x035690  // _RGB(  3,  86, 144)
#define GPC_DARK_SKY_BLUE             0x0149ab  // _RGB(  1,  73, 171)
#define GPC_LIGHT_CERULEAN_BLUE       0x04a1f2  // _RGB(  4, 161, 242)
#define GPC_BRIGHT_SKY_BLUE           0xa8e8fa  // _RGB(168, 232, 250)
#define GPC_DARK_CERULEAN_BLUE        0x035690  // _RGB(  3,  86, 144)
#define GPC_MIDDLE_BLUE               0x0149ab  // _RGB(  1,  73, 171)
#define GPC_BRIGHT_MARINE_BLUE        0xb9e8fe  // _RGB(185, 232, 254)
#define GPC_BLUE_GREEN                0x2995c6  // _RGB( 41, 149, 198) 
#define GPC_WHITE_PINK                0xfeb9e7  // _RGB(254, 185, 231)
#define GPC_VIOLET_PINK               0xc62991  // _RGB(198,  41, 145)
#define GPC_DARK_VIOLET               0x9629c6  // _RGB(150,  41, 198)
#define GPC_VIOLET                    0xe9b9fe  // _RGB(233, 185, 254)
#define GPC_BRIGHT_YELLOW             0xfbf5c9  // _RGB(251, 245, 201)
#define GPC_RED_GRAY                  0x979696  // _RGB(151, 150, 150)
#define GPC_BROWN_GRAY                0x4c4c4c  // _RGB( 76,  76,  76)
#define GPC_WHITE_BLUE                0x76c2f8  // _RGB(118, 194, 248)
#define GPC_WHITE_BLUE_BLUE           0x65c8fc  // _RGB(101, 200, 252)
#define GPC_SKY_BLUE_BLUE             0xa5dcf8  // _RGB(165, 220, 248)
#define GPC_LIGHT_GRAY_VIOLET         0x779fd2  // _RGB(119, 159, 210)
#define GPC_LIGHT_BLUE_GRAY           0xfff2f8  // _RGB(255, 242, 248)
#define GPC_MISTY_BLUE_GRAY           0x446788  // _RGB( 68, 103, 136)
#define GPC_RED_VIOLET_PINK           0xd2228d  // _RGB(210,  34, 141)
#define GPC_BLUE_MINT                 0x0270ce  // _RGB(  2, 112, 206)
#define GPC_VIOLET_SKY                0x6e7dc5  // _RGB(110, 125, 197)
#define GPC_LIGHT_GREEN               0xccf9fc  // _RGB(204, 249, 252)
#define GPC_BRIGHT_VIOLET             0xd6bcff  // _RGB(214, 188, 255)
#define GPC_MARINE                    0x1e94d2  // _RGB( 30, 148, 210)
#define GPC_LIGHT_LEMON_YELLOW        0xffffda  // _RGB(255, 255, 218)
#define GPC_PURL_BLUE                 0xade1ff  // _RGB(173, 225, 255)
#define GPC_YELLOW_DEEP               0xfcca02  // _RGB(252, 202,   2)
#define GPC_CYAN_BLUE                 0x009bfe  // _RGB(  0, 155, 254)
#define GPC_LILAC_PINK                0xf0cdff  // _RGB(240, 205, 255)
#define GPC_BRIGHT_CYAN_BLUE          0x77eefc  // _RGB(119, 238, 252)
#define GPC_RED_VIOLET                0x9d37d2  // _RGB(157,  55, 210)
#define GPC_BRIGHT_RED_VIOLET         0xdeb1f5  // _RGB(222, 177, 245)
#define GPC_RED_WHITE                 0xfdf9ff  // _RGB(253, 249, 255)
#define GPC_DARK_BLUE_MARINE          0x015195  // _RGB(  1,  81, 149)  
#define GPC_MANGANESE_BLUE            0x2795e1  // _RGB( 39, 149, 225)
#define GPC_WHITE_MANGANESE_BLUE      0xb8e8fe  // _RGB(184, 232, 254)
#define GPC_COBALT_VIOLET_TINT        0xe7b0fe  // _RGB(231, 176, 254)
#define GPC_SAP_BLUE                  0x2595fd  // _RGB( 37, 149, 253)
#define GPC_LEMON_YELLOW              0xfffdd5  // _RGB(255, 253, 213)
#define GPC_VIOLET_PALE               0xb505b7  // _RGB(181,   5, 183)
#define GPC_SAP_GREEN                 0x01a605  // _RGB(  1, 166,   5)
#define GPC_ORANGE                    0xf3a104  // _RGB(243, 161,   4)
#define GPC_DARK_YELLOW               0xae7209  // _RGB(174, 114,   9)
#define GPC_CARMINE                   0xa10e03  // _RGB(161,  14,   3)
#define GPC_WHITE_VIOLET              0xcacdfd  // _RGB(202, 205, 253)
#define GPC_LIGHT_WHITE_GRAY          0xff96bb  // _RGB(255, 150, 187)
#define GPC_MEDI_WHITE_GRAY           0x3ed0fa  // _RGB( 62, 208, 250)
#define GPC_DARK_WHITE_GRAY           0x1c2b2b  // _RGB( 28,  43,  43)



#endif	//GPC_COLOR_TABLE

// 线型
#ifndef GPC_LINE_STYLE
#define GPC_LINE_STYLE

#define GPC_SOLID_LINE   0xffff			// 实线 ——
#define GPC_DASH_LINE    0xf0f0			// 虚线 - - 
#define GPC_DOT_LINE     0xaaaa			// 虚线 ····
#define GPC_DASHDOT_LINE 0xe4e4			// 点划线 -·-·

#endif //GPC_LINE_STYLE

// 线宽 
#define GPC_NORM_WIDTH   1  
#define GPC_THICK_WIDTH  3  

// BitBlt operators for gpcPutImage 
#define GPC_COPY_PUT        COPY_PUT   // MOV 
#define GPC_XOR_PUT         XOR_PUT    // XOR 
#define GPC_OR_PUT          OR_PUT     // OR  
#define GPC_AND_PUT         AND_PUT    // AND 
#define GPC_NOT_PUT         NOT_PUT    // NOT 

// 返回值 
#ifndef GPC_ERROR_CODE
#define GPC_ERROR_CODE

#define GPC_ERR_OK          (0)   // No Error, Call Was Successful. 
#define GPC_ERR_FAILED      (-1)  // General purpose failure.       
#define GPC_ERR_NOMAP       (-2)  // Memory Overflow.
#define GPC_ERR_FONT        (-10) // No FONTX2 Font.
#define GCC_NO_FIELD        (-20) // No Field Control
#define GCC_NO_DATA_FIELD   (-21) // No Data in the Field Control
#define GPC_ERR_NO_SCROLL   (-22) // No Scroll in the Field Control
#define GPC_ERR_MAX_SCROLL  (-23) // ScrollLines > 10(MAX_SCROLL)
#define GPC_NO_FONT_FIELD   (-24) // No FONT1 in the text field

#endif // GPC_ERROR_CODE

// 位操作类型
#ifndef GPC_BIT_OP_STYLE
#define GPC_BIT_OP_STYLE

#define GPC_REPLACE_STYLE		0x1					// 位替换操作
#define GPC_AND_STYLE			0x2					// 位与操作
#define GPC_OR_STYLE			0x3					// 位或操作
#define GPC_XOR_STYLE			0x4					// 位异或操作
#define GPC_COPY_STYLE			0x5					// 位复制操作
#define GPC_NOT_STYLE			0x6					// 位取反操作

// 扩展位操作类型
#ifndef GPC_BIT_OP_EX_STYLE
#define GPC_BIT_OP_EX_STYLE

#define GPC_TRANSPARENT_STYLE	0x7					// 透明效果
#define GPC_PAINT_STYLE			0x8					// 正常效果

#define GPC_MIN_STYLE			GPC_REPLACE_STYLE
#define GPC_MAX_STYLE			GPC_PAINT_STYLE

#endif	//GPC_BIT_OP_EX_STYLE
#endif	//GPC_BIT_OP_STYLE

//-----------------------------------------------------------
// 光标状态
#define ASIX_CURSOR_OFF			1			// 关闭光标
#define ASIX_CURSOR_ON			2			// 开启光标
#define ASIX_CURSOR_REVERSED	3			// 反转光标状态

#define BLINK_MASK				0x0			// 光标闪烁模板
//#define BLINK_MASK			0xffffff	// 光标闪烁模板

// maximun scope of cursor
// cursor的最大为16*16 pixel
// longn_qi 2001/12/20 revised
#define MAX_CURSOR_WIDTH		16			// 最大光标宽度
#define MAX_CURSOR_HEIGHT		16			// 最大光标高度

// 光标闪烁频率范围
#define FREMAX					10000		//??最低频率(1/10000 MHz = 100Hz)
#define FREMIN					10			//??最高频率(1/10 MHz = 100KHz)

// 光标风格
#define CURSOR_THREAD			0			// 垂直细实线
#define CURSOR_REC				1			// 矩形

// 文本对齐模式
#define GPC_ALIGN_CENTER		0			// 居中对齐
#define GPC_ALIGN_LEFT			1			// 左对齐
#define GPC_ALIGN_RIGHT			2			// 右对齐

// 结构标识符
#ifdef BIG_ENDIAN_ORDER
#define GPC_GC_SYMBOL			0x4347		// 图形上下文结构标识符'GC'
#define	GPC_CURSOR_SYMBOL		0x5343		// 光标结构标识符'CS'
#define GPC_BMP_SYMBOL			0x424D		// 位图标识符'BM'
#else
#define GPC_GC_SYMBOL			0x4743		// 图形上下文结构标识符'GC'
#define	GPC_CURSOR_SYMBOL		0x4353		// 光标结构标识符'CS'
#define GPC_BMP_SYMBOL			0x4D42		// 位图标识符'BM'
#endif

/* Now, we use GB font */
#define _GB2312_

#ifndef _GB2312_
// 1999.12.13 By Shin :: Add Font Byte Check
#define gpcCheckFontByte(text)  \
    (((*(text) >= 0x20 && *(text) <= 0x7E) || (*(text) >= 0xA1 && *(text) <= 0xDF)) ? 1 :   \
     ((*(text) >= 0x81 && *(text) <= 0x9F) || (*(text) >= 0xE0 && *(text) <= 0xEA) ||       \
      (*(text) >= 0xED && *(text) <= 0xEE) || (*(text) >= 0xFA && *(text) <= 0xFC)) ? 2 : 0)   
// Modified by Stella 2001/01/11
#else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -