~vcs-imports/tilda/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef TILDA_PALETTES_H
#define TILDA_PALETTES_H

#include <gtk/gtk.h>

G_BEGIN_DECLS

/**
 * The number of colors contained in a #TildaColorPalette.
 */
#define TILDA_COLOR_PALETTE_SIZE 16

/**
 * A color scheme links a color scheme name to its corresponding
 * color palette.
 */
typedef struct _TildaColorPaletteScheme
{
  const char *name;
  const GdkRGBA *palette;
} TildaColorScheme;

/**
 * Gets a list of color schemes. Use
 * tilda_palettes_get_n_palette_schemes to
 * determine the number of color schemes.
 *
 * @return A pointer to an array of color schemes.
 */
TildaColorScheme *tilda_palettes_get_palette_schemes (void);

/**
 * Gets the number of palette schemes.
 *
 * @return The number of color schemes contained in
 *         #tilda_palettes_get_palette_schemes.
 */
gint tilda_palettes_get_n_palette_schemes (void);

/**
 * Get the currently active color palette.
 *
 * @return A pointer to a color palette of size TILDA_COLOR_PALETTE_SIZE
 *         with GdkRGBA colors. The color palette is owned by tilda
 *         and must not be freed.
 */
GdkRGBA *tilda_palettes_get_current_palette (void);

/**
 * Sets the currently active color palette.
 *
 * @param palette A pointer to a color palette of size TILDA_COLOR_PALETTE_SIZE.
 */
void tilda_palettes_set_current_palette (const GdkRGBA *palette);

/**
 * Gets the color at the specified position from the palette.
 *
 * @param palette A TildaColorPalette of size TILDA_COLOR_PALETTE_SIZE.
 * @param color_num Position of the color in the palette.
 * @return A pointer to a GdkRGBA color struct.
 */
const GdkRGBA *tilda_palettes_get_palette_color (const GdkRGBA *palette,
                                                 int color_num);

G_END_DECLS

#endif //TILDA_PALETTES_H