#include <udisp.hpp>
Inheritance diagram for ubit::UDisp:
Public Member Functions | |
UDisp (const UStr &display_name) | |
UDisp (UConf &) | |
creates a new Display. | |
const UConf & | getConf () const |
returns the configuration of this Display. | |
int | getID () const |
returns the ID of this Display. | |
bool | isOpened () const |
returns true if the Display was sucessufully opened. | |
virtual void | add (UWin &) |
add a window (UFrame, UDialog, etc) to this Display. | |
virtual void | remove (UWin &, bool auto_delete) |
remove a window from this Display. | |
int | getDepth () const |
depth of this UDisp. | |
const UStr & | getDisplayName () const |
name of the X server (default = null). | |
int | getScreenWidth () const |
int | getScreenHeight () const |
size of the Screen used by this UDisp. | |
int | getScreenNumber () const |
returns the number of the Screen of this UDisp. | |
int | getScreenCount () const |
void | flush () |
flushes all drawing requests. | |
bool | isRealized () const |
returns true if the graphics resources of the Display are initialized. | |
void | setPointerPos (const UPoint &screen_pos, int channel=0) const |
move the pointer to this position on the screen. | |
UPoint | getPointerPos (int channel=0) const |
returns the position of the pointer on the screen. | |
int | getPointerState (int channel=0) const |
returns the state of the modifier keys and pointer buttons. | |
bool | grabPointer (const UCursor *=null) |
starts a physical grab of the native pointer. | |
void | ungrabPointer () |
ends a physical grab of the native pointer. | |
bool | pickWindow (UNatWin &picked_win, int &x_in_win, int &y_in_win, UCursor *=null) |
bool | pickWindow (UNatWin &picked_win, int &x_in_win, int &y_in_win, UCall &callback, UCursor *=null) |
grab the pointer and pick a window with the mouse. | |
UEventFlow * | getDispFlow (int channel) const |
returns the Event Flow for this channel on this display (null if not found). | |
UEventFlow * | obtainDispFlow (int channel) |
gets or creates the Event Flow that corresponds to this channel on this display. | |
USelection * | getDispSelection (int channel) |
returns the text selection of a given event flow on this display. | |
int | setTrueColors (int depth_hint) |
int | setPseudoColors (int depth_hint) |
[X11 only] tries to set TrueColor or PseudoColor mode with this depth. | |
virtual void | realize () |
[impl] realizes this display (allocates the X resources). | |
UNatDisp * | getNatDisp () const |
[impl] implementation dependant data. | |
void | copySelection (UEvent &, USelection &) |
[impl] copies the content of the selection in the copy buffer and tells the X server we own the X selection. | |
void | pasteSelection (UEvent &e, UStr *_paste_to_str, int _paste_to_pos) |
[impl] pastes the X selection in this UStr at this pos. | |
void | addHardWin (UWin *) |
void | removeHardWin (UWin *) |
[impl] will manage the events of this window if it is realized and shown. | |
void | realizeFont (const UFont &) |
bool | realizeColor (UColor &) |
bool | realizeCursor (UCursor &) |
[impl] allocates graphical data. |
A UAppli can open windows on several Displays (that can be controlled by remote machines). Window children can be shared by windows that belong to different displays. These children are automatically replicated (and synchronized) on the corresponding displays. The default Display is the UAppli. See class UAppli and UAppli::getDisp().
ubit::UDisp::UDisp | ( | UConf & | ) |
creates a new Display.
'display_name' is the name of the X Window server:
void ubit::UDisp::add | ( | UWin & | ) | [virtual] |
add a window (UFrame, UDialog, etc) to this Display.
Reimplemented in ubit::UAppli.
void ubit::UDisp::copySelection | ( | UEvent & | , | |
USelection & | ||||
) |
[impl] copies the content of the selection in the copy buffer and tells the X server we own the X selection.
note: there is 1 selection per UEventFlow but only 1 copy_buffer per UDisp
UEventFlow * ubit::UDisp::getDispFlow | ( | int | channel | ) | const |
returns the Event Flow for this channel on this display (null if not found).
0 is the channel of the native Event Flow on this display. Don't confuse channels with event flow IDs: channels depend on displays, while IDs are unique for the whole UAppli. For instance, if an appli is displayed on 2 displays, it will have (at least) 2 event flows, 1 on disp1 and 1 on disp2. The channel of both event flow will be 0, but their IDs will differ.
USelection * ubit::UDisp::getDispSelection | ( | int | channel | ) |
returns the text selection of a given event flow on this display.
int ubit::UDisp::getID | ( | ) | const |
returns the ID of this Display.
the ID of the default Display is 0 (the default Display is the UAppli).
bool ubit::UDisp::grabPointer | ( | const UCursor * | = null |
) |
starts a physical grab of the native pointer.
the UCursor arg is the curcor that is shown during the grab. A default value (such as UCursor::crosshair) is used if this argument is null. returns true if the pointer could be grabbed. BEWARE that grabPointer() may lock the X server!
UEventFlow * ubit::UDisp::obtainDispFlow | ( | int | channel | ) |
gets or creates the Event Flow that corresponds to this channel on this display.
calls getDispFlow() then creates a new flow if getDispFlow() returns null.
[impl] pastes the X selection in this UStr at this pos.
ATTENTION: c'est lie a *chaque* disp et c'est ASYNCHRONE: le paste n'est pas fait immediatement mais par appel ulterieur d'un callback
bool ubit::UDisp::pickWindow | ( | UNatWin & | picked_win, | |
int & | x_in_win, | |||
int & | y_in_win, | |||
UCall & | callback, | |||
UCursor * | = null | |||
) |
grab the pointer and pick a window with the mouse.
void ubit::UDisp::realize | ( | ) | [virtual] |
[impl] realizes this display (allocates the X resources).
this function does not need to be explicitely called except if you need to draw Graphics before calling the mainLoop. The UError exception is thrown if the UDisp can't be realized
Reimplemented in ubit::UAppli.
void ubit::UDisp::remove | ( | UWin & | , | |
bool | auto_delete | |||
) | [virtual] |
remove a window from this Display.
for explanations on 'auto_delete' see: UGroup::remove()
Reimplemented in ubit::UAppli.
int ubit::UDisp::setPseudoColors | ( | int | depth_hint | ) |
[X11 only] tries to set TrueColor or PseudoColor mode with this depth.
Arguments:
void ubit::UDisp::ungrabPointer | ( | ) |