aboutsummaryrefslogtreecommitdiff
path: root/src/objects.c
diff options
context:
space:
mode:
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;