diff 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
line wrap: on
line diff
--- a/src/imgstore.h	Mon May 17 04:39:14 2004 +0000
+++ b/src/imgstore.h	Mon May 17 06:47:20 2004 +0000
@@ -26,17 +26,8 @@
 #ifndef _GAIM_CONV_IMGSTORE_H_
 #define _GAIM_CONV_IMGSTORE_H_
 
-/**
- * Stored image
- *
- * Represents a single IM image awaiting display and/or transmission.
- */
-typedef struct
-{
-	char *data;		/**< The image data.		*/
-	size_t size;		/**< The image data's size.	*/
-	char *filename;		/**< The filename (for the UI)	*/
-} GaimStoredImage;
+struct _GaimStoredImage;
+typedef struct _GaimStoredImage GaimStoredImage;
 
 #ifdef __cplusplus
 extern "C" {
@@ -66,6 +57,36 @@
 GaimStoredImage *gaim_imgstore_get(int id);
 
 /**
+ * Retrieves a pointer to the image's data.
+ *
+ * @param i	The Image
+ *
+ * @return A pointer to the data, which must not
+ *         be freed or modified.
+ */
+gpointer gaim_imgstore_get_data(GaimStoredImage *i);
+
+/**
+ * Retrieves the length of the image's data.
+ *
+ * @param i	The Image
+ *
+ * @return The size of the data that the pointer returned by
+ *         gaim_imgstore_get_data points to.
+ */
+size_t gaim_imgstore_get_size(GaimStoredImage *i);
+
+/**
+ * Retrieves a pointer to the image's filename.
+ *
+ * @param i	The Image
+ *
+ * @return A pointer to the filename, which must not
+ *         be freed or modified.
+ */
+const char *gaim_imgstore_get_filename(GaimStoredImage *i);
+
+/**
  * Increment the reference count for an image in the store. The
  * image will be removed from the store when the reference count
  * is zero.