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 / strut.h < prev    next >
C/C++ Source or Header  |  1992-12-08  |  2KB  |  90 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989, 1990, 1991 Stanford University
  3.  * Copyright (c) 1991 Silicon Graphics, Inc.
  4.  *
  5.  * Permission to use, copy, modify, distribute, and sell this software and 
  6.  * its documentation for any purpose is hereby granted without fee, provided
  7.  * that (i) the above copyright notices and this permission notice appear in
  8.  * all copies of the software and related documentation, and (ii) the names of
  9.  * Stanford and Silicon Graphics may not be used in any advertising or
  10.  * publicity relating to the software without the specific, prior written
  11.  * permission of Stanford and Silicon Graphics.
  12.  * 
  13.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  14.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  15.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  16.  *
  17.  * IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
  18.  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  19.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20.  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  21.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  22.  * OF THIS SOFTWARE.
  23.  */
  24.  
  25. /*
  26.  * Strut - filler glyph
  27.  */
  28.  
  29. #ifndef iv_strut_h
  30. #define iv_strut_h
  31.  
  32. #include <InterViews/glyph.h>
  33.  
  34. class Font;
  35.  
  36. class Strut : public Glyph {
  37. public:
  38.     Strut(
  39.         const Font*,
  40.         Coord natural = 0, Coord stretch = 0, Coord shrink = 0
  41.     );
  42.     virtual ~Strut();
  43.  
  44.     virtual void request(Requisition&) const;
  45.     virtual void allocate(Canvas*, const Allocation&, Extension&);
  46. private:
  47.     const Font* font_;
  48.     Coord natural_;
  49.     Coord stretch_;
  50.     Coord shrink_;
  51.     Coord height_;
  52.     float alignment_;
  53. };
  54.  
  55. class HStrut : public Glyph {
  56. public:
  57.     HStrut(
  58.         Coord right_bearing, Coord left_bearing = 0,
  59.         Coord natural = 0, Coord stretch = 0, Coord shrink = 0
  60.     );
  61.     virtual ~HStrut();
  62.  
  63.     virtual void request(Requisition&) const;
  64. private:
  65.     Coord left_bearing_;
  66.     Coord right_bearing_;
  67.     Coord natural_;
  68.     Coord stretch_;
  69.     Coord shrink_;
  70. };
  71.  
  72. class VStrut : public Glyph {
  73. public:
  74.     VStrut(
  75.         Coord ascent, Coord descent = 0,
  76.         Coord natural = 0, Coord stretch = 0, Coord shrink = 0
  77.     );
  78.     virtual ~VStrut();
  79.  
  80.     virtual void request(Requisition&) const;
  81. private:
  82.     Coord ascent_;
  83.     Coord descent_;
  84.     Coord natural_;
  85.     Coord stretch_;
  86.     Coord shrink_;
  87. };
  88.  
  89. #endif
  90.