aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-04-22 22:06:42 +0200
committerThomas White <taw@bitwiz.org.uk>2016-04-22 22:06:42 +0200
commit044b25bb359c4b3254b947ca34a1491f5eb9f901 (patch)
tree0fe851a5bfdaf6552c7ea0b07450be3446861944 /src/frame.c
parent2c85156b2bc8b68502b47c250bd4902ff6449c95 (diff)
Add SCBlock to image and callback paragraphs
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/frame.c b/src/frame.c
index f275baf..744f85d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -64,6 +64,9 @@ struct _paragraph
PangoLayout *layout;
size_t offset_last;
+ /* For anything other than PARA_TYPE_TEXT */
+ SCBlock *scblock;
+
/* For PARA_TYPE_IMAGE */
char *filename;
double image_w;
@@ -419,7 +422,7 @@ static Paragraph *insert_paragraph(struct frame *fr, int pos)
}
-void add_callback_para(struct frame *fr, double w, double h,
+void add_callback_para(struct frame *fr, SCBlock *bl, double w, double h,
SCCallbackDrawFunc draw_func,
SCCallbackClickFunc click_func, void *bvp,
void *vp)
@@ -433,6 +436,7 @@ void add_callback_para(struct frame *fr, double w, double h,
}
pnew->type = PARA_TYPE_CALLBACK;
+ pnew->scblock = bl;
pnew->cb_w = w;
pnew->cb_h = h;
pnew->draw_func = draw_func;
@@ -444,7 +448,7 @@ void add_callback_para(struct frame *fr, double w, double h,
}
-void add_image_para(struct frame *fr, const char *filename,
+void add_image_para(struct frame *fr, SCBlock *scblock, const char *filename,
double w, double h, int editable)
{
Paragraph *pnew;
@@ -456,6 +460,7 @@ void add_image_para(struct frame *fr, const char *filename,
}
pnew->type = PARA_TYPE_IMAGE;
+ pnew->scblock = scblock;
pnew->filename = strdup(filename);
pnew->image_w = w;
pnew->image_h = h;