summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader
authorllornkcor <llornkcor>2002-09-14 12:01:36 (UTC)
committer llornkcor <llornkcor>2002-09-14 12:01:36 (UTC)
commite82423eb0aa113cf8accd92a698cf236d9b069a6 (patch) (side-by-side diff)
treed979fdc09016c63a60b515af629899985ddb8896 /noncore/apps/opie-reader
parenta17482a473c90c7e030bbf7a03b252fdaf53c2ed (diff)
downloadopie-e82423eb0aa113cf8accd92a698cf236d9b069a6.zip
opie-e82423eb0aa113cf8accd92a698cf236d9b069a6.tar.gz
opie-e82423eb0aa113cf8accd92a698cf236d9b069a6.tar.bz2
add this too
Diffstat (limited to 'noncore/apps/opie-reader') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h
new file mode 100644
index 0000000..4d3696e
--- a/dev/null
+++ b/noncore/apps/opie-reader/CDrawBuffer.h
@@ -0,0 +1,59 @@
+#ifndef __CDRAWBUFFER_H
+#define __CDRAWBUFFER_H
+
+#include "StyleConsts.h"
+#include "CBuffer.h"
+#include "my_list.h"
+
+class QPainter;
+
+struct textsegment
+{
+ int start;
+ CStyle style;
+ textsegment(int _start, CStyle _style)
+ :
+ start(_start), style(_style)
+ {}
+};
+
+class FontControl;
+
+class CDrawBuffer : public CBuffer
+{
+ CList<textsegment> segs;
+ int len;
+ FontControl* fc;
+ int m_maxstyle, m_ascent, m_descent, m_lineSpacing;
+ public:
+ CDrawBuffer(FontControl* _fs = NULL)
+ :
+ fc(_fs)
+ {
+ empty();
+ }
+/*
+ CDrawBuffer()
+ :
+ size(0)
+ {
+ empty();
+ }
+*/
+ int width(int numchars = -1);
+ void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw);
+ CDrawBuffer& operator=(const tchar*sztmp);
+ CDrawBuffer& operator=(CDrawBuffer&);
+ void empty();
+ void addch(tchar ch, CStyle _style);
+ void truncate(int);
+ void setright(CDrawBuffer&, int);
+ CStyle laststyle();
+ int ascent() { return m_ascent; }
+ int descent() { return m_descent; }
+ int lineSpacing() { return m_lineSpacing; }
+
+// void frig();
+ bool isLink(int numchars, size_t& tgt);
+};
+#endif