| 31 #include "pidginaccountchooser.h" |
31 #include "pidginaccountchooser.h" |
| 32 #include "pidginaccountfilterconnected.h" |
32 #include "pidginaccountfilterconnected.h" |
| 33 #include "pidginaccountstore.h" |
33 #include "pidginaccountstore.h" |
| 34 #include "pidgincore.h" |
34 #include "pidgincore.h" |
| 35 #include "pidgindialog.h" |
35 #include "pidgindialog.h" |
| 36 #include "pidgingdkpixbuf.h" |
|
| 37 |
36 |
| 38 #include <gdk/gdkkeysyms.h> |
37 #include <gdk/gdkkeysyms.h> |
| 39 |
38 |
| 40 typedef struct |
39 typedef struct |
| 41 { |
40 { |
| 357 /* Dialog icon. */ |
356 /* Dialog icon. */ |
| 358 icon_data = purple_request_cpar_get_custom_icon(cpar, &icon_size); |
357 icon_data = purple_request_cpar_get_custom_icon(cpar, &icon_size); |
| 359 if (icon_data) { |
358 if (icon_data) { |
| 360 GdkPixbuf *pixbuf; |
359 GdkPixbuf *pixbuf; |
| 361 |
360 |
| 362 pixbuf = pidgin_pixbuf_from_data(icon_data, icon_size); |
361 pixbuf = purple_gdk_pixbuf_from_data(icon_data, icon_size); |
| 363 if (pixbuf) { |
362 if (pixbuf) { |
| 364 /* scale the image if it is too large */ |
363 /* scale the image if it is too large */ |
| 365 int width = gdk_pixbuf_get_width(pixbuf); |
364 int width = gdk_pixbuf_get_width(pixbuf); |
| 366 int height = gdk_pixbuf_get_height(pixbuf); |
365 int height = gdk_pixbuf_get_height(pixbuf); |
| 367 if (width > 128 || height > 128) { |
366 if (width > 128 || height > 128) { |
| 1309 create_image_field(PurpleRequestField *field) |
1308 create_image_field(PurpleRequestField *field) |
| 1310 { |
1309 { |
| 1311 GtkWidget *widget; |
1310 GtkWidget *widget; |
| 1312 GdkPixbuf *buf, *scale; |
1311 GdkPixbuf *buf, *scale; |
| 1313 |
1312 |
| 1314 buf = pidgin_pixbuf_from_data( |
1313 buf = purple_gdk_pixbuf_from_data( |
| 1315 (const guchar *)purple_request_field_image_get_buffer(field), |
1314 (const guchar *)purple_request_field_image_get_buffer(field), |
| 1316 purple_request_field_image_get_size(field)); |
1315 purple_request_field_image_get_size(field)); |
| 1317 |
1316 |
| 1318 scale = gdk_pixbuf_scale_simple(buf, |
1317 scale = gdk_pixbuf_scale_simple(buf, |
| 1319 purple_request_field_image_get_scale_x(field) * gdk_pixbuf_get_width(buf), |
1318 purple_request_field_image_get_scale_x(field) * gdk_pixbuf_get_width(buf), |
| 1450 if (has_icons) { |
1449 if (has_icons) { |
| 1451 const char *icon_path = (const char *)item->value; |
1450 const char *icon_path = (const char *)item->value; |
| 1452 GdkPixbuf* pixbuf = NULL; |
1451 GdkPixbuf* pixbuf = NULL; |
| 1453 |
1452 |
| 1454 if (icon_path) |
1453 if (icon_path) |
| 1455 pixbuf = pidgin_pixbuf_new_from_file(icon_path); |
1454 pixbuf = purple_gdk_pixbuf_new_from_file(icon_path); |
| 1456 |
1455 |
| 1457 gtk_list_store_set(store, &iter, |
1456 gtk_list_store_set(store, &iter, |
| 1458 0, purple_request_field_list_get_data(field, text), |
1457 0, purple_request_field_list_get_data(field, text), |
| 1459 1, text, |
1458 1, text, |
| 1460 2, pixbuf, |
1459 2, pixbuf, |