diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/anagram/vaclgui/trfview.hpp	Sat Dec 22 17:52:45 2007 -0500
@@ -0,0 +1,90 @@
+/*
+ * AnaGram, A System for Syntax Directed Programming
+ * Copyright 1997-2002 Parsifal Software. All Rights Reserved.
+ * See the file COPYING for license and usage terms.
+ *
+ * trfview.hpp
+ */
+
+#ifndef TRFVIEW_HPP
+#define TRFVIEW_HPP
+
+#include "digset.hpp"
+#include "fileview.hpp"
+#include "ftpar.h"
+#include "sparse.h"
+
+
+class TraceFileView
+  : public FileView
+{
+public:
+  TraceFileView(IWindow *owner, text_file &file_, AgString);
+  ~TraceFileView();
+
+  int findMaxWidth();
+  ISize suggestSize();
+
+  virtual Boolean paintWindow(IPaintEvent &event);
+
+  int tableWidth;
+  virtual int charPosition(int xPos, AgString line);
+  virtual int xPosition(int charPos, AgString line);
+
+  cint getCursorLocation();
+
+  AgAction desynchAction;
+  AgAction resynchAction;
+
+public:
+  TraceFileView &turnHighlightOff();
+  TraceFileView &turnHighlightOn(unsigned);
+  TraceFileView &refreshHighlight(cint oldLoc);
+  TraceFileView &step();
+  TraceFileView &parse();
+  void parseToCursor();
+  AgAction parseAction;
+  virtual void reload();
+
+  FtParser parser;
+  AgSparseIntArray reductionTable;
+  virtual Boolean  findNext(AgString);
+  virtual Boolean  findPrev(AgString);
+
+protected:
+  Boolean mouseClicked(IMouseClickEvent &event);
+  Boolean virtualKeyPress(IKeyboardEvent &event);
+  Boolean mousePointerChange(IMousePointerEvent &event);
+  TraceFileView &parseLine(int ln, AgString, int, int);
+  int measureWidth(const char *);
+  TraceFileView &doLayout();
+  TraceFileView &refreshLines(int, int);
+
+private:
+  int clickEnabled;
+  int doubleClickEnabled;
+  IFont windowFont;
+  AgStack<DigSetter::Dig> dig;
+  static DigSetter::Style displayStyle[4];
+  AgStack<DigSetter::Hole> hole;
+  DigSetter setter;
+  int  activeHighlight;
+  cint beginHighlight;
+  cint endHighlight;
+  int topLine;
+  int margin;
+  int measure;
+  int enWidth;
+  int lineHeight;
+  int nDigs;
+  int nHoles;
+  int painting;
+  int charWidth[256];
+
+  AgNotificationAction<TraceFileView> dataColorChange;
+  void onColorChange() {refresh();}
+  AgNotificationAction<TraceFileView> fontChange;
+  void onFontChange();
+};
+
+#endif /* TRFVIEW_HPP */