Mercurial > pidgin.yaz
comparison src/imgstore.h @ 8962:4ff4c34b7500
[gaim-migrate @ 9736]
IM Image, WYSIWYG.
It's still somewhat buggy, although the worse problems are with oscar's
direct connect. We could always yank oscar's im image flag if we think it
will cause too many bug reports.
I made the GaimImgstore struct opque.
I modified oscar's sending function to parse im images better, and
everything seems to work. I made it write some errors to the conversation
if you try to send an image and you aren't direct connected. That's just
a hack until you can set formatting flags on a per conversation bases.
There's a scrolling bug I haven't tracked down. I think it may exist
normally and this just causes it better.
It's worth noting jabber also uses this for pics in profiles, although
I never did find a test case. Hopefully some other stuff can use this
soon too, maybe Yahoo! pics in profiles or something.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Mon, 17 May 2004 06:47:20 +0000 |
parents | fa6395637e2c |
children | db62420a53a2 |
comparison
equal
deleted
inserted
replaced
8961:92e061a1db10 | 8962:4ff4c34b7500 |
---|---|
24 * | 24 * |
25 */ | 25 */ |
26 #ifndef _GAIM_CONV_IMGSTORE_H_ | 26 #ifndef _GAIM_CONV_IMGSTORE_H_ |
27 #define _GAIM_CONV_IMGSTORE_H_ | 27 #define _GAIM_CONV_IMGSTORE_H_ |
28 | 28 |
29 /** | 29 struct _GaimStoredImage; |
30 * Stored image | 30 typedef struct _GaimStoredImage GaimStoredImage; |
31 * | |
32 * Represents a single IM image awaiting display and/or transmission. | |
33 */ | |
34 typedef struct | |
35 { | |
36 char *data; /**< The image data. */ | |
37 size_t size; /**< The image data's size. */ | |
38 char *filename; /**< The filename (for the UI) */ | |
39 } GaimStoredImage; | |
40 | 31 |
41 #ifdef __cplusplus | 32 #ifdef __cplusplus |
42 extern "C" { | 33 extern "C" { |
43 #endif | 34 #endif |
44 | 35 |
64 * @return A pointer to the requested image, or NULL if it was not found. | 55 * @return A pointer to the requested image, or NULL if it was not found. |
65 */ | 56 */ |
66 GaimStoredImage *gaim_imgstore_get(int id); | 57 GaimStoredImage *gaim_imgstore_get(int id); |
67 | 58 |
68 /** | 59 /** |
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 /** | |
69 * Increment the reference count for an image in the store. The | 90 * Increment the reference count for an image in the store. The |
70 * image will be removed from the store when the reference count | 91 * image will be removed from the store when the reference count |
71 * is zero. | 92 * is zero. |
72 * | 93 * |
73 * @param id The ID for the image. | 94 * @param id The ID for the image. |