Table of Contents
r3root
oops/r3root.h
r3oops
The base class for realsoft objects.
-
r3Root
R3CLID_ROOT - 0
CREATE, DELETE, SETCLATTR, GETCLATTR, SET, GET, READ, WRITE, UPDATE, REF, UNREF, ADDHEAD, ADDTAIL, REMOVE, OOENUM, MAKETAGLIST, FREETAGLIST, NAMEFORTAG, TRANSFORM, COPY, ASSIGN, LOADOBJECT, GETSTR, ENUMSUBCLASSES, FREECACHE, SETINDEXED, GETINDEXED, ISOFKIND, ISYOURTAG, INSERT, FINDTAGDESCR, FINDTAGDESCRBYNAME, GETPUBATTR, SETPUBATTR, FINDINDEXEDTAGDESCR, NAMEFORINDEXEDTAG,
Hook, Error, Name, ClassID, InstanceSize, SysObject, Next, Previous, HookData, List, Self, StaticName, Version, RefCount, Dispatcher, Icon,
int R3RegisterRootClass(R3APP *app);
R3RM_CREATE
CREATE
R3RM_CREATE
R3OBJ*, address of the created object
R3TAG*, default attributes for the instance to be created
rc = obj.CREATE(p3);
Creates a new instance.
R3RM_DELETE
DELETE
R3RM_DELETE
obj.DELETE();
Deletes an object (destructor). See R3ObjectDelete() shield.
R3RM_SETCLATTR
SETCLATTR
R3RM_SETCLATTR
R3TAG*, tag list specifying attributes and values to be set.
obj.SETCLATTR(p3);
Set one or more class attributes. See R3SetClassAttrs()
R3RM_GETCLATTR
GETCLATTR
R3RM_GETCLATTR
R3TAG*, tags list specifying attributes to be fecthed
obj.GETCLATTR(p3);
Fetch class attributes
R3RM_SET
SET
R3RM_SET
R3TAG*, tag list specifying attributes and values to be set
obj.SET(p3);
Set object attributes
R3RM_GET
GET
R3RM_GET
R3TAG*, NULL if all tags were recognized, otherwise address of the unrecognized tag.
R3TAG*, tag list specifying attributes/storages.
rc = obj.GET(p3);
Fetch one or more object attributes
R3RM_READ
READ
R3RM_READ
R3BOOL, FALSE if failed, R3RA_Error, can be used for fetching the error code
R3TAG*, tag list specifying the file object and address for the error code:
rc = obj.READ(p3);
Tells object to read its attributes from a file. If the class of the file is R3CLID_IFF, automatic crossplatform conversion is applied.
R3RM_WRITE
WRITE
R3RM_WRITE
R3BOOL, NULL if write failed
R3TAG*, tag list (R3RA_FileObject, R3RA_Error).
rc = obj.WRITE(p3);
Tells an object to write its attributes to a file
R3RM_UPDATE
UPDATE
R3RM_UPDATE
void*, new value, the type of the value depends on the attribute in question
R3INT, model's attribute that has changed
obj.UPDATE(p1, p3);
This method is defined by the root class althought its up to the sub classes to implement it. For more information, see model-view concept.
R3RM_REF
REF
R3RM_REF
obj.REF();
Increments objects reference count. By default, the reference count is zero.
R3RM_UNREF
UNREF
R3RM_UNREF
R3OBJ*, NULL if object was deleted
rc = obj.UNREF();
Decrements objects reference count. When reference count drops to zero, the object is deleted.
R3RM_ADDHEAD
ADDHEAD
R3RM_ADDHEAD
R3LIST, list
obj.ADDHEAD(p3);
Tells an object to link itself at the head of a list.
R3RM_ADDTAIL
ADDTAIL
R3RM_ADDTAIL
R3LIST, list
obj.ADDTAIL(p3);
Tells an object ot link itself to the end of a list
R3RM_REMOVE
REMOVE
R3RM_REMOVE
R3LIST, list
obj.REMOVE(p3);
Removes an object from a list
R3RM_OOENUM
OOENUM
R3RM_OOENUM
void*, return value from the called object.
R3TAG*, R3RA_TargetObject, R3RA_TargetMethod
rc = obj.OOENUM(p3);
Enumerate object.
R3RM_MAKETAGLIST
MAKETAGLIST
R3RM_MAKETAGLIST
R3LIST, list containing R3TAGLISTNODE structures
obj.MAKETAGLIST(p3);
Fetch the public attribute list.
R3RM_FREETAGLIST
FREETAGLIST
R3RM_FREETAGLIST
R3LIST, list containing R3TAGLISTNODE structures by R3RM_MAKETAGLIST.
obj.FREETAGLIST(p3);
Free the public attribute list
R3RM_NAMEFORTAG
NAMEFORTAG
R3RM_NAMEFORTAG
R3BOOL, true if found.
R3INT, attribute identifier
char*, buffer for the name
rc = obj.NAMEFORTAG(p1, p3);
Fetch the name for the given attribute.
R3RM_TRANSFORM
TRANSFORM
R3RM_TRANSFORM
obj.TRANSFORM();
This method is defined by the root class but implemented by the sub classes.
R3RM_COPY
COPY
R3RM_COPY
R3OBJ*, an address of the duplicate
rc = obj.COPY();
Makes a copy of an object
R3RM_ASSIGN
ASSIGN
R3RM_ASSIGN
R3OBJ*, address of the object from which the attributes should be read
obj.ASSIGN(p3);
Tells an object to read all its attributes from the given object. Note: only those attributes are assigned which are common to the both objects.
R3RCM_LOADOBJECT
LOADOBJECT
R3RCM_LOADOBJECT
R3OBJ*, address of the loaded object or NULL if failed
R3TAG*, attributes for the object to be loaded.
rc = obj.LOADOBJECT(p3);
Reads on object from the given file. FIrst, root attributes (such as the class id) are read. The root class then creates an instance of that class and sends R3RM_READ method to the instance.
R3RCM_GETSTR
GETSTR
R3RCM_GETSTR
R3INT, string identifier. See localization examples
obj.GETSTR(p3);
Fetches a localized string corresponding the given string id.
R3RCM_ENUMSUBCLASSES
ENUMSUBCLASSES
R3RCM_ENUMSUBCLASSES
R3OBJ*, object to be called as R3SendMsgA3((R3OBJ *)p1, (R3INT)p2, (R3CLASS *)super, (R3CLAS *)class, (void *)p3);
R3INT, method for the callback object
void*, whatever user data for the callback object.
obj.ENUMSUBCLASSES(p1, p2, p3);
Enumerates sub class of the given class (non-recursive)
R3RCM_FREECACHE
FREECACHE
R3RCM_FREECACHE
obj.FREECACHE();
Sent to each class at close down. The class should free all objects allocated, * e.g. window cache.
R3RM_SETINDEXED
SETINDEXED
R3RM_SETINDEXED
obj.SETINDEXED();
Set an indexed object attribute
R3RM_GETINDEXED
GETINDEXED
R3RM_GETINDEXED
obj.GETINDEXED();
Get an indexed object attribute
R3RM_ISOFKIND
ISOFKIND
R3RM_ISOFKIND
R3INT, 0 if the given class id doesn't match any of the classes of the given object. Otherwise positive integer is returned indicating the 'level' at which the match was found. Return value of 1 means that the given class is the 'true class' of the object. The return value of 2 indicates that the given class id is the super class of the object etc.
R3CLID, class id to be checked
rc = obj.ISOFKIND(p3);
Compares the given class id agains the class ids of the object.
R3RM_ISYOURTAG
ISYOURTAG
R3RM_ISYOURTAG
R3BOOL, true if object recognizes the tag
R3INT, tag identifier
rc = obj.ISYOURTAG(p3);
Asks if the given method or attribute is defined by the object.
R3RM_INSERT
INSERT
R3RM_INSERT
R3BOOL, true if 'prev' node was found
R3BOOL, don't send R3MM_CHANGED
R3OBJ*, previous object in the list
R3LIST, list
rc = obj.INSERT(p1, p2, p3);
Insert the object to a given list after the given 'prev' node
R3RM_FINDTAGDESCR
FINDTAGDESCR
R3RM_FINDTAGDESCR
R3BOOL, true if tag was found.
R3INT, tag to be fetched
R3LIST, tags fetched by calling R3RM_MAKETAGLIST. If null, maketaglist and freetaglits methods are called internally.
rc = obj.FINDTAGDESCR(p1, p2, 0);
Fetch tag descriptor (R3TAGNAME) data for the given tag id.
R3RM_FINDTAGDESCRBYNAME
FINDTAGDESCRBYNAME
R3RM_FINDTAGDESCRBYNAME
R3BOOL, true if found
char*, name of the attribute to be found
rc = obj.FINDTAGDESCRBYNAME(p1, 0);
Find tag descriptor by name
R3RM_GETPUBATTR
GETPUBATTR
R3RM_GETPUBATTR
R3OBJ*, object whose attribute was referred
char*, hierarhcial name identifying the attribute
void*, buffer for the value
rc = obj.GETPUBATTR(p1, p3);
Fetch public attribute by hierarhical name. The method returns the value and specification by using the FINDTAGDESCRBYNAME method.
R3RM_SETPUBATTR
SETPUBATTR
R3RM_SETPUBATTR
R3OBJ*, object whose attribute was referred
char*, hierarhcial name identifying the attribute
void*, buffer for the value
rc = obj.SETPUBATTR(p1, p3);
Set public attribute. This uses FINDTAGDESCRBYNAME method.
R3RM_FINDINDEXEDTAGDESCR
FINDINDEXEDTAGDESCR
R3RM_FINDINDEXEDTAGDESCR
R3BOOL, true if found
R3INT, tag
R3INT, index,
rc = obj.FINDINDEXEDTAGDESCR(p1, p2, 0);
Find tag description for indexed tag.
R3RM_NAMEFORINDEXEDTAG
NAMEFORINDEXEDTAG
R3RM_NAMEFORINDEXEDTAG
R3BOOL, true if found
R3INT, tag
R3INT, index,
char*, buffer for tag name
rc = obj.NAMEFORINDEXEDTAG(p1, p2, p3);
Find name for indexed tag.
Hook
Hook
R3RA_Hook
String
void*
callback or hook for whatever usage
jsobj.SetHook(value);
value = jsobj.GetHook();
void* value = ...;
R3SetAttrs(r3obj, R3RA_Hook, value, R3TAG_END);
void* value;
R3GetAttrs(r3obj, R3RA_Hook, &value, R3TAG_END);
Error
Error
R3RA_Error
Integer
R3INT
for passing error codes to caller
jsobj.SetError(value);
value = jsobj.GetError();
R3INT value = ...;
R3SetAttrs(r3obj, R3RA_Error, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3RA_Error, &value, R3TAG_END);
Name
Name
R3RA_Name
String
char*
object's name
jsobj.SetName(value);
value = jsobj.GetName();
char* value = ...;
R3SetAttrs(r3obj, R3RA_Name, value, R3TAG_END);
char* value;
R3GetAttrs(r3obj, R3RA_Name, &value, R3TAG_END);
ClassID
ClassID
R3RA_ClassID
Integer
R3INT
objects classid
jsobj.SetClassID(value);
value = jsobj.GetClassID();
R3INT value = ...;
R3SetAttrs(r3obj, R3RA_ClassID, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3RA_ClassID, &value, R3TAG_END);
InstanceSize
InstanceSize
R3RA_InstanceSize
Integer
R3INT
instance size
value = jsobj.GetInstanceSize();
R3INT value;
R3GetAttrs(r3obj, R3RA_InstanceSize, &value, R3TAG_END);
SysObject
SysObject
R3RA_SysObject
String
void*
OS specific object associated with V4 object
jsobj.SetSysObject(value);
value = jsobj.GetSysObject();
void* value = ...;
R3SetAttrs(r3obj, R3RA_SysObject, value, R3TAG_END);
void* value;
R3GetAttrs(r3obj, R3RA_SysObject, &value, R3TAG_END);
Next
Next
R3RA_Next
Object
R3OBJ*
next object in a list
jsobj.SetNext(value);
value = jsobj.GetNext();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3RA_Next, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3RA_Next, &value, R3TAG_END);
Previous
Previous
R3RA_Previous
Object
R3OBJ*
jsobj.SetPrevious(value);
value = jsobj.GetPrevious();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3RA_Previous, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3RA_Previous, &value, R3TAG_END);
HookData
HookData
R3RA_HookData
String
void*
for callbacks
jsobj.SetHookData(value);
value = jsobj.GetHookData();
void* value = ...;
R3SetAttrs(r3obj, R3RA_HookData, value, R3TAG_END);
void* value;
R3GetAttrs(r3obj, R3RA_HookData, &value, R3TAG_END);
List
List
R3RA_List
r3List
R3LIST*
for R3RM_ADDHEAD/TAIL methods
jsobj.SetList(value);
R3LIST* value = ...;
R3SetAttrs(r3obj, R3RA_List, value, R3TAG_END);
Self
Self
R3RA_Self
Object
R3OBJ*
whenever objects needs to pass its address to someone
value = jsobj.GetSelf();
R3OBJ* value;
R3GetAttrs(r3obj, R3RA_Self, &value, R3TAG_END);
StaticName
StaticName
R3RA_StaticName
String
char*
'R3RA_StaticName' not documented
jsobj.SetStaticName(value);
value = jsobj.GetStaticName();
char* value = ...;
R3SetAttrs(r3obj, R3RA_StaticName, value, R3TAG_END);
char* value;
R3GetAttrs(r3obj, R3RA_StaticName, &value, R3TAG_END);
Version
Version
R3RA_Version
Integer
R3INT
version number of the object's class
value = jsobj.GetVersion();
R3INT value;
R3GetAttrs(r3obj, R3RA_Version, &value, R3TAG_END);
RefCount
RefCount
R3RA_RefCount
Integer
R3INT
read only, use REF and UNREF methods for changing refcount
jsobj.SetRefCount(value);
value = jsobj.GetRefCount();
R3INT value = ...;
R3SetAttrs(r3obj, R3RA_RefCount, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3RA_RefCount, &value, R3TAG_END);
Dispatcher
Dispatcher
R3RA_Dispatcher
String
void*
void *(*)(R3CLASS *, R3OBJ *, R3INT, void *, void *, void*) , same as R3RCA_Dispatcher, but can be asked from object as well
jsobj.SetDispatcher(value);
value = jsobj.GetDispatcher();
void* value = ...;
R3SetAttrs(r3obj, R3RA_Dispatcher, value, R3TAG_END);
void* value;
R3GetAttrs(r3obj, R3RA_Dispatcher, &value, R3TAG_END);
Icon
Icon
R3RA_Icon
Object
R3OBJ*
class specific icon object. May be NULL
jsobj.SetIcon(value);
value = jsobj.GetIcon();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3RA_Icon, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3RA_Icon, &value, R3TAG_END);
Limitations
Used for ENUM method
list to be enumerated
See R3TNF_* flags below
see subtypes in r3typids.h
for R3TID_ENUM type
for R3TID_ENUM type
if R3TNF_INDEXED flag is set, use R3SetIndexedAttr() with 'index' for this tag
if R3TNF_ARRAY, tag used for fetching the size of the array
if R3TNF_ARRAY, tag used for fetching the size of the item in the array
if R3TNF_ARRAY, tag used for fetching selection array (R3BYTE *)
flags for r3tagname
obsolete, don't use in new code
Strings defined by the root class
Fetch strings defined by other classes
Registry function