00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
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
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
00062 void set_xrefs(ht_tree *xrefs);
00063 void set_cursor(UINT cx, UINT cy);
00064 };
00065
00066
00067
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
00079 virtual UINT linecount();
00080
00081 void set_node(UINT ofs, UINT len);
00082 };
00083
00084
00085
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
00104 virtual void draw();
00105 virtual char *defaultpalette();
00106 virtual void get_pindicator_str(char *buf);
00107 virtual void handlemsg(htmsg *msg);
00108
00109 virtual bool gotonode(char *file, char *node);
00110 };
00111
00112 #endif