📄 gpc.h
字号:
///////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 SHANGHAI EPSON Corp.
// All Rights Reserved
//
// File name :gpc.h
// Function :
// This is a GPC33 header file
// Revision history
// Ver 0.10 2001/01/11 Stella Yuan Start
// Ver 1.90 2001/06/01 CYu customize to plus version
//
///////////////////////////////////////////////////////////////////////////////////
#ifndef _GPC_H_
#define _GPC_H_
#include <cDevice.h>
///////////////////////////////////////////////////////////////
// Define Declare Section
///////////////////////////////////////////////////////////////
// GPC Library Version */
#define GPC_VERSION (0x19) // ver 1.1
// Define 16 Color Table
#define GPC_BLACK 0x00
#define GPC_RED 0x80
#define GPC_GREEN 0x10
#define GPC_YELLOW 0x90
#define GPC_BLUE 0x01
#define GPC_MAGENTA 0xa2
#define GPC_CYAN 0x12
#define GPC_LIGHTGRAY 0xb6
#define GPC_DARKGRAY 0x91
#define GPC_LIGHTRED 0xf0
#define GPC_LIGHTGREEN 0x1c
#define GPC_LIGHTYELLOW 0xfc
#define GPC_LIGHTBLUE 0x03
#define GPC_LIGHTMAGENTA 0xe3
#define GPC_LIGHTCYAN 0x1f
#define GPC_WHITE 0xff
// Line styles
#define GPC_SOLID_LINE 0xffff
#define GPC_DASH_LINE 0xf0f0
#define GPC_DOT_LINE 0xaaaa
#define GPC_DASHDOT_LINE 0xe4e4
// Line widths
#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
// 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
#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
U16 gpcCheckFontByte(U8 *text);
#endif
// graphic context is considered as a virtual device property.
// hardware information are invisible to this context.
typedef struct _gpcGCValues {
S16 GCScreenWidth; // width of screen
S16 GCScreenHeight; // height of screen
U16 GCColorIndex; // current color
RGB GCColorRGB;
U16 GCBkColorIndex; // BackGround Color for gpcDrawText
RGB GCBkColorRGB;
U8 GCLineWidth; // current line width
U16 GCLineStyle; // current line style
U8 *GCFont1; // point of font 1Byte
S8 GCFont1Width; // current 1byte width
S8 GCFont1Height; // current 1byte height
U8 *GCFont2; // point of font 2Byte
S8 GCFont2Width; // current 2byte width
S8 GCFont2Height; // current 2byte height
U8 *GCTableEntry; // 2Byte Font Table Entry.
S8 GCTableSize; // 2Byte Font Table Entry Size.
} gpcGCValues;
///////////////////////////////////////////////////////////////
// Function Declare Section
///////////////////////////////////////////////////////////////
U16 gpcInitGc( void );
U16 gpcSetColor( RGB rgb );
U16 gpcGetColor( RGB *rgb );
U16 gpcSetBkColor( RGB rgb );
U16 gpcGetBkColor( RGB *rgb );
U16 gpcSetLineWidth( U8 width );
U16 gpcGetLineWidth( U8 *width );
U16 gpcSetLineStyle( U16 style );
U16 gpcGetLineStyle( U16 *style );
U16 gpcSetFont( U8 *font1, U8 *font2 );
U16 gpcGetFont( U8 *font1, U8 *font2 );
U32 gpcFont2StartPoint( U8 *text );
U16 gpcGetVersion( void );
U16 gpcDrawPoint( S16 x, S16 y );
U16 gpcDrawLine( S16 x1, S16 y1, S16 x2, S16 y2 );
U16 gpcDrawRect( S16 left, S16 top, S16 right, S16 bottom );
U16 gpcFillRect( S16 left, S16 top, S16 right, S16 bottom );
U16 gpcInvertRect( S16 left, S16 top, S16 right, S16 bottom );
U16 gpcDrawEllipse( S16 left, S16 top, S16 right, S16 bottom );
U16 gpcFillEllipse( S16 left, S16 top, S16 right, S16 bottom );
U16 gpcDrawCircle( S16 x0, S16 y0, S16 r );
U16 gpcFillCircle( S16 x0, S16 y0, S16 r );
U16 gpcDrawArc( S16 x0, S16 y0, S16 r, S16 angle1, S16 angle2 );
U16 gpcDrawText( S16 x, S16 y, U8 *text, S16 length );
U16 gpcGetImage( S16 x, S16 y, S16 width, S16 height, U16 *buf );
U16 gpcPutImage( S16 x, S16 y, S16 width, S16 height, U16 *buf, U8 op );
#endif // _GPC_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -