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
/
Tag.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-12-08
|
5KB
|
144 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 SimpleTag_h
#define SimpleTag_h
#include <stdio.h>
class Font;
class FontFamily;
class TextView;
/*-----------------------------------------------------------------------
The following classes define specific MML definition for fonts of
paragraphs.
-----------------------------------------------------------------------*/
//
// *** class of available font families
//
class FontFamilyInfo
{
public:
char* _name; // name of font famile (e.g. Times)
FontFamily* _family; // font family member
};
//
// *** list available fonts
//
class FontList
{
public:
Font* _font; // pointer to Font type
char* _font_name; // font name and style
int _pts; // size of font
};
//
// *** simple tag class
//
class SimpleTag
{
public:
SimpleTag(); // constructor
SimpleTag(const char*, const char*, Coord); // constructor
SimpleTag(const char*, const char*, int); // constructor
~SimpleTag(); // destructor
const char* Id(); // returns name of tag
const char* Class();
protected:
friend class TextView; // allow access from text view
virtual void getid(const char*); // parse line for tag ID
virtual void getline(FILE*, char*); // retrieve line from file
virtual void Define(FILE*); // define the tag
Coord _rvalue; // float value
int _ivalue; // integer value
char* _id; // ID string
char* _class; // class string
};
//
// *** Font tag class
//
class FontTag : public SimpleTag
{
public:
FontTag(const char*, int); // constructor
FontTag(const char*, FILE*); // constructor
~FontTag(); // destructor
Font* font(); // return Font pointer
const char* Name(); // returns font name
int Points(); // return size
int index(); // returns font list index
protected:
virtual void findfont(FILE*); // defines font
int lookup_font(const char*, int);
// finds font in list
int _index; // index in font list
};
//
// *** Paragraph Tag class
//
class ParaTag : public SimpleTag
{
public:
ParaTag(const char*); // constructor
ParaTag(const char*, FILE*, TextView*); // constructor
~ParaTag(); // destructor
FontTag* fonttag(); // returns font definition
protected:
friend class TextView; // allows access from Text View
virtual void setalign(char*); // defines alignment variables
virtual void define(FILE*, TextView*);// define Tag
virtual void discretionaries(); // defines discret. variables
char* _alignment; // alignment string
boolean _hypertext; // if hypertext tag
FontTag* _font; // Font tag pointer
float _after; // Space after paragraph
float _before; // Space before paragraph
float _first; // First Line Indent
float _leading; // Interline spacing
float _left; // Left indent
Glyph* _begin_line_strut;
Glyph* _end_line_strut;
Glyph* _begin_par_strut;
Glyph* _end_par_strut;
Glyph* _line_strut;
Glyph* _fil_strut;
Glyph* _hyphen;
Glyph* _interline_glue;
Glyph* _interpar_glue;
Glyph* _hfil_glue;
Glyph* _hfill_glue;
Glyph* _vfil_glue;
Glyph* _word_space;
};
#endif