aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-09-11 22:45:22 +0200
committerThomas White <taw@bitwiz.org.uk>2014-09-11 22:45:46 +0200
commit71e298fd373d5afea429b88f83b8be677e1e2c83 (patch)
tree177901cf38204942f05270458784f2ea32dcefeb /src/frame.c
parent59c8ad0d099c1fdefcf7676458b70ecaf98f5fc9 (diff)
Factorise rendering pipeline a bit
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index 2906c40..9b3ab06 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -78,6 +78,29 @@ struct frame *frame_new()
}
+void renew_frame(struct frame *fr)
+{
+ int i;
+
+ if ( fr == NULL ) return;
+
+ for ( i=0; i<fr->n_lines; i++ ) {
+ // wrap_line_free(&fr->lines[i]);
+ }
+ free(fr->lines);
+ fr->lines = NULL;
+ fr->n_lines = 0;
+ fr->max_lines = 0;
+
+ if ( fr->boxes != NULL ) {
+ free(fr->boxes->boxes);
+ free(fr->boxes);
+ }
+ fr->boxes = malloc(sizeof(struct wrap_line));
+ initialise_line(fr->boxes);
+}
+
+
struct frame *add_subframe(struct frame *fr)
{
struct frame *n;