Class to display graphics on screen, using X11.
Macros:
Labels for values in X11DisplayEvt
Enumerations:
None.
Typedefs:
X11Display opaque structure
Struct CapyX11DisplayEvt :
Struct CapyX11DisplayEvt's properties:
0: no event, 1: press, 2: release
0: key, 1: mouse
Time of the event in millisecond (not sure relative to what)
key or button mask, 'or' combination of: NoModMask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask
key/button value, one of: for key: NoSymbol or the XK_... value (see complete list here: /usr/include/X11/keysymdef.h) which map to ASCII (XK_a == 'a') for button: Button1, Button2, Button3, Button4, Button5
Coordinates of the pointer at the time of event
Struct CapyX11DisplayEvt's methods:
None.
Struct CapyX11DisplayPos :
Struct CapyX11DisplayPos's properties:
Position (0,0 is the top-left corner, x toward right, y toward bottom)
Struct CapyX11DisplayPos's methods:
None.
Struct { :
Struct {'s properties:
Dimensions of the buffer
RGB buffers, three channels, ordered by row of RGB pixel value in [0, 255]
Struct {'s methods:
None.
Functions:
Allocate memory and create a new CapyX11Display instance
Input argument(s):
width: initial width of the display
height: initial height of the display
displayName: the display name as hostname:server_number.screen_number, if
NULL ":0.0" is used instead
title: the title of the window
Output and side effect(s):
Return a new CapyX11Display instance, or NULL if it couldn't be created
Free the resource used by a CapyX11Display instance
Input argument(s):
that: pointer to the CapyX11Display instance
Output and side effect(s):
*that is set to NULL, the display is closed if it has been shown, all memory allocated by the instance is released
Display the CapyX11Display instance and starts its main loop in a separate thread. The thread will end when the window has focus and the user presses ctrl-c (the key combination, not the signal), or CapyX11DisplayHide() is called, or CapyX11DisplayFree() is called.
Input argument(s):
that: the CapyX11Display instance
Hide the CapyX11Display instance. The display is unmapped and its thread is terminated but its reources are not freed and it is ready to be shown again anytime.
Input argument(s):
that: the CapyX11Display instance
Check if a display is currently shown
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return true if the display is shown, else false
Get the average refresh rate (number of times the window content is updated per second) since the last call to CapyX11DisplayGetRefreshRate() or CapyX11DisplayShow().
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return the refresh rate
Get the average frame rate (number of times the image buffer is updated per second) since the last call to CapyX11DisplayGetFrameRate() or CapyX11DisplayShow().
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return the frame rate
Return the next event in the queue of events
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Pop the next event from the queue and return it. If there was no event in the queue an event with type == 0 is returned instead.
Flush the event queue
Input argument(s):
that: the CapyX11Display instance
Get the las known position of the pointer in the display
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return the last known position.
Get the current rendering buffer.
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return the buffer to write on. The content of the buffer is undefined. The width and height of the buffer may be different from the previous buffer.
Publish the current editing buffer
Input argument(s):
that: the CapyX11Display instance
Get the elapsed time in millisecond since the display is shown
Input argument(s):
that: the CapyX11Display instance
Output and side effect(s):
Return the elapsed time.
Set the title of the window
Input argument(s):
that: pointer to the CapyX11Display instance
title: the window's new title