|
ubit
|
Display Context. More...
#include <udisp.hpp>
Classes | |
| struct | LastResize |
Public Member Functions | |
| bool | isOpened () const |
| returns true if the Display was sucessufully opened. | |
| int | getID () const |
| returns the ID of this Display. More... | |
| const UConf & | getConf () const |
| returns the configuration of this Display. | |
| int | getBpp () const |
| returns the number of bit per pixel of this UDisp. More... | |
| const UStr & | getDisplayName () const |
| returns the name of the UDisp's X11 server (when X11 is used). | |
| int | getScreenWidth () const |
| returns the width of the UDisp's screen. | |
| int | getScreenHeight () const |
| returns the height of the UDisp's screen. | |
| void | setPixelPerInch (double pixel_per_inch) |
| changes the pixel density (number of pixels per inch). | |
| void | setPixelPerMM (double pixel_per_mm) |
| changes the pixel density (number of pixels per mm). | |
| virtual void | add (UWin &) |
| add a window (UFrame, UDialog, etc) to this display. More... | |
| void | add (UWin *) |
| see add(UWin&). | |
| virtual void | remove (UWin &, bool auto_delete) |
| remove a window from this display. More... | |
| void | remove (UWin *, bool auto_delete) |
| see remove(UWin&, bool auto_delete). | |
| virtual void | setPointerPos (const UPoint &screen_pos)=0 |
| move the pointer to this position on the screen. | |
| virtual UPoint | getPointerPos () const =0 |
| returns the position of the pointer on the screen. | |
| virtual int | getPointerState () const =0 |
| returns the state of the modifier keys and pointer buttons. | |
| virtual bool | grabPointer (const UCursor *=null)=0 |
| starts a physical grab of the native pointer. More... | |
| virtual void | ungrabPointer ()=0 |
| ends a physical grab of the native pointer. More... | |
| virtual bool | pickWindow (int &x_in_win, int &y_in_win, UHardwinImpl *window, UCursor *cursor=null, UCall *callback=null)=0 |
| grabs the pointer and lets the user pick a window interactively with the mouse. More... | |
| UEventFlow * | getChannelFlow (int channel) const |
| returns the Event Flow for this channel on this display (null if not found). More... | |
| UEventFlow * | obtainChannelFlow (int channel) |
| gets or creates the Event Flow that corresponds to this channel on this display. More... | |
| USelection * | getChannelSelection (int channel) |
| returns the text selection of a given event flow on this display. More... | |
| const UStr & | getCopyBuffer () const |
| returns the copy buffer. | |
| UStr * | getPasteTarget (int &pos) const |
| [impl] returns the string (and the pos in this string) where the paste will take place. | |
| void | clearPasteTarget () |
| [impl] clears the paste target. | |
| virtual void | copySelection (UMouseEvent &, USelection &) |
| [impl] copies the content of the selection in the copy buffer and tells the X server we own the X selection. More... | |
| virtual void | pasteSelection (UMouseEvent &, UStr *paste_str, int paste_pos) |
| [impl] pastes the X selection into this UStr at this pos. More... | |
| URenderContext * | getDefaultContext () |
| void | makeDefaultContextCurrentIfNeeded () |
| void | addHardwin (UWin *) |
| void | removeHardwin (UWin *) |
| virtual unsigned long | createColorPixel (const URgba &)=0 |
| virtual UHardwinImpl * | createWinImpl (UWin *)=0 |
| virtual UCursorImpl * | createCursorImpl (int curtype)=0 |
| virtual void | deleteCursorImpl (UCursorImpl *)=0 |
| virtual UHardFont * | getFont (const UFontDesc *) |
| returns (possibily creating) the requested font (see NOTES). More... | |
| virtual UHardFont * | realizeFont (const UFont &) |
| virtual UHardFont * | realizeFont (const UFontDesc &) |
| virtual void | realizeFontFamily (const UFontFamily &) |
| unsigned long | getBlackPixel () const |
| unsigned long | getWhitePixel () const |
| unsigned long | getRedMask () const |
| unsigned long | getGreenMask () const |
| unsigned long | getBlueMask () const |
| int | getRedShift () const |
| int | getGreenShift () const |
| int | getBlueShift () const |
| int | getRedBits () const |
| int | getGreenBits () const |
| int | getBlueBits () const |
| UEventFlow * | obtainFlow (unsigned int ev_state, int channel) |
| returns the corresponding Event Flow (creates it if does not already exist). | |
| virtual void | onPaint (UView *winview, float x, float y, float w, float h) |
| virtual void | onResize (UView *winview, const UDimension &size) |
| void | onResizeCB (UView *winview) |
| virtual bool | setSelectionOwner (UMouseEvent &) |
| [X11 only] tells the X-server the appli owns the X selection. | |
| virtual void | pasteSelectionRequest (UMouseEvent &) |
| [X11 only] asks the X selection. More... | |
| virtual void | copySelectionCB (void *system_event) |
| [X11 only] copie reellement la selection (ou plus exactement envoie son contenu a l'appli qui la demande). More... | |
| virtual void | pasteSelectionCB (void *system_event) |
| [X11 only] recupere effectivement le contenu de la X selection. More... | |
Static Public Member Functions | |
| static UDisp * | create (const UStr &display_name) |
| creates and opens a new Display. More... | |
| static void | countBits (unsigned long mask, int &bits, int &shift) |
Protected Types | |
| typedef std::list< UHardwinImpl * > | HardwinList |
Protected Member Functions | |
| UDisp (const UStr &display_name) | |
| virtual void | startAppli ()=0 |
| virtual void | quitAppli ()=0 |
| virtual void | startLoop (bool main_loop)=0 |
| virtual void | quitLoop (bool main_loop)=0 |
Protected Attributes | |
| int | id |
| UConf & | conf |
| UStr | display_name |
| int | bpp |
| int | depth_size |
| int | stencil_size |
| int | screen_width |
| int | screen_height |
| int | screen_width_mm |
| int | screen_height_mm |
| bool | is_opened |
| URenderContext * | default_context |
| const UGlcontext * | current_glcontext |
| std::vector< UHardFont ** > | font_map |
| unsigned long | app_motion_time |
| unsigned long | nat_motion_time |
| unsigned long | black_pixel |
| unsigned long | white_pixel |
| unsigned long | red_mask |
| unsigned long | green_mask |
| unsigned long | blue_mask |
| int | red_shift |
| int | green_shift |
| int | blue_shift |
| int | red_bits |
| int | green_bits |
| int | blue_bits |
| double | IN_TO_PX |
| double | CM_TO_PX |
| double | MM_TO_PX |
| double | PT_TO_PX |
| double | PC_TO_PX |
| HardwinList | hardwin_list |
| UStr | copy_buffer |
| uptr< UStr > | paste_str |
| int | paste_pos |
| UElem | winlist |
| struct ubit::UDisp::LastResize | last_resize |
Display Context.
A UAppli can open windows on several displays, which can be on remote machines when X11 is used as a windowing systems. A UDisp contains the data related to a given display (or to a specific screen of a given display when screens are logically separated, ie. when a window cannot move freely from one screen to another one).
UWin objects (and UFrame, UDialog, UMenu subclasses) can be attached to a specific UDisp by using UDisp::add(). Widgets that are contained in several UWin objects ("contained" meaning they are a child of them) are AUTOMATICCALY REPLICATED and synchronized on all these windows.
UAppli derives from UDisp. The UAppli object (which must be unique) represents the default display.
|
virtual |
add a window (UFrame, UDialog, etc) to this display.
Note that windows are initially hidden, their show() method must be called to make them visible. Moreover, as show() calculates the window size, it should called after adding the window children (see also: UWin::adjustSize()).
|
virtual |
[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
|
inlinevirtual |
[X11 only] copie reellement la selection (ou plus exactement envoie son contenu a l'appli qui la demande).
l'event doit etre un XSelectionRequestEvent
creates and opens a new Display.
'display_name' is the name of the X Window server, it must be specified as follows:
NOTES:
|
inline |
returns the number of bit per pixel of this UDisp.
when X11 is used, this bpp may differ from the default BPP of the X11 display.
| UEventFlow * UDisp::getChannelFlow | ( | 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 * UDisp::getChannelSelection | ( | int | channel | ) |
returns the text selection of a given event flow on this display.
returns (possibily creating) the requested font (see NOTES).
IMPORTANT NOTES:
|
inline |
returns the ID of this Display.
the ID of the default Display is 0 (the default Display is the UAppli).
|
pure virtual |
starts a physical grab of the native pointer.
the UCursor arg is the cursor 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 * UDisp::obtainChannelFlow | ( | 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.
|
virtual |
[impl] pastes the X selection into 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
|
inlinevirtual |
[X11 only] recupere effectivement le contenu de la X selection.
l'appel de cette fct est provoque par pasteSelectionRequest() the XEvent must be a XSelectionEvent event.
|
inlinevirtual |
[X11 only] asks the X selection.
cette fct ne recupere PAS tout de suite le contenu de la selection mais entrainera un appel ulterieur de pasteSelectionCallback(). the UEvent must be a button event.
|
pure virtual |
grabs the pointer and lets the user pick a window interactively with the mouse.
(note: this function only works when X11 is used).
|
virtual |
remove a window from this display.
for explanations on 'auto_delete' see: UElem::remove()
|
pure virtual |
ends a physical grab of the native pointer.
1.8.12