1with agar.core.types;
2
3package agar.gui.colors is
4
5  type color_selection_t is (
6    BG_COLOR,
7    FRAME_COLOR,
8    LINE_COLOR,
9    TEXT_COLOR,
10    WINDOW_BG_COLOR,
11    WINDOW_HI_COLOR,
12    WINDOW_LO_COLOR,
13    TITLEBAR_FOCUSED_COLOR,
14    TITLEBAR_UNFOCUSED_COLOR,
15    TITLEBAR_CAPTION_COLOR,
16    BUTTON_COLOR,
17    BUTTON_TXT_COLOR,
18    DISABLED_COLOR,
19    CHECKBOX_COLOR,
20    CHECKBOX_TXT_COLOR,
21    GRAPH_BG_COLOR,
22    GRAPH_XAXIS_COLOR,
23    HSVPAL_CIRCLE_COLOR,
24    HSVPAL_TILE1_COLOR,
25    HSVPAL_TILE2_COLOR,
26    MENU_UNSEL_COLOR,
27    MENU_SEL_COLOR,
28    MENU_OPTION_COLOR,
29    MENU_TXT_COLOR,
30    MENU_SEP1_COLOR,
31    MENU_SEP2_COLOR,
32    NOTEBOOK_BG_COLOR,
33    NOTEBOOK_SEL_COLOR,
34    NOTEBOOK_TXT_COLOR,
35    RADIO_SEL_COLOR,
36    RADIO_OVER_COLOR,
37    RADIO_HI_COLOR,
38    RADIO_LO_COLOR,
39    RADIO_TXT_COLOR,
40    SCROLLBAR_COLOR,
41    SCROLLBAR_BTN_COLOR,
42    SCROLLBAR_ARR1_COLOR,
43    SCROLLBAR_ARR2_COLOR,
44    SEPARATOR_LINE1_COLOR,
45    SEPARATOR_LINE2_COLOR,
46    TABLEVIEW_COLOR,
47    TABLEVIEW_HEAD_COLOR,
48    TABLEVIEW_HTXT_COLOR,
49    TABLEVIEW_CTXT_COLOR,
50    TABLEVIEW_LINE_COLOR,
51    TABLEVIEW_SEL_COLOR,
52    TEXTBOX_COLOR,
53    TEXTBOX_TXT_COLOR,
54    TEXTBOX_CURSOR_COLOR,
55    TLIST_TXT_COLOR,
56    TLIST_BG_COLOR,
57    TLIST_LINE_COLOR,
58    TLIST_SEL_COLOR,
59    MAPVIEW_GRID_COLOR,
60    MAPVIEW_CURSOR_COLOR,
61    MAPVIEW_TILE1_COLOR,
62    MAPVIEW_TILE2_COLOR,
63    MAPVIEW_MSEL_COLOR,
64    MAPVIEW_ESEL_COLOR,
65    TILEVIEW_TILE1_COLOR,
66    TILEVIEW_TILE2_COLOR,
67    TILEVIEW_TEXTBG_COLOR,
68    TILEVIEW_TEXT_COLOR,
69    TRANSPARENT_COLOR,
70    HSVPAL_BAR1_COLOR,
71    HSVPAL_BAR2_COLOR,
72    PANE_COLOR,
73    PANE_CIRCLE_COLOR,
74    MAPVIEW_RSEL_COLOR,
75    MAPVIEW_ORIGIN_COLOR,
76    FOCUS_COLOR,
77    TABLE_COLOR,
78    TABLE_LINE_COLOR,
79    FIXED_BG_COLOR,
80    FIXED_BOX_COLOR,
81    TEXT_DISABLED_COLOR,
82    MENU_TXT_DISABLED_COLOR,
83    SOCKET_COLOR,
84    SOCKET_LABEL_COLOR,
85    SOCKET_HIGHLIGHT_COLOR,
86    PROGRESS_BAR_COLOR,
87    LAST_COLOR
88  );
89
90  for color_selection_t use (
91    BG_COLOR                 => 0,
92    FRAME_COLOR              => 1,
93    LINE_COLOR               => 2,
94    TEXT_COLOR               => 3,
95    WINDOW_BG_COLOR          => 4,
96    WINDOW_HI_COLOR          => 5,
97    WINDOW_LO_COLOR          => 6,
98    TITLEBAR_FOCUSED_COLOR   => 7,
99    TITLEBAR_UNFOCUSED_COLOR => 8,
100    TITLEBAR_CAPTION_COLOR   => 9,
101    BUTTON_COLOR             => 10,
102    BUTTON_TXT_COLOR         => 11,
103    DISABLED_COLOR           => 12,
104    CHECKBOX_COLOR           => 13,
105    CHECKBOX_TXT_COLOR       => 14,
106    GRAPH_BG_COLOR           => 15,
107    GRAPH_XAXIS_COLOR        => 16,
108    HSVPAL_CIRCLE_COLOR      => 17,
109    HSVPAL_TILE1_COLOR       => 18,
110    HSVPAL_TILE2_COLOR       => 19,
111    MENU_UNSEL_COLOR         => 20,
112    MENU_SEL_COLOR           => 21,
113    MENU_OPTION_COLOR        => 22,
114    MENU_TXT_COLOR           => 23,
115    MENU_SEP1_COLOR          => 24,
116    MENU_SEP2_COLOR          => 25,
117    NOTEBOOK_BG_COLOR        => 26,
118    NOTEBOOK_SEL_COLOR       => 27,
119    NOTEBOOK_TXT_COLOR       => 28,
120    RADIO_SEL_COLOR          => 29,
121    RADIO_OVER_COLOR         => 30,
122    RADIO_HI_COLOR           => 31,
123    RADIO_LO_COLOR           => 32,
124    RADIO_TXT_COLOR          => 33,
125    SCROLLBAR_COLOR          => 34,
126    SCROLLBAR_BTN_COLOR      => 35,
127    SCROLLBAR_ARR1_COLOR     => 36,
128    SCROLLBAR_ARR2_COLOR     => 37,
129    SEPARATOR_LINE1_COLOR    => 38,
130    SEPARATOR_LINE2_COLOR    => 39,
131    TABLEVIEW_COLOR          => 40,
132    TABLEVIEW_HEAD_COLOR     => 41,
133    TABLEVIEW_HTXT_COLOR     => 42,
134    TABLEVIEW_CTXT_COLOR     => 43,
135    TABLEVIEW_LINE_COLOR     => 44,
136    TABLEVIEW_SEL_COLOR      => 45,
137    TEXTBOX_COLOR            => 46,
138    TEXTBOX_TXT_COLOR        => 47,
139    TEXTBOX_CURSOR_COLOR     => 48,
140    TLIST_TXT_COLOR          => 49,
141    TLIST_BG_COLOR           => 50,
142    TLIST_LINE_COLOR         => 51,
143    TLIST_SEL_COLOR          => 52,
144    MAPVIEW_GRID_COLOR       => 53,
145    MAPVIEW_CURSOR_COLOR     => 54,
146    MAPVIEW_TILE1_COLOR      => 55,
147    MAPVIEW_TILE2_COLOR      => 56,
148    MAPVIEW_MSEL_COLOR       => 57,
149    MAPVIEW_ESEL_COLOR       => 58,
150    TILEVIEW_TILE1_COLOR     => 59,
151    TILEVIEW_TILE2_COLOR     => 60,
152    TILEVIEW_TEXTBG_COLOR    => 61,
153    TILEVIEW_TEXT_COLOR      => 62,
154    TRANSPARENT_COLOR        => 63,
155    HSVPAL_BAR1_COLOR        => 64,
156    HSVPAL_BAR2_COLOR        => 65,
157    PANE_COLOR               => 66,
158    PANE_CIRCLE_COLOR        => 67,
159    MAPVIEW_RSEL_COLOR       => 68,
160    MAPVIEW_ORIGIN_COLOR     => 69,
161    FOCUS_COLOR              => 70,
162    TABLE_COLOR              => 71,
163    TABLE_LINE_COLOR         => 72,
164    FIXED_BG_COLOR           => 73,
165    FIXED_BOX_COLOR          => 74,
166    TEXT_DISABLED_COLOR      => 75,
167    MENU_TXT_DISABLED_COLOR  => 76,
168    SOCKET_COLOR             => 77,
169    SOCKET_LABEL_COLOR       => 78,
170    SOCKET_HIGHLIGHT_COLOR   => 79,
171    PROGRESS_BAR_COLOR       => 80,
172    LAST_COLOR               => 81
173  );
174  for color_selection_t'size use c.unsigned'size;
175  pragma convention (c, color_selection_t);
176
177  type color_t is record
178    r : agar.core.types.uint8_t;
179    g : agar.core.types.uint8_t;
180    b : agar.core.types.uint8_t;
181    a : agar.core.types.uint8_t;
182  end record;
183  type color_access_t is access all color_t;
184  pragma convention (c, color_t);
185  pragma convention (c, color_access_t);
186
187  type blend_func_t is (
188    ALPHA_OVERLAY,
189    ALPHA_SRC,
190    ALPHA_DST,
191    ALPHA_ONE_MINUS_DST,
192    ALPHA_ONE_MINUS_SRC
193  );
194  for blend_func_t use (
195    ALPHA_OVERLAY       => 0,
196    ALPHA_SRC           => 1,
197    ALPHA_DST           => 2,
198    ALPHA_ONE_MINUS_DST => 3,
199    ALPHA_ONE_MINUS_SRC => 4
200  );
201  for blend_func_t'size use c.unsigned'size;
202  pragma convention (c, blend_func_t);
203
204  procedure init;
205  pragma import (c, init, "AG_ColorsInit");
206
207  procedure destroy;
208  pragma import (c, destroy, "AG_ColorsDestroy");
209
210  function load (path : string) return boolean;
211  pragma inline (load);
212
213  function save (path : string) return boolean;
214  pragma inline (save);
215
216  function save_default return boolean;
217  pragma inline (save_default);
218
219end agar.gui.colors;
220