GEMLIB  0.44.0
Macros | Functions

window frame interface More...

Macros

#define wind_calc(a, b, c, d, e, f, g, h, i, j)   mt_wind_calc(a,b,c,d,e,f,g,h,i,j,aes_global)
 
#define wind_close(a)   mt_wind_close(a,aes_global)
 
#define wind_create(a, b, c, d, e)   mt_wind_create(a,b,c,d,e,aes_global)
 
#define wind_delete(a)   mt_wind_delete(a,aes_global)
 
#define wind_draw(a, b)   mt_wind_draw(a,b,aes_global)
 
#define wind_find(a, b)   mt_wind_find(a,b,aes_global)
 
#define wind_get(a, b, c, d, e, f)   mt_wind_get(a,b,c,d,e,f,aes_global)
 
#define wind_new()   mt_wind_new(aes_global)
 
#define wind_open(a, b, c, d, e)   mt_wind_open(a,b,c,d,e,aes_global)
 
#define wind_set(a, b, c, d, e, f)   mt_wind_set(a,b,c,d,e,f,aes_global)
 
#define wind_update(a)   mt_wind_update(a,aes_global)
 
#define wind_calc_grect(a, b, c, d)   mt_wind_calc_grect(a,b,c,d,aes_global)
 
#define wind_create_grect(a, b)   mt_wind_create_grect(a,b,aes_global)
 
#define wind_xcreate_grect(a, b, c)   mt_wind_xcreate_grect(a,b,c,aes_global)
 
#define wind_get_grect(a, b, c)   mt_wind_get_grect(a,b,c,aes_global)
 
#define wind_xget_grect(a, b, c, d)   mt_wind_xget_grect(a,b,c,d,aes_global)
 
#define wind_open_grect(a, b)   mt_wind_open_grect(a,b,aes_global)
 
#define wind_set_grect(a, b, c)   mt_wind_set_grect(a,b,c,aes_global)
 
#define wind_xset_grect(a, b, c, d)   mt_wind_xset_grect(a,b,c,d,aes_global)
 
#define wind_set_str(a, b, c)   mt_wind_set_str(a,b,c,aes_global)
 

Functions

short mt_wind_calc (short Type, short Parts, short InX, short InY, short InW, short InH, short *OutX, short *OutY, short *OutW, short *OutH, short *global_aes)
 
short mt_wind_close (short WindowHandle, short *global_aes)
 
short mt_wind_create (short Parts, short Wx, short Wy, short Ww, short Wh, short *global_aes)
 
short mt_wind_xcreate (short Parts, short Wx, short Wy, short Ww, short Wh, short *OutX, short *OutY, short *OutW, short *OutH, short *global_aes)
 
short mt_wind_delete (short WindowHandle, short *global_aes)
 
short mt_wind_draw (short WindowHandle, short startob, short *global_aes)
 
short mt_wind_find (short X, short Y, short *global_aes)
 
short mt_wind_get (short WindowHandle, short What, short *W1, short *W2, short *W3, short *W4, short *global_aes)
 
short mt_wind_new (short *global_aes)
 
short mt_wind_open (short WindowHandle, short Wx, short Wy, short Ww, short Wh, short *global_aes)
 
short mt_wind_set (short WindowHandle, short What, short W1, short W2, short W3, short W4, short *global_aes)
 
short mt_wind_update (short Code, short *global_aes)
 
short mt_wind_calc_grect (short Type, short Parts, const GRECT *In, GRECT *Out, short *global_aes)
 
short mt_wind_create_grect (short Parts, const GRECT *r, short *global_aes)
 
short mt_wind_xcreate_grect (short Parts, const GRECT *r, GRECT *ret, short *global_aes)
 
short mt_wind_get_grect (short WindowHandle, short What, GRECT *r, short *global_aes)
 
short mt_wind_xget_grect (short WindowHandle, short What, const GRECT *clip, GRECT *r, short *global_aes)
 
short mt_wind_open_grect (short WindowHandle, const GRECT *r, short *global_aes)
 
short mt_wind_set_grect (short WindowHandle, short What, const GRECT *r, short *global_aes)
 
short mt_wind_xset_grect (short WindowHandle, short What, const GRECT *s, GRECT *r, short *global_aes)
 
short mt_wind_set_str (short WindowHandle, short What, const char *str, short *global_aes)
 

Detailed Description

window frame interface

The Window Library is responsible for the displaying and maintenance of AES windows.

Macro Definition Documentation

#define wind_calc (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
 
)    mt_wind_calc(a,b,c,d,e,f,g,h,i,j,aes_global)

single-thread version of mt_wind_calc()

#define wind_calc_grect (   a,
  b,
  c,
 
)    mt_wind_calc_grect(a,b,c,d,aes_global)

single-thread version of mt_wind_calc_grect()

#define wind_close (   a)    mt_wind_close(a,aes_global)

single-thread version of mt_wind_close()

#define wind_create (   a,
  b,
  c,
  d,
 
)    mt_wind_create(a,b,c,d,e,aes_global)

single-thread version of mt_wind_create()

#define wind_create_grect (   a,
 
)    mt_wind_create_grect(a,b,aes_global)

single-thread version of mt_wind_create_grect()

#define wind_delete (   a)    mt_wind_delete(a,aes_global)

single-thread version of mt_wind_delete()

#define wind_draw (   a,
 
)    mt_wind_draw(a,b,aes_global)

single-thread version of mt_wind_draw()

#define wind_find (   a,
 
)    mt_wind_find(a,b,aes_global)

single-thread version of mt_wind_find()

#define wind_get (   a,
  b,
  c,
  d,
  e,
 
)    mt_wind_get(a,b,c,d,e,f,aes_global)

single-thread version of mt_wind_get()

#define wind_get_grect (   a,
  b,
 
)    mt_wind_get_grect(a,b,c,aes_global)

single-thread version of mt_wind_get_grect()

#define wind_new ( )    mt_wind_new(aes_global)

single-thread version of mt_wind_new()

#define wind_open (   a,
  b,
  c,
  d,
 
)    mt_wind_open(a,b,c,d,e,aes_global)

single-thread version of mt_wind_open()

#define wind_open_grect (   a,
 
)    mt_wind_open_grect(a,b,aes_global)

single-thread version of mt_wind_open_grect()

#define wind_set (   a,
  b,
  c,
  d,
  e,
 
)    mt_wind_set(a,b,c,d,e,f,aes_global)

single-thread version of mt_wind_set()

#define wind_set_grect (   a,
  b,
 
)    mt_wind_set_grect(a,b,c,aes_global)

single-thread version of mt_wind_set_grect()

#define wind_set_str (   a,
  b,
 
)    mt_wind_set_str(a,b,c,aes_global)

single-thread version of mt_wind_set_str()

#define wind_update (   a)    mt_wind_update(a,aes_global)

single-thread version of mt_wind_update()

#define wind_xcreate_grect (   a,
  b,
 
)    mt_wind_xcreate_grect(a,b,c,aes_global)

single-thread version of mt_wind_xcreate_grect()

#define wind_xget_grect (   a,
  b,
  c,
 
)    mt_wind_xget_grect(a,b,c,d,aes_global)

single-thread version of mt_wind_xget_grect()

#define wind_xset_grect (   a,
  b,
  c,
 
)    mt_wind_xset_grect(a,b,c,d,aes_global)

single-thread version of mt_wind_xset_grect()

Function Documentation

short mt_wind_calc ( short  Type,
short  Parts,
short  InX,
short  InY,
short  InW,
short  InH,
short *  OutX,
short *  OutY,
short *  OutW,
short *  OutH,
short *  global_aes 
)

returns size information for a specific window.

Parameters
Typespecifies the mode of this call.
Partsis a bit mask of window 'widgets' present with the window. For a detailed listing of these elements see mt_wind_create().
InXX-position of the input area
InYY-position of the input area
InWWidth of the input area
InHHeight of the input area
OutXX-position of the output area
[option CHECK_NULLPTR] OutX may be NULL
OutYY-position of the output area
[option CHECK_NULLPTR] OutY may be NULL
OutWWidth of the output area
[option CHECK_NULLPTR] OutW may be NULL
OutHHeight of the output area
[option CHECK_NULLPTR] OutH may be NULL
global_aesglobal AES array
Returns
0 if an error occurred or non-zero otherwise.
Since
All AES versions.
See also
mt_wind_create()

If Type is WC_BORDER (0), InX, InY, InW, and InH specify the work area of a window of type Parts. The call then fills in the WORDs pointed to by OutX, OutY, OutW, and OutH with the full extent of the window.

If Type is WC_WORK (1), InX, InY, InW, and InH specify the full extent of a window of type Parts. The call fills in the WORDs pointed to by OutX, OutY, OutW, and OutH with the work area of the window.

mt_wind_calc() is unable to calculate correct values when a toolbar is attached to a window. This can be corrected, though, by adjusting the values output by this function with the height of the toolbar.

short mt_wind_calc_grect ( short  Type,
short  Parts,
const GRECT In,
GRECT Out,
short *  global_aes 
)

returns size information for a specific window.

Parameters
Typespecifies the mode of this call.
Partsis a bit mask of window 'widgets' present with the window. For a detailed listing of these elements see mt_wind_create().
Inthe input area
Outthe output area
global_aesglobal AES array

see mt_wind_calc() documentation for more details

short mt_wind_close ( short  WindowHandle,
short *  global_aes 
)

removes a window from the display screen.

Parameters
WindowHandlespecifies the window handle of the window to close.
global_aesglobal AES array
Returns
0 if an error occurred or non-zero otherwise.
Since
All AES versions.
See also
mt_wind_create(), mt_wind_open(), mt_wind_delete()

Upon calling mt_wind_close() a redraw message for the portion of the screen changed will be sent to all applications. Calling mt_wind_close() does not release the memory allocated to the window structure. mt_wind_delete() must be called to permanently destroy the window and free any memory allocated by the AES for the window. Until mt_wind_delete() is called, the window may be re-opened at any time with mt_wind_open().

short mt_wind_create ( short  Parts,
short  Wx,
short  Wy,
short  Ww,
short  Wh,
short *  global_aes 
)

initializes a new window structure and allocates any necessary memory.

Parameters
Partsis a bit array whose elements determine the presence of any 'widgets' on the window as follows:
  • NAME (0x01) Window has a title bar.
  • CLOSER (0x02) Window has a close box.
  • FULLER (0x04) Window has a fuller box.
  • MOVER (0x08) Window may be moved by the user.
  • INFO (0x10) Window has an information line.
  • SIZER (0x20) Window has a sizer box.
  • UPARROW (0x40) Window has an up arrow.
  • DNARROW (0x80) Window has a down arrow.
  • VSLIDE (0x100) Window has a vertical slider.
  • LFARROW (0x200) Window has a left arrow.
  • RTARROW (0x400) Window has a right arrow.
  • HSLIDE (0x800) Window has a horizontal slider.
  • HOTCLOSEBOX (0x1000) Window has "hot close box" box.
  • MENUBAR (0x1000) Window has a menu bar.
  • BACKDROP (0x2000) Window has a backdrop box.
  • SMALLER (0x4000) Window has an iconifier.
  • BORDER (0x8000) Window has border-resize capability (XaAES).
The parameter Parts is created by OR'ing together any desired elements.
WxX-position of the maximum extents of the window.
WyY-position of the maximum extents of the window.
WwWidth of the maximum extents of the window.
WhHeight of the maximum extents of the window.
Normally this is the entire screen area minus the menu bar (to find this area use mt_wind_get() with a parameter of WF_WORKXYWH ). The area may be smaller to bound the window to a particular size and location.
global_aesglobal AES array
Returns
a window handle if successful or a negative number if it was unable to create the window.
Since
All AES versions.
See also
mt_wind_open(), mt_wind_close(), mt_wind_delete()

The SMALLER gadget is only available as of AES version 4.1.

The BORDER gadget is only available in XaAES kernel module versions compiled after November 8, 2004.

A window is not actually displayed on screen with this call, you need to call mt_wind_open() to do that.

The desktop was limited to four windows. The AES actually allowed seven windows. As of MultiTOS the number of open windows is limited only by memory and the capabilities of an application. You should ensure that your application calls a mt_wind_delete() for each mt_wind_create(), otherwise memory may not be deallocated when your application exits.

short mt_wind_create_grect ( short  Parts,
const GRECT r,
short *  global_aes 
)

initializes a new window structure and allocates any necessary memory.

Parameters
Partsis a bit array whose elements determine the presence of any 'widgets' on the window.
rspecify the maximum extents of the window.
global_aesglobal AES array

see mt_wind_create() documentation for more details

short mt_wind_delete ( short  WindowHandle,
short *  global_aes 
)

destroys the specified window and releases any memory allocated for it.

Parameters
WindowHandlespecifies the window handle of the window to destroy.
global_aesglobal AES array
Returns
0 if an error occurred or non-zero otherwise.
Since
All AES versions.
See also
mt_wind_create(), mt_wind_open(), mt_wind_close(), mt_wind_new()

A window should by closed with mt_wind_close() before deleting it.

short mt_wind_draw ( short  whandle,
short  startob,
short *  global_aes 
)

Draws the Non-Client-Area (window widgets) of a window and checks the list of rectangles of the window specified.

Parameters
whandlespecifies the handle of the window to redraw
startobindex of the start object
global_aesglobal AES array
Returns
a 0 if an error occurred or non-zero otherwise.
Since
???
Note
This function is normaly not interesting for applications. The function is used by the screen manager for redrawing the window objects.
short mt_wind_find ( short  X,
short  Y,
short *  global_aes 
)

returns the handle of the window found at the given coordinates.

Parameters
Xspecify the X-coordinate to search for a window at.
Yspecify the Y-coordinate to search for a window at.
global_aesglobal AES array
Returns
the handle of the uppermost window found at location X, Y. If no window is found, the function returns 0 meaning the Desktop window.
Since
All AES versions.

This function is useful for tracking the mouse pointer and changing its shape depending upon what window it falls over.

short mt_wind_get ( short  WindowHandle,
short  What,
short *  W1,
short *  W2,
short *  W3,
short *  W4,
short *  global_aes 
)

returns various information about a window.

Parameters
WindowHandlespecifies the handle of the window to return information about (0 is the desktop window)
Whatspecifies the information to return and the values placed into the WORDs pointed to by W1 to W4.
W11st returned value
[option CHECK_NULLPTR] W1 may be NULL
W22nd returned value
[option CHECK_NULLPTR] W2 may be NULL
W33rd returned value
[option CHECK_NULLPTR] W3 may be NULL
W44th returned value
[option CHECK_NULLPTR] W4 may be NULL
global_aesglobal AES array
Returns
a 0 if an error occurred or non-zero otherwise.
Since
All AES versions.
WF_KIND, WF_NAME and WF_INFO since NAES (release?).
See also
mt_wind_set()
NameValueMeaning
WF_KIND 1

Gets the actual window elements

  • W1 contains the actual window elements with N.AES or MagiC.

WF_NAME 2

Gets the actual title of the window

  • copies the title in the buffer pointed by W1.

If the window has no title, the return value of the function equals 0, the buffer remains unchanged.

Since a title may have a length of 128 chars, the buffer must be large enough!

WF_INFO 3

Gets the actual infoline of the window

  • copies the infoline in the buffer pointed by W1.

If the window has no infoline, the return value of the function equals 0, the buffer remains unchanged.

Since an infoline may have a length of 128 chars, the buffer must be large enough!

WF_WORKXYWH 4

Gets the work area coordinates of the window

  • W1, W2, W3 and W4 are filled in with the x, y, w, and h of the current coordinates of the window's work area.

WF_CURRXYWH 5

Gets the coordinates of the window (external area)

  • W1, W2, W3 and W4 are filled in with the x, y, w, and h of the current coordinates of the full extent of the window.

WF_PREVXYWH 6

Gets the previous coordinates of the window

  • W1, W2, W3 and W4 are filled in with the x, y, w, and h of the previous coordinates of the full extent of the window prior to the last mt_wind_set() call.

WF_FULLXYWH 7

Gets the coordinates of the window when "fulled" the screen

  • W1, W2, W3 and W4 are filled in with the x, y, w, and h values specified in the mt_wind_create() call.

WF_HSLIDE 8

Gets the current position of the horizontal slider

  • W1 is filled in with the current position of the horizontal slider between 0 and 1000. A value of one indicates that the slider is in its leftmost position.

WF_VSLIDE 9

Gets the current position of the vertical slider

  • W1 is filled in with the current position of the vertical slider between 0 and 1000. A value of one indicates that the slider is in its uppermost position.

WF_TOP 10

Gets the handle of the top window

  • W1 is filled in with the window handle of the window currently on top.
  • W2 is filled in with the owners AES id
  • W3 is filled in with the handle of the window directly below it.

W2 and W3 are only filled by the AES since AES version 4.0, and when mt_appl_getinfo() with mode AES_WINDOW indicates the availability of this feature.

WF_FIRSTXYWH 11

Gets the first rectangle in the list of rectangles for this window

  • W1, W2, W3 and W4 are filled in with the x, y, w, and h of the first AES rectangle in the window's rectangle list.

If W3 and W4 are both 0, the window is completely covered.

WF_NEXTXYWH 12

Gets the next rectangle in the list of rectangles for this window

  • W1, W2, W3 and W4 are filled in with subsequent AES rectangles for each time this function is called until W3 and W4 are 0 to signify the end of the list.

WF_NEWDESK 14

Gets the OBJECT tree installed as desktop

  • W1 contains the high WORD of the address and W2 contains the low WORD of the address of the current desktop background OBJECT tree.

Available as of AES versions 4.0, and when mt_appl_getinfo() with mode AES_WINDOW indicates.

WF_HSLSIZE 15

Gets the size of the horizontal slider

  • W1 contains the size of the current slider relative to the size of the scroll bar as a value from 0 to 1000. A value of 1000 indicates that the slider is at its maximum size.

WF_VSLSIZE 16

Gets the size of the vertical slider

  • W1 contains the size of the current slider relative to the size of the scroll bar as a value from 0 to 1000. A value of 1000 indicates that the slider is at its maximum size.

WF_SCREEN 17

Gets current AES menu/alert buffer and its size

  • W1 contains the high WORD of the pointer to the AES buffer
  • W2 contains the low WORD of the pointer to the AES buffer
  • The length of the buffer is returned as a LONG with the upper WORD being in W3 and the lower WORD being in W4.

Note that GEM 1.2 returns 0 in W3 and W4 by mistake.

The menu/alert buffer is used by the AES to save the screen area hidden by menus and alert boxes. It is not recommended that applications use this area as its usage is not guaranteed in future versions of the OS.

WF_COLOR 18

Gets current color of widget

This mode is only valid as of AES version 0x0300. From AES versions 4.0 and above, mt_appl_getinfo() with mode AES_WINDOW should be used to determine if this mode is supported.

WF_DCOLOR 19

This mode gets the default color of newly created windows as with WF_COLOR above.

This mode only works as of AES version 0x0300.

WF_OWNER 20

Gets the owner of the window

  • W1 is filled in with the AES id of the owner of the specified window.
  • W2 is filled in with its open status (0 = closed, 1 = open).
  • W3 is filled in with the handle of the window directly above it (in the window order list)
  • W4 is filled in with the handle of the window below it (likewise, in the window order list)

This mode is only available as of AES version 4.0 (and when indicated by mt_appl_getinfo() with mode AES_WINDOW).

WF_BEVENT 24

Gets window feature on mouse button event

  • W1 is interpreted as bit arrays whose bits indicate supported window features. These bits are:

This mode is only available as of AES version 4.0 (and when indicated by mt_appl_getinfo() with mode AES_WINDOW).

WF_BOTTOM 25

Gets bottom window

  • W1 will be filled in with the handle of the window currently on the bottom of the window list (it may actually be on top if there is only one window). Note also that this does not include the desktop window.

This mode is only available as of AES version 4.0 (and when indicated by mt_appl_getinfo() with mode AES_WINDOW).

WF_ICONIFY 26

Gets iconification of the window

  • W1 will be filled in with 0 if the window is not iconified or non-zero if it is.
  • W2 and W3 contain the width and height of the icon.
  • W4 is unused.

This mode is only available as of AES version 4.1 (and when indicated by mt_appl_getinfo() with mode AES_WINDOW).

WF_UNICONIFY 27

Gets un-iconification of the window

  • W1, W2, W3 and W4, are filled in with the x, y, w, and h of the original coordinates of the iconified window.

This mode is only available as of AES version 4.1 (and when indicated by mt_appl_getinfo() with mode AES_WINDOW).

WF_TOOLBAR 30

Gets tool bar attached to a window

  • W1 and W2 contain the high and low WORD respectively of the pointer to the current toolbar object tree (or NULL if none).

This mode is only available as of AES version 4.1.

WF_FTOOLBAR 31

Gets the first rectangle of the toolbar area

  • W1, W2, W3 and W4, are filled in with the x, y, w, and h, respectively of the first uncovered rectangle of the toolbar region of the window.

If W3 and W4 are 0, the toolbar is completely covered.

This mode is only available as of AES version 4.1.

WF_NTOOLBAR 32

Gets the next rectangle of the toolbar area

  • W1, W2, W3 and W4, are filled in with the x, y, w, and h, respectively of subsequent uncovered rectangles of the toolbar region.

This mode should be repeated to reveal subsequent rectangles until W3 and W4 are found to be 0.

This mode is only available as of AES version 4.1.

WF_WIDGETS 200 Gets the actual positions of the slider widgets (W_UPARROW, W_DNARROW, and so on)
  • W1 and W2 are the vertical elements of type rightwidget (W1 is the top and W2 is the bottom widget of the vertical slider)
  • W3 and W4 are the horizontal elements of type bottomwidgets. (W3 is the left and W4 is the right widget of the horizotal slider).
WF_USER_POINTER 230

Get the user value of the window

  • W1 and W2 are the 2 values already set by user with wind_set()

MyAES feature

WF_WIND_ATTACH 231

Get if a window is attach to the requested window

  • W1 windows id attached values already set by user with wind_set()

MyAES feature

WF_BITMAP 233

Get bitmap content of the window if MyAES "windows_backup" option is set to true, any windows of any application can be read

TODO

MyAES 0.96 feature

Note
aes_intout[3,4] are initialized to 0 before the AES trap. It's usefull under NAES for WF_FIRST/NEXTXYWH since lot of programmers only check for w and h = 0, and not the return value.
Under MyAES if WindowHandle is set to -2 then it is possible to know if option What is avaible or not, if available then return is 1 else return value is 0

References AESPB::addrin, AESPB::addrout, AES_ADDRINMAX, AES_ADDROUTMAX, AES_CTRLMAX, AES_INTINMAX, AES_INTOUTMAX, AESPB::control, AESPB::global, AESPB::intin, AESPB::intout, WF_COLOR, WF_DCOLOR, WF_INFO, and WF_NAME.

short mt_wind_get_grect ( short  WindowHandle,
short  What,
GRECT r,
short *  global_aes 
)

returns various information about a window.

Parameters
WindowHandlespecifies the handle of the window to return information about (0 is the desktop window)
Whatspecifies the information to return and the values placed into r.
r
global_aesglobal AES array

see mt_wind_get() documentation for more details.

short mt_wind_new ( short *  global_aes)

closes and deletes all of the application's windows. In addition, the state of mt_wind_update(), and the mouse pointer hide count is reset.

Parameters
global_aesglobal AES array
Returns
The return value is reserved and currently unused
Since
Available as of AES version 0x0140.
See also
mt_wind_delete(), mt_graf_mouse(), mt_wind_update()

This function should not be relied upon to clean up after an application. It was designed for parent processes that wish to ensure that a poorly written child process has properly cleaned up after itself.

short mt_wind_open ( short  WindowHandle,
short  Wx,
short  Wy,
short  Ww,
short  Wh,
short *  global_aes 
)

opens the window specified.

Parameters
WindowHandlespecifies the handle of the window to open as returned by mt_wind_create()
Wxx-position of the rectangle
Wyy-position of the rectangle
Wwwidth of the rectangle
Whheight of the rectangle into which the rectangle should be displayed.
global_aesglobal AES array
Returns
a 0 if an error occurred or non-zero otherwise.
Since
All AES versions.
See also
mt_wind_close(), mt_wind_create(), mt_wind_delete()

This call will also trigger a WM_REDRAW message which encompasses the work area of the window so applications should not initially render the work area, rather, wait for the message.

short mt_wind_open_grect ( short  WindowHandle,
const GRECT r,
short *  global_aes 
)

opens the window specified.

Parameters
WindowHandlespecifies the handle of the window to open as returned by mt_wind_create()
rthe rectangle into which the rectangle should be displayed.
global_aesglobal AES array

see mt_wind_open() documentation for more details.

short mt_wind_set ( short  WindowHandle,
short  What,
short  W1,
short  W2,
short  W3,
short  W4,
short *  global_aes 
)

sets various window attributes.

Parameters
WindowHandlespecifies the window handle of the window to modify.
Whatspecifies the attribute to change and the meanings of parameters W1 to W4
W1see hereafter
W2see hereafter
W3see hereafter
W4see hereafter
global_aesglobal AES array
Returns
0 if an error occurred or non-zero otherwise.
NameValueMeaning
WF_NAME 2

This mode passes a pointer to a character string containing the new title of the window.

  • W1 contains the high WORD of the pointer
  • W2 contains the low WORD of the pointer

WF_INFO 3

This mode passes a pointer to a character string containing the new information line of the window.

  • W1 contains the high WORD of the pointer
  • W2 contains the low WORD of the pointer

WF_CURRXYWH 5

returns the global dimensions (external area) of the window)

  • W1, W2, W3 and W4 specify the x, y, w, and h of the new coordinates of the full extent of the window.

WF_HSLIDE 8

Sets the position of the horizontal slider

  • W1 specifies the new position of the horizontal slider between 1 and 1000. A value of 1 indicates that the slider is in its leftmost position.

WF_VSLIDE 9

Sets the position of the vertical slider

  • W1 specifies the new position of the vertical slider between 1 and 1000. A value of 1 indicates that the slider is in its uppermost position.

WF_TOP 10

Tops a window

  • parameters W1 to W4 are unused . WindowHandle specifies the window handle of the window to top

Note that if multiple calls of mt_wind_set() with WF_TOP, are made without releasing control to the AES (which allows the window to actually be topped), only the most recent window specified will actually change position.

WF_NEWDESK 14

This mode allows to install or uninstall a desktop tree. This OBJECT tree whill be redrawn automatically by the AES as the background.

  • W1 contains the high WORD of the OBJECT pointer
  • W2 contains the low WORD of the OBJECT pointer.

To reset (uninstall) the desktop background to the default, specify W1 and W2 as 0 (that is OBJECT = NULL).

WF_HSLSIZE 15

Sets the size of the horizontal slider

  • W1 defines the size of the current slider relative to the size of the scroll bar as a value from 1 to 1000. A value of 1000 indicates that the slider is at its maximum size.

WF_VSLSIZE 16

Sets the size of the vertical slider

  • W1 defines the size of the current slider relative to the size of the scroll bar as a value from 1 to 1000. A value of 1000 indicates that the slider is at its maximum size.

WF_COLOR 18

Sets the current color of window widgets

This mode is only valid as of AES version 0x0300.

WF_DCOLOR 19

This mode sets the default color of newly created windows as with WF_COLOR above.

This mode only works as of AES version 0x0300.

As of AES version 4.1, this mode causes all currently displayed windows which have not had their color explicitly set with WF_COLOR to be changed.

WF_BEVENT 24

Sets/unsets window features on mouse button event

  • W1 is a bitmap fields. Its bits are defined as follow:
    • BEVENT_WORK : the window is set to be 'un-toppable' and will never receive WM_TOPPED message when the user clicks on the work area of the window. This mode is only available as of AES versions 4.0.
    • BEVENT_INFO : MagiC 6 only... (meaning ????)

WF_BOTTOM 25

This mode will place the specified window at the bottom of the window list (if there is more than one window) and top the new window on the top of the list. This mode is only available as of AES version 4.0.

WF_ICONIFY 26

This mode iconifies the specified window.

  • W1, W2, W3 and W4 specify the X, Y, width, and height coordinates of the iconified window.

Normally, this happens as the result of receiving a WM_ICONIFY message.

This mode is only available as of AES version 4.1.

WF_UNICONIFY 27

This mode uniconifies the window specified

  • W1, W2, W3 and W4 specify the X, Y, width, and height coordinates of the un-iconified window.

Normally, this happens as the result of receiving a WM_UNICONIFY message.

This mode is only available as of AES version 4.1.

WF_UNICONIFYXYWH 28

This mode sets the coordinates to be transmitted to the window with the next WM_UNICONIFY message that targets it. This call is used when a window is opened in an iconified state to give the OS a method of positioning it when it is uniconified.

  • W1, W2, W3 and W4 specify the X, Y, width, and height coordinates of the un-iconified window.

This mode is only available as of AES version 4.1.

WF_TOOLBAR 30

This mode attaches a toolbar to the specified window.

  • W1 and W2 contain the high and low WORD of the address of the toolbar OBJECT tree respectively.
  • W3 and W4 are unused.

Set W1 and W2 to 0 to remove a toolbar.

This mode is available as of AES 4.10.

WF_WHEEL 40

This mode allows to configure the feature of window on mouse wheel events

  • WindowHandle handle of the window, or -1 to apply the setting to all windows that will be created later by the application.
  • W1 may be one of the following value:

Please note that it's not mandatory to explicitly set the WO0_WHEEL bit of WF_OPTS to enable this mouse wheel feature. A simple mt_wind_set(WF_WHEEL) is enought.

XaAES supports these 3 values of W1. MyAES (xmas 2005 edition) only support WHEEL_MESAG value. So if you want your application to support the mouse wheel with both MyAES and XaAES, you should use WHEEL_MESAG.

mt_appl_getinfo() with parameter AES_WINDOW returns the availability of this mode.

WF_OPTS 41

This mode allows to configure the feature of window on mouse wheel events

  • WindowHandle may be 0 (=> all the windows of the calling application are then concerned)
  • W1 is the mode : 0 = clear, 1 = set option bits
  • W2 is the the first option word bitmask. Bits are defined as follow:
    • WO0_WHEEL (0x0001) : Setting this bit will enable extended mouse wheel support. Then, the reaction of applications on mouse wheel turns may be tuned by calling mt_wind_set() with WF_WHEEL command.
    • WO0_FULLREDRAW (0x0002) : Setting this bit will make AES send WM_REDRAW messages to cover the whole work-area of the window when it is FULLED. Default behaviour is to only send WM_REDRAW messages for the areas that need it, blitting the already visible parts.
    • WO0_NOBLITW (0x0004) : Setting this bit will make AES send WM_REDRAW messages to cover the whole work-area of the window when its WIDTH changes. This is handy for apps like HighWire, Textprocessors ,etc, that need to reformat when window width changes. Default behaviour is to send WM_REDRAW messages for the areas that need it.
    • WO0_NOBLITH (0x0008) : Setting this bit will make AES send WM_REDRAW messages to cover the whole work-area of the window when its HEIGHT changes. Default behaviour is to send WM_REDRAW messages for the areas that need it.
    • WO0_SENDREPOS (0x0010) : Setting this bit will make AES send a WM_REPOSED message when a windows X/WIDTH and/or Y/HEIGHT coordinate pair changes. Such changes happen when the user resizes the window using upper/left borders. Default behaviour is to first send a WM_MOVED followed by a WM_SIZED message under these conditions, because older apps dont evaluate the WIDTH/HEIGHT in WM_MOVED messages.
  • W3 is the 2nd option word bitmask. Should be set to WO1_NONE (bits are not defined yet)
  • W4 is the 3rd option word bitmask. Should be set to WO2_NONE (bits are not defined yet)

mt_appl_getinfo() with parameter AES_WINDOW returns the availability of this mode. mt_appl_getinfo() with parameter AES_WOPTS returns the support of WOx_xxx feature .

WF_WIDGETS 200

Sets the actual positions of the slider widgets (W_UPARROW, W_DNARROW, and so on)

  • W1 and W2 are the vertical elements of type rightwidget (W1 is the top and W2 is the bottom widget of the vertical slider)
  • W3 and W4 are the horizontal elements of type bottomwidgets. (W3 is the left and W4 is the right widget of the horizotal slider).

WF_USER_POINTER 230

Link a user value to the windows

  • W1 and W2 are the 2 value you can transmit it could be used as 32 bits pointer but any value can be provided

MyAES feature

WF_WIND_ATTACH 231

attach a window to another, using it if you close the mother window other windows linked will be closed

  • W1 the window to attach

MyAES feature

WF_TOPMOST 232

Sets the actual window at topmost level (details below).

  • W1 should be set to one of the following values:
    • 0 : remove topmost state.
    • 1 : Set topmost state at global level
    • 2 : Set topmost state at application level
  • W2, W3 and W4 are reseved and should be set to 0.

Topmost windows always 'float' ontop of classical windows. One key feature of windows in any WF_TOPMOST state is that they do not disturb current keyboard focus, and can be used to issue important messages, status raports, etc., without demanding user interaction. As consequence, topmost window never get keyboard focus, and they never get WM_TOPPED or WM_UNTOPPED AES messages

Mode 1 of topmost windows fits well for task bar applications for example (window displayed whatever the active application)

Mode 2 of topmost windows fits well for toolbox windows: the visibility of the window is linked to the application that has the focus. That is, when owner is untopped the toolbox window disappears, when owner regains focus, the window automatically reappears (no action required by the application, opening and closing of the window is performed by the AES).

MyAES feature

WF_OPTIONS 234

Change window behavior

  • W1 only one value available for the moment:
    • 1 : request automatic close when application focus is lost and restore it when is back to add this feature or remove it you should use W2
  • W2 remove/add option:
    • 1 : add option
    • 0 : remove option

MyAES feature

WF_FULLSCREEN 235

Switch fullscreen - normal window mode. The fullscreen mode is without any widget. Hit the key ESC escape from fullscreen mode

MyAES 0.96 feature

Since
All AES versions.
See also
mt_wind_get()
Note
Under MyAES if WindowHandle is set to -2 then it is possible to know if option What is avaible or not, if available then return is 1 else return value is 0
short mt_wind_set_grect ( short  WindowHandle,
short  What,
const GRECT r,
short *  global_aes 
)

sets various window attributes.

Parameters
WindowHandlespecifies the window handle of the window to modify.
Whatspecifies the attribute to change
ra rectangle
global_aesglobal AES array

see mt_wind_set() documentation for more details

the fields x, y, w and h of r are respectively sent in place of the parameters w1, w2, w3 and w4 of mt_wind_set().

short mt_wind_set_str ( short  WindowHandle,
short  What,
const char *  str,
short *  global_aes 
)

sets various window attributes.

Parameters
WindowHandlespecifies the window handle of the window to modify.
Whatspecifies the attribute to change
stra string
global_aesglobal AES array

see mt_wind_set() documentation for more details.

the str pointer (32 bits) is sent in place of the two first parameters w1 (most significant word of str) and w2 (less significant word of str) of mt_wind_set(). Parameters w3 and w4 of mt_wind_set() are undefined.

short mt_wind_update ( short  Code,
short *  global_aes 
)

manages the screen drawing semaphore.

Parameters
Codespecifies an action as follows:
  • END_UPDATE (0) This mode resets the flag set by BEG_UPDATE and should be called as soon as redrawing is complete. This will allow windows to be moved and menus to be dropped down again.
  • BEG_UPDATE (1) Calling this mode will suspend the process until no drop-down menus are showing and no other process is updating the screen. This will then set a flag which guarantees that the screen will not be updated and windows will not be moved until you reset it with END_UPDATE. Generally this call is made whenever a WM_REDRAW message is received to lock the screen semaphore while redrawing.
  • END_MCTRL (2) This mode releases control of the mouse to the AES and resumes mouse click message services.
  • BEG_MCTRL (3) This mode prevents mouse button messages from being sent to applications other than your own. mt_form_do() makes this call to lock out screen functions. Desk accessories which display a dialog outside of a window must use this function to prevent button clicks from falling through to the desktop.
global_aesglobal AES array
Returns
returns 0 if an error occurred or non-zero otherwise.
Since
All AES versions.
See also
mt_wind_new()

As of AES version 4.0, you may logically OR a mask of NO_BLOCK (0x0100) to either BEG_UPDATE or BEG_MCTRL. This mask will prevent the application from blocking if another application currently has control of the screen semaphore. Instead, if another application has control, the function will immediately return with an error value of 0. This method should only be used by timing-sensitive applications such as terminal programs in which a long redraw by another application could cause a timeout.

All mt_wind_update() modes nest. For instance, to release the screen semaphore, the same number of END_UPDATE calls must be received as were BEG_UPDATE calls. It it recommended that you design your application in a manner that avoids nesting these calls. Both the BEG_UPDATE and BEG_MCTRL modes should be used prior to displaying a form or popup to prevent them from being overwritten or clicks to them being sent to other applications. Always wait until after the BEG_UPDATE call to turn off the mouse cursor when updating the screen to be sure you have gained control of the screen. Applications such as slide-show viewers which require the whole screen area (and may need to change screen modes) may call mt_wind_update() with parameters of both BEG_UPDATE and BEG_MCTRL to completely lock out the screen from other applications. The application would still be responsible for saving the screen area, manipulating video modes as necessary, restoring the screen when done, and returning control of the screen to other applications with END_UPDATE and END_MCTRL.

short mt_wind_xcreate ( short  Parts,
short  Wx,
short  Wy,
short  Ww,
short  Wh,
short *  OutX,
short *  OutY,
short *  OutW,
short *  OutH,
short *  global_aes 
)

initializes a new window structure and allocates any necessary memory.

Parameters
Partsis a bit array whose elements determine the presence of any 'widgets' on the window as follows:
  • NAME (0x01) Window has a title bar.
  • CLOSER (0x02) Window has a close box.
  • FULLER (0x04) Window has a fuller box.
  • MOVER (0x08) Window may be moved by the user.
  • INFO (0x10) Window has an information line.
  • SIZER (0x20) Window has a sizer box.
  • UPARROW (0x40) Window has an up arrow.
  • DNARROW (0x80) Window has a down arrow.
  • VSLIDE (0x100) Window has a vertical slider.
  • LFARROW (0x200) Window has a left arrow.
  • RTARROW (0x400) Window has a right arrow.
  • HSLIDE (0x800) Window has a horizontal slider.
  • HOTCLOSEBOX (0x1000) Window has "hot close box" box.
  • MENUBAR (0x1000) Window has a menu bar.
  • BACKDROP (0x2000) Window has a backdrop box.
  • SMALLER (0x4000) Window has an iconifier.
  • BORDER (0x8000) Window has border-resize capability (XaAES).
The parameter Parts is created by OR'ing together any desired elements.
WxX-position of the maximum extents of the window.
WyY-position of the maximum extents of the window.
WwWidth of the maximum extents of the window.
WhHeight of the maximum extents of the window.
Normally this is the entire screen area minus the menu bar (to find this area use mt_wind_get() with a parameter of WF_WORKXYWH ). The area may be smaller to bound the window to a particular size and location.
OutXX-coordinate of the maximum (if Wx exceeded it) extent of the window.
OutYY-coordinate of the maximum (if Wy exceeded it) extent of the window.
OutWX-coordinate of the maximum (if Ww exceeded it) extent of the window.
OutHX-coordinate of the maximum (if Wh exceeded it) extent of the window. wind_xcreate() is only of use when the AES operates in WCOWORK mode, in which case the Outx parameters are 'clipped' to the maximum work area if input extent exceeded it.
global_aesglobal AES array
Returns
a window handle if successful or a negative number if it was unable to create the window.
Since
XaAES versions .
See also
mt_wind_open(), mt_wind_close(), mt_wind_delete()

The SMALLER gadget is only available as of AES version 4.1.

The BORDER gadget is only available in XaAES kernel module versions compiled after November 8, 2004.

A window is not actually displayed on screen with this call, you need to call mt_wind_open() to do that.

The desktop was limited to four windows. The AES actually allowed seven windows. As of MultiTOS the number of open windows is limited only by memory and the capabilities of an application. You should ensure that your application calls a mt_wind_delete() for each mt_wind_create(), otherwise memory may not be deallocated when your application exits.

short mt_wind_xcreate_grect ( short  Parts,
const GRECT r,
GRECT OutR,
short *  global_aes 
)

initializes a new window structure and allocates any necessary memory.

Parameters
Partsis a bit array whose elements determine the presence of any 'widgets' on the window.
rspecify the maximum extents of the window.
OutRCorrected maximum extents of window, if 'r' exceeded it.
global_aesglobal AES array

see mt_wind_xcreate() documentation for more details

short mt_wind_xget_grect ( short  WindowHandle,
short  What,
const GRECT clip,
GRECT r,
short *  global_aes 
)

returns various information about a window.

Parameters
WindowHandlespecifies the handle of the window to return information about (0 is the desktop window)
Whatspecifies the information to return and the values placed into r.
clipadditional information about the request. For now, this information is only taken into account for command WF_FIRSTAREAXYWH. In that case, clip is a clipping area, and the AES may optimize the list of rectangles returned by WF_FIRSTAREAXYWH and WF_NEXTXYWH.
rvalue returned, see mt_wind_get()
global_aesglobal AES array

see mt_wind_get() documentation for more details.

short mt_wind_xset_grect ( short  WindowHandle,
short  What,
const GRECT s,
GRECT r,
short *  global_aes 
)

returns various information about a window.

Parameters
WindowHandlespecifies the handle of the window to return information about (0 is the desktop window)
Whatspecifies the information to return and the values placed into r.
sis a rectangle containing coordinates for WF_CURRXYWH, WF_PREVXYWH, and WF_FULLXYWH modes. wind_xset_grect(handle, WF_CURRXYWH, (const GRECT *)s, (GRECT *)r); will set the coordinates of the window, just like wind_set_grect(handle, WF_CURRXYWH, (const GRECT *)r); but will return the coordinates actually set in 'r'. This eliminates the need to do wind_get_grect(..) to fetch the newly set coordinates. Refer to the XaAES documentation for more information about the extended wind_set() modes
ractual coordinates returned
global_aesglobal AES array

see mt_wind_set() documentation for more details.