Back to index

texmacs  1.0.7.15
composite.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : composite.hpp
00004 * DESCRIPTION: composite boxes
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 COMPOSITE_H
00013 #define COMPOSITE_H
00014 #include "boxes.hpp"
00015 #include "array.hpp"
00016 
00017 /******************************************************************************
00018 * Composite boxes
00019 ******************************************************************************/
00020 
00021 struct composite_box_rep: public box_rep {
00022   array<box> bs;  // the children
00023   path lip, rip;  // left-most and right-most inverse paths
00024 
00025   composite_box_rep (path ip);
00026   composite_box_rep (path ip, array<box> bs);
00027   composite_box_rep (path ip, array<box> bs, bool init_sx_sy);
00028   composite_box_rep (path ip, array<box> bs, array<SI> x, array<SI> y);
00029   ~composite_box_rep ();
00030 
00031   void    insert (box b, SI x, SI y);
00032   void    position ();
00033   void    left_justify ();
00034   void    finalize ();
00035 
00036   int     subnr ();
00037   box     subbox (int i);
00038   void    display (renderer ren);
00039 
00040   virtual int             find_child (SI x, SI y, SI delta, bool force);
00041   virtual path            find_box_path (SI x, SI y, SI delta, bool force);
00042   virtual path            find_lip ();
00043   virtual path            find_rip ();
00044   virtual path            find_box_path (path p, bool& found);
00045   virtual path            find_tree_path (path bp);
00046   virtual cursor          find_cursor (path bp);
00047   virtual selection       find_selection (path lbp, path rbp);
00048   virtual gr_selections   graphical_select (SI x, SI y, SI dist);
00049   virtual gr_selections   graphical_select (SI x1, SI y1, SI x2, SI y2);
00050 
00051   virtual tree action (tree t, SI x, SI y, SI delta);
00052   virtual void loci (SI x, SI y, SI delta, list<string>& ids, rectangles& rs);
00053   virtual bool access_allowed ();
00054   virtual void collect_page_numbers (hashmap<string,tree>& h, tree page);
00055   virtual path find_tag (string name);
00056 
00057   virtual box  transform (frame fr);
00058 };
00059 
00060 struct concrete_composite_box_rep: public composite_box_rep {
00061   bool border_flag;
00062   concrete_composite_box_rep (
00063     path ip, array<box> bs, array<SI> x, array<SI> y, bool bfl):
00064       composite_box_rep (ip, bs, x, y), border_flag (bfl) { finalize (); }
00065   concrete_composite_box_rep (path ip, array<box> bs, bool bfl):
00066     composite_box_rep (ip, bs, true), border_flag (bfl) { finalize (); }
00067   operator tree () { return tree ("composite"); }
00068   int find_child (SI x, SI y, SI delta, bool force);
00069 };
00070 
00071 #endif // defined COMPOSITE_H