comparison pidgin/gtkblist-theme.h @ 26654:f099e7f2739c

Several changes: * Use "color" for text-color consistently in the buddylist themes, instead of using "text_color" in some places and "color" in others. * Rename FontColorPair to PidginThemeFont. (I suspect we might use this later for conversation themes as well?) * Hide PidginThemeFont structure, add accessor/mutator functions. * Remove some ridiculous code duplications.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 17 Apr 2009 19:28:20 +0000
parents 74d62c5fd716
children 98c40e2a0c7f
comparison
equal deleted inserted replaced
26653:74d62c5fd716 26654:f099e7f2739c
57 struct _PidginBlistThemeClass 57 struct _PidginBlistThemeClass
58 { 58 {
59 PurpleThemeClass parent_class; 59 PurpleThemeClass parent_class;
60 }; 60 };
61 61
62 #if 0
62 typedef struct 63 typedef struct
63 { 64 {
64 const gchar *font; 65 const gchar *font;
65 const gchar *color; 66 const gchar *color;
66 67
67 } FontColorPair; 68 } PidginThemeFont;
69 #endif
70 typedef struct _PidginThemeFont PidginThemeFont;
68 71
69 typedef struct 72 typedef struct
70 { 73 {
71 gint status_icon; 74 gint status_icon;
72 gint text; 75 gint text;
76 gboolean show_status; 79 gboolean show_status;
77 80
78 } PidginBlistLayout; 81 } PidginBlistLayout;
79 82
80 /**************************************************************************/ 83 /**************************************************************************/
81 /** @name FontColorPair API */ 84 /** @name PidginThemeFont API */
82 /**************************************************************************/ 85 /**************************************************************************/
83 86
87 PidginThemeFont * pidgin_theme_font_new(const char *face, GdkColor *color);
88
84 /** 89 /**
85 * Frees a font and color pair 90 * Frees a font and color pair
86 */ 91 *
87 void free_font_and_color(FontColorPair *pair); 92 * @param font The theme font
93 */
94 void pidgin_theme_font_free(PidginThemeFont *font);
95
96 void pidgin_theme_font_set_font_face(PidginThemeFont *font, const gchar *face);
97
98 void pidgin_theme_font_set_color(PidginThemeFont *font, const GdkColor *color);
99
100 const gchar * pidgin_theme_font_get_font_face(PidginThemeFont *font);
101
102 const GdkColor * pidgin_theme_font_get_color(PidginThemeFont *font);
103
104 const gchar * pidgin_theme_font_get_color_describe(PidginThemeFont *font);
88 105
89 /**************************************************************************/ 106 /**************************************************************************/
90 /** @name Purple Buddy List Theme API */ 107 /** @name Purple Buddy List Theme API */
91 /**************************************************************************/ 108 /**************************************************************************/
92 G_BEGIN_DECLS 109 G_BEGIN_DECLS
141 * 158 *
142 * @param theme The PidginBlist theme. 159 * @param theme The PidginBlist theme.
143 * 160 *
144 * @returns A font and color pair. 161 * @returns A font and color pair.
145 */ 162 */
146 FontColorPair *pidgin_blist_theme_get_expanded_text_info(PidginBlistTheme *theme); 163 PidginThemeFont *pidgin_blist_theme_get_expanded_text_info(PidginBlistTheme *theme);
147 164
148 /** 165 /**
149 * Returns the background color to be used with collapsed groups. 166 * Returns the background color to be used with collapsed groups.
150 * 167 *
151 * @param theme The PidginBlist theme. 168 * @param theme The PidginBlist theme.
159 * 176 *
160 * @param theme The PidginBlist theme. 177 * @param theme The PidginBlist theme.
161 * 178 *
162 * @returns A font and color pair. 179 * @returns A font and color pair.
163 */ 180 */
164 FontColorPair *pidgin_blist_theme_get_collapsed_text_info(PidginBlistTheme *theme); 181 PidginThemeFont *pidgin_blist_theme_get_collapsed_text_info(PidginBlistTheme *theme);
165 182
166 /** 183 /**
167 * Returns the colors to be used for contacts and chats. 184 * Returns the colors to be used for contacts and chats.
168 * 185 *
169 * @param theme The PidginBlist theme. 186 * @param theme The PidginBlist theme.
177 * 194 *
178 * @param theme The PidginBlist theme. 195 * @param theme The PidginBlist theme.
179 * 196 *
180 * @returns A font and color pair. 197 * @returns A font and color pair.
181 */ 198 */
182 FontColorPair *pidgin_blist_theme_get_contact_text_info(PidginBlistTheme *theme); 199 PidginThemeFont *pidgin_blist_theme_get_contact_text_info(PidginBlistTheme *theme);
183 200
184 /** 201 /**
185 * Returns the text font and color to be used for online buddies. 202 * Returns the text font and color to be used for online buddies.
186 * 203 *
187 * @param theme The PidginBlist theme. 204 * @param theme The PidginBlist theme.
188 * 205 *
189 * @returns A font and color pair. 206 * @returns A font and color pair.
190 */ 207 */
191 FontColorPair *pidgin_blist_theme_get_online_text_info(PidginBlistTheme *theme); 208 PidginThemeFont *pidgin_blist_theme_get_online_text_info(PidginBlistTheme *theme);
192 209
193 /** 210 /**
194 * Returns the text font and color to be used for away and idle buddies. 211 * Returns the text font and color to be used for away and idle buddies.
195 * 212 *
196 * @param theme The PidginBlist theme. 213 * @param theme The PidginBlist theme.
197 * 214 *
198 * @returns A font and color pair. 215 * @returns A font and color pair.
199 */ 216 */
200 FontColorPair *pidgin_blist_theme_get_away_text_info(PidginBlistTheme *theme); 217 PidginThemeFont *pidgin_blist_theme_get_away_text_info(PidginBlistTheme *theme);
201 218
202 /** 219 /**
203 * Returns the text font and color to be used for offline buddies. 220 * Returns the text font and color to be used for offline buddies.
204 * 221 *
205 * @param theme The PidginBlist theme. 222 * @param theme The PidginBlist theme.
206 * 223 *
207 * @returns A font and color pair. 224 * @returns A font and color pair.
208 */ 225 */
209 FontColorPair *pidgin_blist_theme_get_offline_text_info(PidginBlistTheme *theme); 226 PidginThemeFont *pidgin_blist_theme_get_offline_text_info(PidginBlistTheme *theme);
210 227
211 /** 228 /**
212 * Returns the text font and color to be used for idle buddies. 229 * Returns the text font and color to be used for idle buddies.
213 * 230 *
214 * @param theme The PidginBlist theme. 231 * @param theme The PidginBlist theme.
215 * 232 *
216 * @returns A font and color pair. 233 * @returns A font and color pair.
217 */ 234 */
218 FontColorPair *pidgin_blist_theme_get_idle_text_info(PidginBlistTheme *theme); 235 PidginThemeFont *pidgin_blist_theme_get_idle_text_info(PidginBlistTheme *theme);
219 236
220 /** 237 /**
221 * Returns the text font and color to be used for buddies with unread messages. 238 * Returns the text font and color to be used for buddies with unread messages.
222 * 239 *
223 * @param theme The PidginBlist theme. 240 * @param theme The PidginBlist theme.
224 * 241 *
225 * @returns A font and color pair. 242 * @returns A font and color pair.
226 */ 243 */
227 FontColorPair *pidgin_blist_theme_get_unread_message_text_info(PidginBlistTheme *theme); 244 PidginThemeFont *pidgin_blist_theme_get_unread_message_text_info(PidginBlistTheme *theme);
228 245
229 /** 246 /**
230 * Returns the text font and color to be used for chats with unread messages 247 * Returns the text font and color to be used for chats with unread messages
231 * that mention your nick. 248 * that mention your nick.
232 * 249 *
233 * @param theme The PidginBlist theme. 250 * @param theme The PidginBlist theme.
234 * 251 *
235 * @returns A font and color pair. 252 * @returns A font and color pair.
236 */ 253 */
237 FontColorPair *pidgin_blist_theme_get_unread_message_nick_said_text_info(PidginBlistTheme *theme); 254 PidginThemeFont *pidgin_blist_theme_get_unread_message_nick_said_text_info(PidginBlistTheme *theme);
238 255
239 /** 256 /**
240 * Returns the text font and color to be used for a buddy's status message. 257 * Returns the text font and color to be used for a buddy's status message.
241 * 258 *
242 * @param theme The PidginBlist theme. 259 * @param theme The PidginBlist theme.
243 * 260 *
244 * @returns A font and color pair. 261 * @returns A font and color pair.
245 */ 262 */
246 FontColorPair *pidgin_blist_theme_get_status_text_info(PidginBlistTheme *theme); 263 PidginThemeFont *pidgin_blist_theme_get_status_text_info(PidginBlistTheme *theme);
247 264
248 /* Set Methods */ 265 /* Set Methods */
249 266
250 /** 267 /**
251 * Sets the background color to be used for this buddy list theme. 268 * Sets the background color to be used for this buddy list theme.
283 * Sets the text color and font to be used for expanded groups. 300 * Sets the text color and font to be used for expanded groups.
284 * 301 *
285 * @param theme The PidginBlist theme. 302 * @param theme The PidginBlist theme.
286 * @param pair The new text font at color pair. 303 * @param pair The new text font at color pair.
287 */ 304 */
288 void pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 305 void pidgin_blist_theme_set_expanded_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
289 306
290 /** 307 /**
291 * Sets the background color to be used for collapsed groups. 308 * Sets the background color to be used for collapsed groups.
292 * 309 *
293 * @param theme The PidginBlist theme. 310 * @param theme The PidginBlist theme.
299 * Sets the text color and font to be used for expanded groups. 316 * Sets the text color and font to be used for expanded groups.
300 * 317 *
301 * @param theme The PidginBlist theme. 318 * @param theme The PidginBlist theme.
302 * @param pair The new text font at color pair. 319 * @param pair The new text font at color pair.
303 */ 320 */
304 void pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 321 void pidgin_blist_theme_set_collapsed_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
305 322
306 /** 323 /**
307 * Sets the background color to be used for contacts and chats. 324 * Sets the background color to be used for contacts and chats.
308 * 325 *
309 * @param theme The PidginBlist theme. 326 * @param theme The PidginBlist theme.
315 * Sets the text color and font to be used for expanded contacts. 332 * Sets the text color and font to be used for expanded contacts.
316 * 333 *
317 * @param theme The PidginBlist theme. 334 * @param theme The PidginBlist theme.
318 * @param pair The new text font at color pair. 335 * @param pair The new text font at color pair.
319 */ 336 */
320 void pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 337 void pidgin_blist_theme_set_contact_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
321 338
322 /** 339 /**
323 * Sets the text color and font to be used for online buddies. 340 * Sets the text color and font to be used for online buddies.
324 * 341 *
325 * @param theme The PidginBlist theme. 342 * @param theme The PidginBlist theme.
326 * @param pair The new text font at color pair. 343 * @param pair The new text font at color pair.
327 */ 344 */
328 void pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 345 void pidgin_blist_theme_set_online_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
329 346
330 /** 347 /**
331 * Sets the text color and font to be used for away and idle buddies. 348 * Sets the text color and font to be used for away and idle buddies.
332 * 349 *
333 * @param theme The PidginBlist theme. 350 * @param theme The PidginBlist theme.
334 * @param pair The new text font at color pair. 351 * @param pair The new text font at color pair.
335 */ 352 */
336 void pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 353 void pidgin_blist_theme_set_away_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
337 354
338 /** 355 /**
339 * Sets the text color and font to be used for offline buddies. 356 * Sets the text color and font to be used for offline buddies.
340 * 357 *
341 * @param theme The PidginBlist theme. 358 * @param theme The PidginBlist theme.
342 * @param pair The new text font at color pair. 359 * @param pair The new text font at color pair.
343 */ 360 */
344 void pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 361 void pidgin_blist_theme_set_offline_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
345 362
346 /** 363 /**
347 * Sets the text color and font to be used for idle buddies. 364 * Sets the text color and font to be used for idle buddies.
348 * 365 *
349 * @param theme The PidginBlist theme. 366 * @param theme The PidginBlist theme.
350 * @param pair The new text font at color pair. 367 * @param pair The new text font at color pair.
351 */ 368 */
352 void pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 369 void pidgin_blist_theme_set_idle_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
353 370
354 /** 371 /**
355 * Sets the text color and font to be used for buddies with unread messages. 372 * Sets the text color and font to be used for buddies with unread messages.
356 * 373 *
357 * @param theme The PidginBlist theme. 374 * @param theme The PidginBlist theme.
358 * @param pair The new text font at color pair. 375 * @param pair The new text font at color pair.
359 */ 376 */
360 void pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 377 void pidgin_blist_theme_set_unread_message_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
361 378
362 /** 379 /**
363 * Sets the text color and font to be used for a chat with unread messages 380 * Sets the text color and font to be used for a chat with unread messages
364 * that mention your nick. 381 * that mention your nick.
365 * 382 *
366 * @param theme The PidginBlist theme. 383 * @param theme The PidginBlist theme.
367 * @param pair The new text font at color pair. 384 * @param pair The new text font at color pair.
368 */ 385 */
369 void pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 386 void pidgin_blist_theme_set_unread_message_nick_said_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
370 387
371 /** 388 /**
372 * Sets the text color and font to be used for buddy status messages. 389 * Sets the text color and font to be used for buddy status messages.
373 * 390 *
374 * @param theme The PidginBlist theme. 391 * @param theme The PidginBlist theme.
375 * @param pair The new text font at color pair. 392 * @param pair The new text font at color pair.
376 */ 393 */
377 void pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, const FontColorPair *pair); 394 void pidgin_blist_theme_set_status_text_info(PidginBlistTheme *theme, const PidginThemeFont *pair);
378 395
379 G_END_DECLS 396 G_END_DECLS
380 #endif /* PIDGIN_BLIST_THEME_H */ 397 #endif /* PIDGIN_BLIST_THEME_H */