aboutsummaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-03-28 17:03:01 +0200
committerThomas White <taw@bitwiz.org.uk>2016-03-28 17:03:01 +0200
commit3087709f11b05b943c20436c9c64a09e09223208 (patch)
tree7e0efd326aa4f06685724b04ab836ba606a9bbbd /src/frame.h
parenteb4c2a335c5b6c0b534330021effc7f3efbf1dc4 (diff)
Basic renderer using PangoLayouts
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h40
1 files changed, 27 insertions, 13 deletions
diff --git a/src/frame.h b/src/frame.h
index 8b1a645..99e5df4 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,7 +1,7 @@
/*
* frame.h
*
- * Copyright © 2013-2015 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2016 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -31,6 +31,7 @@
#include <cairo.h>
#include "sc_parse.h"
+#include "sc_interp.h"
typedef enum
@@ -47,6 +48,7 @@ typedef enum
GRAD_VERT
} GradientType;
+typedef struct _paragraph Paragraph;
struct frame
{
@@ -55,16 +57,10 @@ struct frame
int max_children;
SCBlock *scblocks;
- struct boxvec *boxes; /* The unwrapped boxes */
- int visited;
- int n_paragraphs;
- struct boxvec **paragraphs;
- int *paragraph_start_lines;
-
- int n_lines;
- int max_lines;
- struct wrap_line *lines;
+ Paragraph **paras;
+ int n_paras;
+ int max_paras;
/* The font which will be used by default for this frame */
PangoFontDescription *fontdesc;
@@ -94,9 +90,6 @@ struct frame
/* True if this frame can be resized and moved */
int resizable;
-
- /* True if wrapping failed for this frame */
- int trouble;
};
@@ -108,4 +101,25 @@ extern void delete_subframe(struct frame *top, struct frame *fr);
extern struct frame *find_frame_with_scblocks(struct frame *top,
SCBlock *scblocks);
+extern double total_height(struct frame *fr);
+
+extern Paragraph *last_open_para(struct frame *fr);
+extern void close_last_paragraph(struct frame *fr);
+
+extern PangoLayout *paragraph_layout(Paragraph *para);
+extern double paragraph_height(Paragraph *para);
+
+extern void add_run(Paragraph *para, SCBlock *scblock, size_t offs_bytes,
+ size_t len_bytes, PangoFontDescription *fdesc, int eop);
+
+extern void add_callback_para(struct frame *fr, double w, double h,
+ SCCallbackDrawFunc draw_func,
+ SCCallbackClickFunc click_func, void *bvp,
+ void *vp);
+
+extern void add_image_para(struct frame *fr, const char *filename,
+ double w, double h, int editable);
+
+extern void wrap_paragraph(Paragraph *para, PangoContext *pc, double w);
+
#endif /* FRAME_H */