aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-11-30 09:49:01 +0100
committerThomas White <taw@bitwiz.org.uk>2012-11-30 09:49:01 +0100
commitf6fefa99ea3a9a71d5803931cec403db845f767a (patch)
tree1331f00024cbede9245b993efa9e501dbca42405 /src
parent1392eda7d12dc4ad6a75c794fcb21e494c12c0aa (diff)
WIP on rendering
Diffstat (limited to 'src')
-rw-r--r--src/frame.h33
-rw-r--r--src/layout.h70
-rw-r--r--src/mainwindow.c1
-rw-r--r--src/presentation.h2
-rw-r--r--src/render.c3
-rw-r--r--src/render.h2
-rw-r--r--src/stylesheet.h3
7 files changed, 36 insertions, 78 deletions
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 <pango/pango.h>
-#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 <taw@bitwiz.org.uk>
- *
- * 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 <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef LAYOUT_H
-#define LAYOUT_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#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 <cairo.h>
#include <gtk/gtk.h>
-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 <taw@bitwiz.org.uk>
+ * Copyright (c) 2012 Thomas White <taw@bitwiz.org.uk>
*
* 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