Back to index

texmacs  1.0.7.15
tm_window.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : tm_window.hpp
00004 * DESCRIPTION: TeXmacs main data structures (buffers, views and windows)
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 TM_WINDOW_H
00013 #define TM_WINDOW_H
00014 #include "server.hpp"
00015 #include "tm_buffer.hpp"
00016 
00017 class tm_window_rep {
00018 public:
00019   widget win;
00020   widget wid;
00021   int    id;
00022 
00023 public:
00024   hashmap<tree,tree> props;
00025   int                serial;
00026   int                sfactor;       // the shrinking factor
00027 
00028 protected:
00029   hashmap<int,object>    menu_current;
00030   hashmap<object,widget> menu_cache;
00031   string*  text_ptr;  // where the interactive string is returned
00032   command  call_back; // called when typing finished
00033 
00034 public:
00035   tm_window_rep (widget wid2, tree geom);
00036   tm_window_rep (tree doc, command quit);
00037   ~tm_window_rep ();
00038   void set_window_name (string s);
00039   void set_window_url (url u);
00040   void map ();
00041   void unmap ();
00042   void refresh ();
00043   inline void set_property (scheme_tree what, scheme_tree val) {
00044     props (what)= val; }
00045   inline scheme_tree get_property (scheme_tree what) {
00046     return props [what]; }
00047 
00048   bool get_menu_widget (int which, string menu, widget& w);
00049   void menu_main (string menu);
00050   void menu_icons (int which, string menu);
00051   void side_tools (int which, string tools);
00052   void set_header_flag (bool flag);
00053   void set_icon_bar_flag (int which, bool flag);
00054   void set_side_tools_flag (int which, bool flag);
00055   bool get_header_flag ();
00056   bool get_icon_bar_flag (int which);
00057   bool get_side_tools_flag (int which);
00058 
00059   int  get_shrinking_factor ();
00060   void set_shrinking_factor (int sf);
00061   void get_visible (SI& x1, SI& y1, SI& x2, SI& y2);
00062   void get_extents (SI& x1, SI& y1, SI& x2, SI& y2);
00063   void set_extents (SI x1, SI y1, SI x2, SI y2);
00064   void set_scrollbars (int i);
00065   void get_scroll_pos (SI& x, SI& y);
00066   void set_scroll_pos (SI x, SI y);
00067 
00068   bool get_footer_flag ();
00069   void set_footer_flag (bool on);
00070   void set_left_footer (string s);
00071   void set_right_footer (string s);
00072   bool get_interactive_mode ();
00073   void set_interactive_mode (bool on);
00074   void interactive (string name, string type, array<string> def,
00075                   string& s, command cmd);
00076   void interactive_return ();
00077 };
00078 
00079 class tm_view_rep {
00080 public:
00081   tm_buffer buf;
00082   editor    ed;
00083   tm_window win;
00084   inline tm_view_rep (tm_buffer buf2, editor ed2):
00085     buf (buf2), ed (ed2), win (NULL) {}
00086 };
00087 
00088 typedef tm_buffer_rep* tm_buffer;
00089 typedef tm_view_rep*   tm_view;
00090 typedef tm_window_rep* tm_window;
00091 
00092 widget texmacs_output_widget (tree doc);
00093 widget texmacs_input_widget (tree doc, command cmd, bool continuous);
00094 
00095 int window_handle ();
00096 void window_create (int win, widget wid, string name, bool plain);
00097 void window_create (int win, widget wid, string name, command quit);
00098 void window_delete (int win);
00099 void window_show (int win);
00100 void window_hide (int win);
00101 void windows_delayed_refresh (int ms);
00102 void windows_refresh ();
00103 
00104 #endif // defined TM_WINDOW_H