summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index ccfa0bd6..3971f24c 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -120,6 +120,8 @@ struct fz_alloc_context_s
void *(*malloc)(void *, unsigned int);
void *(*realloc)(void *, void *, unsigned int);
void (*free)(void *, void *);
+ void (*lock)(void *);
+ void (*unlock)(void *);
};
/* Default allocator */
@@ -376,6 +378,20 @@ void fz_free_context(fz_context *ctx);
void fz_new_aa_context(fz_context *ctx);
void fz_free_aa_context(fz_context *ctx);
+static inline void
+fz_lock(fz_context *ctx)
+{
+ if (ctx->alloc->lock)
+ ctx->alloc->lock(ctx->alloc->user);
+}
+
+static inline void
+fz_unlock(fz_context *ctx)
+{
+ if (ctx->alloc->unlock)
+ ctx->alloc->unlock(ctx->alloc->user);
+}
+
/*
* Basic runtime and utility functions
*/
@@ -737,9 +753,10 @@ enum {
void fz_new_store_context(fz_context *ctx, unsigned int max);
void fz_free_store_context(fz_context *ctx);
+fz_store *fz_store_keep(fz_context *ctx);
void fz_debug_store(fz_context *ctx);
-void *fz_keep_storable(fz_storable *);
+void *fz_keep_storable(fz_context *, fz_storable *);
void fz_drop_storable(fz_context *, fz_storable *);
void fz_store_item(fz_context *ctx, fz_obj *key, void *val, unsigned int itemsize);
@@ -921,7 +938,7 @@ fz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, i
fz_pixmap *fz_new_pixmap_with_rect(fz_context *ctx, fz_colorspace *, fz_bbox bbox);
fz_pixmap *fz_new_pixmap_with_rect_and_data(fz_context *ctx, fz_colorspace *, fz_bbox bbox, unsigned char *samples);
fz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *, int w, int h);
-fz_pixmap *fz_keep_pixmap(fz_pixmap *pix);
+fz_pixmap *fz_keep_pixmap(fz_context *ctx, fz_pixmap *pix);
void fz_drop_pixmap(fz_context *ctx, fz_pixmap *pix);
void fz_free_pixmap_imp(fz_context *ctx, fz_storable *pix);
void fz_clear_pixmap(fz_pixmap *pix);
@@ -1009,7 +1026,7 @@ struct fz_colorspace_s
};
fz_colorspace *fz_new_colorspace(fz_context *ctx, char *name, int n);
-fz_colorspace *fz_keep_colorspace(fz_colorspace *colorspace);
+fz_colorspace *fz_keep_colorspace(fz_context *ctx, fz_colorspace *colorspace);
void fz_drop_colorspace(fz_context *ctx, fz_colorspace *colorspace);
void fz_free_colorspace_imp(fz_context *ctx, fz_storable *colorspace);
@@ -1250,7 +1267,7 @@ struct fz_shade_s
float *mesh; /* [x y 0], [x y r], [x y t] or [x y c1 ... cn] */
};
-fz_shade *fz_keep_shade(fz_shade *shade);
+fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade);
void fz_drop_shade(fz_context *ctx, fz_shade *shade);
void fz_free_shade_imp(fz_context *ctx, fz_storable *shade);
void fz_debug_shade(fz_shade *shade);