26 #if ! defined (octave_text_engine_h)
27 #define octave_text_engine_h 1
29 #include "octave-config.h"
41 class text_element_string;
42 class text_element_symbol;
43 class text_element_list;
44 class text_element_subscript;
45 class text_element_superscript;
46 class text_element_combined;
47 class text_element_fontname;
48 class text_element_fontsize;
49 class text_element_fontstyle;
50 class text_element_color;
95 enum { invalid_code = 0xFFFFFFFFU };
105 uint32_t get_symbol_code (
void)
const;
295 #define ASSIGN_COLOR(r,g,b) { rgb(0) = r; rgb(1) = g; rgb(2) = b; }
306 else if (cname ==
"lightBlue")
ASSIGN_COLOR(0.68, .85, .9)
333 el_p->accept (*
this);
361 #define TEXT_ELEMENT_ACCEPT(cls) \
363 cls::accept (text_processor& p) \
425 { destroy_lexer (); }
436 bool init_lexer (
const std::string& s);
438 void destroy_lexer (
void);
451 std::unique_ptr<text_parser>
parser;
462 #if defined (OCAVE_USE_DEPRECATED_FUNCTIONS)
464 OCTAVE_DEPRECATED (5,
"use 'octave::text_element' instead")
465 typedef
octave::text_element text_element;
467 OCTAVE_DEPRECATED (5, "use '
octave::text_element_string' instead")
468 typedef
octave::text_element_string text_element_string;
470 OCTAVE_DEPRECATED (5, "use '
octave::text_element_symbol' instead")
471 typedef
octave::text_element_symbol text_element_symbol;
473 OCTAVE_DEPRECATED (5, "use '
octave::text_element_list' instead")
474 typedef
octave::text_element_list text_element_list;
476 OCTAVE_DEPRECATED (5, "use '
octave::text_element_subscript' instead")
477 typedef
octave::text_element_subscript text_element_subscript;
479 OCTAVE_DEPRECATED (5, "use '
octave::text_element_superscript' instead")
480 typedef
octave::text_element_superscript text_element_superscript;
482 OCTAVE_DEPRECATED (5, "use '
octave::text_element_combined' instead")
483 typedef
octave::text_element_combined text_element_combined;
485 OCTAVE_DEPRECATED (5, "use '
octave::text_element_fontstyle' instead")
486 typedef
octave::text_element_fontstyle text_element_fontstyle;
488 OCTAVE_DEPRECATED (5, "use '
octave::text_element_fontname' instead")
489 typedef
octave::text_element_fontname text_element_fontname;
491 OCTAVE_DEPRECATED (5, "use '
octave::text_element_fontsize' instead")
492 typedef
octave::text_element_fontsize text_element_fontsize;
494 OCTAVE_DEPRECATED (5, "use '
octave::text_element_color' instead")
495 typedef
octave::text_element_color text_element_color;
497 OCTAVE_DEPRECATED (5, "use '
octave::text_processor' instead")
498 typedef
octave::text_processor text_processor;
500 OCTAVE_DEPRECATED (5, "use '
octave::text_parser' instead")
501 typedef
octave::text_parser text_parser;
503 OCTAVE_DEPRECATED (5, "use '
octave::text_parser_none' instead")
504 typedef
octave::text_parser_none text_parser_none;
506 OCTAVE_DEPRECATED (5, "use '
octave::text_parser_tex' instead")
507 typedef
octave::text_parser_tex text_parser_tex;
text_element_color(double r, double g, double b)
text_element_color(const std::string &cname)
~text_element_color(void)=default
text_element_combined(text_element *e)
text_element_combined(text_element *e1, text_element *e2)
~text_element_fontname(void)=default
text_element_fontname(void)
const std::string & get_fontname(void) const
text_element_fontname(const std::string &fname)
text_element_fontsize(double fsize)
text_element_fontsize(void)
double get_fontsize(void) const
~text_element_fontsize(void)=default
fontstyle get_fontstyle(void) const
text_element_fontstyle(fontstyle st)
~text_element_fontstyle(void)=default
text_element_fontstyle(void)
text_element_list(text_element *e)
text_element_string(const std::string &s="")
text_element_string(const text_element_string &)
std::string string_value(void) const
~text_element_string(void)=default
text_element * get_element(void)
text_element_subscript(text_element *e)
~text_element_subscript(void)
text_element_subscript(char c)
text_element_subscript(void)
text_element_superscript(void)
text_element_superscript(text_element *e)
text_element * get_element(void)
text_element_superscript(char c)
~text_element_superscript(void)
int get_symbol(void) const
text_element_symbol(int sym)
~text_element_symbol(void)=default
text_element(const text_element &)
virtual ~text_element(void)=default
virtual void accept(text_processor &p)=0
~text_parser_none(void)=default
text_element * parse(const std::string &s)
void set_parse_result(text_element *e)
text_element * get_parse_result(void)
virtual text_element * parse(const std::string &s)=0
virtual ~text_parser(void)=default
virtual void visit(text_element_list &e)
virtual void visit(text_element_fontname &)
virtual void visit(text_element_symbol &)
virtual ~text_processor(void)=default
virtual void visit(text_element_fontsize &)
virtual void visit(text_element_subscript &e)
virtual void visit(text_element_color &)
virtual void visit(text_element_fontstyle &)
virtual void visit(text_element_superscript &e)
virtual void visit(text_element_combined &)
virtual void visit(text_element_string &e)=0
#define TEXT_ELEMENT_ACCEPT(cls)
#define ASSIGN_COLOR(r, g, b)