WinDom: Usefull macro functions

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# Usefull macro functions
[WinDom constants and macros]

## Defines
#define | mt_AppAESversion(ap) ((ap)->aes_global[0])
| AES number version.
#define | mt_AppAESnumapps(ap) ((ap)->aes_global[1])
| Number of concurrent applications.
#define | mt_AppAESapid(ap) ((ap)->aes_global[2])
| Application identifier.
#define | mt_AppId(ap) ((ap)->aes_global[2])
| shorter name for mt_AppAESapid()
#define | mt_AppAESappglobal(ap) (*((long *)&((ap)->aes_global[3])))
| Address of the Global Array application.
#define | mt_AppAESrscfile(ap) ((OBJECT **)(*((long *)&((ap)->aes_global[5]))))
| Pointer to resource loaded by rsrc_load().
#define | mt_AppAESmaxchar(ap) ((ap)->aes_global[13])
| Maximal character size use to print on screen.
#define | mt_AppAESminchar(ap) ((ap)->aes_global[14])
| Minimal character size use to print on screen.
#define | MAX(a, b) ((a)>(b)?(a):(b))
| Returns maximal value of a and b.
#define | MIN(a, b) ((a)<(b)?(a):(b))
| Returns minimal value of a and b.
#define | UNUSED(a) ((void )(a))
| Use this macro on unused parameter avoid warning message from your compiler.
#define | IS_IN(xp, yp, x, y, w, h) (xp>=x && yp>=y && xp<x+w && yp<y+h)
| Return TRUE if (xp,yp) coordinate belongs to area (x,y,w,h).
#define | FORM(app, win) (((W_FORM*)mt_DataSearch( app, win, WD_WFRM))->root)
| Returns FORM structure linked to a window formular.
#define | TOOL(win) ((win)->tool.root)
| Returns TOOL structure linked to a window containing a toolbar.
#define | ADR(c) (int)((long)(c)>>16), (int)(long)(c)
| Convert a 32 bit adress value into a couple of 16 bit values.
#define | SET_BIT(field, bit, val) field = (val)?((field)|(bit)):((field) & ~(bit))
| Set to value `value` the bit `bit` of a bit field `field`.

## Define Documentation

#define ADR | ( | c |  | ) | (int)((long)(c)>>16), (int)(long)(c)

| Convert a 32 bit adress value into a couple of 16 bit values.

#define FORM | ( | app,
|  | win |  | ) | (((W_FORM*)mt_DataSearch( app, win, WD_WFRM))->root)

| Returns FORM structure linked to a window formular.

#define IS_IN | ( | xp,
|  | yp,
|  | x,
|  | y,
|  | w,
|  | h |  | ) | (xp>=x && yp>=y && xp<x+w && yp<y+h)

| Return TRUE if (xp,yp) coordinate belongs to area (x,y,w,h).

#define MAX | ( | a,
|  | b |  | ) | ((a)>(b)?(a):(b))

| Returns maximal value of a and b.

#define MIN | ( | a,
|  | b |  | ) | ((a)<(b)?(a):(b))

| Returns minimal value of a and b.

#define mt_AppAESapid | ( | ap |  | ) | ((ap)->aes_global[2])

| Application identifier.

#define mt_AppAESappglobal | ( | ap |  | ) | (*((long *)&((ap)->aes_global[3])))

| Address of the Global Array application.

#define mt_AppAESmaxchar | ( | ap |  | ) | ((ap)->aes_global[13])

| Maximal character size use to print on screen.

#define mt_AppAESminchar | ( | ap |  | ) | ((ap)->aes_global[14])

| Minimal character size use to print on screen.

#define mt_AppAESnumapps | ( | ap |  | ) | ((ap)->aes_global[1])

| Number of concurrent applications.

#define mt_AppAESrscfile | ( | ap |  | ) | ((OBJECT **)(*((long *)&((ap)->aes_global[5]))))

| Pointer to resource loaded by rsrc_load().

#define mt_AppAESversion | ( | ap |  | ) | ((ap)->aes_global[0])

| AES number version.

#define mt_AppId | ( | ap |  | ) | ((ap)->aes_global[2])

| shorter name for mt_AppAESapid()

#define SET_BIT | ( | field,
|  | bit,
|  | val |  | ) | field = (val)?((field)|(bit)):((field) & ~(bit))

| Set to value `value` the bit `bit` of a bit field `field`.

#define TOOL | ( | win |  | ) | ((win)->tool.root)

| Returns TOOL structure linked to a window containing a toolbar.

#define UNUSED | ( | a |  | ) | ((void )(a))

| Use this macro on unused parameter avoid warning message from your compiler.