TGClient


class description - source file - inheritance tree

class TGClient : public TObject


    protected:
Bool_t DoRedraw() Bool_t HandleEvent(Event_t* event) Bool_t HandleMaskEvent(Event_t* event, Window_t wid) Bool_t ProcessOneEvent() public:
TGClient TGClient(const char* dpyName = 0) TGClient TGClient(TGClient&) virtual void ~TGClient() static TClass* Class() void FreePicture(const TGPicture* pic) Bool_t GetColorByName(const char* name, ULong_t& pixel) const FontStruct_t GetFontByName(const char* name) const ULong_t GetHilite(ULong_t base_color) const TGMimeTypes* GetMimeTypeList() const const TGPicture* GetPicture(const char* name) const const TGPicture* GetPicture(const char* name, UInt_t new_width, UInt_t new_height) const const TGPicturePool* GetPicturePool() const const TGWindow* GetRoot() const ULong_t GetShadow(ULong_t base_color) const TGWindow* GetWindowById(Window_t sw) const Bool_t HandleInput() virtual TClass* IsA() const void NeedRedraw(TGWindow* w) void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2) void RegisterWindow(TGWindow* w) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void UnregisterWindow(TGWindow* w) void WaitFor(TGWindow* w) void WaitForUnmap(TGWindow* w)

Data Members

protected:
ULong_t fBackColor default background color ULong_t fForeColor default foreground color ULong_t fHilite default hilite color ULong_t fShadow default shadow color ULong_t fSelBackColor default selection background color ULong_t fSelForeColor default selection foreground color ULong_t fWhite white color index ULong_t fBlack black color index TGWindow* fRoot root (base) window Int_t fXfd file descriptor of connection to server TGPicturePool* fPicturePool pixmap cache TGMimeTypes* fMimeTypeList mimetype list Bool_t fGlobalNeedRedraw true if at least one window needs to be redrawn THashList* fWlist list of frames EGEventType fWaitForEvent event to wait for Window_t fWaitForWindow window in which to wait for event

Class Description

                                                                      
 TGClient                                                             
                                                                      
 Window client. In client server windowing systems, like X11 this     
 class is used to make the initial connection to the window server.   
 It is the only GUI class that does not inherit from TGObject.        
                                                                      


TGClient(const char *dpyName)
 Create a connection with the display sever on host DpyName and setup
 the complete GUI system, i.e., graphics contexts, fonts, etc. for all
 widgets.

const TGPicture* GetPicture(const char *name)
 Get picture from pool. Picture must be freed using
 TGClient::FreePicture(). If picture is not found 0 is returned.

const TGPicture* GetPicture(const char *name, UInt_t new_width, UInt_t new_height)
 Get picture with specified size from pool (picture will be scaled if
 necessary). Picture must be freed using TGClient::FreePicture(). If
 picture is not found 0 is returned.

void FreePicture(const TGPicture *pic)
 Free picture resource.

void NeedRedraw(TGWindow *w)
 Set redraw flags.

Bool_t GetColorByName(const char *name, ULong_t &pixel) const
 Get a color by name. If color is found return kTRUE and pixel is
 set to the color's pixel value, kFALSE otherwise.

FontStruct_t GetFontByName(const char *name) const
 Get a font by name. If font is not found, fixed font is returned,
 if fixed font also does not exist return 0 and print error.

ULong_t GetHilite(ULong_t base_color) const
 Return pixel value of hilite color based on base_color.

ULong_t GetShadow(ULong_t base_color) const
 Return pixel value of shadow color based on base_color.
 Shadow is 60% of base_color intensity.

void RegisterWindow(TGWindow *w)
 Add a TGWindow to the clients list of windows.

void UnregisterWindow(TGWindow *w)
 Remove a TGWindow from the list of windows.

TGWindow* GetWindowById(Window_t wid) const
 Find a TGWindow via its handle. If window is not found return 0.

~TGClient()
 Closing down client: cleanup and close X connection.

Bool_t ProcessOneEvent()
 Process one event. This method should only be called when there is
 a GUI event ready to be processed. If event has been processed
 kTRUE is returned. If processing of a specific event type for a specific
 window was requested kFALSE is returned when specific event has been
 processed, kTRUE otherwise. If no more pending events return kFALSE.

Bool_t HandleInput()
 Handles input from the display server. Returns kTRUE if one or more
 events have been processed, kFALSE otherwise.

void WaitFor(TGWindow *w)
 Wait for window to be destroyed.

void WaitForUnmap(TGWindow *w)
 Wait for window to be unmapped.

Bool_t DoRedraw()
 Redraw all windows that need redrawing. Returns kFALSE if no redraw
 was needed, kTRUE otherwise.
 Only redraw the application's windows when the event queue
 does not contain expose event anymore.

Bool_t HandleEvent(Event_t *event)
 Handle a GUI event.

Bool_t HandleMaskEvent(Event_t *event, Window_t wid)
 Handle masked events only if window wid is the window for which the
 event was reported or if wid is a parent of the event window. The not
 masked event are handled directly. The masked events are:
 kButtonPress, kButtonRelease, kKeyPress, kKeyRelease, kEnterNotify,
 kLeaveNotify, kMotionNotify.

void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
 Execute string "cmd" via the interpreter. Before executing replace
 in the command string the token $MSG, $PARM1 and $PARM2 by msg,
 parm1 and parm2, respectively. The function in cmd string must accept
 these as longs.



Inline Functions


             const TGWindow* GetRoot() const
        const TGPicturePool* GetPicturePool() const
                TGMimeTypes* GetMimeTypeList() const
                     TClass* Class()
                     TClass* IsA() const
                        void ShowMembers(TMemberInspector& insp, char* parent)
                        void Streamer(TBuffer& b)
                    TGClient TGClient(TGClient&)


Author: Fons Rademakers 27/12/97
Last update: root/gui:$Name: $:$Id: TGClient.cxx,v 1.7 2000/10/10 10:20:10 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.