Mercurial > pidgin
comparison pidgin/gtkthemes.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | a8cc50c2279f |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
120 g_free(theme_dir); | 120 g_free(theme_dir); |
121 } | 121 } |
122 | 122 |
123 static void _pidgin_themes_smiley_themeize(GtkWidget *imhtml, gboolean custom) | 123 static void _pidgin_themes_smiley_themeize(GtkWidget *imhtml, gboolean custom) |
124 { | 124 { |
125 /* TODO WEBKIT: move imhtml dependency to use webview. */ | |
126 #if 0 | |
125 struct smiley_list *list; | 127 struct smiley_list *list; |
126 if (!current_smiley_theme) | 128 if (!current_smiley_theme) |
127 return; | 129 return; |
128 | 130 |
129 gtk_imhtml_remove_smileys(GTK_IMHTML(imhtml)); | 131 gtk_imhtml_remove_smileys(GTK_IMHTML(imhtml)); |
145 } | 147 } |
146 } | 148 } |
147 | 149 |
148 list = list->next; | 150 list = list->next; |
149 } | 151 } |
152 #endif /* if 0 */ | |
150 } | 153 } |
151 | 154 |
152 void pidgin_themes_smiley_themeize(GtkWidget *imhtml) | 155 void pidgin_themes_smiley_themeize(GtkWidget *imhtml) |
153 { | 156 { |
154 _pidgin_themes_smiley_themeize(imhtml, FALSE); | 157 _pidgin_themes_smiley_themeize(imhtml, FALSE); |
276 i++; | 279 i++; |
277 | 280 |
278 if (*i == '[' && strchr(i, ']') && load) { | 281 if (*i == '[' && strchr(i, ']') && load) { |
279 struct smiley_list *child = g_new0(struct smiley_list, 1); | 282 struct smiley_list *child = g_new0(struct smiley_list, 1); |
280 child->sml = g_strndup(i+1, strchr(i, ']') - i - 1); | 283 child->sml = g_strndup(i+1, strchr(i, ']') - i - 1); |
284 child->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); | |
285 | |
281 if (theme->list) | 286 if (theme->list) |
282 list->next = child; | 287 list->next = child; |
283 else | 288 else |
284 theme->list = child; | 289 theme->list = child; |
285 /* Reverse the Smiley list since it was built in reverse order for efficiency reasons */ | 290 /* Reverse the Smiley list since it was built in reverse order for efficiency reasons */ |
318 if (!sfile) { | 323 if (!sfile) { |
319 sfile = g_build_filename(dirname, l, NULL); | 324 sfile = g_build_filename(dirname, l, NULL); |
320 } else { | 325 } else { |
321 GtkIMHtmlSmiley *smiley = gtk_imhtml_smiley_create(sfile, l, hidden, 0); | 326 GtkIMHtmlSmiley *smiley = gtk_imhtml_smiley_create(sfile, l, hidden, 0); |
322 list->smileys = g_slist_prepend(list->smileys, smiley); | 327 list->smileys = g_slist_prepend(list->smileys, smiley); |
328 g_hash_table_insert (list->files, g_strdup(l), g_strdup(sfile)); | |
323 } | 329 } |
324 while (isspace(*i)) | 330 while (isspace(*i)) |
325 i++; | 331 i++; |
326 | 332 |
327 } | 333 } |
356 for (cnv = purple_get_conversations(); cnv != NULL; cnv = cnv->next) { | 362 for (cnv = purple_get_conversations(); cnv != NULL; cnv = cnv->next) { |
357 PurpleConversation *conv = cnv->data; | 363 PurpleConversation *conv = cnv->data; |
358 | 364 |
359 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { | 365 if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { |
360 /* We want to see our custom smileys on our entry if we write the shortcut */ | 366 /* We want to see our custom smileys on our entry if we write the shortcut */ |
361 pidgin_themes_smiley_themeize(PIDGIN_CONVERSATION(conv)->imhtml); | |
362 pidgin_themes_smiley_themeize_custom(PIDGIN_CONVERSATION(conv)->entry); | 367 pidgin_themes_smiley_themeize_custom(PIDGIN_CONVERSATION(conv)->entry); |
363 } | 368 } |
364 } | 369 } |
365 } | 370 } |
366 } | 371 } |