home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Programming / MR_Classes / Dev / Source / tcpalette / TCPalette.doc < prev    next >
Encoding:
Text File  |  2000-08-04  |  6.6 KB  |  194 lines

  1. #include <classes/gadgets/tcpalette.h>
  2.  
  3. /****** tcpalette.gc/--datasheet-- ******************************************
  4. *
  5. *   NAME
  6. *       tcpalette.gadget -- True color palette BOOPSI gadget
  7. *
  8. *   SUPERCLASS
  9. *       gadgetclass
  10. *
  11. *   REQUIRES
  12. *       mlr_ordered.pattern
  13. *       bevel.image
  14. *
  15. *   DESCRIPTION
  16. *       This class provides a gadget similar to the palette.gadget
  17. *       and the GadTools palette gadget.  Key difference is that
  18. *       this gadget provides more than just a "pick a color" user interface.
  19. *       Instead of suppling a pen index, this gadget requires color values
  20. *       This gadget also provides tags that make it easy to change the 
  21. *       colors of the palette and integrate this object with other 
  22. *       gadgets using a model.
  23. *
  24. *   METHODS
  25. *
  26. *       OM_NEW -- Create the palette gadget, calls OM_SET.  Passed to
  27. *           superclass.
  28. *
  29. *       OM_SET -- Set object attributes.  Passed to superclass first.
  30. *
  31. *       OM_GET -- Get object attributes.
  32. *
  33. *       OM_NOTIFY -- Notify connections of attribute changes.
  34. *
  35. *       OM_DISPOSE -- Frees resources and calls superclass.
  36. *
  37. *       OM_UPDATE -- Calls OM_SET.
  38. *
  39. *       GM_DOMAIN -- Return the maximum and minimum size of the gadget.
  40. *
  41. *       GM_RENDER -- Renders the gadget imagry.  Overrides the superclass.
  42. *
  43. *       GM_GOACTIVE -- Activate the gadget on mouse click only.  Overrides
  44. *           the superclass.
  45. *
  46. *       GM_HANDLEINPUT -- Handles input events once active.  Overrides the
  47. *           superclass.
  48. *
  49. *       GM_GOINACTIVE -- Deactivates the gadget.  Passed to the superclass.
  50. *
  51. *       GM_LAYOUT -- On initial layout, this object sends out OM_NOTIFY
  52. *
  53. *       All other methods are passed to the superclass.
  54. *
  55. *
  56. *   ATTRIBUTES
  57. *       TCPALETTE_ShowSelected (BOOL)
  58. *           Keeps the selected pen highlighted when user input ends.
  59. *
  60. *           Defaults to TRUE
  61. *
  62. *           Applicability is (OM_NEW, OM_SET, OM_GET)
  63. *
  64. *       TCPALETTE_SelectedColor (UBYTE) [0..255]
  65. *           Selected color
  66. *
  67. *           Defaults to 0
  68. *
  69. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  70. *
  71. *       TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
  72. *           32bit per component, Red, Green & Blue value of the selected color.
  73. *
  74. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  75. *
  76. *       TCPALETTE_SelectedLRGB (struct TCPaletteLRGB *)
  77. *           8bit  per component Red, Green & Blue value of the selected color.
  78. *           This color format is packed into a ULONG in this format 0x00rrggbb
  79. *
  80. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  81. *
  82. *       TCPALETTE_Precision (ULONG) [1..32]
  83. *           Bit depth of component colors, only effects the values of the 
  84. *           following three tags.  This was implemented because some gadgets
  85. *           cannot handle full 32bit numbers, specifically the slider.gadget.
  86. *
  87. *           Defaults to 8
  88. *
  89. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  90. *   
  91. *       TCPALETTE_SelectedRed (ULONG)
  92. *       TCPALETTE_SelectedGreen (ULONG)
  93. *       TCPALETTE_SelectedBlue (ULONG)
  94. *           Component level of the selected color.  The value of these 
  95. *           attributes is dependant on the TCPALETTE_Precision attribute.
  96. *           Setting TCPALETTE_Precision to 8, will yield a range from 0-255;
  97. *           4 = 0-15
  98. *
  99. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  100. *
  101. *       TCPALETTE_NumColors (ULONG) [1..256]
  102. *           Number of colors in the palette.
  103. *
  104. *           Defaults to 1
  105. *
  106. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  107. *
  108. *       TCPALETTE_RGBPalette (struct TCPaletteRGB *)
  109. *           Palette data, you provide an array, with at leaset
  110. *           TCPALETTE_NumColors entries.  If your array is to
  111. *           small, bad things will happen (especially with OM_GET).
  112. *
  113. *           Defaults to all entries 0,0,0
  114. *
  115. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
  116. *
  117. *       TCPALETTE_LRGBPalette (struct TCPaletteLRGB * or ULONG *)
  118. *           Palette data, you provide an array, with at leaset
  119. *           TCPALETTE_NumColors entries.  If your array is to
  120. *           small, bad things will happen (especially with OM_GET).
  121. *
  122. *           Defaults to all entries 0
  123. *
  124. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
  125. *
  126. *       TCPALETTE_Orientation
  127. *           Restrict layout to horizontal or vertical.
  128. *           Not yet implemented.
  129. *
  130. *       TCPALETTE_EditMode (ULONG)
  131. *           TCPEM_NORMAL - 
  132. *           TCPEM_COPY - The color of the current selected pen will
  133. *             be copied to the pen the user selects next.
  134. *           TCPEM_SWAP - The color of the current selected pen will
  135. *             be swaped with the pen the user selects next.
  136. *           TCPEN_SPREAD - The color of the current selected pen will
  137. *             be spread to the pen the user selects next.
  138. *
  139. *           Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  140. *
  141. *       TCPALETTE_Undo 
  142. *           Undo changes to palette, this should be a method.
  143. *           
  144. *           Applicability is (OM_SET, OM_UPDATE)
  145. *
  146. *       TCPALETTE_NoUndo 
  147. *           If zero the undo buffer has data in it.
  148. *           (so it's mappable to GA_Disabled, ie. disable UNDO gadget)
  149. *
  150. *           Applicability is (OM_GET, OM_NOTIFY)
  151. *
  152. *   NOTIFICATION
  153. *       These tags are supplied during notification.
  154. *       TCPALETTE_SelectedColor (UBYTE) [0..255]
  155. *       TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
  156. *       TCPALETTE_SelectedLRGB (struct TCPaletteRGB *)
  157. *       TCPALETTE_SelectedRed (ULONG)
  158. *       TCPALETTE_SelectedGreen (ULONG)
  159. *       TCPALETTE_SelectedBlue (ULONG)
  160. *       TCPALETTE_NumColors (ULONG) [1..256]
  161. *       TCPALETTE_EditMode
  162. *       TCPALETTE_NoUndo (ULONG)
  163. *
  164. *   NOTES
  165. *       On true color CyberGfx displays, this gadgets renders true colors.
  166. *       On 8bit or less displays, this gadget uses FindColor() to display
  167. *       colors, which means that the gadget may become visually corrupt
  168. *       when other programs change the screen colors.  So you may what to
  169. *       rerender the object periodically.
  170. *
  171. *
  172. *   BUGS
  173. *       Gadget may become visually corrupt when screen colors change on
  174. *       8 bit or less screens.
  175. *
  176. *   SEE ALSO
  177. *
  178. ******************************************************************************
  179. *
  180. */
  181.  
  182. /****** / ******************************************
  183. *
  184. *   To Do
  185. *       * Add TCPALETTE_PenNameArray (UBYTE **) Make paletter gadget look
  186. *         like gadget in Palette Prefs
  187. *           May need scroller ?
  188. *   44.1 -
  189. *       Inlcuded version string
  190. *
  191. ******************************************************************************
  192. *
  193. */
  194.