Keywords: LessTif

Next: 2. The BaseClass Extension Up: 2. The Method Hooks Previous: 2. The Method Hooks Contents Index

## 1. The Wrapper Data Stacks

XmWrapperDataRecThe wrapper data stack plays an important role for the hook mechanism. For example, the prehook wrapper for initialize() etc. must keep the old pointer to the leaf method of the method-chain when it hooks in the posthook method instead. The old pointer is stored in a XmWrapperDataRec structure (figure ). These wrapper data records are linked so that they form a stack for every single widget class. The head of the stack is accessible through a base class extension record. For the moment, I'll skip the base class extension record and come back to it in the next section.

Figure: The wrapper data stack keeps saved method pointers for a widget class.

The layout of a XmWrapperDataRec structure is as follows:

    typedef struct _XmWrapperDataRec
    {
        struct _XmWrapperDataRec *next;
        WidgetClass              widgetClass;
        XtInitProc               initializeLeaf;
        XtSetValuesFunc          setValuesLeaf;
        XtArgsProc               getValuesLeaf;
        XtRealizeProc            realize;
        XtWidgetClassProc        classPartInitLeaf;
        XtWidgetProc             resize;
        XtGeometryHandler        geometry_manager;
    } XmWrapperDataRec, *XmWrapperData;

Now for a description of such a wrapper data record:

Please note that the functions which work on wrapper data do not appear in any official header file (and thus not even in BaseClassP.h) and aren't accessible from the outside. This is true at least for M*TIF but unfortunately LESSTIF doesn't declare the wrapper functions static, so they are accessible. Despite this their use is strongly discouraged. I only talk about them here so you can understand their task within the BaseClass stuff. In M*TIF 2.0 the wrapper functions have lost their _Xm prefix to reflect their private state.

Next: 2. The BaseClass Extension Up: 2. The Method Hooks Previous: 2. The Method Hooks Contents Index