[comp.windows.x] Resources

tek@penzance.cs.ucla.edu (06/12/90)

There seem to be so many ways to set your resources. I have tried to
enumerate all of them here. Please tell me if I have forgotten any.

	Toolkit Programs
	----------------
In order of descending precedence:

1. Command Line
  standard arguments include:
    A. command switches (-display, -fg, -foreground, +rv, etc.)
    B. resource manager directives (-name, -xrm)
    C. natural lanaguage directive (-xnllangauge)

2. User Environment File
  use the first source found from:
    A. file named by XENVIRONMENT environment variable
    B. $HOST/.Xdefaults-<host> file

3. Server/User Preference Resources 
  use the first source found from:
    A. RESOURCE_MANAGER property on root window (screen 0)
    B. $HOME/.Xdefaults file

4. Application User Resources 
  use the first "class" file found by XtResolvePathname using the:
    A. search path defined by the XUSERFILESEARCHPATH environment variable
    B. search path based on the XAPPLRESDIR environment variable: 
      $XAPPLRESDIR/%L/%C:$XAPPLRESDIR/%l/%C:$XAPPLRESDIR/%C:$HOME/%C
    C. default search path:
      $HOME/%L/%C:$HOME/%l/%C:$HOME/%C

5. Application Class Resources 
  use the first source found from:
    A. the "app-defaults" type file found by XtResolvePathname using the:
        1) search path defined by the XFILESEARCHPATH environment variable 
	2) default search path:
	  /usr/lib/X11/%L/app-defaults/%C:/usr/lib/X11/%l/app-defaults/%C:\
	  /usr/lib/X11/app-defaults/%C
    B. fallback resources defined by XtAppSetFallbackResources

In the specifications above:	
  %C = class name
  %L = the whole language specification
  %l = just the language part (no territory or codespec) 

	Special Processing
	------------------
1. Display (using XtOpenDisplay)
  use the first source found from:
    A. Program Provided Name
    B. -display Command Arg
    C. DISPLAY environment variable

2. Name (using XtOpenDisplay)
  use the first source found from:
    A. -name Command Arg
    B. Program Provided Name
    C. RESOURCE_NAME environment variable 
    D. basename of argv[0]
    E. default name of "main"

3. Natural Language
  use the first source found from:
    A. Command Line
    B. Server/User Preference Resources
    C. LANG environment variable
  (notice that User Environment File is not used, and
   Application User and Class Resources depend on langauge)


	Xlib Programs
	-------------
Xlib based programs can use:

1. XrmParseCommand
  to parse command line 

2. XGetDefaults 
  uses two sources:
    A. User Environment File
    B. Server/User Preference Defaults
  with instance <program>.<option> and class "Program.Name"

3. Xrm Routines
  to do custom resource lookup

4. Program Provided Defaults


-ted
Ted Kim                           
UCLA Computer Science Department  Internet: tek@penzance.cs.ucla.edu
3804C Boelter Hall                UUCP:    ...!{uunet|ucbvax}!cs.ucla.edu!tek
Los Angeles, CA 90024		  Phone:   (213) 206-8696

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (11/29/90)

    > 1)  Is it possible to use X to read an X resource files without 
    >     being connected to a server?
    No.  You must be connected to the server in order for the Xlib routines
    to access the database associated with it (you can have a resource file
    unique to every server).

The question was resource *file*, not resource *property*.  There is no
requirement that you be connected to a server to manipulate resource *files*.
Notice that XrmGetFileDatabase does not take a display argument.

ta_k@maths.su.oz.au (Katya Ta) (04/26/91)

Hi,
	Does anyone know how the application defaults files are read into
an X-applications resource database?

Thanks Katya

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-
      /  .__.   |             Katya Ta                 
   ----  |__| __|__           University of Sydney     
    --   |__|   |             Australia                
    --   |__|  \|             (ta_k@maths.su.oz.au)    
   .__.    /|   |                                            
   |__|  _/ |   | <-- Chay(Cantonese) == Ta.(Vietnamese) :)  
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-