aboutsummaryrefslogtreecommitdiff
path: root/src/objects.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-08-10 22:03:52 +0200
committerThomas White <taw@bitwiz.org.uk>2011-08-10 22:03:52 +0200
commit87d1c1c339768b8c9cde14e40b955e618ee4540f (patch)
treebae3f229a48a526f2f1d788cff3db204068e555f /src/objects.c
parent394b051daacb63c661dba0a8c57ec04ad1ae73cf (diff)
Plug in style and layout stuff to UI
Diffstat (limited to 'src/objects.c')
-rw-r--r--src/objects.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/objects.c b/src/objects.c
index cb921f3..6b99005 100644
--- a/src/objects.c
+++ b/src/objects.c
@@ -33,7 +33,7 @@
#include "objects.h"
-static struct object *new_object(enum objtype t)
+static struct object *new_object(enum objtype t, struct layout_element *le)
{
struct object *new;
@@ -43,9 +43,7 @@ static struct object *new_object(enum objtype t)
new->type = t;
new->empty = 1;
new->parent = NULL;
-
- new->layout = NULL;
- new->fontdesc = NULL;
+ new->le = NULL;
return new;
}
@@ -59,11 +57,12 @@ static void free_object(struct object *o)
}
-struct object *add_text_object(struct slide *s, double x, double y)
+struct object *add_text_object(struct slide *s, double x, double y,
+ struct layout_element *el, struct text_style *ts)
{
struct object *new;
- new = new_object(TEXT);
+ new = new_object(TEXT, el);
if ( add_object_to_slide(s, new) ) {
free_object(new);
return NULL;
@@ -76,6 +75,9 @@ struct object *add_text_object(struct slide *s, double x, double y)
new->text[0] = '\0';
new->text_len = 1;
new->insertion_point = 0;
+ new->style = ts;
+ new->layout = NULL;
+ new->fontdesc = NULL;
s->object_seq++;
@@ -127,6 +129,14 @@ void insert_text(struct object *o, char *t)
}
+void set_text_style(struct object *o, struct text_style *ts)
+{
+ assert(o->type == TEXT);
+ o->style = ts;
+ o->parent->object_seq++;
+}
+
+
static int find_prev_index(const char *t, int p)
{
int i, nback;