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

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

Protected Fields

oMap __map


Inherited from XObjectEventListener:

Public Methods

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


Inherited from XEventListener:


Documentation

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

ovirtual ~XObject()
Destructs the object's instance

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

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

oXRect GetBounds()
Returns the object's bounds

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

ounsigned long GetId()
Returns the object's id

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

oXPoint GetOrigin()
Returns the object's origin

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

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

oXPoint GetSize()
Returns the object's size

ounsigned 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

ovirtual bool GetState(unsigned long __Mask)
Returns the value of the specified object's state
Returns:
true if bit set
Parameters:
__Mask - state mask

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

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

ovirtual 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

ovirtual 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

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

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

ovirtual 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

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

ounsigned long Id
Object's unique identificator

ounsigned 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

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

oXPoint Size
Object's size

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

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

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

ochar Pal[80]
Object's attached color palette

ounsigned PalLen
Palette size

oXObject* 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)

oClientList Clients
Linked list of object's registered clients

obool 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

obool 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
XtHList
XtDialog
XtCheckButton
XtButton
XtBackground

Go to the hierarchy of classes.


Copyright ©1998-2001 Dragos Acostachioaie
Last update on October 27, 2001

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