Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
env.hpp File Reference
#include "vars.hpp"
#include "drd_info.hpp"
#include "gui.hpp"
#include "font.hpp"
#include "language.hpp"
#include "path.hpp"
#include "hashmap.hpp"
#include "boxes.hpp"
#include "url.hpp"
#include "Graphics/frame.hpp"
#include "link.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  edit_env_rep
class  edit_env

Defines

#define DECORATION   (-1)
#define Env_User   0
#define Env_Fixed   1
#define Env_Magnification   2
#define Env_Magnify   3
#define Env_Language   4
#define Env_Mode   5
#define Env_Info_Level   6
#define Env_Font   7
#define Env_Font_Size   8
#define Env_Index_Level   9
#define Env_Display_Style   10
#define Env_Math_Condensed   11
#define Env_Vertical_Pos   12
#define Env_Color   13
#define Env_Paragraph   14
#define Env_Page   15
#define Env_Page_Extents   16
#define Env_Preamble   17
#define Env_Geometry   18
#define Env_Frame   19
#define Env_Line_Width   20
#define Env_Grid   21
#define Env_Grid_Aspect   22
#define Env_Src_Style   23
#define Env_Src_Special   24
#define Env_Src_Compact   25
#define Env_Src_Close   26
#define Env_Point_Style   27
#define Env_Dash_Style   28
#define Env_Dash_Style_Unit   29
#define Env_Fill_Color   30
#define Env_Line_Arrows   31
#define Env_Text_At_Halign   32
#define Env_Text_At_Valign   33
#define STYLE_ANGULAR   0
#define STYLE_SCHEME   1
#define STYLE_LATEX   2
#define STYLE_FUNCTIONAL   3
#define SPECIAL_RAW   0
#define SPECIAL_FORMAT   1
#define SPECIAL_NORMAL   2
#define SPECIAL_MAXIMAL   3
#define COMPACT_ALL   0
#define COMPACT_INLINE_ARGS   1
#define COMPACT_INLINE_START   2
#define COMPACT_INLINE   3
#define COMPACT_NONE   4
#define CLOSE_MINIMAL   0
#define CLOSE_COMPACT   1
#define CLOSE_LONG   2
#define CLOSE_REPEAT   3
#define INACTIVE_INLINE_RECURSE   0
#define INACTIVE_INLINE_ONCE   1
#define INACTIVE_INLINE_ERROR   2
#define INACTIVE_BLOCK_RECURSE   3
#define INACTIVE_BLOCK_ONCE   4
#define INACTIVE_BLOCK_ERROR   5
#define INFO_NONE   0
#define INFO_MINIMAL   1
#define INFO_SHORT   2
#define INFO_DETAILED   3
#define INFO_PAPER   4
#define FILL_MODE_NOTHING   0
#define FILL_MODE_NONE   1
#define FILL_MODE_INSIDE   2
#define FILL_MODE_BOTH   3

Functions

 CONCRETE_NULL_CODE (edit_env)
tm_ostreamoperator<< (tm_ostream &out, edit_env env)
tree texmacs_exec (edit_env env, tree cmd)
void extract_format (tree fm, tree *r, int n)
tree load_inclusion (url u)
tree tree_extents (tree t)
bool is_percentage (tree t, string s)
bool is_percentage (tree t)
double as_percentage (tree t)
bool is_magnification (string s)
double get_magnification (string s)
int decode_alpha (string s)
void set_graphical_value (tree var, tree val)
bool has_graphical_value (tree var)
tree get_graphical_value (tree var)
bool graphics_needs_update ()
void graphics_require_update (tree var)
void graphics_notify_update (tree var)

Define Documentation

#define CLOSE_COMPACT   1

Definition at line 88 of file env.hpp.

#define CLOSE_LONG   2

Definition at line 89 of file env.hpp.

#define CLOSE_MINIMAL   0

Definition at line 87 of file env.hpp.

#define CLOSE_REPEAT   3

Definition at line 90 of file env.hpp.

#define COMPACT_ALL   0

Definition at line 81 of file env.hpp.

#define COMPACT_INLINE   3

Definition at line 84 of file env.hpp.

#define COMPACT_INLINE_ARGS   1

Definition at line 82 of file env.hpp.

#define COMPACT_INLINE_START   2

Definition at line 83 of file env.hpp.

#define COMPACT_NONE   4

Definition at line 85 of file env.hpp.

#define DECORATION   (-1)

Definition at line 26 of file env.hpp.

#define Env_Color   13

Definition at line 45 of file env.hpp.

#define Env_Dash_Style   28

Definition at line 60 of file env.hpp.

#define Env_Dash_Style_Unit   29

Definition at line 61 of file env.hpp.

#define Env_Display_Style   10

Definition at line 42 of file env.hpp.

#define Env_Fill_Color   30

Definition at line 62 of file env.hpp.

#define Env_Fixed   1

Definition at line 33 of file env.hpp.

#define Env_Font   7

Definition at line 39 of file env.hpp.

#define Env_Font_Size   8

Definition at line 40 of file env.hpp.

#define Env_Frame   19

Definition at line 51 of file env.hpp.

#define Env_Geometry   18

Definition at line 50 of file env.hpp.

#define Env_Grid   21

Definition at line 53 of file env.hpp.

#define Env_Grid_Aspect   22

Definition at line 54 of file env.hpp.

#define Env_Index_Level   9

Definition at line 41 of file env.hpp.

#define Env_Info_Level   6

Definition at line 38 of file env.hpp.

#define Env_Language   4

Definition at line 36 of file env.hpp.

#define Env_Line_Arrows   31

Definition at line 63 of file env.hpp.

#define Env_Line_Width   20

Definition at line 52 of file env.hpp.

#define Env_Magnification   2

Definition at line 34 of file env.hpp.

#define Env_Magnify   3

Definition at line 35 of file env.hpp.

#define Env_Math_Condensed   11

Definition at line 43 of file env.hpp.

#define Env_Mode   5

Definition at line 37 of file env.hpp.

#define Env_Page   15

Definition at line 47 of file env.hpp.

#define Env_Page_Extents   16

Definition at line 48 of file env.hpp.

#define Env_Paragraph   14

Definition at line 46 of file env.hpp.

#define Env_Point_Style   27

Definition at line 59 of file env.hpp.

#define Env_Preamble   17

Definition at line 49 of file env.hpp.

#define Env_Src_Close   26

Definition at line 58 of file env.hpp.

#define Env_Src_Compact   25

Definition at line 57 of file env.hpp.

#define Env_Src_Special   24

Definition at line 56 of file env.hpp.

#define Env_Src_Style   23

Definition at line 55 of file env.hpp.

#define Env_Text_At_Halign   32

Definition at line 64 of file env.hpp.

#define Env_Text_At_Valign   33

Definition at line 65 of file env.hpp.

#define Env_User   0

Definition at line 32 of file env.hpp.

#define Env_Vertical_Pos   12

Definition at line 44 of file env.hpp.

#define FILL_MODE_BOTH   3

Definition at line 112 of file env.hpp.

#define FILL_MODE_INSIDE   2

Definition at line 111 of file env.hpp.

#define FILL_MODE_NONE   1

Definition at line 110 of file env.hpp.

#define FILL_MODE_NOTHING   0

Definition at line 109 of file env.hpp.

#define INACTIVE_BLOCK_ERROR   5

Definition at line 97 of file env.hpp.

#define INACTIVE_BLOCK_ONCE   4

Definition at line 96 of file env.hpp.

#define INACTIVE_BLOCK_RECURSE   3

Definition at line 95 of file env.hpp.

#define INACTIVE_INLINE_ERROR   2

Definition at line 94 of file env.hpp.

#define INACTIVE_INLINE_ONCE   1

Definition at line 93 of file env.hpp.

#define INACTIVE_INLINE_RECURSE   0

Definition at line 92 of file env.hpp.

#define INFO_DETAILED   3

Definition at line 106 of file env.hpp.

#define INFO_MINIMAL   1

Definition at line 104 of file env.hpp.

#define INFO_NONE   0

Definition at line 103 of file env.hpp.

#define INFO_PAPER   4

Definition at line 107 of file env.hpp.

#define INFO_SHORT   2

Definition at line 105 of file env.hpp.

#define SPECIAL_FORMAT   1

Definition at line 77 of file env.hpp.

#define SPECIAL_MAXIMAL   3

Definition at line 79 of file env.hpp.

#define SPECIAL_NORMAL   2

Definition at line 78 of file env.hpp.

#define SPECIAL_RAW   0

Definition at line 76 of file env.hpp.

#define STYLE_ANGULAR   0

Definition at line 71 of file env.hpp.

#define STYLE_FUNCTIONAL   3

Definition at line 74 of file env.hpp.

#define STYLE_LATEX   2

Definition at line 73 of file env.hpp.

#define STYLE_SCHEME   1

Definition at line 72 of file env.hpp.


Function Documentation

double as_percentage ( tree  t)

Definition at line 286 of file env_length.cpp.

                       {
  return as_double (t->label (0, N (t->label) - 1)) / 100.0;
}

Here is the call graph for this function:

int decode_alpha ( string  s)

Definition at line 275 of file env_semantics.cpp.

                        {
  if (N(s) == 0) return 255;
  else if (s[N(s)-1] == '%')
    return (int) (2.55 * as_double (s (0, N(s)-1)));
  else return (int) (255.0 * as_double (s));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void extract_format ( tree  fm,
tree r,
int  n 
)

Definition at line 98 of file cell.cpp.

                                         {
  int i;
  for (i=0; i<n; i++) r[i]= tree (TFORMAT);
  if (!is_func (fm, TFORMAT)) return;
  for (i=0; i<N(fm); i++)
    if (is_func (fm[i], CWITH))
      if ((N(fm[i]) >= 2) &&
         (is_int (fm[i][0])) &&
         (is_int (fm[i][1])))
       {
         int k;
         int k1= as_int (fm[i][0]);
         int k2= as_int (fm[i][1]);
         tree u= fm[i] (2, N (fm[i]));
         if (k1>=0) k1--; else k1+=n;
         if (k2> 0) k2--; else k2+=n;
         if ((k1 >= n) || (k2 < 0)) continue;
         k1= max (k1, 0);
         k2= min (k2, n-1);
         for (k=k1; k<=k2; k++) r[k] << u;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 359 of file concat_graphics.cpp.

                               {
  ASSERT (has_graphical_value (var), "invalid graphical id");
  //cout << "Get " << var << " = " << graphical_values [var->label] << "\n";
  return graphical_values [var->label];
}

Here is the call graph for this function:

Here is the caller graph for this function:

double get_magnification ( string  s)

Definition at line 303 of file env_length.cpp.

                             {
  int i=0;
  double magn= 1.0, result;
  while (i<N(s)) {
    if (s[i]=='*') { i++; read_double (s, i, result); magn *= result; }
    else if (s[i]=='/') { i++; read_double (s, i, result); magn /= result; }
    else return magn;
  }
  return magn;
}

Here is the call graph for this function:

Definition at line 366 of file concat_graphics.cpp.

                         {
  return N(graphical_modified) > 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 378 of file concat_graphics.cpp.

                                  {
  if (is_atomic (var))
    graphical_modified->remove (var->label);
  //cout << "Reset " << var << ", " << N(graphical_modified) << "\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 371 of file concat_graphics.cpp.

                                   {
  if (is_atomic (var))
    graphical_modified->insert (var->label);
  //cout << "Set " << var << ", " << N(graphical_modified) << "\n";
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool has_graphical_value ( tree  var)

Definition at line 353 of file concat_graphics.cpp.

                               {
  //cout << "Has " << var << "?\n";
  return is_atomic (var) && graphical_values->contains (var->label);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_magnification ( string  s)

Definition at line 291 of file env_length.cpp.

                            {
  double result;
  if (N(s) == 0) return false;
  for (int i=0; i<N(s); /*nop*/) {
    if (s[i]=='*') { i++; read_double (s, i, result); }
    else if (s[i]=='/') { i++; read_double (s, i, result); }
    else return false;
  }
  return true;
}

Here is the call graph for this function:

bool is_percentage ( tree  t,
string  s 
)

Definition at line 273 of file env_length.cpp.

                                 {
  return
    is_atomic (t) &&
    ends (t->label, s) &&
    is_double (t->label (0, N (t->label) - 1));
}

Here is the call graph for this function:

bool is_percentage ( tree  t)

Definition at line 281 of file env_length.cpp.

                       {
  return is_percentage (t, "%");
}

Here is the call graph for this function:

Definition at line 143 of file tm_file.cpp.

                          {
  // url name= relative (base_file_name, file_name);
  string name_s= as_string (name);
  if (document_inclusions->contains (name_s))
    return document_inclusions [name_s];
  tree doc= extract_document (load_tree (name, "generic"));
  if (!is_func (doc, ERROR)) document_inclusions (name_s)= doc;
  return doc;
}

Here is the call graph for this function:

tm_ostream& operator<< ( tm_ostream out,
edit_env  env 
)

Definition at line 200 of file env.cpp.

                                            {
  return out << env->env;
}
void set_graphical_value ( tree  var,
tree  val 
)

Definition at line 346 of file concat_graphics.cpp.

                                         {
  //cout << "Set " << var << " := " << val << "\n";
  if (is_atomic (var))
    graphical_values (var->label)= val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

tree texmacs_exec ( edit_env  env,
tree  cmd 
)

Definition at line 159 of file env_exec.cpp.

                                      {
  // re-entrancy
  if (!is_nil (current_rewrite_env)) env= current_rewrite_env;
  return env->exec (cmd);
}

Here is the call graph for this function:

Definition at line 71 of file tm_button.cpp.

                        {
  drd_info drd ("none", std_drd);
  edit_env env= get_init_environment (doc, drd);
  tree t= extract (doc, "body");
  lazy lz= make_lazy (env, t, path ());
  format vf= make_query_vstream_width (array<line_item>(), array<line_item>());
  format rf= lz->query (LAZY_BOX, vf);
  SI w= ((format_vstream) rf)->width;
  box b= (box) lz->produce (LAZY_BOX, make_format_width (w));
  SI h= b->h ();
  w += env->get_length (PAGE_SCREEN_LEFT);
  w += env->get_length (PAGE_SCREEN_RIGHT);
  h += env->get_length (PAGE_SCREEN_TOP);
  h += env->get_length (PAGE_SCREEN_BOT);
  return tuple (as_tree ((w / (5*PIXEL)) + 1), as_tree ((h / (5*PIXEL)) + 1));
}

Here is the call graph for this function:

Here is the caller graph for this function: