aboutsummaryrefslogtreecommitdiff
path: root/src/source.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/source.h')
-rw-r--r--src/source.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/source.h b/src/source.h
index 6f051e3..80b1e81 100644
--- a/src/source.h
+++ b/src/source.h
@@ -4,6 +4,20 @@
#include <stdbool.h>
#include "bitmap.h"
+struct imv_source_message {
+ /* Pointer to sender of message */
+ struct imv_source *source;
+
+ /* User-supplied pointer */
+ void *user_data;
+
+ /* Receiver is responsible for destroying bitmap */
+ struct imv_bitmap *bitmap;
+
+ /* Error message if bitmap was NULL */
+ const char *error;
+};
+
/* Generic source of one or more bitmaps. Essentially a single image file */
struct imv_source {
/* usually the path of the image this is the source of */
@@ -41,6 +55,12 @@ struct imv_source {
*/
void (*free)(struct imv_source *src);
+ /* User-specified callback for returning messages */
+ void (*callback)(struct imv_source_message *message);
+
+ /* User-specified pointer, included in returned messages */
+ void *user_data;
+
/* Implementation private data */
void *private;
};