diff 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
line wrap: on
line diff
--- a/src/imgstore.c	Mon May 17 04:39:14 2004 +0000
+++ b/src/imgstore.c	Mon May 17 06:47:20 2004 +0000
@@ -31,6 +31,20 @@
 static GSList *imgstore = NULL;
 static int nextid = 0;
 
+/**
+ * Stored image
+ *
+ * Represents a single IM image awaiting display and/or transmission.
+ * Now that this type is basicly private too, these two structs could
+ * probably be combined.
+ */
+struct _GaimStoredImage
+{
+	char *data;		/**< The image data.		*/
+	size_t size;		/**< The image data's size.	*/
+	char *filename;		/**< The filename (for the UI)	*/
+};
+
 typedef struct
 {
 	int id;
@@ -117,6 +131,18 @@
 	return priv->img;
 }
 
+gpointer gaim_imgstore_get_data(GaimStoredImage *i) {
+	return i->data;
+}
+
+size_t gaim_imgstore_get_size(GaimStoredImage *i) {
+	return i->size;
+}
+
+const char *gaim_imgstore_get_filename(GaimStoredImage *i) {
+	return i->filename;
+}
+
 void gaim_imgstore_ref(int id) {
 	GaimStoredImagePriv *priv = gaim_imgstore_get_priv(id);