home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / g__lib / plotfile.h < prev    next >
C/C++ Source or Header  |  1993-07-23  |  3KB  |  84 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Doug Lea (dl@rocky.oswego.edu)
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY.  No author or distributor
  10. accepts responsibility to anyone for the consequences of using it
  11. or for whether it serves any particular purpose or works at all,
  12. unless he says so in writing.  Refer to the GNU CC General Public
  13. License for full details.
  14.  
  15. Everyone is granted permission to copy, modify and redistribute
  16. GNU CC, but only under the conditions described in the
  17. GNU CC General Public License.   A copy of this license is
  18. supposed to have been given to you along with GNU CC so you
  19. can know your rights and responsibilities.  It should be in a
  20. file named COPYING.  Among other things, the copyright notice
  21. and this notice must be preserved on all copies.  
  22. */
  23.  
  24. /* 
  25.    a very simple implementation of a class to output unix "plot"
  26.    format plotter files. See corresponding unix man pages for
  27.    more details. 
  28. */
  29.  
  30. #ifndef _PlotFile_h
  31. #pragma once
  32. #define _PlotFile_h
  33.  
  34. #include <File.h>
  35.  
  36. /*   
  37.    Some plot libraries have the `box' command to draw boxes. Some don't.
  38.    `box' is included here via moves & lines to allow both possiblilties.
  39. */
  40.  
  41.  
  42. class PlotFile : private File
  43. {
  44. protected:
  45.   PlotFile& cmd(char c);
  46.   PlotFile& operator << (int x);
  47.   PlotFile& operator << (char *s); 
  48.  
  49. public:
  50.             File::open;      File::close;     File::raw;       
  51.             File::remove;    File::filedesc;  File::is_open;
  52.             File::iocount;   File::error;     File::name;
  53.             File::setname;   File::rdstate;   File::put;
  54.             File::eof;       File::fail;      File::bad;
  55.             File::good;      File::clear;     File::failif;
  56.             File::setbuf;    File::writable;  File::readable;
  57.  
  58.             PlotFile();
  59.             PlotFile(const char* filename, io_mode m, access_mode a);
  60.             PlotFile(const char* filename, const char* m);
  61.             PlotFile(int filedesc, io_mode m = io_writeonly);
  62.             PlotFile(FILE* fileptr);
  63.  
  64.            ~PlotFile();
  65.  
  66.   void*     operator void*();
  67.  
  68.   PlotFile& arc(int xi, int yi, int x0, int y0, int x1, int y1);
  69.   PlotFile& box(int x0, int y0, int x1, int y1);
  70.   PlotFile& circle(int x, int y, int r);
  71.   PlotFile& cont(int xi, int yi);
  72.   PlotFile& dot(int xi, int yi, int dx, int n, int* pat);
  73.   PlotFile& erase(); 
  74.   PlotFile& label(char* s);
  75.   PlotFile& line(int x0, int y0, int x1, int y1);
  76.   PlotFile& linemod(char* s);
  77.   PlotFile& move(int xi, int yi);
  78.   PlotFile& point(int xi, int yi);
  79.   PlotFile& space(int x0, int y0, int x1, int y1);
  80. };
  81.  
  82.  
  83. #endif
  84.