Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Related Pages  

Nano-X window API.
[Nano-X public API]

Functions for handling windows on the screen. More...

Functions

GR_WINDOW_ID GrNewWindow (GR_WINDOW_ID parent, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height, GR_SIZE bordersize, GR_COLOR background, GR_COLOR bordercolor)
 Create a new window.

GR_WINDOW_ID GrNewPixmap (GR_SIZE width, GR_SIZE height, void *pixels)
 Create a new server side pixmap.

GR_WINDOW_ID GrNewInputWindow (GR_WINDOW_ID parent, GR_COORD x, GR_COORD y, GR_SIZE width, GR_SIZE height)
 Create a new input-only window with the specified dimensions which is a child of the specified parent window.

void GrDestroyWindow (GR_WINDOW_ID wid)
 Destroys a window and all of it's children.

void GrGetWindowInfo (GR_WINDOW_ID wid, GR_WINDOW_INFO *infoptr)
 Fills in a GR_WINDOW_INFO structure with information regarding a window.

void GrMapWindow (GR_WINDOW_ID wid)
 Recursively maps (makes visible) the specified window and all of the child windows which have a sufficient map count.

void GrUnmapWindow (GR_WINDOW_ID wid)
 Recursively unmaps (makes invisible) the specified window and all of the child windows.

void GrRaiseWindow (GR_WINDOW_ID wid)
 Places the specified window at the top of its parents drawing stack, above all of its sibling windows.

void GrLowerWindow (GR_WINDOW_ID wid)
 Places the specified window at the bottom of its parents drawing stack, below all of its sibling windows.

void GrMoveWindow (GR_WINDOW_ID wid, GR_COORD x, GR_COORD y)
 Moves the specified window to the specified position relative to its parent window.

void GrResizeWindow (GR_WINDOW_ID wid, GR_SIZE width, GR_SIZE height)
 Resizes the specified window to be the specified width and height.

void GrReparentWindow (GR_WINDOW_ID wid, GR_WINDOW_ID pwid, GR_COORD x, GR_COORD y)
 Changes the parent window of the specified window to the specified parent window and places it at the specified coordinates relative to the new parent.

GR_WINDOW_ID GrGetFocus (void)
 Returns the ID of the window which currently has the keyboard focus.

void GrSetFocus (GR_WINDOW_ID wid)
 Sets the keyboard focus to the specified window.

void GrSetWMProperties (GR_WINDOW_ID wid, GR_WM_PROPERTIES *props)
 Copies the provided GR_WM_PROPERTIES structure into the the GR_WM_PROPERTIES structure of the specified window id.

void GrGetWMProperties (GR_WINDOW_ID wid, GR_WM_PROPERTIES *props)
 Reads the GR_WM_PROPERTIES structure for the window with the specified id and fills in the provided structure with the information.

void GrCloseWindow (GR_WINDOW_ID wid)
 Sends a CLOSE_REQ event to the specified window if the client has selected to receive CLOSE_REQ events on this window.

void GrKillWindow (GR_WINDOW_ID wid)
 Forcibly disconnects the client which owns this window with the specified ID number.

void GrSetBackgroundPixmap (GR_WINDOW_ID wid, GR_WINDOW_ID pixmap, int flags)
 Sets the background of the specified window to the specified pixmap.

void GrQueryTree (GR_WINDOW_ID wid, GR_WINDOW_ID *parentid, GR_WINDOW_ID **children, GR_COUNT *nchildren)
 Return window parent and list of children.

void GrSetWindowRegion (GR_WINDOW_ID wid, GR_REGION_ID rid, int type)
 Sets the bounding region of the specified window, not to be confused with a GC clip region.


Detailed Description

Functions for handling windows on the screen.


Function Documentation

void GrCloseWindow GR_WINDOW_ID  wid  ) 
 

Sends a CLOSE_REQ event to the specified window if the client has selected to receive CLOSE_REQ events on this window.

Used to request an application to shut down but not force it to do so immediately, so the application can ask whether to save changed files before shutting down cleanly.

Parameters:
wid the ID of the window to send the CLOSE_REQ event to

void GrDestroyWindow GR_WINDOW_ID  wid  ) 
 

Destroys a window and all of it's children.

Recursively unmaps and frees the data structures associated with the specified window and all of its children.

Parameters:
wid The ID of the window to destroy.

GR_WINDOW_ID GrGetFocus void   ) 
 

Returns the ID of the window which currently has the keyboard focus.

Returns:
the ID of the window which currently has the keyboard focus

void GrGetWindowInfo GR_WINDOW_ID  wid,
GR_WINDOW_INFO infoptr
 

Fills in a GR_WINDOW_INFO structure with information regarding a window.

Parameters:
wid The ID of the window to retrieve information about.
infoptr Pointer to a GR_WINDOW_INFO structure to return the information in.

void GrGetWMProperties GR_WINDOW_ID  wid,
GR_WM_PROPERTIES props
 

Reads the GR_WM_PROPERTIES structure for the window with the specified id and fills in the provided structure with the information.

It is the callers responsibility to free the title member as it is allocated dynamically. The title field will be set to NULL if the window has no title.

Parameters:
wid the ID of the window to retreive the WM properties of
props pointer to a GR_WM_PROPERTIES structure to fill in

void GrKillWindow GR_WINDOW_ID  wid  ) 
 

Forcibly disconnects the client which owns this window with the specified ID number.

Used to kill an application which has locked up and is not responding to CLOSE_REQ events.

Parameters:
wid the ID of the window to kill

void GrLowerWindow GR_WINDOW_ID  wid  ) 
 

Places the specified window at the bottom of its parents drawing stack, below all of its sibling windows.

Parameters:
wid the ID of the window to lower

void GrMapWindow GR_WINDOW_ID  wid  ) 
 

Recursively maps (makes visible) the specified window and all of the child windows which have a sufficient map count.

The border and background of the window are painted, and an exposure event is generated for the window and every child which becomes visible.

Parameters:
wid the ID of the window to map

void GrMoveWindow GR_WINDOW_ID  wid,
GR_COORD  x,
GR_COORD  y
 

Moves the specified window to the specified position relative to its parent window.

Parameters:
wid the ID of the window to move
x the X coordinate to move the window to relative to its parent.
y the Y coordinate to move the window to relative to its parent.

GR_WINDOW_ID GrNewInputWindow GR_WINDOW_ID  parent,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height
 

Create a new input-only window with the specified dimensions which is a child of the specified parent window.

Parameters:
parent The ID of the window to use as the parent of the new window.
x The X coordinate of the new window relative to the parent window.
y The Y coordinate of the new window relative to the parent window.
width The width of the new window.
height The height of the new window.
Returns:
The ID of the newly created window.

GR_WINDOW_ID GrNewPixmap GR_SIZE  width,
GR_SIZE  height,
void *  pixels
 

Create a new server side pixmap.

This is an offscreen drawing area which can be copied into a window using a GrCopyArea call.

Parameters:
width The width of the pixmap.
height The height of the pixmap.
pixels Currently unused in client/server mode.
Returns:
The ID of the newly created pixmap.

Todo:
FIXME Add support for shared memory...

GR_WINDOW_ID GrNewWindow GR_WINDOW_ID  parent,
GR_COORD  x,
GR_COORD  y,
GR_SIZE  width,
GR_SIZE  height,
GR_SIZE  bordersize,
GR_COLOR  background,
GR_COLOR  bordercolor
 

Create a new window.

Parameters:
parent The ID of the parent window.
x The X coordinate of the new window relative to the parent window.
y The Y coordinate of the new window relative to the parent window.
width The width of the new window.
height The height of the new window.
bordersize The width of the window border.
background The color of the window background.
bordercolor The color of the window border.
Returns:
The ID of the newly created window.

void GrQueryTree GR_WINDOW_ID  wid,
GR_WINDOW_ID *  parentid,
GR_WINDOW_ID **  children,
GR_COUNT *  nchildren
 

Return window parent and list of children.

Caller must free() children list after use.

Parameters:
wid window ID for query
parentid returned parent ID
children returned children ID list
nchildren returned children count

void GrRaiseWindow GR_WINDOW_ID  wid  ) 
 

Places the specified window at the top of its parents drawing stack, above all of its sibling windows.

Parameters:
wid the ID of the window to raise

void GrReparentWindow GR_WINDOW_ID  wid,
GR_WINDOW_ID  pwid,
GR_COORD  x,
GR_COORD  y
 

Changes the parent window of the specified window to the specified parent window and places it at the specified coordinates relative to the new parent.

Parameters:
wid the ID of the window to reparent
pwid the ID of the new parent window
x the X coordinate to place the window at relative to the new parent
y the Y coordinate to place the window at relative to the new parent

void GrResizeWindow GR_WINDOW_ID  wid,
GR_SIZE  width,
GR_SIZE  height
 

Resizes the specified window to be the specified width and height.

Parameters:
wid the ID of the window to resize
width the width to resize the window to
height the height to resize the window to

void GrSetBackgroundPixmap GR_WINDOW_ID  wid,
GR_WINDOW_ID  pixmap,
int  flags
 

Sets the background of the specified window to the specified pixmap.

The flags which specify how to draw the pixmap (in the top left of the window, in the centre of the window, tiled, etc.) are those which start with GR_BACKGROUND_ in nano-X.h. If the pixmap value is 0, the server will disable the background pixmap and return to using a solid colour fill.

Parameters:
wid ID of the window to set the background of
pixmap ID of the pixmap to use as the background
flags flags specifying how to draw the pixmap onto the window

void GrSetFocus GR_WINDOW_ID  wid  ) 
 

Sets the keyboard focus to the specified window.

Parameters:
wid the ID of the window to set the focus to

void GrSetWindowRegion GR_WINDOW_ID  wid,
GR_REGION_ID  rid,
int  type
 

Sets the bounding region of the specified window, not to be confused with a GC clip region.

The bounding region is used to implement non-rectangular windows. A window is defined by two regions: the bounding region and the clip region. The bounding region defines the area within the parent window that the window will occupy, including border. The clip region is the subset of the bounding region that is available for subwindows and graphics. The area between the bounding region and the clip region is defined to be the border of the window. Currently, only the window bounding region is implemented.

Copies the specified region and makes the copy be the bounding region used for the specified window. After setting the clipping region, all drawing within the window will be clipped to the specified region (including the drawing of the window background by the server), and mouse events will pass through parts of the window which are outside the clipping region to whatever is underneath them. Also, windows underneath the areas which are outside the clipping region will be able to draw to the screen as if those areas of the window were not there (in other words, you can see through the gaps in the window). This is most commonly used to implement shaped windows (ie. windows which are some shape other than a simple rectangle). Note that if you are using this feature you will probably want to disable window manager decorations so that the window manager does not draw its own container window behind yours and spoil the desired effect. Also note that shaped windows must always have a border size of 0. If you need a border around a shaped window, add it to the clipping region and draw it yourself.

Parameters:
wid the ID of the window to set the clipping region of
rid the ID of the region to assign to the specified window
type region type, bounding or clip mask

void GrSetWMProperties GR_WINDOW_ID  wid,
GR_WM_PROPERTIES props
 

Copies the provided GR_WM_PROPERTIES structure into the the GR_WM_PROPERTIES structure of the specified window id.

Parameters:
wid the ID of the window to set the WM properties of
props pointer to a GR_WM_PROPERTIES structure

void GrUnmapWindow GR_WINDOW_ID  wid  ) 
 

Recursively unmaps (makes invisible) the specified window and all of the child windows.

Parameters:
wid the ID of the window to unmap


Generated on Sun May 18 21:03:07 2003 for Microwindows Nano-X API by doxygen1.3