libpurple/purplegdkpixbuf.h

Tue, 24 Oct 2023 02:02:49 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 24 Oct 2023 02:02:49 -0500
changeset 42391
090b03385984
parent 42338
2548eb61acc9
child 42594
eddde70cedd8
permissions
-rw-r--r--

Add Since and symbol visibility to new-in-3.0 things

Mostly found through comparing ABI on `release-2.x.y` and `default`.

Note this only covers things that show up in the ABI, so macros, typedefs and the like won't be tagged.

Testing Done:
Compiled only.

Bugs closed: PIDGIN-17838

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

41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
1 /*
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
2 * Purple - Internet Messaging Library
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * 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
7 * source distribution.
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * 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
10 * 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
11 * 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
12 * (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
13 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * 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
15 * 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
16 * 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
17 * 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
18 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
24 # error "only <purple.h> may be included directly"
40502
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
25 #endif
875489636847 pidgin.h phase3: create pidgin.h and force its usage
Gary Kramlich <grim@reaperworld.com>
parents: 39570
diff changeset
26
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
27 #ifndef PURPLE_GDK_PIXBUF_H
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
28 #define PURPLE_GDK_PIXBUF_H
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
31
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #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
33
42338
2548eb61acc9 Make sure all internal includes use double quotes
Gary Kramlich <grim@reaperworld.com>
parents: 41319
diff changeset
34 #include "image.h"
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
35 #include "purpleversion.h"
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 G_BEGIN_DECLS
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
39570
a6ec70c31e9e Add missing docs on pidgin_gdk_pixbuf_new_from_image
Gary Kramlich <grim@reaperworld.com>
parents: 39569
diff changeset
39 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
40 * purple_gdk_pixbuf_make_round:
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 * @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
42 *
39569
0f82795adcb5 Clean up a bad comment
Gary Kramlich <grim@reaperworld.com>
parents: 39568
diff changeset
43 * Rounds the corners of a GdkPixbuf in place.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
44 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
45 * Since: 3.0.0
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
47 PURPLE_AVAILABLE_IN_3_0
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
48 void purple_gdk_pixbuf_make_round(GdkPixbuf *pixbuf);
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
51 * purple_gdk_pixbuf_is_opaque:
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 * @pixbuf: The pixbuf
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 * 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
55 * 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
56 *
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * Returns: TRUE if the pixbuf is opaque around the edges, FALSE otherwise
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
58 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
59 * Since: 3.0.0
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
61 PURPLE_AVAILABLE_IN_3_0
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
62 gboolean purple_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf);
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
64 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
65 * purple_gdk_pixbuf_from_data:
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
66 * @buf: The raw binary image data.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
67 * @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
68 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
69 * 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
70 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
71 * 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
72 * there was an error parsing the data.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
73 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
74 * Since: 3.0.0
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
75 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
76 PURPLE_AVAILABLE_IN_3_0
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
77 GdkPixbuf *purple_gdk_pixbuf_from_data(const guchar *buf, gsize count);
41144
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 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
80 * purple_gdk_pixbuf_from_image:
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
81 * @image: a PurpleImage.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
82 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
83 * Create a GdkPixbuf from a PurpleImage.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
84 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
85 * Returns: (transfer full): a GdkPixbuf created from the @image.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
86 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
87 * Since: 3.0.0
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
88 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
89 PURPLE_AVAILABLE_IN_3_0
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
90 GdkPixbuf *
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
91 purple_gdk_pixbuf_from_image(PurpleImage *image);
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
92
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
93 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
94 * purple_gdk_pixbuf_new_from_file:
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
95 * @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
96 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
97 * 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
98 * 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
99 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
100 * 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
101 * 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
102 * 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
103 * 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
104 * 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
105 * (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
106 * infinite loop.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
107 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
108 * 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
109 * 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
110 * 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
111 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
112 * 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
113 * a warning is logged.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
114 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
115 * Since: 3.0.0
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
116 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
117 PURPLE_AVAILABLE_IN_3_0
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
118 GdkPixbuf *purple_gdk_pixbuf_new_from_file(const char *filename);
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
119
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
120 /**
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
121 * purple_gdk_pixbuf_new_from_file_at_size:
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
122 * @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
123 * @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
124 * @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
125 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
126 * 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
127 * 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
128 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
129 * 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
130 * 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
131 * 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
132 * 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
133 * 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
134 * (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
135 * infinite loop.
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
136 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
137 * 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
138 * 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
139 * 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
140 *
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
141 * 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
142 * a warning is logged.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
143 *
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
144 * Since: 3.0.0
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
145 */
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42338
diff changeset
146 PURPLE_AVAILABLE_IN_3_0
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
147 GdkPixbuf *purple_gdk_pixbuf_new_from_file_at_size(const char *filename, int width, int height);
41144
910bdda75c74 Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41124
diff changeset
148
39568
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 G_END_DECLS
f4714f1de6d0 Start cleaning up gtkutils by moving functions to individual files
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150
41319
04d027ed3d63 Add gdk-pixbuf as a libpurple dependency and move helpers from pidgin to purple
Gary Kramlich <grim@reaperworld.com>
parents: 41144
diff changeset
151 #endif /* PURPLE_GDK_PIXBUF_H */

mercurial