home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / doc / Xt / CH13 < prev    next >
Encoding:
Text File  |  1991-08-27  |  16.1 KB  |  487 lines

  1. .\" $XConsortium: CH13,v 1.5 91/08/26 13:41:42 swick Exp $
  2. .\"
  3. .\" Copyright 1985, 1986, 1987, 1988, 1991
  4. .\" Massachusetts Institute of Technology, Cambridge, Massachusetts,
  5. .\" and Digital Equipment Corporation, Maynard, Massachusetts.
  6. .\"
  7. .\" Permission to use, copy, modify and distribute this documentation for any
  8. .\" purpose and without fee is hereby granted, provided that the above copyright
  9. .\" notice appears in all copies and that both that copyright notice and this
  10. .\" permission notice appear in supporting documentation, and that the name of
  11. .\" M.I.T. or Digital not be used in in advertising or publicity pertaining
  12. .\" to distribution of the software without specific, written prior permission.
  13. .\" M.I.T and Digital makes no representations about the suitability of the
  14. .\" software described herein for any purpose.
  15. .\" It is provided ``as is'' without express or implied warranty.
  16. \&
  17. .sp 1
  18. .ce 3
  19. \s+1\fBChapter 13\fP\s-1
  20.  
  21. \s+1\fBEvolution of The \*(xI\fP\s-1
  22. .sp 2
  23. .nr H1 13
  24. .nr H2 0
  25. .nr H3 0
  26. .nr H4 0
  27. .nr H5 0
  28. .LP
  29. .XS
  30. Chapter 13 \- Evolution of The \*(xI
  31. .XE
  32. .LP
  33. The interfaces described by this specification have undergone several
  34. sets of revisions in the course of adoption as an X Consortium
  35. standard specification.  Having now been adopted by the Consortium as
  36. a standard part of the X Window System, it is expected that this and
  37. future revisions will retain
  38. backward compatibility in the sense that fully conforming
  39. implementations of these specifications may be produced that provide
  40. source compatibility with widgets and applications written to
  41. previous Consortium standard revisions.
  42. .LP
  43. The \*(xI do not place any special requirement on widget
  44. programmers to retain source or binary compatibility for their widgets
  45. as they evolve, but several conventions have been established to
  46. assist those developers who want to provide such compatibility.
  47. .LP
  48. In particular, widget programmers may wish to conform to the convention
  49. described in Section 1.6.12 when defining class extension records.
  50.  
  51. .NH 2
  52. Determining Specification Revision Level
  53. .XS
  54. \fB\*(SN Determining Specification Revision Level\fP
  55. .XE
  56. .LP
  57. Widget and application developers who wish to maintain a common source
  58. pool that will build properly with implementations of the \*(xI
  59. at different revision levels of these specifications but that take
  60. advantage of newer features added in later revisions may use the
  61. symbolic macro
  62. .PN XtSpecificationRelease .
  63. .LP
  64. .Ds 0
  65. #define XtSpecificationRelease 5
  66. .De
  67. .IN "XtSpecificationRelease" "" "@DEF@"
  68. .LP
  69. As the symbol
  70. .PN XtSpecificationRelease
  71. was new to Release 4, widgets and
  72. applications desiring to build against earlier implementations should
  73. test for the presence of this symbol and assume only Release 3
  74. interfaces if the definition is not present.
  75.  
  76. .NH 2
  77. Release 3 to Release 4 Compatibility
  78. .XS
  79. \fB\*(SN Release 3 to Release 4 Compatibility\fP
  80. .XE
  81. .LP
  82. At the data structure level, Release 4 retains binary compatibility
  83. with Release 3 (the first X Consortium standard release) for all data
  84. structures except
  85. .PN WMShellPart, 
  86. .PN TopLevelShellPart ,
  87. and
  88. .PN TransientShellPart .
  89. Release 4 changed the argument type to most procedures that now take
  90. arguments of type
  91. .PN XtPointer
  92. and structure members that are now of type
  93. .PN XtPointer
  94. in order to avoid potential ANSI C conformance problems.  It is
  95. expected that most implementations will be binary compatible with the
  96. previous definition.
  97. .LP
  98. Two fields in
  99. .PN CoreClassPart
  100. were changed from
  101. .PN Boolean
  102. to
  103. .PN XtEnum
  104. to allow implementations additional freedom in specifying the
  105. representations of each.  This change should require no source
  106. modification.
  107.  
  108. .NH 3
  109. Additional Arguments
  110. .XS
  111. \*(SN Additional Arguments
  112. .XE
  113. .LP
  114. Arguments were added to the procedure definitions for
  115. .PN XtInitProc ,
  116. .PN XtSetValuesFunc ,
  117. and
  118. .PN XtEventHandler
  119. to provide more information and to
  120. allow event handlers to abort further dispatching of the current event
  121. (caution is advised!).  The added arguments to
  122. .PN XtInitProc
  123. and
  124. .PN XtSetValuesFunc
  125. make the initialize_hook and set_values_hook methods
  126. obsolete, but the hooks have been retained for those widgets that used
  127. them in Release 3.
  128.  
  129. .NH 3
  130. set_values_almost Procedures
  131. .XS
  132. \*(SN set_values_almost Procedures
  133. .XE
  134. .LP
  135. The use of the arguments by a set_values_almost procedure was poorly
  136. described in Release 3 and was inconsistent with other conventions.
  137. .LP
  138. The current specification for the manner in which a set_values_almost
  139. procedure returns information to the \*(xI is not compatible with
  140. the Release 3 specification, and all widget implementations should
  141. verify that any set_values_almost procedures conform to the current
  142. interface.
  143. .LP
  144. No known implementation of the \*(xI correctly implemented the
  145. Release 3 interface, so it is expected that the impact of this
  146. specification change is small.
  147.  
  148. .NH 3
  149. Query Geometry
  150. .XS
  151. \*(SN Query Geometry
  152. .XE
  153. .LP
  154. A composite widget layout routine that calls
  155. .PN XtQueryGeometry
  156. is now expected to store the complete new geometry in the intended structure;
  157. previously the specification said ``store the changes it intends to
  158. make''.  Only by storing the complete geometry does the child have
  159. any way to know what other parts of the geometry may still be
  160. flexible.  Existing widgets should not be affected by this, except
  161. to take advantage of the new information.
  162.  
  163. .NH 3
  164. unrealizeCallback Callback List
  165. .XS
  166. \*(SN unrealizeCallback Callback List
  167. .XE
  168. .LP
  169. In order to provide a mechanism for widgets to be notified when they
  170. become unrealized through a call to
  171. .PN XtUnrealizeWidget ,
  172. the callback
  173. list name ``unrealizeCallback'' has been defined by the \*(xI.  A
  174. widget class that requires notification on unrealize may declare a
  175. callback list resource by this name.  No class is required to declare
  176. this resource, but any class that did so in a prior revision may find
  177. it necessary to modify the resource name if it does not wish to use the new
  178. semantics.
  179.  
  180. .NH 3
  181. Subclasses of WMShell
  182. .XS
  183. \*(SN Subclasses of WMShell
  184. .XE
  185. .LP
  186. The formal adoption of the \fI\*(xC\fP as
  187. an X Consortium standard has meant the addition of four fields to
  188. .PN WMShellPart
  189. and one field to
  190. .PN TopLevelShellPart .
  191. In deference to some
  192. widget libraries that had developed their own additional conventions
  193. to provide binary compatibility, these five new fields were added at
  194. the end of the respective data structures. 
  195. .LP
  196. To provide more convenience for TransientShells, a field was added
  197. to the previously empty
  198. .PN TransientShellPart .
  199. On some architectures the size of the part structure will not
  200. have changed as a result of this.
  201. .LP
  202. Any widget implementation whose class is a subclass of
  203. TopLevelShell
  204. or
  205. TransientShell
  206. must at minimum be
  207. recompiled with the new data structure declarations.  Because
  208. .PN WMShellPart
  209. no longer contains a contiguous
  210. .PN XSizeHints
  211. data structure,
  212. a subclass that expected to do a single structure assignment of an
  213. .PN XSizeHints
  214. structure to the \fIsize_hints\fP field of
  215. .PN WMShellPart
  216. must be revised, though the old fields remain at the same positions within
  217. .PN WMShellPart .
  218.  
  219. .NH 3
  220. Resource Type Converters
  221. .XS
  222. \*(SN Resource Type Converters
  223. .XE
  224. .LP
  225. A new interface declaration for resource type converters was defined
  226. to provide more information to converters, to support conversion
  227. cache cleanup with resource reference counting, and to allow
  228. additional procedures to be declared to free resources.  The old
  229. interfaces remain (in the compatibility section) and a new set of
  230. procedures was defined that work only with the new type converter
  231. interface.
  232. .LP
  233. In the now obsolete old type converter interface, converters are
  234. reminded that they must return the size of the converted value as well
  235. as its address.  The example indicated this, but the description of
  236. .PN XtConverter
  237. was incomplete.
  238.  
  239. .NH 3
  240. KeySym Case Conversion Procedure
  241. .XS
  242. \*(SN KeySym Case Conversion Procedure
  243. .XE
  244. .LP
  245. The specification for the
  246. .PN XtCaseProc
  247. function type has been changed
  248. to match the Release 3 implementation, which included necessary
  249. additional information required by the function (a pointer to the
  250. display connection), and corrects the argument type of the source
  251. KeySym parameter.  No known implementation of the \*(xI
  252. implemented the previously documented interface.
  253.  
  254. .NH 3
  255. Nonwidget Objects
  256. .XS
  257. \*(SN Nonwidget Objects
  258. .XE
  259. .LP
  260. Formal support for nonwidget objects is new to Release 4.  A
  261. prototype implementation was latent in at least one Release 3
  262. implementation of the \*(xI, but the specification has changed
  263. somewhat.  The most significant change is the requirement for a
  264. composite widget to declare the
  265. .PN CompositeClassExtension
  266. record with the \fIaccepts_objects\fP field set to
  267. .PN True
  268. in order to permit a client to create a nonwidget child.
  269. .LP
  270. The addition of this extension field ensures that composite widgets
  271. written under Release 3 will not encounter unexpected errors if an
  272. application attempts to create a nonwidget child.  In Release 4 there
  273. is no requirement that all composite widgets implement the extra
  274. functionality required to manage windowless children, so the
  275. \fIaccept_objects\fP field allows a composite widget to declare that it
  276. is not prepared to do so.
  277.  
  278. .NH 2
  279. Release 4 to Release 5 Compatibility
  280. .XS
  281. \fB\*(SN Release 4 to Release 5 Compatibility\fP
  282. .XE
  283. .LP
  284. At the data structure level, Release 5 retains complete binary
  285. compatibility with release 4.  The specification of the
  286. .PN ObjectPart ,
  287. .PN RectObjPart ,
  288. .PN CorePart ,
  289. .PN CompositePart ,
  290. .PN ShellPart ,
  291. .PN WMShellPart ,
  292. .PN TopLevelShellPart ,
  293. and
  294. .PN ApplicationShellPart
  295. instance records was made less strict to permit implementations to
  296. add internal fields to these structures.  Any implementation that
  297. chooses to do so would, of course, force a recompilation.
  298. The Xlib specification for
  299. .PN XrmValue
  300. and
  301. .PN XrmOptionDescRec
  302. was updated to use a new type,
  303. .PN XPointer ,
  304. for the \fIaddr\fP and \fIvalue\fP fields respectively, to avoid
  305. ANSI C conformance problems.  The definition of
  306. .PN XPointer
  307. is binary compatible with the previous implementation.
  308.  
  309. .NH 3
  310. baseTranslations Resource
  311. .XS
  312. \fB\*(SN baseTranslations Resource\fP
  313. .XE
  314.  
  315. .LP
  316. A new pseudo-resource, XtNbaseTranslations, was defined to permit
  317. application developers to specify translation tables in application
  318. defaults files while still giving end users the ability to augment
  319. or override individual event sequences.  This change will affect
  320. only those applications that wish to take advantage of the new
  321. functionality, or those widgets that may have previously defined
  322. a resource named ``baseTranslations''.
  323. .LP
  324. Applications wishing to take advantage of the new functionality
  325. would change their application defaults file, e.g., from
  326. .Ds
  327.     app.widget.translations: \fIvalue\fP
  328. .DE
  329. to
  330. .Ds
  331.     app.widget.baseTranslations: \fIvalue\fP
  332. .DE
  333. If it is important to the application to preserve complete
  334. compatibility of the defaults file between different versions
  335. of the application running under Release 4 and Release 5,
  336. the full translations can be replicated in both the ``translations''
  337. and the ``baseTranslations'' resource.
  338.  
  339. .NH 3
  340. Resource File Search Path
  341. .XS
  342. \fB\*(SN Resource File Search Path\fP
  343. .XE
  344.  
  345. .LP
  346. The current specification allows implementations greater flexibility
  347. in defining the directory structure used to hold the application class
  348. and per-user application defaults files.  Previous specifications
  349. required the substitution strings to appear in the default path in a
  350. certain order, preventing sites from collecting all the files for
  351. a specific application together in one directory.  The Release 5
  352. specification allows the default path to specify the substitution
  353. strings in any order within a single path entry.  Users will need to
  354. pay close attention to the documentation for the specific
  355. implementation to know where to find these files and how to specify
  356. their own
  357. .PN XFILESEARCHPATH
  358. and
  359. .PN XUSERFILESEARCHPATH
  360. values when overriding the system defaults.
  361.  
  362. .NH 3
  363. Customization Resource
  364. .XS
  365. \fB\*(SN Customization Resource\fP
  366. .XE
  367.  
  368. .LP
  369. .PN XtResolvePathname
  370. supports a new substitution string, %C, for specifying separate
  371. application class resource files according to arbitrary user-specified
  372. categories.  The primary motivation for this addition was separate
  373. monochrome and color application class defaults files.  The
  374. substitution value is obtained by querying the current resource
  375. database for the application resource name ``customization'', class
  376. ``Customization''.  Any application that previously used this
  377. resource name and class will need to be aware of the possibly
  378. conflicting semantics.
  379.  
  380. .NH 3
  381. Per-Screen Resource Database
  382. .XS
  383. \fB\*(SN Per-Screen Resource Database\fP
  384. .XE
  385.  
  386. .LP
  387. To allow a user to specify separate preferences for each screen of a
  388. display, a per-screen resource specification string has been added and
  389. multiple resource databases are created; one for each screen.  This
  390. will affect any application that modified the (formerly unique)
  391. resource database associated with the display subsequent to the \*(xI
  392. database initialization.  Such applications will need to be aware
  393. of the particular screen on which each shell widget is to be created.
  394. .LP
  395. Although the wording of the specification changed substantially in the
  396. description of the process by which the resource database(s) is
  397. initialized, the net effect is the same as in prior releases with the
  398. exception of the added per-screen resource specification and the new
  399. customization substitution string in
  400. .PN XtResolvePathname .
  401.  
  402. .NH 3
  403. Internationalization of Applications
  404. .XS
  405. \fB\*(SN Internationalization of Applications\fP
  406. .XE
  407.  
  408. .LP
  409. Internationalization as defined by ANSI is a technology that
  410. allows support of an application in a single locale.  In
  411. adding support for internationalization to the \*(xI
  412. the restrictions of this model have been followed.
  413. In particular, the new \*(xI interfaces are designed to not
  414. preclude an application from using other alternatives.
  415. For this reason, no \*(xI routine makes a call to establish the
  416. locale.   However, a convenience routine to establish the
  417. locale at initialize time has been provided, in the form
  418. of a default procedure that must be explicitly installed
  419. if the application desires ANSI C locale behavior.
  420. .LP
  421. As many objects in X, particularly resource databases, now inherit
  422. the global locale when they are created, applications wishing to use
  423. the ANSI C locale model should use the new function
  424. .PN XtSetLanguageProc
  425. to do so.
  426. .LP
  427. The internationalization additions also define event filters
  428. as a part of the Xlib Input Method specifications.  The
  429. \*(xI enable the use of event filters through additions to
  430. .PN XtDispatchEvent .
  431. Applications that may not be dispatching all events through
  432. .PN XtDispatchEvent
  433. should be reviewed in the context of this new input method mechanism.
  434. .LP
  435. In order to permit internationalization of error messages the name
  436. and path of the error database file is now allowed to be implementation
  437. dependent.  No adequate standard mechanism has yet been suggested to
  438. allow the \*(xI to locate the database from localization information
  439. supplied by the client.
  440. .LP
  441. The previous specification for the syntax of the language string
  442. specified by
  443. .PN xnlLanguage
  444. has been dropped to avoid potential conflicts with other standards.
  445. The language string syntax is now implementation-defined.
  446. The example syntax cited is consistent with the previous
  447. specification.
  448.  
  449. .NH 3
  450. Permanently Allocated Strings
  451. .XS
  452. \*(SN Permanently Allocated Strings
  453. .XE
  454.  
  455. .LP
  456. In order to permit additional memory savings, an Xlib interface was
  457. added to allow the resource manager to avoid copying certain string
  458. constants.  The \*(xI specification was updated to explicitly require
  459. the Object \fIclass_name\fP, \fIresource_name\fP, \fIresource_class\fP,
  460. \fIresource_type\fP, \fIdefault_type\fP in resource tables, Core \fIactions\fP
  461. \fIstring\fP field, and Constraint \fIresource_name\fP, \fIresource_class\fP,
  462. \fIresource_type\fP, and \fIdefault_type\fP resource fields to be
  463. permanently allocated.  This explicit requirement is expected to
  464. affect only applications that may create and destroy classes
  465. on the fly.
  466.  
  467. .NH 3
  468. Arguments to Existing Functions
  469. .XS
  470. \fB\*(SN Arguments to Existing Functions\fP
  471. .XE
  472.  
  473. .LP
  474. The \fIargs\fP argument to
  475. .PN XtAppInitialize ,
  476. .PN XtVaAppInitialize ,
  477. .PN XtOpenDisplay ,
  478. .PN XtDisplayInitialize ,
  479. and
  480. .PN XtInitialize
  481. were changed from
  482. .PN Cardinal *
  483. to int* to conform to pre-existing convention and avoid otherwise
  484. annoying typecasting in ANSI C environments.
  485.  
  486. .bp
  487.