1 
2 /******************************************************************************
3 * MODULE     : tm_frame.hpp
4 * DESCRIPTION: Routines for main TeXmacs frames
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 TM_FRAME_H
13 #define TM_FRAME_H
14 #include "server.hpp"
15 
16 class tm_frame_rep: virtual public server_rep {
17 protected:
18   bool full_screen;        // full screen mode
19   bool full_screen_edit;   // full screen edit mode
20   widget dialogue_win;     // dialogue window
21   widget dialogue_wid;     // dialogue widget
22 
23 public:
24   tm_frame_rep ();
25   ~tm_frame_rep ();
26 
27   /* properties */
28   int get_window_serial ();
29   void set_window_property (scheme_tree what, scheme_tree val);
30   void set_bool_window_property (string what, bool val);
31   void set_int_window_property (string what, int val);
32   void set_string_window_property (string what, string val);
33   scheme_tree get_window_property (scheme_tree what);
34   bool get_bool_window_property (string what);
35   int get_int_window_property (string what);
36   string get_string_window_property (string what);
37 
38   /* menus */
39   void show_header (bool flag);
40   void show_icon_bar (int which, bool flag);
41   void show_side_tools (int which, bool flag);
42   void show_bottom_tools (int which, bool flag);
43   bool visible_header ();
44   bool visible_icon_bar (int which);
45   bool visible_side_tools (int which);
46   bool visible_bottom_tools (int which);
47   void menu_widget (string menu, widget& w);
48   void menu_main (string menu);
49   void menu_icons (int which, string menu);
50   void side_tools (int which, string menu);
51   void bottom_tools (int which, string menu);
52 
53   /* canvas */
54   void set_window_zoom_factor (double zoom);
55   double get_window_zoom_factor ();
56   void set_scrollbars (int sb);
57   void get_visible (SI& x1, SI& y1, SI& x2, SI& y2);
58   void scroll_where (SI& x, SI& y);
59   void scroll_to (SI x, SI y);
60   void set_extents (SI x1, SI y1, SI x2, SI y2);
61   void get_extents (SI& x1, SI& y1, SI& x2, SI& y2);
62   void full_screen_mode (bool on, bool edit);
63   bool in_full_screen_mode ();
64   bool in_full_screen_edit_mode ();
65 
66   /* footer */
67   void show_footer (bool flag);
68   bool visible_footer ();
69   void set_left_footer (string s);
70   void set_right_footer (string s);
71   void set_message (tree left, tree right, bool temp= false);
72   void recall_message ();
73   void dialogue_start (string name, widget wid);
74   void dialogue_inquire (int i, string& arg);
75   void dialogue_end ();
76   void choose_file (object fun, string title, string type,
77 		    string prompt, url name);
78   void interactive (object fun, scheme_tree p);
79 };
80 
81 widget box_widget (box b, bool trans);
82 widget box_widget (scheme_tree p, string s, color col,
83 		   bool trans= true, bool ink= false);
84 
85 #endif // defined TM_FRAME_H
86