You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Object object:
Cvo_Object
Cvo_BasicObject
The Cvo_Object object is the lowest level object that operates on windows as opposed to pixmaps. It allow registration of events and provides the most fundamental operations on a window. It is never directly created, but instead it is used to derive more useful objects. Although there is only one dervied class of a Cvo_Object in Cvo, it is intended that non-Cvo windows can use the Cvo registration/event mechanism through this object, although no facility is currently provided for this.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Flush (
[ [ { char | wchar_t } c ], int x ]
,
[ int which ] )
Cause any data not already sent to the X Server to be sent for this
object. This may also cause other objects to be flushed as well. By
default, it will cause all the children of this object to be flushed.
Some objects, like the Cvo_Text object, buffer up data and do not
attempt to process it until Flush()
is called. This allows for a
screen with less flicker.
The optional argument, which, can have several values. A value of zero indicates that the object, its children, and the display should be flushed.
A value of one indicates that the object and its children should be flushed.
A value of two indicates that the object and the display should be flushed.
A value of three indicates that just the object should be flushed.
Map (
)
This function actually creates the X Window for the object, if not already created, and then causes the object to be mapped on the screen. By default, the children of this object will be mapped as well.
Unmap (
)
This function causes the object to become unmapped, but not destroyed.
This has the effect of removing the window from the screen, but it
can be brought back on a moments notice via the Map()
function.
CreateAll (
)
This function is similar to Map()
, except it does not actually map
the object. It will assure that this object and all of its children
have been created.
Iconify (
)
Deiconify (
)
These functions either iconify or deiconify the X window which the object is in. This should only be used on a top level window.
RaiseWindow (
)
LowerWindow (
)
These functions either raise or lower the X window which the object is in. This should only be used on a top level window.
char *Name (
)
char *Class (
)
char *FullName (
)
These functions return the name, class, and fully resolved name of
the object. Each call to FullName()
may overwrite the previous
value returned from FullName()
.
XrmQuark QName (
)
XrmQuark QClass (
)
These functions return the Quark version of the name and class of the object.
Cvo_Object *Parent (
)
This function returns a pointer to the parent object.
Cvo_Object *Children (
)
This function returns a pointer to the first child of this object, if any.
Cvo_Object *Sibling (
)
This function returns a pointer to the next child of this object's
parent. This list is NULL
terminated.
Cvo_Object *Elder (
)
This function returns a pointer to the previous child of this object's parent. This list is circular. To find the last child of an object you may use the code:
Children() ? Children()->Elder() : 0
Cvo_Object RootObject (
)
This function returns a pointer to the object at the root of the object tree to which this object belongs. e.g., if this object is a child of a Cvo_Frame, and the Cvo_Frame object is a child of a Cvo_Application object, then a pointer to the Cvo_Application object will be returned.
SetFocus (
Cvo_Object *object )
This function is used to indicate that when this object gains focus, it should be automatically passed on to the specified argument object. Normally this call is not needed, but it might be used to associate a label with an input field.
QueryMouseLocation (
int *x,
int *y,
[ int *root_x, int *root_y ] )
This function returns the current position of the mouse relative to this object in the variables x and y. If root_x and root_y are specified, then the absolute location on the screen is returned in those variables.
SetTitle (
char *title )
This function sets X's idea of the title for this object. This is only useful on a top level window.
SetIconTitle (
char *icon_title )
This function sets X's idea of the title for this object to be used in an icon. This is only useful on a top level window.
PlaceBefore (
Cvo_Object *sibling )
This function causes this object to appear just prior to sibling in the object tree. This will affect the location of the object in its parent.
PlaceAfter (
Cvo_Object *sibling )
This function causes this object to appear just after sibling in the object tree. This will affect the location of the object in its parent.
Functions dealing with retrieving X resource values:
char *GetResource (
char *name,
char *class,
[ char *default ] )
char *GetResource (
XrmQuark name,
XrmQuark class,
[ char *default ],
[ XrmQuark name_root ],
[ XrmQuark class_root ] )
char *GetNewResource (
{ char * | XrmQuark } name,
{ char * | XrmQuark } class,
[ char *default ] )
BOOL GetResourceTruth (
{ char * | XrmQuark } name,
{ char * | XrmQuark } class,
[ BOOL default ] )
int GetResourceInt (
{ char * | XrmQuark } name,
{ char * | XrmQuark } class,
[ int default ] )
These functions retrieve information out of the X Resource Database.
The name and class of the resource, which may be either a string or
a Quark
, should only refer to the last element of the resource, e.g.
"title", "Title". These functions automatically prepend the fully
resolved resource name/class prior to the given name and class. If
default is specified, it will be returned if no match was found.
In its Quark
form, the GetResource()
function takes two
additional, optional Quark
arguments, name_root and
class_root. If name_root is given, it will be prepended to
the Quark
given by name. If class_root is given, it will
be prepended to the Quark
given by class. However, if
name_root is given, but class_root is not, then name_root
will be used in the place of class_root.
The GetNewResource()
functions return a string that was put in
memory allocated by new
. It is up to the caller to call
delete
on that memory when it is no longer needed.
The GetResourceTruth()
functions return a boolean value. It
understands the common English words: on, off, true, false,
affirmative, negative, yes, no.
The GetResourceInt()
function interprets the value as an integer.
If no integer can be formed, zero is returned.
Beep (
)
This function simply causes the system bell to be beeped.
char *ExpandName (
char *name )
This function allocates a buffer to contain the expanded version of
the string pointed to by name. The argument name is processed
like a printf()
style format with the following macro expansions:
%%
simply a single '%'
%I
the application's instance name
%P
the application's program name
%C
the application's class name
%R
the application's resource name
%L
the application's locale
%n
the object's name
%c
the object's class
Cvo_Registration *Register (
CARD32 event,
[ CARD16 mask ],
{ Cvo_EvFunc func | Cvo_ExtEvFunc func },
[ void *_data, KeySym key ] )
Cvo_Registration *RegisterKey (
KeySym key,
[ CARD16 mask ],
{ Cvo_ExtEvFunc func | Cvo_EvFunc func },
[ void *_data ] )
This object defines the following Cvo Events in addition to those defined by its parent and ancestor objects.
CvoExitEvent
struct
Cvo_AnyEvent
This event is sent to each object just prior to Cvo_Exit()
actually
calling exit()
.
CvoPreMapRequestEvent
struct
Cvo_AnyEvent
This event is sent just prior to laying out this object when it is being mapped.
CvoMapRequestEvent
struct
Cvo_AnyEvent
This event is sent just after laying out this object and just prior to it being mapped.
CvoUnmapRequestEvent
struct
Cvo_AnyEvent
This event is sent just prior to actually unmapping the object.
CvoFocusInEvent
struct
Cvo_AnyEvent
This event is generated just prior to assigning focus to this object.
CvoFocusOutEvent
struct
Cvo_AnyEvent
This event is generated just prior to removing focus from this object.
CvoDestroyedEvent
struct
Cvo_DestroyedEvent
This event is sent just prior to the actual destruction of this object.
CvoKeyTextEvent
struct
Cvo_KeyTextEvent
Window root,
Window subwindow,
Time time,
int x.art int y
,
int x_root.art int y_root
,
CARD state,
CARD keycode,
BOOL same_screen:1,
BOOL have_sym,
BOOL have_text,
KeySym keysym,
Cvo_CharacterBuffer *text
This event is generated after a KeyPress
event is recieved on the
object. It is quite similar to a KeyPress
event, but the correct
LookupString()
call has been made and the results are pointed to by
text. Besides the standard XKeyEvent
elements that are found in a
Cvo_KeyTextEvent
, the have_sym value indicates that keysym
contains the evaluated keysym and have_text indicates that text
actually points to resolved text.
This event deals correctly with I18N issues of alternate input mechanisms.
This object uses the following X resources in addition to those used by its parent and ancestor objects.
*CvoObject.FONT
(class:
FONT
)This resource is the X font to use for this window. If this resource is specified, then its value will be used as the absolute font name, regardless of other font resource values.
*CvoObject.dontSink
(class:
DontSink
) (default value:
True
)
This resource does something, but I am not sure what!
*CvoObject.fontEncoding
(class:
FontEncoding
) (default value:
*
)
*CvoObject.fontFamily
(class:
FontFamily
) (default value:
Clean
)
*CvoObject.fontFoundry
(class:
FontFoundry
) (default value:
*
)
*CvoObject.fontInfo
(class:
FontInfo
) (default value:
False
)
*CvoObject.fontPointSize
(class:
FontPointSize
) (default value:
*
)
*CvoObject.fontRegistry
(class:
FontRegistry
) (default value:
*
)
*CvoObject.fontSize
(class:
FontSize
) (default value:
14
)
*CvoObject.fontSlant
(class:
FontSlant
) (default value:
r
)
*CvoObject.fontSpaceWidth
(class:
FontSpaceWidth
) (default value:
*
)
*CvoObject.fontSpacing
(class:
FontSpacing
) (default value:
*
)
*CvoObject.fontStyle
(class:
FontStyle
) (default value:
*
)
*CvoObject.fontWeight
(class:
FontWeight
) (default value:
Medium
)
*CvoObject.fontWidth
(class:
FontWidth
) (default value:
*
)
*CvoObject.fontXResolution
(class:
FontXResolution
) (default value:
*
)
*CvoObject.fontYResolution
(class:
FontYResolution
) (default value:
*
)
These resources are used to specify the font for this object and its children. Each resource is used to provide an element in the standard X font description format.
*CvoObject.monochrome
(class:
Monochrome
)This resource determines whether or not this object is being displayed on a color display. It should be a boolean value.
*CvoObject.printEvents
(class:
PrintEvents
) (default value:
False
)
This resource, when True
, will cause events to be printed to the
standard error output stream, for debugging purposes. This will only
work in Cvo debugging mode (-debug
command line option).
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoObject*Background
(new value:
white
)
*CvoObject*Chamfer
(new value:
2
)
*CvoObject*Color*Background
(new value:
gray
)
*CvoObject*Color*DontSink
(new value:
)
*CvoObject*Foreground
(new value:
black
)
*CvoObject*InternalPad
(new value:
3
)
*CvoObject*LayoutPad
(new value:
3
)
*CvoObject.Cursor
(new value:
Diamond Cross
)
See the legend for information about the conventions used in this documentation.