home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / src / Length.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-02  |  1.5 KB  |  58 lines

  1. /* Length.h
  2.  *
  3.  * The official LaTeX length parameters are implemented here. They control
  4.  * variables such as the paragraph indentation and the space to skip between
  5.  * lines.
  6.  *
  7.  * Copyright 1992 Jonathan Monsarrat. Permission given to freely distribute,
  8.  * edit and use as long as this copyright statement remains intact.
  9.  *
  10.  */
  11.  
  12. const MAXLENGTHPARAMS = 100;
  13. class Length;
  14. // The class for the official LaTeX Length variables,
  15. // plus any user-defined ones.
  16. class LengthParam {
  17.    float _value;
  18.    char *_tokentext;
  19.    Length *_parent;
  20.  public:
  21.    LengthParam(LengthParam *, Length *);
  22.    LengthParam(float, char *, Length *);
  23.    ~LengthParam();
  24.    void set(float);
  25.    float get();
  26.    static int compare(const void *, const void *);
  27.    void revert(Length *);
  28.    void postscript_set();
  29.    int match(char *);
  30. };
  31.  
  32. // The official LaTeX Length variables are stored here
  33. class Length : public Param {
  34.  public:
  35.    enum LengthTypes {
  36.       Parameter,
  37.       Parse_Length
  38.    };
  39.    Length();
  40.    Length(Length *);
  41.    ~Length();
  42.    Param *copy();
  43.    void revert(Param *);
  44.    void addtolength(int, int, float, char *);
  45.    void newlength(int, int, float, char *);
  46.    void setlength(int, int, float, char *);
  47.    float length_argument();
  48.    LengthParam **fetch(char *);
  49.  private:
  50.    LengthParam *values[MAXLENGTHPARAMS];
  51.    int set(int, float, char*);
  52.    float get(int, char*);
  53.    void postscript_set(int);
  54.    void makeparam(float, char *);
  55.    void set_lp(LengthParam *, float);
  56.    int numvalues;
  57. };
  58.