1 
2 /******************************************************************************
3 * MODULE     : edit_graphics.hpp
4 * DESCRIPTION: the interface for TeXmacs
5 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
6 *******************************************************************************
7 * This software falls under the GNU general public license version 3 or later.
8 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10 ******************************************************************************/
11 
12 #ifndef EDIT_GRAPHICS_H
13 #define EDIT_GRAPHICS_H
14 #include "editor.hpp"
15 #include "timer.hpp"
16 
17 class edit_graphics_rep: virtual public editor_rep {
18 private:
19   box go_box;           // The graphical object typesetted as a box
20   double gr_x, gr_y;    // Last (x, y) position of the mouse
21   gr_selections gs;     // Last graphical_select (x, y)
22   grid gr0;             // Last grid
23 
24 protected:
25   point cur_pos;
26   tree graphical_object;
27 
28 public:
29   edit_graphics_rep ();
30   ~edit_graphics_rep ();
31 
32   path   graphics_path ();
33   bool   inside_graphics (bool b);
34   bool   inside_active_graphics (bool b);
35   bool   over_graphics (SI x, SI y);
36   tree   get_graphics ();
37   double get_x ();
38   double get_y ();
39   frame  find_frame (bool last= false);
40   grid   find_grid ();
41   void   find_limits (point& lim1, point& lim2);
42   bool   find_graphical_region (SI& x1, SI& y1, SI& x2, SI& y2);
43   point  adjust (point p);
44   tree   find_point (point p);
45   tree   graphical_select (double x, double y);
46   tree   graphical_select (double x1, double y1, double x2, double y2);
47   tree   get_graphical_object ();
48   void   set_graphical_object (tree t);
49   void   invalidate_graphical_object ();
50   void   draw_graphical_object (renderer ren);
51   bool   mouse_graphics (string s, SI x, SI y, int mods, time_t t);
52   void   back_in_text_at (tree t, path p, bool forward);
53 };
54 
55 #endif // defined EDIT_GRAPHICS_H
56