Mercurial > pidgin.yaz
comparison src/imgstore.c @ 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 | 8bda65b88e49 |
comparison
equal
deleted
inserted
replaced
8961:92e061a1db10 | 8962:4ff4c34b7500 |
---|---|
28 #include <debug.h> | 28 #include <debug.h> |
29 #include <imgstore.h> | 29 #include <imgstore.h> |
30 | 30 |
31 static GSList *imgstore = NULL; | 31 static GSList *imgstore = NULL; |
32 static int nextid = 0; | 32 static int nextid = 0; |
33 | |
34 /** | |
35 * Stored image | |
36 * | |
37 * Represents a single IM image awaiting display and/or transmission. | |
38 * Now that this type is basicly private too, these two structs could | |
39 * probably be combined. | |
40 */ | |
41 struct _GaimStoredImage | |
42 { | |
43 char *data; /**< The image data. */ | |
44 size_t size; /**< The image data's size. */ | |
45 char *filename; /**< The filename (for the UI) */ | |
46 }; | |
33 | 47 |
34 typedef struct | 48 typedef struct |
35 { | 49 { |
36 int id; | 50 int id; |
37 int refcount; | 51 int refcount; |
115 gaim_debug(GAIM_DEBUG_INFO, "imgstore", "retrieved image id %d\n", priv->id); | 129 gaim_debug(GAIM_DEBUG_INFO, "imgstore", "retrieved image id %d\n", priv->id); |
116 | 130 |
117 return priv->img; | 131 return priv->img; |
118 } | 132 } |
119 | 133 |
134 gpointer gaim_imgstore_get_data(GaimStoredImage *i) { | |
135 return i->data; | |
136 } | |
137 | |
138 size_t gaim_imgstore_get_size(GaimStoredImage *i) { | |
139 return i->size; | |
140 } | |
141 | |
142 const char *gaim_imgstore_get_filename(GaimStoredImage *i) { | |
143 return i->filename; | |
144 } | |
145 | |
120 void gaim_imgstore_ref(int id) { | 146 void gaim_imgstore_ref(int id) { |
121 GaimStoredImagePriv *priv = gaim_imgstore_get_priv(id); | 147 GaimStoredImagePriv *priv = gaim_imgstore_get_priv(id); |
122 | 148 |
123 g_return_if_fail(priv != NULL); | 149 g_return_if_fail(priv != NULL); |
124 | 150 |