10568f49bSmrg<?xml version="1.0" encoding="UTF-8" ?>
20568f49bSmrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
30568f49bSmrg
49e7bcd65Smrg<chapter id='Evolution_of_the_Intrinsics'>
59e7bcd65Smrg<title>Evolution of the Intrinsics</title>
69e7bcd65Smrg
79e7bcd65Smrg<para>
89e7bcd65SmrgThe interfaces described by this specification have undergone several
99e7bcd65Smrgsets of revisions in the course of adoption as an X Consortium
109e7bcd65Smrgstandard specification.  Having now been adopted by the Consortium as
119e7bcd65Smrga standard part of the X Window System, it is expected that this and
129e7bcd65Smrgfuture revisions will retain
139e7bcd65Smrgbackward compatibility in the sense that fully conforming
149e7bcd65Smrgimplementations of these specifications may be produced that provide
159e7bcd65Smrgsource compatibility with widgets and applications written to
169e7bcd65Smrgprevious Consortium standard revisions.
179e7bcd65Smrg</para>
189e7bcd65Smrg
199e7bcd65Smrg<para>
209e7bcd65SmrgThe Intrinsics do not place any special requirement on widget
219e7bcd65Smrgprogrammers to retain source or binary compatibility for their widgets
229e7bcd65Smrgas they evolve, but several conventions have been established to
239e7bcd65Smrgassist those developers who want to provide such compatibility.
249e7bcd65Smrg</para>
259e7bcd65Smrg
269e7bcd65Smrg<para>
279e7bcd65SmrgIn particular, widget programmers may wish to conform to the convention
289e7bcd65Smrgdescribed in <xref linkend='Class_Extension_Records' /> when defining class extension records.
299e7bcd65Smrg</para>
309e7bcd65Smrg<sect1 id="Determining_Specification_Revision_Level">
319e7bcd65Smrg<title>Determining Specification Revision Level</title>
329e7bcd65Smrg<para>
339e7bcd65SmrgWidget and application developers who wish to maintain a common source
349e7bcd65Smrgpool that will build properly with implementations of the Intrinsics
359e7bcd65Smrgat different revision levels of these specifications but that take
369e7bcd65Smrgadvantage of newer features added in later revisions may use the
379e7bcd65Smrgsymbolic macro
389e7bcd65Smrg<function>XtSpecificationRelease</function>.
399e7bcd65Smrg</para>
400568f49bSmrg<programlisting>
410568f49bSmrg#define XtSpecificationRelease 7
420568f49bSmrg</programlisting>
439e7bcd65Smrg<para>
449e7bcd65SmrgAs the symbol
459e7bcd65Smrg<function>XtSpecificationRelease</function>
469e7bcd65Smrgwas new to Release 4, widgets and
479e7bcd65Smrgapplications desiring to build against earlier implementations should
489e7bcd65Smrgtest for the presence of this symbol and assume only Release 3
499e7bcd65Smrginterfaces if the definition is not present.
509e7bcd65Smrg</para>
519e7bcd65Smrg</sect1>
529e7bcd65Smrg
539e7bcd65Smrg<sect1 id="Release_to_Release_Compatibility">
549e7bcd65Smrg<title>Release 3 to Release 4 Compatibility</title>
559e7bcd65Smrg<para>
569e7bcd65SmrgAt the data structure level, Release 4 retains binary compatibility
579e7bcd65Smrgwith Release 3 (the first X Consortium standard release) for all data
589e7bcd65Smrgstructures except
599e7bcd65Smrg<function>WMShellPart,</function>
609e7bcd65Smrg<function>TopLevelShellPart</function>,
619e7bcd65Smrgand
629e7bcd65Smrg<function>TransientShellPart</function>.
639e7bcd65SmrgRelease 4 changed the argument type to most procedures that now take
649e7bcd65Smrgarguments of type
659e7bcd65Smrg<function>XtPointer</function>
669e7bcd65Smrgand structure members that are now of type
679e7bcd65Smrg<function>XtPointer</function>
689e7bcd65Smrgin order to avoid potential ANSI C conformance problems.  It is
699e7bcd65Smrgexpected that most implementations will be binary compatible with the
709e7bcd65Smrgprevious definition.
719e7bcd65Smrg</para>
729e7bcd65Smrg
739e7bcd65Smrg<para>
749e7bcd65SmrgTwo fields in
759e7bcd65Smrg<function>CoreClassPart</function>
769e7bcd65Smrgwere changed from
779e7bcd65Smrg<function>Boolean</function>
789e7bcd65Smrgto
799e7bcd65Smrg<function>XtEnum</function>
809e7bcd65Smrgto allow implementations additional freedom in specifying the
819e7bcd65Smrgrepresentations of each.  This change should require no source
829e7bcd65Smrgmodification.
839e7bcd65Smrg</para>
849e7bcd65Smrg<sect2 id="Additional_Arguments">
859e7bcd65Smrg<title>Additional Arguments</title>
869e7bcd65Smrg<para>
879e7bcd65SmrgArguments were added to the procedure definitions for
889e7bcd65Smrg<xref linkend='XtInitProc' xrefstyle='select: title'/>,
899e7bcd65Smrg<xref linkend='XtSetValuesFunc' xrefstyle='select: title'/>,
909e7bcd65Smrgand
919e7bcd65Smrg<xref linkend='XtEventHandler' xrefstyle='select: title'/>
929e7bcd65Smrgto provide more information and to
939e7bcd65Smrgallow event handlers to abort further dispatching of the current event
949e7bcd65Smrg(caution is advised!).  The added arguments to
959e7bcd65Smrg<xref linkend='XtInitProc' xrefstyle='select: title'/>
969e7bcd65Smrgand
979e7bcd65Smrg<xref linkend='XtSetValuesFunc' xrefstyle='select: title'/>
989e7bcd65Smrgmake the initialize_hook and set_values_hook methods
999e7bcd65Smrgobsolete, but the hooks have been retained for those widgets that used
1009e7bcd65Smrgthem in Release 3.
1019e7bcd65Smrg</para>
1029e7bcd65Smrg</sect2>
1039e7bcd65Smrg
1049e7bcd65Smrg<sect2 id="set_values_almost_Procedures">
1059e7bcd65Smrg<title>set_values_almost Procedures</title>
1069e7bcd65Smrg<para>
1079e7bcd65SmrgThe use of the arguments by a set_values_almost procedure was poorly
1089e7bcd65Smrgdescribed in Release 3 and was inconsistent with other conventions.
1099e7bcd65Smrg</para>
1109e7bcd65Smrg
1119e7bcd65Smrg<para>
1129e7bcd65SmrgThe current specification for the manner in which a set_values_almost
1139e7bcd65Smrgprocedure returns information to the Intrinsics is not compatible with
1149e7bcd65Smrgthe Release 3 specification, and all widget implementations should
1159e7bcd65Smrgverify that any set_values_almost procedures conform to the current
1169e7bcd65Smrginterface.
1179e7bcd65Smrg</para>
1189e7bcd65Smrg
1199e7bcd65Smrg<para>
1209e7bcd65SmrgNo known implementation of the Intrinsics correctly implemented the
1219e7bcd65SmrgRelease 3 interface, so it is expected that the impact of this
1229e7bcd65Smrgspecification change is small.
1239e7bcd65Smrg</para>
1249e7bcd65Smrg</sect2>
1259e7bcd65Smrg
1269e7bcd65Smrg<sect2 id="Query_Geometry">
1279e7bcd65Smrg<title>Query Geometry</title>
1289e7bcd65Smrg<para>
1299e7bcd65SmrgA composite widget layout routine that calls
1309e7bcd65Smrg<xref linkend='XtQueryGeometry' xrefstyle='select: title'/>
1319e7bcd65Smrgis now expected to store the complete new geometry in the intended structure;
1320568f49bSmrgpreviously the specification said &ldquo;store the changes it intends to
1330568f49bSmrgmake&rdquo;.  Only by storing the complete geometry does the child have
1349e7bcd65Smrgany way to know what other parts of the geometry may still be
1359e7bcd65Smrgflexible.  Existing widgets should not be affected by this, except
1369e7bcd65Smrgto take advantage of the new information.
1379e7bcd65Smrg</para>
1389e7bcd65Smrg</sect2>
1399e7bcd65Smrg
1409e7bcd65Smrg<sect2 id="unrealizeCallback_Callback_List">
1419e7bcd65Smrg<title>unrealizeCallback Callback List</title>
1429e7bcd65Smrg<para>
1439e7bcd65SmrgIn order to provide a mechanism for widgets to be notified when they
1449e7bcd65Smrgbecome unrealized through a call to
1459e7bcd65Smrg<xref linkend='XtUnrealizeWidget' xrefstyle='select: title'/>,
1469e7bcd65Smrgthe callback
1470568f49bSmrglist name &ldquo;unrealizeCallback&rdquo; has been defined by the Intrinsics.  A
1489e7bcd65Smrgwidget class that requires notification on unrealize may declare a
1499e7bcd65Smrgcallback list resource by this name.  No class is required to declare
1509e7bcd65Smrgthis resource, but any class that did so in a prior revision may find
1519e7bcd65Smrgit necessary to modify the resource name if it does not wish to use the new
1529e7bcd65Smrgsemantics.
1539e7bcd65Smrg</para>
1549e7bcd65Smrg</sect2>
1559e7bcd65Smrg
1569e7bcd65Smrg<sect2 id="Subclasses_of_WMShell">
1579e7bcd65Smrg<title>Subclasses of WMShell</title>
1589e7bcd65Smrg<para>
1590568f49bSmrgThe formal adoption of the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis> as
1609e7bcd65Smrgan X Consortium standard has meant the addition of four fields to
1619e7bcd65Smrg<function>WMShellPart</function>
1629e7bcd65Smrgand one field to
1639e7bcd65Smrg<function>TopLevelShellPart</function>.
1649e7bcd65SmrgIn deference to some
1659e7bcd65Smrgwidget libraries that had developed their own additional conventions
1669e7bcd65Smrgto provide binary compatibility, these five new fields were added at
1679e7bcd65Smrgthe end of the respective data structures.
1689e7bcd65Smrg</para>
1699e7bcd65Smrg
1709e7bcd65Smrg<para>
1719e7bcd65SmrgTo provide more convenience for TransientShells, a field was added
1729e7bcd65Smrgto the previously empty
1739e7bcd65Smrg<function>TransientShellPart</function>.
1749e7bcd65SmrgOn some architectures the size of the part structure will not
1759e7bcd65Smrghave changed as a result of this.
1769e7bcd65Smrg</para>
1779e7bcd65Smrg
1789e7bcd65Smrg<para>
1799e7bcd65SmrgAny widget implementation whose class is a subclass of
1809e7bcd65SmrgTopLevelShell
1819e7bcd65Smrgor
1829e7bcd65SmrgTransientShell
1839e7bcd65Smrgmust at minimum be
1849e7bcd65Smrgrecompiled with the new data structure declarations.  Because
1859e7bcd65Smrg<function>WMShellPart</function>
1869e7bcd65Smrgno longer contains a contiguous
1879e7bcd65Smrg<function>XSizeHints</function>
1889e7bcd65Smrgdata structure,
1899e7bcd65Smrga subclass that expected to do a single structure assignment of an
1909e7bcd65Smrg<function>XSizeHints</function>
1919e7bcd65Smrgstructure to the <emphasis remap='I'>size_hints</emphasis> field of
1929e7bcd65Smrg<function>WMShellPart</function>
1939e7bcd65Smrgmust be revised, though the old fields remain at the same positions within
1949e7bcd65Smrg<function>WMShellPart</function>.
1959e7bcd65Smrg</para>
1969e7bcd65Smrg</sect2>
1979e7bcd65Smrg
1989e7bcd65Smrg<sect2 id="Resource_Type_Converters">
1999e7bcd65Smrg<title>Resource Type Converters</title>
2009e7bcd65Smrg<para>
2019e7bcd65SmrgA new interface declaration for resource type converters was defined
2029e7bcd65Smrgto provide more information to converters, to support conversion
2039e7bcd65Smrgcache cleanup with resource reference counting, and to allow
2049e7bcd65Smrgadditional procedures to be declared to free resources.  The old
2059e7bcd65Smrginterfaces remain (in the compatibility section), and a new set of
2069e7bcd65Smrgprocedures was defined that work only with the new type converter
2079e7bcd65Smrginterface.
2089e7bcd65Smrg</para>
2099e7bcd65Smrg
2109e7bcd65Smrg<para>
2119e7bcd65SmrgIn the now obsolete old type converter interface, converters are
2129e7bcd65Smrgreminded that they must return the size of the converted value as well
2139e7bcd65Smrgas its address.  The example indicated this, but the description of
2149e7bcd65Smrg<xref linkend='XtConverter' xrefstyle='select: title'/>
2159e7bcd65Smrgwas incomplete.
2169e7bcd65Smrg</para>
2179e7bcd65Smrg</sect2>
2189e7bcd65Smrg
2199e7bcd65Smrg<sect2 id="KeySym_Case_Conversion_Procedure">
2209e7bcd65Smrg<title>KeySym Case Conversion Procedure</title>
2219e7bcd65Smrg<para>
2229e7bcd65SmrgThe specification for the
2239e7bcd65Smrg<xref linkend='XtCaseProc' xrefstyle='select: title'/>
2249e7bcd65Smrgfunction type has been changed
2259e7bcd65Smrgto match the Release 3 implementation, which included necessary
2269e7bcd65Smrgadditional information required by the function (a pointer to the
2279e7bcd65Smrgdisplay connection), and corrects the argument type of the source
2289e7bcd65SmrgKeySym parameter.  No known implementation of the Intrinsics
2299e7bcd65Smrgimplemented the previously documented interface.
2309e7bcd65Smrg</para>
2319e7bcd65Smrg</sect2>
2329e7bcd65Smrg
2339e7bcd65Smrg<sect2 id="Nonwidget_Objects_2">
2349e7bcd65Smrg<title>Nonwidget Objects</title>
2359e7bcd65Smrg<para>
2369e7bcd65SmrgFormal support for nonwidget objects is new to Release 4.  A
2379e7bcd65Smrgprototype implementation was latent in at least one Release 3
2389e7bcd65Smrgimplementation of the Intrinsics, but the specification has changed
2399e7bcd65Smrgsomewhat.  The most significant change is the requirement for a
2409e7bcd65Smrgcomposite widget to declare the
2419e7bcd65Smrg<function>CompositeClassExtension</function>
2429e7bcd65Smrgrecord with the <emphasis remap='I'>accepts_objects</emphasis> field set to
2439e7bcd65Smrg<function>True</function>
2449e7bcd65Smrgin order to permit a client to create a nonwidget child.
2459e7bcd65Smrg</para>
2469e7bcd65Smrg
2479e7bcd65Smrg<para>
2489e7bcd65SmrgThe addition of this extension field ensures that composite widgets
2499e7bcd65Smrgwritten under Release 3 will not encounter unexpected errors if an
2509e7bcd65Smrgapplication attempts to create a nonwidget child.  In Release 4 there
2519e7bcd65Smrgis no requirement that all composite widgets implement the extra
2529e7bcd65Smrgfunctionality required to manage windowless children, so the
2539e7bcd65Smrg<emphasis remap='I'>accepts_objects</emphasis> field allows a composite widget to declare that it
2549e7bcd65Smrgis not prepared to do so.
2559e7bcd65Smrg</para>
2569e7bcd65Smrg</sect2>
2579e7bcd65Smrg</sect1>
2589e7bcd65Smrg
2599e7bcd65Smrg<sect1 id="Release_to_Release_Compatibility_2">
2609e7bcd65Smrg<title>Release 4 to Release 5 Compatibility</title>
2619e7bcd65Smrg<para>
2629e7bcd65SmrgAt the data structure level, Release 5 retains complete binary
2639e7bcd65Smrgcompatibility with Release 4.  The specification of the
2649e7bcd65Smrg<function>ObjectPart</function>,
2659e7bcd65Smrg<function>RectObjPart</function>,
2669e7bcd65Smrg<function>CorePart</function>,
2679e7bcd65Smrg<function>CompositePart</function>,
2689e7bcd65Smrg<function>ShellPart</function>,
2699e7bcd65Smrg<function>WMShellPart</function>,
2709e7bcd65Smrg<function>TopLevelShellPart</function>,
2719e7bcd65Smrgand
2729e7bcd65Smrg<function>ApplicationShellPart</function>
2739e7bcd65Smrginstance records was made less strict to permit implementations to
2749e7bcd65Smrgadd internal fields to these structures.  Any implementation that
2759e7bcd65Smrgchooses to do so would, of course, force a recompilation.
2769e7bcd65SmrgThe Xlib specification for
2779e7bcd65Smrg<function>XrmValue</function>
2789e7bcd65Smrgand
2799e7bcd65Smrg<function>XrmOptionDescRec</function>
2809e7bcd65Smrgwas updated to use a new type,
2819e7bcd65Smrg<function>XPointer</function>,
2829e7bcd65Smrgfor the <emphasis remap='I'>addr</emphasis> and <emphasis remap='I'>value</emphasis> fields, respectively, to avoid
2839e7bcd65SmrgANSI C conformance problems.  The definition of
2849e7bcd65Smrg<function>XPointer</function>
2859e7bcd65Smrgis binary compatible with the previous implementation.
2869e7bcd65Smrg</para>
2879e7bcd65Smrg<sect2 id="baseTranslations_Resource">
2889e7bcd65Smrg<title>baseTranslations Resource</title>
2899e7bcd65Smrg<para>
2909e7bcd65SmrgA new pseudo-resource, XtNbaseTranslations, was defined to permit
2919e7bcd65Smrgapplication developers to specify translation tables in application
2929e7bcd65Smrgdefaults files while still giving end users the ability to augment
2939e7bcd65Smrgor override individual event sequences.  This change will affect
2949e7bcd65Smrgonly those applications that wish to take advantage of the new
2959e7bcd65Smrgfunctionality or those widgets that may have previously defined
2960568f49bSmrga resource named &ldquo;baseTranslations&rdquo;.
2979e7bcd65Smrg</para>
2989e7bcd65Smrg
2999e7bcd65Smrg<para>
3009e7bcd65SmrgApplications wishing to take advantage of the new functionality
3019e7bcd65Smrgwould change their application defaults file, e.g., from
3020568f49bSmrg<programlisting>
3030568f49bSmrg        app.widget.translations:         <emphasis remap='I'>value</emphasis>
3049e7bcd65Smrgto
3050568f49bSmrg        app.widget.baseTranslations:     <emphasis remap='I'>value</emphasis>
3060568f49bSmrg</programlisting>
3079e7bcd65SmrgIf it is important to the application to preserve complete
3089e7bcd65Smrgcompatibility of the defaults file between different versions
3099e7bcd65Smrgof the application running under Release 4 and Release 5,
3100568f49bSmrgthe full translations can be replicated in both the &ldquo;translations&rdquo;
3110568f49bSmrgand the &ldquo;baseTranslations&rdquo; resource.
3129e7bcd65Smrg</para>
3139e7bcd65Smrg</sect2>
3149e7bcd65Smrg
3159e7bcd65Smrg<sect2 id="Resource_File_Search_Path">
3169e7bcd65Smrg<title>Resource File Search Path</title>
3179e7bcd65Smrg<para>
3189e7bcd65SmrgThe current specification allows implementations greater flexibility
3199e7bcd65Smrgin defining the directory structure used to hold the application class
3209e7bcd65Smrgand per-user application defaults files.  Previous specifications
3219e7bcd65Smrgrequired the substitution strings to appear in the default path in a
3229e7bcd65Smrgcertain order, preventing sites from collecting all the files for
3239e7bcd65Smrga specific application together in one directory.  The Release 5
3249e7bcd65Smrgspecification allows the default path to specify the substitution
3259e7bcd65Smrgstrings in any order within a single path entry.  Users will need to
3269e7bcd65Smrgpay close attention to the documentation for the specific
3279e7bcd65Smrgimplementation to know where to find these files and how to specify
3289e7bcd65Smrgtheir own
3299e7bcd65Smrg<emphasis role='strong'>XFILESEARCHPATH</emphasis>
3309e7bcd65Smrgand
3319e7bcd65Smrg<emphasis role='strong'>XUSERFILESEARCHPATH</emphasis>
3329e7bcd65Smrgvalues when overriding the system defaults.
3339e7bcd65Smrg</para>
3349e7bcd65Smrg</sect2>
3359e7bcd65Smrg
3369e7bcd65Smrg<sect2 id="Customization_Resource">
3379e7bcd65Smrg<title>Customization Resource</title>
3389e7bcd65Smrg<para>
3399e7bcd65Smrg<xref linkend='XtResolvePathname' xrefstyle='select: title'/>
3409e7bcd65Smrgsupports a new substitution string, %C, for specifying separate
3419e7bcd65Smrgapplication class resource files according to arbitrary user-specified
3429e7bcd65Smrgcategories.  The primary motivation for this addition was separate
3439e7bcd65Smrgmonochrome and color application class defaults files.  The
3449e7bcd65Smrgsubstitution value is obtained by querying the current resource
3450568f49bSmrgdatabase for the application resource name &ldquo;customization&rdquo;, class
3460568f49bSmrg&ldquo;Customization&rdquo;.  Any application that previously used this
3479e7bcd65Smrgresource name and class will need to be aware of the possibly
3489e7bcd65Smrgconflicting semantics.
3499e7bcd65Smrg</para>
3509e7bcd65Smrg</sect2>
3519e7bcd65Smrg
3529e7bcd65Smrg<sect2 id="Per_Screen_Resource_Database">
3539e7bcd65Smrg<title>Per-Screen Resource Database</title>
3549e7bcd65Smrg<para>
3559e7bcd65SmrgTo allow a user to specify separate preferences for each screen of a
3569e7bcd65Smrgdisplay, a per-screen resource specification string has been added and
3579e7bcd65Smrgmultiple resource databases are created; one for each screen.  This
3589e7bcd65Smrgwill affect any application that modified the (formerly unique)
3599e7bcd65Smrgresource database associated with the display subsequent to the Intrinsics
3609e7bcd65Smrgdatabase initialization.  Such applications will need to be aware
3619e7bcd65Smrgof the particular screen on which each shell widget is to be created.
3629e7bcd65Smrg</para>
3639e7bcd65Smrg
3649e7bcd65Smrg<para>
3659e7bcd65SmrgAlthough the wording of the specification changed substantially in the
3669e7bcd65Smrgdescription of the process by which the resource database(s) is
3679e7bcd65Smrginitialized, the net effect is the same as in prior releases with the
3689e7bcd65Smrgexception of the added per-screen resource specification and the new
3699e7bcd65Smrgcustomization substitution string in
3709e7bcd65Smrg<xref linkend='XtResolvePathname' xrefstyle='select: title'/>.
3719e7bcd65Smrg</para>
3729e7bcd65Smrg</sect2>
3739e7bcd65Smrg
3749e7bcd65Smrg<sect2 id="Internationalization_of_Applications">
3759e7bcd65Smrg<title>Internationalization of Applications</title>
3769e7bcd65Smrg<para>
3779e7bcd65SmrgInternationalization as defined by ANSI is a technology that
3789e7bcd65Smrgallows support of an application in a single locale.  In
3799e7bcd65Smrgadding support for internationalization to the Intrinsics
3809e7bcd65Smrgthe restrictions of this model have been followed.
3819e7bcd65SmrgIn particular, the new Intrinsics interfaces are designed not to
3829e7bcd65Smrgpreclude an application from using other alternatives.
3839e7bcd65SmrgFor this reason, no Intrinsics routine makes a call to establish the
3849e7bcd65Smrglocale.   However, a convenience routine to establish the
3859e7bcd65Smrglocale at initialize time has been provided, in the form
3869e7bcd65Smrgof a default procedure that must be explicitly installed
3879e7bcd65Smrgif the application desires ANSI C locale behavior.
3889e7bcd65Smrg</para>
3899e7bcd65Smrg
3909e7bcd65Smrg<para>
3919e7bcd65SmrgAs many objects in X, particularly resource databases, now inherit
3929e7bcd65Smrgthe global locale when they are created, applications wishing to use
3939e7bcd65Smrgthe ANSI C locale model should use the new function
3949e7bcd65Smrg<function>XtSetLanguageProc</function>
3959e7bcd65Smrgto do so.
3969e7bcd65Smrg</para>
3979e7bcd65Smrg
3989e7bcd65Smrg<para>
3999e7bcd65SmrgThe internationalization additions also define event filters
4009e7bcd65Smrgas a part of the Xlib Input Method specifications.  The
4019e7bcd65SmrgIntrinsics enable the use of event filters through additions to
4029e7bcd65Smrg<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>.
4039e7bcd65SmrgApplications that may not be dispatching all events through
4049e7bcd65Smrg<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
4059e7bcd65Smrgshould be reviewed in the context of this new input method mechanism.
4069e7bcd65Smrg</para>
4079e7bcd65Smrg
4089e7bcd65Smrg<para>
4099e7bcd65SmrgIn order to permit internationalization of error messages, the name
4109e7bcd65Smrgand path of the error database file are now allowed to be
4119e7bcd65Smrgimplementation-dependent.
4129e7bcd65SmrgNo adequate standard mechanism has yet been suggested to
4139e7bcd65Smrgallow the Intrinsics to locate the database from localization information
4149e7bcd65Smrgsupplied by the client.
4159e7bcd65Smrg</para>
4169e7bcd65Smrg
4179e7bcd65Smrg<para>
4189e7bcd65SmrgThe previous specification for the syntax of the language string
4199e7bcd65Smrgspecified by
4209e7bcd65Smrg<function>xnlLanguage</function>
4219e7bcd65Smrghas been dropped to avoid potential conflicts with other standards.
4229e7bcd65SmrgThe language string syntax is now implementation-defined.
4239e7bcd65SmrgThe example syntax cited is consistent with the previous
4249e7bcd65Smrgspecification.
4259e7bcd65Smrg</para>
4269e7bcd65Smrg</sect2>
4279e7bcd65Smrg
4289e7bcd65Smrg<sect2 id="Permanently_Allocated_Strings">
4299e7bcd65Smrg<title>Permanently Allocated Strings</title>
4309e7bcd65Smrg<para>
4319e7bcd65SmrgIn order to permit additional memory savings, an Xlib interface was
4329e7bcd65Smrgadded to allow the resource manager to avoid copying certain string
4339e7bcd65Smrgconstants.  The Intrinsics specification was updated to explicitly require
4349e7bcd65Smrgthe Object <emphasis remap='I'>class_name</emphasis>, <emphasis remap='I'>resource_name</emphasis>, <emphasis remap='I'>resource_class</emphasis>,
4359e7bcd65Smrg<emphasis remap='I'>resource_type</emphasis>, <emphasis remap='I'>default_type</emphasis> in resource tables, Core <emphasis remap='I'>actions</emphasis>
4369e7bcd65Smrg<emphasis remap='I'>string</emphasis> field, and Constraint <emphasis remap='I'>resource_name</emphasis>, <emphasis remap='I'>resource_class</emphasis>,
4379e7bcd65Smrg<emphasis remap='I'>resource_type</emphasis>, and <emphasis remap='I'>default_type</emphasis> resource fields to be
4389e7bcd65Smrgpermanently allocated.  This explicit requirement is expected to
4399e7bcd65Smrgaffect only applications that may create and destroy classes
4409e7bcd65Smrgon the fly.
4419e7bcd65Smrg</para>
4429e7bcd65Smrg</sect2>
4439e7bcd65Smrg
4449e7bcd65Smrg<sect2 id="Arguments_to_Existing_Functions">
4459e7bcd65Smrg<title>Arguments to Existing Functions</title>
4469e7bcd65Smrg<para>
4479e7bcd65SmrgThe <emphasis remap='I'>args</emphasis> argument to
4489e7bcd65Smrg<xref linkend='XtAppInitialize' xrefstyle='select: title'/>,
4499e7bcd65Smrg<xref linkend='XtVaAppInitialize' xrefstyle='select: title'/>,
4509e7bcd65Smrg<xref linkend='XtOpenDisplay' xrefstyle='select: title'/>,
4519e7bcd65Smrg<xref linkend='XtDisplayInitialize' xrefstyle='select: title'/>,
4529e7bcd65Smrgand
4539e7bcd65Smrg<xref linkend='XtInitialize' xrefstyle='select: title'/>
4549e7bcd65Smrgwere changed from
4559e7bcd65Smrg<function>Cardinal</function>*
4569e7bcd65Smrgto int* to conform to pre-existing convention and avoid otherwise
4579e7bcd65Smrgannoying typecasting in ANSI C environments.
4589e7bcd65Smrg</para>
4599e7bcd65Smrg</sect2>
4609e7bcd65Smrg</sect1>
4619e7bcd65Smrg
4629e7bcd65Smrg<sect1 id="Release_to_Release_Compatibility_3">
4639e7bcd65Smrg<title>Release 5 to Release 6 Compatibility</title>
4649e7bcd65Smrg<para>
4659e7bcd65SmrgAt the data structure level, Release 6 retains binary compatibility
4669e7bcd65Smrgwith Release 5 for all data structures except
4679e7bcd65Smrg<function>WMShellPart</function>.
4689e7bcd65SmrgThree resources were added to the specification.
4699e7bcd65SmrgThe known implementations had unused space in the data structure,
4709e7bcd65Smrgtherefore on some architectures and implementations,
4719e7bcd65Smrgthe size of the part structure will not have changed as a result of this.
4729e7bcd65Smrg</para>
4739e7bcd65Smrg<sect2 id="Widget_Internals">
4749e7bcd65Smrg<title>Widget Internals</title>
4759e7bcd65Smrg<para>
4769e7bcd65SmrgTwo new widget methods for instance allocation and deallocation were added
4779e7bcd65Smrgto the Object class.  These new methods
4789e7bcd65Smrgallow widgets to be treated as C++ objects in the C++ environment
4799e7bcd65Smrgwhen an appropriate allocation method is specified or inherited
4809e7bcd65Smrgby the widget class.
4819e7bcd65Smrg</para>
4829e7bcd65Smrg
4839e7bcd65Smrg<para>
4849e7bcd65SmrgThe textual descriptions of the processes of widget creation and
4859e7bcd65Smrgwidget destruction have been edited to provide clarification to widget
4869e7bcd65Smrgwriters.  Widgets writers may have reason to rely on the specific order of
4879e7bcd65Smrgthe stages of widget creation and destruction; with that motivation,
4889e7bcd65Smrgthe specification now more exactly describes the process.
4899e7bcd65Smrg</para>
4909e7bcd65Smrg
4919e7bcd65Smrg<para>
4929e7bcd65SmrgAs a convenience, an interface to locate a widget class extension
4939e7bcd65Smrgrecord on a linked list,
4949e7bcd65Smrg<xref linkend='XtGetClassExtension' xrefstyle='select: title'/>,
4959e7bcd65Smrghas been added.
4969e7bcd65Smrg</para>
4979e7bcd65Smrg
4989e7bcd65Smrg<para>
4999e7bcd65SmrgA new option to allow bundled changes to the managed set of a Composite
5009e7bcd65Smrgwidget is introduced in the Composite class extension record.
5019e7bcd65SmrgWidgets that define a change_managed procedure that can accommodate
5029e7bcd65Smrgadditions and deletions to the managed set of children in a single
5039e7bcd65Smrginvocation should set allows_change_managed_set to <function>True</function> in the
5049e7bcd65Smrgextension record.
5059e7bcd65Smrg</para>
5069e7bcd65Smrg
5079e7bcd65Smrg<para>
5089e7bcd65SmrgThe wording of the process followed by
5099e7bcd65Smrg<xref linkend='XtUnmanageChildren' xrefstyle='select: title'/>
5109e7bcd65Smrghas changed slightly to better handle changes to the managed set
5119e7bcd65Smrgduring phase 2 destroy processing.
5129e7bcd65Smrg</para>
5139e7bcd65Smrg
5149e7bcd65Smrg<para>
5159e7bcd65SmrgA new exposure event compression flag,
5169e7bcd65Smrg<function>XtExposeNoRegion</function>,
5179e7bcd65Smrgwas added.  Many widgets specify exposure compression, but either
5189e7bcd65Smrgignore the actual damage region passed to the core expose procedure or
5199e7bcd65Smrguse only the cumulative bounding box data available in the event.
5209e7bcd65SmrgWidgets with expose procedures that do not make use of exact
5219e7bcd65Smrgexposure region information can indicate that the Intrinsics need not
5229e7bcd65Smrgcompute the region.
5239e7bcd65Smrg</para>
5249e7bcd65Smrg</sect2>
5259e7bcd65Smrg
5269e7bcd65Smrg<sect2 id="General_Application_Development">
5279e7bcd65Smrg<title>General Application Development</title>
5289e7bcd65Smrg<para>
5299e7bcd65Smrg<xref linkend='XtOpenApplication' xrefstyle='select: title'/>
5309e7bcd65Smrgis a new convenience procedure to initialize the toolkit, create an
5319e7bcd65Smrgapplication context, open an X display connection, and create the
5329e7bcd65Smrgroot of the widget instance tree.  It is identical to the interface
5339e7bcd65Smrgit replaces,
5349e7bcd65Smrg<xref linkend='XtAppInitialize' xrefstyle='select: title'/>,
5359e7bcd65Smrgin all respects except that it takes an additional argument specifying
5369e7bcd65Smrgthe widget class of the root shell to create.
5379e7bcd65SmrgThis interface is now the recommended one so that clients may easily
5389e7bcd65Smrgbecome session participants.
5399e7bcd65SmrgThe old convenience procedures appear in the compatibility section.
5409e7bcd65Smrg</para>
5419e7bcd65Smrg
5429e7bcd65Smrg<para>
5439e7bcd65SmrgThe toolkit initialization function
5449e7bcd65Smrg<xref linkend='XtToolkitInitialize' xrefstyle='select: title'/>
5459e7bcd65Smrgmay be called multiple times without penalty.
5469e7bcd65Smrg</para>
5479e7bcd65Smrg
5489e7bcd65Smrg<para>
5499e7bcd65SmrgIn order to optimize changes in geometry to a set of geometry-managed
5509e7bcd65Smrgchildren, a new interface,
5519e7bcd65Smrg<xref linkend='XtChangeManagedSet' xrefstyle='select: title'/>,
5529e7bcd65Smrghas been added.
5539e7bcd65Smrg</para>
5549e7bcd65Smrg</sect2>
5559e7bcd65Smrg
5569e7bcd65Smrg<sect2 id="Communication_with_Window_and_Session_Managers">
5579e7bcd65Smrg<title>Communication with Window and Session Managers</title>
5589e7bcd65Smrg<para>
5590568f49bSmrgThe revision of the <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis> as an X Consortium standard has resulted
5609e7bcd65Smrgin the addition of three fields to the specification of
5619e7bcd65Smrg<function>WMShellPart</function>.
5629e7bcd65SmrgThese are <emphasis remap='I'>urgency</emphasis>, <emphasis remap='I'>client_leader</emphasis>, and <emphasis remap='I'>window_role</emphasis>.
5639e7bcd65Smrg</para>
5649e7bcd65Smrg
5659e7bcd65Smrg<para>
5669e7bcd65SmrgThe adoption of the <emphasis remap='I'>X Session Management Protocol</emphasis> as an X Consortium
5679e7bcd65Smrgstandard has resulted in the addition of a new shell widget,
5689e7bcd65Smrg<function>SessionShell</function>,
5699e7bcd65Smrgand an accompanying subclass verification interface,
5709e7bcd65Smrg<function>XtIsSessionShell</function>.
5719e7bcd65SmrgThis widget provides support for communication between an application
5729e7bcd65Smrgand a session manager, as well as a window manager.
5739e7bcd65SmrgIn order to preserve compatibility with existing subclasses of
5749e7bcd65Smrg<function>ApplicationShell</function>,
5759e7bcd65Smrgthe
5769e7bcd65Smrg<function>ApplicationShell</function>
5779e7bcd65Smrgwas subclassed to create the new widget class.
5789e7bcd65SmrgThe session protocol requires a modal response to certain checkpointing
5799e7bcd65Smrgoperations by participating applications.  The
5809e7bcd65Smrg<function>SessionShell</function>
5819e7bcd65Smrgstructures
5829e7bcd65Smrgthe application's notification of and responses to messages from the session
5839e7bcd65Smrgmanager by use of various callback lists and by use of the new interfaces
5849e7bcd65Smrg<xref linkend='XtSessionGetToken' xrefstyle='select: title'/>
5859e7bcd65Smrgand
5869e7bcd65Smrg<xref linkend='XtSessionReturnToken' xrefstyle='select: title'/>.
5879e7bcd65SmrgThere is also a new command line argument, -xtsessionID, which facilitates
5889e7bcd65Smrgthe session manager in restarting applications based on the Intrinsics.
5899e7bcd65Smrg</para>
5909e7bcd65Smrg
5919e7bcd65Smrg<para>
5929e7bcd65SmrgThe resource name and class strings defined by the Intrinsics shell
5939e7bcd65Smrgwidgets in
5940568f49bSmrg<filename class="headerfile">&lt;X11/Shell.h&gt;</filename>
5959e7bcd65Smrgare now listed in Appendix E.  The addition of a new symbol
5969e7bcd65Smrgfor the
5979e7bcd65Smrg<function>WMShell</function>
5989e7bcd65Smrg<emphasis remap='I'>wait_for_wm</emphasis> resource was made to bring the external symbol
5999e7bcd65Smrgand the string it represents into agreement.  The actual resource name
6009e7bcd65Smrgstring in
6019e7bcd65Smrg<function>WMShell</function>
6029e7bcd65Smrghas not changed.
6039e7bcd65SmrgThe resource representation type of the XtNwinGravity resource of the
6049e7bcd65Smrg<function>WMShell</function>
6059e7bcd65Smrgwas changed to XtRGravity in order to register a type
6069e7bcd65Smrgconverter so that window gravity resource values could be specified by name.
6079e7bcd65Smrg</para>
6089e7bcd65Smrg</sect2>
6099e7bcd65Smrg
6109e7bcd65Smrg<sect2 id="Geometry_Management_2">
6119e7bcd65Smrg<title>Geometry Management</title>
6129e7bcd65Smrg<para>
6139e7bcd65SmrgA clarification to the specification was made to indicate that geometry
6149e7bcd65Smrgrequests may include current values along with the requested changes.
6159e7bcd65Smrg</para>
6169e7bcd65Smrg</sect2>
6179e7bcd65Smrg
6189e7bcd65Smrg<sect2 id="Event_Management_2">
6199e7bcd65Smrg<title>Event Management</title>
6209e7bcd65Smrg<para>
6219e7bcd65SmrgIn Release 6, support is provided for registering selectors
6229e7bcd65Smrgand event handlers for events generated by X protocol extensions
6239e7bcd65Smrgand for dispatching those events to the appropriate widget.
6249e7bcd65SmrgThe new event handler registration interfaces are
6259e7bcd65Smrg<xref linkend='XtInsertEventTypeHandler' xrefstyle='select: title'/>
6269e7bcd65Smrgand
6279e7bcd65Smrg<xref linkend='XtRemoveEventTypeHandler' xrefstyle='select: title'/>.
6289e7bcd65SmrgSince the mechanism to indicate selection of extension events is specific
6299e7bcd65Smrgto the extension being used, the Intrinsics introduces
6309e7bcd65Smrg<xref linkend='XtRegisterExtensionSelector' xrefstyle='select: title'/>,
6319e7bcd65Smrgwhich allows the application to select for the events of interest.
6329e7bcd65SmrgIn order to change the dispatching algorithm to accommodate extension events
6339e7bcd65Smrgas well as core X protocol events,
6349e7bcd65Smrgthe Intrinsics event dispatcher may now be replaced or enveloped
6359e7bcd65Smrgby the application with
6369e7bcd65Smrg<xref linkend='XtSetEventDispatcher' xrefstyle='select: title'/>.
6379e7bcd65SmrgThe dispatcher may wish to call
6389e7bcd65Smrg<xref linkend='XtGetKeyboardFocusWidget' xrefstyle='select: title'/>
6399e7bcd65Smrgto determine the widget with the current Intrinsics keyboard focus.
6409e7bcd65SmrgA dispatcher, after determining the destination widget, may use
6419e7bcd65Smrg<xref linkend='XtDispatchEventToWidget' xrefstyle='select: title'/>
6429e7bcd65Smrgto cause the event to be dispatched to the event handlers registered
6439e7bcd65Smrgby a specific widget.
6449e7bcd65Smrg</para>
6459e7bcd65Smrg
6469e7bcd65Smrg<para>
6479e7bcd65SmrgTo permit the dispatching of events
6489e7bcd65Smrgfor nonwidget drawables, such as pixmaps that are not associated
6499e7bcd65Smrgwith a widget's window,
6509e7bcd65Smrg<xref linkend='XtRegisterDrawable' xrefstyle='select: title'/>
6519e7bcd65Smrgand
6529e7bcd65Smrg<xref linkend='XtUnregisterDrawable' xrefstyle='select: title'/>
6539e7bcd65Smrghave been added to the library.  A related update was made to
6549e7bcd65Smrgthe description of
6559e7bcd65Smrg<xref linkend='XtWindowToWidget' xrefstyle='select: title'/>.
6569e7bcd65Smrg</para>
6579e7bcd65Smrg
6589e7bcd65Smrg<para>
6599e7bcd65SmrgThe library is now thread-safe, allowing one thread at a time to
6609e7bcd65Smrgenter the library and protecting global data as necessary from concurrent use.
6619e7bcd65SmrgThreaded toolkit applications are supported by the
6629e7bcd65Smrgnew interfaces
6639e7bcd65Smrg<xref linkend='XtToolkitThreadInitialize' xrefstyle='select: title'/>,
6649e7bcd65Smrg<xref linkend='XtAppLock' xrefstyle='select: title'/>,
6659e7bcd65Smrg<xref linkend='XtAppUnlock' xrefstyle='select: title'/>,
6669e7bcd65Smrg<xref linkend='XtAppSetExitFlag' xrefstyle='select: title'/>,
6679e7bcd65Smrgand
6689e7bcd65Smrg<xref linkend='XtAppGetExitFlag' xrefstyle='select: title'/>.
6699e7bcd65SmrgWidget writers may also use
6709e7bcd65Smrg<xref linkend='XtProcessLock' xrefstyle='select: title'/>
6719e7bcd65Smrgand
6729e7bcd65Smrg<xref linkend='XtProcessUnlock' xrefstyle='select: title'/>.
6739e7bcd65Smrg</para>
6749e7bcd65Smrg
6759e7bcd65Smrg<para>
6769e7bcd65SmrgSafe handling of POSIX signals and other asynchronous notifications
6779e7bcd65Smrgis now provided by use of
6789e7bcd65Smrg<xref linkend='XtAppAddSignal' xrefstyle='select: title'/>,
6799e7bcd65Smrg<xref linkend='XtNoticeSignal' xrefstyle='select: title'/>,
6809e7bcd65Smrgand
6819e7bcd65Smrg<xref linkend='XtRemoveSignal' xrefstyle='select: title'/>.
6829e7bcd65Smrg</para>
6839e7bcd65Smrg
6849e7bcd65Smrg<para>
6859e7bcd65SmrgThe application can receive notification of an impending block
6869e7bcd65Smrgin the Intrinsics event manager by registering interest through
6879e7bcd65Smrg<xref linkend='XtAppAddBlockHook' xrefstyle='select: title'/>
6889e7bcd65Smrgand
6899e7bcd65Smrg<xref linkend='XtRemoveBlockHook' xrefstyle='select: title'/>.
6909e7bcd65Smrg</para>
6919e7bcd65Smrg
6929e7bcd65Smrg<para>
6939e7bcd65Smrg<xref linkend='XtLastEventProcessed' xrefstyle='select: title'/>
6949e7bcd65Smrgreturns the most recent event passed to
6959e7bcd65Smrg<xref linkend='XtDispatchEvent' xrefstyle='select: title'/>
6969e7bcd65Smrgfor a specified display.
6979e7bcd65Smrg</para>
6989e7bcd65Smrg</sect2>
6999e7bcd65Smrg
7009e7bcd65Smrg<sect2 id="Resource_Management_2">
7019e7bcd65Smrg<title>Resource Management</title>
7029e7bcd65Smrg<para>
7039e7bcd65SmrgResource converters are registered by the Intrinsics for window gravity
7049e7bcd65Smrgand for three new resource types associated with session participation:
7059e7bcd65SmrgRestartStyle, CommandArgArray and DirectoryString.
7069e7bcd65Smrg</para>
7079e7bcd65Smrg
7089e7bcd65Smrg<para>
7099e7bcd65SmrgThe file search path syntax has been extended to make it easier to
7109e7bcd65Smrginclude the default search path, which controls resource
7119e7bcd65Smrgdatabase construction, by using the new substitution string, %D.
7129e7bcd65Smrg</para>
7139e7bcd65Smrg</sect2>
7149e7bcd65Smrg
7159e7bcd65Smrg<sect2 id="Translation_Management_2">
7169e7bcd65Smrg<title>Translation Management</title>
7179e7bcd65Smrg<para>
7189e7bcd65SmrgThe default key translator now recognizes the NumLock modifier.
7199e7bcd65SmrgIf NumLock is on and the second keysym is a keypad keysym
7200568f49bSmrg(a standard keysym named with a &ldquo;KP&rdquo; prefix or a
7219e7bcd65Smrgvendor-specific keysym in the hexadecimal range 0x11000000 to 0x1100FFFF),
7229e7bcd65Smrgthen the default key translator will
7239e7bcd65Smrguse the first keysym if Shift and/or ShiftLock is on and will
7249e7bcd65Smrguse the second keysym if neither is on.  Otherwise, it will
7259e7bcd65Smrgignore NumLock and apply the normal protocol semantics.
7269e7bcd65Smrg</para>
7279e7bcd65Smrg</sect2>
7289e7bcd65Smrg
7299e7bcd65Smrg<sect2 id="Selections">
7309e7bcd65Smrg<title>Selections</title>
7319e7bcd65Smrg<para>
7329e7bcd65SmrgThe targets of selection requests may be parameterized, as described
7330568f49bSmrgby the revised <emphasis remap='I'>Inter-Client Communication Conventions Manual</emphasis>.
7349e7bcd65SmrgWhen such requests are made,
7359e7bcd65Smrg<xref linkend='XtSetSelectionParameters' xrefstyle='select: title'/>
7369e7bcd65Smrgis used by the requestor to specify the target parameters and
7379e7bcd65Smrg<xref linkend='XtGetSelectionParameters' xrefstyle='select: title'/>
7389e7bcd65Smrgis used by the selection owner to retrieve the parameters.
7399e7bcd65SmrgWhen a parameterized target is specified in the context of a bundled
7409e7bcd65Smrgrequest for multiple targets,
7419e7bcd65Smrg<xref linkend='XtCreateSelectionRequest' xrefstyle='select: title'/>,
7429e7bcd65Smrg<xref linkend='XtCancelSelectionRequest' xrefstyle='select: title'/>,
7439e7bcd65Smrgand
7449e7bcd65Smrg<xref linkend='XtSendSelectionRequest' xrefstyle='select: title'/>
7459e7bcd65Smrgare used to envelop the assembly of the request.
7469e7bcd65SmrgWhen the parameters themselves are the names of properties,
7479e7bcd65Smrgthe Intrinsics provides support for the economical use of property atom names;
7489e7bcd65Smrgsee
7499e7bcd65Smrg<xref linkend='XtReservePropertyAtom' xrefstyle='select: title'/>
7509e7bcd65Smrgand
7519e7bcd65Smrg<xref linkend='XtReleasePropertyAtom' xrefstyle='select: title'/>.
7529e7bcd65Smrg</para>
7539e7bcd65Smrg</sect2>
7549e7bcd65Smrg
7559e7bcd65Smrg<sect2 id="External_Agent_Hooks">
7569e7bcd65Smrg<title>External Agent Hooks</title>
7579e7bcd65Smrg<para>
7589e7bcd65SmrgExternal agent hooks were added for the benefit of applications
7599e7bcd65Smrgthat instrument other applications for purposes of accessibility,
7609e7bcd65Smrgtesting, and customization.  The external agent and the application
7619e7bcd65Smrgcommunicate by a shared protocol which is transparent to the application.
7629e7bcd65SmrgThe hook callbacks permit the external agent to register interest
7639e7bcd65Smrgin groups or classes of toolkit activity and to be notified of the
7649e7bcd65Smrgtype and details of the activity as it occurs.  The new interfaces
7659e7bcd65Smrgrelated to this effort are
7669e7bcd65Smrg<xref linkend='XtHooksOfDisplay' xrefstyle='select: title'/>,
7679e7bcd65Smrgwhich returns the hook registration widget, and
7689e7bcd65Smrg<xref linkend='XtGetDisplays' xrefstyle='select: title'/>,
7699e7bcd65Smrgwhich returns a list of the X displays associated with an application context.
7709e7bcd65Smrg</para>
7719e7bcd65Smrg</sect2>
7729e7bcd65Smrg</sect1>
7730568f49bSmrg
7740568f49bSmrg<sect1 id="Release_to_Release_Compatibility_4">
7750568f49bSmrg<title>Release 6 to Release 7 Compatibility</title>
7760568f49bSmrg
7770568f49bSmrg<sect2 id="Changes_During_X11R6">
7780568f49bSmrg<title>Changes During X11R6</title>
7790568f49bSmrg<para>
7800568f49bSmrgThe Toolkit was proposed in X10R4, released at the end of 1986.
7810568f49bSmrgThe X11R6 documentation was completed in mid&ndash;1994.
7820568f49bSmrgOver most of the eleven years through X11R6.9,
7830568f49bSmrgonly minor changes were made to the specification.
7840568f49bSmrgSome changes are documented only in the release notes:
7850568f49bSmrg</para>
7860568f49bSmrg
7870568f49bSmrg<itemizedlist>
7880568f49bSmrg<listitem>
7890568f49bSmrg<para>
7900568f49bSmrgThe X11R6.3 release notes (1997) mention one new feature (section 3.15)
7910568f49bSmrg<emphasis remap='I'>Xt Geometry Management Debugger</emphasis>, saying
7920568f49bSmrg</para>
7930568f49bSmrg<blockquote>
7940568f49bSmrg<para>
7950568f49bSmrgDaniel Dardailler's &ldquo;GeoTattler&rdquo; code has been merged into the Xt
7960568f49bSmrgIntrinsics library implementation.
7970568f49bSmrgThis is not a standard.
7980568f49bSmrgIf libXt is compiled with the <code>XT_GEO_TATTLER</code> symbol defined
7990568f49bSmrg(currently there is no build configuration support to do this)
8000568f49bSmrgthen a &ldquo;geoTattler&rdquo; resource
8010568f49bSmrgmay be specified for any widget in an application.
8020568f49bSmrgIf the <code>geoTattler</code>
8030568f49bSmrgresource for a widget instance is <code>True</code>
8040568f49bSmrgthen libXt will generate debugging information to
8050568f49bSmrg<emphasis remap='I'>stdout</emphasis> when the widget makes geometry change requests.
8060568f49bSmrg</para>
8070568f49bSmrg<para>
8080568f49bSmrgFor example, if the resources specify:
8090568f49bSmrg</para>
8100568f49bSmrg<programlisting>
8110568f49bSmrgmyapp*draw.XmScale.geoTattler: ON
8120568f49bSmrg*XmScrollBar.geoTattler:ON
8130568f49bSmrg*XmRowColumn.exit_button.geoTattler:ON
8140568f49bSmrg</programlisting>
8150568f49bSmrg<para>
8160568f49bSmrgthen geometry management debugging information will be generated for all
8170568f49bSmrgthe <code>XmScale</code> children
8180568f49bSmrgof the widget named <emphasis remap='I'>draw</emphasis>,
8190568f49bSmrgall the XmScrollBars,
8200568f49bSmrgand the widget named <emphasis remap='I'>exit_button</emphasis>
8210568f49bSmrgin any <code>XmRowColumn</code>.
8220568f49bSmrg</para>
8230568f49bSmrg</blockquote>
8240568f49bSmrg</listitem>
8250568f49bSmrg<listitem>
8260568f49bSmrg<para>
8270568f49bSmrgX11R6.4 (1998) added
8280568f49bSmrg<xref linkend='Resource_Configuration_Management' />.
8290568f49bSmrgThe release notes explain that by saying
8300568f49bSmrg<blockquote>
8310568f49bSmrg<para>
8320568f49bSmrgThe X Toolkit Intrinsics library (libXt) now has IBM's Easy Resource
8330568f49bSmrgConfiguration support included.
8340568f49bSmrg</para>
8350568f49bSmrg</blockquote>
8360568f49bSmrg</para>
8370568f49bSmrg<para>
8380568f49bSmrgbut goes on to say (section 14) that
8390568f49bSmrg<blockquote>
8400568f49bSmrg<para>
8410568f49bSmrgEasy Resource Configuration
8420568f49bSmrgis not a standard part of the X Toolkit Intrinsics (libXt).
8430568f49bSmrgIt is neither an X Consortium standard nor an X Project Team specification.
8440568f49bSmrg</para>
8450568f49bSmrg</blockquote>
8460568f49bSmrg</para>
8470568f49bSmrg</listitem>
8480568f49bSmrg<listitem>
8490568f49bSmrg<para>
8500568f49bSmrgX11R6.5 (2000) documented a bug-fix for XtAppPeekEvent in the release notes,
8510568f49bSmrgstating that it now worked as described in the specification.
8520568f49bSmrgIt also modified the description of XtAppPeekEvent in the specification.
8530568f49bSmrgPreviously the specification stated that no known implementations behaved
8540568f49bSmrgas specified.
8550568f49bSmrg</para>
8560568f49bSmrg</listitem>
8570568f49bSmrg<listitem>
8580568f49bSmrg<para>
8590568f49bSmrgSubsequent releases X11R6.6 (2001) through X11R6.9 (2005)
8600568f49bSmrgdid not document any new or improved features.
8610568f49bSmrg</para>
8620568f49bSmrg</listitem>
8630568f49bSmrg</itemizedlist>
8640568f49bSmrg<para>
8650568f49bSmrgThroughout this interval,
8660568f49bSmrgthere were undocumented fixes and improvements made to the X Toolkit Intrinsics library.
8670568f49bSmrgThe documentation was modified to fix minor errors,
8680568f49bSmrgimprove the formatting, and
8690568f49bSmrgupdate version numbers.
8700568f49bSmrg</para>
8710568f49bSmrg</sect2>
8720568f49bSmrg<sect2 id="Changes_During_X11R7">
8730568f49bSmrg<title>Changes During X11R7</title>
8740568f49bSmrg<para>
8750568f49bSmrgX11R7 releases starting in 2005 continued this trend,
8760568f49bSmrgconverting the documentation from nroff to sgml.
8770568f49bSmrgX11R7.7 (2012) provides the same Intrinsics specification
8780568f49bSmrg(aside from details of formatting and version numbers) as X11R6 (1995).
8790568f49bSmrg</para>
8800568f49bSmrg<para>
8810568f49bSmrgThe updates for this specification are a continuation of X11R7.7,
8820568f49bSmrgbecause (as of April 2019) there are no plans for an X11R7.8 release.
8830568f49bSmrg</para>
8840568f49bSmrg</sect2>
8850568f49bSmrg<sect2 id="Converting_to_Standard_C">
8860568f49bSmrg<title>Converting to Standard C</title>
8870568f49bSmrg<para>
8880568f49bSmrgThe Intrinsics specification was first released with X11R3 in 1989.
8890568f49bSmrgThat was too early to take Standard C (i.e., ANSI C) into account.
8900568f49bSmrgBecause vendors generally did not provide a no-cost Standard C compiler,
8910568f49bSmrgthe X Toolkit Intrinsics library initially supported both K&amp;R and ANSI C.
8920568f49bSmrgThe X11R5 release notes mention using gcc, with some caveats.
8930568f49bSmrgAs a result, the specification and implementation gave equal attention
8940568f49bSmrgto both K&amp;R and ANSI C.
8950568f49bSmrg</para>
8960568f49bSmrg<para>
8970568f49bSmrgThis example shows how a function prototype was used in the C header files:
8980568f49bSmrg</para>
8990568f49bSmrg<programlisting>
9000568f49bSmrgextern Display *XtOpenDisplay(
9010568f49bSmrg#if NeedFunctionPrototypes
9020568f49bSmrg    XtAppContext        /* app_context */,
9030568f49bSmrg    _Xconst _XtString   /* display_string */,
9040568f49bSmrg    _Xconst _XtString   /* application_name */,
9050568f49bSmrg    _Xconst _XtString   /* application_class */,
9060568f49bSmrg    XrmOptionDescRec*   /* options */,
9070568f49bSmrg    Cardinal            /* num_options */,
9080568f49bSmrg    int*                /* argc */,
9090568f49bSmrg    char**              /* argv */
9100568f49bSmrg#endif
9110568f49bSmrg);
9120568f49bSmrg</programlisting>
9130568f49bSmrg<para>
9140568f49bSmrgThe parameters for the ANSI C prototype were conditionally compiled.
9150568f49bSmrgUsed with a K&amp;R compiler, those parameters were ignored.
9160568f49bSmrg</para>
9170568f49bSmrg<itemizedlist>
9180568f49bSmrg<listitem>
9190568f49bSmrg<para>
9200568f49bSmrgThe X Toolkit Intrinsics library used <type>const</type> in just a few cases.
9210568f49bSmrgThe specification did not mention it at all.
9220568f49bSmrg</para>
9230568f49bSmrg<para>
9240568f49bSmrgOver time, that was seen as a problem,
9250568f49bSmrgpartly because of gcc's warning options
9260568f49bSmrgsuch as <emphasis remap='I'>write-strings</emphasis>,
9270568f49bSmrgintroduced in early 1988 (released with gcc 1.27 in late 1988).
9280568f49bSmrgQuoting from gcc 2.58's documentation (late 1993):
9290568f49bSmrg<programlisting>
9300568f49bSmrg`-Wwrite-strings'
9310568f49bSmrg     Give string constants the type `const char[LENGTH]' so that
9320568f49bSmrg     copying the address of one into a non-`const' `char *' pointer
9330568f49bSmrg     will get a warning.  These warnings will help you find at compile
9340568f49bSmrg     time code that can try to write into a string constant, but only
9350568f49bSmrg     if you have been very careful about using `const' in declarations
9360568f49bSmrg     and prototypes.  <emphasis remap='I'>Otherwise, it will just be a nuisance; this is
9370568f49bSmrg     why we did not make `-Wall' request these warnings.</emphasis>
9380568f49bSmrg</programlisting>
9390568f49bSmrg</para>
9400568f49bSmrg<para>
9410568f49bSmrgOthers did not agree that it was a nuisance. Besides the obvious advantage
9420568f49bSmrgof improving program correctness, making a symbol &ldquo;const&rdquo;
9430568f49bSmrggave the compiler and linker a hint that the symbol could be put into
9440568f49bSmrgthe text (read-only) section, eliminating some steps needed by the linker
9450568f49bSmrgto adjust addresses and thereby reducing the time it took to load a
9460568f49bSmrgprogram into memory.
9470568f49bSmrg</para>
9480568f49bSmrg<para>
9490568f49bSmrgOther gcc warning options (such as
9500568f49bSmrgsuch as <emphasis remap='I'>cast-qual</emphasis>)
9510568f49bSmrgare useful for improving programs.
9520568f49bSmrgThey give similar information, because unless told otherwise,
9530568f49bSmrggcc would treat string values as nonwritable.
9540568f49bSmrgQuoting from gcc 1.27:
9550568f49bSmrg<programlisting>
9560568f49bSmrg   * GNU CC normally makes string constants read-only.  If several
9570568f49bSmrg     identical-looking string constants are used, GNU CC stores only
9580568f49bSmrg     one copy of the string.
9590568f49bSmrg     ...
9600568f49bSmrg     The best solution to these problems is to change the program to
9610568f49bSmrg     use `char'-array variables with initialization strings for these
9620568f49bSmrg     purposes instead of string constants.  But if this is not
9630568f49bSmrg     possible, you can use the `-fwritable-strings' flag, which
9640568f49bSmrg     directs GNU CC to handle string constants the same way most C
9650568f49bSmrg     compilers do.
9660568f49bSmrg</programlisting>
9670568f49bSmrgand
9680568f49bSmrg<programlisting>
9690568f49bSmrg    `-fwritable-strings'
9700568f49bSmrg          Store string constants in the writable data segment and
9710568f49bSmrg          don't uniquize them.  This is for compatibility with old
9720568f49bSmrg          programs which assume they can write into string constants.
9730568f49bSmrg          Writing into string constants is a very bad idea;
9740568f49bSmrg          ``constants'' should be constant.
9750568f49bSmrg</programlisting>
9760568f49bSmrg</para>
9770568f49bSmrg</listitem>
9780568f49bSmrg<listitem>
9790568f49bSmrg<para>
9800568f49bSmrgSeveral prototypes in the implementation
9810568f49bSmrguse the private type <type>_XtString</type>.
9820568f49bSmrgThe specification and implementation also used a <type>String</type>
9830568f49bSmrgtype without explaining when it is appropriate.
9840568f49bSmrg<programlisting>
9850568f49bSmrgtypedef char *String;
9860568f49bSmrg
9870568f49bSmrg/* We do this in order to get "const" declarations to work right.  We
9880568f49bSmrg * use _XtString instead of String so that C++ applications can
9890568f49bSmrg * #define String to something else if they choose, to avoid conflicts
9900568f49bSmrg * with other C++ libraries.
9910568f49bSmrg */
9920568f49bSmrg#define _XtString char*
9930568f49bSmrg</programlisting>
9940568f49bSmrgThat is, the developers were providing for some workaround to allow
9950568f49bSmrgC++ applications to use the stricter compiler checking
9960568f49bSmrgassociated with <type>const</type>.
9970568f49bSmrg</para>
9980568f49bSmrg</listitem>
9990568f49bSmrg<listitem>
10000568f49bSmrg<para>
10010568f49bSmrgThe <type>String</type> type is not the only type used in the
10020568f49bSmrgprototypes for the X Toolkit Intrinsics library.
10030568f49bSmrgIts developers were also concerned with porting the library
10040568f49bSmrgto platforms with different size-constraints.
10050568f49bSmrgThey defined different types (used in the function prototypes)
10060568f49bSmrgdepending on whether a &ldquo;wide&rdquo; parameter type was appropriate: 
10070568f49bSmrg<programlisting>
10080568f49bSmrg/* _Xt names are private to Xt implementation, do not use in client code */
10090568f49bSmrg#if NeedWidePrototypes
10100568f49bSmrg#define _XtBoolean	int
10110568f49bSmrg#define _XtDimension	unsigned int
10120568f49bSmrg#define _XtKeyCode	unsigned int
10130568f49bSmrg#define _XtPosition	int
10140568f49bSmrg#define _XtXtEnum	unsigned int
10150568f49bSmrg#else
10160568f49bSmrg#define _XtBoolean	Boolean
10170568f49bSmrg#define _XtDimension	Dimension
10180568f49bSmrg#define _XtKeyCode	KeyCode
10190568f49bSmrg#define _XtPosition	Position
10200568f49bSmrg#define _XtXtEnum	XtEnum
10210568f49bSmrg#endif /* NeedWidePrototypes */
10220568f49bSmrg</programlisting>
10230568f49bSmrgand
10240568f49bSmrg<programlisting>
10250568f49bSmrg#ifdef CRAY
10260568f49bSmrgtypedef long		Boolean;
10270568f49bSmrgtypedef char*		XtArgVal;
10280568f49bSmrgtypedef long		XtEnum;
10290568f49bSmrg#else
10300568f49bSmrgtypedef char		Boolean;
10310568f49bSmrgtypedef long		XtArgVal;
10320568f49bSmrgtypedef unsigned char	XtEnum;
10330568f49bSmrg#endif
10340568f49bSmrg</programlisting>
10350568f49bSmrgIn practice, wide-prototypes are rarely used, not well supported.
10360568f49bSmrgThe specification did not clarify the distinction
10370568f49bSmrgbetween <type>Bool</type> (mentioned as a resource type)
10380568f49bSmrgand <type>Boolean</type> (used in all of the data structures).
10390568f49bSmrgThe implementation used both, predominantly the latter.
10400568f49bSmrg</para>
10410568f49bSmrg</listitem>
10420568f49bSmrg</itemizedlist>
10430568f49bSmrg<para>
10440568f49bSmrgOther features of Standard C were neglected in the specification because
10450568f49bSmrgit was accommodating K&amp;R C:
10460568f49bSmrg</para>
10470568f49bSmrg<itemizedlist>
10480568f49bSmrg<listitem>
10490568f49bSmrg<para>
10500568f49bSmrgK&amp;R C has no <type>void</type> keyword.
10510568f49bSmrgThe specification used it for return-types,
10520568f49bSmrgbut not to indicate an empty parameter list.
10530568f49bSmrgThe specification also stated that
10540568f49bSmrg<type>void*</type> would be used for the <type>XtPointer</type> type.
10550568f49bSmrg</para>
10560568f49bSmrg<para>
10570568f49bSmrgThe conversion to sgml lost the <type>void</type> return-type.
10580568f49bSmrg</para>
10590568f49bSmrg</listitem>
10600568f49bSmrg<listitem>
10610568f49bSmrg<para>
10620568f49bSmrgStandard C uses an ellipsis for variable-length argument lists, e.g., for
10630568f49bSmrg<xref linkend='XtVaAppCreateShell' />.
10640568f49bSmrgAgain, there was a conditional-compilation symbol
10650568f49bSmrg(<code>NeedVarargsPrototypes</code>)
10660568f49bSmrgto handle the different forms used.
10670568f49bSmrgHere is an example:
10680568f49bSmrg<programlisting>
10690568f49bSmrg#if NeedVarargsPrototypes
10700568f49bSmrgvoid
10710568f49bSmrgXtVaGetApplicationResources(Widget widget, XtPointer base, XtResourceList resources, Cardinal num_resources, ...)
10720568f49bSmrg#else
10730568f49bSmrg/*VARARGS4*/
10740568f49bSmrgvoid XtVaGetApplicationResources(widget, base, resources, num_resources, va_alist)
10750568f49bSmrg    Widget widget;
10760568f49bSmrg    XtPointer base;
10770568f49bSmrg    XtResourceList resources;
10780568f49bSmrg    Cardinal num_resources;
10790568f49bSmrg    va_dcl
10800568f49bSmrg#endif
10810568f49bSmrg</programlisting>
10820568f49bSmrg</para>
10830568f49bSmrg<para>
10840568f49bSmrgOne problem with the conditional-compilation was
10850568f49bSmrgthat it was easy to make a mistake with the order
10860568f49bSmrgof parameters between the two forms.
10870568f49bSmrgDevelopers would frequently group together parameters
10880568f49bSmrgwhich used the same type, whether or not they were adjacent in
10890568f49bSmrgthe Standard C prototype.
10900568f49bSmrg</para>
10910568f49bSmrg<para>
10920568f49bSmrgA comment in the X11R4 header file said that this was temporary,
10930568f49bSmrguntil function prototypes worked everywhere.
10940568f49bSmrgThat was finally removed in X11R6.7 (fourteen years later).
10950568f49bSmrgHowever, the subsequent conversion to sgml
10960568f49bSmrglost the ellipsis from the prototypes shown in the specification.
10970568f49bSmrg</para>
10980568f49bSmrg</listitem>
10990568f49bSmrg</itemizedlist>
11000568f49bSmrg<para>
11010568f49bSmrgSupport for K&amp;R C was removed from the header files in 2003
11020568f49bSmrg(released in X11R6.7),
11030568f49bSmrgand from the library source in 2004
11040568f49bSmrg(released in X11R6.9).
11050568f49bSmrgThe wide-prototype feature is still present in 2019, but generally unused.
11060568f49bSmrg</para>
11070568f49bSmrg<para>
11080568f49bSmrgRemoving support for K&amp;R C did not address the issues of <type>const</type>.
11090568f49bSmrgThat was done in 2019:
11100568f49bSmrg</para>
11110568f49bSmrg<itemizedlist>
11120568f49bSmrg<listitem>
11130568f49bSmrg<para>
11140568f49bSmrgThe <type>String</type> is conditionally defined,
11150568f49bSmrgto provide compatibility with existing applications.
11160568f49bSmrg</para>
11170568f49bSmrg</listitem>
11180568f49bSmrg<listitem>
11190568f49bSmrg<para>
11200568f49bSmrgIf the symbol <symbol>_CONST_X_STRING</symbol> is defined,
11210568f49bSmrg<type>String</type> is read-only as shown here.
11220568f49bSmrg<programlisting>
11230568f49bSmrg/*
11240568f49bSmrg * As used in its function interface, the String type of libXt can be readonly.
11250568f49bSmrg * But compiling libXt with this feature may require some internal changes,
11260568f49bSmrg * e.g., casts and occasionally using a plain "char*".
11270568f49bSmrg */
11280568f49bSmrg#ifdef _CONST_X_STRING
11290568f49bSmrgtypedef const char *String;
11300568f49bSmrg#else
11310568f49bSmrgtypedef char *String;
11320568f49bSmrg#endif
11330568f49bSmrg</programlisting>
11340568f49bSmrg</para>
11350568f49bSmrg</listitem>
11360568f49bSmrg<listitem>
11370568f49bSmrg<para>
11380568f49bSmrgApplications which use the newer <type>const</type> feature must define
11390568f49bSmrg<symbol>_CONST_X_STRING</symbol> to enable this feature.
11400568f49bSmrg</para>
11410568f49bSmrg</listitem>
11420568f49bSmrg<listitem>
11430568f49bSmrg<para>
11440568f49bSmrgBy default, the X Toolkit Intrinsics library
11450568f49bSmrguses the <type>const</type> feature.
11460568f49bSmrgIt has been updated to make use of the <type>const</type> feature
11470568f49bSmrgfor improved type-checking.
11480568f49bSmrg</para>
11490568f49bSmrg</listitem>
11500568f49bSmrg<listitem>
11510568f49bSmrg<para>
11520568f49bSmrgBecause the X Toolkit Intrinsics library uses <type>const</type>,
11530568f49bSmrgsome prototypes have been modified.
11540568f49bSmrgFor example:
11550568f49bSmrg<itemizedlist>
11560568f49bSmrg<listitem>
11570568f49bSmrg<para>
11580568f49bSmrgMost of the parameters which used <type>String</type> are unmodified; 
11590568f49bSmrga few (such as the <emphasis remap='I'>argv</emphasis>&ndash;parameters)
11600568f49bSmrgare actually read/write.
11610568f49bSmrgThey are now <type>char*</type> parameters.
11620568f49bSmrg</para>
11630568f49bSmrg<para>
11640568f49bSmrgMany of the strings passed to the library are stored in widgets
11650568f49bSmrgwithout reallocating a copy.
11660568f49bSmrgThose are treated as read-only, and use the <type>String</type> type.
11670568f49bSmrg</para>
11680568f49bSmrg</listitem>
11690568f49bSmrg<listitem>
11700568f49bSmrg<para>
11710568f49bSmrgEach change to the documentation was verified using scripts that
11720568f49bSmrgextracted the function prototypes and used the C compiler to check
11730568f49bSmrgfor compatibility.
11740568f49bSmrg</para>
11750568f49bSmrg</listitem>
11760568f49bSmrg</itemizedlist>
11770568f49bSmrg</para>
11780568f49bSmrg</listitem>
11790568f49bSmrg</itemizedlist>
11800568f49bSmrg</sect2>
11810568f49bSmrg</sect1>
11829e7bcd65Smrg</chapter>
1183