XmRenderTableAddRenditions(library call) XmRenderTableAddRenditions(library call)
NAME
XmRenderTableAddRenditions -- Creates a new render table
SYNOPSIS
#include <Xm/Xm.h>
XmRenderTable XmRenderTableAddRenditions(
XmRenderTable oldtable,
XmRendition *renditions,
Cardinal rendition_count,
XmMergeMode merge_mode);
DESCRIPTION
XmRenderTableAddRenditions is a function to create a new render table that includes the renditions listed in oldtable, if there is one.
This function also copies specified renditions (renditions) to the new render table. The first rendition_count renditions of the renditions
array are added to the new table. If a rendition is tagged with a tag that matches a tag already in oldtable, then the existing rendition
using that tag is either modified or freed and replaced with the new rendition, depending on the value of merge_mode. If oldtable is NULL,
XmRenderTableAddRenditions creates a new render table containing only the specified renditions.
This function deallocates the original render table after extracting the required information. It is the responsibility of the caller to
free the renditions of the renditions array by calling the XmRenditionFree function.
oldtable Specifies the render table to be added to.
renditions
Specifies an array of renditions to be added.
rendition_count
Specifies the number of renditions from renditions to be added.
merge_mode
Specifies what to do if the XmNtag of a rendition matches that of one that already exists in oldtable. The possible values are as
follows:
XmMERGE_REPLACE
Completely replaces the old rendition with the new one.
XmMERGE_OLD
Replaces any unspecified values of the old rendition with the corresponding values from the new rendition.
XmMERGE_NEW
Replaces the old rendition with the new rendition, replacing any unspecified values of the new rendition with the cor-
responding values from the old rendition.
XmSKIP Skips over the new rendition, leaving the old rendition intact.
RETURN
If renditions is NULL or rendition_count is 0 (zero), this function returns oldtable. Otherwise, the function returns a new XmRenderTable.
The function allocates space to hold this new render table. The application is responsible for managing this allocated space. The appli-
cation can recover the allocated space by calling XmRenderTableFree.
RELATED XmRendition(3) and XmRenderTableFree(3).
XmRenderTableAddRenditions(library call)
Check Out this Related Man Page
XmRenderTable(library call) XmRenderTable(library call)
NAME
XmRenderTable -- Data type for a render table
SYNOPSIS
#include <Xm/Xm.h>
XmRenderTable
DESCRIPTION
XmRenderTable is the data type for a render table, which contains a table of renditions (XmRenditions). Each rendition consists of a set of
attributes for rendering text, including a font or fontset, colors, tabs, and lines. Each rendition is identified with a tag.
When a compound string is displayed, for each segment in the string, the rendition used to render that string is formed as follows. If the
segment has at least one rendition begin tag or if the list of tags formed by accumulating from previous segments the rendition begin tags
and removing the rendition end tags is not empty, these tags are matched with renditions in the render table. The effective rendition used
to render the segment is formed by successively merging each rendition found into the current rendition with non-XmAS_IS (XmUNSPECI-
FIED_PIXEL for color resources) values for resources in the rendition to be merged, thus replacing the corresponding values of the
resources in the current rendition. Finally, if the resulting rendition still has resources with unspecified values and the segment has a
locale or charset tag (these are optional and mutually exclusive) this tag is matched with a rendition in the render table, and the missing
rendition values are filled in from that entry.
If no matching rendition is found for a particular tag, then the XmNnoRenditionCallback of the XmDisplay object is called and the render
table is searched again for that tag.
If the resulting rendition does not specify a font or fontset, then for segments whose text type is XmCHARSET_TEXT, the render table will
be searched for a rendition tagged with XmFONTLIST_DEFAULT_TAG, and if a matching rendition is found, it will be merged into the current
rendition. If the resulting rendition contains no font or fontset, the XmNnoFontCallback will be called with the default rendition and ""
as the font name. If no rendition matches or no font was found after the callback, then the first rendition in the render table will be
merged into the current rendition. If this rendition still has no font, then the segment will not be rendered and a warning will be emit-
ted.
For segments whose text type is XmMULTIBYTE_TEXT or XmWIDECHAR_TEXT, the render table will be searched for a rendition tagged with
_MOTIF_DEFAULT_LOCALE, and, if a matching rendition is found, it will be merged into the current rendition. If the resulting rendition con-
tains no font, the XmNnoFontCallback will be called with the default rendition and "" as the font name. An application can have this call-
back attempt to remedy this problem by calling XmRenditionUpdate on the input rendition to provide a font for the widget to use. This may
be done by either providing an alternative font name to be loaded using the XmNfontName and XmNfontType resources or with an already loaded
font using the XmNfont resource. If no rendition matches or no font was found after the callback, then the segment will not be rendered
and a warning will be issued.
Render tables are specified in resource files with the following syntax:
resource_spec: [ tag [, tag ]* ]
where tag is some string suitable for the XmNtag resource of a rendition.
If no tags are specified, then a render table will be created that is either empty or contains only a rendition with a tag of
_MOTIF_DEFAULT_LOCALE.
Specific values for specific rendition resources are specified using the following syntax:
resource_spec [*|.] rendition[*|.] resource_name: value
where:
resource_spec
Specifies the render table.
rendition Is either the class Rendition or a tag.
resource_name
Is either the class or name of a particular resource.
value Is the specification of the value to be set.
Any resource line that consists of just a resource name or class component with no rendition component or loose binding will be assumed to
specify resource values for a rendition with a tag of _MOTIF_DEFAULT_LOCALE. In effect, this creates a default rendition in much the same
way that specifying no fontlist tag for a fontlist resource causes the fontlist created to contain an entry tagged with
XmFONTLIST_DEFAULT_TAG:
resource_spec.resource_name: value
For example, the following would set the XmNrenderTable resource of label1 to a render table consisting of three renditions tagged with
_MOTIF_DEFAULT_LOCALE, bold, and oblique, with values for resources set as described in the resource specifications.
*label1.renderTable: bold, oblique
*label1.renderTable.bold.renditionForeground: Green
*label1.renderTable.bold.fontName: *-*-*-bold-*-iso8859-1
*label1.renderTable.bold.fontType: FONT_IS_FONT
*label1.renderTable.oblique.renditionBackground: Red
*label1.renderTable.oblique.fontName: *-*-*-italic-*-iso8859-1
*label1.renderTable.oblique.fontType: FONT_IS_FONT
*label1.renderTable.oblique.underlineType: AS_IS
*label1.renderTable.fontName: fixed
*label1.renderTable.fontType: FONT_IS_FONT
*label1.renderTable.renditionForegound: black
*label1.renderTable*tabList: 1in, +1.5in, +3in
RELATED XmRenderTableAddRenditions(3), XmRenderTableCopy(3), XmRenderTableCvtFromProp(3), XmRenderTableCvtToProp(3), XmRenderTableFree(3), XmRen-
derTableGetRendition(3), XmRenderTableGetRenditions(3), XmRenderTableGetTags(3), XmRenderTableRemoveRenditions(3), XmRendition(3), and
XmString(3).
XmRenderTable(library call)