[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1052.0. ""customized" default colormap?" by CSC32::B_BRADACH () Mon Jul 03 1989 22:31

    I have a customer who wants to install his own default colormap.
    He wants all application progams to always use this colormap.
    Can anyone tell me exactly what program loads the default colormap into
    the hardware, and is there any way to alter this colormap so that a
    customized one can be used?  Or is it possible to specify a different
    colormap at boot time?
    
    Any and all suggestions would be appreciated.
    
    bernie
    csc/cs
    

T.RTitleUserPersonal
Name
DateLines
1052.1PSW::WINALSKICareful with that VAX, EugeneTue Jul 04 1989 22:529
Colors are done on a per-application basis.  Applications that don't use private
colormaps allocate color entries out of the default color map and then set them
to the RGB values that they want.  For applications that read their color
information out of resource files, one could override the resources in
DECW$XDEFAULTS.DAT.  If you look through this conference, you'll find notes
showing how to do that for various widgets and applications.

--PSW

1052.2VWSENG::KLEINSORGEToys 'R' UsWed Jul 05 1989 15:079
    
    It sounds like .0 is asking how to cause the default colormap to be
    initialized to some default state.  So that when applications come
    along the colormap has already had some specific allocations and setups
    done on it.
    
    Sounds reasonable, have'nt got a clue how to do it :-)
    

1052.3PSW::WINALSKICareful with that VAX, EugeneWed Jul 05 1989 20:448
You can do that by creating a small program that allocates entries from the
default color map using XAllocColorCells, sets the desired colors using
XStoreColors, then exits.  Have this program run as the first thing in
DECW$LOGIN.COM.  The colors that the program sets will stay behind, as long as
no other application allocates the color cells and bashes them.

--PSW

1052.4VWSENG::KLEINSORGEToys 'R' UsWed Jul 05 1989 22:2612
    
    **NOT** if you want allocate *specific* entries in the colormap.  This
    might be useful if (say) you were doing a number of applications that
    required some specific alignment of the entries for operation without
    reformatting the pixel data.  Like image operations (for instance) where
    say only a small number of colors are used - like 32 or 64.
    
    I have not found a way using the default colormap to do this all the
    time.
    
    

1052.5thanks for the responsesCSC32::B_BRADACHThu Jul 06 1989 17:2910
    Thanks for all of the responses, I will pass the information onto my
    customer.  He is indeed attempting to "replace" the default colormap
    with his own entries.  This will give him some things to try.
    
    thanks again,
    
    bernie
    csc/cs
    

1052.6Longwinded explanation of standard colormapsDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Fri Jul 07 1989 02:1130
    Sounds like your customer is after what we call "standard" colormaps.
    There is minimal support for this in xlib now.  See
    XSetStandardColormap.  Essentially, the idea is to load a color cube or
    a gray ramp into a colormap and then leave some data around on a
    property telling which colormap you used, the base, multiplier, and
    number of entries for each primary, etc.  The application can then
    calculate what color index it wants to use rather than having to Alloc
    it.  Currently the only code that exists to support this is the
    routines in XLIB which write and read the property.  R4 of MIT's X
    will have the session manager set up at least one standard colormap.
    So will Display PostScript on VMS and Ultrix.
    
    Just as a hint:  There are at least two ways to allocate the colors
    for a standard colormap:  First, use AllocColorCells with the
    contiguous option.  Then Store into them what you want in the order you
    want them.  The second way, a hack but with nicer results, is to use
    AllocColor one at a time on the colors you want, and check to see if
    they come back contiguous.  If so, you are golden.  If not, well...
    fall back to the old method.  MIT is using the latter method.  I
    suspect it only works well if they get in early before clients have
    started running.
    
    However you do it, you need to use a separate connection (i.e.
    XOpenDisplay).  Create the colors over that connection, then set
    shutdown mode to RetainPermanent.  Then XCloseDisplay.  Voila!  Your
    colors are still allocated, and other clients can use them.
    
    Burns