Loading...
Searching...
No Matches
imgstore.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_IMGSTORE_H_
#define _PURPLE_IMGSTORE_H_
#include <glib.h>
typedef struct _PurpleStoredImage PurpleStoredImage;
#ifdef __cplusplus
extern "C" {
#endif
PurpleStoredImage *
purple_imgstore_add(gpointer data, size_t size, const char *filename);
PurpleStoredImage *
purple_imgstore_new_from_file(const char *path);
int purple_imgstore_add_with_id(gpointer data, size_t size, const char *filename);
PurpleStoredImage *purple_imgstore_find_by_id(int id);
gconstpointer purple_imgstore_get_data(PurpleStoredImage *img);
size_t purple_imgstore_get_size(PurpleStoredImage *img);
const char *purple_imgstore_get_filename(const PurpleStoredImage *img);
const char *purple_imgstore_get_extension(PurpleStoredImage *img);
PurpleStoredImage *
purple_imgstore_ref(PurpleStoredImage *img);
PurpleStoredImage *
purple_imgstore_unref(PurpleStoredImage *img);
void purple_imgstore_ref_by_id(int id);
void purple_imgstore_unref_by_id(int id);
void *purple_imgstore_get_handle(void);
void purple_imgstore_init(void);
void purple_imgstore_uninit(void);
#ifdef __cplusplus
}
#endif
#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.