Tue, 30 Sep 2003 18:41:28 +0000
[gaim-migrate @ 7643]
robot101 gave us images in notify_formatted windows. very cool. This lets what I committed earlier (which was support for images in jabber vcards) to work.
| 6982 | 1 | /** |
| 2 | * @file imgstore.h IM Image Store API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Copyright (C) 2003 Robert McQueen <robot101@debian.org> | |
| 8 | * | |
| 9 | * This program is free software; you can redistribute it and/or modify | |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with this program; if not, write to the Free Software | |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 22 | * | |
| 23 | */ | |
| 24 | #ifndef _GAIM_IMGSTORE_H_ | |
| 25 | #define _GAIM_IMGSTORE_H_ | |
| 26 | ||
| 27 | /** | |
| 28 | * Stored image | |
| 29 | * | |
| 30 | * Represents a single IM image awaiting display and/or transmission. | |
| 31 | */ | |
| 32 | typedef struct | |
| 33 | { | |
| 34 | char *data; /**< The image data. */ | |
| 35 | size_t size; /**< The image data's size. */ | |
| 36 | char *filename; /**< The filename (for the UI) */ | |
| 37 | } GaimStoredImage; | |
| 38 | ||
| 39 | #ifdef __cplusplus | |
| 40 | extern "C" { | |
| 41 | #endif | |
| 42 | ||
| 43 | /** | |
| 44 | * Add an image to the store. The caller owns a reference | |
| 45 | * to the image in the store, and must dereference the image | |
| 46 | * with gaim_imgstore_unref for it to be freed. | |
| 47 | * | |
| 48 | * @param data Pointer to the image data. | |
| 49 | * @param size Image data's size. | |
| 50 | * @param filename Filename associated with image. | |
| 51 | ||
| 52 | * @return ID for the image. | |
| 53 | */ | |
| 54 | int gaim_imgstore_add(const void *data, size_t size, const char *filename); | |
| 55 | ||
| 56 | /** | |
| 57 | * Retrieve an image from the store. The caller does not own a | |
| 58 | * reference to the image. | |
| 59 | * | |
| 60 | * @param id The ID for the image. | |
| 61 | * | |
| 62 | * @return A pointer to the requested image, or NULL if it was not found. | |
| 63 | */ | |
| 64 | GaimStoredImage *gaim_imgstore_get(int id); | |
| 65 | ||
| 66 | /** | |
| 67 | * Increment the reference count for an image in the store. The | |
| 68 | * image will be removed from the store when the reference count | |
| 69 | * is zero. | |
| 70 | * | |
| 71 | * @param id The ID for the image. | |
| 72 | */ | |
| 73 | void gaim_imgstore_ref(int id); | |
| 74 | ||
| 75 | /** | |
| 76 | * Decrement the reference count for an image in the store. The | |
| 77 | * image will be removed from the store when the reference count | |
| 78 | * is zero. | |
| 79 | * | |
| 80 | * @param id The ID for the image. | |
| 81 | */ | |
| 82 | void gaim_imgstore_unref(int id); | |
| 83 | ||
| 84 | #ifdef __cplusplus | |
| 85 | } | |
| 86 | #endif | |
| 87 | ||
| 88 | #endif /* _GAIM_IMGSTORE_H_ */ |