6982
+ 鐃緒申��申鐃緒申 1 /**
+ 鐃緒申��申鐃緒申 2 * @file imgstore.h IM Image Store API
+ 鐃緒申��申鐃緒申 3 * @ingroup core
+ 鐃緒申��申鐃緒申 4 *
+ 鐃緒申��申鐃緒申 5 * gaim
+ 鐃緒申��申鐃緒申 6 *
8046
+ 鐃緒申��申鐃緒申 7 * Gaim is the legal property of its developers, whose names are too numerous
+ 鐃緒申��申鐃緒申 8 * to list here. Please refer to the COPYRIGHT file distributed with this
+ 鐃緒申��申鐃緒申 9 * source distribution.
6982
+ 鐃緒申��申鐃緒申 10 *
+ 鐃緒申��申鐃緒申 11 * This program is free software; you can redistribute it and/or modify
+ 鐃緒申��申鐃緒申 12 * it under the terms of the GNU General Public License as published by
+ 鐃緒申��申鐃緒申 13 * the Free Software Foundation; either version 2 of the License, or
+ 鐃緒申��申鐃緒申 14 * (at your option) any later version.
+ 鐃緒申��申鐃緒申 15 *
+ 鐃緒申��申鐃緒申 16 * This program is distributed in the hope that it will be useful,
+ 鐃緒申��申鐃緒申 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ 鐃緒申��申鐃緒申 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ 鐃緒申��申鐃緒申 19 * GNU General Public License for more details.
+ 鐃緒申��申鐃緒申 20 *
+ 鐃緒申��申鐃緒申 21 * You should have received a copy of the GNU General Public License
+ 鐃緒申��申鐃緒申 22 * along with this program; if not, write to the Free Software
+ 鐃緒申��申鐃緒申 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 鐃緒申��申鐃緒申 24 *
+ 鐃緒申��申鐃緒申 25 */
9713
+ 鐃緒申��申鐃緒申 26 #ifndef _GAIM_IMGSTORE_H_
+ 鐃緒申��申鐃緒申 27 #define _GAIM_IMGSTORE_H_
6982
+ 鐃緒申��申鐃緒申 28
8962
+ 鐃緒申��申鐃緒申 29 struct _GaimStoredImage;
+ 鐃緒申��申鐃緒申 30 typedef struct _GaimStoredImage GaimStoredImage;
6982
+ 鐃緒申��申鐃緒申 31
+ 鐃緒申��申鐃緒申 32 #ifdef __cplusplus
+ 鐃緒申��申鐃緒申 33 extern "C" {
+ 鐃緒申��申鐃緒申 34 #endif
+ 鐃緒申��申鐃緒申 35
+ 鐃緒申��申鐃緒申 36 /**
+ 鐃緒申��申鐃緒申 37 * Add an image to the store. The caller owns a reference
+ 鐃緒申��申鐃緒申 38 * to the image in the store, and must dereference the image
+ 鐃緒申��申鐃緒申 39 * with gaim_imgstore_unref for it to be freed.
+ 鐃緒申��申鐃緒申 40 *
+ 鐃緒申��申鐃緒申 41 * @param data Pointer to the image data.
+ 鐃緒申��申鐃緒申 42 * @param size Image data's size.
+ 鐃緒申��申鐃緒申 43 * @param filename Filename associated with image.
+ 鐃緒申��申鐃緒申 44
+ 鐃緒申��申鐃緒申 45 * @return ID for the image.
+ 鐃緒申��申鐃緒申 46 */
+ 鐃緒申��申鐃緒申 47 int gaim_imgstore_add(const void *data, size_t size, const char *filename);
+ 鐃緒申��申鐃緒申 48
+ 鐃緒申��申鐃緒申 49 /**
+ 鐃緒申��申鐃緒申 50 * Retrieve an image from the store. The caller does not own a
+ 鐃緒申��申鐃緒申 51 * reference to the image.
+ 鐃緒申��申鐃緒申 52 *
+ 鐃緒申��申鐃緒申 53 * @param id The ID for the image.
+ 鐃緒申��申鐃緒申 54 *
+ 鐃緒申��申鐃緒申 55 * @return A pointer to the requested image, or NULL if it was not found.
+ 鐃緒申��申鐃緒申 56 */
+ 鐃緒申��申鐃緒申 57 GaimStoredImage *gaim_imgstore_get(int id);
+ 鐃緒申��申鐃緒申 58
+ 鐃緒申��申鐃緒申 59 /**
8962
+ 鐃緒申��申鐃緒申 60 * Retrieves a pointer to the image's data.
+ 鐃緒申��申鐃緒申 61 *
+ 鐃緒申��申鐃緒申 62 * @param i The Image
+ 鐃緒申��申鐃緒申 63 *
+ 鐃緒申��申鐃緒申 64 * @return A pointer to the data, which must not
+ 鐃緒申��申鐃緒申 65 * be freed or modified.
+ 鐃緒申��申鐃緒申 66 */
+ 鐃緒申��申鐃緒申 67 gpointer gaim_imgstore_get_data(GaimStoredImage *i);
+ 鐃緒申��申鐃緒申 68
+ 鐃緒申��申鐃緒申 69 /**
+ 鐃緒申��申鐃緒申 70 * Retrieves the length of the image's data.
+ 鐃緒申��申鐃緒申 71 *
+ 鐃緒申��申鐃緒申 72 * @param i The Image
+ 鐃緒申��申鐃緒申 73 *
+ 鐃緒申��申鐃緒申 74 * @return The size of the data that the pointer returned by
+ 鐃緒申��申鐃緒申 75 * gaim_imgstore_get_data points to.
+ 鐃緒申��申鐃緒申 76 */
+ 鐃緒申��申鐃緒申 77 size_t gaim_imgstore_get_size(GaimStoredImage *i);
+ 鐃緒申��申鐃緒申 78
+ 鐃緒申��申鐃緒申 79 /**
+ 鐃緒申��申鐃緒申 80 * Retrieves a pointer to the image's filename.
+ 鐃緒申��申鐃緒申 81 *
+ 鐃緒申��申鐃緒申 82 * @param i The Image
+ 鐃緒申��申鐃緒申 83 *
+ 鐃緒申��申鐃緒申 84 * @return A pointer to the filename, which must not
+ 鐃緒申��申鐃緒申 85 * be freed or modified.
+ 鐃緒申��申鐃緒申 86 */
+ 鐃緒申��申鐃緒申 87 const char *gaim_imgstore_get_filename(GaimStoredImage *i);
+ 鐃緒申��申鐃緒申 88
+ 鐃緒申��申鐃緒申 89 /**
6982
+ 鐃緒申��申鐃緒申 90 * Increment the reference count for an image in the store. The
+ 鐃緒申��申鐃緒申 91 * image will be removed from the store when the reference count
+ 鐃緒申��申鐃緒申 92 * is zero.
+ 鐃緒申��申鐃緒申 93 *
+ 鐃緒申��申鐃緒申 94 * @param id The ID for the image.
+ 鐃緒申��申鐃緒申 95 */
+ 鐃緒申��申鐃緒申 96 void gaim_imgstore_ref(int id);
+ 鐃緒申��申鐃緒申 97
+ 鐃緒申��申鐃緒申 98 /**
+ 鐃緒申��申鐃緒申 99 * Decrement the reference count for an image in the store. The
+ 鐃緒申��申鐃緒申 100 * image will be removed from the store when the reference count
+ 鐃緒申��申鐃緒申 101 * is zero.
+ 鐃緒申��申鐃緒申 102 *
+ 鐃緒申��申鐃緒申 103 * @param id The ID for the image.
+ 鐃緒申��申鐃緒申 104 */
+ 鐃緒申��申鐃緒申 105 void gaim_imgstore_unref(int id);
+ 鐃緒申��申鐃緒申 106
+ 鐃緒申��申鐃緒申 107 #ifdef __cplusplus
+ 鐃緒申��申鐃緒申 108 }
+ 鐃緒申��申鐃緒申 109 #endif
+ 鐃緒申��申鐃緒申 110
9713
+ 鐃緒申��申鐃緒申 111 #endif /* _GAIM_IMGSTORE_H_ */