pidgin 2.14.14dev
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
37typedef struct _PurpleStoredImage PurpleStoredImage;
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
67purple_imgstore_add(gpointer data, size_t size, const char *filename);
68
89
112int purple_imgstore_add_with_id(gpointer data, size_t size, const char *filename);
113
123
133
143
153
164
174
186
197
208
215
220
225
226#ifdef __cplusplus
227}
228#endif
229
230#endif /* _PURPLE_IMGSTORE_H_ */
void * purple_imgstore_get_handle(void)
Returns the image store subsystem handle.
gconstpointer purple_imgstore_get_data(PurpleStoredImage *img)
Retrieves a pointer to the image's data.
PurpleStoredImage * purple_imgstore_find_by_id(int id)
Retrieve an image from the store.
size_t purple_imgstore_get_size(PurpleStoredImage *img)
Retrieves the length of the image's data.
PurpleStoredImage * purple_imgstore_add(gpointer data, size_t size, const char *filename)
Create a new PurpleStoredImage.
void purple_imgstore_init(void)
Initializes the image store subsystem.
const char * purple_imgstore_get_filename(const PurpleStoredImage *img)
Retrieves a pointer to the image's filename.
void purple_imgstore_ref_by_id(int id)
Increment the reference count using an ID.
PurpleStoredImage * purple_imgstore_new_from_file(const char *path)
Create a PurpleStoredImage using purple_imgstore_add() by reading the given filename from disk.
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.
void purple_imgstore_uninit(void)
Uninitializes the image store subsystem.
void purple_imgstore_unref_by_id(int id)
Decrement the reference count using an ID.
struct _PurpleStoredImage PurpleStoredImage
A set of utility functions that provide a reference-counted immutable wrapper around an image's data ...
Definition: imgstore.h:37
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...
PurpleStoredImage * purple_imgstore_unref(PurpleStoredImage *img)
Decrement the reference count.
PurpleStoredImage * purple_imgstore_ref(PurpleStoredImage *img)
Increment the reference count.