Back to index

texmacs  1.0.7.15
edit_typeset.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : edit_typeset.hpp
00004 * DESCRIPTION: the typeset structure for the mathematical editor
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef EDIT_TYPESET_H
00013 #define EDIT_TYPESET_H
00014 #include "env.hpp"
00015 #include "typesetter.hpp"
00016 #include "editor.hpp"
00017 #include "hashset.hpp"
00018 
00019 class document_rep;
00020 class edit_typeset_rep: virtual public editor_rep {
00021 protected:
00022   tree the_style;                         // document style
00023   hashmap<path,hashmap<string,tree> > cur; // environment at different paths
00024   hashmap<string,tree> pre;               // environment after styles
00025   hashmap<string,tree> init;              // environment changes w.r.t. style
00026   hashmap<string,tree> fin ;              // environment changes w.r.t. doc
00027   edit_env env;                           // the environment for typesetting
00028   typesetter ttt;                         // the (not) yet typesetted document
00029 
00030 protected:
00031   typesetter           get_typesetter ();
00032   tree                 get_style ();
00033   void                 set_style (tree t);
00034   hashmap<string,tree> get_init ();
00035   hashmap<string,tree> get_fin ();
00036   void                 set_init (hashmap<string,tree> init= tree ("?"));
00037   void                 add_init (hashmap<string,tree> init);
00038   void                 set_fin (hashmap<string,tree> fin);
00039   void                 set_base_name (url name);
00040 
00041 public:
00042   edit_typeset_rep ();
00043   ~edit_typeset_rep ();
00044   void clear_local_info ();
00045   void set_data (new_data data);
00046   void get_data (new_data& data);
00047 
00048   SI       as_length (string l);
00049   string   add_lengths (string l1, string l2);
00050   string   multiply_length (double x, string l);
00051   bool     is_length (string s);
00052   double   divide_lengths (string l1, string l2);
00053 
00054   void     drd_update ();
00055 #ifdef EXPERIMENTAL
00056   void     environment_update ();
00057 #endif
00058   bool     defined_at_cursor (string var_name);
00059   bool     defined_at_init (string var_name);
00060   bool     defined_in_init (string var_name);
00061   tree     get_env_value (string var_name, path p);
00062   tree     get_env_value (string var_name);
00063   tree     get_init_value (string var_name);
00064   string   get_env_string (string var_name);
00065   string   get_init_string (string var_name);
00066   int      get_env_int (string var_name);
00067   int      get_init_int (string var_name);
00068   double   get_env_double (string var_name);
00069   double   get_init_double (string var_name);
00070   language get_env_language ();
00071 
00072   tree     exec (tree t, hashmap<string,tree> env, bool expand_refs= true);
00073   tree     exec_texmacs (tree t, path p);
00074   tree     exec_texmacs (tree t);
00075   tree     exec_verbatim (tree t, path p);
00076   tree     exec_verbatim (tree t);
00077   tree     exec_html (tree t, path p);
00078   tree     exec_html (tree t);
00079   tree     exec_latex (tree t, path p);
00080   tree     exec_latex (tree t);
00081   tree     texmacs_exec (tree t);
00082 
00083   void     init_env (string var, tree by);
00084   void     init_default (string var);
00085   void     init_style ();
00086   void     init_style (string style);
00087   void     init_add_package (string package);
00088   void     init_remove_package (string package);
00089 
00090   void     typeset_style_use_cache (tree style);
00091   void     typeset_preamble ();
00092   void     typeset_prepare ();
00093   void     typeset_invalidate_env ();
00094   void     typeset_exec_until (path p);
00095   void     typeset_invalidate (path p);
00096   void     typeset_invalidate_all ();
00097   void     typeset (SI& x1, SI& y1, SI& x2, SI& y2);
00098 
00099   friend class tm_window_rep;
00100   friend class tm_server_rep;
00101 };
00102 
00103 #endif // defined EDIT_TYPESET_H