| 38 } GntStyle; |
38 } GntStyle; |
| 39 |
39 |
| 40 /** |
40 /** |
| 41 * Read configuration from a file. |
41 * Read configuration from a file. |
| 42 * |
42 * |
| 43 * @param filename The filename to read configuration from. |
43 * @filename: The filename to read configuration from. |
| 44 */ |
44 */ |
| 45 void gnt_style_read_configure_file(const char *filename); |
45 void gnt_style_read_configure_file(const char *filename); |
| 46 |
46 |
| 47 /** |
47 /** |
| 48 * Get the user-setting for a style. |
48 * Get the user-setting for a style. |
| 49 * @param style The style. |
49 * @style: The style. |
| 50 * @return The user-setting, or @c NULL. |
50 * Returns: The user-setting, or %NULL. |
| 51 */ |
51 */ |
| 52 const char *gnt_style_get(GntStyle style); |
52 const char *gnt_style_get(GntStyle style); |
| 53 |
53 |
| 54 /** |
54 /** |
| 55 * Get the value of a preference in ~/.gntrc. |
55 * Get the value of a preference in ~/.gntrc. |
| 56 * |
56 * |
| 57 * @param group The name of the group in the keyfile. If @c NULL, the prgname |
57 * @group: The name of the group in the keyfile. If %NULL, the prgname |
| 58 * will be used first, if available. Otherwise, "general" will be used. |
58 * will be used first, if available. Otherwise, "general" will be used. |
| 59 * @param key The key |
59 * @key: The key |
| 60 * |
60 * |
| 61 * @return The value of the setting as a string, or @c NULL |
61 * Returns: The value of the setting as a string, or %NULL |
| 62 * |
62 * |
| 63 * @since 2.0.0 (gnt), 2.1.0 (pidgin) |
63 * @since 2.0.0 (gnt), 2.1.0 (pidgin) |
| 64 */ |
64 */ |
| 65 char *gnt_style_get_from_name(const char *group, const char *key); |
65 char *gnt_style_get_from_name(const char *group, const char *key); |
| 66 |
66 |
| 67 /** |
67 /** |
| 68 * Get the value of a preference in ~/.gntrc. |
68 * Get the value of a preference in ~/.gntrc. |
| 69 * |
69 * |
| 70 * @param group The name of the group in the keyfile. If @c NULL, the prgname |
70 * @group: The name of the group in the keyfile. If %NULL, the prgname |
| 71 * will be used first, if available. Otherwise, "general" will be used. |
71 * will be used first, if available. Otherwise, "general" will be used. |
| 72 * @param key The key |
72 * @key: The key |
| 73 * @param length Return location for the number of strings returned, or NULL |
73 * @length: Return location for the number of strings returned, or NULL |
| 74 * |
74 * |
| 75 * @return NULL terminated string array. The array should be freed with g_strfreev(). |
75 * Returns: NULL terminated string array. The array should be freed with g_strfreev(). |
| 76 * |
76 * |
| 77 * @since 2.4.0 |
77 * @since 2.4.0 |
| 78 */ |
78 */ |
| 79 char **gnt_style_get_string_list(const char *group, const char *key, gsize *length); |
79 char **gnt_style_get_string_list(const char *group, const char *key, gsize *length); |
| 80 |
80 |
| 81 /** |
81 /** |
| 82 * Get the value of a color pair in ~/.gntrc. |
82 * Get the value of a color pair in ~/.gntrc. |
| 83 * |
83 * |
| 84 * @param group The name of the group in the keyfile. If @c NULL, the prgname |
84 * @group: The name of the group in the keyfile. If %NULL, the prgname |
| 85 * will be used first, if available. Otherwise, "general" will be used. |
85 * will be used first, if available. Otherwise, "general" will be used. |
| 86 * @param key The key |
86 * @key: The key |
| 87 * |
87 * |
| 88 * @return The value of the color as an int, or 0 on error. |
88 * Returns: The value of the color as an int, or 0 on error. |
| 89 * |
89 * |
| 90 * @since 2.4.0 |
90 * @since 2.4.0 |
| 91 */ |
91 */ |
| 92 int gnt_style_get_color(char *group, char *key); |
92 int gnt_style_get_color(char *group, char *key); |
| 93 |
93 |
| 94 /** |
94 /** |
| 95 * Parse a boolean preference. For example, if 'value' is "false" (ignoring case) |
95 * Parse a boolean preference. For example, if 'value' is "false" (ignoring case) |
| 96 * or "0", the return value will be @c FALSE, otherwise @c TRUE. |
96 * or "0", the return value will be %FALSE, otherwise %TRUE. |
| 97 * |
97 * |
| 98 * @param value The value of the boolean setting as a string |
98 * @value: The value of the boolean setting as a string |
| 99 * @return The boolean value |
99 * Returns: The boolean value |
| 100 * |
100 * |
| 101 * @since 2.0.0 (gnt), 2.1.0 (pidgin) |
101 * @since 2.0.0 (gnt), 2.1.0 (pidgin) |
| 102 */ |
102 */ |
| 103 gboolean gnt_style_parse_bool(const char *value); |
103 gboolean gnt_style_parse_bool(const char *value); |
| 104 |
104 |
| 105 /** |
105 /** |
| 106 * Get the boolean value for a user-setting. |
106 * Get the boolean value for a user-setting. |
| 107 * |
107 * |
| 108 * @param style The style. |
108 * @style: The style. |
| 109 * @param def The default value (i.e, the value if the user didn't define |
109 * @def: The default value (i.e, the value if the user didn't define |
| 110 * any value) |
110 * any value) |
| 111 * |
111 * |
| 112 * @return The value of the setting. |
112 * Returns: The value of the setting. |
| 113 */ |
113 */ |
| 114 gboolean gnt_style_get_bool(GntStyle style, gboolean def); |
114 gboolean gnt_style_get_bool(GntStyle style, gboolean def); |
| 115 |
115 |
| 116 /** |
116 /** |
| 117 * @internal |
117 * @internal |