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

« back to all changes in this revision

Viewing changes to src/ipemodel/ipeq.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2007-01-09 23:14:51 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20070109231451-3nd095g7ishc108l
Tags: 6.0pre27-3
* debian/gsfonts-fontmap.xml: New.  Fontmap for fonts from gsfonts package.
* debian/rules: Use gsfonts-fontmap.xml instead of tetex-fontmap.xml.
* debian/control: Add texlive-latex-base dependency as alternative to
  tetex-bin (for pdflatex) and replace tetex-extra by gsfonts (for font
  files).  Patch courtesy of Norbert Preining.  Closes: #378537.

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-2004  Otfried Cheong
 
8
    Copyright (C) 1993-2005  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
36
36
#include "ipexml.h"
37
37
#include "ipecolor.h"
38
38
 
39
 
#include <qstring.h>
40
 
#include <qpixmap.h>
 
39
#include <QString>
41
40
 
42
41
// --------------------------------------------------------------------
43
42
 
44
43
class QIODevice;
45
 
class IpeStyleSheet;
46
 
 
47
 
extern QPixmap ColorPixmap(IpeAttribute sym, const IpeStyleSheet *sheet);
48
44
 
49
45
inline IpeString IpeQ(const QString &str)
50
46
{
51
 
  return IpeString(str.utf8());
 
47
  return IpeString(str.toUtf8());
52
48
}
53
49
 
54
50
inline QString QIpe(const IpeString &str)
64
60
  virtual void PutCString(const char *s);
65
61
  virtual void PutRaw(const char *data, int size);
66
62
  virtual int Tell() const;
67
 
private:
 
63
  void flush();
 
64
private:
 
65
  inline void put(char ch);
 
66
private:
 
67
  static const int BUFSIZE = 8192;
68
68
  QIODevice *iDevice;
 
69
  IpeBuffer iBuffer;
 
70
  int iPos;
69
71
};
70
72
 
71
 
class XmlQStringSource : public IpeDataSource {
 
73
class QStringDataSource : public IpeDataSource {
72
74
public:
73
 
  XmlQStringSource(QString str);
 
75
  QStringDataSource(QString str);
74
76
  virtual int GetChar();
75
77
private:
76
78
  IpeString iData;
77
79
  int iPos;
78
80
};
79
81
 
80
 
class XmlQSource : public IpeDataSource {
 
82
class QDataSource : public IpeDataSource {
81
83
public:
82
 
  XmlQSource(QIODevice *dev, bool skipPercent = false);
 
84
  QDataSource(QIODevice *dev, bool skipPercent = false);
83
85
  virtual int GetChar();
84
 
private:
 
86
  void reset();
 
87
private:
 
88
  int get();
 
89
private:
 
90
  static const int BUFSIZE = 8192;
85
91
  bool iSkipPercent;
86
92
  QIODevice *iDev;
 
93
  IpeBuffer iBuffer;
 
94
  int iPos;
 
95
  int iBytes;
87
96
};
88
97
 
89
98
inline IpeStream &operator<<(IpeStream &stream, const QString &str)
92
101
  return stream;
93
102
}
94
103
 
 
104
inline void IpeQStream::put(char ch)
 
105
{
 
106
  iBuffer[iPos++] = ch;
 
107
  if (iPos == BUFSIZE) flush();
 
108
}
 
109
 
 
110
 
95
111
// --------------------------------------------------------------------
96
112
#endif