From aab9b50bb755d741ee54203f91bdfc464a95642f Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 14 Apr 2019 18:45:06 -0400 Subject: use programlisting tag rather than workaround for literallayout font. Signed-off-by: Thomas E. Dickey --- specs/CH01.xml | 890 ++++++++++++++++++++++++++++----------------------------- specs/CH02.xml | 200 ++++++------- specs/CH03.xml | 34 +-- specs/CH04.xml | 622 ++++++++++++++++++++-------------------- specs/CH05.xml | 24 +- specs/CH06.xml | 38 +-- specs/CH07.xml | 80 +++--- specs/CH08.xml | 26 +- specs/CH09.xml | 254 ++++++++-------- specs/CH10.xml | 50 ++-- specs/CH11.xml | 160 +++++------ specs/CH12.xml | 294 +++++++++---------- specs/CH13.xml | 14 +- specs/appB.xml | 108 +++---- specs/appC.xml | 8 +- 15 files changed, 1401 insertions(+), 1401 deletions(-) (limited to 'specs') diff --git a/specs/CH01.xml b/specs/CH01.xml index b20226e..1d880cf 100644 --- a/specs/CH01.xml +++ b/specs/CH01.xml @@ -218,42 +218,42 @@ All widget classes contain the fields defined in the CoreClassPart structure. - -typedef struct { - WidgetClass superclass; See - String class_name; See - Cardinal widget_size; See - XtProc class_initialize; See - XtWidgetClassProc class_part_initialize; See - XtEnum class_inited; See - XtInitProc initialize; See - XtArgsProc initialize_hook; See - XtRealizeProc realize; See - XtActionList actions; See - Cardinal num_actions; See - XtResourceList resources; See - Cardinal num_resources; See - XrmClass xrm_class; Private to resource manager - Boolean compress_motion; See - XtEnum compress_exposure; See - Boolean compress_enterleave; See - Boolean visible_interest; See - XtWidgetProc destroy; See - XtWidgetProc resize; See - XtExposeProc expose; See - XtSetValuesFunc set_values; See - XtArgsFunc set_values_hook; See - XtAlmostProc set_values_almost; See - XtArgsProc get_values_hook; See - XtAcceptFocusProc accept_focus; See - XtVersionType version; See - XtPointer callback_private; Private to callbacks - String tm_table; See - XtGeometryHandler query_geometry; See - XtStringProc display_accelerator; See - XtPointer extension; See -} CoreClassPart; - + +typedef struct { + WidgetClass superclass; See + String class_name; See + Cardinal widget_size; See + XtProc class_initialize; See + XtWidgetClassProc class_part_initialize; See + XtEnum class_inited; See + XtInitProc initialize; See + XtArgsProc initialize_hook; See + XtRealizeProc realize; See + XtActionList actions; See + Cardinal num_actions; See + XtResourceList resources; See + Cardinal num_resources; See + XrmClass xrm_class; Private to resource manager + Boolean compress_motion; See + XtEnum compress_exposure; See + Boolean compress_enterleave; See + Boolean visible_interest; See + XtWidgetProc destroy; See + XtWidgetProc resize; See + XtExposeProc expose; See + XtSetValuesFunc set_values; See + XtArgsFunc set_values_hook; See + XtAlmostProc set_values_almost; See + XtArgsProc get_values_hook; See + XtAcceptFocusProc accept_focus; See + XtVersionType version; See + XtPointer callback_private; Private to callbacks + String tm_table; See + XtGeometryHandler query_geometry; See + XtStringProc display_accelerator; See + XtPointer extension; See +} CoreClassPart; + All widget classes have the Core class fields as their first component. The prototypical @@ -262,11 +262,11 @@ and CoreWidgetClass are defined with only this set of fields. - -typedef struct { - CoreClassPart core_class; -} WidgetClassRec, *WidgetClass, CoreClassRec, *CoreWidgetClass; - + +typedef struct { + CoreClassPart core_class; +} WidgetClassRec, *WidgetClass, CoreClassRec, *CoreWidgetClass; + Various routines can cast widget class pointers, as needed, to specific widget class types. @@ -281,17 +281,17 @@ creating instances of Core are In IntrinsicP.h: - -extern WidgetClassRec widgetClassRec; -#define coreClassRec widgetClassRec - + +extern WidgetClassRec widgetClassRec; +#define coreClassRec widgetClassRec + In Intrinsic.h: - -extern WidgetClass widgetClass, coreWidgetClass; - + +extern WidgetClass widgetClass, coreWidgetClass; + The opaque types Widget @@ -305,9 +305,9 @@ does not allow applications to access private data, the Intrinsics use incomplete structure definitions in Intrinsic.h: - -typedef struct _WidgetClassRec *WidgetClass, *CoreWidgetClass; - + +typedef struct _WidgetClassRec *WidgetClass, *CoreWidgetClass; + CorePart Structure @@ -316,49 +316,49 @@ All widget instances contain the fields defined in the CorePart structure. - -typedef struct _CorePart { - Widget self; Described below - WidgetClass widget_class; See - Widget parent; See - Boolean being_destroyed; See - XtCallbackList destroy_callbacks; - XtPointer constraints; See - Position x; See - Position y; See - Dimension width; See - Dimension height; See - Dimension border_width; See - Boolean managed; See - Boolean sensitive; See - Boolean ancestor_sensitive; See - XtTranslations accelerators; See - Pixel border_pixel; See - Pixmap border_pixmap; See - WidgetList popup_list; See - Cardinal num_popups; See - String name; See - Screen *screen; See - Colormap colormap; See - Window window; See - Cardinal depth; See - Pixel background_pixel; See - Pixmap background_pixmap; See - Boolean visible; See - Boolean mapped_when_managed; See -} CorePart; - + +typedef struct _CorePart { + Widget self; Described below + WidgetClass widget_class; See + Widget parent; See + Boolean being_destroyed; See + XtCallbackList destroy_callbacks; + XtPointer constraints; See + Position x; See + Position y; See + Dimension width; See + Dimension height; See + Dimension border_width; See + Boolean managed; See + Boolean sensitive; See + Boolean ancestor_sensitive; See + XtTranslations accelerators; See + Pixel border_pixel; See + Pixmap border_pixmap; See + WidgetList popup_list; See + Cardinal num_popups; See + String name; See + Screen *screen; See + Colormap colormap; See + Window window; See + Cardinal depth; See + Pixel background_pixel; See + Pixmap background_pixmap; See + Boolean visible; See + Boolean mapped_when_managed; See +} CorePart; + All widget instances have the Core fields as their first component. The prototypical type Widget is defined with only this set of fields. - -typedef struct { - CorePart core; -} WidgetRec, *Widget, CoreRec, *CoreWidget; - + +typedef struct { + CorePart core; +} WidgetRec, *Widget, CoreRec, *CoreWidget; + Various routines can cast widget pointers, as needed, to specific widget types. @@ -370,9 +370,9 @@ does not allow applications to access private data, the Intrinsics use incomplete structure definitions in Intrinsic.h. - -typedef struct _WidgetRec *Widget, *CoreWidget; - + +typedef struct _WidgetRec *Widget, *CoreWidget; + Core Resources @@ -631,15 +631,15 @@ Core class fields, widgets of the Composite class have the following class fields. - -typedef struct { - XtGeometryHandler geometry_manager; See - XtWidgetProc change_managed; See - XtWidgetProc insert_child; See - XtWidgetProc delete_child; See - XtPointer extension; See -} CompositeClassPart; - + +typedef struct { + XtGeometryHandler geometry_manager; See + XtWidgetProc change_managed; See + XtWidgetProc insert_child; See + XtWidgetProc delete_child; See + XtPointer extension; See +} CompositeClassPart; + The extension record defined for CompositeClassPart @@ -649,27 +649,27 @@ equal to is CompositeClassExtensionRec. - -typedef struct { - XtPointer next_extension; See - XrmQuark record_type; See - long version; See - Cardinal record_size; See - Boolean accepts_objects; See - Boolean allows_change_managed_set; See -} CompositeClassExtensionRec, *CompositeClassExtension; - + +typedef struct { + XtPointer next_extension; See + XrmQuark record_type; See + long version; See + Cardinal record_size; See + Boolean accepts_objects; See + Boolean allows_change_managed_set; See +} CompositeClassExtensionRec, *CompositeClassExtension; + Composite classes have the Composite class fields immediately following the Core class fields. - -typedef struct { - CoreClassPart core_class; - CompositeClassPart composite_class; -} CompositeClassRec, *CompositeWidgetClass; - + +typedef struct { + CoreClassPart core_class; + CompositeClassPart composite_class; +} CompositeClassRec, *CompositeWidgetClass; + The single occurrences of the class record and pointer for creating instances of Composite are @@ -679,16 +679,16 @@ instances of Composite are In IntrinsicP.h: - -extern CompositeClassRec compositeClassRec; - + +extern CompositeClassRec compositeClassRec; + In Intrinsic.h: - -extern WidgetClass compositeWidgetClass; - + +extern WidgetClass compositeWidgetClass; + The opaque types CompositeWidget @@ -708,9 +708,9 @@ uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. - -typedef struct _CompositeClassRec *CompositeWidgetClass; - + +typedef struct _CompositeClassRec *CompositeWidgetClass; + CompositePart Structure @@ -723,33 +723,33 @@ instance fields defined in the CompositePart structure. - -typedef struct { - WidgetList children; See - Cardinal num_children; See - Cardinal num_slots; See - XtOrderProc insert_position; See -} CompositePart; - + +typedef struct { + WidgetList children; See + Cardinal num_children; See + Cardinal num_slots; See + XtOrderProc insert_position; See +} CompositePart; + Composite widgets have the Composite instance fields immediately following the Core instance fields. - -typedef struct { - CorePart core; - CompositePart composite; -} CompositeRec, *CompositeWidget; - + +typedef struct { + CorePart core; + CompositePart composite; +} CompositeRec, *CompositeWidget; + Intrinsic.h uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. - -typedef struct _CompositeRec *CompositeWidget; - + +typedef struct _CompositeRec *CompositeWidget; + Composite Resources @@ -877,17 +877,17 @@ class fields, widgets of the Constraint class have the following class fields. - -typedef struct { - XtResourceList resources; See - Cardinal num_resources; See - Cardinal constraint_size; See - XtInitProc initialize; See - XtWidgetProc destroy; See - XtSetValuesFunc set_values; See - XtPointer extension; See -} ConstraintClassPart; - + +typedef struct { + XtResourceList resources; See + Cardinal num_resources; See + Cardinal constraint_size; See + XtInitProc initialize; See + XtWidgetProc destroy; See + XtSetValuesFunc set_values; See + XtPointer extension; See +} ConstraintClassPart; + The extension record defined for ConstraintClassPart @@ -896,27 +896,27 @@ with record_type equal to is ConstraintClassExtensionRec. - -typedef struct { - XtPointer next_extension; See - XrmQuark record_type; See - long version; See - Cardinal record_size; See - XtArgsProc get_values_hook; See -} ConstraintClassExtensionRec, *ConstraintClassExtension; - + +typedef struct { + XtPointer next_extension; See + XrmQuark record_type; See + long version; See + Cardinal record_size; See + XtArgsProc get_values_hook; See +} ConstraintClassExtensionRec, *ConstraintClassExtension; + Constraint classes have the Constraint class fields immediately following the Composite class fields. - -typedef struct _ConstraintClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ConstraintClassPart constraint_class; -} ConstraintClassRec, *ConstraintWidgetClass; - + +typedef struct _ConstraintClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ConstraintClassPart constraint_class; +} ConstraintClassRec, *ConstraintWidgetClass; + The single occurrences of the class record and pointer for creating instances of Constraint are @@ -926,16 +926,16 @@ instances of Constraint are In IntrinsicP.h: - -extern ConstraintClassRec constraintClassRec; - + +extern ConstraintClassRec constraintClassRec; + In Intrinsic.h: - -extern WidgetClass constraintWidgetClass; - + +extern WidgetClass constraintWidgetClass; + The opaque types ConstraintWidget @@ -955,9 +955,9 @@ version identifier is uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. - -typedef struct _ConstraintClassRec *ConstraintWidgetClass; - + +typedef struct _ConstraintClassRec *ConstraintWidgetClass; + ConstraintPart Structure @@ -972,31 +972,31 @@ instance fields defined in the ConstraintPart structure - -typedef struct { - int empty; -} ConstraintPart; - + +typedef struct { + int empty; +} ConstraintPart; + Constraint widgets have the Constraint instance fields immediately following the Composite instance fields. - -typedef struct { - CorePart core; - CompositePart composite; - ConstraintPart constraint; -} ConstraintRec, *ConstraintWidget; - + +typedef struct { + CorePart core; + CompositePart composite; + ConstraintPart constraint; +} ConstraintRec, *ConstraintWidget; + Intrinsic.h uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. - -typedef struct _ConstraintRec *ConstraintWidget; - + +typedef struct _ConstraintRec *ConstraintWidget; + Constraint Resources @@ -1418,30 +1418,30 @@ Entry points for new class methods. For example, the following is the public .h file for a possible implementation of a Label widget: - -#ifndef LABEL_H -#define LABEL_H + +#ifndef LABEL_H +#define LABEL_H -/* New resources */ -#define XtNjustify "justify" -#define XtNforeground "foreground" -#define XtNlabel "label" -#define XtNfont "font" -#define XtNinternalWidth "internalWidth" -#define XtNinternalHeight "internalHeight" +/* New resources */ +#define XtNjustify "justify" +#define XtNforeground "foreground" +#define XtNlabel "label" +#define XtNfont "font" +#define XtNinternalWidth "internalWidth" +#define XtNinternalHeight "internalHeight" -/* Class record pointer */ -extern WidgetClass labelWidgetClass; +/* Class record pointer */ +extern WidgetClass labelWidgetClass; -/* C Widget type definition */ -typedef struct _LabelRec *LabelWidget; +/* C Widget type definition */ +typedef struct _LabelRec *LabelWidget; -/* New class method entry points */ -extern void LabelSetText(Widget w, String text); -extern String LabelGetText(Widget w); +/* New class method entry points */ +extern void LabelSetText(Widget w, String text); +extern String LabelGetText(Widget w); -#endif LABEL_H - +#endif LABEL_H + The conditional inclusion of the text allows the application to include header files for different widgets without being concerned @@ -1557,67 +1557,67 @@ An inherit constant for each new procedure in the widget class part structure. For example, the following is the private .h file for a possible Label widget: - -#ifndef LABELP_H -#define LABELP_H - -#include <X11/Label.h> - -/* New representation types used by the Label widget */ -#define XtRJustify "Justify" - -/* New fields for the Label widget record */ -typedef struct { -/* Settable resources */ - Pixel foreground; - XFontStruct *font; - String label; /* text to display */ - XtJustify justify; - Dimension internal_width; /* # pixels horizontal border */ - Dimension internal_height; /* # pixels vertical border */ -/* Data derived from resources */ - GC normal_GC; - GC gray_GC; - Pixmap gray_pixmap; - Position label_x; - Position label_y; - Dimension label_width; - Dimension label_height; - Cardinal label_len; - Boolean display_sensitive; -} LabelPart; - -/* Full instance record declaration */ -typedef struct _LabelRec { - CorePart core; - LabelPart label; -} LabelRec; - -/* Types for Label class methods */ -typedef void (*LabelSetTextProc)(Widget w, String text); -typedef String (*LabelGetTextProc)(Widget w); - -/* New fields for the Label widget class record */ -typedef struct { - LabelSetTextProc set_text; - LabelGetTextProc get_text; - XtPointer extension; -} LabelClassPart; - -/* Full class record declaration */ -typedef struct _LabelClassRec { - CoreClassPart core_class; - LabelClassPart label_class; -} LabelClassRec; - -/* Class record variable */ -extern LabelClassRec labelClassRec; - -#define LabelInheritSetText((LabelSetTextProc)_XtInherit) -#define LabelInheritGetText((LabelGetTextProc)_XtInherit) - -#endif LABELP_H - + +#ifndef LABELP_H +#define LABELP_H + +#include <X11/Label.h> + +/* New representation types used by the Label widget */ +#define XtRJustify "Justify" + +/* New fields for the Label widget record */ +typedef struct { +/* Settable resources */ + Pixel foreground; + XFontStruct *font; + String label; /* text to display */ + XtJustify justify; + Dimension internal_width; /* # pixels horizontal border */ + Dimension internal_height; /* # pixels vertical border */ +/* Data derived from resources */ + GC normal_GC; + GC gray_GC; + Pixmap gray_pixmap; + Position label_x; + Position label_y; + Dimension label_width; + Dimension label_height; + Cardinal label_len; + Boolean display_sensitive; +} LabelPart; + +/* Full instance record declaration */ +typedef struct _LabelRec { + CorePart core; + LabelPart label; +} LabelRec; + +/* Types for Label class methods */ +typedef void (*LabelSetTextProc)(Widget w, String text); +typedef String (*LabelGetTextProc)(Widget w); + +/* New fields for the Label widget class record */ +typedef struct { + LabelSetTextProc set_text; + LabelGetTextProc get_text; + XtPointer extension; +} LabelClassPart; + +/* Full class record declaration */ +typedef struct _LabelClassRec { + CoreClassPart core_class; + LabelClassPart label_class; +} LabelClassRec; + +/* Class record variable */ +extern LabelClassRec labelClassRec; + +#define LabelInheritSetText((LabelSetTextProc)_XtInherit) +#define LabelInheritGetText((LabelGetTextProc)_XtInherit) + +#endif LABELP_H + To accommodate operating systems with file name length restrictions, the name of the private .h file is the first nine characters of the @@ -1737,94 +1737,94 @@ The following is an abbreviated version of the .c file for a Label widget. The resources table is described in . - -/* Resources specific to Label */ -static XtResource resources[] = { - {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), - XtOffset(LabelWidget, label.foreground), XtRString, - XtDefaultForeground}, - {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), - XtOffset(LabelWidget, label.font),XtRString, - XtDefaultFont}, - {XtNlabel, XtCLabel, XtRString, sizeof(String), - XtOffset(LabelWidget, label.label), XtRString, NULL}, - . - . - . -} - -/* Forward declarations of procedures */ -static void ClassInitialize(); -static void Initialize(); -static void Realize(); -static void SetText(); -static void GetText(); - . - . - . - - -/* Class record constant */ -LabelClassRec labelClassRec = { - { - /* core_class fields */ - /* superclass */ (WidgetClass)&coreClassRec, - /* class_name */ "Label", - /* widget_size */ sizeof(LabelRec), - /* class_initialize */ ClassInitialize, - /* class_part_initialize */ NULL, - /* class_inited */ False, - /* initialize */ Initialize, - /* initialize_hook */ NULL, - /* realize */ Realize, - /* actions */ NULL, - /* num_actions */ 0, - /* resources */ resources, - /* num_resources */ XtNumber(resources), - /* xrm_class */ NULLQUARK, - /* compress_motion */ True, - /* compress_exposure */ True, - /* compress_enterleave */ True, - /* visible_interest */ False, - /* destroy */ NULL, - /* resize */ Resize, - /* expose */ Redisplay, - /* set_values */ SetValues, - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, - /* accept_focus */ NULL, - /* version */ XtVersion, - /* callback_offsets */ NULL, - /* tm_table */ NULL, - /* query_geometry */ XtInheritQueryGeometry, - /* display_accelerator */ NULL, - /* extension */ NULL - }, - { - /* Label_class fields */ - /* get_text */ GetText, - /* set_text */ SetText, - /* extension */ NULL - } -}; - -/* Class record pointer */ -WidgetClass labelWidgetClass = (WidgetClass) &labelClassRec; - -/* New method access routines */ -void LabelSetText(Widget w, String text) -{ - LabelWidgetClass lwc = (Label WidgetClass)XtClass(w); - XtCheckSubclass(w, labelWidgetClass, NULL); - *(lwc->label_class.set_text)(w, text) -} - -/* Private procedures */ - . - . - . - + +/* Resources specific to Label */ +static XtResource resources[] = { + {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffset(LabelWidget, label.foreground), XtRString, + XtDefaultForeground}, + {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), + XtOffset(LabelWidget, label.font),XtRString, + XtDefaultFont}, + {XtNlabel, XtCLabel, XtRString, sizeof(String), + XtOffset(LabelWidget, label.label), XtRString, NULL}, + . + . + . +} + +/* Forward declarations of procedures */ +static void ClassInitialize(); +static void Initialize(); +static void Realize(); +static void SetText(); +static void GetText(); + . + . + . + + +/* Class record constant */ +LabelClassRec labelClassRec = { + { + /* core_class fields */ + /* superclass */ (WidgetClass)&coreClassRec, + /* class_name */ "Label", + /* widget_size */ sizeof(LabelRec), + /* class_initialize */ ClassInitialize, + /* class_part_initialize */ NULL, + /* class_inited */ False, + /* initialize */ Initialize, + /* initialize_hook */ NULL, + /* realize */ Realize, + /* actions */ NULL, + /* num_actions */ 0, + /* resources */ resources, + /* num_resources */ XtNumber(resources), + /* xrm_class */ NULLQUARK, + /* compress_motion */ True, + /* compress_exposure */ True, + /* compress_enterleave */ True, + /* visible_interest */ False, + /* destroy */ NULL, + /* resize */ Resize, + /* expose */ Redisplay, + /* set_values */ SetValues, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, + /* accept_focus */ NULL, + /* version */ XtVersion, + /* callback_offsets */ NULL, + /* tm_table */ NULL, + /* query_geometry */ XtInheritQueryGeometry, + /* display_accelerator */ NULL, + /* extension */ NULL + }, + { + /* Label_class fields */ + /* get_text */ GetText, + /* set_text */ SetText, + /* extension */ NULL + } +}; + +/* Class record pointer */ +WidgetClass labelWidgetClass = (WidgetClass) &labelClassRec; + +/* New method access routines */ +void LabelSetText(Widget w, String text) +{ + LabelWidgetClass lwc = (Label WidgetClass)XtClass(w); + XtCheckSubclass(w, labelWidgetClass, NULL); + *(lwc->label_class.set_text)(w, text) +} + +/* Private procedures */ + . + . + . + @@ -2090,35 +2090,35 @@ the Intrinsics access the field's value only after accessing its corresponding superclass value (called downward superclass chaining) or before accessing its corresponding superclass value (called upward superclass chaining). The self-contained fields are - -In all widget classes: class_name - class_initialize - widget_size - realize - visible_interest - resize - expose - accept_focus - compress_motion - compress_exposure - compress_enterleave - set_values_almost - tm_table - version - allocate - deallocate - -In Composite widget classes: geometry_manager - change_managed - insert_child - delete_child - accepts_objects - allows_change_managed_set - -In Constraint widget classes: constraint_size - -In Shell widget classes: root_geometry_manager - + +In all widget classes: class_name + class_initialize + widget_size + realize + visible_interest + resize + expose + accept_focus + compress_motion + compress_exposure + compress_enterleave + set_values_almost + tm_table + version + allocate + deallocate + +In Composite widget classes: geometry_manager + change_managed + insert_child + delete_child + accepts_objects + allows_change_managed_set + +In Constraint widget classes: constraint_size + +In Shell widget classes: root_geometry_manager + With downward superclass chaining, @@ -2130,15 +2130,15 @@ Core class structures, then from the subclass structure, and so on down the class chain to that widget's class structure. These superclass-to-subclass fields are - - class_part_initialize - get_values_hook - initialize - initialize_hook - set_values - set_values_hook - resources - + + class_part_initialize + get_values_hook + initialize + initialize_hook + set_values + set_values_hook + resources + In addition, for subclasses of @@ -2151,12 +2151,12 @@ structures are chained from the Constraint class down to the subclass: - - resources - initialize - set_values - get_values_hook - + + resources + initialize + set_values + get_values_hook + With upward superclass chaining, @@ -2170,10 +2170,10 @@ Object class structures. The subclass-to-superclass fields are - - destroy - actions - + + destroy + actions + For subclasses of @@ -2296,13 +2296,13 @@ a class structure is constant. The following example provides the class initialization procedure for a Label class. - -static void ClassInitialize() -{ - XtSetTypeConverter(XtRString, XtRJustify, CvtStringToJustify, - NULL, 0, XtCacheNone, NULL); -} - + +static void ClassInitialize() +{ + XtSetTypeConverter(XtRString, XtRJustify, CvtStringToJustify, + NULL, 0, XtCacheNone, NULL); +} + @@ -2428,30 +2428,30 @@ For example, CompositeP.h contains these definitions: - -#define XtInheritGeometryManager ((XtGeometryHandler) _XtInherit) -#define XtInheritChangeManaged ((XtWidgetProc) _XtInherit) -#define XtInheritInsertChild ((XtArgsProc) _XtInherit) -#define XtInheritDeleteChild ((XtWidgetProc) _XtInherit) - + +#define XtInheritGeometryManager ((XtGeometryHandler) _XtInherit) +#define XtInheritChangeManaged ((XtWidgetProc) _XtInherit) +#define XtInheritInsertChild ((XtArgsProc) _XtInherit) +#define XtInheritDeleteChild ((XtWidgetProc) _XtInherit) + Composite's class_part_initialize procedure begins as follows: - -static void CompositeClassPartInitialize(WidgetClass widgetClass) -{ - CompositeWidgetClass wc = (CompositeWidgetClass)widgetClass; - CompositeWidgetClass super = (CompositeWidgetClass)wc->core_class.superclass; - if (wc->composite_class.geometry_manager == XtInheritGeometryManager) { - wc->composite_class.geometry_manager = super->composite_class.geometry_manager; - } - if (wc->composite_class.change_managed == XtInheritChangeManaged) { - wc->composite_class.change_managed = super->composite_class.change_managed; - } - . - . - . - + +static void CompositeClassPartInitialize(WidgetClass widgetClass) +{ + CompositeWidgetClass wc = (CompositeWidgetClass)widgetClass; + CompositeWidgetClass super = (CompositeWidgetClass)wc->core_class.superclass; + if (wc->composite_class.geometry_manager == XtInheritGeometryManager) { + wc->composite_class.geometry_manager = super->composite_class.geometry_manager; + } + if (wc->composite_class.change_managed == XtInheritChangeManaged) { + wc->composite_class.change_managed = super->composite_class.change_managed; + } + . + . + . + Nonprocedure fields may be inherited in the same manner as procedure fields. The class may declare any reserved value it wishes for @@ -2622,14 +2622,14 @@ declared as a linked list, and each extension record definition should contain the following four fields at the beginning of the structure declaration: - -struct { - XtPointer next_extension; - XrmQuark record_type; - long version; - Cardinal record_size; -}; - + +struct { + XtPointer next_extension; + XrmQuark record_type; + long version; + Cardinal record_size; +}; + diff --git a/specs/CH02.xml b/specs/CH02.xml index c1bd5e2..af52f9a 100644 --- a/specs/CH02.xml +++ b/specs/CH02.xml @@ -823,12 +823,12 @@ prior to , as in the following example. - - Widget top; - XtSetLanguageProc(NULL, NULL, NULL); - top = XtOpenApplication(...); - ... - + + Widget top; + XtSetLanguageProc(NULL, NULL, NULL); + top = XtOpenApplication(...); + ... + @@ -1012,14 +1012,14 @@ is not defined, the default must contain at least six entries. These entries must contain $HOME as the directory prefix, plus the following substitutions: - - 1. %C, %N, %L or %C, %N, %l, %t, %c - 2. %C, %N, %l - 3. %C, %N - 4. %N, %L or %N, %l, %t, %c - 5. %N, %l - 6. %N - + + 1. %C, %N, %L or %C, %N, %l, %t, %c + 2. %C, %N, %l + 3. %C, %N + 4. %N, %L or %N, %l, %t, %c + 5. %N, %l + 6. %N + The order of these six entries within the path must be as given above. The order and use of substitutions within a given entry are @@ -1034,15 +1034,15 @@ is defined, the default must contain at least seven entries. These entries must contain the following directory prefixes and substitutions: - - 1. $XAPPLRESDIR with %C, %N, %L or %C, %N, %l, %t, %c - 2. $XAPPLRESDIR with %C, %N, %l - 3. $XAPPLRESDIR with %C, %N - 4. $XAPPLRESDIR with %N, %L or %N, %l, %t, %c - 5. $XAPPLRESDIR with %N, %l - 6. $XAPPLRESDIR with %N - 7. $HOME with %N - + + 1. $XAPPLRESDIR with %C, %N, %L or %C, %N, %l, %t, %c + 2. $XAPPLRESDIR with %C, %N, %l + 3. $XAPPLRESDIR with %C, %N + 4. $XAPPLRESDIR with %N, %L or %N, %l, %t, %c + 5. $XAPPLRESDIR with %N, %l + 6. $XAPPLRESDIR with %N + 7. $HOME with %N + The order of these seven entries within the path must be as given above. The order and use of substitutions within a given entry are @@ -1272,26 +1272,26 @@ and it takes as a parameter additional application-specific resource abbreviations. The format of this table is described in Section 15.9 in Xlib — C Language X Interface. - -typedef enum { - XrmoptionNoArg, /* Value is specified in OptionDescRec.value */ - XrmoptionIsArg, /* Value is the option string itself */ - XrmoptionStickyArg, /* Value is characters immediately following option */ - XrmoptionSepArg, /* Value is next argument in argv */ - XrmoptionResArg, /* Use the next argument as input to XrmPutLineResource*/ - XrmoptionSkipArg, /* Ignore this option and the next argument in argv */ - XrmoptionSkipNArgs, /* Ignore this option and the next */ - /* OptionDescRec.value arguments in argv */ - XrmoptionSkipLine /* Ignore this option and the rest of argv */ -} XrmOptionKind; - -typedef struct { - char *option; /* Option name in argv */ - char *specifier; /* Resource name (without application name) */ - XrmOptionKind argKind; /* Location of the resource value */ - XPointer value; /* Value to provide if XrmoptionNoArg */ -} XrmOptionDescRec, *XrmOptionDescList; - + +typedef enum { + XrmoptionNoArg, /* Value is specified in OptionDescRec.value */ + XrmoptionIsArg, /* Value is the option string itself */ + XrmoptionStickyArg, /* Value is characters immediately following option */ + XrmoptionSepArg, /* Value is next argument in argv */ + XrmoptionResArg, /* Use the next argument as input to XrmPutLineResource*/ + XrmoptionSkipArg, /* Ignore this option and the next argument in argv */ + XrmoptionSkipNArgs, /* Ignore this option and the next */ + /* OptionDescRec.value arguments in argv */ + XrmoptionSkipLine /* Ignore this option and the rest of argv */ +} XrmOptionKind; + +typedef struct { + char *option; /* Option name in argv */ + char *specifier; /* Resource name (without application name) */ + XrmOptionKind argKind; /* Location of the resource value */ + XPointer value; /* Value to provide if XrmoptionNoArg */ +} XrmOptionDescRec, *XrmOptionDescList; + The standard table contains the following entries: @@ -1503,9 +1503,9 @@ to give a red background to all command buttons in an application named xmh, you can start it up as - -xmh -xrm 'xmh*Command.background: red' - + +xmh -xrm 'xmh*Command.background: red' + When it parses the command line, @@ -1611,12 +1611,12 @@ These are passed as an arglist, a pointer to an array of Arg structures, which contains - -typedef struct { - String name; - XtArgVal value; -} Arg, *ArgList; - + +typedef struct { + String name; + XtArgVal value; +} Arg, *ArgList; + where XtArgVal @@ -1688,26 +1688,26 @@ The function is usually used in a highly stylized manner to minimize the probability of making a mistake; for example: - -Arg args[20]; -int n; -n = 0; -XtSetArg(args[n], XtNheight, 100); n++; -XtSetArg(args[n], XtNwidth, 200); n++; -XtSetValues(widget, args, n); - + +Arg args[20]; +int n; +n = 0; +XtSetArg(args[n], XtNheight, 100); n++; +XtSetArg(args[n], XtNwidth, 200); n++; +XtSetValues(widget, args, n); + Alternatively, an application can statically declare the argument list and use : - -static Args args[] = { - {XtNheight, (XtArgVal) 100}, - {XtNwidth, (XtArgVal) 200}, -}; -XtSetValues(Widget, args, XtNumber(args)); - + +static Args args[] = { + {XtNheight, (XtArgVal) 100}, + {XtNwidth, (XtArgVal) 200}, +}; +XtSetValues(Widget, args, XtNumber(args)); + Note that you should not use expressions with side effects such as auto-increment or auto-decrement @@ -1823,9 +1823,9 @@ Two special names are defined for use only in varargs lists: and XtVaNestedList. - -#define XtVaTypedArg "XtVaTypedArg" - + +#define XtVaTypedArg "XtVaTypedArg" + If the name XtVaTypedArg @@ -1852,9 +1852,9 @@ otherwise value is a pointer to the data. If the conversion fails for any reason, a warning message is issued and the list entry is skipped. - -#define XtVaNestedList "XtVaNestedList" - + +#define XtVaNestedList "XtVaNestedList" + If the name XtVaNestedList @@ -1873,9 +1873,9 @@ To dynamically allocate a varargs list for use with in multiple calls, use . - -typedef XtPointer XtVarArgsList; - + +typedef XtPointer XtVarArgsList; + @@ -2351,21 +2351,21 @@ The first method, which is best used when there is a clear choice for what is the main window, leads to resource specifications like the following: - -xmail.geometry:... (the main window) -xmail.read.geometry:... (the read window) -xmail.compose.geometry:... (the compose window) - + +xmail.geometry:... (the main window) +xmail.read.geometry:... (the read window) +xmail.compose.geometry:... (the compose window) + The second method, which is best if there is no main window, leads to resource specifications like the following: - -xmail.headers.geometry:... (the headers window) -xmail.read.geometry:... (the read window) -xmail.compose.geometry:... (the compose window) - + +xmail.headers.geometry:... (the headers window) +xmail.read.geometry:... (the read window) +xmail.compose.geometry:... (the compose window) + To create a top-level widget that is the root of a widget tree using varargs lists, use @@ -2760,14 +2760,14 @@ When the call to create a widget includes a varargs list containing these arguments will be passed to the allocation procedure in an XtTypedArgList. - -typedef struct { - String name; - String type; - XtArgVal value; - int size; -} XtTypedArg, *XtTypedArgList; - + +typedef struct { + String name; + String type; + XtArgVal value; + int size; +} XtTypedArg, *XtTypedArgList; + The allocate procedure pointer in the ObjectClassExtension @@ -4270,9 +4270,9 @@ procedure ClientDestroy with client data to a wid . - -XtAddCallback(w, XtNdestroyCallback, ClientDestroy, client_data) - + +XtAddCallback(w, XtNdestroyCallback, ClientDestroy, client_data) + Similarly, the following removes the application-supplied destroy callback @@ -4280,9 +4280,9 @@ procedure ClientDestroy by calling . - -XtRemoveCallback(w, XtNdestroyCallback, ClientDestroy, client_data) - + +XtRemoveCallback(w, XtNdestroyCallback, ClientDestroy, client_data) + The ClientDestroy argument is of type ; diff --git a/specs/CH03.xml b/specs/CH03.xml index 558dbba..a72ddd3 100644 --- a/specs/CH03.xml +++ b/specs/CH03.xml @@ -1316,27 +1316,27 @@ For example, a widget class that needs to maintain a maximum width and height for each child might define its constraint record as follows: - -typedef struct { - Dimension max_width, max_height; -} MaxConstraintPart; -typedef struct { - MaxConstraintPart max; -} MaxConstraintRecord, *MaxConstraint; - + +typedef struct { + Dimension max_width, max_height; +} MaxConstraintPart; +typedef struct { + MaxConstraintPart max; +} MaxConstraintRecord, *MaxConstraint; + A subclass of this widget class that also needs to maintain a minimum size would define its constraint record as follows: - -typedef struct { - Dimension min_width, min_height; -} MinConstraintPart; -typedef struct { - MaxConstraintPart max; - MinConstraintPart min; -} MaxMinConstraintRecord, *MaxMinConstraint; - + +typedef struct { + Dimension min_width, min_height; +} MinConstraintPart; +typedef struct { + MaxConstraintPart max; + MinConstraintPart min; +} MaxMinConstraintRecord, *MaxMinConstraint; + Constraints are allocated, initialized, deallocated, and otherwise maintained insofar as possible by the Intrinsics. diff --git a/specs/CH04.xml b/specs/CH04.xml index 23f6101..77aca22 100644 --- a/specs/CH04.xml +++ b/specs/CH04.xml @@ -183,132 +183,132 @@ class has additional class fields, which are all contained in the None of the other Shell classes have any additional class fields: - -typedef struct { - XtPointer extension; -} ShellClassPart, OverrideShellClassPart, -WMShellClassPart, VendorShellClassPart, TransientShellClassPart, -TopLevelShellClassPart, ApplicationShellClassPart, SessionShellClassPart; - + +typedef struct { + XtPointer extension; +} ShellClassPart, OverrideShellClassPart, +WMShellClassPart, VendorShellClassPart, TransientShellClassPart, +TopLevelShellClassPart, ApplicationShellClassPart, SessionShellClassPart; + The full Shell class record definitions are: - -typedef struct _ShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; -} ShellClassRec; - - - -typedef struct { - XtPointer next_extension; See - XrmQuark record_type; See - long version; See - Cardinal record_size; See - XtGeometryHandler root_geometry_manager; See below -} ShellClassExtensionRec, *ShellClassExtension; - - - -typedef struct _OverrideShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - OverrideShellClassPart override_shell_class; -} OverrideShellClassRec; - - - -typedef struct _WMShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; -} WMShellClassRec; - - - -typedef struct _VendorShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; - VendorShellClassPart vendor_shell_class; -} VendorShellClassRec; - - - -typedef struct _TransientShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; - VendorShellClassPart vendor_shell_class; - TransientShellClassPart transient_shell_class; -} TransientShellClassRec; - - - -typedef struct _TopLevelShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; - VendorShellClassPart vendor_shell_class; - TopLevelShellClassPart top_level_shell_class; -} TopLevelShellClassRec; - - - -typedef struct _ApplicationShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; - VendorShellClassPart vendor_shell_class; - TopLevelShellClassPart top_level_shell_class; - ApplicationShellClassPart application_shell_class; -} ApplicationShellClassRec; - - - -typedef struct _SessionShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; - ShellClassPart shell_class; - WMShellClassPart wm_shell_class; - VendorShellClassPart vendor_shell_class; - TopLevelShellClassPart top_level_shell_class; - ApplicationShellClassPart application_shell_class; - SessionShellClassPart session_shell_class; -} SessionShellClassRec; - + +typedef struct _ShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; +} ShellClassRec; + + + +typedef struct { + XtPointer next_extension; See + XrmQuark record_type; See + long version; See + Cardinal record_size; See + XtGeometryHandler root_geometry_manager; See below +} ShellClassExtensionRec, *ShellClassExtension; + + + +typedef struct _OverrideShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + OverrideShellClassPart override_shell_class; +} OverrideShellClassRec; + + + +typedef struct _WMShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; +} WMShellClassRec; + + + +typedef struct _VendorShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; +} VendorShellClassRec; + + + +typedef struct _TransientShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TransientShellClassPart transient_shell_class; +} TransientShellClassRec; + + + +typedef struct _TopLevelShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; +} TopLevelShellClassRec; + + + +typedef struct _ApplicationShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; + ApplicationShellClassPart application_shell_class; +} ApplicationShellClassRec; + + + +typedef struct _SessionShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; + TopLevelShellClassPart top_level_shell_class; + ApplicationShellClassPart application_shell_class; + SessionShellClassPart session_shell_class; +} SessionShellClassRec; + The single occurrences of the class records and pointers for creating instances of shells are: - -extern ShellClassRec shellClassRec; -extern OverrideShellClassRec overrideShellClassRec; -extern WMShellClassRec wmShellClassRec; -extern VendorShellClassRec vendorShellClassRec; -extern TransientShellClassRec transientShellClassRec; -extern TopLevelShellClassRec topLevelShellClassRec; -extern ApplicationShellClassRec applicationShellClassRec; -extern SessionShellClassRec sessionShellClassRec; -extern WidgetClass shellWidgetClass; -extern WidgetClass overrideShellWidgetClass; -extern WidgetClass wmShellWidgetClass; -extern WidgetClass vendorShellWidgetClass; -extern WidgetClass transientShellWidgetClass; -extern WidgetClass topLevelShellWidgetClass; -extern WidgetClass applicationShellWidgetClass; -extern WidgetClass sessionShellWidgetClass; - + +extern ShellClassRec shellClassRec; +extern OverrideShellClassRec overrideShellClassRec; +extern WMShellClassRec wmShellClassRec; +extern VendorShellClassRec vendorShellClassRec; +extern TransientShellClassRec transientShellClassRec; +extern TopLevelShellClassRec topLevelShellClassRec; +extern ApplicationShellClassRec applicationShellClassRec; +extern SessionShellClassRec sessionShellClassRec; +extern WidgetClass shellWidgetClass; +extern WidgetClass overrideShellWidgetClass; +extern WidgetClass wmShellWidgetClass; +extern WidgetClass vendorShellWidgetClass; +extern WidgetClass transientShellWidgetClass; +extern WidgetClass topLevelShellWidgetClass; +extern WidgetClass applicationShellWidgetClass; +extern WidgetClass sessionShellWidgetClass; + The following opaque types and opaque variables are defined @@ -476,191 +476,191 @@ fields defined in their widget records: - -typedef struct { - String geometry; - XtCreatePopupChildProc create_popup_child_proc; - XtGrabKind grab_kind; - Boolean spring_loaded; - Boolean popped_up; - Boolean allow_shell_resize; - Boolean client_specified; - Boolean save_under; - Boolean override_redirect; - XtCallbackList popup_callback; - XtCallbackList popdown_callback; - Visual * visual; -} ShellPart; - - - -typedef struct { - int empty; -} OverrideShellPart; - - - -typedef struct { - String title; - int wm_timeout; - Boolean wait_for_wm; - Boolean transient; - Boolean urgency; - Widget client_leader; - String window_role; - struct _OldXSizeHints { - long flags; - int x, y; - int width, height; - int min_width, min_height; - int max_width, max_height; - int width_inc, height_inc; - struct { - int x; - int y; - } min_aspect, max_aspect; - } size_hints; - XWMHints wm_hints; - int base_width, base_height, win_gravity; - Atom title_encoding; -} WMShellPart; - - - -typedef struct { - int vendor_specific; -} VendorShellPart; - - - -typedef struct { - Widget transient_for; -} TransientShellPart; -typedef struct { - String icon_name; - Boolean iconic; - Atom icon_name_encoding; -} TopLevelShellPart; - - - -typedef struct { - char * class; - XrmClass xrm_class; - int argc; - char ** argv; -} ApplicationShellPart; - - - -typedef struct { - SmcConn connection; - String session_id; - String * restart_command; - String * clone_command; - String * discard_command; - String * resign_command; - String * shutdown_command; - String * environment; - String current_dir; - String program_path; - unsigned char restart_style; - Boolean join_session; - XtCallbackList save_callbacks; - XtCallbackList interact_callbacks; - XtCallbackList cancel_callbacks; - XtCallbackList save_complete_callbacks; - XtCallbackList die_callbacks; - XtCallbackList error_callbacks; -} SessionShellPart; - + +typedef struct { + String geometry; + XtCreatePopupChildProc create_popup_child_proc; + XtGrabKind grab_kind; + Boolean spring_loaded; + Boolean popped_up; + Boolean allow_shell_resize; + Boolean client_specified; + Boolean save_under; + Boolean override_redirect; + XtCallbackList popup_callback; + XtCallbackList popdown_callback; + Visual * visual; +} ShellPart; + + + +typedef struct { + int empty; +} OverrideShellPart; + + + +typedef struct { + String title; + int wm_timeout; + Boolean wait_for_wm; + Boolean transient; + Boolean urgency; + Widget client_leader; + String window_role; + struct _OldXSizeHints { + long flags; + int x, y; + int width, height; + int min_width, min_height; + int max_width, max_height; + int width_inc, height_inc; + struct { + int x; + int y; + } min_aspect, max_aspect; + } size_hints; + XWMHints wm_hints; + int base_width, base_height, win_gravity; + Atom title_encoding; +} WMShellPart; + + + +typedef struct { + int vendor_specific; +} VendorShellPart; + + + +typedef struct { + Widget transient_for; +} TransientShellPart; +typedef struct { + String icon_name; + Boolean iconic; + Atom icon_name_encoding; +} TopLevelShellPart; + + + +typedef struct { + char * class; + XrmClass xrm_class; + int argc; + char ** argv; +} ApplicationShellPart; + + + +typedef struct { + SmcConn connection; + String session_id; + String * restart_command; + String * clone_command; + String * discard_command; + String * resign_command; + String * shutdown_command; + String * environment; + String current_dir; + String program_path; + unsigned char restart_style; + Boolean join_session; + XtCallbackList save_callbacks; + XtCallbackList interact_callbacks; + XtCallbackList cancel_callbacks; + XtCallbackList save_complete_callbacks; + XtCallbackList die_callbacks; + XtCallbackList error_callbacks; +} SessionShellPart; + The full shell widget instance record definitions are: - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; -} ShellRec, *ShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - OverrideShellPart override; -} OverrideShellRec, *OverrideShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; -} WMShellRec, *WMShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; - VendorShellPart vendor; -} VendorShellRec, *VendorShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; - VendorShellPart vendor; - TransientShellPart transient; -} TransientShellRec, *TransientShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; - VendorShellPart vendor; - TopLevelShellPart topLevel; -} TopLevelShellRec, *TopLevelShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; - VendorShellPart vendor; - TopLevelShellPart topLevel; - ApplicationShellPart application; -} ApplicationShellRec, *ApplicationShellWidget; - - - -typedef struct { - CorePart core; - CompositePart composite; - ShellPart shell; - WMShellPart wm; - VendorShellPart vendor; - TopLevelShellPart topLevel; - ApplicationShellPart application; - SessionShellPart session; -} SessionShellRec, *SessionShellWidget; - + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; +} ShellRec, *ShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + OverrideShellPart override; +} OverrideShellRec, *OverrideShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; +} WMShellRec, *WMShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; +} VendorShellRec, *VendorShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TransientShellPart transient; +} TransientShellRec, *TransientShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; +} TopLevelShellRec, *TopLevelShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; +} ApplicationShellRec, *ApplicationShellWidget; + + + +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; + SessionShellPart session; +} SessionShellRec, *SessionShellWidget; + @@ -2065,20 +2065,20 @@ The checkpoint token in the call_data parameter i XtCheckpointToken. - -typedef struct { - int save_type; - int interact_style; - Boolean shutdown; - Boolean fast; - Boolean cancel_shutdown - int phase; - int interact_dialog_type; /* return */ - Boolean request_cancel; /* return */ - Boolean request_next_phase; /* return */ - Boolean save_success; /* return */ -} XtCheckpointTokenRec, *XtCheckpointToken; - + +typedef struct { + int save_type; + int interact_style; + Boolean shutdown; + Boolean fast; + Boolean cancel_shutdown + int phase; + int interact_dialog_type; /* return */ + Boolean request_cancel; /* return */ + Boolean request_next_phase; /* return */ + Boolean save_success; /* return */ +} XtCheckpointTokenRec, *XtCheckpointToken; + The save_type, interact_style, shutdown, and fast diff --git a/specs/CH05.xml b/specs/CH05.xml index b3e04ac..97974bd 100644 --- a/specs/CH05.xml +++ b/specs/CH05.xml @@ -394,9 +394,9 @@ Some of these routines take an argument of type XtGrabKind, which is defined as - -typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind; - + +typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind; + The create_popup_child_proc procedure pointer @@ -512,9 +512,9 @@ or XtGrabExclusive, it calls - -XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False) - + +XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False) + @@ -988,12 +988,12 @@ The function casts the client_data parameter to a pointer of type XtPopdownID. - -typedef struct { - Widget shell_widget; - Widget enable_widget; -} XtPopdownIDRec, *XtPopdownID; - + +typedef struct { + Widget shell_widget; + Widget enable_widget; +} XtPopdownIDRec, *XtPopdownID; + The shell_widget is the pop-up shell to pop down, and the enable_widget is usually the widget that was used to pop it up diff --git a/specs/CH06.xml b/specs/CH06.xml index d46e5ec..0985e79 100644 --- a/specs/CH06.xml +++ b/specs/CH06.xml @@ -124,17 +124,17 @@ When making a geometry request, the child specifies an structure. - -typedef unsigned long XtGeometryMask; -typedef struct { - XtGeometryMask request_mode; - Position x, y; - Dimension width, height; - Dimension border_width; - Widget sibling; - int stack_mode; -} XtWidgetGeometry; - + +typedef unsigned long XtGeometryMask; +typedef struct { + XtGeometryMask request_mode; + Position x, y; + Dimension width, height; + Dimension border_width; + Widget sibling; + int stack_mode; +} XtWidgetGeometry; + To make a general geometry manager request from a widget, use @@ -278,14 +278,14 @@ when called by a child of a primitive widget. The return codes from geometry managers are - -typedef enum { - XtGeometryYes, - XtGeometryNo, - XtGeometryAlmost, - XtGeometryDone -} XtGeometryResult; - + +typedef enum { + XtGeometryYes, + XtGeometryNo, + XtGeometryAlmost, + XtGeometryDone +} XtGeometryResult; + The request_mode definitions are from diff --git a/specs/CH07.xml b/specs/CH07.xml index 737a0b6..bd1208c 100644 --- a/specs/CH07.xml +++ b/specs/CH07.xml @@ -2850,12 +2850,12 @@ dispatched to the widget's expose procedure. This field must be initialized to one of the following values: - -#define XtExposeNoCompress ((XtEnum)False) -#define XtExposeCompressSeries ((XtEnum)True) -#define XtExposeCompressMultiple <implementation-defined> -#define XtExposeCompressMaximal <implementation-defined> - + +#define XtExposeNoCompress ((XtEnum)False) +#define XtExposeCompressSeries ((XtEnum)True) +#define XtExposeCompressMultiple <implementation-defined> +#define XtExposeCompressMaximal <implementation-defined> + optionally ORed with any combination of the following flags (all with @@ -3140,11 +3140,11 @@ the widgets Label, Pushbutton, and Toggle, you could write a single display routine in Label that uses display state fields like - -Boolean invert; -Boolean highlight; -Dimension highlight_width; - + +Boolean invert; +Boolean highlight; +Dimension highlight_width; + Label would have invert and highlight always False @@ -3521,9 +3521,9 @@ To register an event handler procedure that receives events before or after all previously registered event handlers, use . - -typedef enum {XtListHead, XtListTail} XtListPosition; - + +typedef enum {XtListHead, XtListTail} XtListPosition; + @@ -4734,13 +4734,13 @@ Resource converters are an exception. They require the application context or process to be locked before the application can safely call them directly, for example: - - ... - XtAppLock(app_context); - XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret); - XtAppUnlock(app_context); - ... - + + ... + XtAppLock(app_context); + XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret); + XtAppUnlock(app_context); + ... + When the application relies upon @@ -4755,29 +4755,29 @@ utility functions, such as one which retrieves the being_destroyed field from a widget instance, must lock the application context before accessing widget internal data. For example: - -#include <X11/CoreP.h> -Boolean BeingDestroyed (Widget widget) -{ - Boolean ret; - XtAppLock(XtWidgetToApplicationContext(widget)); - ret = widget->core.being_destroyed; - XtAppUnlock(XtWidgetToApplicationContext(widget)); - return ret; -} - + +#include <X11/CoreP.h> +Boolean BeingDestroyed (Widget widget) +{ + Boolean ret; + XtAppLock(XtWidgetToApplicationContext(widget)); + ret = widget->core.being_destroyed; + XtAppUnlock(XtWidgetToApplicationContext(widget)); + return ret; +} + A client that wishes to atomically call two or more Intrinsics functions must lock the application context. For example: - - ... - XtAppLock(XtWidgetToApplicationContext(widget)); - XtUnmanageChild (widget1); - XtManageChild (widget2); - XtAppUnlock(XtWidgetToApplicationContext(widget)); - ... - + + ... + XtAppLock(XtWidgetToApplicationContext(widget)); + XtUnmanageChild (widget1); + XtManageChild (widget2); + XtAppUnlock(XtWidgetToApplicationContext(widget)); + ... + Locking the Application Context diff --git a/specs/CH08.xml b/specs/CH08.xml index 40fd053..926e8d8 100644 --- a/specs/CH08.xml +++ b/specs/CH08.xml @@ -102,23 +102,23 @@ call, it should specify the address of a NULL-terminated array of type XtCallbackList. - -typedef struct { - XtCallbackProc callback; - XtPointer closure; -} XtCallbackRec, *XtCallbackList; - + +typedef struct { + XtCallbackProc callback; + XtPointer closure; +} XtCallbackRec, *XtCallbackList; + For example, the callback list for procedures A and B with client data clientDataA and clientDataB, respectively, is - -static XtCallbackRec callbacks[] = { - {A, (XtPointer) clientDataA}, - {B, (XtPointer) clientDataB}, - {(XtCallbackProc) NULL, (XtPointer) NULL} -}; - + +static XtCallbackRec callbacks[] = { + {A, (XtPointer) clientDataA}, + {B, (XtPointer) clientDataB}, + {(XtCallbackProc) NULL, (XtPointer) NULL} +}; + Although callback lists are passed by address in arglists and varargs lists, diff --git a/specs/CH09.xml b/specs/CH09.xml index 53eba83..822ee6a 100644 --- a/specs/CH09.xml +++ b/specs/CH09.xml @@ -46,17 +46,17 @@ The declaration for the XtResource structure is - -typedef struct { - String resource_name; - String resource_class; - String resource_type; - Cardinal resource_size; - Cardinal resource_offset; - String default_type; - XtPointer default_addr; -} XtResource, *XtResourceList; - + +typedef struct { + String resource_name; + String resource_class; + String resource_type; + Cardinal resource_size; + Cardinal resource_offset; + String default_type; + XtPointer default_addr; +} XtResource, *XtResourceList; + When the resource list is specified as the CoreClassPart, @@ -130,19 +130,19 @@ and all the other pixel entries a resource class of Then, the resource file needs only two lines to change all pixels to ivory or darkblue: - -*Background: ivory -*Foreground: darkblue - + +*Background: ivory +*Foreground: darkblue + Similarly, a widget may have several font resources (such as normal and bold), but all fonts should have the class Font. Thus, changing all fonts simply requires only a single line in the default resource file: - + *Font: 6x13 - + By convention, resource classes are always spelled starting with a capital letter @@ -641,20 +641,20 @@ see and Here is an abbreviated version of a possible resource list for a Label widget: - -/* Resources specific to Label */ -static XtResource resources[] = { -{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), - XtOffsetOf(LabelRec, label.foreground), XtRString, XtDefaultForeground}, -{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*), - XtOffsetOf(LabelRec, label.font), XtRString, XtDefaultFont}, -{XtNlabel, XtCLabel, XtRString, sizeof(String), - XtOffsetOf(LabelRec, label.label), XtRString, NULL}, - . - . - . -} - + +/* Resources specific to Label */ +static XtResource resources[] = { +{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(LabelRec, label.foreground), XtRString, XtDefaultForeground}, +{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*), + XtOffsetOf(LabelRec, label.font), XtRString, XtDefaultFont}, +{XtNlabel, XtCLabel, XtRString, sizeof(String), + XtOffsetOf(LabelRec, label.label), XtRString, NULL}, + . + . + . +} + The complete resource name for a field of a widget instance is the concatenation of the application shell name (from @@ -1759,12 +1759,12 @@ see Section Xlib — C Language X Interface.) for input and output values. - -typedef struct { - unsigned int size; - XPointer addr; -} XrmValue, *XrmValuePtr; - + +typedef struct { + unsigned int size; + XPointer addr; +} XrmValue, *XrmValuePtr; + The addr field specifies the address of the data, and the size field gives the total number of significant bytes in the data. @@ -1942,72 +1942,72 @@ still required to inform the Intrinsics that the converted value is a function of the particular display (and colormap). - -#define done(type, value) \\ - { \\ - if (toVal->addr != NULL) { \\ - if (toVal->size < sizeof(type)) { \\ - toVal->size = sizeof(type); \\ - return False; \\ - } \\ - *(type*)(toVal->addr) = (value); \\ - } \\ - else { \\ - static type static_val; \\ - static_val = (value); \\ - toVal->addr = (XPointer)&static_val; \\ - } \\ - toVal->size = sizeof(type); \\ - return True; \\ - } - -static Boolean CvtStringToPixel( - Display *dpy, - XrmValue *args, - Cardinal *num_args, - XrmValue *fromVal, - XrmValue *toVal, - XtPointer *converter_data) -{ - static XColor screenColor; - XColor exactColor; - Screen *screen; - Colormap colormap; - Status status; - - if (*num_args != 2) - XtAppWarningMsg(XtDisplayToApplicationContext(dpy), - "wrongParameters", "cvtStringToPixel", "XtToolkitError", - "String to pixel conversion needs screen and colormap arguments", - (String *)NULL, (Cardinal *)NULL); - screen = *((Screen**) args[0].addr); - colormap = *((Colormap *) args[1].addr); - if (CompareISOLatin1(str, XtDefaultBackground) == 0) { - *closure_ret = False; - done(Pixel, WhitePixelOfScreen(screen)); - } - if (CompareISOLatin1(str, XtDefaultForeground) == 0) { - *closure_ret = False; - done(Pixel, BlackPixelOfScreen(screen)); - } - status = XAllocNamedColor(DisplayOfScreen(screen), colormap, (char*)fromVal->addr, - &screenColor, &exactColor); - if (status == 0) { - String params[1]; - Cardinal num_params = 1; - params[0] = (String)fromVal->addr; - XtAppWarningMsg(XtDisplayToApplicationContext(dpy), - "noColormap", "cvtStringToPixel", "XtToolkitError", - "Cannot allocate colormap entry for \\"%s\\"", - params, &num_params); - *converter_data = (char *) False; - return False; - } else { - *converter_data = (char *) True; - done(Pixel, &screenColor.pixel); - } -} - + +#define done(type, value) \\ + { \\ + if (toVal->addr != NULL) { \\ + if (toVal->size < sizeof(type)) { \\ + toVal->size = sizeof(type); \\ + return False; \\ + } \\ + *(type*)(toVal->addr) = (value); \\ + } \\ + else { \\ + static type static_val; \\ + static_val = (value); \\ + toVal->addr = (XPointer)&static_val; \\ + } \\ + toVal->size = sizeof(type); \\ + return True; \\ + } + +static Boolean CvtStringToPixel( + Display *dpy, + XrmValue *args, + Cardinal *num_args, + XrmValue *fromVal, + XrmValue *toVal, + XtPointer *converter_data) +{ + static XColor screenColor; + XColor exactColor; + Screen *screen; + Colormap colormap; + Status status; + + if (*num_args != 2) + XtAppWarningMsg(XtDisplayToApplicationContext(dpy), + "wrongParameters", "cvtStringToPixel", "XtToolkitError", + "String to pixel conversion needs screen and colormap arguments", + (String *)NULL, (Cardinal *)NULL); + screen = *((Screen**) args[0].addr); + colormap = *((Colormap *) args[1].addr); + if (CompareISOLatin1(str, XtDefaultBackground) == 0) { + *closure_ret = False; + done(Pixel, WhitePixelOfScreen(screen)); + } + if (CompareISOLatin1(str, XtDefaultForeground) == 0) { + *closure_ret = False; + done(Pixel, BlackPixelOfScreen(screen)); + } + status = XAllocNamedColor(DisplayOfScreen(screen), colormap, (char*)fromVal->addr, + &screenColor, &exactColor); + if (status == 0) { + String params[1]; + Cardinal num_params = 1; + params[0] = (String)fromVal->addr; + XtAppWarningMsg(XtDisplayToApplicationContext(dpy), + "noColormap", "cvtStringToPixel", "XtToolkitError", + "Cannot allocate colormap entry for \\"%s\\"", + params, &num_params); + *converter_data = (char *) False; + return False; + } else { + *converter_data = (char *) True; + done(Pixel, &screenColor.pixel); + } +} + All type converters should define some set of conversion values for which they @@ -2221,9 +2221,9 @@ calls to the converter. Conversion cache control is specified via an XtCacheType argument. - -typedef int XtCacheType; - + +typedef int XtCacheType; + An XtCacheType @@ -2513,24 +2513,24 @@ specify how each argument is derived. These are defined in <X11/Intrinsic.h>. - -typedef enum { - /* address mode parameter representation */ - XtAddress, /* address */ - XtBaseOffset, /* offset */ - XtImmediate, /* constant */ - XtResourceString, /* resource name string */ - XtResourceQuark, /* resource name quark */ - XtWidgetBaseOffset, /* offset */ - XtProcedureArg /* procedure to call */ -} XtAddressMode; - -typedef struct { - XtAddressMode address_mode; - XtPointer address_id; - Cardinal size; -} XtConvertArgRec, *XtConvertArgList; - + +typedef enum { + /* address mode parameter representation */ + XtAddress, /* address */ + XtBaseOffset, /* offset */ + XtImmediate, /* constant */ + XtResourceString, /* resource name string */ + XtResourceQuark, /* resource name quark */ + XtWidgetBaseOffset, /* offset */ + XtProcedureArg /* procedure to call */ +} XtAddressMode; + +typedef struct { + XtAddressMode address_mode; + XtPointer address_id; + Cardinal size; +} XtConvertArgRec, *XtConvertArgList; + The size field specifies the length of the data in bytes. The address_mode field specifies how the address_id field should be @@ -2659,9 +2659,9 @@ To invoke explicit resource conversions, use or . - -typedef XtPointer XtCacheRef; - + +typedef XtPointer XtCacheRef; + diff --git a/specs/CH10.xml b/specs/CH10.xml index 9bc17ed..be4232d 100644 --- a/specs/CH10.xml +++ b/specs/CH10.xml @@ -114,12 +114,12 @@ Specifies the number of entries in params. - -typedef struct _XtActionsRec { - String string; - XtActionProc proc; -} XtActionsRec, *XtActionList; - + +typedef struct _XtActionsRec { + String string; + XtActionProc proc; +} XtActionsRec, *XtActionList; + The string field is the name used in translation tables to access the procedure. @@ -181,15 +181,15 @@ The string entry is the name used in translation tables. The procedure entry (usually spelled identically to the string) is the name of the C procedure that implements that function: - -XtActionsRec actionTable[] = { - {"Set", Set}, - {"Unset", Unset}, - {"Highlight", Highlight}, - {"Unhighlight", Unhighlight} - {"Notify", Notify}, -}; - + +XtActionsRec actionTable[] = { + {"Set", Set}, + {"Unset", Unset}, + {"Highlight", Highlight}, + {"Unhighlight", Unhighlight} + {"Notify", Notify}, +}; + The Intrinsics reserve all action names and parameters starting with the characters “Xt” for future standard enhancements. Users, @@ -550,13 +550,13 @@ Call callbacks and reinvert on left button up. The following illustrates Pushbutton's default translation table: - -static String defaultTranslations = - "<EnterWindow>: Highlight()\\n\\ - <LeaveWindow>: Unhighlight()\\n\\ - <Btn1Down>: Set()\\n\\ - <Btn1Up>: Notify() Unset()"; - + +static String defaultTranslations = + "<EnterWindow>: Highlight()\\n\\ + <LeaveWindow>: Unhighlight()\\n\\ + <Btn1Down>: Set()\\n\\ + <Btn1Up>: Notify() Unset()"; + The tm_table field of the CoreClassPart @@ -1388,9 +1388,9 @@ server's KeyCode-to-KeySym table. This table must not be modified. There are keysyms_per_keycode_return KeySyms associated with each KeyCode, located in the table with indices starting at index - - (test_keycode - min_keycode_return) * keysyms_per_keycode_return - + + (test_keycode - min_keycode_return) * keysyms_per_keycode_return + for KeyCode test_keycode. Any entries that have no KeySyms associated with them contain the value diff --git a/specs/CH11.xml b/specs/CH11.xml index 509987b..0f863de 100644 --- a/specs/CH11.xml +++ b/specs/CH11.xml @@ -466,9 +466,9 @@ is a convenience macro that calls with the following arguments specified: - -((type *) XtMalloc((unsigned) sizeof(type))) - + +((type *) XtMalloc((unsigned) sizeof(type))) + The storage allocated by @@ -513,9 +513,9 @@ is a convenience macro that calls with the following arguments specified: - -(strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) - + +(strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) + The storage allocated by @@ -1834,9 +1834,9 @@ The procedure pointer specified by the incremental owner to supply the selection data to the Intrinsics is of type . - -typedef XtPointer XtRequestId; - + +typedef XtPointer XtRequestId; + @@ -4379,12 +4379,12 @@ A string substitution is defined by a list of Substitution entries. - -typedef struct { - char match; - String substitution; -} SubstitutionRec, *Substitution; - + +typedef struct { + char match; + String substitution; +} SubstitutionRec, *Substitution; + File name evaluation is handled in an operating-system-dependent fashion by an @@ -4772,14 +4772,14 @@ must contain the following substitutions: - -1. %C, %N, %S, %T, %L or %C, %N, %S, %T, %l, %t, %c -2. %C, %N, %S, %T, %l -3. %C, %N, %S, %T -4. %N, %S, %T, %L or %N, %S, %T, %l, %t, %c -5. %N, %S, %T, %l -6. %N, %S, %T - + +1. %C, %N, %S, %T, %L or %C, %N, %S, %T, %l, %t, %c +2. %C, %N, %S, %T, %l +3. %C, %N, %S, %T +4. %N, %S, %T, %L or %N, %S, %T, %l, %t, %c +5. %N, %S, %T, %l +6. %N, %S, %T + The order of these six entries within the path must be as given above. @@ -4804,11 +4804,11 @@ Possible values might include ".txt", ".dat", and ".bm". A suggested value for the default path on POSIX-based systems is - - /usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:\ - /usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:\ - /usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S - + + /usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:\ + /usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:\ + /usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S + @@ -4831,9 +4831,9 @@ might set XFILESEARCHPATH to - - %D:ourdir/%T/%N%C:ourdir/%T/%N - + + %D:ourdir/%T/%N%C:ourdir/%T/%N + The customization string is obtained by querying the resource database @@ -5042,14 +5042,14 @@ The call_data parameter in a createHook callback cast to type XtCreateHookData. - -typedef struct { - String type; - Widget widget; - ArgList args; - Cardinal num_args; -} XtCreateHookDataRec, *XtCreateHookData; - + +typedef struct { + String type; + Widget widget; + ArgList args; + Cardinal num_args; +} XtCreateHookDataRec, *XtCreateHookData; + The type is set to XtHcreate, @@ -5125,14 +5125,14 @@ The call_data parameter in a changeHook callback be cast to type XtChangeHookData. - -typedef struct { - String type; - Widget widget; - XtPointer event_data; - Cardinal num_event_data; -} XtChangeHookDataRec, *XtChangeHookData; - + +typedef struct { + String type; + Widget widget; + XtPointer event_data; + Cardinal num_event_data; +} XtChangeHookDataRec, *XtChangeHookData; + When the changeHook callbacks are called as a result of a call to @@ -5144,13 +5144,13 @@ or event_data may be cast to type XtChangeHookSetValuesData. - -typedef struct { - Widget old, req; - ArgList args; - Cardinal num_args; -} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData; - + +typedef struct { + Widget old, req; + ArgList args; + Cardinal num_args; +} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData; + The old, req, args, and num_args are the parameters passed to the set_values procedure. The callbacks are called @@ -5388,9 +5388,9 @@ without employing the Intrinsics library should invoke the change hook itself. This is done by: - - XtCallCallbacks(XtHooksOfDisplay(dpy), XtNchangeHook, call_data); - + + XtCallCallbacks(XtHooksOfDisplay(dpy), XtNchangeHook, call_data); + The XtNconfigureHook callback list is called any time the Intrinsics move, resize, or configure a widget and when @@ -5402,14 +5402,14 @@ is called. The call_data parameter may be cast to type XtConfigureHookData. - -typedef struct { - String type; - Widget widget; - XtGeometryMask changeMask; - XWindowChanges changes; -} XtConfigureHookDataRec, *XtConfigureHookData; - + +typedef struct { + String type; + Widget widget; + XtGeometryMask changeMask; + XWindowChanges changes; +} XtConfigureHookDataRec, *XtConfigureHookData; + When the configureHook callbacks are called, the type is XtHconfigure, @@ -5431,15 +5431,15 @@ The call_data parameter may be cast to type XtGeometryHookData. - -typedef struct { - String type; - Widget widget; - XtWidgetGeometry* request; - XtWidgetGeometry* reply; - XtGeometryResult result; -} XtGeometryHookDataRec, *XtGeometryHookData; - + +typedef struct { + String type; + Widget widget; + XtWidgetGeometry* request; + XtWidgetGeometry* reply; + XtGeometryResult result; +} XtGeometryHookDataRec, *XtGeometryHookData; + When the geometryHook callbacks are called prior to geometry negotiation, the type is @@ -5459,12 +5459,12 @@ The XtNdestroyHook callback list is called when a widget is destroyed. The call_data parameter may be cast to type XtDestroyHookData. - -typedef struct { - String type; - Widget widget; -} XtDestroyHookDataRec, *XtDestroyHookData; - + +typedef struct { + String type; + Widget widget; +} XtDestroyHookDataRec, *XtDestroyHookData; + When the destroyHook callbacks are called as a result of a call to , diff --git a/specs/CH12.xml b/specs/CH12.xml index 4a40b92..a20f846 100644 --- a/specs/CH12.xml +++ b/specs/CH12.xml @@ -68,42 +68,42 @@ but exist to pad the data structure so that it matches Core's class record. The class record initialization must fill all objn fields with NULL or zero as appropriate to the type. - -typedef struct _ObjectClassPart { - WidgetClass superclass; - String class_name; - Cardinal widget_size; - XtProc class_initialize; - XtWidgetClassProc class_part_initialize; - XtEnum class_inited; - XtInitProc initialize; - XtArgsProc initialize_hook; - XtProc obj1; - XtPointer obj2; - Cardinal obj3; - XtResourceList resources; - Cardinal num_resources; - XrmClass xrm_class; - Boolean obj4; - XtEnum obj5; - Boolean obj6; - Boolean obj7; - XtWidgetProc destroy; - XtProc obj8; - XtProc obj9; - XtSetValuesFunc set_values; - XtArgsFunc set_values_hook; - XtProc obj10; - XtArgsProc get_values_hook; - XtProc obj11; - XtVersionType version; - XtPointer callback_private; - String obj12; - XtProc obj13; - XtProc obj14; - XtPointer extension; -} ObjectClassPart; - + +typedef struct _ObjectClassPart { + WidgetClass superclass; + String class_name; + Cardinal widget_size; + XtProc class_initialize; + XtWidgetClassProc class_part_initialize; + XtEnum class_inited; + XtInitProc initialize; + XtArgsProc initialize_hook; + XtProc obj1; + XtPointer obj2; + Cardinal obj3; + XtResourceList resources; + Cardinal num_resources; + XrmClass xrm_class; + Boolean obj4; + XtEnum obj5; + Boolean obj6; + Boolean obj7; + XtWidgetProc destroy; + XtProc obj8; + XtProc obj9; + XtSetValuesFunc set_values; + XtArgsFunc set_values_hook; + XtProc obj10; + XtArgsProc get_values_hook; + XtProc obj11; + XtVersionType version; + XtPointer callback_private; + String obj12; + XtProc obj13; + XtProc obj14; + XtPointer extension; +} ObjectClassPart; + The extension record defined for ObjectClassPart @@ -112,27 +112,27 @@ with a record_type equal to is ObjectClassExtensionRec. - -typedef struct { - XtPointer next_extension; See - XrmQuark record_type; See - long version; See - Cardinal record_size; See - XtAllocateProc allocate; See . - XtDeallocateProc deallocate; See . -} ObjectClassExtensionRec, *ObjectClassExtension; - + +typedef struct { + XtPointer next_extension; See + XrmQuark record_type; See + long version; See + Cardinal record_size; See + XtAllocateProc allocate; See . + XtDeallocateProc deallocate; See . +} ObjectClassExtensionRec, *ObjectClassExtension; + The prototypical ObjectClass consists of just the ObjectClassPart. - -typedef struct _ObjectClassRec { - ObjectClassPart object_class; -} ObjectClassRec, *ObjectClass; - + +typedef struct _ObjectClassRec { + ObjectClassPart object_class; +} ObjectClassRec, *ObjectClass; + The predefined class record and pointer for ObjectClassRec @@ -143,16 +143,16 @@ are In IntrinsicP.h: - -extern ObjectClassRec objectClassRec; - + +extern ObjectClassRec objectClassRec; + In Intrinsic.h: - -extern WidgetClass objectClass; - + +extern WidgetClass objectClass; + The opaque types Object @@ -170,9 +170,9 @@ version identifier is uses an incomplete structure definition to ensure that the compiler catches attempts to access private data: - -typedef struct _ObjectClassRec* ObjectClass; - + +typedef struct _ObjectClassRec* ObjectClass; + @@ -185,16 +185,16 @@ structure. All fields have the same meaning as the corresponding fields in CorePart. - -typedef struct _ObjectPart { - Widget self; - WidgetClass widget_class; - Widget parent; - Boolean being_destroyed; - XtCallbackList destroy_callbacks; - XtPointer constraints; -} ObjectPart; - + +typedef struct _ObjectPart { + Widget self; + WidgetClass widget_class; + Widget parent; + Boolean being_destroyed; + XtCallbackList destroy_callbacks; + XtPointer constraints; +} ObjectPart; + All object instances have the Object @@ -209,18 +209,18 @@ object types. In IntrinsicP.h: - -typedef struct _ObjectRec { - ObjectPart object; -} ObjectRec, *Object; - + +typedef struct _ObjectRec { + ObjectPart object; +} ObjectRec, *Object; + In Intrinsic.h: - -typedef struct _ObjectRec *Object; - + +typedef struct _ObjectRec *Object; + @@ -516,53 +516,53 @@ Core's class record. The class record initialization must fill all rectn fields with NULL or zero as appropriate to the type. - -typedef struct _RectObjClassPart { - WidgetClass superclass; - String class_name; - Cardinal widget_size; - XtProc class_initialize; - XtWidgetClassProc class_part_initialize; - XtEnum class_inited; - XtInitProc initialize; - XtArgsProc initialize_hook; - XtProc rect1; - XtPointer rect2; - Cardinal rect3; - XtResourceList resources; - Cardinal num_resources; - XrmClass xrm_class; - Boolean rect4; - XtEnum rect5; - Boolean rect6; - Boolean rect7; - XtWidgetProc destroy; - XtWidgetProc resize; - XtExposeProc expose; - XtSetValuesFunc set_values; - XtArgsFunc set_values_hook; - XtAlmostProc set_values_almost; - XtArgsProc get_values_hook; - XtProc rect9; - XtVersionType version; - XtPointer callback_private; - String rect10; - XtGeometryHandler query_geometry; - XtProc rect11; - XtPointer extension; -} RectObjClassPart; - + +typedef struct _RectObjClassPart { + WidgetClass superclass; + String class_name; + Cardinal widget_size; + XtProc class_initialize; + XtWidgetClassProc class_part_initialize; + XtEnum class_inited; + XtInitProc initialize; + XtArgsProc initialize_hook; + XtProc rect1; + XtPointer rect2; + Cardinal rect3; + XtResourceList resources; + Cardinal num_resources; + XrmClass xrm_class; + Boolean rect4; + XtEnum rect5; + Boolean rect6; + Boolean rect7; + XtWidgetProc destroy; + XtWidgetProc resize; + XtExposeProc expose; + XtSetValuesFunc set_values; + XtArgsFunc set_values_hook; + XtAlmostProc set_values_almost; + XtArgsProc get_values_hook; + XtProc rect9; + XtVersionType version; + XtPointer callback_private; + String rect10; + XtGeometryHandler query_geometry; + XtProc rect11; + XtPointer extension; +} RectObjClassPart; + The RectObj class record consists of just the RectObjClassPart. - -typedef struct _RectObjClassRec { - RectObjClassPart rect_class; -} RectObjClassRec, *RectObjClass; - + +typedef struct _RectObjClassRec { + RectObjClassPart rect_class; +} RectObjClassRec, *RectObjClass; + The predefined class record and pointer for RectObjClassRec @@ -573,16 +573,16 @@ are In Intrinsic.h: - -extern RectObjClassRec rectObjClassRec; - + +extern RectObjClassRec rectObjClassRec; + In Intrinsic.h: - -extern WidgetClass rectObjClass; - + +extern WidgetClass rectObjClass; + The opaque types RectObj @@ -597,9 +597,9 @@ RectObj. uses an incomplete structure definition to ensure that the compiler catches attempts to access private data: - -typedef struct _RectObjClassRec* RectObjClass; - + +typedef struct _RectObjClassRec* RectObjClass; + @@ -615,33 +615,33 @@ objects have the following fields defined in the structure. All fields have the same meaning as the corresponding field in CorePart. - -typedef struct _RectObjPart { - Position x, y; - Dimension width, height; - Dimension border_width; - Boolean managed; - Boolean sensitive; - Boolean ancestor_sensitive; -} RectObjPart; - + +typedef struct _RectObjPart { + Position x, y; + Dimension width, height; + Dimension border_width; + Boolean managed; + Boolean sensitive; + Boolean ancestor_sensitive; +} RectObjPart; + RectObj objects have the RectObj fields immediately following the Object fields. - -typedef struct _RectObjRec { - ObjectPart object; - RectObjPart rectangle; -} RectObjRec, *RectObj; - + +typedef struct _RectObjRec { + ObjectPart object; + RectObjPart rectangle; +} RectObjRec, *RectObj; + In Intrinsic.h: - -typedef struct _RectObjRec* RectObj; - + +typedef struct _RectObjRec* RectObj; + diff --git a/specs/CH13.xml b/specs/CH13.xml index 530f918..79fa42a 100644 --- a/specs/CH13.xml +++ b/specs/CH13.xml @@ -37,9 +37,9 @@ advantage of newer features added in later revisions may use the symbolic macro XtSpecificationRelease. - -#define XtSpecificationRelease 6 - + +#define XtSpecificationRelease 6 + As the symbol XtSpecificationRelease @@ -299,11 +299,11 @@ a resource named “baseTranslations”. Applications wishing to take advantage of the new functionality would change their application defaults file, e.g., from - - app.widget.translations: value + + app.widget.translations: value to - app.widget.baseTranslations: value - + app.widget.baseTranslations: value + If it is important to the application to preserve complete compatibility of the defaults file between different versions of the application running under Release 4 and Release 5, diff --git a/specs/appB.xml b/specs/appB.xml index ab6313e..ec87056 100644 --- a/specs/appB.xml +++ b/specs/appB.xml @@ -240,12 +240,12 @@ a dollar sign ($), and another backslash (\). Briefly: - -No modifiers: None <event> detail -Any modifiers: <event> detail -Only these modifiers: ! mod1 mod2 <event> detail -These modifiers and any others: mod1 mod2 <event> detail - + +No modifiers: None <event> detail +Any modifiers: <event> detail +Only these modifiers: ! mod1 mod2 <event> detail +These modifiers and any others: mod1 mod2 <event> detail + The use of "None" for a modifier list is identical to the use @@ -942,13 +942,13 @@ The canonical representation of a translation table is (see also The canonical modifier names are - - Ctrl Mod1 Button1 - Shift Mod2 Button2 - Lock Mod3 Button3 - Mod4 Button4 - Mod5 Button5 - + + Ctrl Mod1 Button1 + Shift Mod2 Button2 + Lock Mod3 Button3 + Mod4 Button4 + Mod5 Button5 + The canonical event types are @@ -1033,53 +1033,53 @@ The canonical representation of a translation table is (see also Always put more specific events in the table before more general ones: - - Shift <Btn1Down> : twas()\n\ - <Btn1Down> : brillig() - + + Shift <Btn1Down> : twas()\n\ + <Btn1Down> : brillig() + For double-click on Button1 Up with Shift, use this specification: - -Shift<Btn1Up>(2) : and() - + +Shift<Btn1Up>(2) : and() + This is equivalent to the following line with appropriate timers set between events: - -Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down>,Shift<Btn1Up> : and() - + +Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down>,Shift<Btn1Up> : and() + For double-click on Button1 Down with Shift, use this specification: - -Shift<Btn1Down>(2) : the() - + +Shift<Btn1Down>(2) : the() + This is equivalent to the following line with appropriate timers set between events: - -Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down> : the() - + +Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down> : the() + Mouse motion is always discarded when it occurs between events in a table where no motion event is specified: - -<Btn1Down>,<Btn1Up> : slithy() - + +<Btn1Down>,<Btn1Up> : slithy() + This is taken, even if the pointer moves a bit between the down and up events. @@ -1096,10 +1096,10 @@ noninitial subsequence of another translation, it is not taken if it occurs in the context of the longer sequence. This occurs mostly in sequences like the following: - -<Btn1Down>,<Btn1Up> : toves()\n\ -<Btn1Up> : did() - + +<Btn1Down>,<Btn1Up> : toves()\n\ +<Btn1Up> : did() + The second translation is taken only if the button release is not preceded by a button press or if there are intervening events between the @@ -1120,9 +1120,9 @@ For single click on Button1 Up with Shift and Meta, use this specification: - -Shift Meta <Btn1Down>, Shift Meta<Btn1Up>: gyre() - + +Shift Meta <Btn1Down>, Shift Meta<Btn1Up>: gyre() + @@ -1132,9 +1132,9 @@ count in an event sequence. The actions will be invoked on the count-th click and each subsequent one arriving within the multi-click time interval. For example: - -Shift <Btn1Up>(2+) : and() - + +Shift <Btn1Up>(2+) : and() + @@ -1142,9 +1142,9 @@ To indicate EnterNotify with any modifiers, use this specification: - -<Enter> : gimble() - + +<Enter> : gimble() + @@ -1152,9 +1152,9 @@ To indicate EnterNotify with no modifiers, use this specification: - -None <Enter> : in() - + +None <Enter> : in() + @@ -1163,9 +1163,9 @@ To indicate with Button1 Down and Button2 Up and "don't care" about the other modifiers, use this specification: - -Button1 ~Button2 <Enter> : the() - + +Button1 ~Button2 <Enter> : the() + @@ -1173,9 +1173,9 @@ To indicate EnterNotify with Button1 down and Button2 down exclusively, use this specification: - -! Button1 Button2 <Enter> : wabe() - + +! Button1 Button2 <Enter> : wabe() + You do not need to use a tilde (~) with an exclamation point (!). diff --git a/specs/appC.xml b/specs/appC.xml index 9ca1035..bab8943 100644 --- a/specs/appC.xml +++ b/specs/appC.xml @@ -46,10 +46,10 @@ you could define the macro as: - -#define XtLabelCreate(name, parent, args, num_args) \ - ((LabelWidget) XtCreateWidget(name, labelWidgetClass, parent, args, num_args)) - + +#define XtLabelCreate(name, parent, args, num_args) \ + ((LabelWidget) XtCreateWidget(name, labelWidgetClass, parent, args, num_args)) + Pop-up shells in some of the prototypes automatically performed an -- cgit v1.2.3