class XObject: public XEventBroker, public XObjectEventListener

Foundation class

Inheritance:

XObject - XEventBroker

XObject - XObjectEventListener - XEventListener


Public Methods

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

Protected Fields

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

Protected Methods

[more]bool SendMessage(unsigned long __Receiver, unsigned long __Class, long __Message)
Sends a "long" message
[more]bool SendMessage(unsigned long __Receiver, unsigned long __Class, void *__Body, unsigned long __Size)
Sends a "void *" message

Inherited from XEventBroker:

Public Methods

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

Protected Fields

Map __map

Inherited from XObjectEventListener:

Public Methods

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

Inherited from XEventListener:


Documentation

Inherited by most Xterminal classes
XObject(XRect __Bounds)
Constructs a new XObject with the specified bounds

virtual ~XObject()
Destructs the object's 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 bool GetState(unsigned long __Mask)
Returns the value of the specified object's state
Returns:
true if bit set
Parameters:
__Mask - state mask

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

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

virtual bool 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)
Returns:
true if event was processed

virtual void RegisterClient(XObject *__Client)
Registers the specified XObject as client. It also adjusts the client's bounds and enables the SM_NO_REFRESH flag for the newly registered client

virtual void Resize(XPoint __delta)
Adjusts the object's size with the specified coordinates
Parameters:
__delta - translation vector

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, bool __BoolValue)
Sets the value of the specified object state
Parameters:
__Mask - state mask
__BoolValue - set bit if non-zero, otherwise clear it

virtual void UnregisterClient(XObject *__Client)
Unregisters the specified client

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)

ClientList Clients
Linked list of object's registered clients

bool SendMessage(unsigned long __Receiver, unsigned long __Class, long __Message)
Sends a "long" message
Returns:
false if destination does not exists
Parameters:
__Receiver - destination object id
__Class - message class
__Message - the message itself

bool SendMessage(unsigned long __Receiver, unsigned long __Class, void *__Body, unsigned long __Size)
Sends a "void *" message
Returns:
false if destination does not exists
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-99 Dragos Acostachioaie, Bernd Kalbfuss
Last update on March 9, 1999

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