comparison anagram/vaclgui/trfview.hpp @ 0:13d2b8934445

Import AnaGram (near-)release tree into Mercurial.
author David A. Holland
date Sat, 22 Dec 2007 17:52:45 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1997-2002 Parsifal Software. All Rights Reserved.
4 * See the file COPYING for license and usage terms.
5 *
6 * trfview.hpp
7 */
8
9 #ifndef TRFVIEW_HPP
10 #define TRFVIEW_HPP
11
12 #include "digset.hpp"
13 #include "fileview.hpp"
14 #include "ftpar.h"
15 #include "sparse.h"
16
17
18 class TraceFileView
19 : public FileView
20 {
21 public:
22 TraceFileView(IWindow *owner, text_file &file_, AgString);
23 ~TraceFileView();
24
25 int findMaxWidth();
26 ISize suggestSize();
27
28 virtual Boolean paintWindow(IPaintEvent &event);
29
30 int tableWidth;
31 virtual int charPosition(int xPos, AgString line);
32 virtual int xPosition(int charPos, AgString line);
33
34 cint getCursorLocation();
35
36 AgAction desynchAction;
37 AgAction resynchAction;
38
39 public:
40 TraceFileView &turnHighlightOff();
41 TraceFileView &turnHighlightOn(unsigned);
42 TraceFileView &refreshHighlight(cint oldLoc);
43 TraceFileView &step();
44 TraceFileView &parse();
45 void parseToCursor();
46 AgAction parseAction;
47 virtual void reload();
48
49 FtParser parser;
50 AgSparseIntArray reductionTable;
51 virtual Boolean findNext(AgString);
52 virtual Boolean findPrev(AgString);
53
54 protected:
55 Boolean mouseClicked(IMouseClickEvent &event);
56 Boolean virtualKeyPress(IKeyboardEvent &event);
57 Boolean mousePointerChange(IMousePointerEvent &event);
58 TraceFileView &parseLine(int ln, AgString, int, int);
59 int measureWidth(const char *);
60 TraceFileView &doLayout();
61 TraceFileView &refreshLines(int, int);
62
63 private:
64 int clickEnabled;
65 int doubleClickEnabled;
66 IFont windowFont;
67 AgStack<DigSetter::Dig> dig;
68 static DigSetter::Style displayStyle[4];
69 AgStack<DigSetter::Hole> hole;
70 DigSetter setter;
71 int activeHighlight;
72 cint beginHighlight;
73 cint endHighlight;
74 int topLine;
75 int margin;
76 int measure;
77 int enWidth;
78 int lineHeight;
79 int nDigs;
80 int nHoles;
81 int painting;
82 int charWidth[256];
83
84 AgNotificationAction<TraceFileView> dataColorChange;
85 void onColorChange() {refresh();}
86 AgNotificationAction<TraceFileView> fontChange;
87 void onFontChange();
88 };
89
90 #endif /* TRFVIEW_HPP */