📄 mwtypes.h
字号:
MWUCHAR lfSmallCaps; /* =1 for small caps */
MWUCHAR lfPitch; /* font pitch (width) */
char lfFaceName[MWLF_FACESIZE]; /* font name, may be aliased*/
} MWLOGFONT, *PMWLOGFONT;
/*
* Macros to initialize the MWLOGFONT structure to the most common defaults
* needed by application programs and the nano-X server program.
*/
#define MWLF_Clear(lf) \
do { \
(lf)->lfHeight = 0; \
(lf)->lfWidth = 0; \
(lf)->lfEscapement = 0; \
(lf)->lfOrientation = 0; \
(lf)->lfWeight = MWLF_WEIGHT_REGULAR; \
(lf)->lfPitch = 0; \
(lf)->lfItalic = 0; \
(lf)->lfOblique = 0; \
(lf)->lfRoman = 0; \
(lf)->lfSerif = 0; \
(lf)->lfSansSerif = 0; \
(lf)->lfModern = 0; \
(lf)->lfMonospace = 0; \
(lf)->lfProportional = 0; \
(lf)->lfSmallCaps = 0; \
(lf)->lfUnderline = 0; \
(lf)->lfStrikeOut = 0; \
(lf)->lfCharSet = 0; \
(lf)->lfOutPrecision = 0; \
(lf)->lfClipPrecision = 0; \
(lf)->lfQuality = 0; \
(lf)->lfFaceName[0] = '\0'; \
} while (0)
#define MWLF_SetBold(lf) \
do { \
(lf)->lfWeight = MWLF_WEIGHT_BOLD; \
} while (0)
#define MWLF_SetRegular(lf) \
do { \
(lf)->lfWeight = MWLF_WEIGHT_REGULAR; \
} while (0)
#define MWLF_SetItalics(lf) \
do { \
(lf)->lfItalic = 1; \
(lf)->lfOblique = 0; \
(lf)->lfRoman = 0; \
} while (0)
#define MWLF_SetRoman(lf) \
do { \
(lf)->lfItalic = 0; \
(lf)->lfOblique = 0; \
(lf)->lfRoman = 1; \
} while (0)
/*
* Rectangle and point structures.
* These structures are "inherited" in wingdi.h for
* the Win32 RECT and POINT structures, so they must match
* Microsoft's definition.
*/
/* MWPOINT used in GdPoly, GdFillPoly*/
typedef struct {
MWCOORD x;
MWCOORD y;
} MWPOINT;
/* MWRECT used in region routines*/
typedef struct {
MWCOORD left;
MWCOORD top;
MWCOORD right;
MWCOORD bottom;
} MWRECT;
/* dynamically allocated multi-rectangle clipping region*/
typedef struct {
int size; /* malloc'd # of rectangles*/
int numRects; /* # rectangles in use*/
int type; /* region type*/
MWRECT *rects; /* rectangle array*/
MWRECT extents; /* bounding box of region*/
} MWCLIPREGION;
/* region types */
#define MWREGION_ERROR 0
#define MWREGION_NULL 1
#define MWREGION_SIMPLE 2
#define MWREGION_COMPLEX 3
/* GdRectInRegion return codes*/
#define MWRECT_OUT 0 /* rectangle not in region*/
#define MWRECT_ALLIN 1 /* rectangle all in region*/
#define MWRECT_PARTIN 2 /* rectangle partly in region*/
/* GdAllocPolyRegion types*/
#define MWPOLY_EVENODD 1
#define MWPOLY_WINDING 2
/* In-core color palette structure*/
typedef struct {
MWUCHAR r;
MWUCHAR g;
MWUCHAR b;
} MWPALENTRY;
/* In-core mono and color image structure*/
#define MWIMAGE_UPSIDEDOWN 01 /* compression flag: upside down image*/
#define MWIMAGE_BGR 00 /* compression flag: BGR byte order*/
#define MWIMAGE_RGB 02 /* compression flag: RGB not BGR bytes*/
typedef struct {
int width; /* image width in pixels*/
int height; /* image height in pixels*/
int planes; /* # image planes*/
int bpp; /* bits per pixel (1, 4 or 8)*/
int pitch; /* bytes per line*/
int bytesperpixel; /* bytes per pixel*/
int compression; /* compression algorithm*/
int palsize; /* palette size*/
long transcolor; /* transparent color or -1 if none*/
MWPALENTRY * palette; /* palette*/
MWUCHAR * imagebits; /* image bits (dword right aligned)*/
} MWIMAGEHDR, *PMWIMAGEHDR;
/* image information structure - returned by GdGetImageInfo*/
typedef struct {
int id; /* image id*/
int width; /* image width in pixels*/
int height; /* image height in pixels*/
int planes; /* # image planes*/
int bpp; /* bits per pixel (1, 4 or 8)*/
int pitch; /* bytes per line*/
int bytesperpixel; /* bytes per pixel*/
int compression; /* compression algorithm*/
int palsize; /* palette size*/
MWPALENTRY palette[256]; /* palette*/
} MWIMAGEINFO, *PMWIMAGEINFO;
#define MWMAX_CURSOR_SIZE 16 /* maximum cursor x and y size*/
/* In-core software cursor structure*/
typedef struct {
int width; /* cursor width in pixels*/
int height; /* cursor height in pixels*/
MWCOORD hotx; /* relative x pos of hot spot*/
MWCOORD hoty; /* relative y pos of hot spot*/
MWCOLORVAL fgcolor; /* foreground color*/
MWCOLORVAL bgcolor; /* background color*/
MWIMAGEBITS image[MWMAX_CURSOR_SIZE];/* cursor image bits*/
MWIMAGEBITS mask[MWMAX_CURSOR_SIZE];/* cursor mask bits*/
} MWCURSOR, *PMWCURSOR;
typedef struct _mwfont * PMWFONT;
/* outline and filled arc and pie types*/
#define MWARC 0x0001 /* arc*/
#define MWOUTLINE 0x0002
#define MWARCOUTLINE 0x0003 /* arc + outline*/
#define MWPIE 0x0004 /* pie (filled)*/
#define MWELLIPSE 0x0008 /* ellipse outline*/
#define MWELLIPSEFILL 0x0010 /* ellipse filled*/
#ifdef MWINCLUDECOLORS
/*
* Common colors - note any color including these may not be
* available on palettized systems, and the system will
* then use the nearest color already in the system palette,
* or allocate a new color entry.
* These colors are the first 16 entries in the std palette,
* and are written to the system palette if writable.
*/
#define BLACK MWRGB( 0 , 0 , 0 )
#define BLUE MWRGB( 0 , 0 , 128 )
#define GREEN MWRGB( 0 , 128, 0 )
#define CYAN MWRGB( 0 , 128, 128 )
#define RED MWRGB( 128, 0 , 0 )
#define MAGENTA MWRGB( 128, 0 , 128 )
#define BROWN MWRGB( 128, 64 , 0 )
#define LTGRAY MWRGB( 192, 192, 192 )
#define GRAY MWRGB( 128, 128, 128 )
#define LTBLUE MWRGB( 0 , 0 , 255 )
#define LTGREEN MWRGB( 0 , 255, 0 )
#define LTCYAN MWRGB( 0 , 255, 255 )
#define LTRED MWRGB( 255, 0 , 0 )
#define LTMAGENTA MWRGB( 255, 0 , 255 )
#define YELLOW MWRGB( 255, 255, 0 )
#define WHITE MWRGB( 255, 255, 255 )
/* other common colors*/
#define DKGRAY MWRGB( 32, 32, 32)
#endif /* MWINCLUDECOLORS*/
/* Keyboard values*/
typedef unsigned short MWKEY;
typedef unsigned char MWSCANCODE;
#define MWKEY_UNKNOWN 0
/* Following special control keysyms are mapped to ASCII*/
#define MWKEY_BACKSPACE 8
#define MWKEY_TAB 9
#define MWKEY_ENTER 13
#define MWKEY_ESCAPE 27
/* Keysyms from 32-126 are mapped to ASCII*/
#define MWKEY_NONASCII_MASK 0xFF00
/* Following keysyms are mapped to private use portion of Unicode-16*/
/* arrows + home/end pad*/
#define MWKEY_FIRST 0xF800
#define MWKEY_LEFT 0xF800
#define MWKEY_RIGHT 0xF801
#define MWKEY_UP 0xF802
#define MWKEY_DOWN 0xF803
#define MWKEY_INSERT 0xF804
#define MWKEY_DELETE 0xF805
#define MWKEY_HOME 0xF806
#define MWKEY_END 0xF807
#define MWKEY_PAGEUP 0xF808
#define MWKEY_PAGEDOWN 0xF809
/* Numeric keypad*/
#define MWKEY_KP0 0xF80A
#define MWKEY_KP1 0xF80B
#define MWKEY_KP2 0xF80C
#define MWKEY_KP3 0xF80D
#define MWKEY_KP4 0xF80E
#define MWKEY_KP5 0xF80F
#define MWKEY_KP6 0xF810
#define MWKEY_KP7 0xF811
#define MWKEY_KP8 0xF812
#define MWKEY_KP9 0xF813
#define MWKEY_KP_PERIOD 0xF814
#define MWKEY_KP_DIVIDE 0xF815
#define MWKEY_KP_MULTIPLY 0xF816
#define MWKEY_KP_MINUS 0xF817
#define MWKEY_KP_PLUS 0xF818
#define MWKEY_KP_ENTER 0xF819
#define MWKEY_KP_EQUALS 0xF81A
/* Function keys */
#define MWKEY_F1 0xF81B
#define MWKEY_F2 0xF81C
#define MWKEY_F3 0xF81D
#define MWKEY_F4 0xF81E
#define MWKEY_F5 0xF81F
#define MWKEY_F6 0xF820
#define MWKEY_F7 0xF821
#define MWKEY_F8 0xF822
#define MWKEY_F9 0xF823
#define MWKEY_F10 0xF824
#define MWKEY_F11 0xF825
#define MWKEY_F12 0xF827
/* Key state modifier keys*/
#define MWKEY_NUMLOCK 0xF828
#define MWKEY_CAPSLOCK 0xF829
#define MWKEY_SCROLLOCK 0xF82A
#define MWKEY_LSHIFT 0xF82B
#define MWKEY_RSHIFT 0xF82C
#define MWKEY_LCTRL 0xF82D
#define MWKEY_RCTRL 0xF82E
#define MWKEY_LALT 0xF82F
#define MWKEY_RALT 0xF830
#define MWKEY_LMETA 0xF831
#define MWKEY_RMETA 0xF832
#define MWKEY_ALTGR 0xF833
/* Misc function keys*/
#define MWKEY_PRINT 0xF834
#define MWKEY_SYSREQ 0xF835
#define MWKEY_PAUSE 0xF836
#define MWKEY_BREAK 0xF837
#define MWKEY_QUIT 0xF838 /* virtual key*/
#define MWKEY_MENU 0xF839 /* virtual key*/
#define MWKEY_REDRAW 0xF83A /* virtual key*/
/* Handheld function keys*/
#define MWKEY_RECORD 0xF840
#define MWKEY_PLAY 0xF841
#define MWKEY_CONTRAST 0xF842
#define MWKEY_BRIGHTNESS 0xF843
#define MWKEY_SELECTUP 0xF844
#define MWKEY_SELECTDOWN 0xF845
#define MWKEY_ACCEPT 0xF846
#define MWKEY_CANCEL 0xF847
#define MWKEY_APP1 0xF848
#define MWKEY_APP2 0xF849
#define MWKEY_LAST 0xF849
/* Keyboard state modifiers*/
#define MWKMOD_NONE 0x0000
#define MWKMOD_LSHIFT 0x0001
#define MWKMOD_RSHIFT 0x0002
#define MWKMOD_LCTRL 0x0040
#define MWKMOD_RCTRL 0x0080
#define MWKMOD_LALT 0x0100
#define MWKMOD_RALT 0x0200
#define MWKMOD_LMETA 0x0400 /* Windows key*/
#define MWKMOD_RMETA 0x0800 /* Windows key*/
#define MWKMOD_NUM 0x1000
#define MWKMOD_CAPS 0x2000
#define MWKMOD_ALTGR 0x4000
#define MWKMOD_SCR 0x8000
#define MWKMOD_CTRL (MWKMOD_LCTRL|MWKMOD_RCTRL)
#define MWKMOD_SHIFT (MWKMOD_LSHIFT|MWKMOD_RSHIFT)
#define MWKMOD_ALT (MWKMOD_LALT|MWKMOD_RALT)
#define MWKMOD_META (MWKMOD_LMETA|MWKMOD_RMETA)
#define MWKINFO_LED_MASK (1 << 0)
#define MWKINFO_LED_MODE_MASK (1 << 1)
/* Keyboard info values */
#define MWKINFO_LED_CAP (1 << 0)
#define MWKINFO_LED_NUM (1 << 1)
#define MWKINFO_LED_SCR (1 << 2)
#define MWKINFO_LED_MODE_ON (1 << 3)
#define MWKINFO_LED_MODE_OFF (1 << 4)
typedef struct {
int led;
int led_mode;
} MWKBINFO, *PMWKBINFO;
#endif /* _MWTYPES_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -