Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: Resource Database - Help! Message-ID: <8805131605.AA20134@EXPO.LCS.MIT.EDU> Date: 13 May 88 16:05:26 GMT References: <1610015@hpcvlx.HP.COM> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 79 More complete explanations can be found in the "Using and Specifying X Resources" tutorial that was sent out a couple months ago and will be a part of R3. I'll mail a copy of it to you separately. However, for the sake of discussion, > 1. Who owns a resource database? A client? A window? A client. > 2. There are specific references to a resource database loaded into the > server, or stored as a property on the root window. Which is true? Resources are obtained from the following places: 1. from the RESOURCE_MANAGER property on the root window of screen 0; these are stored using the xrdb program. If this property is not defined, then $HOME/.Xdefaults will be read to provide compatibility with X10 (although the resource specification format has changed somewhat). 2. from any application-specific resource files, usually stored in /usr/lib/X11/app-defaults/. 3. from any user-specific defaults stored in a file whose name is set in the environment variable XENVIRONMENT. 4. from the -xrm command line option (for programs written with the X Toolkit). > 3. What does the first quote above mean by "when you log in"? Does that > mean when you fire up the X server? Or does it mean when you open > a display? It actually means when you run a program like xrdb that sets the RESOURCE_MANAGER property on the root window of screen 0. You do this from whatever mechanism you use to start up your commonly-used X applications (e.g. your window manager, terminal emulators, clocks, load average monitors, editors, mail readers, etc.). I use a little shell script, other people have fancy session managers, etc. An example is given in the Resources Tutorial, but it boils down to running the xrdb program. > 5. Is the resouce database and the resource manager referred to in the > Xlib manual the same as that used by the toolkit? Yes. > 6. In section 10.11.2 of the Xlib manual, it says that a resource > database is an opaque type. What does this mean? An XrmDatabase is defined as: typedef struct _XrmHashBucketRec *XrmDatabase; However, if you look around, you'll find that there is no definition for struct _XrmHashBucketRec in the public include files. As a result, your program cannot access any fields in it; this is a useful way to do abstraction and data hiding. > 7. Section 4 of the Inter-client Communication Conventions Manual > discusses resources that are allocated to clients. Are these the > same types of resouces as are discussed in the Xlib manual, chapter 10? Yes. A copy of "Using and Specifying X Resources" will arrive separately. Jim Fulton X Consortium MIT Laboratory for Computer Science (617) 253-1428 jim@EXPO.LCS.MIT.EDU