diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-04-14 18:45:06 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-04-16 18:47:10 -0400 |
commit | aab9b50bb755d741ee54203f91bdfc464a95642f (patch) | |
tree | 1ea045c043e39dbccd3e6cf0a7fc0e6b4cad5696 /specs | |
parent | aa871eb5c087f3af40e49e77378a04fa872c7465 (diff) |
use programlisting tag rather than workaround for literallayout font.
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'specs')
-rw-r--r-- | specs/CH01.xml | 890 | ||||
-rw-r--r-- | specs/CH02.xml | 200 | ||||
-rw-r--r-- | specs/CH03.xml | 34 | ||||
-rw-r--r-- | specs/CH04.xml | 622 | ||||
-rw-r--r-- | specs/CH05.xml | 24 | ||||
-rw-r--r-- | specs/CH06.xml | 38 | ||||
-rw-r--r-- | specs/CH07.xml | 80 | ||||
-rw-r--r-- | specs/CH08.xml | 26 | ||||
-rw-r--r-- | specs/CH09.xml | 254 | ||||
-rw-r--r-- | specs/CH10.xml | 50 | ||||
-rw-r--r-- | specs/CH11.xml | 160 | ||||
-rw-r--r-- | specs/CH12.xml | 294 | ||||
-rw-r--r-- | specs/CH13.xml | 14 | ||||
-rw-r--r-- | specs/appB.xml | 108 | ||||
-rw-r--r-- | specs/appC.xml | 8 |
15 files changed, 1401 insertions, 1401 deletions
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 <function>CoreClassPart</function> structure. </para> -<literallayout> -<code>typedef struct {</code> -<code> WidgetClass superclass; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> String class_name; </code>See <xref linkend="Resource_Management" xrefstyle='select: label' /> -<code> Cardinal widget_size; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> XtProc class_initialize; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> XtWidgetClassProc class_part_initialize; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> XtEnum class_inited; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> XtInitProc initialize; </code>See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> -<code> XtArgsProc initialize_hook; </code>See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> -<code> XtRealizeProc realize; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> XtActionList actions; </code>See <xref linkend='Translation_Management' xrefstyle='select: label' /> -<code> Cardinal num_actions; </code>See <xref linkend='Translation_Management' xrefstyle='select: label' /> -<code> XtResourceList resources; </code>See <xref linkend="Resource_Management" xrefstyle='select: label' /> -<code> Cardinal num_resources; </code>See <xref linkend="Resource_Management" xrefstyle='select: label' /> -<code> XrmClass xrm_class; </code>Private to resource manager -<code> Boolean compress_motion; </code>See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> -<code> XtEnum compress_exposure; </code>See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> -<code> Boolean compress_enterleave; </code>See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> -<code> Boolean visible_interest; </code>See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> -<code> XtWidgetProc destroy; </code>See <xref linkend='Destroying_Widgets' xrefstyle='select: label' /> -<code> XtWidgetProc resize; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> XtExposeProc expose; </code>See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> -<code> XtSetValuesFunc set_values; </code>See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> -<code> XtArgsFunc set_values_hook; </code>See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> -<code> XtAlmostProc set_values_almost; </code>See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> -<code> XtArgsProc get_values_hook; </code>See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> -<code> XtAcceptFocusProc accept_focus; </code>See <xref linkend='Focusing_Events_on_a_Child' xrefstyle='select: label' /> -<code> XtVersionType version; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code> XtPointer callback_private; </code>Private to callbacks -<code> String tm_table; </code>See <xref linkend='Translation_Management' xrefstyle='select: label' /> -<code> XtGeometryHandler query_geometry; </code>See <xref linkend ='Geometry_Management' xrefstyle='select: label' /> -<code> XtStringProc display_accelerator; </code>See <xref linkend='Translation_Management' xrefstyle='select: label' /> -<code> XtPointer extension; </code>See <xref linkend="Widget_Classing" xrefstyle='select: label' /> -<code>} CoreClassPart;</code> -</literallayout> +<programlisting> +typedef struct { + WidgetClass superclass; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + String class_name; See <xref linkend="Resource_Management" xrefstyle='select: label' /> + Cardinal widget_size; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + XtProc class_initialize; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + XtWidgetClassProc class_part_initialize; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + XtEnum class_inited; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + XtInitProc initialize; See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> + XtArgsProc initialize_hook; See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> + XtRealizeProc realize; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + XtActionList actions; See <xref linkend='Translation_Management' xrefstyle='select: label' /> + Cardinal num_actions; See <xref linkend='Translation_Management' xrefstyle='select: label' /> + XtResourceList resources; See <xref linkend="Resource_Management" xrefstyle='select: label' /> + Cardinal num_resources; See <xref linkend="Resource_Management" xrefstyle='select: label' /> + XrmClass xrm_class; Private to resource manager + Boolean compress_motion; See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> + XtEnum compress_exposure; See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> + Boolean compress_enterleave; See <xref linkend='X_Event_Filters' xrefstyle='select: label' /> + Boolean visible_interest; See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> + XtWidgetProc destroy; See <xref linkend='Destroying_Widgets' xrefstyle='select: label' /> + XtWidgetProc resize; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + XtExposeProc expose; See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> + XtSetValuesFunc set_values; See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> + XtArgsFunc set_values_hook; See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> + XtAlmostProc set_values_almost; See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> + XtArgsProc get_values_hook; See <xref linkend='Reading_and_Writing_Widget_State' xrefstyle='select: label' /> + XtAcceptFocusProc accept_focus; See <xref linkend='Focusing_Events_on_a_Child' xrefstyle='select: label' /> + XtVersionType version; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> + XtPointer callback_private; Private to callbacks + String tm_table; See <xref linkend='Translation_Management' xrefstyle='select: label' /> + XtGeometryHandler query_geometry; See <xref linkend ='Geometry_Management' xrefstyle='select: label' /> + XtStringProc display_accelerator; See <xref linkend='Translation_Management' xrefstyle='select: label' /> + XtPointer extension; See <xref linkend="Widget_Classing" xrefstyle='select: label' /> +} CoreClassPart; +</programlisting> <para> All widget classes have the Core class fields as their first component. The prototypical @@ -262,11 +262,11 @@ and <function>CoreWidgetClass</function> are defined with only this set of fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> CoreClassPart core_class;</code> -<code>} WidgetClassRec, *WidgetClass, CoreClassRec, *CoreWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct { + CoreClassPart core_class; +} WidgetClassRec, *WidgetClass, CoreClassRec, *CoreWidgetClass; +</programlisting> <para> Various routines can cast widget class pointers, as needed, to specific widget class types. @@ -281,17 +281,17 @@ creating instances of Core are In <function>IntrinsicP.h</function>: </para> -<literallayout> -<code>extern WidgetClassRec widgetClassRec;</code> -<code>#define coreClassRec widgetClassRec</code> -</literallayout> +<programlisting> +extern WidgetClassRec widgetClassRec; +#define coreClassRec widgetClassRec +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern WidgetClass widgetClass, coreWidgetClass;</code> -</literallayout> +<programlisting> +extern WidgetClass widgetClass, coreWidgetClass; +</programlisting> <para> The opaque types <function>Widget</function> @@ -305,9 +305,9 @@ does not allow applications to access private data, the Intrinsics use incomplete structure definitions in <function>Intrinsic.h</function>: </para> -<literallayout> -<code>typedef struct _WidgetClassRec *WidgetClass, *CoreWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct _WidgetClassRec *WidgetClass, *CoreWidgetClass; +</programlisting> </sect3> <sect3 id="CorePart_Structure"> <title>CorePart Structure</title> @@ -316,49 +316,49 @@ All widget instances contain the fields defined in the <function>CorePart</function> structure. </para> -<literallayout> -<code>typedef struct _CorePart {</code> -<code> Widget self; </code>Described below -<code> WidgetClass widget_class; </code>See <xref linkend='Widget_Classing' xrefstyle='select: label' /> -<code> Widget parent; </code>See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> -<code> Boolean being_destroyed; </code>See <xref linkend='Destroying_Widgets' xrefstyle='select: label' /> -<code> XtCallbackList destroy_callbacks; </code><xref linkend='Destroying_Widgets' xrefstyle='select: label' /> -<code> XtPointer constraints; </code>See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> -<code> Position x; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> Position y; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> Dimension width; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> Dimension height; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> Dimension border_width; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> Boolean managed; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> Boolean sensitive; </code>See <xref linkend='Setting_and_Checking_the_Sensitivity_State_of_a_Widget' xrefstyle='select: label' /> -<code> Boolean ancestor_sensitive; </code>See <xref linkend='Setting_and_Checking_the_Sensitivity_State_of_a_Widget' xrefstyle='select: label' /> -<code> XtTranslations accelerators; </code>See <xref linkend='Translation_Management' xrefstyle='select: label' /> -<code> Pixel border_pixel; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Pixmap border_pixmap; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> WidgetList popup_list; </code>See <xref linkend='Pop_Up_Widgets' xrefstyle='select: label' /> -<code> Cardinal num_popups; </code>See <xref linkend='Pop_Up_Widgets' xrefstyle='select: label' /> -<code> String name; </code>See <xref linkend='Resource_Management' xrefstyle='select: label' /> -<code> Screen *screen; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Colormap colormap; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Window window; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Cardinal depth; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Pixel background_pixel; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Pixmap background_pixmap; </code>See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> -<code> Boolean visible; </code>See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> -<code> Boolean mapped_when_managed; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code>} CorePart;</code> -</literallayout> +<programlisting> +typedef struct _CorePart { + Widget self; Described below + WidgetClass widget_class; See <xref linkend='Widget_Classing' xrefstyle='select: label' /> + Widget parent; See <xref linkend='Creating_Widgets' xrefstyle='select: label' /> + Boolean being_destroyed; See <xref linkend='Destroying_Widgets' xrefstyle='select: label' /> + XtCallbackList destroy_callbacks; <xref linkend='Destroying_Widgets' xrefstyle='select: label' /> + XtPointer constraints; See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> + Position x; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + Position y; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + Dimension width; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + Dimension height; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + Dimension border_width; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + Boolean managed; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + Boolean sensitive; See <xref linkend='Setting_and_Checking_the_Sensitivity_State_of_a_Widget' xrefstyle='select: label' /> + Boolean ancestor_sensitive; See <xref linkend='Setting_and_Checking_the_Sensitivity_State_of_a_Widget' xrefstyle='select: label' /> + XtTranslations accelerators; See <xref linkend='Translation_Management' xrefstyle='select: label' /> + Pixel border_pixel; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Pixmap border_pixmap; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + WidgetList popup_list; See <xref linkend='Pop_Up_Widgets' xrefstyle='select: label' /> + Cardinal num_popups; See <xref linkend='Pop_Up_Widgets' xrefstyle='select: label' /> + String name; See <xref linkend='Resource_Management' xrefstyle='select: label' /> + Screen *screen; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Colormap colormap; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Window window; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Cardinal depth; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Pixel background_pixel; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Pixmap background_pixmap; See <xref linkend='Realizing_Widgets' xrefstyle='select: label' /> + Boolean visible; See <xref linkend='Widget_Exposure_and_Visibility' xrefstyle='select: label' /> + Boolean mapped_when_managed; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> +} CorePart; +</programlisting> <para> All widget instances have the Core fields as their first component. The prototypical type <function>Widget</function> is defined with only this set of fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code>} WidgetRec, *Widget, CoreRec, *CoreWidget;</code> -</literallayout> +<programlisting> +typedef struct { + CorePart core; +} WidgetRec, *Widget, CoreRec, *CoreWidget; +</programlisting> <para> 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 <function>Intrinsic.h</function>. </para> -<literallayout> -<code>typedef struct _WidgetRec *Widget, *CoreWidget;</code> -</literallayout> +<programlisting> +typedef struct _WidgetRec *Widget, *CoreWidget; +</programlisting> </sect3> <sect3 id="Core_Resources"> <title>Core Resources</title> @@ -631,15 +631,15 @@ Core class fields, widgets of the Composite class have the following class fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtGeometryHandler geometry_manager; </code>See <xref linkend='Geometry_Management' xrefstyle='select: label' /> -<code> XtWidgetProc change_managed; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> XtWidgetProc insert_child; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> XtWidgetProc delete_child; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> XtPointer extension; </code>See <xref linkend='Widget_Classing' xrefstyle='select: label' /> -<code>} CompositeClassPart;</code> -</literallayout> +<programlisting> +typedef struct { + XtGeometryHandler geometry_manager; See <xref linkend='Geometry_Management' xrefstyle='select: label' /> + XtWidgetProc change_managed; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + XtWidgetProc insert_child; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + XtWidgetProc delete_child; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + XtPointer extension; See <xref linkend='Widget_Classing' xrefstyle='select: label' /> +} CompositeClassPart; +</programlisting> <para> The extension record defined for <function>CompositeClassPart</function> @@ -649,27 +649,27 @@ equal to is <function>CompositeClassExtensionRec</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtPointer next_extension; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> XrmQuark record_type; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> long version; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> Cardinal record_size; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> Boolean accepts_objects; </code>See <xref linkend='Creating_a_Widget_Instance' xrefstyle='select: label' /> -<code> Boolean allows_change_managed_set; </code>See <xref linkend='Bundling_Changes_to_the_Managed_Set' xrefstyle='select: label' /> -<code>} CompositeClassExtensionRec, *CompositeClassExtension;</code> -</literallayout> +<programlisting> +typedef struct { + XtPointer next_extension; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + XrmQuark record_type; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + long version; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + Cardinal record_size; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + Boolean accepts_objects; See <xref linkend='Creating_a_Widget_Instance' xrefstyle='select: label' /> + Boolean allows_change_managed_set; See <xref linkend='Bundling_Changes_to_the_Managed_Set' xrefstyle='select: label' /> +} CompositeClassExtensionRec, *CompositeClassExtension; +</programlisting> <para> Composite classes have the Composite class fields immediately following the Core class fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code>} CompositeClassRec, *CompositeWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct { + CoreClassPart core_class; + CompositeClassPart composite_class; +} CompositeClassRec, *CompositeWidgetClass; +</programlisting> <para> The single occurrences of the class record and pointer for creating instances of Composite are @@ -679,16 +679,16 @@ instances of Composite are In <function>IntrinsicP.h</function>: </para> -<literallayout> -<code>extern CompositeClassRec compositeClassRec;</code> -</literallayout> +<programlisting> +extern CompositeClassRec compositeClassRec; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern WidgetClass compositeWidgetClass;</code> -</literallayout> +<programlisting> +extern WidgetClass compositeWidgetClass; +</programlisting> <para> The opaque types <function>CompositeWidget</function> @@ -708,9 +708,9 @@ uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. </para> -<literallayout> -<code>typedef struct _CompositeClassRec *CompositeWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct _CompositeClassRec *CompositeWidgetClass; +</programlisting> </sect3> <sect3 id="CompositePart_Structure"> <title>CompositePart Structure</title> @@ -723,33 +723,33 @@ instance fields defined in the <function>CompositePart</function> structure. </para> -<literallayout> -<code>typedef struct {</code> -<code> WidgetList children; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> Cardinal num_children; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> Cardinal num_slots; </code>See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> -<code> XtOrderProc insert_position; </code>See <xref linkend='Insertion_Order_of_Children_The_insert_position_Procedure' xrefstyle='select: label' /> -<code>} CompositePart;</code> -</literallayout> +<programlisting> +typedef struct { + WidgetList children; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + Cardinal num_children; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + Cardinal num_slots; See <xref linkend='Composite_Widgets_and_Their_Children' xrefstyle='select: label' /> + XtOrderProc insert_position; See <xref linkend='Insertion_Order_of_Children_The_insert_position_Procedure' xrefstyle='select: label' /> +} CompositePart; +</programlisting> <para> Composite widgets have the Composite instance fields immediately following the Core instance fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code>} CompositeRec, *CompositeWidget;</code> -</literallayout> +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; +} CompositeRec, *CompositeWidget; +</programlisting> <para> <function>Intrinsic.h</function> uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. </para> -<literallayout> -<code>typedef struct _CompositeRec *CompositeWidget;</code> -</literallayout> +<programlisting> +typedef struct _CompositeRec *CompositeWidget; +</programlisting> </sect3> <sect3 id="Composite_Resources"> <title>Composite Resources</title> @@ -877,17 +877,17 @@ class fields, widgets of the Constraint class have the following class fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtResourceList resources; </code>See <xref linkend='Resource_Management' xrefstyle='select: label' /> -<code> Cardinal num_resources; </code>See <xref linkend='Resource_Management' xrefstyle='select: label' /> -<code> Cardinal constraint_size; </code>See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> -<code> XtInitProc initialize; </code>See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> -<code> XtWidgetProc destroy; </code>See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> -<code> XtSetValuesFunc set_values; </code>See <xref linkend='Setting_Widget_State' xrefstyle='select: label' /> -<code> XtPointer extension; </code>See <xref linkend='Widget_Classing' xrefstyle='select: label' /> -<code>} ConstraintClassPart;</code> -</literallayout> +<programlisting> +typedef struct { + XtResourceList resources; See <xref linkend='Resource_Management' xrefstyle='select: label' /> + Cardinal num_resources; See <xref linkend='Resource_Management' xrefstyle='select: label' /> + Cardinal constraint_size; See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> + XtInitProc initialize; See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> + XtWidgetProc destroy; See <xref linkend='Constrained_Composite_Widgets' xrefstyle='select: label' /> + XtSetValuesFunc set_values; See <xref linkend='Setting_Widget_State' xrefstyle='select: label' /> + XtPointer extension; See <xref linkend='Widget_Classing' xrefstyle='select: label' /> +} ConstraintClassPart; +</programlisting> <para> The extension record defined for <function>ConstraintClassPart</function> @@ -896,27 +896,27 @@ with <emphasis remap='I'>record_type</emphasis> equal to is <function>ConstraintClassExtensionRec</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtPointer next_extension; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> XrmQuark record_type; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> long version; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> Cardinal record_size; </code>See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> -<code> XtArgsProc get_values_hook; </code>See <xref linkend='Obtaining_Widget_State' xrefstyle='select: label' /> -<code>} ConstraintClassExtensionRec, *ConstraintClassExtension;</code> -</literallayout> +<programlisting> +typedef struct { + XtPointer next_extension; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + XrmQuark record_type; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + long version; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + Cardinal record_size; See <xref linkend='Class_Extension_Records' xrefstyle='select: label' /> + XtArgsProc get_values_hook; See <xref linkend='Obtaining_Widget_State' xrefstyle='select: label' /> +} ConstraintClassExtensionRec, *ConstraintClassExtension; +</programlisting> <para> Constraint classes have the Constraint class fields immediately following the Composite class fields. </para> -<literallayout> -<code>typedef struct _ConstraintClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ConstraintClassPart constraint_class;</code> -<code>} ConstraintClassRec, *ConstraintWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct _ConstraintClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ConstraintClassPart constraint_class; +} ConstraintClassRec, *ConstraintWidgetClass; +</programlisting> <para> The single occurrences of the class record and pointer for creating instances of Constraint are @@ -926,16 +926,16 @@ instances of Constraint are In <function>IntrinsicP.h</function>: </para> -<literallayout> -<code>extern ConstraintClassRec constraintClassRec;</code> -</literallayout> +<programlisting> +extern ConstraintClassRec constraintClassRec; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern WidgetClass constraintWidgetClass;</code> -</literallayout> +<programlisting> +extern WidgetClass constraintWidgetClass; +</programlisting> <para> The opaque types <function>ConstraintWidget</function> @@ -955,9 +955,9 @@ version identifier is uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. </para> -<literallayout> -<code>typedef struct _ConstraintClassRec *ConstraintWidgetClass;</code> -</literallayout> +<programlisting> +typedef struct _ConstraintClassRec *ConstraintWidgetClass; +</programlisting> </sect3> <sect3 id="ConstraintPart_Structure"> <title>ConstraintPart Structure</title> @@ -972,31 +972,31 @@ instance fields defined in the <function>ConstraintPart</function> structure </para> -<literallayout> -<code>typedef struct {</code> -<code> int empty;</code> -<code>} ConstraintPart;</code> -</literallayout> +<programlisting> +typedef struct { + int empty; +} ConstraintPart; +</programlisting> <para> Constraint widgets have the Constraint instance fields immediately following the Composite instance fields. </para> -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ConstraintPart constraint;</code> -<code>} ConstraintRec, *ConstraintWidget;</code> -</literallayout> +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ConstraintPart constraint; +} ConstraintRec, *ConstraintWidget; +</programlisting> <para> <function>Intrinsic.h</function> uses an incomplete structure definition to ensure that the compiler catches attempts to access private data. </para> -<literallayout> -<code>typedef struct _ConstraintRec *ConstraintWidget;</code> -</literallayout> +<programlisting> +typedef struct _ConstraintRec *ConstraintWidget; +</programlisting> </sect3> <sect3 id="Constraint_Resources"> <title>Constraint Resources</title> @@ -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: </para> -<literallayout> -<code>#ifndef LABEL_H</code> -<code>#define LABEL_H</code> +<programlisting> +#ifndef LABEL_H +#define LABEL_H -<code>/* New resources */</code> -<code>#define XtNjustify "justify"</code> -<code>#define XtNforeground "foreground"</code> -<code>#define XtNlabel "label"</code> -<code>#define XtNfont "font"</code> -<code>#define XtNinternalWidth "internalWidth"</code> -<code>#define XtNinternalHeight "internalHeight"</code> +/* New resources */ +#define XtNjustify "justify" +#define XtNforeground "foreground" +#define XtNlabel "label" +#define XtNfont "font" +#define XtNinternalWidth "internalWidth" +#define XtNinternalHeight "internalHeight" -<code>/* Class record pointer */</code> -<code>extern WidgetClass labelWidgetClass;</code> +/* Class record pointer */ +extern WidgetClass labelWidgetClass; -<code>/* C Widget type definition */</code> -<code>typedef struct _LabelRec *LabelWidget;</code> +/* C Widget type definition */ +typedef struct _LabelRec *LabelWidget; -<code>/* New class method entry points */</code> -<code>extern void LabelSetText(Widget w, String text);</code> -<code>extern String LabelGetText(Widget w);</code> +/* New class method entry points */ +extern void LabelSetText(Widget w, String text); +extern String LabelGetText(Widget w); -<code>#endif LABEL_H</code> -</literallayout> +#endif LABEL_H +</programlisting> <para> 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. <para> For example, the following is the private .h file for a possible Label widget: </para> -<literallayout> -<code>#ifndef LABELP_H</code> -<code>#define LABELP_H</code> - -<code>#include <X11/Label.h></code> - -<code>/* New representation types used by the Label widget */</code> -<code>#define XtRJustify "Justify"</code> - -<code>/* New fields for the Label widget record */</code> -<code>typedef struct {</code> -<code>/* Settable resources */</code> -<code> Pixel foreground;</code> -<code> XFontStruct *font;</code> -<code> String label; /* text to display */</code> -<code> XtJustify justify;</code> -<code> Dimension internal_width; /* # pixels horizontal border */</code> -<code> Dimension internal_height; /* # pixels vertical border */</code> -<code>/* Data derived from resources */</code> -<code> GC normal_GC;</code> -<code> GC gray_GC;</code> -<code> Pixmap gray_pixmap;</code> -<code> Position label_x;</code> -<code> Position label_y;</code> -<code> Dimension label_width;</code> -<code> Dimension label_height;</code> -<code> Cardinal label_len;</code> -<code> Boolean display_sensitive;</code> -<code>} LabelPart;</code> - -<code>/* Full instance record declaration */</code> -<code>typedef struct _LabelRec {</code> -<code> CorePart core;</code> -<code> LabelPart label;</code> -<code>} LabelRec;</code> - -<code>/* Types for Label class methods */</code> -<code>typedef void (*LabelSetTextProc)(Widget w, String text);</code> -<code>typedef String (*LabelGetTextProc)(Widget w);</code> - -<code>/* New fields for the Label widget class record */</code> -<code>typedef struct {</code> -<code> LabelSetTextProc set_text;</code> -<code> LabelGetTextProc get_text;</code> -<code> XtPointer extension;</code> -<code>} LabelClassPart;</code> - -<code>/* Full class record declaration */</code> -<code>typedef struct _LabelClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> LabelClassPart label_class;</code> -<code>} LabelClassRec;</code> - -<code>/* Class record variable */</code> -<code>extern LabelClassRec labelClassRec;</code> - -<code>#define LabelInheritSetText((LabelSetTextProc)_XtInherit)</code> -<code>#define LabelInheritGetText((LabelGetTextProc)_XtInherit)</code> - -<code>#endif LABELP_H</code> -</literallayout> +<programlisting> +#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 +</programlisting> <para> 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 <xref linkend='Resource_Management' />. </para> -<literallayout> -<code>/* Resources specific to Label */</code> -<code>static XtResource resources[] = {</code> -<code> {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),</code> -<code> XtOffset(LabelWidget, label.foreground), XtRString,</code> -<code> XtDefaultForeground},</code> -<code> {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),</code> -<code> XtOffset(LabelWidget, label.font),XtRString,</code> -<code> XtDefaultFont},</code> -<code> {XtNlabel, XtCLabel, XtRString, sizeof(String),</code> -<code> XtOffset(LabelWidget, label.label), XtRString, NULL},</code> -<code> .</code> -<code> .</code> -<code> .</code> -<code>}</code> - -<code>/* Forward declarations of procedures */</code> -<code>static void ClassInitialize();</code> -<code>static void Initialize();</code> -<code>static void Realize();</code> -<code>static void SetText();</code> -<code>static void GetText();</code> -<code> .</code> -<code> .</code> -<code> .</code> -</literallayout> -<literallayout> -<code>/* Class record constant */</code> -<code>LabelClassRec labelClassRec = {</code> -<code> {</code> -<code> /* core_class fields */</code> -<code> /* superclass */ (WidgetClass)&coreClassRec,</code> -<code> /* class_name */ "Label",</code> -<code> /* widget_size */ sizeof(LabelRec),</code> -<code> /* class_initialize */ ClassInitialize,</code> -<code> /* class_part_initialize */ NULL,</code> -<code> /* class_inited */ False,</code> -<code> /* initialize */ Initialize,</code> -<code> /* initialize_hook */ NULL,</code> -<code> /* realize */ Realize,</code> -<code> /* actions */ NULL,</code> -<code> /* num_actions */ 0,</code> -<code> /* resources */ resources,</code> -<code> /* num_resources */ XtNumber(resources),</code> -<code> /* xrm_class */ NULLQUARK,</code> -<code> /* compress_motion */ True,</code> -<code> /* compress_exposure */ True,</code> -<code> /* compress_enterleave */ True,</code> -<code> /* visible_interest */ False,</code> -<code> /* destroy */ NULL,</code> -<code> /* resize */ Resize,</code> -<code> /* expose */ Redisplay,</code> -<code> /* set_values */ SetValues,</code> -<code> /* set_values_hook */ NULL,</code> -<code> /* set_values_almost */ XtInheritSetValuesAlmost,</code> -<code> /* get_values_hook */ NULL,</code> -<code> /* accept_focus */ NULL,</code> -<code> /* version */ XtVersion,</code> -<code> /* callback_offsets */ NULL,</code> -<code> /* tm_table */ NULL,</code> -<code> /* query_geometry */ XtInheritQueryGeometry,</code> -<code> /* display_accelerator */ NULL,</code> -<code> /* extension */ NULL</code> -<code> },</code> -<code> {</code> -<code> /* Label_class fields */</code> -<code> /* get_text */ GetText,</code> -<code> /* set_text */ SetText,</code> -<code> /* extension */ NULL</code> -<code> }</code> -<code>};</code> - -<code>/* Class record pointer */</code> -<code>WidgetClass labelWidgetClass = (WidgetClass) &labelClassRec;</code> - -<code>/* New method access routines */</code> -<code>void LabelSetText(Widget w, String text)</code> -<code>{</code> -<code> LabelWidgetClass lwc = (Label WidgetClass)XtClass(w);</code> -<code> XtCheckSubclass(w, labelWidgetClass, NULL);</code> -<code> *(lwc->label_class.set_text)(w, text)</code> -<code>}</code> - -<code>/* Private procedures */</code> -<code> .</code> -<code> .</code> -<code> .</code> -</literallayout> +<programlisting> +/* 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(); + . + . + . +</programlisting> +<programlisting> +/* 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 */ + . + . + . +</programlisting> </sect2> <sect2 id="Widget_Class_and_Superclass_Look_Up"> @@ -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</para> -<literallayout> -<code>In all widget classes: </code><emphasis remap='I'>class_name</emphasis> -<code> </code><emphasis remap='I'>class_initialize</emphasis> -<code> </code><emphasis remap='I'>widget_size</emphasis> -<code> </code><emphasis remap='I'>realize</emphasis> -<code> </code><emphasis remap='I'>visible_interest</emphasis> -<code> </code><emphasis remap='I'>resize</emphasis> -<code> </code><emphasis remap='I'>expose</emphasis> -<code> </code><emphasis remap='I'>accept_focus</emphasis> -<code> </code><emphasis remap='I'>compress_motion</emphasis> -<code> </code><emphasis remap='I'>compress_exposure</emphasis> -<code> </code><emphasis remap='I'>compress_enterleave</emphasis> -<code> </code><emphasis remap='I'>set_values_almost</emphasis> -<code> </code><emphasis remap='I'>tm_table</emphasis> -<code> </code><emphasis remap='I'>version</emphasis> -<code> </code><emphasis remap='I'>allocate</emphasis> -<code> </code><emphasis remap='I'>deallocate</emphasis> - -<code>In Composite widget classes: </code><emphasis remap='I'>geometry_manager</emphasis> -<code> </code><emphasis remap='I'>change_managed</emphasis> -<code> </code><emphasis remap='I'>insert_child</emphasis> -<code> </code><emphasis remap='I'>delete_child</emphasis> -<code> </code><emphasis remap='I'>accepts_objects</emphasis> -<code> </code><emphasis remap='I'>allows_change_managed_set</emphasis> - -<code>In Constraint widget classes: </code><emphasis remap='I'>constraint_size</emphasis> - -<code>In Shell widget classes: </code><emphasis remap='I'>root_geometry_manager</emphasis> -</literallayout> +<programlisting> +In all widget classes: <emphasis remap='I'>class_name</emphasis> + <emphasis remap='I'>class_initialize</emphasis> + <emphasis remap='I'>widget_size</emphasis> + <emphasis remap='I'>realize</emphasis> + <emphasis remap='I'>visible_interest</emphasis> + <emphasis remap='I'>resize</emphasis> + <emphasis remap='I'>expose</emphasis> + <emphasis remap='I'>accept_focus</emphasis> + <emphasis remap='I'>compress_motion</emphasis> + <emphasis remap='I'>compress_exposure</emphasis> + <emphasis remap='I'>compress_enterleave</emphasis> + <emphasis remap='I'>set_values_almost</emphasis> + <emphasis remap='I'>tm_table</emphasis> + <emphasis remap='I'>version</emphasis> + <emphasis remap='I'>allocate</emphasis> + <emphasis remap='I'>deallocate</emphasis> + +In Composite widget classes: <emphasis remap='I'>geometry_manager</emphasis> + <emphasis remap='I'>change_managed</emphasis> + <emphasis remap='I'>insert_child</emphasis> + <emphasis remap='I'>delete_child</emphasis> + <emphasis remap='I'>accepts_objects</emphasis> + <emphasis remap='I'>allows_change_managed_set</emphasis> + +In Constraint widget classes: <emphasis remap='I'>constraint_size</emphasis> + +In Shell widget classes: <emphasis remap='I'>root_geometry_manager</emphasis> +</programlisting> <para> 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 </para> -<literallayout> -<code> </code><emphasis remap='I'>class_part_initialize</emphasis> -<code> </code><emphasis remap='I'>get_values_hook</emphasis> -<code> </code><emphasis remap='I'>initialize</emphasis> -<code> </code><emphasis remap='I'>initialize_hook</emphasis> -<code> </code><emphasis remap='I'>set_values</emphasis> -<code> </code><emphasis remap='I'>set_values_hook</emphasis> -<code> </code><emphasis remap='I'>resources</emphasis> -</literallayout> +<programlisting> + <emphasis remap='I'>class_part_initialize</emphasis> + <emphasis remap='I'>get_values_hook</emphasis> + <emphasis remap='I'>initialize</emphasis> + <emphasis remap='I'>initialize_hook</emphasis> + <emphasis remap='I'>set_values</emphasis> + <emphasis remap='I'>set_values_hook</emphasis> + <emphasis remap='I'>resources</emphasis> +</programlisting> <para> In addition, for subclasses of @@ -2151,12 +2151,12 @@ structures are chained from the Constraint class down to the subclass: </para> -<literallayout> -<code> </code><emphasis remap='I'>resources</emphasis> -<code> </code><emphasis remap='I'>initialize</emphasis> -<code> </code><emphasis remap='I'>set_values</emphasis> -<code> </code><emphasis remap='I'>get_values_hook</emphasis> -</literallayout> +<programlisting> + <emphasis remap='I'>resources</emphasis> + <emphasis remap='I'>initialize</emphasis> + <emphasis remap='I'>set_values</emphasis> + <emphasis remap='I'>get_values_hook</emphasis> +</programlisting> <para> With upward superclass chaining, @@ -2170,10 +2170,10 @@ Object class structures. The subclass-to-superclass fields are </para> -<literallayout> -<code> </code><emphasis remap='I'>destroy</emphasis> -<code> </code><emphasis remap='I'>actions</emphasis> -</literallayout> +<programlisting> + <emphasis remap='I'>destroy</emphasis> + <emphasis remap='I'>actions</emphasis> +</programlisting> <para> For subclasses of @@ -2296,13 +2296,13 @@ a class structure is constant. <para> The following example provides the class initialization procedure for a Label class. </para> -<literallayout> -<code>static void ClassInitialize()</code> -<code>{</code> -<code> XtSetTypeConverter(XtRString, XtRJustify, CvtStringToJustify,</code> -<code> NULL, 0, XtCacheNone, NULL);</code> -<code>}</code> -</literallayout> +<programlisting> +static void ClassInitialize() +{ + XtSetTypeConverter(XtRString, XtRJustify, CvtStringToJustify, + NULL, 0, XtCacheNone, NULL); +} +</programlisting> </sect2> <sect2 id="Initializing_a_Widget_Class"> @@ -2428,30 +2428,30 @@ For example, <function>CompositeP.h</function> contains these definitions: </para> -<literallayout> -<code>#define XtInheritGeometryManager ((XtGeometryHandler) _XtInherit)</code> -<code>#define XtInheritChangeManaged ((XtWidgetProc) _XtInherit)</code> -<code>#define XtInheritInsertChild ((XtArgsProc) _XtInherit)</code> -<code>#define XtInheritDeleteChild ((XtWidgetProc) _XtInherit)</code> -</literallayout> +<programlisting> +#define XtInheritGeometryManager ((XtGeometryHandler) _XtInherit) +#define XtInheritChangeManaged ((XtWidgetProc) _XtInherit) +#define XtInheritInsertChild ((XtArgsProc) _XtInherit) +#define XtInheritDeleteChild ((XtWidgetProc) _XtInherit) +</programlisting> <para> Composite's class_part_initialize procedure begins as follows: </para> -<literallayout> -<code>static void CompositeClassPartInitialize(WidgetClass widgetClass)</code> -<code>{</code> -<code> CompositeWidgetClass wc = (CompositeWidgetClass)widgetClass;</code> -<code> CompositeWidgetClass super = (CompositeWidgetClass)wc->core_class.superclass;</code> -<code> if (wc->composite_class.geometry_manager == XtInheritGeometryManager) {</code> -<code> wc->composite_class.geometry_manager = super->composite_class.geometry_manager;</code> -<code> }</code> -<code> if (wc->composite_class.change_managed == XtInheritChangeManaged) {</code> -<code> wc->composite_class.change_managed = super->composite_class.change_managed;</code> -<code> }</code> -<code> .</code> -<code> .</code> -<code> .</code> -</literallayout> +<programlisting> +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; + } + . + . + . +</programlisting> <para> 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: </para> -<literallayout> -<code>struct {</code> -<code> XtPointer next_extension;</code> -<code> XrmQuark record_type;</code> -<code> long version;</code> -<code> Cardinal record_size;</code> -<code>};</code> -</literallayout> +<programlisting> +struct { + XtPointer next_extension; + XrmQuark record_type; + long version; + Cardinal record_size; +}; +</programlisting> <variablelist> <varlistentry> 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 <xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>, as in the following example. </para> -<literallayout> -<code> Widget top;</code> -<code> XtSetLanguageProc(NULL, NULL, NULL);</code> -<code> top = XtOpenApplication(</code>...<code>);</code> -<code> </code>... -</literallayout> +<programlisting> + Widget top; + XtSetLanguageProc(NULL, NULL, NULL); + top = XtOpenApplication(...); + ... +</programlisting> </sect1> <sect1 id="Loading_the_Resource_Database"> @@ -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: </para> -<literallayout> -<code> 1. %C, %N, %L or %C, %N, %l, %t, %c</code> -<code> 2. %C, %N, %l</code> -<code> 3. %C, %N</code> -<code> 4. %N, %L or %N, %l, %t, %c</code> -<code> 5. %N, %l</code> -<code> 6. %N</code> -</literallayout> +<programlisting> + 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 +</programlisting> <para> 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: </para> -<literallayout> -<code> 1. $XAPPLRESDIR with %C, %N, %L or %C, %N, %l, %t, %c</code> -<code> 2. $XAPPLRESDIR with %C, %N, %l</code> -<code> 3. $XAPPLRESDIR with %C, %N</code> -<code> 4. $XAPPLRESDIR with %N, %L or %N, %l, %t, %c</code> -<code> 5. $XAPPLRESDIR with %N, %l</code> -<code> 6. $XAPPLRESDIR with %N</code> -<code> 7. $HOME with %N</code> -</literallayout> +<programlisting> + 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 +</programlisting> <para> 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 <emphasis remap='I'>Xlib — C Language X Interface</emphasis>. </para> -<literallayout> -<code>typedef enum {</code> -<code> XrmoptionNoArg, /* Value is specified in OptionDescRec.value */</code> -<code> XrmoptionIsArg, /* Value is the option string itself */</code> -<code> XrmoptionStickyArg, /* Value is characters immediately following option */</code> -<code> XrmoptionSepArg, /* Value is next argument in argv */</code> -<code> XrmoptionResArg, /* Use the next argument as input to XrmPutLineResource*/</code> -<code> XrmoptionSkipArg, /* Ignore this option and the next argument in argv */</code> -<code> XrmoptionSkipNArgs, /* Ignore this option and the next */</code> -<code> /* OptionDescRec.value arguments in argv */</code> -<code> XrmoptionSkipLine /* Ignore this option and the rest of argv */</code> -<code>} XrmOptionKind;</code> - -<code>typedef struct {</code> -<code> char *option; /* Option name in argv */</code> -<code> char *specifier; /* Resource name (without application name) */</code> -<code> XrmOptionKind argKind; /* Location of the resource value */</code> -<code> XPointer value; /* Value to provide if XrmoptionNoArg */</code> -<code>} XrmOptionDescRec, *XrmOptionDescList;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para>The standard table contains the following entries:</para> <informaltable frame='topbot'> @@ -1503,9 +1503,9 @@ to give a red background to all command buttons in an application named <function>xmh</function>, you can start it up as </para> -<literallayout> -<code>xmh -xrm 'xmh*Command.background: red'</code> -</literallayout> +<programlisting> +xmh -xrm 'xmh*Command.background: red' +</programlisting> <para> When it parses the command line, <xref linkend='XtDisplayInitialize' xrefstyle='select: title'/> @@ -1611,12 +1611,12 @@ These are passed as an arglist, a pointer to an array of <function>Arg</function> structures, which contains </para> -<literallayout> -<code>typedef struct {</code> -<code> String name;</code> -<code> XtArgVal value;</code> -<code>} Arg, *ArgList;</code> -</literallayout> +<programlisting> +typedef struct { + String name; + XtArgVal value; +} Arg, *ArgList; +</programlisting> <para> where <function>XtArgVal</function> @@ -1688,26 +1688,26 @@ The function is usually used in a highly stylized manner to minimize the probability of making a mistake; for example: </para> -<literallayout> -<code>Arg args[20];</code> -<code>int n;</code> -<code>n = 0;</code> -<code>XtSetArg(args[n], XtNheight, 100); n++;</code> -<code>XtSetArg(args[n], XtNwidth, 200); n++;</code> -<code>XtSetValues(widget, args, n);</code> -</literallayout> +<programlisting> +Arg args[20]; +int n; +n = 0; +XtSetArg(args[n], XtNheight, 100); n++; +XtSetArg(args[n], XtNwidth, 200); n++; +XtSetValues(widget, args, n); +</programlisting> <para> Alternatively, an application can statically declare the argument list and use <xref linkend='XtNumber' xrefstyle='select: title'/>: </para> -<literallayout> -<code>static Args args[] = {</code> -<code> {XtNheight, (XtArgVal) 100},</code> -<code> {XtNwidth, (XtArgVal) 200},</code> -<code>};</code> -<code>XtSetValues(Widget, args, XtNumber(args));</code> -</literallayout> +<programlisting> +static Args args[] = { + {XtNheight, (XtArgVal) 100}, + {XtNwidth, (XtArgVal) 200}, +}; +XtSetValues(Widget, args, XtNumber(args)); +</programlisting> <para> 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 <function>XtVaNestedList</function>. </para> -<literallayout> -<code>#define XtVaTypedArg "XtVaTypedArg"</code> -</literallayout> +<programlisting> +#define XtVaTypedArg "XtVaTypedArg" +</programlisting> <para> If the name <function>XtVaTypedArg</function> @@ -1852,9 +1852,9 @@ otherwise <emphasis remap='I'>value</emphasis> is a pointer to the data. If the conversion fails for any reason, a warning message is issued and the list entry is skipped. </para> -<literallayout> -<code>#define XtVaNestedList "XtVaNestedList"</code> -</literallayout> +<programlisting> +#define XtVaNestedList "XtVaNestedList" +</programlisting> <para> If the name <function>XtVaNestedList</function> @@ -1873,9 +1873,9 @@ To dynamically allocate a varargs list for use with in multiple calls, use <xref linkend='XtVaCreateArgsList' xrefstyle='select: title'/>. </para> -<literallayout> -<code>typedef XtPointer XtVarArgsList;</code> -</literallayout> +<programlisting> +typedef XtPointer XtVarArgsList; +</programlisting> <funcsynopsis id='XtVaCreateArgsList'> <funcprototype> @@ -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: </para> -<literallayout> -<code>xmail.geometry:</code>...<code> (the main window)</code> -<code>xmail.read.geometry:</code>...<code> (the read window)</code> -<code>xmail.compose.geometry:</code>...<code> (the compose window)</code> -</literallayout> +<programlisting> +xmail.geometry:... (the main window) +xmail.read.geometry:... (the read window) +xmail.compose.geometry:... (the compose window) +</programlisting> <para> The second method, which is best if there is no main window, leads to resource specifications like the following: </para> -<literallayout> -<code>xmail.headers.geometry:</code>...<code> (the headers window)</code> -<code>xmail.read.geometry:</code>...<code> (the read window)</code> -<code>xmail.compose.geometry:</code>...<code> (the compose window)</code> -</literallayout> +<programlisting> +xmail.headers.geometry:... (the headers window) +xmail.read.geometry:... (the read window) +xmail.compose.geometry:... (the compose window) +</programlisting> <para> 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 <function>XtTypedArgList</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> String name;</code> -<code> String type;</code> -<code> XtArgVal value;</code> -<code> int size;</code> -<code>} XtTypedArg, *XtTypedArgList;</code> -</literallayout> +<programlisting> +typedef struct { + String name; + String type; + XtArgVal value; + int size; +} XtTypedArg, *XtTypedArgList; +</programlisting> <para> The allocate procedure pointer in the <function>ObjectClassExtension</function> @@ -4270,9 +4270,9 @@ procedure <emphasis remap='I'>ClientDestroy</emphasis> with client data to a wid <xref linkend='XtAddCallback' xrefstyle='select: title'/>. </para> -<literallayout> -<code>XtAddCallback(</code><emphasis remap='I'>w</emphasis><code>, XtNdestroyCallback, </code><emphasis remap='I'>ClientDestroy</emphasis><code>, </code><emphasis remap='I'>client_data</emphasis><code>)</code> -</literallayout> +<programlisting> +XtAddCallback(<emphasis remap='I'>w</emphasis>, XtNdestroyCallback, <emphasis remap='I'>ClientDestroy</emphasis>, <emphasis remap='I'>client_data</emphasis>) +</programlisting> <para> Similarly, the following removes the application-supplied destroy callback @@ -4280,9 +4280,9 @@ procedure <emphasis remap='I'>ClientDestroy</emphasis> by calling <xref linkend='XtRemoveCallback' xrefstyle='select: title'/>. </para> -<literallayout> -<code>XtRemoveCallback(</code><emphasis remap='I'>w</emphasis><code>, XtNdestroyCallback, </code><emphasis remap='I'>ClientDestroy</emphasis><code>, </code><emphasis remap='I'>client_data</emphasis><code>)</code> -</literallayout> +<programlisting> +XtRemoveCallback(<emphasis remap='I'>w</emphasis>, XtNdestroyCallback, <emphasis remap='I'>ClientDestroy</emphasis>, <emphasis remap='I'>client_data</emphasis>) +</programlisting> <para> The <emphasis remap='I'>ClientDestroy</emphasis> argument is of type <xref linkend='XtCallbackProc' xrefstyle='select: title'/>; 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: </para> -<literallayout> -<code>typedef struct {</code> -<code> Dimension max_width, max_height;</code> -<code>} MaxConstraintPart;</code> -<code>typedef struct {</code> -<code> MaxConstraintPart max;</code> -<code>} MaxConstraintRecord, *MaxConstraint;</code> -</literallayout> +<programlisting> +typedef struct { + Dimension max_width, max_height; +} MaxConstraintPart; +typedef struct { + MaxConstraintPart max; +} MaxConstraintRecord, *MaxConstraint; +</programlisting> <para> A subclass of this widget class that also needs to maintain a minimum size would define its constraint record as follows: </para> -<literallayout> -<code>typedef struct {</code> -<code> Dimension min_width, min_height;</code> -<code>} MinConstraintPart;</code> -<code>typedef struct {</code> -<code> MaxConstraintPart max;</code> -<code> MinConstraintPart min;</code> -<code>} MaxMinConstraintRecord, *MaxMinConstraint;</code> -</literallayout> +<programlisting> +typedef struct { + Dimension min_width, min_height; +} MinConstraintPart; +typedef struct { + MaxConstraintPart max; + MinConstraintPart min; +} MaxMinConstraintRecord, *MaxMinConstraint; +</programlisting> <para> 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: </para> -<literallayout> -<code>typedef struct {</code> -<code> XtPointer extension;</code> -<code>} ShellClassPart, OverrideShellClassPart,</code> -<code>WMShellClassPart, VendorShellClassPart, TransientShellClassPart,</code> -<code>TopLevelShellClassPart, ApplicationShellClassPart, SessionShellClassPart;</code> -</literallayout> +<programlisting> +typedef struct { + XtPointer extension; +} ShellClassPart, OverrideShellClassPart, +WMShellClassPart, VendorShellClassPart, TransientShellClassPart, +TopLevelShellClassPart, ApplicationShellClassPart, SessionShellClassPart; +</programlisting> <para>The full Shell class record definitions are:</para> -<literallayout> -<code>typedef struct _ShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code>} ShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> XtPointer next_extension; </code>See <xref linkend='Class_Extension_Records' /> -<code> XrmQuark record_type; </code>See <xref linkend='Class_Extension_Records' /> -<code> long version; </code>See <xref linkend='Class_Extension_Records' /> -<code> Cardinal record_size; </code>See <xref linkend='Class_Extension_Records' /> -<code> XtGeometryHandler root_geometry_manager; </code>See below -<code>} ShellClassExtensionRec, *ShellClassExtension;</code> -</literallayout> - -<literallayout> -<code>typedef struct _OverrideShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> OverrideShellClassPart override_shell_class;</code> -<code>} OverrideShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _WMShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code>} WMShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _VendorShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code> VendorShellClassPart vendor_shell_class;</code> -<code>} VendorShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _TransientShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code> VendorShellClassPart vendor_shell_class;</code> -<code> TransientShellClassPart transient_shell_class;</code> -<code>} TransientShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _TopLevelShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code> VendorShellClassPart vendor_shell_class;</code> -<code> TopLevelShellClassPart top_level_shell_class;</code> -<code>} TopLevelShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _ApplicationShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code> VendorShellClassPart vendor_shell_class;</code> -<code> TopLevelShellClassPart top_level_shell_class;</code> -<code> ApplicationShellClassPart application_shell_class;</code> -<code>} ApplicationShellClassRec;</code> -</literallayout> - -<literallayout> -<code>typedef struct _SessionShellClassRec {</code> -<code> CoreClassPart core_class;</code> -<code> CompositeClassPart composite_class;</code> -<code> ShellClassPart shell_class;</code> -<code> WMShellClassPart wm_shell_class;</code> -<code> VendorShellClassPart vendor_shell_class;</code> -<code> TopLevelShellClassPart top_level_shell_class;</code> -<code> ApplicationShellClassPart application_shell_class;</code> -<code> SessionShellClassPart session_shell_class;</code> -<code>} SessionShellClassRec;</code> -</literallayout> +<programlisting> +typedef struct _ShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; +} ShellClassRec; +</programlisting> + +<programlisting> +typedef struct { + XtPointer next_extension; See <xref linkend='Class_Extension_Records' /> + XrmQuark record_type; See <xref linkend='Class_Extension_Records' /> + long version; See <xref linkend='Class_Extension_Records' /> + Cardinal record_size; See <xref linkend='Class_Extension_Records' /> + XtGeometryHandler root_geometry_manager; See below +} ShellClassExtensionRec, *ShellClassExtension; +</programlisting> + +<programlisting> +typedef struct _OverrideShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + OverrideShellClassPart override_shell_class; +} OverrideShellClassRec; +</programlisting> + +<programlisting> +typedef struct _WMShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; +} WMShellClassRec; +</programlisting> + +<programlisting> +typedef struct _VendorShellClassRec { + CoreClassPart core_class; + CompositeClassPart composite_class; + ShellClassPart shell_class; + WMShellClassPart wm_shell_class; + VendorShellClassPart vendor_shell_class; +} VendorShellClassRec; +</programlisting> + +<programlisting> +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; +</programlisting> + +<programlisting> +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; +</programlisting> + +<programlisting> +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; +</programlisting> + +<programlisting> +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; +</programlisting> <para> The single occurrences of the class records and pointers for creating instances of shells are: </para> -<literallayout> -<code>extern ShellClassRec shellClassRec;</code> -<code>extern OverrideShellClassRec overrideShellClassRec;</code> -<code>extern WMShellClassRec wmShellClassRec;</code> -<code>extern VendorShellClassRec vendorShellClassRec;</code> -<code>extern TransientShellClassRec transientShellClassRec;</code> -<code>extern TopLevelShellClassRec topLevelShellClassRec;</code> -<code>extern ApplicationShellClassRec applicationShellClassRec;</code> -<code>extern SessionShellClassRec sessionShellClassRec;</code> -<code>extern WidgetClass shellWidgetClass;</code> -<code>extern WidgetClass overrideShellWidgetClass;</code> -<code>extern WidgetClass wmShellWidgetClass;</code> -<code>extern WidgetClass vendorShellWidgetClass;</code> -<code>extern WidgetClass transientShellWidgetClass;</code> -<code>extern WidgetClass topLevelShellWidgetClass;</code> -<code>extern WidgetClass applicationShellWidgetClass;</code> -<code>extern WidgetClass sessionShellWidgetClass;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> The following opaque types and opaque variables are defined @@ -476,191 +476,191 @@ fields defined in their widget records: </para> -<literallayout> -<code>typedef struct {</code> -<code> String geometry;</code> -<code> XtCreatePopupChildProc create_popup_child_proc;</code> -<code> XtGrabKind grab_kind;</code> -<code> Boolean spring_loaded;</code> -<code> Boolean popped_up;</code> -<code> Boolean allow_shell_resize;</code> -<code> Boolean client_specified;</code> -<code> Boolean save_under;</code> -<code> Boolean override_redirect;</code> -<code> XtCallbackList popup_callback;</code> -<code> XtCallbackList popdown_callback;</code> -<code> Visual * visual;</code> -<code>} ShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> int empty;</code> -<code>} OverrideShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> String title;</code> -<code> int wm_timeout;</code> -<code> Boolean wait_for_wm;</code> -<code> Boolean transient;</code> -<code> Boolean urgency;</code> -<code> Widget client_leader;</code> -<code> String window_role;</code> -<code> struct _OldXSizeHints {</code> -<code> long flags;</code> -<code> int x, y;</code> -<code> int width, height;</code> -<code> int min_width, min_height;</code> -<code> int max_width, max_height;</code> -<code> int width_inc, height_inc;</code> -<code> struct {</code> -<code> int x;</code> -<code> int y;</code> -<code> } min_aspect, max_aspect;</code> -<code> } size_hints;</code> -<code> XWMHints wm_hints;</code> -<code> int base_width, base_height, win_gravity;</code> -<code> Atom title_encoding;</code> -<code>} WMShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> int vendor_specific;</code> -<code>} VendorShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> Widget transient_for;</code> -<code>} TransientShellPart;</code> -<code>typedef struct {</code> -<code> String icon_name;</code> -<code> Boolean iconic;</code> -<code> Atom icon_name_encoding;</code> -<code>} TopLevelShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> char * class;</code> -<code> XrmClass xrm_class;</code> -<code> int argc;</code> -<code> char ** argv;</code> -<code>} ApplicationShellPart;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> SmcConn connection;</code> -<code> String session_id;</code> -<code> String * restart_command;</code> -<code> String * clone_command;</code> -<code> String * discard_command;</code> -<code> String * resign_command;</code> -<code> String * shutdown_command;</code> -<code> String * environment;</code> -<code> String current_dir;</code> -<code> String program_path;</code> -<code> unsigned char restart_style;</code> -<code> Boolean join_session;</code> -<code> XtCallbackList save_callbacks;</code> -<code> XtCallbackList interact_callbacks;</code> -<code> XtCallbackList cancel_callbacks;</code> -<code> XtCallbackList save_complete_callbacks;</code> -<code> XtCallbackList die_callbacks;</code> -<code> XtCallbackList error_callbacks;</code> -<code>} SessionShellPart;</code> -</literallayout> +<programlisting> +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; +</programlisting> + +<programlisting> +typedef struct { + int empty; +} OverrideShellPart; +</programlisting> + +<programlisting> +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; +</programlisting> + +<programlisting> +typedef struct { + int vendor_specific; +} VendorShellPart; +</programlisting> + +<programlisting> +typedef struct { + Widget transient_for; +} TransientShellPart; +typedef struct { + String icon_name; + Boolean iconic; + Atom icon_name_encoding; +} TopLevelShellPart; +</programlisting> + +<programlisting> +typedef struct { + char * class; + XrmClass xrm_class; + int argc; + char ** argv; +} ApplicationShellPart; +</programlisting> + +<programlisting> +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; +</programlisting> <para> The full shell widget instance record definitions are: </para> -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code>} ShellRec, *ShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> OverrideShellPart override;</code> -<code>} OverrideShellRec, *OverrideShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code>} WMShellRec, *WMShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code> VendorShellPart vendor;</code> -<code>} VendorShellRec, *VendorShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code> VendorShellPart vendor;</code> -<code> TransientShellPart transient;</code> -<code>} TransientShellRec, *TransientShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code> VendorShellPart vendor;</code> -<code> TopLevelShellPart topLevel;</code> -<code>} TopLevelShellRec, *TopLevelShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code> VendorShellPart vendor;</code> -<code> TopLevelShellPart topLevel;</code> -<code> ApplicationShellPart application;</code> -<code>} ApplicationShellRec, *ApplicationShellWidget;</code> -</literallayout> - -<literallayout> -<code>typedef struct {</code> -<code> CorePart core;</code> -<code> CompositePart composite;</code> -<code> ShellPart shell;</code> -<code> WMShellPart wm;</code> -<code> VendorShellPart vendor;</code> -<code> TopLevelShellPart topLevel;</code> -<code> ApplicationShellPart application;</code> -<code> SessionShellPart session;</code> -<code>} SessionShellRec, *SessionShellWidget;</code> -</literallayout> +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; +} ShellRec, *ShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + OverrideShellPart override; +} OverrideShellRec, *OverrideShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; +} WMShellRec, *WMShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; +} VendorShellRec, *VendorShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TransientShellPart transient; +} TransientShellRec, *TransientShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; +} TopLevelShellRec, *TopLevelShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; +} ApplicationShellRec, *ApplicationShellWidget; +</programlisting> + +<programlisting> +typedef struct { + CorePart core; + CompositePart composite; + ShellPart shell; + WMShellPart wm; + VendorShellPart vendor; + TopLevelShellPart topLevel; + ApplicationShellPart application; + SessionShellPart session; +} SessionShellRec, *SessionShellWidget; +</programlisting> </sect2> @@ -2065,20 +2065,20 @@ The checkpoint token in the <emphasis remap='I'>call_data</emphasis> parameter i <function>XtCheckpointToken</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> int save_type;</code> -<code> int interact_style;</code> -<code> Boolean shutdown;</code> -<code> Boolean fast;</code> -<code> Boolean cancel_shutdown</code> -<code> int phase;</code> -<code> int interact_dialog_type; /* return */</code> -<code> Boolean request_cancel; /* return */</code> -<code> Boolean request_next_phase; /* return */</code> -<code> Boolean save_success; /* return */</code> -<code>} XtCheckpointTokenRec, *XtCheckpointToken;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> The <emphasis remap='I'>save_type</emphasis>, <emphasis remap='I'>interact_style</emphasis>, <emphasis remap='I'>shutdown</emphasis>, and <emphasis remap='I'>fast</emphasis> 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 <function>XtGrabKind</function>, which is defined as </para> -<literallayout> -<code>typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind;</code> -</literallayout> +<programlisting> +typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind; +</programlisting> <para> The create_popup_child_proc procedure pointer @@ -512,9 +512,9 @@ or <function>XtGrabExclusive</function>, it calls </para> -<literallayout> -<code>XtAddGrab(</code><emphasis remap='I'>popup_shell</emphasis><code>, (</code><emphasis remap='I'>grab_kind</emphasis><code> == XtGrabExclusive), False)</code> -</literallayout> +<programlisting> +XtAddGrab(<emphasis remap='I'>popup_shell</emphasis>, (<emphasis remap='I'>grab_kind</emphasis> == XtGrabExclusive), False) +</programlisting> </listitem> <listitem> <para> @@ -988,12 +988,12 @@ The function casts the <emphasis remap='I'>client_data</emphasis> parameter to a pointer of type <function>XtPopdownID</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> Widget shell_widget;</code> -<code> Widget enable_widget;</code> -<code>} XtPopdownIDRec, *XtPopdownID;</code> -</literallayout> +<programlisting> +typedef struct { + Widget shell_widget; + Widget enable_widget; +} XtPopdownIDRec, *XtPopdownID; +</programlisting> <para> The <emphasis remap='I'>shell_widget</emphasis> is the pop-up shell to pop down, and the <emphasis remap='I'>enable_widget</emphasis> 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. </para> -<literallayout> -<code>typedef unsigned long XtGeometryMask;</code> -<code>typedef struct {</code> -<code> XtGeometryMask request_mode;</code> -<code> Position x, y;</code> -<code> Dimension width, height;</code> -<code> Dimension border_width;</code> -<code> Widget sibling;</code> -<code> int stack_mode;</code> -<code>} XtWidgetGeometry;</code> -</literallayout> +<programlisting> +typedef unsigned long XtGeometryMask; +typedef struct { + XtGeometryMask request_mode; + Position x, y; + Dimension width, height; + Dimension border_width; + Widget sibling; + int stack_mode; +} XtWidgetGeometry; +</programlisting> <para> 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 </para> -<literallayout> -<code>typedef enum {</code> -<code> XtGeometryYes,</code> -<code> XtGeometryNo,</code> -<code> XtGeometryAlmost,</code> -<code> XtGeometryDone</code> -<code>} XtGeometryResult;</code> -</literallayout> +<programlisting> +typedef enum { + XtGeometryYes, + XtGeometryNo, + XtGeometryAlmost, + XtGeometryDone +} XtGeometryResult; +</programlisting> <para> The <emphasis remap='I'>request_mode</emphasis> 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: </para> -<literallayout> -<code>#define XtExposeNoCompress ((XtEnum)False)</code> -<code>#define XtExposeCompressSeries ((XtEnum)True)</code> -<code>#define XtExposeCompressMultiple <implementation-defined></code> -<code>#define XtExposeCompressMaximal <implementation-defined></code> -</literallayout> +<programlisting> +#define XtExposeNoCompress ((XtEnum)False) +#define XtExposeCompressSeries ((XtEnum)True) +#define XtExposeCompressMultiple <implementation-defined> +#define XtExposeCompressMaximal <implementation-defined> +</programlisting> <para> 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 </para> -<literallayout> -<code>Boolean invert;</code> -<code>Boolean highlight;</code> -<code>Dimension highlight_width;</code> -</literallayout> +<programlisting> +Boolean invert; +Boolean highlight; +Dimension highlight_width; +</programlisting> <para> Label would have <emphasis remap='I'>invert</emphasis> and <emphasis remap='I'>highlight</emphasis> always <function>False</function> @@ -3521,9 +3521,9 @@ To register an event handler procedure that receives events before or after all previously registered event handlers, use <xref linkend='XtInsertEventHandler' xrefstyle='select: title'/>. </para> -<literallayout> -<code>typedef enum {XtListHead, XtListTail} XtListPosition;</code> -</literallayout> +<programlisting> +typedef enum {XtListHead, XtListTail} XtListPosition; +</programlisting> <funcsynopsis id='XtInsertEventHandler'> <funcprototype> @@ -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: </para> -<literallayout> -<code> </code>... -<code> XtAppLock(app_context);</code> -<code> XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret);</code> -<code> XtAppUnlock(app_context);</code> -<code> </code>... -</literallayout> +<programlisting> + ... + XtAppLock(app_context); + XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret); + XtAppUnlock(app_context); + ... +</programlisting> <para> When the application relies upon <xref linkend='XtConvertAndStore' xrefstyle='select: title'/> @@ -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: </para> -<literallayout> -<code>#include <X11/CoreP.h></code> -<code>Boolean BeingDestroyed (Widget widget)</code> -<code>{</code> -<code> Boolean ret;</code> -<code> XtAppLock(XtWidgetToApplicationContext(widget));</code> -<code> ret = widget->core.being_destroyed;</code> -<code> XtAppUnlock(XtWidgetToApplicationContext(widget));</code> -<code> return ret;</code> -<code>}</code> -</literallayout> +<programlisting> +#include <X11/CoreP.h> +Boolean BeingDestroyed (Widget widget) +{ + Boolean ret; + XtAppLock(XtWidgetToApplicationContext(widget)); + ret = widget->core.being_destroyed; + XtAppUnlock(XtWidgetToApplicationContext(widget)); + return ret; +} +</programlisting> <para> A client that wishes to atomically call two or more Intrinsics functions must lock the application context. For example: </para> -<literallayout> -<code> </code>... -<code> XtAppLock(XtWidgetToApplicationContext(widget));</code> -<code> XtUnmanageChild (widget1);</code> -<code> XtManageChild (widget2);</code> -<code> XtAppUnlock(XtWidgetToApplicationContext(widget));</code> -<code> </code>... -</literallayout> +<programlisting> + ... + XtAppLock(XtWidgetToApplicationContext(widget)); + XtUnmanageChild (widget1); + XtManageChild (widget2); + XtAppUnlock(XtWidgetToApplicationContext(widget)); + ... +</programlisting> <sect3 id="Locking_the_Application_Context"> <title>Locking the Application Context</title> <para> 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 <function>XtCallbackList</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtCallbackProc callback;</code> -<code> XtPointer closure;</code> -<code>} XtCallbackRec, *XtCallbackList;</code> -</literallayout> +<programlisting> +typedef struct { + XtCallbackProc callback; + XtPointer closure; +} XtCallbackRec, *XtCallbackList; +</programlisting> <para> For example, the callback list for procedures A and B with client data clientDataA and clientDataB, respectively, is </para> -<literallayout> -<code>static XtCallbackRec callbacks[] = {</code> -<code> {A, (XtPointer) clientDataA},</code> -<code> {B, (XtPointer) clientDataB},</code> -<code> {(XtCallbackProc) NULL, (XtPointer) NULL}</code> -<code>};</code> -</literallayout> +<programlisting> +static XtCallbackRec callbacks[] = { + {A, (XtPointer) clientDataA}, + {B, (XtPointer) clientDataB}, + {(XtCallbackProc) NULL, (XtPointer) NULL} +}; +</programlisting> <para> 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 <function>XtResource</function> structure is </para> -<literallayout> -<code>typedef struct {</code> -<code> String resource_name;</code> -<code> String resource_class;</code> -<code> String resource_type;</code> -<code> Cardinal resource_size;</code> -<code> Cardinal resource_offset;</code> -<code> String default_type;</code> -<code> XtPointer default_addr;</code> -<code>} XtResource, *XtResourceList;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> When the resource list is specified as the <function>CoreClassPart</function>, @@ -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: </para> -<literallayout> -<code>*Background: ivory</code> -<code>*Foreground: darkblue</code> -</literallayout> +<programlisting> +*Background: ivory +*Foreground: darkblue +</programlisting> <para> 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: </para> -<literallayout> +<programlisting> *Font: 6x13 -</literallayout> +</programlisting> <para> By convention, resource classes are always spelled starting with a capital letter @@ -641,20 +641,20 @@ see <xref linkend='Obtaining_Widget_State' /> and <para> Here is an abbreviated version of a possible resource list for a Label widget: </para> -<literallayout> -<code>/* Resources specific to Label */</code> -<code>static XtResource resources[] = {</code> -<code>{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),</code> -<code> XtOffsetOf(LabelRec, label.foreground), XtRString, XtDefaultForeground},</code> -<code>{XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),</code> -<code> XtOffsetOf(LabelRec, label.font), XtRString, XtDefaultFont},</code> -<code>{XtNlabel, XtCLabel, XtRString, sizeof(String),</code> -<code> XtOffsetOf(LabelRec, label.label), XtRString, NULL},</code> -<code> .</code> -<code> .</code> -<code> .</code> -<code>}</code> -</literallayout> +<programlisting> +/* 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}, + . + . + . +} +</programlisting> <para> 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 <olink targetdoc='libX11' targetptr='Creating_and_Storing_Databases'>Section <olink targetdoc='libX11' targetptr='libX11'>Xlib — C Language X Interface.</olink>) for input and output values. </para> -<literallayout> -<code>typedef struct {</code> -<code> unsigned int size;</code> -<code> XPointer addr;</code> -<code>} XrmValue, *XrmValuePtr;</code> -</literallayout> +<programlisting> +typedef struct { + unsigned int size; + XPointer addr; +} XrmValue, *XrmValuePtr; +</programlisting> <para> The <emphasis remap='I'>addr</emphasis> field specifies the address of the data, and the <emphasis remap='I'>size</emphasis> 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). </para> -<literallayout> -<code>#define done(type, value) \\</code> -<code> { \\</code> -<code> if (toVal->addr != NULL) { \\</code> -<code> if (toVal->size < sizeof(type)) { \\</code> -<code> toVal->size = sizeof(type); \\</code> -<code> return False; \\</code> -<code> } \\</code> -<code> *(type*)(toVal->addr) = (value); \\</code> -<code> } \\</code> -<code> else { \\</code> -<code> static type static_val; \\</code> -<code> static_val = (value); \\</code> -<code> toVal->addr = (XPointer)&static_val; \\</code> -<code> } \\</code> -<code> toVal->size = sizeof(type); \\</code> -<code> return True; \\</code> -<code> }</code> - -<code>static Boolean CvtStringToPixel(</code> -<code> Display *dpy,</code> -<code> XrmValue *args,</code> -<code> Cardinal *num_args,</code> -<code> XrmValue *fromVal,</code> -<code> XrmValue *toVal,</code> -<code> XtPointer *converter_data)</code> -<code>{</code> -<code> static XColor screenColor;</code> -<code> XColor exactColor;</code> -<code> Screen *screen;</code> -<code> Colormap colormap;</code> -<code> Status status;</code> - -<code> if (*num_args != 2)</code> -<code> XtAppWarningMsg(XtDisplayToApplicationContext(dpy),</code> -<code> "wrongParameters", "cvtStringToPixel", "XtToolkitError",</code> -<code> "String to pixel conversion needs screen and colormap arguments",</code> -<code> (String *)NULL, (Cardinal *)NULL);</code> -<code> screen = *((Screen**) args[0].addr);</code> -<code> colormap = *((Colormap *) args[1].addr);</code> -<code> if (CompareISOLatin1(str, XtDefaultBackground) == 0) {</code> -<code> *closure_ret = False;</code> -<code> done(Pixel, WhitePixelOfScreen(screen));</code> -<code> }</code> -<code> if (CompareISOLatin1(str, XtDefaultForeground) == 0) {</code> -<code> *closure_ret = False;</code> -<code> done(Pixel, BlackPixelOfScreen(screen));</code> -<code> }</code> -<code> status = XAllocNamedColor(DisplayOfScreen(screen), colormap, (char*)fromVal->addr,</code> -<code> &screenColor, &exactColor);</code> -<code> if (status == 0) {</code> -<code> String params[1];</code> -<code> Cardinal num_params = 1;</code> -<code> params[0] = (String)fromVal->addr;</code> -<code> XtAppWarningMsg(XtDisplayToApplicationContext(dpy),</code> -<code> "noColormap", "cvtStringToPixel", "XtToolkitError",</code> -<code> "Cannot allocate colormap entry for \\"%s\\"",</code> -<code> params, &num_params);</code> -<code> *converter_data = (char *) False;</code> -<code> return False;</code> -<code> } else {</code> -<code> *converter_data = (char *) True;</code> -<code> done(Pixel, &screenColor.pixel);</code> -<code> }</code> -<code>}</code> -</literallayout> +<programlisting> +#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); + } +} +</programlisting> <para> 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 <function>XtCacheType</function> argument. </para> -<literallayout> -<code>typedef int XtCacheType;</code> -</literallayout> +<programlisting> +typedef int XtCacheType; +</programlisting> <para> An <function>XtCacheType</function> @@ -2513,24 +2513,24 @@ specify how each argument is derived. These are defined in <function><X11/Intrinsic.h></function>. </para> -<literallayout> -<code>typedef enum {</code> -<code> /* address mode parameter representation */</code> -<code> XtAddress, /* address */</code> -<code> XtBaseOffset, /* offset */</code> -<code> XtImmediate, /* constant */</code> -<code> XtResourceString, /* resource name string */</code> -<code> XtResourceQuark, /* resource name quark */</code> -<code> XtWidgetBaseOffset, /* offset */</code> -<code> XtProcedureArg /* procedure to call */</code> -<code>} XtAddressMode;</code> - -<code>typedef struct {</code> -<code> XtAddressMode address_mode;</code> -<code> XtPointer address_id;</code> -<code> Cardinal size;</code> -<code>} XtConvertArgRec, *XtConvertArgList;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> The <emphasis remap='I'>size</emphasis> field specifies the length of the data in bytes. The <emphasis remap='I'>address_mode</emphasis> field specifies how the <emphasis remap='I'>address_id</emphasis> field should be @@ -2659,9 +2659,9 @@ To invoke explicit resource conversions, use or <xref linkend='XtCallConverter' xrefstyle='select: title'/>. </para> -<literallayout> -<code>typedef XtPointer XtCacheRef;</code> -</literallayout> +<programlisting> +typedef XtPointer XtCacheRef; +</programlisting> <funcsynopsis id='XtCallConverter'> <funcprototype> 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 <emphasis remap='I'>params</emphasis>. </varlistentry> </variablelist> -<literallayout> -<code>typedef struct _XtActionsRec {</code> -<code> String string;</code> -<code> XtActionProc proc;</code> -<code>} XtActionsRec, *XtActionList;</code> -</literallayout> +<programlisting> +typedef struct _XtActionsRec { + String string; + XtActionProc proc; +} XtActionsRec, *XtActionList; +</programlisting> <para> The <emphasis remap='I'>string</emphasis> 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: </para> -<literallayout> -<code>XtActionsRec actionTable[] = {</code> -<code> {"Set", Set},</code> -<code> {"Unset", Unset},</code> -<code> {"Highlight", Highlight},</code> -<code> {"Unhighlight", Unhighlight}</code> -<code> {"Notify", Notify},</code> -<code>};</code> -</literallayout> +<programlisting> +XtActionsRec actionTable[] = { + {"Set", Set}, + {"Unset", Unset}, + {"Highlight", Highlight}, + {"Unhighlight", Unhighlight} + {"Notify", Notify}, +}; +</programlisting> <para> 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. <para> The following illustrates Pushbutton's default translation table: </para> -<literallayout> -<code>static String defaultTranslations =</code> -<code> "<EnterWindow>: Highlight()\\n\\</code> -<code> <LeaveWindow>: Unhighlight()\\n\\</code> -<code> <Btn1Down>: Set()\\n\\</code> -<code> <Btn1Up>: Notify() Unset()";</code> -</literallayout> +<programlisting> +static String defaultTranslations = + "<EnterWindow>: Highlight()\\n\\ + <LeaveWindow>: Unhighlight()\\n\\ + <Btn1Down>: Set()\\n\\ + <Btn1Up>: Notify() Unset()"; +</programlisting> <para> The <emphasis remap='I'>tm_table</emphasis> field of the <function>CoreClassPart</function> @@ -1388,9 +1388,9 @@ server's KeyCode-to-KeySym table. This table must not be modified. There are <emphasis remap='I'>keysyms_per_keycode_return</emphasis> KeySyms associated with each KeyCode, located in the table with indices starting at index </para> -<literallayout> -<code> (test_keycode - min_keycode_return) * keysyms_per_keycode_return</code> -</literallayout> +<programlisting> + (test_keycode - min_keycode_return) * keysyms_per_keycode_return +</programlisting> <para> for KeyCode <emphasis remap='I'>test_keycode</emphasis>. 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 <xref linkend='XtMalloc' xrefstyle='select: title'/> with the following arguments specified: </para> -<literallayout> -<code>((type *) XtMalloc((unsigned) sizeof(type)))</code> -</literallayout> +<programlisting> +((type *) XtMalloc((unsigned) sizeof(type))) +</programlisting> <para> The storage allocated by <xref linkend='XtNew' xrefstyle='select: title'/> @@ -513,9 +513,9 @@ is a convenience macro that calls <xref linkend='XtMalloc' xrefstyle='select: title'/> with the following arguments specified: </para> -<literallayout> -<code>(strcpy(XtMalloc((unsigned)strlen(str) + 1), str))</code> -</literallayout> +<programlisting> +(strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) +</programlisting> <para> The storage allocated by <xref linkend='XtNewString' xrefstyle='select: title'/> @@ -1834,9 +1834,9 @@ The procedure pointer specified by the incremental owner to supply the selection data to the Intrinsics is of type <xref linkend='XtConvertSelectionIncrProc' xrefstyle='select: title'/>. </para> -<literallayout> -<code>typedef XtPointer XtRequestId;</code> -</literallayout> +<programlisting> +typedef XtPointer XtRequestId; +</programlisting> <funcsynopsis id='XtConvertSelectionIncrProc'> <funcprototype> @@ -4379,12 +4379,12 @@ A string substitution is defined by a list of <function>Substitution</function> entries. </para> -<literallayout> -<code>typedef struct {</code> -<code> char match;</code> -<code> String substitution;</code> -<code>} SubstitutionRec, *Substitution;</code> -</literallayout> +<programlisting> +typedef struct { + char match; + String substitution; +} SubstitutionRec, *Substitution; +</programlisting> <para> File name evaluation is handled in an operating-system-dependent fashion by an @@ -4772,14 +4772,14 @@ must contain the following substitutions: <!-- OK PAST HERE --> -<literallayout> -<code>1. %C, %N, %S, %T, %L or %C, %N, %S, %T, %l, %t, %c</code> -<code>2. %C, %N, %S, %T, %l</code> -<code>3. %C, %N, %S, %T</code> -<code>4. %N, %S, %T, %L or %N, %S, %T, %l, %t, %c</code> -<code>5. %N, %S, %T, %l</code> -<code>6. %N, %S, %T</code> -</literallayout> +<programlisting> +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 +</programlisting> <para> 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". <para> A suggested value for the default path on POSIX-based systems is </para> -<literallayout> -<code> /usr/lib/X11/%L/%T/%N%C%S:/usr/lib/X11/%l/%T/%N%C%S:\</code> -<code> /usr/lib/X11/%T/%N%C%S:/usr/lib/X11/%L/%T/%N%S:\</code> -<code> /usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S</code> -</literallayout> +<programlisting> + /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 +</programlisting> <para> @@ -4831,9 +4831,9 @@ might set <emphasis role='strong'>XFILESEARCHPATH</emphasis> to </para> -<literallayout> -<code> %D:ourdir/%T/%N%C:ourdir/%T/%N</code> -</literallayout> +<programlisting> + %D:ourdir/%T/%N%C:ourdir/%T/%N +</programlisting> <para> The customization string is obtained by querying the resource database @@ -5042,14 +5042,14 @@ The <emphasis remap='I'>call_data</emphasis> parameter in a createHook callback cast to type <function>XtCreateHookData</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> String type;</code> -<code> Widget widget;</code> -<code> ArgList args;</code> -<code> Cardinal num_args;</code> -<code>} XtCreateHookDataRec, *XtCreateHookData;</code> -</literallayout> +<programlisting> +typedef struct { + String type; + Widget widget; + ArgList args; + Cardinal num_args; +} XtCreateHookDataRec, *XtCreateHookData; +</programlisting> <para> The <emphasis remap='I'>type</emphasis> is set to <function>XtHcreate</function>, @@ -5125,14 +5125,14 @@ The <emphasis remap='I'>call_data</emphasis> parameter in a changeHook callback be cast to type <function>XtChangeHookData</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> String type;</code> -<code> Widget widget;</code> -<code> XtPointer event_data;</code> -<code> Cardinal num_event_data;</code> -<code>} XtChangeHookDataRec, *XtChangeHookData;</code> -</literallayout> +<programlisting> +typedef struct { + String type; + Widget widget; + XtPointer event_data; + Cardinal num_event_data; +} XtChangeHookDataRec, *XtChangeHookData; +</programlisting> <para> When the changeHook callbacks are called as a result of a call to <xref linkend='XtSetValues' xrefstyle='select: title'/> @@ -5144,13 +5144,13 @@ or <emphasis remap='I'>event_data</emphasis> may be cast to type <function>XtChangeHookSetValuesData</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> Widget old, req;</code> -<code> ArgList args;</code> -<code> Cardinal num_args;</code> -<code>} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData;</code> -</literallayout> +<programlisting> +typedef struct { + Widget old, req; + ArgList args; + Cardinal num_args; +} XtChangeHookSetValuesDataRec, *XtChangeHookSetValuesData; +</programlisting> <para> The <emphasis remap='I'>old</emphasis>, <emphasis remap='I'>req</emphasis>, <emphasis remap='I'>args</emphasis>, and <emphasis remap='I'>num_args</emphasis> 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: </para> -<literallayout> -<code> XtCallCallbacks(XtHooksOfDisplay(dpy), XtNchangeHook, call_data);</code> -</literallayout> +<programlisting> + XtCallCallbacks(XtHooksOfDisplay(dpy), XtNchangeHook, call_data); +</programlisting> <para> 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 <emphasis remap='I'>call_data</emphasis> parameter may be cast to type <function>XtConfigureHookData.</function> </para> -<literallayout> -<code>typedef struct {</code> -<code> String type;</code> -<code> Widget widget;</code> -<code> XtGeometryMask changeMask;</code> -<code> XWindowChanges changes;</code> -<code>} XtConfigureHookDataRec, *XtConfigureHookData;</code> -</literallayout> +<programlisting> +typedef struct { + String type; + Widget widget; + XtGeometryMask changeMask; + XWindowChanges changes; +} XtConfigureHookDataRec, *XtConfigureHookData; +</programlisting> <para> When the configureHook callbacks are called, the <emphasis remap='I'>type</emphasis> is <function>XtHconfigure</function>, @@ -5431,15 +5431,15 @@ The <emphasis remap='I'>call_data</emphasis> parameter may be cast to type <function>XtGeometryHookData</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> String type;</code> -<code> Widget widget;</code> -<code> XtWidgetGeometry* request;</code> -<code> XtWidgetGeometry* reply;</code> -<code> XtGeometryResult result;</code> -<code>} XtGeometryHookDataRec, *XtGeometryHookData;</code> -</literallayout> +<programlisting> +typedef struct { + String type; + Widget widget; + XtWidgetGeometry* request; + XtWidgetGeometry* reply; + XtGeometryResult result; +} XtGeometryHookDataRec, *XtGeometryHookData; +</programlisting> <para> When the geometryHook callbacks are called prior to geometry negotiation, the <emphasis remap='I'>type</emphasis> is @@ -5459,12 +5459,12 @@ The XtNdestroyHook callback list is called when a widget is destroyed. The <emphasis remap='I'>call_data parameter</emphasis> may be cast to type <function>XtDestroyHookData</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> String type;</code> -<code> Widget widget;</code> -<code>} XtDestroyHookDataRec, *XtDestroyHookData;</code> -</literallayout> +<programlisting> +typedef struct { + String type; + Widget widget; +} XtDestroyHookDataRec, *XtDestroyHookData; +</programlisting> <para> When the destroyHook callbacks are called as a result of a call to <xref linkend='XtDestroyWidget' xrefstyle='select: title'/>, 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 obj<emphasis remap='I'>n</emphasis> fields with NULL or zero as appropriate to the type. </para> -<literallayout> -<code>typedef struct _ObjectClassPart {</code> -<code> WidgetClass superclass;</code> -<code> String class_name;</code> -<code> Cardinal widget_size;</code> -<code> XtProc class_initialize;</code> -<code> XtWidgetClassProc class_part_initialize;</code> -<code> XtEnum class_inited;</code> -<code> XtInitProc initialize;</code> -<code> XtArgsProc initialize_hook;</code> -<code> XtProc obj1;</code> -<code> XtPointer obj2;</code> -<code> Cardinal obj3;</code> -<code> XtResourceList resources;</code> -<code> Cardinal num_resources;</code> -<code> XrmClass xrm_class;</code> -<code> Boolean obj4;</code> -<code> XtEnum obj5;</code> -<code> Boolean obj6;</code> -<code> Boolean obj7;</code> -<code> XtWidgetProc destroy;</code> -<code> XtProc obj8;</code> -<code> XtProc obj9;</code> -<code> XtSetValuesFunc set_values;</code> -<code> XtArgsFunc set_values_hook;</code> -<code> XtProc obj10;</code> -<code> XtArgsProc get_values_hook;</code> -<code> XtProc obj11;</code> -<code> XtVersionType version;</code> -<code> XtPointer callback_private;</code> -<code> String obj12;</code> -<code> XtProc obj13;</code> -<code> XtProc obj14;</code> -<code> XtPointer extension;</code> -<code>} ObjectClassPart;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> The extension record defined for <function>ObjectClassPart</function> @@ -112,27 +112,27 @@ with a <emphasis remap='I'>record_type</emphasis> equal to is <function>ObjectClassExtensionRec</function>. </para> -<literallayout> -<code>typedef struct {</code> -<code> XtPointer next_extension; </code>See <xref linkend='Class_Extension_Records' /> -<code> XrmQuark record_type; </code>See <xref linkend='Class_Extension_Records' /> -<code> long version; </code>See <xref linkend='Class_Extension_Records' /> -<code> Cardinal record_size; </code>See <xref linkend='Class_Extension_Records' /> -<code> XtAllocateProc allocate; </code>See <xref linkend='Widget_Instance_Allocation_The_allocate_Procedure' />. -<code> XtDeallocateProc deallocate; </code>See <xref linkend='Widget_Instance_Deallocation_The_deallocate_Procedure' />. -<code>} ObjectClassExtensionRec, *ObjectClassExtension;</code> -</literallayout> +<programlisting> +typedef struct { + XtPointer next_extension; See <xref linkend='Class_Extension_Records' /> + XrmQuark record_type; See <xref linkend='Class_Extension_Records' /> + long version; See <xref linkend='Class_Extension_Records' /> + Cardinal record_size; See <xref linkend='Class_Extension_Records' /> + XtAllocateProc allocate; See <xref linkend='Widget_Instance_Allocation_The_allocate_Procedure' />. + XtDeallocateProc deallocate; See <xref linkend='Widget_Instance_Deallocation_The_deallocate_Procedure' />. +} ObjectClassExtensionRec, *ObjectClassExtension; +</programlisting> <para> The prototypical <function>ObjectClass</function> consists of just the <function>ObjectClassPart</function>. </para> -<literallayout> -<code>typedef struct _ObjectClassRec {</code> -<code> ObjectClassPart object_class;</code> -<code>} ObjectClassRec, *ObjectClass;</code> -</literallayout> +<programlisting> +typedef struct _ObjectClassRec { + ObjectClassPart object_class; +} ObjectClassRec, *ObjectClass; +</programlisting> <para> The predefined class record and pointer for <function>ObjectClassRec</function> @@ -143,16 +143,16 @@ are In <function>IntrinsicP.h</function>: </para> -<literallayout> -<code>extern ObjectClassRec objectClassRec;</code> -</literallayout> +<programlisting> +extern ObjectClassRec objectClassRec; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern WidgetClass objectClass;</code> -</literallayout> +<programlisting> +extern WidgetClass objectClass; +</programlisting> <para> The opaque types <function>Object</function> @@ -170,9 +170,9 @@ version identifier is uses an incomplete structure definition to ensure that the compiler catches attempts to access private data: </para> -<literallayout> -<code>typedef struct _ObjectClassRec* ObjectClass;</code> -</literallayout> +<programlisting> +typedef struct _ObjectClassRec* ObjectClass; +</programlisting> </sect2> @@ -185,16 +185,16 @@ structure. All fields have the same meaning as the corresponding fields in <function>CorePart</function>. </para> -<literallayout> -<code>typedef struct _ObjectPart {</code> -<code> Widget self;</code> -<code> WidgetClass widget_class;</code> -<code> Widget parent;</code> -<code> Boolean being_destroyed;</code> -<code> XtCallbackList destroy_callbacks;</code> -<code> XtPointer constraints;</code> -<code>} ObjectPart;</code> -</literallayout> +<programlisting> +typedef struct _ObjectPart { + Widget self; + WidgetClass widget_class; + Widget parent; + Boolean being_destroyed; + XtCallbackList destroy_callbacks; + XtPointer constraints; +} ObjectPart; +</programlisting> <para> All object instances have the Object @@ -209,18 +209,18 @@ object types. In <function>IntrinsicP.h</function>: </para> -<literallayout> -<code>typedef struct _ObjectRec {</code> -<code> ObjectPart object;</code> -<code>} ObjectRec, *Object;</code> -</literallayout> +<programlisting> +typedef struct _ObjectRec { + ObjectPart object; +} ObjectRec, *Object; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>typedef struct _ObjectRec *Object;</code> -</literallayout> +<programlisting> +typedef struct _ObjectRec *Object; +</programlisting> </sect2> @@ -516,53 +516,53 @@ Core's class record. The class record initialization must fill all rect<emphasis remap='I'>n</emphasis> fields with NULL or zero as appropriate to the type. </para> -<literallayout> -<code>typedef struct _RectObjClassPart {</code> -<code> WidgetClass superclass;</code> -<code> String class_name;</code> -<code> Cardinal widget_size;</code> -<code> XtProc class_initialize;</code> -<code> XtWidgetClassProc class_part_initialize;</code> -<code> XtEnum class_inited;</code> -<code> XtInitProc initialize;</code> -<code> XtArgsProc initialize_hook;</code> -<code> XtProc rect1;</code> -<code> XtPointer rect2;</code> -<code> Cardinal rect3;</code> -<code> XtResourceList resources;</code> -<code> Cardinal num_resources;</code> -<code> XrmClass xrm_class;</code> -<code> Boolean rect4;</code> -<code> XtEnum rect5;</code> -<code> Boolean rect6;</code> -<code> Boolean rect7;</code> -<code> XtWidgetProc destroy;</code> -<code> XtWidgetProc resize;</code> -<code> XtExposeProc expose;</code> -<code> XtSetValuesFunc set_values;</code> -<code> XtArgsFunc set_values_hook;</code> -<code> XtAlmostProc set_values_almost;</code> -<code> XtArgsProc get_values_hook;</code> -<code> XtProc rect9;</code> -<code> XtVersionType version;</code> -<code> XtPointer callback_private;</code> -<code> String rect10;</code> -<code> XtGeometryHandler query_geometry;</code> -<code> XtProc rect11;</code> -<code> XtPointer extension;</code> -<code>} RectObjClassPart;</code> -</literallayout> +<programlisting> +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; +</programlisting> <para> The RectObj class record consists of just the <function>RectObjClassPart</function>. </para> -<literallayout> -<code>typedef struct _RectObjClassRec {</code> -<code> RectObjClassPart rect_class;</code> -<code>} RectObjClassRec, *RectObjClass;</code> -</literallayout> +<programlisting> +typedef struct _RectObjClassRec { + RectObjClassPart rect_class; +} RectObjClassRec, *RectObjClass; +</programlisting> <para> The predefined class record and pointer for <function>RectObjClassRec</function> @@ -573,16 +573,16 @@ are In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern RectObjClassRec rectObjClassRec;</code> -</literallayout> +<programlisting> +extern RectObjClassRec rectObjClassRec; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>extern WidgetClass rectObjClass;</code> -</literallayout> +<programlisting> +extern WidgetClass rectObjClass; +</programlisting> <para> The opaque types <function>RectObj</function> @@ -597,9 +597,9 @@ RectObj. uses an incomplete structure definition to ensure that the compiler catches attempts to access private data: </para> -<literallayout> -<code>typedef struct _RectObjClassRec* RectObjClass;</code> -</literallayout> +<programlisting> +typedef struct _RectObjClassRec* RectObjClass; +</programlisting> </sect2> @@ -615,33 +615,33 @@ objects have the following fields defined in the structure. All fields have the same meaning as the corresponding field in <function>CorePart</function>. </para> -<literallayout> -<code>typedef struct _RectObjPart {</code> -<code> Position x, y;</code> -<code> Dimension width, height;</code> -<code> Dimension border_width;</code> -<code> Boolean managed;</code> -<code> Boolean sensitive;</code> -<code> Boolean ancestor_sensitive;</code> -<code>} RectObjPart;</code> -</literallayout> +<programlisting> +typedef struct _RectObjPart { + Position x, y; + Dimension width, height; + Dimension border_width; + Boolean managed; + Boolean sensitive; + Boolean ancestor_sensitive; +} RectObjPart; +</programlisting> <para> RectObj objects have the RectObj fields immediately following the Object fields. </para> -<literallayout> -<code>typedef struct _RectObjRec {</code> -<code> ObjectPart object;</code> -<code> RectObjPart rectangle;</code> -<code>} RectObjRec, *RectObj;</code> -</literallayout> +<programlisting> +typedef struct _RectObjRec { + ObjectPart object; + RectObjPart rectangle; +} RectObjRec, *RectObj; +</programlisting> <para> In <function>Intrinsic.h</function>: </para> -<literallayout> -<code>typedef struct _RectObjRec* RectObj;</code> -</literallayout> +<programlisting> +typedef struct _RectObjRec* RectObj; +</programlisting> </sect2> 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 <function>XtSpecificationRelease</function>. </para> -<literallayout> -<code>#define XtSpecificationRelease 6</code> -</literallayout> +<programlisting> +#define XtSpecificationRelease 6 +</programlisting> <para> As the symbol <function>XtSpecificationRelease</function> @@ -299,11 +299,11 @@ a resource named “baseTranslations”. <para> Applications wishing to take advantage of the new functionality would change their application defaults file, e.g., from -<literallayout> -<code> app.widget.translations: </code><emphasis remap='I'>value</emphasis> +<programlisting> + app.widget.translations: <emphasis remap='I'>value</emphasis> to -<code> app.widget.baseTranslations: </code><emphasis remap='I'>value</emphasis> -</literallayout> + app.widget.baseTranslations: <emphasis remap='I'>value</emphasis> +</programlisting> 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: </para> -<literallayout> -<code>No modifiers: None <event> detail</code> -<code>Any modifiers: <event> detail</code> -<code>Only these modifiers: ! mod1 mod2 <event> detail</code> -<code>These modifiers and any others: mod1 mod2 <event> detail</code> -</literallayout> +<programlisting> +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 +</programlisting> <para> 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 <para>The canonical modifier names are</para> -<literallayout> -<code> Ctrl Mod1 Button1</code> -<code> Shift Mod2 Button2</code> -<code> Lock Mod3 Button3</code> -<code> Mod4 Button4</code> -<code> Mod5 Button5</code> -</literallayout> +<programlisting> + Ctrl Mod1 Button1 + Shift Mod2 Button2 + Lock Mod3 Button3 + Mod4 Button4 + Mod5 Button5 +</programlisting> <para>The canonical event types are</para> @@ -1033,53 +1033,53 @@ The canonical representation of a translation table is (see also <para> Always put more specific events in the table before more general ones: </para> -<literallayout> -<code> Shift <Btn1Down> : twas()\n\</code> -<code> <Btn1Down> : brillig()</code> -</literallayout> +<programlisting> + Shift <Btn1Down> : twas()\n\ + <Btn1Down> : brillig() +</programlisting> </listitem> <listitem> <para> For double-click on Button1 Up with Shift, use this specification: </para> -<literallayout> -<code>Shift<Btn1Up>(2) : and()</code> -</literallayout> +<programlisting> +Shift<Btn1Up>(2) : and() +</programlisting> </listitem> <listitem> <para> This is equivalent to the following line with appropriate timers set between events: </para> -<literallayout> -<code>Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down>,Shift<Btn1Up> : and()</code> -</literallayout> +<programlisting> +Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down>,Shift<Btn1Up> : and() +</programlisting> </listitem> <listitem> <para> For double-click on Button1 Down with Shift, use this specification: </para> -<literallayout> -<code>Shift<Btn1Down>(2) : the()</code> -</literallayout> +<programlisting> +Shift<Btn1Down>(2) : the() +</programlisting> </listitem> <listitem> <para> This is equivalent to the following line with appropriate timers set between events: </para> -<literallayout> -<code>Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down> : the()</code> -</literallayout> +<programlisting> +Shift<Btn1Down>,Shift<Btn1Up>,Shift<Btn1Down> : the() +</programlisting> </listitem> <listitem> <para> Mouse motion is always discarded when it occurs between events in a table where no motion event is specified: </para> -<literallayout> -<code><Btn1Down>,<Btn1Up> : slithy()</code> -</literallayout> +<programlisting> +<Btn1Down>,<Btn1Up> : slithy() +</programlisting> <para> 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: </para> -<literallayout> -<code><Btn1Down>,<Btn1Up> : toves()\n\</code> -<code><Btn1Up> : did()</code> -</literallayout> +<programlisting> +<Btn1Down>,<Btn1Up> : toves()\n\ +<Btn1Up> : did() +</programlisting> <para> 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: </para> </listitem> <listitem> -<literallayout> -<code>Shift Meta <Btn1Down>, Shift Meta<Btn1Up>: gyre()</code> -</literallayout> +<programlisting> +Shift Meta <Btn1Down>, Shift Meta<Btn1Up>: gyre() +</programlisting> </listitem> <listitem> <para> @@ -1132,9 +1132,9 @@ count in an event sequence. The actions will be invoked on the <emphasis remap='I'>count</emphasis>-th click and each subsequent one arriving within the multi-click time interval. For example: </para> -<literallayout> -<code>Shift <Btn1Up>(2+) : and()</code> -</literallayout> +<programlisting> +Shift <Btn1Up>(2+) : and() +</programlisting> </listitem> <listitem> <para> @@ -1142,9 +1142,9 @@ To indicate <function>EnterNotify</function> with any modifiers, use this specification: </para> -<literallayout> -<code><Enter> : gimble()</code> -</literallayout> +<programlisting> +<Enter> : gimble() +</programlisting> </listitem> <listitem> <para> @@ -1152,9 +1152,9 @@ To indicate <function>EnterNotify</function> with no modifiers, use this specification: </para> -<literallayout> -<code>None <Enter> : in()</code> -</literallayout> +<programlisting> +None <Enter> : in() +</programlisting> </listitem> <listitem> <para> @@ -1163,9 +1163,9 @@ To indicate with Button1 Down and Button2 Up and "don't care" about the other modifiers, use this specification: </para> -<literallayout> -<code>Button1 ~Button2 <Enter> : the()</code> -</literallayout> +<programlisting> +Button1 ~Button2 <Enter> : the() +</programlisting> </listitem> <listitem> <para> @@ -1173,9 +1173,9 @@ To indicate <function>EnterNotify</function> with Button1 down and Button2 down exclusively, use this specification: </para> -<literallayout> -<code>! Button1 Button2 <Enter> : wabe()</code> -</literallayout> +<programlisting> +! Button1 Button2 <Enter> : wabe() +</programlisting> <para> You do not need to use a tilde (~) with an exclamation point (!). </para> 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: </para> -<literallayout> -<code>#define XtLabelCreate(name, parent, args, num_args) \</code> -<code> ((LabelWidget) XtCreateWidget(name, labelWidgetClass, parent, args, num_args))</code> -</literallayout> +<programlisting> +#define XtLabelCreate(name, parent, args, num_args) \ + ((LabelWidget) XtCreateWidget(name, labelWidgetClass, parent, args, num_args)) +</programlisting> <para> Pop-up shells in some of the prototypes automatically performed an |