home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4499 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  4.2 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!slpfs1!jct
  2. From: jct@slpfs1.UUCP (Jeff Tolmie)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: X/Motif to PM Questions
  5. Keywords: xwindows motif pm
  6. Message-ID: <104@slpfs1.UUCP>
  7. Date: 28 Aug 92 08:29:08 GMT
  8. Organization: SEL - Research Center, Pforzheim, DE
  9. Lines: 79
  10.  
  11.  
  12. In article <dic5340@hertz.njit.edu (David Charlap)> writes:-
  13. >
  14. >  In article <103@slpfs1.UUCP> jct@slpfs1.UUCP (Jeff Tolmie) writes:
  15. >
  16. >> Before anyone else says it, that should be ClientWndProc.
  17. >
  18. > The procedure could be anything.  It's just another function (declared
  19. > with the EXPENTRY qualifier) and can have any name.  It is passed to
  20. > the WinRegisterClass function when declaring the class to OS/2.
  21. >
  22. Yes, I know. I think I mentioned that actually. The point was what
  23. is the default used. ie what IBM always calls it, what Charles Petzold
  24. called it etc. Of course it's up to you. I try not to add complication
  25. to a problem when I'm explaining it to a beginner. Personally, I like to
  26. give it a meaningful name:- MainEventProc, AboutDlgEventProc.
  27. It makes my life easier.
  28.  
  29. > You can use any RGB color fairly easilly - you request an RGB and it
  30. > gives you a palette offset.  If you're on a 24-bit color device, you
  31. > get the color.  Otherwise, PM gives you the nearest match based on the
  32. > current palette.  Dithered colors (for fills) may be done with a
  33. > different API call.
  34.  
  35. So. Can I allocate 200 colors with this method. EXACT RGB values that
  36. I want placed into unused cells in the hardware colormap. The Toolkit
  37. doco is VERY unclear on this. 
  38.  
  39. > If you need the exact colors, you're going to have to mess with the
  40. > palette manager.  This is a pain under OS/2 and Windows.  I don't know
  41. > why it has to be, though.  
  42.  
  43. OS/2 and Windows. Hmm... Where's your info come from Dave? I suspected
  44. this "mess around with" all along, So If I could read the same books
  45. as you about Color in Windows/OS2 I would be a lot happier.
  46.  
  47. > Doesn't X assume a 24-bit palette?  That
  48. > makes things infinitely easier, since there are no palettes to muck
  49. > with. 
  50.  
  51. No, X is much much much better with color. X has the concept of a "Visual"
  52. which allows you to specify the properties of visualization for a particualar
  53. X windows client. A standard X server for a Sun will have visuals for
  54. Monochrome, 8bit Color Table (PsuedoColor), 24 color (TrueColor) and many
  55. more. These are provided as a list to the X-client when it starts. So you,
  56. the programmer, can decide what kind of visual you want. Usually you just take
  57. the default visual, PsuedoColor on a 8bit display, for example. But you can
  58. write a single program that will run on all display types. Also, I have
  59. direct access to the hardware colormap. Normally this is bad programming
  60. behaviour, but if I want to allocate the top 200 colors of the hardware
  61. palette for Image display/processing, then this is the best way to do it.
  62.  
  63. OS/2 protects the hardware colormap to prevent "color flashing". In other
  64. words, that moving from one window to the next causes some colors to be
  65. displayed false in the non-active windows. So OS/2 takes the color request,
  66. and looks at it's hardware colormap to decide if it has space. This decision
  67. takes ALL windows into account. So it is very miserly with colors. I wan't
  68. the right to say, "OK, normally yes, but for my Image Displayer I wan't
  69. all 256 colors for myself."
  70.  
  71. I am working on this issue, but if you'd like to write a program fragment
  72. of how you would read the 256 colors in a 800x600x256 .dll and display them
  73. as boxes in a PM window, then I would be interested in comparing notes.
  74.  
  75.  
  76. If anyone from the IBM OS/2 team is reading this, please let us know your
  77. reasons, and if possible how to do this. There are whole branches of
  78. computing that require High Resolution - High Color. I don't want to use
  79. DOS. I don't want to use Windows. But I also don't want to use just
  80. 16 colors.
  81.  
  82.  
  83. .........................................................................
  84.                   Jeff Tolmie                       email: jct@rcp.sel.de  
  85.   _____ ______    ALCATEL-SEL Research Center.      Ph   : +49 7231 71041 
  86.     / __  /       P.O. Box 1760.                    Fax  : +49 7231 71045
  87.    / /   /      7530 Pforzheim.           
  88. \_/./__./.........GERMANY................................................
  89.  
  90.