home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
x
/
xhyper10.zip
/
XHyper_v1.0
/
src
/
TextView.h
< prev
Wrap
C/C++ Source or Header
|
1992-12-08
|
4KB
|
105 lines
/*
* Copyright (c) 1992 U.S. Geological Survey (USGS)
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of USGS not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. USGS makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* USGS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL USGS
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifndef TextView_h
#define TextView_h
#include <InterViews/handler.h>
#include <InterViews/monoglyph.h>
#include <stdio.h>
class Color;
class Composition;
class Deck;
class FontTag;
class HyperViewer;
class Listener;
class ParaTag;
class Patch;
class TextInfo_List;
//
// *** text information list item
//
class TextInfo
{
public:
unsigned char _code;
unsigned char _tocindex;
};
class TextView : public MonoGlyph, public Handler
{
public:
TextView (HyperViewer*,char*,int); // constructor
~TextView (); // destructor
virtual void view_page(int); // changes currently view page
virtual void draw(Canvas*, const Allocation&)const;
// draws the current page
virtual void event(Event&); // catches mouse events
virtual void printout(); // generates PostScript
void jump_to(int); // jump to page with given offset
int last_page(); // jump to page with given offset
int Count(); // returns number of pages
const char* MMLFile(); // returns filename
int _numfont; // number of font tags
int _numpar; // number of paragraph tags
ParaTag* parlist[100]; // tag list
FontTag* fontlist[100]; // tag list
protected:
virtual void wordhit(GlyphIndex);
// processes mouse click for hypertext
virtual void read(FILE*); // reads a MML file
boolean parse_command(char*, FILE*);
// parses an MML command in <>
virtual void make_defaults(); // creates default tags
virtual void define(const char*, FILE*);
// defines a tag
virtual void fontstyle(const char*);
// changes font style (e.g. bold)
virtual void appendchar(const char);
// adds a character to list
private:
HyperViewer* _parent; // Controlling helpview instance
char* _home; // directory containing document
char* _file; // current document file
const Color* _fg; // foreground text color
const Color* _bg; // background text color
TextInfo_List* _text; // text information list
Patch* _patch; // main patch
Listener* _listener; // event listener
Composition* _lines; // lines of character glyphs
Composition* _characters; // character glyphs
Deck* _pages; // stack of pages
ParaTag* _partag; // current paragraph tag
FontTag* _fonttag; // current font tag
boolean _ishyper; // flag for defining hypertext
int _curpage; // currently viewed page
int _tocindex; // Table of contents index
};
#endif