From 64a96164b0a793c8f6dd9f204018ebb54d0e025e Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 17 Jun 2005 16:20:42 +0000 Subject: initial color support initial color support --- src/PSEditModel.cxx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/PSEditModel.cxx') diff --git a/src/PSEditModel.cxx b/src/PSEditModel.cxx index 8792414..e0028ce 100644 --- a/src/PSEditModel.cxx +++ b/src/PSEditModel.cxx @@ -1,5 +1,5 @@ // -// "$Id: PSEditModel.cxx,v 1.13 2005/02/28 17:56:51 hofmann Exp $" +// "$Id: PSEditModel.cxx,v 1.14 2005/06/17 18:20:42 hofmann Exp $" // // PSEditWidget routines. // @@ -79,10 +79,11 @@ void PSEditModel::clear() { } } -void PSEditModel::new_text(int x1, int y1, const char *s, int size, int p) { +void PSEditModel::new_text(int x1, int y1, const char *s, + int size, int p, PSEditColor *c) { set_page(p); - cur_text = new PSEditText(x1, y1, s, size); + cur_text = new PSEditText(x1, y1, s, size, c); if (text[p]) { text[p]->append(cur_text); } else { @@ -169,6 +170,23 @@ int PSEditModel::get_size() { } } +void PSEditModel::set_color(PSEditColor *c) { + if (cur_text) { + cur_text->text_color.set(c->r, c->g, c->b); + } +} + +int PSEditModel::get_color(PSEditColor *c) { + if (cur_text) { + c->set(cur_text->text_color.r, + cur_text->text_color.g, + cur_text->text_color.b); + return 0; + } else { + return -1; + } +} + int PSEditModel::get_max_pages() { return max_pages; -- cgit v1.2.3