pidgin/pidgingdkpixbuf.h

Fri, 18 Mar 2022 00:13:23 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 18 Mar 2022 00:13:23 -0500
changeset 41305
92438aae2067
parent 41144
910bdda75c74
permissions
-rw-r--r--

Remove a bunch of unused pixmaps

Testing Done:
Compiled and ran, didn't see anything missing.

It's worth noting that we've been using the logo from the resource for a long time, and the other icons were removed when we purge the `GtkStock` stuff, but there's existing items in the default icon theme for them anyways. Also we nuked the system tray stuff forever ago to.

Reviewed at https://reviews.imfreedom.org/r/1336/

39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /* pidgin
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * source distribution.
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * (at your option) any later version.
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * GNU General Public License for more details.
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
40502
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
22 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
23 # error "only <pidgin.h> may be included directly"
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
24 #endif
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
25
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #ifndef PIDGIN_GDK_PIXBUF_H
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #define PIDGIN_GDK_PIXBUF_H
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <glib.h>
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <gdk-pixbuf/gdk-pixbuf.h>
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <purple.h>
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 G_BEGIN_DECLS
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
39570
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
36 /**
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
37 * pidgin_gdk_pixbuf_new_from_image:
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
38 * @image: A #PurpleImage instance.
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
39 * @error: (out) (nullable): A return address for a #GError.
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
40 *
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
41 * Creates a new #GdkPixbuf from the #PurpleImage @image. If provided Sets
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
42 * @error on error.
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
43 *
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
44 * Returns: (transfer full) (nullable): The new #GdkPixbuf or %NULL or error.
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
45 */
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GdkPixbuf *pidgin_gdk_pixbuf_new_from_image(PurpleImage *image, GError **error);
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 /**
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 * pidgin_gdk_pixbuf_make_round:
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 * @pixbuf: The buddy icon to transform
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 *
39569
0f82795adcb5 Clean up a bad comment
Gary Kramlich <grim@reaperworld.com>
parents: 39568
diff changeset
52 * Rounds the corners of a GdkPixbuf in place.
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 */
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf);
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 /**
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * pidgin_gdk_pixbuf_is_opaque:
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * @pixbuf: The pixbuf
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * Returns TRUE if the GdkPixbuf is opaque, as determined by no
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 * alpha at any of the edge pixels.
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 * Returns: TRUE if the pixbuf is opaque around the edges, FALSE otherwise
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 */
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf);
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
67 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
68 * pidgin_pixbuf_from_data:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
69 * @buf: The raw binary image data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
70 * @count: The length of buf in bytes.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
71 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
72 * Create a GdkPixbuf from a chunk of image data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
73 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
74 * Returns: (transfer full): A GdkPixbuf created from the image data, or NULL if
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
75 * there was an error parsing the data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
76 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
77 GdkPixbuf *pidgin_pixbuf_from_data(const guchar *buf, gsize count);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
78
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
79 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
80 * pidgin_pixbuf_anim_from_data:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
81 * @buf: The raw binary image data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
82 * @count: The length of buf in bytes.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
83 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
84 * Create a GdkPixbufAnimation from a chunk of image data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
85 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
86 * Returns: (transfer full): A GdkPixbufAnimation created from the image data, or NULL if
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
87 * there was an error parsing the data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
88 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
89 GdkPixbufAnimation *pidgin_pixbuf_anim_from_data(const guchar *buf, gsize count);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
90
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
91 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
92 * pidgin_pixbuf_from_image:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
93 * @image: a PurpleImage.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
94 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
95 * Create a GdkPixbuf from a PurpleImage.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
96 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
97 * Returns: (transfer full): a GdkPixbuf created from the @image.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
98 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
99 GdkPixbuf *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
100 pidgin_pixbuf_from_image(PurpleImage *image);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
101
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
102 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
103 * pidgin_pixbuf_new_from_file:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
104 * @filename: Name of file to load, in the GLib file name encoding
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
105 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
106 * Helper function that calls gdk_pixbuf_new_from_file() and checks both
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
107 * the return code and the GError and returns NULL if either one failed.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
108 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
109 * The gdk-pixbuf documentation implies that it is sufficient to check
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
110 * the return value of gdk_pixbuf_new_from_file() to determine
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
111 * whether the image was able to be loaded. However, this is not the case
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
112 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
113 * cases a GdkPixbuf object is returned that will cause some operations
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
114 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
115 * infinite loop.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
116 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
117 * This function shouldn't be necessary once Pidgin requires a version of
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
118 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
119 * nice to keep this function around for the debug message that it logs.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
120 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
121 * Returns: (transfer full): The GdkPixbuf if successful. Otherwise NULL is returned and
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
122 * a warning is logged.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
123 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
124 GdkPixbuf *pidgin_pixbuf_new_from_file(const char *filename);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
125
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
126 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
127 * pidgin_pixbuf_new_from_file_at_size:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
128 * @filename: Name of file to load, in the GLib file name encoding
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
129 * @width: The width the image should have or -1 to not constrain the width
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
130 * @height: The height the image should have or -1 to not constrain the height
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
131 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
132 * Helper function that calls gdk_pixbuf_new_from_file_at_size() and checks
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
133 * both the return code and the GError and returns NULL if either one failed.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
134 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
135 * The gdk-pixbuf documentation implies that it is sufficient to check
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
136 * the return value of gdk_pixbuf_new_from_file_at_size() to determine
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
137 * whether the image was able to be loaded. However, this is not the case
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
138 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
139 * cases a GdkPixbuf object is returned that will cause some operations
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
140 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
141 * infinite loop.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
142 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
143 * This function shouldn't be necessary once Pidgin requires a version of
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
144 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
145 * nice to keep this function around for the debug message that it logs.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
146 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
147 * Returns: (transfer full): The GdkPixbuf if successful. Otherwise NULL is returned and
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
148 * a warning is logged.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
149 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
150 GdkPixbuf *pidgin_pixbuf_new_from_file_at_size(const char *filename, int width, int height);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
151
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
152 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
153 * pidgin_pixbuf_new_from_file_at_scale:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
154 * @filename: Name of file to load, in the GLib file name encoding
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
155 * @width: The width the image should have or -1 to not constrain the width
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
156 * @height: The height the image should have or -1 to not constrain the height
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
157 * @preserve_aspect_ratio: TRUE to preserve the image's aspect ratio
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
158 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
159 * Helper function that calls gdk_pixbuf_new_from_file_at_scale() and checks
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
160 * both the return code and the GError and returns NULL if either one failed.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
161 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
162 * The gdk-pixbuf documentation implies that it is sufficient to check
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
163 * the return value of gdk_pixbuf_new_from_file_at_scale() to determine
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
164 * whether the image was able to be loaded. However, this is not the case
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
165 * with gdk-pixbuf 2.23.3 and probably many earlier versions. In some
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
166 * cases a GdkPixbuf object is returned that will cause some operations
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
167 * (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
168 * infinite loop.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
169 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
170 * This function shouldn't be necessary once Pidgin requires a version of
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
171 * gdk-pixbuf where the aforementioned bug is fixed. However, it might be
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
172 * nice to keep this function around for the debug message that it logs.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
173 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
174 * Returns: (transfer full): The GdkPixbuf if successful. Otherwise NULL is returned and
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
175 * a warning is logged.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
176 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
177 GdkPixbuf *pidgin_pixbuf_new_from_file_at_scale(const char *filename, int width, int height, gboolean preserve_aspect_ratio);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
178
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
179 /**
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
180 * pidgin_pixbuf_scale_down:
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
181 * @src: The source image.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
182 * @max_width: Maximum width in px.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
183 * @max_height: Maximum height in px.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
184 * @interp_type: Interpolation method.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
185 * @preserve_ratio: %TRUE to preserve image's aspect ratio.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
186 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
187 * Scales the image to the desired dimensions. If image is smaller, it will be
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
188 * returned without modifications.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
189 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
190 * If new image is created, @src reference count will be decreased and new image
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
191 * with a ref count of 1 will be returned.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
192 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
193 * Returns: (transfer full): The image with proper sizing. %NULL in case of error.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
194 */
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
195 GdkPixbuf *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
196 pidgin_pixbuf_scale_down(GdkPixbuf *src, guint max_width, guint max_height,
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
197 GdkInterpType interp_type, gboolean preserve_ratio);
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
198
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
199
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
200
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 G_END_DECLS
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 #endif /* PIDGIN_GDK_PIXBUF_H */

mercurial