common.h File Reference
Go to the source code of this file.
Data Structures
Defines
- #define _VERSION_CODE(major, minor, micro) (((major)<<16) | ((minor)<<8) | (micro))
- A macro that returns the version code from major, minor and micro version number.
- #define _MINIGUI_VERSION_CODE ((MINIGUI_MAJOR_VERSION << 16) | (MINIGUI_MINOR_VERSION << 8) | MINIGUI_MICRO_VERSION)
- Version code of MiniGUI.
- #define MGUI_LIL_ENDIAN 1234
- Little endianness.
- #define MGUI_BIG_ENDIAN 4321
- Big endianness.
- #define MGUI_BYTEORDER MGUI_LIL_ENDIAN
- The byte order (endianness) of the target system.
- #define FALSE 0
- FALSE value, defined as 0 by MiniGUI.
- #define TRUE 1
- TRUE value, defined as 1 by MiniGUI.
- #define NULL ((void *)0)
- A value indicates null pointer.
- #define LOBYTE(w) ((BYTE)(w))
- Returns the low byte of the word w.
- #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
- Returns the high byte of the word w.
- #define MAKEWORD(low, high) ((WORD)(((BYTE)(low)) | (((WORD)((BYTE)(high))) << 8)))
- Makes a word from low byte and high byte.
- #define LOWORD(l) ((WORD)(DWORD)(l))
- Returns the low word of the double word l.
- #define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
- Returns the high word of the double word l.
- #define LOSWORD(l) ((SWORD)(DWORD)(l))
- Returns the low signed word of the double word l.
- #define HISWORD(l) ((SWORD)((((DWORD)(l)) >> 16) & 0xFFFF))
- Returns the high signed word of the double word l.
- #define MAKELONG(low, high) ((DWORD)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
- Makes a double word from low word and high word.
- #define GetRValue(rgba) ((BYTE)(rgba))
- Gets the red component from a RGBA triple value rgba.
- #define GetGValue(rgba) ((BYTE)(((DWORD)(rgba)) >> 8))
- Gets the green component from a RGBA triple value rgba.
- #define GetBValue(rgba) ((BYTE)((DWORD)(rgba) >> 16))
- Gets the blue component from a RGBA triple value rgba.
- #define GetAValue(rgba) ((BYTE)((DWORD)(rgba) >> 24))
- Gets the alpha component from a RGBA triple value rgba.
- #define MakeRGBA(r, g, b, a)
- Makes a RGBA triple value from red r, green g, blue b and alpha components.
- #define MakeRGB(r, g, b)
- Makes a RGB triple value from red r, green g, and blue b components.
- #define MGUI_NR_KEYS 255
- Number of MiniGUI keys.
- #define NR_KEYS 128
- The number of keys defined by Linux operating system.
- #define SCANCODE_USER (NR_KEYS + 1)
- The first key scan code different from OS defined ones.
- #define KS_REPEATED 0x00000800
- This status indicate that the key down message is an auto-repeated one.
- #define KS_CAPTURED 0x00000400
- This status indicate that the mouse is captured by a window when the mouse message posted.
- #define KS_IMEPOST 0x00000200
- This status indicate that the key message is posted by the IME window.
- #define KS_CAPSLOCK 0x00000100
- This status indicate that the CapsLock key was locked when the key or mouse message posted to the window.
- #define KS_NUMLOCK 0x00000080
- This status indicate that the NumLock key was locked when the key or mouse message posted to the window.
- #define KS_SCROLLLOCK 0x00000040
- This status indicate that the ScrollLock key was locked when the key or mouse message posted to the window.
- #define KS_LEFTCTRL 0x00000020
- This status indicate that the left-Ctrl key was pressed when the key or mouse message posted to the window.
- #define KS_RIGHTCTRL 0x00000010
- This status indicate that the right-Ctrl key was pressed when the key or mouse message posted to the window.
- #define KS_CTRL 0x00000030
- This status indicate that either the left-Ctrl key or the right-Ctrl key was pressed when the key or mouse message posted to the window.
- #define KS_LEFTALT 0x00000008
- This status indicate that left-Alt key was pressed when the key or mouse message posted to the window.
- #define KS_RIGHTALT 0x00000004
- This status indicate that right-Alt key was pressed when the key or mouse message posted to the window.
- #define KS_ALT 0x0000000C
- This status indicate that either the left-Alt key or the right-Alt key was pressed when the key or mouse message posted to the window.
- #define KS_LEFTSHIFT 0x00000002
- This status indicate that left-Shift key was pressed when the key or mouse message posted to the window.
- #define KS_RIGHTSHIFT 0x00000001
- This status indicate that right-Shift key was pressed when the key or mouse message posted to the window.
- #define KS_SHIFT 0x00000003
- This status indicate that either the left-Shift key or the right-Shift key was pressed when the key or mouse message posted to the window.
- #define MASK_KS_SHIFTKEYS 0x00000FFF
- The mask of key status.
- #define KS_LEFTBUTTON 0x00001000
- This status indicate that left button was pressed when the key or mouse message posted to the window.
- #define KS_RIGHTBUTTON 0x00002000
- This status indicate that right button was pressed when the key or mouse message posted to the window.
- #define KS_MIDDLBUTTON 0x00004000
- This status indicate that middle button was pressed when the key or mouse message posted to the window.
- #define MASK_KS_BUTTONS 0x0000F000
- The mask of mouse button status.
- #define ERR_OK 0
- Return value error ok.
- #define ERR_INV_HWND -1
- Return value invalid window handle error.
- #define ERR_QUEUE_FULL -2
- Return value queue is full error.
- #define ERR_INVALID_HANDLE -3
- Return value invalid handle error.
- #define ERR_INVALID_HMENU -4
- Return value invalid menu handle error.
- #define ERR_INVALID_POS -5
- Return value invalid postion error.
- #define ERR_INVALID_ID -6
- Return value invalid id error.
- #define ERR_RES_ALLOCATION -7
- Return value allocation resource error .
- #define ERR_CTRLCLASS_INVNAME -8
- Return value invalid name of control class error.
- #define ERR_CTRLCLASS_INVLEN -9
- Return value control class invalid length.
- #define ERR_CTRLCLASS_MEM -10
- Return value control class memory error.
- #define ERR_CTRLCLASS_INUSE -11
- Return value inuse control class error.
- #define ERR_ALREADY_EXIST -12
- Return value already exit error.
- #define ERR_NO_MATCH -13
- Return no match error.
- #define ERR_BAD_OWNER -14
- Return bad owner error.
- #define ERR_IME_TOOMUCHIMEWND -15
- Return value too much IME window error.
- #define ERR_IME_NOSUCHIMEWND -16
- Return value no such IME wondow error.
- #define ERR_IME_NOIMEWND -17
- Return value no IME wondow error.
- #define ERR_CONFIG_FILE -18
- Return value configure file error.
- #define ERR_FILE_IO -19
- Return value file I/O error.
- #define ERR_GFX_ENGINE -20
- Return value GFX engine error.
- #define ERR_INPUT_ENGINE -21
- Return value input engine error.
- #define ERR_NO_ENGINE -22
- Return value no engine error.
- #define ERR_INVALID_ARGS -23
- Return value invalid arguments.
- #define TABLESIZE(table) (sizeof(table)/sizeof(table[0]))
- A macro returns the number of elements in a table.
- #define MAX(x, y) (((x) > (y))?(x):(y))
- A macro returns the maximum of x and y.
- #define MIN(x, y) (((x) < (y))?(x):(y))
- A macro returns the minimum of x and y.
- #define ABS(x) (((x)<0) ? -(x) : (x))
- A macro returns the absolute value of x.
- #define MAX_PATH PATH_MAX
- The possible maximal length of a path name.
- #define MAX_NAME NAME_MAX
- The possible maximal length of a file name.
Typedefs
- typedef unsigned char Uint8
- A type definition for an 8-bit unsigned character.
- typedef signed char Sint8
- A type definition for an 8-bit signed character.
- typedef unsigned short Uint16
- A type definition for a 16-bit unsigned integer.
- typedef signed short Sint16
- A type definition for a 16-bit signed integer.
- typedef unsigned int Uint32
- A type definition for a 32-bit unsigned integer.
- typedef signed int Sint32
- A type definition for a 32-bit signed integer.
- typedef unsigned long long Uint64
- A type definition for a 64-bit unsigned integer.
- typedef signed long long Sint64
- A type definition for a 64-bit signed integer.
- typedef int BOOL
- A type definition for boolean value.
- typedef unsigned int GHANDLE
- General handle.
- typedef unsigned int HWND
- Handle to main window or control.
- typedef unsigned int HDC
- Handle to device context.
- typedef unsigned int HPALETTE
- Handle to a logical palette.
- typedef unsigned int HCURSOR
- Handle to cursor.
- typedef unsigned int HICON
- Handle to icon.
- typedef unsigned int HMENU
- Handle to menu.
- typedef unsigned int HACCEL
- Handle to accelarator.
- typedef unsigned int HDLG
- Handle to dialog box, same as HWND.
- typedef unsigned int HHOOK
- Handle to keyboard or mouse event hook.
- typedef unsigned char BYTE
- A type definition for unsigned character (byte).
- typedef signed char SBYTE
- A type definition for signed character.
- typedef unsigned short WORD
- A type definition for unsigned short integer (word).
- typedef signed short SWORD
- A type definition for signed short integer.
- typedef unsigned long DWORD
- A type definition for unsigned long integer (double word).
- typedef signed long SDWORD
- A type definition for signed long integer.
- typedef unsigned int UINT
- A type definition for unsigned integer.
- typedef long LONG
- A type definition for long integer.
- typedef unsigned int WPARAM
- A type definition for the first message paramter.
- typedef unsigned long LPARAM
- A type definition for the second message paramter.
- typedef DWORD RGBCOLOR
- A type definition for a RGB color.
- typedef struct _RECT RECT
- typedef RECT * PRECT
- Data type of the pointer to a RECT.
- typedef struct _POINT POINT
- typedef POINT * PPOINT
- Data type of the pointer to a POINT.
- typedef struct _SIZE SIZE
- typedef SIZE * PSIZE
- Data type of the pointer to a SIZE.
- typedef struct _RGB RGB
- typedef RGB * PRGB
- Data type of the pointer to a RGB.
- typedef Sint8 gal_sint8
- Data type of 8-bit signed integer.
- typedef Uint8 gal_uint8
- Data type of 8-bit unsigned integer.
- typedef Sint16 gal_sint16
- Data type of 16-bit signed integer.
- typedef Uint16 gal_uint16
- Data type of 16-bit unsigned integer.
- typedef Sint32 gal_sint32
- Data type of 32-bit signed integer.
- typedef Uint32 gal_uint32
- Data type of 32-bit unsigned integer.
- typedef signed int gal_sint
- Data type of signed integer.
- typedef unsigned int gal_uint
- Data type of unsigned integer.
- typedef Uint32 gal_pixel
- Data type of pixel value.
- typedef Uint32 gal_attr
- Data type of attribute value.
- typedef long fixed
- Data type of fixed point.
- typedef struct _GAL_Color GAL_Color
- typedef struct _GAL_Palette GAL_Palette
- typedef struct _GAL_Rect GAL_Rect
Detailed Description
- Author:
- Wei Yongming <ymwei@minigui.org>
- Date:
- 2002/01/06
This file includes macro definitions and typedefs that commonly used by MiniGUI.
Copyright (C) 2002-2009 Feynman Software.
Copyright (C) 1998-2002 Wei Yongming.
All rights reserved by Feynman Software.
This file is part of MiniGUI, a compact cross-platform Graphics
User Interface (GUI) support system for real-time embedded systems.
Definition in file common.h.