Back to index

texmacs  1.0.7.15
tm_buffer.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : tm_buffer.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_BUFFER_H
00013 #define TM_BUFFER_H
00014 #include "new_data.hpp"
00015 #include "new_buffer.hpp"
00016 
00017 class tm_buffer_rep;
00018 class tm_view_rep;
00019 typedef tm_buffer_rep* tm_buffer;
00020 typedef tm_view_rep*   tm_view;
00021 
00022 extern tree the_et;
00023 path new_document ();
00024 void delete_document (path rp);
00025 void set_document (path rp, tree t);
00026 int  create_window_id ();
00027 void destroy_window_id (int);
00028 
00029 class tm_buffer_rep {
00030 public:
00031   new_buffer buf;         // file related information
00032   new_data data;          // data associated to document
00033   array<tm_view> vws;     // views attached to buffer
00034   tm_buffer prj;          // buffer which corresponds to the project
00035   path rp;                // path to the document's root in the_et
00036 
00037   inline tm_buffer_rep (url name):
00038     buf (name), data (),
00039     vws (0), prj (NULL), rp (new_document ()) {}
00040 
00041   inline ~tm_buffer_rep () {
00042     delete_document (rp); }
00043 
00044   bool needs_to_be_saved ();
00045   bool needs_to_be_autosaved ();
00046 };
00047 
00048 #endif // defined TM_BUFFER_H