diff src/request.h @ 11357:f0bc5f121684

[gaim-migrate @ 13579] Image field added to the request API. committer: Tailor Script <tailor@pidgin.im>
author Bartoz Oler <bartosz@pidgin.im>
date Sun, 28 Aug 2005 22:16:17 +0000
parents 07dc8c6a359f
children b858f992b566
line wrap: on
line diff
--- a/src/request.h	Sun Aug 28 21:43:47 2005 +0000
+++ b/src/request.h	Sun Aug 28 22:16:17 2005 +0000
@@ -58,6 +58,7 @@
 	GAIM_REQUEST_FIELD_CHOICE,
 	GAIM_REQUEST_FIELD_LIST,
 	GAIM_REQUEST_FIELD_LABEL,
+	GAIM_REQUEST_FIELD_IMAGE,
 	GAIM_REQUEST_FIELD_ACCOUNT
 
 } GaimRequestFieldType;
@@ -161,6 +162,14 @@
 
 		} account;
 
+		struct
+		{
+			unsigned int scale_x;
+			unsigned int scale_y;
+			const char *buffer;
+			gsize size;
+		} image;
+
 	} u;
 
 	void *ui_data;
@@ -952,6 +961,61 @@
 /*@}*/
 
 /**************************************************************************/
+/** @name Image Field API                                                 */
+/**************************************************************************/
+/*@{*/
+
+/**
+ * Creates an image field.
+ *
+ * @param id   The field ID.
+ * @param text The label of the field.
+ * @param path Path to the image to be displayed.
+ *
+ * @return The new field.
+ */
+GaimRequestField *gaim_request_field_image_new(const char *id, const char *text,
+											   const char *buf, gsize size);
+
+/**
+ * Returns pointer to the image.
+ *
+ * @param field The image field.
+ *
+ * @return Pointer to the image.
+ */
+const char *gaim_request_field_image_get_buffer(GaimRequestField *field);
+
+/**
+ * Returns size (in bytes) of the image.
+ *
+ * @param field The image field.
+ *
+ * @return Size of the image.
+ */
+gsize gaim_request_field_image_get_size(GaimRequestField *field);
+
+/**
+ * Returns X scale coefficient of the image.
+ *
+ * @param field The image field.
+ *
+ * @return X scale coefficient of the image.
+ */
+unsigned int gaim_request_field_image_get_scale_x(GaimRequestField *field);
+
+/**
+ * Returns Y scale coefficient of the image.
+ *
+ * @param field The image field.
+ *
+ * @return Y scale coefficient of the image.
+ */
+unsigned int gaim_request_field_image_get_scale_y(GaimRequestField *field);
+
+/*@}*/
+
+/**************************************************************************/
 /** @name Account Field API                                               */
 /**************************************************************************/
 /*@{*/