Xterminal Home Page Main page

class XObject : public XEventBroker, public XObjectEventListener

Foundation class

Inheritance:

XObject - XEventBroker

XObject - XObjectEventListener - XEventListener


Public Methods

virtual void CalculateBounds()
Computes the object's size and the real bounds
virtual void Draw()
Paints the visual object content onto the terminal's screen
XRect GetBounds()
Returns the object's bounds
virtual XEvent* GetEvent()
Returns the first event addressed to this object, zero if none
unsigned long GetId()
Returns the object's id
char* GetObjClass()
Returns the objects's class name
XPoint GetOrigin()
Returns the object's origin
virtual unsigned GetPalEntry(unsigned __Index)
Returns the color value with __Index position inside the palette
virtual char* GetPalette()
Returns the object's attached color palette
XPoint GetSize()
Returns the object's size
unsigned long GetState()
Returns the object state register
virtual unsigned GetState(unsigned long __Mask)
Returns the value of the specified object's state
virtual void HandleEvent(XEvent *__Ev)
Handles the event passed as argument, by calling ProcessEvent() method
virtual void MoveTo(XPoint __p)
Moves the object's origin to the specified point
virtual int ProcessEvent(XEvent *__Event)
Receives incoming events and distributes them using the ProcessEvent() method of XObjectEventListener class, also being careful not to treat keyboard events if the object does not own the focus
virtual void RegisterClient(XObject *__NewClient)
Registers the specified XObject as client
virtual void SetPalette(char *__Pal, unsigned __PalLen)
Sets the object's attached color palette
virtual void SetState(unsigned long __Mask, unsigned __BoolValue)
Sets the value of the specified object state
XObject(XRect __Bounds)
Constructs a new XObject with the specified bounds
virtual ~XObject()
Destructs the object instance

Protected Fields

XRect Bounds
This are the *real* bounds, in absolute coordinates
SLList < XObject * > Clients
Linked list of object's registered clients
XPoint Cursor
Cursor's position inside the object's bounds
unsigned long Id
Object's unique identificator
char ObjClass[40]
Name of the class the object belongs, choosen by the programmer
XPoint Origin
Object's upper-left coordinate, relative to it's server
char Pal[80]
Object's attached color palette
unsigned PalLen
Palette size
XObject* Server
Server to which the object is registered (and which services he uses), or zero if the object have no server
XPoint Size
Object's size
unsigned long State
Current properties of the object

Protected Methods

int SendMessage(unsigned long __Receiver, unsigned long __Class, void *__Body, unsigned long __Size)
Sends a "void *" message
int SendMessage(unsigned long __Receiver, unsigned long __Class, long __Message)
Sends a "long" message

Inherited from XEventBroker:

Public Methods

void AddListener(unsigned long __Listener, unsigned __Class)
void DelListener(unsigned long __Listener)
void DelListener(unsigned long __Listener, unsigned __Class)

Protected Fields

Map __map

Inherited from XObjectEventListener:

Public Methods

virtual int ProcessBroadcast(XEvent *__Event)
virtual int ProcessCommand(XMessage *__Event)
virtual int ProcessKeyboardEvent(XKeyboardEvent *__Event)
virtual int ProcessMessage(XMessage *__Event)
virtual int ProcessMouseEvent(XMouseEvent *__Event)
virtual int ProcessSignal(XEvent *__Event)

Inherited from XEventListener:


Documentation

Foundation class
XObject(XRect __Bounds)
Constructs a new XObject with the specified bounds

virtual ~XObject()
Destructs the object instance

virtual void CalculateBounds()
Computes the object's size and the real bounds. This method is used by the RegisterClient method

virtual void Draw()
Paints the visual object content onto the terminal's screen. Remember to call XRefresh() function before return so the draw becomes visible!

XRect GetBounds()
Returns the object's bounds

virtual XEvent* GetEvent()
Returns the first event addressed to this object, zero if none

unsigned long GetId()
Returns the object's id

char* GetObjClass()
Returns the objects's class name

XPoint GetOrigin()
Returns the object's origin

virtual char* GetPalette()
Returns the object's attached color palette

virtual unsigned GetPalEntry(unsigned __Index)
Returns the color value with __Index position inside the palette

XPoint GetSize()
Returns the object's size

unsigned long GetState()
Returns the object state register. The returned value must be processed next with the state masks the object uses to gain valuable information

virtual unsigned GetState(unsigned long __Mask)
Returns the value of the specified object's state
Returns:
non-zero if bit set
Parameters:
__Mask - state mask

virtual void HandleEvent(XEvent *__Ev)
Handles the event passed as argument, by calling ProcessEvent() method

virtual void MoveTo(XPoint __p)
Moves the object's origin to the specified point

virtual int ProcessEvent(XEvent *__Event)
Receives incoming events and distributes them using the ProcessEvent() method of XObjectEventListener class, also being careful not to treat keyboard events if the object does not own the focus

virtual void RegisterClient(XObject *__NewClient)
Registers the specified XObject as client. It also enable the SM_NO_REFRESH flag for the newly registered client

virtual void SetPalette(char *__Pal, unsigned __PalLen)
Sets the object's attached color palette
Parameters:
__Pal - new palette
__PalLen - new palette size

virtual void SetState(unsigned long __Mask, unsigned __BoolValue)
Sets the value of the specified object state
Parameters:
__Mask - state mask
__BoolValue - set bit if non-zero, otherwise clear it

unsigned long Id
Object's unique identificator

unsigned long State
Current properties of the object. The different states can be ORed. The common used states are:

- SM_VISIBLE indicates that the object is currently visible on the terminal's screen, so it is in a drawn state

- SM_CURSOR_VISIBLE indicates that the cursor is currently visible and it's inside the object's bounds

- SM_FOCUSED indicates that the object has the control at the respective moment (only one object can have the control at a moment, so if the user press, let's say, a key, this object will receive the event)

- SM_DRAGGING indicates that the objects is currently dragged on the terminal's screen

- SM_DISABLED indicates that the object is deactivated at the moment

- SM_ACTIVE indicates that the object is active, so the user has control over it

- SM_NO_REFRESH indicates that the object's Draw() method will not dump it's contents to the screen by calling XRefresh(), but will let it's server to do this instead

XPoint Origin
Object's upper-left coordinate, relative to it's server

XPoint Size
Object's size

XPoint Cursor
Cursor's position inside the object's bounds

XRect Bounds
This are the *real* bounds, in absolute coordinates

char ObjClass[40]
Name of the class the object belongs, choosen by the programmer

char Pal[80]
Object's attached color palette

unsigned PalLen
Palette size

XObject* Server
Server to which the object is registered (and which services he uses), or zero if the object have no server. (If you are not familiar with the client-server concept, try to think to the server as the object's parent)

SLList < XObject * > Clients
Linked list of object's registered clients

int SendMessage(unsigned long __Receiver, unsigned long __Class, long __Message)
Sends a "long" message
Parameters:
__Receiver - destination object id
__Class - message class
__Message - the message itself

int SendMessage(unsigned long __Receiver, unsigned long __Class, void *__Body, unsigned long __Size)
Sends a "void *" message
Parameters:
__Receiver - destination object id
__Class - message class
__Body - the message itself
__Size - size of __Body pointer


Direct child classes:
XtWindow
XtStatusLine
XtStaticText
XtScrollBar
XtRadioButton
XtProgressBar
XtMenu
XtList
XtInputStringField
XtDialog
XtCheckButton
XtButton
XtBackground

Go to the hierarchy of classes.


Copyright ©1998 Dragos Acostachioaie, Bernd Kalbfuss
Last update on June 17, 1998

This page was generated with the help of doc++.