~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipemodel/ipelatex_p.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// --------------------------------------------------------------------
 
3
// Latex source to PDF converter
 
4
// --------------------------------------------------------------------
 
5
/*
 
6
 
 
7
    This file is part of the extensible drawing editor Ipe.
 
8
    Copyright (C) 1993-2004  Otfried Cheong
 
9
 
 
10
    Ipe is free software; you can redistribute it and/or modify it
 
11
    under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    As a special exception, you have permission to link Ipe with the
 
16
    CGAL library and distribute executables, as long as you follow the
 
17
    requirements of the Gnu General Public License in regard to all of
 
18
    the software in the executable aside from CGAL.
 
19
 
 
20
    Ipe is distributed in the hope that it will be useful, but WITHOUT
 
21
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
22
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
23
    License for more details.
 
24
 
 
25
    You should have received a copy of the GNU General Public License
 
26
    along with Ipe; if not, you can find it at
 
27
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
 
28
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 
 
30
*/
 
31
 
 
32
#ifndef PDFLATEX_P_H
 
33
#define PDFLATEX_P_H
 
34
 
 
35
#include "ipepage.h"
 
36
#include "ipetext.h"
 
37
 
 
38
#include <qstring.h>
 
39
 
 
40
class PDFDoc;
 
41
class PdfObject;
 
42
class IpeFontPool;
 
43
class IpeStyleSheet;
 
44
class PdfOutputDev;
 
45
class Gfx;
 
46
 
 
47
// --------------------------------------------------------------------
 
48
 
 
49
class IpeLatex {
 
50
public:
 
51
  IpeLatex();
 
52
  ~IpeLatex();
 
53
 
 
54
  int ScanPage(IpePage *page);
 
55
  int CreateLatexSource(QString preamble, const IpeStyleSheet *sheet,
 
56
                        QString texFile);
 
57
  bool ReadPdf(QString pdfFile);
 
58
  bool UpdateTextObjects();
 
59
  IpeFontPool *TakeFontPool();
 
60
 
 
61
private:
 
62
  bool GetXForm(PdfObject &xform);
 
63
  bool GetEmbeddedFont(int fno, int objno);
 
64
  void Warn(IpeString msg);
 
65
 
 
66
private:
 
67
  struct SText {
 
68
    const IpeText *iText;
 
69
    IpeAttribute iSize;
 
70
  };
 
71
 
 
72
  typedef std::list<SText> TextList;
 
73
  typedef std::list<IpeText::XForm *> XFormList;
 
74
 
 
75
  PDFDoc *iDoc;
 
76
 
 
77
  //! List of text objects scanned. Objects not owned.
 
78
  TextList iTextObjects;
 
79
 
 
80
  //! List of XForm objects read from PDF file.  Objects owned!
 
81
  XFormList iXForms;
 
82
 
 
83
  //! The embedded fonts. Owned!
 
84
  IpeFontPool *iFontPool;
 
85
 
 
86
  //! Maps /F<n> to object number;
 
87
  std::map<int, int> iFontObjects;
 
88
 
 
89
  friend class TextCollectingVisitor;
 
90
};
 
91
 
 
92
// --------------------------------------------------------------------
 
93
#endif