aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-09-10 21:00:58 +0200
committerSebastian Geerken <devnull@localhost>2013-09-10 21:00:58 +0200
commit06f5833b8f41196bc427c06e39ed21d431c1e665 (patch)
tree17654b3a7449ffdcfae9916fc211d5750789dfad /dw
parent6acc9e9c711bad1f9d0125d884b9993ed1c4789e (diff)
Some refactoring: the image decoding code now only accesses dw::core::ImgRenderer, not dw::Image (which now implements the former) anymore.
Diffstat (limited to 'dw')
-rw-r--r--dw/Makefile.am1
-rw-r--r--dw/core.hh1
-rw-r--r--dw/image.hh2
-rw-r--r--dw/imgrenderer.hh28
4 files changed, 31 insertions, 1 deletions
diff --git a/dw/Makefile.am b/dw/Makefile.am
index e108da60..06a7af51 100644
--- a/dw/Makefile.am
+++ b/dw/Makefile.am
@@ -14,6 +14,7 @@ libDw_core_a_SOURCES = \
findtext.cc \
findtext.hh \
imgbuf.hh \
+ imgrenderer.hh \
iterator.cc \
iterator.hh \
layout.cc \
diff --git a/dw/core.hh b/dw/core.hh
index f39c38cc..022574b1 100644
--- a/dw/core.hh
+++ b/dw/core.hh
@@ -44,6 +44,7 @@ class ResourceFactory;
#include "types.hh"
#include "events.hh"
#include "imgbuf.hh"
+#include "imgrenderer.hh"
#include "style.hh"
#include "view.hh"
#include "platform.hh"
diff --git a/dw/image.hh b/dw/image.hh
index a8314d4f..7ac05c20 100644
--- a/dw/image.hh
+++ b/dw/image.hh
@@ -116,7 +116,7 @@ public:
*
* \sa\ref dw-images-and-backgrounds
*/
-class Image: public core::Widget
+class Image: public core::Widget, public core::ImgRenderer
{
private:
char *altText;
diff --git a/dw/imgrenderer.hh b/dw/imgrenderer.hh
new file mode 100644
index 00000000..9c7c6525
--- /dev/null
+++ b/dw/imgrenderer.hh
@@ -0,0 +1,28 @@
+#ifndef __DW_IMGRENDERER_HH__
+#define __DW_IMGRENDERER_HH__
+
+#ifndef __INCLUDED_FROM_DW_CORE_HH__
+# error Do not include this file directly, use "core.hh" instead.
+#endif
+
+namespace dw {
+namespace core {
+
+/**
+ * \brief ...
+ *
+ * \sa \ref dw-images-and-backgrounds
+ */
+class ImgRenderer
+{
+public:
+ virtual void setBuffer (core::Imgbuf *buffer, bool resize = false) = 0;
+ virtual void drawRow (int row) = 0;
+};
+
+} // namespace core
+} // namespace dw
+
+#endif // __DW_IMGRENDERER_HH__
+
+