pidgin/gtkutils.c

branch
soc.2013.gobjectification.plugins
changeset 37134
07746c9a04bf
parent 37133
832cd077145e
parent 35815
d6fe2c2ebbbe
child 37135
6271bcdee576
equal deleted inserted replaced
37133:832cd077145e 37134:07746c9a04bf
40 #include <gdk/gdkkeysyms.h> 40 #include <gdk/gdkkeysyms.h>
41 41
42 #include "conversation.h" 42 #include "conversation.h"
43 #include "debug.h" 43 #include "debug.h"
44 #include "desktopitem.h" 44 #include "desktopitem.h"
45 #include "imgstore.h"
46 #include "notify.h" 45 #include "notify.h"
47 #include "prefs.h" 46 #include "prefs.h"
48 #include "protocol.h" 47 #include "protocol.h"
49 #include "request.h" 48 #include "request.h"
50 #include "signals.h" 49 #include "signals.h"
1396 size_t size; 1395 size_t size;
1397 GStatBuf st; 1396 GStatBuf st;
1398 GError *err = NULL; 1397 GError *err = NULL;
1399 PurpleConversation *conv; 1398 PurpleConversation *conv;
1400 PidginConversation *gtkconv; 1399 PidginConversation *gtkconv;
1401 int id;
1402 PurpleBuddy *buddy; 1400 PurpleBuddy *buddy;
1403 PurpleContact *contact; 1401 PurpleContact *contact;
1402 PurpleImage *img;
1403
1404 switch (choice) { 1404 switch (choice) {
1405 case DND_BUDDY_ICON: 1405 case DND_BUDDY_ICON:
1406 if (g_stat(data->filename, &st)) { 1406 if (g_stat(data->filename, &st)) {
1407 char *str; 1407 char *str;
1408 1408
1443 1443
1444 break; 1444 break;
1445 } 1445 }
1446 shortname = strrchr(data->filename, G_DIR_SEPARATOR); 1446 shortname = strrchr(data->filename, G_DIR_SEPARATOR);
1447 shortname = shortname ? shortname + 1 : data->filename; 1447 shortname = shortname ? shortname + 1 : data->filename;
1448 id = purple_imgstore_new_with_id(filedata, size, shortname); 1448 img = purple_image_new_from_data(filedata, size);
1449 1449
1450 pidgin_webview_insert_image(PIDGIN_WEBVIEW(gtkconv->entry), id); 1450 pidgin_webview_insert_image(PIDGIN_WEBVIEW(gtkconv->entry), img);
1451 purple_imgstore_unref_by_id(id); 1451 g_object_unref(img);
1452 1452
1453 break; 1453 break;
1454 } 1454 }
1455 g_free(data->filename); 1455 g_free(data->filename);
1456 g_free(data->who); 1456 g_free(data->who);
3081 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count) 3081 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count)
3082 { 3082 {
3083 return GDK_PIXBUF_ANIMATION(pidgin_pixbuf_from_data_helper(buf, count, TRUE)); 3083 return GDK_PIXBUF_ANIMATION(pidgin_pixbuf_from_data_helper(buf, count, TRUE));
3084 } 3084 }
3085 3085
3086 GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image) 3086 GdkPixbuf *
3087 { 3087 pidgin_pixbuf_from_image(PurpleImage *image)
3088 return pidgin_pixbuf_from_data(purple_imgstore_get_data(image), 3088 {
3089 purple_imgstore_get_size(image)); 3089 return pidgin_pixbuf_from_data(purple_image_get_data(image),
3090 purple_image_get_size(image));
3090 } 3091 }
3091 3092
3092 GdkPixbuf *pidgin_pixbuf_new_from_file(const gchar *filename) 3093 GdkPixbuf *pidgin_pixbuf_new_from_file(const gchar *filename)
3093 { 3094 {
3094 GdkPixbuf *pixbuf; 3095 GdkPixbuf *pixbuf;

mercurial