pidgin/gtkutils.c

branch
soc.2013.gobjectification.plugins
changeset 36405
bfae18433ee8
parent 36362
e518ad02107d
child 36424
477889a0073c
equal deleted inserted replaced
36404:7113051701e2 36405:bfae18433ee8
2267 return TRUE; 2267 return TRUE;
2268 return FALSE; 2268 return FALSE;
2269 } 2269 }
2270 2270
2271 gpointer 2271 gpointer
2272 pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path, size_t *len) 2272 pidgin_convert_buddy_icon(PurplePluginProtocolInfo *prpl_info, const char *path, size_t *len)
2273 { 2273 {
2274 PurplePluginProtocolInfo *prpl_info;
2275 PurpleBuddyIconSpec *spec; 2274 PurpleBuddyIconSpec *spec;
2276 int orig_width, orig_height, new_width, new_height; 2275 int orig_width, orig_height, new_width, new_height;
2277 GdkPixbufFormat *format; 2276 GdkPixbufFormat *format;
2278 char **pixbuf_formats; 2277 char **pixbuf_formats;
2279 char **prpl_formats; 2278 char **prpl_formats;
2283 GdkPixbuf *pixbuf, *original; 2282 GdkPixbuf *pixbuf, *original;
2284 float scale_factor; 2283 float scale_factor;
2285 int i; 2284 int i;
2286 gchar *tmp; 2285 gchar *tmp;
2287 2286
2288 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin);
2289 spec = &prpl_info->icon_spec; 2287 spec = &prpl_info->icon_spec;
2290 g_return_val_if_fail(spec->format != NULL, NULL); 2288 g_return_val_if_fail(spec->format != NULL, NULL);
2291 2289
2292 format = gdk_pixbuf_get_file_info(path, &orig_width, &orig_height); 2290 format = gdk_pixbuf_get_file_info(path, &orig_width, &orig_height);
2293 if (format == NULL) { 2291 if (format == NULL) {
2430 g_strfreev(prpl_formats); 2428 g_strfreev(prpl_formats);
2431 g_object_unref(G_OBJECT(pixbuf)); 2429 g_object_unref(G_OBJECT(pixbuf));
2432 g_object_unref(G_OBJECT(original)); 2430 g_object_unref(G_OBJECT(original));
2433 2431
2434 tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"), 2432 tmp = g_strdup_printf(_("The file '%s' is too large for %s. Please try a smaller image.\n"),
2435 path, plugin->info->name); 2433 path, prpl_info->name);
2436 purple_notify_error(NULL, _("Icon Error"), _("Could not set icon"), tmp); 2434 purple_notify_error(NULL, _("Icon Error"), _("Could not set icon"), tmp);
2437 g_free(tmp); 2435 g_free(tmp);
2438 2436
2439 return NULL; 2437 return NULL;
2440 } 2438 }

mercurial