Chapter 6. Resources

This chapter explains how to establish resources for Motif widgets. In particular, this chapter explains how to do the following:

Defining Motif Resources

You define the resources of a Motif widget as you would define resources for any Intrinsics-based widget. Each resource is defined in a seven-field resource record. For example, the ExmString widget defines a resource record for a new XmNalignment resource as follows:

static XtResource resources[] =
{
  {
   XmNalignment,  /* name of resource */
   XmCAlignment,  /* class of resource */
   XmRAlignment,  /* representation type of resource value */
   sizeof(unsigned char),  /* space to hold resource value */
    /* the next field defines the position of the resource within
       the class record */
   XtOffsetOf( ExmStringRec, string.alignment),
   XmRImmediate,  /* kind of default value */
   (XtPointer) XmALIGNMENT_CENTER  /* default value */
   },
}

The third field of each resource record should contain the name of a Motif representation type. We will detail Motif representation types later in this chapter.

Overriding the Default of an Inherited Resource

Overriding the default of an inherited resource is straightforward. The subclass simply needs to redefine the resource. For example, the XmPrimitive widget defines the XmNhighlightThickness resource and sets its default value to 2. However, the ExmString widget needs to change its default value from 2 to 0. Therefore, the resource table of ExmString contains the following code:

static XtResource resources[] =
{
  {
   XmNhighlightThickness,
   XmCHighlightThickness,
   XmRHorizontalDimension,
   sizeof(Dimension),
   XtOffsetOf( XmPrimitiveRec, primitive.highlight_thickness),
   XmRImmediate,
   (XtPointer) 0  /* new default value */
  },
}

Dynamic Resource Defaulting

The sixth field of most resource records is set to XmRImmediate, meaning that the seventh field holds the resource's default value. However, you may wish to have Motif calculate the resource's default value at runtime. In order to do so, you must do the following:

  • Set the sixth field of the resource record to XmRCallProc. The XmRCallProc pointer is the Motif version of the Intrinsics representation type named XtRCallProc. (See the Intrinsics documentation for more information on XtRCallProc.)

  • Set the seventh field of the resource record to the name of a function that will be called at runtime in order to calculate the resource's value.

For example, consider the following definition of the XmNrenderTable resource from the ExmString demonstration widget:

{
      XmNrenderTable,
      XmCRenderTable,
      XmRRenderTable,
      sizeof(XmRenderTable),
      XtOffsetOf( ExmStringRec,string.render_table),
      XtRCallProc,
      (XtPointer) DefaultFont
},

The function specified in the seventh field must take three arguments:

  1. The name of a widget

  2. An integer offset

  3. An XrmValue to hold the returned value of a resource

For example, the DefaultFont function is coded as follows:

static void
DefaultFont (
        Widget w,
        int offset,
        XrmValue *value)
{
 ExmStringWidgetClass wc = (ExmStringWidgetClass)XtClass(w);
 static XmRenderTable  f1;

 /* Find the default render table associated with the default
    render table type. */
  f1 = XmeGetDefaultRenderTable (w,
                                 wc->string_class.default_render_table_type);

   value->addr = (XtPointer)&f1;
   value->size = sizeof(f1);
}

The XmeGetDefaultPixel function is particularly useful for dynamic resource defaulting. This function returns the default background, foreground, top shadow, bottom shadow, or select colors for a given widget. For example, suppose you are creating a widget that displays a graph. Further suppose that your widget defines a new resource called XmNgraphSelectColor, which holds the select color of the new widget. Suppose you want the XmNgraphSelectColor resource to have a default value equal to the default select color of the widget. To do this, you must first define the resource record to take an XmRCallProc as follows:

{
 XmNgraphSelectColor,
 XmCGraphSelectColor,
 XmRPixel,
 sizeof(Pixel),
 XtOffsetOf(MyGraphRec, graph.graph_select_color),
 XmRCallProc,
 (XtPointer) GetDefaultSelectColor
},

Then, you have to write a function that calls XmeGetDefaultPixel; for example:

static void
GetDefaultSelectColor(
      Widget widget,
      int offset,
      XrmValue *value)
{
   XmeGetDefaultPixel (widget, XmSELECT, offset, value);
}

Synthetic Resources

Widget writers can mark certain resources as synthetic resources. A synthetic resource can automatically convert a resource value between two formats: external format and internal format.

Users and applications specify resource values in external format. As a widget designer, you should pick an external format that makes it easy for a user or application to convey information. However, an easy format for a widget user or application programmer may be a cumbersome or inefficient format for the widget writer. Therefore, Motif provides a synthetic resources mechanism. This mechanism automatically converts cumbersome external formats to a more efficient internal format. A well-chosen internal format expedites processing of the data or reduces its storage requirements.

Synthetic resources are the domain of the widget writer. An application programmer or user need never know that synthetic resources exist.

Defining Synthetic Resources

Defining a synthetic resource is a four-step process:

  1. Define the synthetic resource inside the regular resources array.

  2. Define the synthetic resource inside the syn_resources array.

  3. Specify the name of the syn_resources array inside the class record.

  4. Provide the routines that convert values between external and internal formats.

Step 1: Define the Synthetic Resource Inside the Regular resources Array

The first step is to define the resource as you would define any Motif resource, synthetic or not. In other words, you specify a resource record inside the resources array. For example, following is the resource definition of a resource named XmNsomething:

static XtResource resources[] =
{
    ...
    {
        XmNsomething,
        XmCSomething,
        XmRHorizontalDimension,
        sizeof (Dimension),
        XtOffsetOf(WidgetRec, widget.something),
        XmRImmediate,
        (XtPointer)42
    },
    ...
}

Step 2: Define the Synthetic Resource Inside the syn_resources Array

The second step is to generate a synthetic resource array. The base data type of the array is XmSyntheticResource. By convention, you should name the array variable syn_resources. Therefore, the framework of the synthetic resources array definition should appear as follows:

static XmSyntheticResource syn_resources[] =
  {
   /* one or more synthetic resource records */
  }

Each synthetic resource record contains the following five fields:

  • The first field holds the resource name.

  • The second field holds the size of the resource's value.

  • The third field holds the offset of the resource within the class record.

  • The fourth field holds the name of a function that converts from the resource's internal format to the resource's external format. The specified function must be declared as an XmExportProc conversion routine. This function is called when an application calls XtGetValues to get the value of the resource.

  • The fifth field holds the name of a function that converts from the resources's external format to the resource's internal format. The specified function must be declared as an XmImportProc conversion routine. This function is called when the widget is created and when an application calls XtSetValues to modify the value of the resource.

For example, following is a sample synthetic resource definition:

static XmSyntheticResource syn_resources[] =
{
  ...
  {  /* Here is a synthetic resource record. */
   XmNsomething,
   sizeof (ResourceDatatype),
   XtOffsetOf(WidgetRec, widget.something),
   FromInternalToExternalFormat,
   FromExternalToInternalFormat
  }, /* End of synthetic resource record. */
  ...
};

You can set either the fourth or fifth field to NULL. Doing so tells Motif that you will not be supplying part of the conversion process. For example, if the fourth field is set to NULL, then this widget is not supplying a function to convert the resource value from internal format to external format. If the fourth field is NULL, a call to XtGetValues returns the resource's value in internal format.

Step 3: Specify the syn_resources Array Inside the Class Record

You must specify the name of the synthetic resource array in the appropriate portion of the class record. You must also specify the number of synthetic resources. For example:

/* syn_resources */              syn_resources,
/* num_syn_resources */          XtNumber(syn_resources),

Step 4: Provide the Conversion Routines

The final step is to provide the synthetic resource conversion routines themselves. In some cases, you can use one of Motif's existing routines (such as, XmeFromHorizontalPixels). In other cases, you will have to write the synthetic resource conversion routines yourself. There are two kinds of conversion routines you can write:

  • XmExportProc conversion routines, which convert a resource value from internal format to external format

  • XmImportProc conversion routines, which convert a resource value from external format to internal format

An XmExportProc conversion routine has the following prototype:

void MyExportProcConversionRoutine(
        Widget     wid,
        int           offset,
           XtArgVal     *value)


wid 

Specifies the widget which is requesting a synthetic resource conversion.

offset 

Specifies the offset of a synthetic resource field in the widget record.

value 

Specifies a pointer to a resource value in internal format and returns a pointer to that resource value converted to external format.

An XmImportProc conversion routine has the following prototype:

XmImportOperator MyImportProcConversionRoutine(
   Widget        wid,
           int      offset,
           XtArgVal      *value)


wid 

Specifies the widget which is requesting a synthetic resource conversion.

offset 

Specifies the offset of a synthetic resource field in the widget record.

value 

Specifies a pointer to a resource value in external format. If the XmImportProc conversion routine returns XmSYNTHETIC_LOAD, then value must return the input resource value converted to internal format.

An XmImportProc conversion routine must return an XmImportOperator value, which is an enumerated type having the following possible values:

  • XmSYNTHETIC_NONE, which means that the caller of the XmImportProc is not responsible for copying the converted value into the resource specified by offset.

  • XmSYNTHETIC_LOAD, which means that the caller of the XmImportProc is responsible for copying the converted value into the resource specified by offset.

Motif's synthetic resource mechanism is typically the caller of the XmImportProc. Therefore, if your XmImportProc conversion routine returns XmSYTHETIC_LOAD, Motif synthetic resource mechanism will take care of copying (and casting) value into the resource specified by offset.

Distance Conversions

The synthetic resource implementation is particularly helpful for converting resource values from real-world units (like millimeters) to pixels and back again.

The Xlib and Xme drawing routines all expect pixel arguments. Unfortunately, pixels are not always a very handy unit for widget users to work in. One important problem with pixel units is that a pixel's size depends on the resolution of the screen.

To solve this problem the Motif base classes XmPrimitive and XmManager both provide the XmNunitType resource. This resource holds the kind of units that a given distance or position is measured in. By default, the unit type is pixels. However, the application may specify a unit type of some real-world unit, like millimeters, instead. Any resource whose value symbolizes a size, position, or distance must be able to convert these real-world units to and from pixels.

The synthetic resource mechanism provides a way to do these conversions. In fact, you do not even have to write conversion routines because Motif provides four unit conversion routines for you:

  • XmeFromHorizontalPixels and XmeFromVerticalPixels convert values from any unit type named by the XmNunitType resource to pixels.

  • XmeToHorizontalPixels and XmeToVerticalPixels convert values from pixels to the unit type named by the XmNunitType resource.

For example, the ExmSimple widget uses all four of these routines in its syn_resources array as follows:

static XmSyntheticResource syn_resources[] =
{
    {
         XmNmarginWidth,
               sizeof (Dimension),
               XtOffsetOf( ExmSimpleRec, simple.margin_width),
               XmeFromHorizontalPixels,
               XmeToHorizontalPixels
    },
    {
               XmNmarginHeight,
               sizeof (Dimension),
         XtOffsetOf( ExmSimpleRec, simple.margin_height),
         XmeFromVerticalPixels,
               XmeToVerticalPixels
    },
};

How the Synthetic Resource Mechanism Works

The synthetic resource mechanism is completely transparent to the widget writer. This is because the Motif base classes, XmPrimitive and XmManager, call the appropriate conversion routines at the appropriate times.

For example, the class_part_initialize method of XmPrimitive and XmManager both contain code that initializes the synthetic resource. In other words, both base classes call the routine that converts all the synthetic resource values from external to internal format Similarly, both base classes contain code in their set_values routines to call the external to internal format conversion routine whenever one of the resource values is changed. Finally, both base classes contain code in their get_values_hook routines to call the internal-to-external format conversion routine whenever an application requests the resource value.

Since the class_part_initialize, set_values, and get_values_hook methods are all chained, these conversion routines are automatically called for all primitive and manager widgets.

Representation Types

The third field of every Motif resource record holds the name of a Motif representation type. Motif representation types, like Xt representation types, know how to convert resource values into a different C language representation. Motif associates all its representation types with converters that convert data from one C data type (for example, a String) to another (for example, an int).

Motif representation types have the XmR prefix.

You should become familiar with the predefined Motif representation types. You should also know how to create your representation types when conditions warrant.

Enumerated Representation Types

Suppose you are writing a widget that defines an enumerated resource. In other words, the resource requires an enumerated constant as a value. In picking the representation type, you can do either of the following:

  • Pick a predefined representation type

  • Register (create) a new representation type

The following subsections examine both categories.

Predefined Enumerated Representation Types

If you are defining a new enumerated resource that serves a similar purpose to an existing Motif enumerated resource, then you should probably pick an existing Motif enumerated representation type rather than creating your own. Motif predefines the following enumerated representation types:

  • XmRArrowDirection defines the following registered constants: XmARROW_UP, XmARROW_DOWN,XmARROW_LEFT, and XmARROW_RIGHT. For information on these constants, see the description of XmNarrowDirection in XmArrowButton(3).

  • XmRAlignment defines the following registered constants: XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, and XmALIGNMENT_END. For information on these constants, see the description of XmNalignment in XmLabel(3).

  • XmRDirection defines the following registered constants: XmRIGHT_TO_LEFT_TOP_TO_BOTTOM, XmLEFT_TO_RIGHT_TOP_TO_BOTTOM, XmRIGHT_TO_LEFT_BOTTOM_TO_TOP, XmLEFT_TO_RIGHT_BOTTOM_TO_TOP, XmTOP_TO_BOTTOM_RIGHT_TO_LEFT, XmTOP_TO_BOTTOM_LEFT_TO_RIGHT, XmBOTTOM_TO_TOP_RIGHT_TO_LEFT, and XmBOTTOM_TO_TOP_LEFT_TO_RIGHT. For information on these constants, see the description of XmRDirection in XmLabel(3)

  • XmRIndicatorType defines the following registered constants: XmINDICATOR_NONE, XmINDICATOR_FILL, Xm_INDICATOR_BOX, XmINDICATOR_CHECK, XmINDICATOR_CHECK_BOX, XmINDICATOR_CROSS, and XmINDICATOR_CROSS_BOX. For information on these constants, see the description of XmRIndicator in XmToggleButton(3).

  • XmRMultiClick defines the following registered constants: XmMULTICLICK_KEEP and XmMULTICLICK_DISCARD. For information on these constants, see the description of XmPushButton in XmNmultiClick(3)

  • XmRNavigationType defines the following registered constants: XmNONE, XmTAB_GROUP, XmSTICKY_TAB_GROUP, and XmEXCLUSIVE_TAB_GROUP. For information on these constants, see the description of XmNnavigationType in XmPrimitive(3) or XmManager(3).

  • XmROrientation defines the following registered constants: XmVERTICAL and XmHORIZONTAL. For information on these constants, see the description of XmNorientation in XmScrollBar(3).

  • XmRSelectionMode defines the following registered constants: XmNORMAL_MODE and XmADD_MODE. For information on these constants, see the description of XmNselectionMode in XmList(3).

  • XmRSeparatorType defines the following registered constants: XmSINGLE_LINE, XmDOUBLE_LINE, XmSINGLE_DASHED_LINE, XmDOUBLE_DASHED_LINE, XmNO_LINE XmSHADOW_ETCHED_IN, XmSHADOW_ETCHED_OUT, XmSHADOW_ETCHED_IN_DASH, and XmSHADOW_ETCHED_OUT_DASH. For information on these constants, see the description of XmNseparatorType in XmSeparator(3).

  • XmRShadowType defines the following registered constants: XmSHADOW_IN, XmSHADOW_OUT, XmSHADOW_ETCHED_IN and XmSHADOW_ETCHED_OUT. For information on these constants, see the description of XmNshadowType in XmFrame(3).

  • XmRUnitType defines the following registered constants: XmPIXELS, Xm100TH_MILLIMETERS, Xm1000TH_INCHES, Xm100TH_POINTS, Xm100TH_FONT_UNITS, XmINCHES, XmCENTIMETERS, XmMILLIMETERS, XmPOINTS, and XmFONT_UNITS. For information on these constants, see the description of XmNunitType in XmPrimitive(3)or XmManager(3).

  • XmRVisualEmphasis defines the following registed constants: XmSELECTED and XmNOT_SELECTED. For information on these constants, see the description of XmNvisualEmphasis in XmIconGadeget(3).

For example, the previous list shows that Motif predefines the representation type XmRAlignment. The only legal values that can be assigned to a resource having this representation type are XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, and XmALIGNMENT_END. For details on what these three constants symbolize, see the description of the XmNalignment resource in the XmLabel reference page. This reference page appears in the Motif Programmer's Reference. When defining a resource with similar requirements to XmNalignment, you should specify a representation type of XmRAlignment. For example, the ExmString widget defines a resource named XmNalignment that controls the alignment of text within the widget. The wise choice for the data type of XmNalignment is XmRAlignment, as shown in the following resource record:

...
{
 XmNalignment,
 XmCAlignment,
 XmRAlignment,
 sizeof(unsigned char),
 XtOffsetOf( ExmStringRec,string.alignment),
 XmRImmediate,
 (XtPointer) XmALIGNMENT_CENTER
},
...

One of the primary responsibilities of a widget is to check for valid resource values. Using predefined representation types simplifies this chore by turning it into an easy two-step process:

  1. Call the XmRepTypeGetId function to get the identification number of the representation type.

  2. Call the XmRepTypeValidValue function to check the validity of the resource's value.

For example, the class_initialize method of the ExmString widget gets the identification number with the following code:

static XmRepTypeId alignmentId;
  alignmentId = XmRepTypeGetId(XmRAlignment);

The initialize and set_values methods of the ExmString widget check resource values as follows:

Boolean   ValidValue;
  ValidValue = XmRepTypeValidValue(alignmentId,
                                    my_widget->string.alignment,
                                    my_widget);
  if (!ValidValue)
    /* take appropriate corrective response */

Defining Your Own Enumerated Representation Types

If none of the predefined representation types match the needs of your resource, then you can create a new representation type. Registering a new representation type is a five-step process:

  1. In the widget source code file, you must declare an array variable to hold the normalized names of the possible values of the resource.

  2. In the widget source code file, you must declare a global variable of type XmRepTypeId.

  3. In the widget source code file (probably in the class_initialize or class_part_initialize method), you must call the XmRepTypeRegister routine.

  4. In the widget public header file, you must define a string equivalent for the new representation type.

  5. In the widget public header file, you must specify enumerated constants for the possible values of the new representation type.

For example, the ExmSimple widget defines a representation type named ExmRSimpleShape. The following is the declaration of the array variable (Step 1):

static String SimpleShapeNames[] = {
        "simple_oval",
        "simple_rectangle"
};

And following is the declaration of the XmRepTypeId variable (Step 2):

static XmRepTypeId simpleShapeId;

The class_initialize method calls XmRepTypeRegister as follows (Step 3):

simpleShapeId = XmRepTypeRegister (ExmRSimpleShape, SimpleShapeNames,
                                   NULL, XtNumber(SimpleShapeNames));

Notice how the array variable created in Step 1 is passed as an argument to XmRepTypeRegister. Furthermore, note that the XmRepTypeId variable is assigned the return value.

The public header file declares a string equivalent of the new representation type as follows (Step 4):

#define ExmRSimpleShape "ExmSimpleShape"

The public header file also specifies the appropriate enumerated constants (Step 5):

enum { ExmSHAPE_OVAL=0, ExmSHAPE_RECTANGLE=1 };

The Size of Enumerated Representation Types

The fourth field of all resource records holds the size of the resource value. If the resource has an enumerated representation type, then the fourth field should be set as follows:

sizeof(unsigned char)

Nonenumerated Representation Types

Representation types are also useful for defining nonenumerated resource values. Table 6-1 lists all the useful nonenumerated Motif representation types and their C data type equivalents.

Table 6-1. Common Nonenumerated Representation Types

Motif Representation TypeConverts to C Data Type
XmRHorizontalDimensionDimension
XmRHorizontalPositionPosition
XmRVerticalDimensionDimension
XmRVerticalPositionPosition
XmRBitmapPixmap
XmRPixmapPixmap
XmRDynamicPixmapPixmap
XmRRenderTableXmRenderTable
XmRXmStringXmString
XmRXmStringTableXmString *
XmRTabListXmTabList
XmRValueWcswchar_t *

The fourth field of each resource record specifies the size required to store the resource's value. The second column of Table 6-2 will help you determine this size. For example, the ExmString widget defines a resource record for the XmNrenderTable resource.This resource defines a representation type of XmRRenderTable. According to the table, the C data type associated with this representation type is XmRenderTable. Therefore, the resource record specifies the size of the resource's value as follows:

{
        XmNrenderTable,
        XmCRenderTable,
        XmRRenderTable,
        sizeof(XmRenderTable),  /* size of the resource */
        XtOffsetOf( ExmStringRec,string.render_table),
        XtRCallProc,
        (XtPointer) DefaultFont
},

Pixmap Converter for Scaling

To support the automatic scaling of Pixmaps, the following representation types are available:

  • XmRNoScalingBitmap

  • XmRNoScalingDynamicPixmap

The converters for these representation types ignore the scaling ratio that might be present in their print shell hierarchy and behave normally; that is, they convert XBM and XPM files to Pixmap. These are used when Pixmap is employed for tiling, rather than when it is used for images and icons.

The semantics of the XmRBitmap and XmRDynamic representation type converters apply a scaling ratio to the resulting Pixmap that is equal to the print shell resolution divided by the value of the XmNdefaultPixmapResolution of their XmPrintShell. No scaling is applied if the widget for which a Pixmap resource is being converted is not a descendant of XmPrintShell. See Chapter 16 for more information on XmPrintShell.

Dimensions and Positions Representation Types

Resources whose values symbolize dimensions or positions should use the following representation types:

  • XmRHorizontalDimension, which converts a horizontal dimension to a Dimension.

  • XmRHorizontalPosition, which converts a horizontal position to a Position.

  • XmRVerticalDimension, which converts a vertical dimension to a Dimension.

  • XmRVerticalPosition, which converts a vertical position to a Position.

For example, the ExmSimple widget associates the XmRHorizontalDimension representation type with the XmNmarginWidth resource. Similarly, the XNmarginHeight resource is associated with the XmRVerticalDimension representation type. The unit type conversion functions (XmeFromHorizontalPixels, XmeFromVerticalPixels, XmeToHorizontalPixels, and XmeToVerticalPixels) depend on these representation types.

Bitmap and Pixmap Representation Types

Motif provides the following three representation types for converting bitmaps and pixmaps.

  • XmRBitmap, which converts an input xbm file to a Pixmap of depth 1.

  • XmRPixmap, which converts an input xbm or xpm file to a Pixmap with the same depth as the widget's visual.

  • XmRDynamicPixmap, which depends on the value of the XmNbitmapConversionModel resource of XmScreen. If this resource's value is XmMATCH_DEPTH, XmRDynamicPixmap converts an input xbm or xpm file to a Pixmap of appropirate depth for the widget. If this resource's value is XmDYNAMIC_DEPTH, XmRDynamicPixmap converts an input xbm file to a Pixmap of depth 1 and an input xpm file to a Pixmap the same depth as the widget.

Motif Representation Types in XmPrimitive and XmManager

Tables 6-2 and 6-3 describe the representation types used by the resources of XmPrimitive and XmManager.

Table 6-2. Representation Types for the Resources of XmPrimitive

ResourceRepresentation Type
XmNbottomShadowColorXmRPixel (synonym for XtRPixel)
XmNbottomShadowPixmapXmRNoScalingDynamicPixmap
XmNconvertCallbackXmRCallProc (synonym for XtRCallProc)
XmNforegroundXmRPixel (synonym for XtRPixel)
XmNhelpCallbackXmRCallProc (synonym for XtRCallProc)
XmNhighlightColorXmRPixel (synonym for XtRPixel)
XmNhighlightOnEnterXmRBoolean (synonym for XtRBoolean)
XmNhighlightPixmapXmRNoScalingDynamicPixmap
XmNhighlightThicknessXmRHorizontalDimension
XmNnavigationTypeXmRNavigationType
XmNpopupHandlerCallbackXmRCallProc (synonym for XtRCallProc)
XmNshadowThicknessXmRHorizontalDimension
XmNtopShadowColorXmRPixel (synonym for XtRPixel)
XmNtopShadowPixmapXmRNoScalingDynamicPixmap
XmNtraversalOnXmRBoolean (synonym for XtRBoolean)
XmNunitTypeXmRUnitType
XmNuserDataXmRPointer (synonym for XtRPointer)

Table 6-3. Representation Types for the Resources of XmManager

ResourceRepresentation Type
XmNbottomShadowColorXmRPixel
XmNbottomShadowPixmapXmRNoScalingDynamicPixmap
XmNforegroundXmRPixel
XmNhelpCallbackXmRCallback
XmNhighlightColorXmRPixel
XmNhighlightPixmapXmRNoScalingDynamicPixmap
XmNinitialFocusXmRWidget
XmNlayoutDirectionXmRDirection
XmNnavigationTypeXmRNavigationType
XmNpopupHandlerCallbackXmRCallback
XmNshadowThicknessXmRHorizontalDimension
XmNstringDirectionXmRStringDirection
XmNtopShadowColorXmRPixel
XmNtopShadowPixmapXmRNoScalingDynamicPixmap
XmNtraversalOnXmRBoolean
XmNunitTypeXmRUnitType
XmNuserDataXmRPointer

XmPrimitive and XmManager both provide representation types for the same seven resources of Core. Table 6-4 summarizes these representation types.

Table 6-4. Representation Types for Core Resources

ResourceRepresentation Type
XmNbackgroundPixelXmRPixel (synonym for XtRPixel)
XmNbackgroundPixmapXmRPixmap
XmNborderWidthXmRHorizontalDimension
XmNheightXmRVerticalDimension
XmNwidthXmRHorizontalDimension
XmNxXmRHorizontalPosition
XmNyXmRVerticalPosition