Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UDisp Class Reference

Display Context. More...

#include <udisp.hpp>

Inheritance diagram for UDisp:

UAppli List of all members.

Public Types

enum  Stat { CannotOpen = -1, NotOpened = 0, Opened = 1, OpenGL = 2 }

Public Member Functions

 UDisp (int disp_id, class UAppli &, const UStr &display_name)
 UDisp (int disp_id, class UAppli &, class UConf &)
 creates a new logical Display
int getID () const
 returns the ID of this logical display.
UAppligetAppli () const
 returns the corresponding Application Context.
const class UConfgetConf () const
 returns the configuration of this Display.
int getStatus () const
 returns connection status (see: enum UDisp::Stat)
virtual bool isRealized () const
 is this Display initialized?.
virtual void realize ()
 realizes this display (allocates the X resources)
virtual void add (class UWin *)
virtual void add (class UWin &)
 add a window (UFrame, UDialog, etc) to this logical display
virtual void remove (UWin &child, int remove_mode)
virtual void remove (UWin *child, int remove_mode)
 same as UGroup::remove().
UFlowopenFlow (int flow_id)
 creates a new event flow (or returns an existing flow if ID already used)
void closeFlow (class UFlow *)
 [unstable].
UFlowgetFlow (int flow_id)
 returns the corresponding Event Flow (null otherwise)
unsigned int getFlowCount () const
const UFlowList & getFlows () const
int setTrueColors (int depth_hint)
int setPseudoColors (int depth_hint)
 tries to set TrueColor or PseudoColor mode with this depth
int getScreenWidth () const
int getScreenHeight () const
 size of the Screen used by this UDisp.
int getDepth () const
 depth of this specific UDisp.
int getScreenDefaultDepth () const
 default depth of the Screen used by this UDisp
int getScreenNumber () const
 returns the number of the Screen of this UDisp.
int getScreenCount () const
const UStrgetDisplayName () const
 name of the X server (default = null).
UNatDisp * getNatDisp () const
 [impl] implementation dependant data.
void deleteNotify (class UView *deleted_view)
void deleteNotify (class UGroup *deleted_group)
 [impl] notifies the UDisp that a view/a widget is being destroyed.

Detailed Description

Display Context.

this class modelizes the physical X Display. it is the base class of UAppli, the Application Context.


Constructor & Destructor Documentation

UDisp::UDisp int  disp_id,
class UAppli ,
class UConf
 

creates a new logical Display

Args:

  • 'display_name' name of the X Window server:
  • syntax: hostname[:screen_number]
  • hostname:0 is the default if [:screen_number] is omitted
    • depth and color mode can be specified in the UConf argument. Default is 24 bits true colors.

see also: UDisp::setTrueColors() and class UConf.


Member Function Documentation

void UDisp::add class UWin  )  [virtual]
 

add a window (UFrame, UDialog, etc) to this logical display

notes:

  • at least one window (typically an UFrame) should be added to the UAppli instance
  • the "Main Frame" is the first UFrame that is added to the UAppli
  • windows are initially hidden (including the Main Frame), their show() method must be called to make them visible
  • window children must be added before calling the show() method (as window sizes won't change after this call)
  • See also: classes UWin, UFrame, UDialog, UMenu.

Reimplemented in UAppli.

UFlow * UDisp::getFlow int  flow_id  ) 
 

returns the corresponding Event Flow (null otherwise)

NB: the ID of the standard X event flow is 0.

int UDisp::getScreenDefaultDepth  )  const
 

default depth of the Screen used by this UDisp

Note: this value may differ from getDepth()

int UDisp::getStatus  )  const
 

returns connection status (see: enum UDisp::Stat)

value is > 0 if connected to an X server (and == UDisp::OpenGL if connected in OpenGL mode)

void UDisp::realize  )  [virtual]
 

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 UAppli.

int UDisp::setPseudoColors int  depth_hint  ) 
 

tries to set TrueColor or PseudoColor mode with this depth

Arguments:

  • depth and color mode can be specified in the UConf argument of the UDisp constructor. Default is 24 bits true colors.
  • the 'depth' argument is a hint: the visual with the closest depth available will be used
  • returns the actual depth that was set. 0 means that no compatible depth could be found for this color mode Notes:
  • TrueColor mode should be used whenever possible because it is requested for alpha blending (transparency)
  • this fct. must be called before realize() or mainLoop()


The documentation for this class was generated from the following files:
Generated on Tue Mar 8 22:31:29 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.1