summaryrefslogtreecommitdiff
path: root/src/Postscript.H
blob: b598d542bea055e6ab97c25ee1880044e8880b51 (plain)
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
//
// Copyright 2007-2009 Johannes Hofmann <Johannes.Hofmann@gmx.de>
//
// This software may be used and distributed according to the terms
// of the GNU General Public License, incorporated herein by reference.

#ifndef POSTSCRIPT_H
#define POSTSCRIPT_H

#include <stdio.h>
#include "PSEditModel.H"

class PSParser {
	protected:
		PSEditModel *pse;

		int cur_size;

		PSEditColor cur_text_color;

		int page;

	public: 
		PSParser(PSEditModel *p);
		virtual ~PSParser() {};

		virtual int parse(char *line);
};

class PSParser_2 : public PSParser {
	private:
		int inside;

	public:
		PSParser_2(PSEditModel *p);

		int parse(char *line);
};

class PSWriter {
	protected:
		PSEditModel *pse;

		char * pos_format;

		char * size_format;

		char * text_format;

		char * color_format;

		char * glyph_format;

		char * tag_format;

		void write_string(FILE *out, char *s);

		void write_main_block(FILE *out);

		void write_internal_format(FILE *out);

		int write_text(FILE *out, PSEditText *t);

		virtual char *ps_header();

		virtual char *ps_trailer();

	public: 
		PSWriter(PSEditModel *p);
		virtual ~PSWriter() {};

		int write(FILE *in, FILE *out);
};

class PSLevel1Writer : public PSWriter {
	protected:
		char *ps_header();

		char *ps_trailer();

	public:
		PSLevel1Writer(PSEditModel *p);
};

#endif