haiku/docs/develop/servers/app_server/SystemPalette.htm

250 lines
13 KiB
HTML
Raw Normal View History

<HTML>
<HEAD>
<TITLE>SystemPalette.htm</TITLE>
<style type="text/css">
<!--
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
.Text-Background {background-color: rgb(255,255,255)}
.GR-Default {}
.Body {margin: 0px}
.Footer {margin: 0px}
.Header {margin: 0px}
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
-->
</style>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV class="sheet" id="Sheet 1">
<P class="Body" style="margin: 0px"><span class="OBOS-Title">SystemPalette class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">This object does all the handling for system attribute colors and system palette management.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><BR>
Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=617 HEIGHT=196 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">SystemPalette(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">~SystemPalette(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=32>
<P class="Body" style="margin: 0px">void SetPalette(uint8 index, RGBColor col)</P>
</TD>
<TD WIDTH=260 HEIGHT=32>
<P class="Body" style="margin: 0px">void SetPalette(uint8 index, rgb_color col)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=32>
<P class="Body" style="margin: 0px">RGBColor GetPalette(uint8 index)</P>
</TD>
<TD WIDTH=260 HEIGHT=32>
<P class="Body" style="margin: 0px">void SetGUIColor(color_which which, RGBColor col)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=32>
<P class="Body" style="margin: 0px">RGBColor GetGUIColor(color_which which)</P>
</TD>
<TD WIDTH=260 HEIGHT=32>
<P class="Body" style="margin: 0px">color_set GetGUIColors(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void SetGUIColors(color_set cset)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">void _GenerateSystemPalette(rgb_color *palette)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void _SetDefaultGUIColors(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
_ Denotes a protected function</P>
<P class="Body" style="margin: 0px"><BR>
Structures</P>
<P class="Body" style="margin: 0px"><BR>
color_set {</P>
<P class="Body" style="margin: 0px"> rgb_color panel_background</P>
<P class="Body" style="margin: 0px"> rgb_color panel_text</P>
<P class="Body" style="margin: 0px"> rgb_color document_background</P>
<P class="Body" style="margin: 0px"> rgb_color document_text</P>
<P class="Body" style="margin: 0px"> rgb_color control_background</P>
<P class="Body" style="margin: 0px"> rgb_color control_text</P>
<P class="Body" style="margin: 0px"> rgb_color control_border</P>
<P class="Body" style="margin: 0px"> rgb_color control_highlight</P>
<P class="Body" style="margin: 0px"> rgb_color tooltip_background</P>
<P class="Body" style="margin: 0px"> rgb_color tooltip_text</P>
<P class="Body" style="margin: 0px"> rgb_color menu_background</P>
<P class="Body" style="margin: 0px"> rgb_color menu_selected_background</P>
<P class="Body" style="margin: 0px"> rgb_color menu_text</P>
<P class="Body" style="margin: 0px"> rgb_color menu_selected_text</P>
<P class="Body" style="margin: 0px"> rgb_color menu_separator</P>
<P class="Body" style="margin: 0px"> rgb_color menu_triggers</P>
<P class="Body" style="margin: 0px">}</P>
<P class="Body" style="margin: 0px"><BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">SystemPalette(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Allocate the rgb_color[256] palette on the heap and call _GenerateSystemPalette()</P>
<P class="Body" style="margin: 0px">2) Initialize attribute variables to the defaults</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~SystemPalette(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Free the palette array</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void SetPalette(uint8 index, RGBColor col)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetPalette(uint8 index, rgb_color col)</span></P>
<P class="Body" style="margin: 0px"><BR>
Sets the said index to the passed color value.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">RGBColor GetPalette(uint8 index)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the color at said index in the palette.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void SetGUIColor(color_which which, RGBColor col)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">RGBColor GetGUIColor(color_which which)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">color_set GetGUIColors(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">void SetGUIColors(color_set cset)</span></P>
<P class="Body" style="margin: 0px"><BR>
These tweak or return the system attribute colors, one at a time or all at once.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">protected: void _GenerateSystemPalette(rgb_color *palette)</span></P>
<P class="Body" style="margin: 0px"><BR>
Sets the passed palette to the BeOS R5 system colors, which follows.</P>
<P class="Body" style="margin: 0px"><span class="Default">Grays:</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,0 -&gt; 248,248,248 by increments of 8</span></P>
<P class="Body" style="margin: 0px"><span class="Default">Blues:</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,255</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,229</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,204</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,179</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,154</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,129</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,105</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,80</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,55</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,0,30</span></P>
<P class="Body" style="margin: 0px"><span class="Default">Reds: as per blues, but red values are 1 less</span></P>
<P class="Body" style="margin: 0px"><span class="Default">Greens: as per blues, but green values are 1 less</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,152,51</span></P>
<P class="Body" style="margin: 0px"><span class="Default">255,255,255</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
The following sets use [255, 203, 152, 102, 51, 0] for the blue values, keeping the other colors the same:</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
203,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">152,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">255,152, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
0,102,255</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,102,203</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
203,203, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">152,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,255, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">255,102, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
0,102,152</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,102,102</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
203,152, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">152,152, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,152, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,152, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
230,134,0</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,51, [value excepting 255]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
0,102,51</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,102,0</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
203,102, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">152,102, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,102, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,102, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">255,0, [value excepting 0]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,175,19</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,51,255</span></P>
<P class="Body" style="margin: 0px"><span class="Default">0,51,203</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
203,51, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">152,51, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,51, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,51, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,203,102 -&gt; 255,203,255, stepping in the [value] increments</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
0,51, [value, starting at 152]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">203,0, [value, excepting 0]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,227,70</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
152,0, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">102,0, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default">51,0, [value]</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,203,51 </span></P>
<P class="Body" style="margin: 0px"><span class="Default">255,203,0</span></P>
<P class="Body" style="margin: 0px"><span class="Default"><BR>
255,255, [values in reverse]</span></P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">protected: void _SetDefaultGUIColors(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Sets the internal color_set to the defaults, which is the following:</P>
<P class="Body" style="margin: 0px"><BR>
panel_background: 216,216, 216</P>
<P class="Body" style="margin: 0px">panel_text: 0,0,0</P>
<P class="Body" style="margin: 0px">document_background: 255,255,255</P>
<P class="Body" style="margin: 0px">document_text: 0,0,0</P>
<P class="Body" style="margin: 0px">control_background: 216,216,216</P>
<P class="Body" style="margin: 0px">control_text: 0,0,0</P>
<P class="Body" style="margin: 0px">control_border: 0,0,0</P>
<P class="Body" style="margin: 0px">control_highlight: 0,0,255</P>
<P class="Body" style="margin: 0px">tooltip_background: </P>
<P class="Body" style="margin: 0px">tooltip_text: 0,0,0</P>
<P class="Body" style="margin: 0px">menu_background: 216,216,216</P>
<P class="Body" style="margin: 0px">menu_selected_background: 160,160,160</P>
<P class="Body" style="margin: 0px">menu_text: 0,0,0</P>
<P class="Body" style="margin: 0px">menu_selected_text: 0,0,0</P>
<P class="Body" style="margin: 0px">menu_separator_high: 241,241,241</P>
<P class="Body" style="margin: 0px">menu_separator_low: 186,186,186</P>
<P class="Body" style="margin: 0px">menu_triggers: 0,0,0</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>