Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

infoview.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      infoview.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef __INFOVIEW_H__
00022 #define __INFOVIEW_H__
00023 
00024 #include "textedit.h"
00025 #include "textfile.h"
00026 
00027 #define MAGIC_HT_HELP "$$HTHELP"
00028 
00029 /*
00030  *      CLASS info_node
00031  */
00032 
00033 class info_node: public Object {
00034 public:
00035         FILEOFS start;
00036         UINT len;
00037         ht_tree *xrefs;
00038         
00039         info_node(FILEOFS start);
00040         ~info_node();
00041 };
00042 
00043 /*
00044  *      CLASS ht_info_lexer
00045  */
00046 
00047 class ht_info_lexer: public ht_syntax_lexer {
00048 public:
00049         ht_tree *xrefs;
00050         UINT cx, cy;
00051         ht_view *pal_from;
00052         
00053                         void init(ht_view *pal_from);
00054 /* overwritten */
00055         virtual vcp getcolor_syntax(UINT pal_index);
00056         virtual lexer_state getinitstate();
00057         virtual lexer_token geterrortoken();
00058         virtual char *getname();
00059         virtual lexer_token gettoken(void *buf, UINT buflen, text_pos p, bool start_of_line, lexer_state *ret_state, UINT *ret_len);
00060         virtual vcp gettoken_color(lexer_token t);
00061 /* new */
00062                         void set_xrefs(ht_tree *xrefs);
00063                         void set_cursor(UINT cx, UINT cy);
00064 };
00065 
00066 /*
00067  *      CLASS ht_info_textfile
00068  */
00069  
00070 class ht_info_textfile: public ht_ltextfile {
00071 protected:
00072         UINT start, end;
00073 
00074         virtual ht_ltextfile_line *fetch_line(UINT line);
00075 public:
00076                         void    init(ht_streamfile *streamfile, bool own_streamfile, ht_syntax_lexer *lexer);
00077         virtual void done();
00078 /* overwritten */
00079         virtual UINT linecount();
00080 /* new */       
00081                         void set_node(UINT ofs, UINT len);
00082 };
00083 
00084 /*
00085  *      CLASS ht_info_viewer
00086  */
00087 
00088 class ht_info_viewer: public ht_text_viewer {
00089 protected:
00090         char *cwd;
00091         char *file;
00092         char *node;
00093         ht_tree *xrefs;
00094         ht_list *history;
00095 
00096                         int find_node(char *infofile, char *node);
00097                         ht_tree *get_xrefs();
00098                         bool igotonode(char *file, char *node, bool add2hist);
00099                         UINT readfile(char *fn, char **text);
00100 public:
00101                         void init(bounds *b);
00102         virtual void done();
00103 /* overwritten */
00104         virtual void draw();
00105         virtual char *defaultpalette();
00106         virtual void get_pindicator_str(char *buf);
00107         virtual void handlemsg(htmsg *msg);
00108 /* new */       
00109         virtual bool gotonode(char *file, char *node);
00110 };
00111 
00112 #endif /* __TEXTEDIT_H__ */

Generated on Fri May 7 21:15:40 2004 by doxygen 1.3.5