annotate finch/libgnt/gntcolors.h @ 21397:521df9b2698a

Work around a bug in vim's bracket matching, whereby it doesn't realise that only one branch of an #ifdef applies and claims that every subsequent bracket in the entire file is unbalanced.
author Will Thompson <will.thompson@collabora.co.uk>
date Sat, 03 Nov 2007 12:17:06 +0000
parents ae330012956f
children 3ed9b027479d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
1 /**
18303
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
2 * @file gntcolors.h Colors API
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
3 * @ingroup gnt
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
4 */
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17718
diff changeset
5 /*
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
6 * GNT - The GLib Ncurses Toolkit
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
7 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
8 * GNT is the legal property of its developers, whose names are too numerous
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
10 * source distribution.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
11 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
12 * This library is free software; you can redistribute it and/or modify
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
13 * it under the terms of the GNU General Public License as published by
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
15 * (at your option) any later version.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
16 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
17 * This program is distributed in the hope that it will be useful,
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
20 * GNU General Public License for more details.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
21 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
22 * You should have received a copy of the GNU General Public License
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
23 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18303
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
25 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
26
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #ifndef GNT_COLORS_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #define GNT_COLORS_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include <glib.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31
20751
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
32 /**
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
33 * Different classes of colors.
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
34 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 typedef enum
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 GNT_COLOR_NORMAL = 1,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 GNT_COLOR_HIGHLIGHT, /* eg. when a button is selected */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 GNT_COLOR_DISABLED, /* eg. when a button is disabled */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 GNT_COLOR_HIGHLIGHT_D, /* eg. when a button is selected, but some other window is in focus */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 GNT_COLOR_TEXT_NORMAL,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 GNT_COLOR_TEXT_INACTIVE, /* when the entry is out of focus */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 GNT_COLOR_MNEMONIC,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 GNT_COLOR_MNEMONIC_D,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 GNT_COLOR_SHADOW,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 GNT_COLOR_TITLE,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 GNT_COLOR_TITLE_D,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 GNT_COLOR_URGENT, /* this is for the 'urgent' windows */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 GNT_COLORS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 } GntColorType;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 enum
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 GNT_COLOR_BLACK = 0,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 GNT_COLOR_RED,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 GNT_COLOR_GREEN,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 GNT_COLOR_BLUE,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 GNT_COLOR_WHITE,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 GNT_COLOR_GRAY,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60 GNT_COLOR_DARK_GRAY,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 GNT_TOTAL_COLORS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
64 /**
20751
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
65 * Initialize the colors.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
66 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 void gnt_init_colors(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
69 /**
20751
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
70 * Uninitialize the colors.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
71 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 void gnt_uninit_colors(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 #if GLIB_CHECK_VERSION(2,6,0)
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
75 /**
20751
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
76 * Parse color information from a file.
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
77 *
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
78 * @param kfile The file containing color information.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
79 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 void gnt_colors_parse(GKeyFile *kfile);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
82 /**
20751
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
83 * Parse color-pair information from a file.
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
84 *
fe77cc691f78 Some doxygen stuff.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
85 * @param kfile The file containing the color-pair information.
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
86 */
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 void gnt_color_pairs_parse(GKeyFile *kfile);
17718
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 15818
diff changeset
88
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 #endif
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
91 /**
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
92 * Return the appropriate character attribute for a specified color.
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
93 * If the terminal doesn't have color support, this returns A_STANDOUT
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
94 * when deemed appropriate.
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
95 *
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
96 * @param color The color code.
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
97 *
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
98 * @return A character attribute.
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
99 *
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
100 * @since 2.3.0
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
101 */
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21250
diff changeset
102 int gnt_color_pair(int color);
21250
9187d331aebe Add gnt_color_pair, which will replace color codes with 'appropriate' text
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20751
diff changeset
103
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 #endif