home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pstoedit.zip / source.zip / pstoedit.2.50 / src / drvwmf.h < prev    next >
C/C++ Source or Header  |  1996-12-23  |  3KB  |  108 lines

  1. /*
  2.    drvWMF.h : This file is part of pstoedit
  3.      Header-File for drvWMF.cpp
  4.  
  5.    Copyright (C) 1996 Jens Weber, wr@lzh1.lzh.de
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. */
  22.  
  23. #ifndef __drvwmf_h
  24. #define __drvwmf_h
  25. #include "drvbase.h"
  26.  
  27.  
  28. #define VZX 1.0 // JW
  29. #define VZY -1.0 // JW
  30.  
  31.  
  32.  
  33. struct DRVWMFSETUP {
  34.   long exit;
  35.     long info;
  36.     long draw_noPath;
  37.     long draw_noColor;
  38. //    long draw_digColor;
  39.     long draw_target;
  40.     enum targetType {to_META, to_WINDOW};
  41.     long draw_noFill;
  42.     long draw_noText;
  43.     long draw_noGraphic;
  44. //    long noLogPal;
  45.     char *pOutFileName;
  46.     char *pInFileName;
  47.     char wmf_options[100];
  48.     char *infile;
  49.     int enhanced;
  50.     int height, width;
  51.     int origin_x, origin_y;
  52.     int maxstatus, minstatus;
  53.  };
  54.  
  55. struct WmfPrivate; // forward to the internal data
  56.  
  57. #ifndef _BYTE_DEFINED
  58. typedef unsigned char BYTE;
  59. #endif
  60. class  TPoint;
  61.  
  62. class drvWMF : public drvbase {
  63.  
  64. private:
  65.  
  66.     void print_coords(TPoint *);
  67.     void drawPoly(int, TPoint *, int);
  68.  
  69. public:
  70.     drvWMF(ostream &, ostream &,float , char *, DRVWMFSETUP *);
  71.     ~drvWMF();
  72.  
  73. private:
  74.     WmfPrivate * pd; // the real private data
  75.  
  76.     long searchPalEntry(float, float, float);
  77.     void setColor(float, float, float);
  78. //    void setGrayLevel(const float grayLevel);
  79.  
  80.     int FetchFont (const char *pFontName, short int, short int);
  81.  
  82.     inline int transX(float k) {
  83.         int value=(int)((VZX*k + x_offset)*scale);
  84.         if(value<0) value=0;
  85.         return value;        };
  86.  
  87.     inline int transY(float k) {
  88.         int value=(int)((VZY*k + y_offset)*scale);
  89. //        int value=(int)((800 -k)*scale); // just for test
  90. //        if(value<0) value=0;
  91.         return value; }
  92.  
  93. public:
  94.     void show_polyline();
  95.     void show_polygon();
  96.  
  97.   // Abstrakte Funktionen aus drvbase
  98.     virtual void open_page();
  99.     virtual void close_page();
  100.     virtual void show_text(const TextInfo &);
  101.     virtual void show_rectangle(const float llx, const float lly, const float urx, const float ury);
  102.     virtual void show_path();
  103.  
  104. };
  105.  
  106.  
  107. #endif
  108.