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

« back to all changes in this revision

Viewing changes to src/include/ipelatex.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-12-11 21:22:35 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091211212235-5iio4nzpra64snab
Tags: 7.0.10-1
* New upstream.  Closes: #551192.
  - New build-depends: libcairo2-dev, liblua5.1-0-dev, gsfonts
  - patches/config.diff: Remove.  Upstream build system replaced.
  - Runtime lib package changed to libipe7.0.10 from libipe1c2a
  - Devel package renamed to libipe-dev (from libipe1-dev)
  - Package ipe depends on lua5.1 due to ipe-update-master.

* rules: Re-write to use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
/*
6
6
 
7
7
    This file is part of the extensible drawing editor Ipe.
8
 
    Copyright (C) 1993-2007  Otfried Cheong
 
8
    Copyright (C) 1993-2009  Otfried Cheong
9
9
 
10
10
    Ipe is free software; you can redistribute it and/or modify it
11
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
 
12
    the Free Software Foundation; either version 3 of the License, or
13
13
    (at your option) any later version.
14
14
 
15
15
    As a special exception, you have permission to link Ipe with the
35
35
#include "ipepage.h"
36
36
#include "ipetext.h"
37
37
#include "ipepdfparser.h"
38
 
 
39
 
class IpeFontPool;
40
 
class IpeStyleSheet;
 
38
#include "ipefontpool.h"
41
39
 
42
40
// --------------------------------------------------------------------
43
41
 
44
 
class IPE_EXPORT IpeLatex {
45
 
public:
46
 
  IpeLatex(const IpeStyleSheet *sheet);
47
 
  ~IpeLatex();
48
 
 
49
 
  int ScanObject(const IpeObject *obj);
50
 
  int ScanPage(IpePage *page);
51
 
  int CreateLatexSource(IpeStream &stream, IpeString preamble);
52
 
  bool ReadPdf(IpeDataSource &source);
53
 
  bool UpdateTextObjects();
54
 
  IpeFontPool *TakeFontPool();
55
 
 
56
 
private:
57
 
  bool GetXForm(const IpePdfObj *xform);
58
 
  bool GetEmbeddedFont(int fno, int objno);
59
 
  void Warn(IpeString msg);
60
 
 
61
 
private:
62
 
  struct SText {
63
 
    const IpeText *iText;
64
 
    IpeAttribute iSize;
 
42
namespace ipe {
 
43
 
 
44
  class Cascade;
 
45
  class TextCollectingVisitor;
 
46
 
 
47
  class Latex {
 
48
  public:
 
49
    Latex(const Cascade *sheet);
 
50
    ~Latex();
 
51
 
 
52
    int scanObject(const Object *obj);
 
53
    int scanPage(Page *page);
 
54
    int createLatexSource(Stream &stream, String preamble);
 
55
    bool readPdf(DataSource &source);
 
56
    bool updateTextObjects();
 
57
    FontPool *takeFontPool();
 
58
 
 
59
  private:
 
60
    bool getXForm(const PdfObj *xform);
 
61
    bool getEmbeddedFont(int fno, int objno);
 
62
    void warn(String msg);
 
63
 
 
64
  private:
 
65
    struct SText {
 
66
      const Text *iText;
 
67
      Attribute iSize;
 
68
    };
 
69
 
 
70
    typedef std::list<SText> TextList;
 
71
    typedef std::list<Text::XForm *> XFormList;
 
72
 
 
73
    const Cascade *iCascade;
 
74
 
 
75
    PdfFile iPdf;
 
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
    FontPool *iFontPool;
 
85
 
 
86
    //! Maps /F<n> to object number;
 
87
    std::map<int, int> iFontObjects;
 
88
 
 
89
    friend class ipe::TextCollectingVisitor;
65
90
  };
66
91
 
67
 
  typedef std::list<SText> TextList;
68
 
  typedef std::list<IpeText::XForm *> XFormList;
69
 
 
70
 
  const IpeStyleSheet *iStyleSheet;
71
 
 
72
 
  IpePdfFile iPdf;
73
 
 
74
 
  //! List of text objects scanned. Objects not owned.
75
 
  TextList iTextObjects;
76
 
 
77
 
  //! List of XForm objects read from PDF file.  Objects owned!
78
 
  XFormList iXForms;
79
 
 
80
 
  //! The embedded fonts. Owned!
81
 
  IpeFontPool *iFontPool;
82
 
 
83
 
  //! Maps /F<n> to object number;
84
 
  std::map<int, int> iFontObjects;
85
 
 
86
 
  friend class TextCollectingVisitor;
87
 
};
 
92
} // namespace
88
93
 
89
94
// --------------------------------------------------------------------
90
95
#endif