Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
concat_graphics.cpp File Reference
#include "concater.hpp"
#include "Boxes/graphics.hpp"
#include "drd_std.hpp"
#include "hashset.hpp"
#include "analyze.hpp"
#include "scheme.hpp"

Go to the source code of this file.

Defines

#define BEGIN_MAGNIFY
#define END_MAGNIFY

Functions

void notify_graphics_extents (tree t, point lbot, point rtop)
static tree protect_arrow (edit_env env, tree t)
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)
static void set_graphical_values (tree t)

Variables

hashmap< string, treegraphical_values (UNINIT)
hashset< stringgraphical_modified

Define Documentation

#define BEGIN_MAGNIFY
Value:
tree new_mag= as_string (env->magn * env->mgfy);              \
  tree old_mfy= env->local_begin (MAGNIFY, "1");                \
  tree old_mag= env->local_begin (MAGNIFICATION, new_mag);

Definition at line 19 of file concat_graphics.cpp.

#define END_MAGNIFY
Value:
env->local_end (MAGNIFICATION, old_mag);      \
  env->local_end (MAGNIFY, old_mfy);

Definition at line 24 of file concat_graphics.cpp.


Function Documentation

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:

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:

void notify_graphics_extents ( tree  t,
point  lbot,
point  rtop 
)

Definition at line 41 of file concat_graphics.cpp.

                                                         {
  static hashmap<string,tree> h (UNINIT);
  if (is_atomic (t)) {
    string id= t->label;
    tree val= tuple (as_string (lbot[0]), as_string (lbot[1]),
                     as_string (rtop[0]), as_string (rtop[1]));
    if (h[id] != val) {
      h (id)= val;
      array<object> args;
      args << object (id)
           << object (lbot[0]) << object (lbot[1])
           << object (rtop[0]) << object (rtop[1]);
      call ("graphics-notify-extents", args);
    }
  }
  else if (is_func (t, GRAPHICS) || is_func (t, GR_GROUP)) {
    for (int i=0; i<N(t); i++)
      notify_graphics_extents (t[i], lbot, rtop);
  }
  else if (is_func (t, LOCUS) || is_func (t, WITH)) {
    if (is_func (t, LOCUS, 2) &&
        is_func (t[0], ID, 1) &&
        is_atomic (t[0][0]) &&
        starts (t[0][0]->label, "graph-"))
      notify_graphics_extents (t[0][0], lbot, rtop);
    notify_graphics_extents (t[N(t)-1], lbot, rtop);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static tree protect_arrow ( edit_env  env,
tree  t 
) [static]

Definition at line 221 of file concat_graphics.cpp.

                                     {
  return tree (WITH, "arrow-begin", "none", "arrow-end", "none",
               "dash-style", "none", t);
}

Here is the caller graph for this function:

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:

static void set_graphical_values ( tree  t) [static]

Definition at line 385 of file concat_graphics.cpp.

                              {
  if (is_atomic (t));
  else if (is_func (t, WITH)) {
    for (int i=0; i<N(t)-1; i+=2)
      if (t[i] == GID && is_atomic (t[i+1]))
        set_graphical_value (t[i+1]->label, t[N(t)-1]);
    set_graphical_values (t[N(t)-1]);
  }
  else {
    for (int i=0; i<N(t); i++)
      set_graphical_values (t[i]);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 343 of file concat_graphics.cpp.