pidgin: imgstore.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
imgstore.h
Go to the documentation of this file.
1
7/* purple
8 *
9 * Purple is the legal property of its developers, whose names are too numerous
10 * to list here. Please refer to the COPYRIGHT file distributed with this
11 * source distribution.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 */
27#ifndef _PURPLE_IMGSTORE_H_
28#define _PURPLE_IMGSTORE_H_
29
30#include <glib.h>
31
37 typedef struct _PurpleStoredImage PurpleStoredImage;
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
66 PurpleStoredImage *
67purple_imgstore_add(gpointer data, size_t size, const char *filename);
68
87 PurpleStoredImage *
88purple_imgstore_new_from_file(const char *path);
89
112 int purple_imgstore_add_with_id(gpointer data, size_t size, const char *filename);
113
122 PurpleStoredImage *purple_imgstore_find_by_id(int id);
123
132gconstpointer purple_imgstore_get_data(PurpleStoredImage *img);
133
142 size_t purple_imgstore_get_size(PurpleStoredImage *img);
143
152 const char *purple_imgstore_get_filename(const PurpleStoredImage *img);
153
163 const char *purple_imgstore_get_extension(PurpleStoredImage *img);
164
172 PurpleStoredImage *
173purple_imgstore_ref(PurpleStoredImage *img);
174
184 PurpleStoredImage *
185purple_imgstore_unref(PurpleStoredImage *img);
186
196 void purple_imgstore_ref_by_id(int id);
197
207 void purple_imgstore_unref_by_id(int id);
208
214 void *purple_imgstore_get_handle(void);
215
219 void purple_imgstore_init(void);
220
224 void purple_imgstore_uninit(void);
225
226#ifdef __cplusplus
227}
228#endif
229
230#endif /* _PURPLE_IMGSTORE_H_ */
purple_imgstore_get_handle
void * purple_imgstore_get_handle(void)
Returns the image store subsystem handle.
purple_imgstore_get_data
gconstpointer purple_imgstore_get_data(PurpleStoredImage *img)
Retrieves a pointer to the image's data.
purple_imgstore_find_by_id
PurpleStoredImage * purple_imgstore_find_by_id(int id)
Retrieve an image from the store.
purple_imgstore_get_size
size_t purple_imgstore_get_size(PurpleStoredImage *img)
Retrieves the length of the image's data.
purple_imgstore_add
PurpleStoredImage * purple_imgstore_add(gpointer data, size_t size, const char *filename)
Create a new PurpleStoredImage.
purple_imgstore_init
void purple_imgstore_init(void)
Initializes the image store subsystem.
purple_imgstore_get_filename
const char * purple_imgstore_get_filename(const PurpleStoredImage *img)
Retrieves a pointer to the image's filename.
purple_imgstore_ref_by_id
void purple_imgstore_ref_by_id(int id)
Increment the reference count using an ID.
purple_imgstore_new_from_file
PurpleStoredImage * purple_imgstore_new_from_file(const char *path)
Create a PurpleStoredImage using purple_imgstore_add() by reading the given filename from disk.
purple_imgstore_add_with_id
int purple_imgstore_add_with_id(gpointer data, size_t size, const char *filename)
Create a PurpleStoredImage using purple_imgstore_add() and add the image to the image store.
purple_imgstore_uninit
void purple_imgstore_uninit(void)
Uninitializes the image store subsystem.
purple_imgstore_unref_by_id
void purple_imgstore_unref_by_id(int id)
Decrement the reference count using an ID.
PurpleStoredImage
struct _PurpleStoredImage PurpleStoredImage
A set of utility functions that provide a reference-counted immutable wrapper around an image's data ...
Definition: imgstore.h:37
purple_imgstore_get_extension
const char * purple_imgstore_get_extension(PurpleStoredImage *img)
Looks at the magic numbers of the image data (the first few bytes) and returns an extension correspon...
purple_imgstore_unref
PurpleStoredImage * purple_imgstore_unref(PurpleStoredImage *img)
Decrement the reference count.
purple_imgstore_ref
PurpleStoredImage * purple_imgstore_ref(PurpleStoredImage *img)
Increment the reference count.