From f6fefa99ea3a9a71d5803931cec403db845f767a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 30 Nov 2012 09:49:01 +0100 Subject: WIP on rendering --- src/frame.h | 33 ++++++++++++++++++++++++- src/layout.h | 70 ------------------------------------------------------ src/mainwindow.c | 1 - src/presentation.h | 2 -- src/render.c | 3 ++- src/render.h | 2 +- src/stylesheet.h | 3 +-- 7 files changed, 36 insertions(+), 78 deletions(-) delete mode 100644 src/layout.h (limited to 'src') diff --git a/src/frame.h b/src/frame.h index 8c1797f..80072a2 100644 --- a/src/frame.h +++ b/src/frame.h @@ -29,7 +29,38 @@ #include -#include "layout.h" + +typedef enum +{ + DIR_NONE, + DIR_UL, + DIR_U, + DIR_UR, + DIR_R, + DIR_DR, + DIR_D, + DIR_DL, + DIR_L +} Direction; + + +struct layout_parameters +{ + double margin_l; + double margin_r; + double margin_t; + double margin_b; + + double pad_l; + double pad_r; + double pad_t; + double pad_b; + + Direction grav; + + double min_w; + double min_h; +}; struct frame diff --git a/src/layout.h b/src/layout.h deleted file mode 100644 index d037157..0000000 --- a/src/layout.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * layout.h - * - * Colloquium - A tiny presentation program - * - * Copyright (c) 2012 Thomas White - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -#ifndef LAYOUT_H -#define LAYOUT_H - -#ifdef HAVE_CONFIG_H -#include -#endif - - -struct frame; - - -typedef enum -{ - DIR_NONE, - DIR_UL, - DIR_U, - DIR_UR, - DIR_R, - DIR_DR, - DIR_D, - DIR_DL, - DIR_L -} Direction; - - -struct layout_parameters -{ - double margin_l; - double margin_r; - double margin_t; - double margin_b; - - double pad_l; - double pad_r; - double pad_t; - double pad_b; - - Direction grav; - - double min_w; - double min_h; -}; - - -/* Calculate layout for frame (and all its children) based on size */ -extern void layout_frame(struct frame *fr, double w, double h); - -#endif /* LAYOUT_H */ diff --git a/src/mainwindow.c b/src/mainwindow.c index e36be11..a97dd29 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -535,7 +535,6 @@ static gint add_furniture(GtkWidget *widget, struct presentation *p) fr->style = sty; set_edit(p, p->cur_edit_slide); fr->sc = "Hello"; - layout_frame(p->cur_edit_slide->top, p->slide_width, p->slide_height); set_selection(p, fr); rerender_slide(p, p->pc); redraw(p); diff --git a/src/presentation.h b/src/presentation.h index 415147f..c43cb9a 100644 --- a/src/presentation.h +++ b/src/presentation.h @@ -30,8 +30,6 @@ #include #include -struct frame; -#include "layout.h" #include "stylesheet.h" struct slide diff --git a/src/render.c b/src/render.c index d7b46ec..6cd1f05 100644 --- a/src/render.c +++ b/src/render.c @@ -3,7 +3,7 @@ * * Colloquium - A tiny presentation program * - * Copyright (c) 2011 Thomas White + * Copyright (c) 2012 Thomas White * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include "stylesheet.h" #include "presentation.h" #include "frame.h" +#include "render.h" struct renderstuff diff --git a/src/render.h b/src/render.h index 4bc47f2..d2f8388 100644 --- a/src/render.h +++ b/src/render.h @@ -29,7 +29,7 @@ #include "presentation.h" -extern int render_sc(const char *sc, cairo_t *cr, double w, double h); +extern int render_sc(struct frame *fr, cairo_t *cr, double w, double h); extern int render_frame(struct frame *fr, cairo_t *cr); diff --git a/src/stylesheet.h b/src/stylesheet.h index 82f198d..deb1b08 100644 --- a/src/stylesheet.h +++ b/src/stylesheet.h @@ -28,9 +28,8 @@ #endif -struct frame; -#include "layout.h" #include "loadsave.h" +#include "frame.h" struct style -- cgit v1.2.3