Back to index

texmacs  1.0.7.15
bridge_hidden.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : bridge_hidden.cpp
00004 * DESCRIPTION: Bridge between logical and physical local enviroment changes
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 #include "bridge.hpp"
00013 
00014 class bridge_hidden_rep: public bridge_rep {
00015 protected:
00016   bridge body;
00017 
00018 public:
00019   bridge_hidden_rep (typesetter ttt, tree st, path ip);
00020 
00021   void notify_assign (path p, tree u);
00022   bool notify_macro  (int type, string var, int level, path p, tree u);
00023   void notify_change ();
00024 
00025   void my_typeset (int desired_status);
00026 };
00027 
00028 bridge_hidden_rep::bridge_hidden_rep (typesetter ttt, tree st, path ip):
00029   bridge_rep (ttt, st, ip) {}
00030 
00031 bridge
00032 bridge_hidden (typesetter ttt, tree st, path ip) {
00033   //cout << "Construct " << st << "\n";
00034   return tm_new<bridge_hidden_rep> (ttt, st, ip);
00035 }
00036 
00037 /******************************************************************************
00038 * Event notification
00039 ******************************************************************************/
00040 
00041 void
00042 bridge_hidden_rep::notify_assign (path p, tree u) {
00043   //cout << "Assign " << p << ", " << u << " in " << st << "\n";
00044   status= CORRUPTED;
00045   st= substitute (st, p, u);
00046 }
00047 
00048 bool
00049 bridge_hidden_rep::notify_macro (int tp, string var, int l, path p, tree u) {
00050   //cout << "Notify macro in " << st << "\n";
00051   (void) tp; (void) p; (void) u;
00052   bool flag= env->depends (st, var, l);
00053   if (flag) status= CORRUPTED;
00054   return flag;
00055 }
00056 
00057 void
00058 bridge_hidden_rep::notify_change () {
00059   //cout << "Notify change in " << st << "\n";
00060   status= CORRUPTED;
00061 }
00062 
00063 /******************************************************************************
00064 * Typesetting
00065 ******************************************************************************/
00066 
00067 void
00068 bridge_hidden_rep::my_typeset (int desired_status) {
00069   (void) desired_status;
00070   stack_border temp_sb;
00071   array<page_item> temp_l=
00072     typeset_stack (env, st, ip, ttt->a, ttt->b, temp_sb);
00073   int i=0, n= N(temp_l);
00074   for (i=0; i<n; i++)
00075     if (temp_l[i]->type != PAGE_CONTROL_ITEM) {
00076       box b= temp_l[i]->b;
00077       temp_l[i]->type= PAGE_HIDDEN_ITEM;
00078       temp_l[i]->b   = resize_box (ip, b, b->x1, 0, b->x2, 0);
00079       temp_l[i]->spc = space (0, 0, 0);
00080     }
00081   ttt->l = temp_l;
00082   ttt->sb= temp_sb; // stack_border ();
00083   //ttt->insert_stack (temp_l, temp_sb);
00084 }