Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!dont-send-mail-to-path-lines From: Nagesh_Pabbisetty.Henr801C@xerox.COM Newsgroups: comp.windows.x Subject: Re: white and black colors in the X server Message-ID: <"31-May-91.17:30:23.EDT".*.Nagesh_Pabbisetty.Henr801C@Xerox.com> Date: 31 May 91 21:30:23 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 54 Keith, Thanks for the response. Here is some background information: We would like to use the mfb code of the MIT server as the base. sunBW2.c sets whitepixel to 0 and black pixel to 1 for the Sun. We have hardware which has reverse values for white and black compared to Suns. I reversed the pixel values in xrxBW2.c. But this change was not sufficient because other parts of the implementation KNOW the values of white and black pixel. Looks as if I will have to go thru the entire code and figure out where the changes have to be made. Now, back to your reply: > This is simply untrue. I may not have understood the implementation well. Here is the scenario I am talking about. File mfbgc.c, function mfbValidateGC, has the following code (there are quite a few such instances in the server. This is one instance I can think of): if (pGC->fgPixel) pGC->ops->ImageGlyphBlt = mfbTEGlyphBltWhite; else pGC->ops->ImageGlyphBlt = mfbTEGlyphBltBlack; It would have been more appropriate (in terms of portability) to code it as: /* in some global place */ #define WhitePixel 0 #define BlackPixel 1 /* in mfbgc.c, function mfbValidateGC */ if (pGC->fgPixel == WhitePixel) pGC->ops->ImageGlyphBlt = mfbTEGlyphBltWhite; else pGC->ops->ImageGlyphBlt = mfbTEGlyphBltBlack; This way, people who have to port to a different architecture have to change ONLY the file containing the global definitions of WhitePixel and BlackPixel. Please clarify if my understanding is incorrect. What would be the easiest way for me to continue to use the code I have ported based on mfb, AND take care of this reversal of white and black on my hardware? Any input you can provide will be appreciated ... Nagesh Pabbisetty