Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtGetSubres(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtGetApplicationResources(1)

XtVaGetSubresources(1)

 

Name

XtGetSubresources — update subpart resource list. 

Synopsis

void XtGetSubresources(object, base, name, class, resources, num_resources, args, num_args)

    Widget object;
    XtPointer base;
    String name;
    String class;
    XtResourceList resources;
    Cardinal num_resources;
    ArgList args;
    Cardinal num_args;

Arguments

objectSpecifies the object used to qualify the subpart resource name and class; may be of class Object or any subclass thereof. 

baseSpecifies the base address of the subpart data structure where the resources will be written. 

nameSpecifies the name of the subpart. 

classSpecifies the class of the subpart. 

resourcesSpecifies the resource list for the subpart. 

num_resources
Specifies the number of resources in the resource list.

argsSpecifies the argument list to override any other resource specifications. 

num_argsSpecifies the number of arguments in the argument list. 

Description

A widget does not do anything to get its own resources; instead, XtCreateWidget does this automatically before calling the class initialize procedure. 

However, some widgets have subparts that are not widgets but for which the widget would like to fetch resources.  For example, the R3 Athena Text widget fetched resources for its source and sink.  Such widgets call XtGetSubresources to accomplish this.  (Text now uses objects instead of subparts.) 

XtGetSubresources constructs a name or class list from the application name or class, the names or classes of all its ancestors, and the widget itself.  Then, it appends to this list the name or class pair passed in.  resources is fetched from the argument list, the resource database, or the default values in the resource list.  Then, resources is copied into the subpart record.  If args is NULL, num_args must be zero.  However, if num_args is zero, the argument list is not referenced. 

XtGetSubresources may overwrite the specified resource list with an equivalent representation in an internal format that optimizes access time if the list is used repeatedly.  The resource list must be allocated in writable storage and the caller must not modify the list contents after the call if the same list is to be used again.  Resources fetched by XtGetSubresources are reference counted as if they were referenced by the specified widget.  Subresources might therefore be freed from the conversion cache and destroyed when the widget is destroyed, but not before then. 

With the exception of name and class, the arguments to XtGetSubresources are the same as those for XtGetApplicationResources.  See XtGetApplicationResources for additional details. 

All resource-fetching routines (XtGetSubresources and XtGetApplicationResources) call resource converters if the desired representation differs from the resource the user specifies or from the widget’s default resource value. 

For more information, see Chapter 9, Resource Management and Type Conversion, in Volume Four, X Toolkit Intrinsics Programming Manual. 

Structures

XtResource is defined as follows in <X11/Intrinsic.h>:

typedef struct _XtResource {
String   resource_name;/∗ Resource name ∗/
String   resource_class;/∗ Resource class ∗/
String   resource_type;/∗ Representation type desired ∗/
Cardinal resource_size;/∗ Size in bytes of representation ∗/
Cardinal resource_offset;/∗ Offset from base to put resource value ∗/
String   default_type;/∗ Representation type of specified default ∗/
XtPointer default_addr;/∗ Address of resource default value ∗/
} XtResource, XtResourceList;

An Arg is defined as follows:

typedef struct {
String name;
XtArgVal value;
} Arg, ∗ArgList;

See Also

XtGetApplicationResources(1), XtVaGetSubresources(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026