Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!bionet!ig!agate!ucbvax!decwrl!hplabs!hp-sde!hpfcdc!hpfclp!diamant
From: diamant@hpfclp.SDE.HP.COM (John Diamant)
Newsgroups: comp.windows.x
Subject: Re: Resource management on 11.2
Message-ID: <9740059@hpfclp.SDE.HP.COM>
Date: 17 Sep 88 05:45:22 GMT
References: <8809160015.AA14382@decwrl.dec.com>
Organization: HP SDE, Fort Collins, CO
Lines: 45

> 4) /usr/lib/X11/app-defaults is a directory of files where the file name
>    is a classname.  For xterm, the classname is XTerm.  Each client has
>    it's own classname (as far as I can tell.)  This is not documented
>    well.  For instance, given the set of clients from MIT, what are the
>    given classnames?  Is there a way for the user to specify classnames
>    at runtime?

The classname needs to be documented by the client (in the man page
would be appropriate).  If they are not, look in the app-defaults directory
to see if you can find the ones in use.  For most applications, the
classname is unique.  This is by convention only, but it is very important
if the app-defaults files are to be usable (since defaults are program
specific).  Unfortunately, the Inter-Client Communications Conventions
Manual specifies that all window managers use the class "Wm" instead of
a unique one.  Not only is that inconsistent with common practice, but it
makes an app-defaults file for window managers a very risky endevour.

As far as whether you can specify a classname at runtime, the answer is
no, unless the client goes to great pains to make it possible (XtInitialize
parses command line arguments and .Xdefaults).  Obviously, once XtInitialize
has been called, it's too late to change the class value used in looking
up the app-defaults file and resources in .Xdefaults.  You can specify the
name of an application (really, the instance) with -name on the command
line, but app-defaults will not be looked up based on it.

What is really needed is three different levels of resource lookup:
instance		win1
application name	Emacs
application class	EDIT

The toolkit has the first two of these, and calls them name and class.
If the conventions were different, the name and class could correspond to
what I called name and class above, but that doesn't work well with the
existing mechanisms (name would have to be set on command line manually,
class would make app-defaults useless, because different defaults are
needed for different applications).  If we had three levels instead of
two, you could load Emacs specific entrires in an Emacs app-defaults file
and EDITOR generic resources in an EDITOR app-defaults or via entries in
.Xdefaults like: "EDIT*foreground:	green" to make all your edit
windows green regardless of which editor you used.

John Diamant
Software Development Environments
Hewlett-Packard Co.		ARPA Internet: diamant@hpfclp.sde.hp.com
Fort Collins, CO		UUCP:  {hplabs,hpfcla}!hpfclp!diamant