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

Nano-X miscellaneous APIs.
[Nano-X public API]

Functions that didn't fit anywhere else. More...

Functions

void GrReqShmCmds (long shmsize)
 Requests a shared memory area of the specified size to use for transferring command arguments.

void GrInjectPointerEvent (GR_COORD x, GR_COORD y, int button, int visible)
 Sets the pointer invisible if the visible parameter is GR_FALSE, or visible if it is GR_TRUE, then moves the pointer to the specified position and generates a mouse event with the specified button status.

void GrInjectKeyboardEvent (GR_WINDOW_ID wid, GR_KEY keyvalue, GR_KEYMOD modifiers, GR_SCANCODE scancode, GR_BOOL pressed)
 Sends a keyboard event to the specified window, or to the window with the current keyboard focus if 0 is used as the ID.

void GrSetScreenSaverTimeout (GR_TIMEOUT timeout)
 Sets the number of seconds of inactivity before a screen saver activate event is sent to the root window ID.

void GrBell (void)
 Asks the server to ring the console bell on behalf of the client (intended for terminal apps to be able to ring the bell on the server even if they are running remotely).

void GrSetPortraitMode (int portraitmode)
 Set server portrait mode.

void GrQueryPointer (GR_WINDOW_ID *mwin, GR_COORD *x, GR_COORD *y, GR_BUTTON *bmask)
 Returns the current information for the pointer.

GR_BOOL GrGrabKey (GR_WINDOW_ID wid, GR_KEY key, int type)
 Grab a key for a specific window.

void GrUngrabKey (GR_WINDOW_ID wid, GR_KEY key)
 Ungrab a key for a specific window.

void GrSetTransform (GR_TRANSFORM *)
 This passes transform data to the mouse input engine.


Detailed Description

Functions that didn't fit anywhere else.


Function Documentation

GR_BOOL GrGrabKey GR_WINDOW_ID  id,
GR_KEY  key,
int  type
 

Grab a key for a specific window.

This function has two effects. With any type other than #GR_GRAB_HOTKEY it attempts to reserve the specified key for exclusive use by the application. In addition, with #GR_GRAB_HOTKEY or #GR_GRAB_HOTKEY_EXCLUSIVE it requests hotkey events be sent to the specified window whenever the specified key is pressed or released.

A key can have any number of reservations of type #GR_GRAB_HOTKEY, but at most one reservation of another type. This means that grabs of type #GR_GRAB_HOTKEY always succeed, but grabs of any other type will fail if the key is already grabbed in any fashion except #GR_GRAB_HOTKEY.

Note that all grabs are automatically released when the window specified in the id paramater is deleted, or when the client application closes it's connection to the Nano-X server.

Parameters:
id Window to send event to.
key MWKEY value.
type The type of reservation to make. Valid values are #GR_GRAB_HOTKEY_EXCLUSIVE, #GR_GRAB_HOTKEY, #GR_GRAB_EXCLUSIVE and #GR_GRAB_EXCLUSIVE_MOUSE.
Returns:
#GR_TRUE on success, #GR_FALSE on error.

void GrInjectKeyboardEvent GR_WINDOW_ID  wid,
GR_KEY  keyvalue,
GR_KEYMOD  modifiers,
GR_SCANCODE  scancode,
GR_BOOL  pressed
 

Sends a keyboard event to the specified window, or to the window with the current keyboard focus if 0 is used as the ID.

The other arguments correspond directly to the fields of the same names in the keyboard event structure.

Parameters:
wid ID of the window to send the event to, or 0.
keyvalue Unicode keystroke value to inject.
modifiers Modifiers (shift, ctrl, alt, etc.) to inject.
scancode The key scan code to inject.
pressed TRUE for a key press, FALSE for a key release.

void GrInjectPointerEvent GR_COORD  x,
GR_COORD  y,
int  button,
int  visible
 

Sets the pointer invisible if the visible parameter is GR_FALSE, or visible if it is GR_TRUE, then moves the pointer to the specified position and generates a mouse event with the specified button status.

Also performs a GrFlush() so that the event takes effect immediately.

Parameters:
x the X coordinate of the pointer event relevant to the root window
y the Y coordinate of the pointer event relevant to the root window
button the pointer button status
visible whether to display the pointer after the event

void GrQueryPointer GR_WINDOW_ID *  mwin,
GR_COORD *  x,
GR_COORD *  y,
GR_BUTTON *  bmask
 

Returns the current information for the pointer.

Parameters:
mwin Window the mouse is current in
x Current X pos of mouse (from root)
y Current Y pos of mouse (from root)
bmask Current button mask

void GrReqShmCmds long  shmsize  ) 
 

Requests a shared memory area of the specified size to use for transferring command arguments.

This is faster but less portable than the standard BSD sockets method of communication (and of course will only work if the client and server are on the same machine). Apart from the initial allocation of the area using this call, the use of shared memory is completely transparent. Additionally, if the allocation fails we silently and automatically fall back on socket communication. It is safe to call this function even if shared memory support is not compiled in; it will simply do nothing.

Parameters:
shmsize the size of the shared memory area to allocate

Todo:
FIXME: how does the user decide what size of shared memory area to allocate?

void GrSetPortraitMode int  portraitmode  ) 
 

Set server portrait mode.

Parameters:
portraitmode New portrait mode.

void GrSetScreenSaverTimeout GR_TIMEOUT  timeout  ) 
 

Sets the number of seconds of inactivity before a screen saver activate event is sent to the root window ID.

A value of 0 activates the screen saver immediately, and a value of -1 disables the screen saver function.

Parameters:
timeout the number of seconds of inactivity before screen saver activates

void GrSetTransform GR_TRANSFORM *  trans  ) 
 

This passes transform data to the mouse input engine.

Parameters:
trans A GR_TRANSFORM structure that contains the transform data for the filter, or NULL to disable.

void GrUngrabKey GR_WINDOW_ID  id,
GR_KEY  key
 

Ungrab a key for a specific window.

Parameters:
id Window to stop key grab.
key MWKEY value.


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