home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / doc / appgroup.txt next >
Encoding:
Text File  |  2001-06-27  |  8.9 KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.        Description of the Application Group Extension
  11.       Implementation for the X11 Sample Server
  12.  
  13.              Kaleb S. KEITHLEY
  14.             X Consortium
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. AppGroup Extension Definitio- 1 -           October, 1996
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89. Copyright (C) 1996 X Consortium
  90.  
  91. Permission is hereby granted, free of charge, to any person
  92. obtaining a copy of this software and associated documenta-
  93. tion files (the ``Software''), to deal in the Software with-
  94. out restriction, including without limitation the rights to
  95. use, copy, modify, merge, publish, distribute, sublicense,
  96. and/or sell copies of the Software, and to permit persons to
  97. whom the Software is furnished to do so, subject to the fol-
  98. lowing conditions:
  99.  
  100. The above copyright notice and this permission notice shall
  101. be included in all copies or substantial portions of the
  102. Software.
  103.  
  104. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
  105. KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  106. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
  107. POSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE X CONSOR-
  108. TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  109. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  110. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  111. OR OTHER DEALINGS IN THE SOFTWARE.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. AppGroup Extension Definitio- 2 -           October, 1996
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. The following document explains the server side of the
  140. Application Group Extension.
  141.  
  142. WindowsNT is a trademark of Microsoft, Inc.  Macintosh and
  143. Apple are trademarks of Apple Computer, Inc.  X Window Sys-
  144. tem is a trademark of X Consortium, Inc.
  145.  
  146. To understand this document and the accompanying source
  147. code, you should know the C language, should be familiar
  148. with X server internals, and should also have a general
  149. knowledge of the X Window System.
  150.  
  151. 1.  AppGroup Server Public Functions
  152.  
  153. The AppGroup extension adds seven new functions that are
  154. called from elsewhere in the server. They are: XagExtension-
  155. Init, XagDefaultColormap, XagRootVisual, XagLeader, XagIs-
  156. ControlledRoot, XagConnectionInfo, XagCallClientStateChange.
  157.  
  158. XagExtensionInit is the extension initialization function
  159. called from InitExtension in mi/miinitext.c. Note that an
  160. new resource type, RT_APPGROUP, is created, specifying the
  161. destructor function XagAppGroupFree.
  162.  
  163. XagDefaultColormap returns the colormap ID that was speci-
  164. fied in the creation of the AppGroup. Any time CopyFromPar-
  165. ent is specified for a top-level window's colormap, i.e. in
  166. a CreateWindow or ChangeWindowAttributes request, this func-
  167. tion is called to see if there is an AppGroup specific col-
  168. ormap to use. If there is one, its ID is returned, otherwise
  169. None is returned.
  170.  
  171. XagRootVisual returns the visual ID that was specified in
  172. the creation of the Appgroup. Like XagDefaultColormap, when
  173. CopyFromParent is specified for a top-level window's visual
  174. in a CreateWindow request, this function is called to see if
  175. there is an AppGroup specific visual to use. If there is
  176. one, its ID is returned, otherwise 0 (zero) is returned.
  177.  
  178. XagLeader returns the ClientPtr of the client that is the
  179. AppGroup Leader. Normally when an application maps or con-
  180. figures a top-level window a MapRequest or ConfigureRequest
  181. event is delivered to the client, e.g. a window manager,
  182. that has selected SubstructureRedirect on the root window.
  183. However, when the application is part of an AppGroup, the
  184. MapRequest and ConfigureRequest events are delivered to the
  185. AppGroup Leader instead.
  186.  
  187. XagIsControlledRoot returns a boolean: True if the window is
  188. a top-level window of a client in an AppGroup, False other-
  189. wise.  In a combined server, i.e. one that provides both UI
  190. and printing, the application may create and map windows on
  191. the "printing" screens; thus it becomes necessary to dis-
  192. criminate between the AppGroup's root window and other root
  193.  
  194.  
  195.  
  196. AppGroup Extension Definitio- 3 -           October, 1996
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. windows. If an AppGroup member creates and maps a [top-
  206. level] window then the window's parent [the root window] is
  207. tested to determine whether to send MapRequest or Configur-
  208. eRequest events to the AppGroup Leader to to some other
  209. client.
  210.  
  211. In the trivial case XagIsControlledRoot returns True if the
  212. parent window has no parent itself, i.e. it is a root win-
  213. dow. In the case where the application is embedded, indi-
  214. cated by the singleScreen attribute being True, the parent's
  215. drawable ID is compared to the AppGroup's root window ID,
  216. and if it is the same, True is returned.  If neither case is
  217. true, then False is returned.
  218.  
  219. XagConnectionInfo returns an abreviated version of the con-
  220. nection setup information. When an embedded AppGroup is cre-
  221. ated the server returns only the information about the [UI]
  222. screen that the application is embedded within in the con-
  223. nection setup in order to prevent the application from cre-
  224. ating windows on other screens; thus attempting to guarantee
  225. that any window that should be embedded can be reparented
  226. into the AppGroup Leader's window hierarchy.
  227.  
  228. XagCallClientStateChange is called to invoke the extension's
  229. client state change callback additional times as necessary
  230. -- currently only once, after the auth data becomes avail-
  231. able between ClientStateInitial and ClientStateConnected.
  232. Client state change callbacks were introduced in the Record
  233. extension, which specifies when the callbacks are invoked.
  234. Unfortunately the points at which they are called are not
  235. necessarily the best as far as the AppGroup Extension is
  236. concerned. Adding an additional state and calling all the
  237. callbacks works too, however this seemed unnecessary
  238. overkill.
  239.  
  240. 2.  AppGroup Server Private APIs
  241.  
  242. The AppGroup extension adds the following functions which
  243. are private to the extension: ProcXagDispatch and SProcX-
  244. agDispatch, ProcXagQueryVersion and SProcXagQueryVersion,
  245. ProcXagCreate and SProcXagCreate, ProcXagDestroy and SProcX-
  246. agDestroy, ProcGetAttr and SProcGetAttr, ProcXagQuery and
  247. SProcXagQuery, ProcXagCreateAssoc and SProcXagCreateAssoc,
  248. ProcXagDestroyAssoc and SProcXagDestroyAssoc, XagResetProc,
  249. and XagAppGroupFree.
  250.  
  251. The ProcXagDispatch, SProcXagDispatch, and XagResetProc
  252. functions should be familiar to anyone familiar with X
  253. server internals and I won't elaborate on them here. Simi-
  254. larly the wrapper functions: SProcXagQueryVersion, SProcX-
  255. agCreate, SProcXagDestroy, SProcXagGetAttr, SProcXagQuery,
  256. SProcXagCreateAssoc, and SProcXagDestroyAssoc, as wrappers
  257. which handle swapping integer data into the host's byte
  258. order will not be explained in any detail.
  259.  
  260.  
  261.  
  262. AppGroup Extension Definitio- 4 -           October, 1996
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. ProcXagQueryVersion returns the major and minor versions of
  272. the AppGroup extension supported by the server.
  273.  
  274. ProcXagCreate creates an AppGroup. A new record in a linked
  275. list of AppGroups is allocated and initialized. The
  276. attributes from the request are validated and copied to the
  277. AppGroup record. If necessary an abbreviated version of the
  278. connection setup information is compiled and also stored in
  279. the AppGroup record. The first time an AppGroup is created a
  280. client-state-change callback is registered and a reference
  281. count is incremented.
  282.  
  283. ProcXagDestroy destroys an AppGroup an AppGroup by calling
  284. FreeResource specifying the AppGroup ID. This will result in
  285. the destructor function XagAppGroupFree being called. The
  286. reference count is decremented and when it reaches zero the
  287. client-state-change callback is deleted.
  288.  
  289. ProcXagGetAttr returns the AppGroup Attributes to the
  290. requesting client.
  291.  
  292. ProcXagQuery returns the AppGroup ID of an arbitrary
  293. resource to the requesting client.
  294.  
  295. ProcXagCreateAssoc creates an association between an X win-
  296. dow ID and system-specific data. In native X this function-
  297. ality is unnecessary but for various personal computers,
  298. e.g. Macintosh, OS/2, and MS-Windows it is necessary to
  299. associate an X window ID with the system's native window
  300. identifier so that when the AppGroup Leader issues a Repar-
  301. entWindow request the personal computer X server can lookup
  302. the system-specific window ID and make the necessary func-
  303. tion call(s) with it.
  304.  
  305. ProcXagDestroyAssoc destroys the association created with
  306. ProcXagCreateAssoc.
  307.  
  308. XagResetProc removes the client-state-change callback, sets
  309. the reference count to zero, and frees all the AppGroup
  310. records in the linked list by calling XagAppGroupFree.
  311.  
  312. XagAppGroupFree calls CloseDownClient for each client in an
  313. AppGroup if the AppGroup has a leader, unlinks the AppGroup
  314. record from the linked list, frees allocated memory refer-
  315. enced by the record, and finally frees the record itself.
  316.  
  317. 3.  Known Problems in this release.
  318.  
  319. In a combined UI/Print server the connection setup returned
  320. to an embedded application will not have information about
  321. the print screens.
  322.  
  323. The LBX proxy caches connection setup information and will
  324. return incorrect connection setup information to an embedded
  325.  
  326.  
  327.  
  328. AppGroup Extension Definitio- 5 -           October, 1996
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. client.
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. AppGroup Extension Definitio- 6 -           October, 1996
  395.  
  396.  
  397.