File: drvasy.h

package info (click to toggle)
pstoedit 3.75-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,132 kB
  • sloc: cpp: 28,684; sh: 4,510; perl: 4,154; ansic: 1,014; java: 860; makefile: 442
file content (92 lines) | stat: -rw-r--r-- 2,268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef __drvASY_h
#define __drvASY_h

/* 
   drvasy.h : This file is part of pstoedit
   Backend for Asymptote files
   Contributed by: John Bowman

   Copyright (C) 1993 - 2020 Wolfgang Glunz, wglunz35_AT_pstoedit.net

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/



#include "drvbase.h"


#ifdef HAVE_STL
#include <string>        // C++ string class
#include <list>
#else
typedef RSString string;
#endif

class drvASY : public drvbase {

public:

  derivedConstructor(drvASY);

  ~drvASY() override; // Destructor
  class DriverOptions : public ProgramOptions {
  public:
    DriverOptions() {}
  }*options;

#include "drvfuncs.h"
  void show_text(const TextInfo & textinfo) override;
  void show_image(const PSImage & imageinfo) override;
  
  void ClipPath(cliptype) override;
  void Save() override;
  void Restore() override;

private:
  void print_coords();
  void save();
  void restore();
  // Previous values of graphics state variables
  std::string prevFontName;
  std::string prevFontWeight;
  float prevR, prevG, prevB;
  float prevFontAngle;
  float prevFontSize;
  float prevLineWidth;
  unsigned int prevLineCap;
  unsigned int prevLineJoin;
  std::string prevDashPattern;

  // Set to true for fill or eofill, false for stroke
  bool fillmode;
  // Set to true for clip or eoclip, false otherwise
  bool clipmode;
  // Set to true for eofill or eoclip, false otherwise
  bool evenoddmode;
  // Set to true on first page, false otherwise
  bool firstpage;
  
  int imgcount;
  
  unsigned int level;
  // gsave nesting level
  
  std::list<bool> clipstack;
  std::list<bool> gsavestack;
};

#endif