Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!jade!ucbvax!shark.tek.COM!paulsh From: paulsh@shark.tek.COM Newsgroups: comp.windows.x Subject: Re: GetStaticColormap Message-ID: <8711032336.AA25730@shark.GWD.TEK> Date: Tue, 3-Nov-87 18:36:44 EST Article-I.D.: shark.8711032336.AA25730 Posted: Tue Nov 3 18:36:44 1987 Date-Received: Sat, 7-Nov-87 08:59:39 EST References: <8711030356.AA06098@xman.sgi.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 57 > In the porting layer document, pg. 25 a function pScreen->GetStaticColormap > is described, however there is no GetStaticColormap function in the screen > structure. There is a routine in server/ddx/cfb/cfbcmap.c called > cfbGetStaticColormap, but it is never referenced. > > I'm no xpert, but I am wondering what the scoop is here. As far as I can tell > the correct way to set build routines for a server on a static color display > is to: > > Write your own CreateColormap routines hooked in as pScreen->CreateColormap > which loops through each of the colors in the static map, calling AllocColor > with appropriate rgb values. > > (reading on in porting layer document 5.2.7.2 seems to confirm this) > > So is this GetStaticColormap a dinosaur or am I missing something > -- > Michael Toy, secret identity: the XMAN at Silicon Graphics > Someday: mtoy@xman.sgi.com For now: {ames,decwrl,sun}!sgi!mtoy I can only offer a guess. You are right that it no longer (never did?) exists in the screen structure. It may have served a purpose when the cfb server was being implemented with the -DSTATIC_COLOR . However I find no current reference to the routine. If you implement the routine, it can be used in your own ddx routine pScreen->CreateColormap, to get the "appropriate rgb values" to initialize a static colormap that is being created by the server or a client. This may have been its intention. However note that the cfb implementation of GetStaticColormap returns the Screen Default ColormapStr. This means that the default colormap would have to be created and assigned first before this routine was called. If you implemented it to simply return a hardcoded static colormap or one that is initialized by probing the hardware (and possibly command line options) then this restriction would not apply to your use of the routine. I think the most interesting "server implementor lesson" is that the authors of the cfb routine assumed (intended?) the screen default colormap to be static. This makes sense. It also suggests that all servers should offer at least one "Static" class visual per screen so the default colormap for that screen can be created as a static (StaticGray, StaticColor, or TrueColor) colormap. Paul Shearer M.S. 61-277 Tektronix, Inc. P.O. Box 1000 Wilsonville, OR 97070-1000 W (503) 685-2137 H (503) 224-3536 tektronix!shark!paulsh