[dia] [gradient] interface definition DiaRenderer::set_pattern()
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [gradient] interface definition DiaRenderer::set_pattern()
- Date: Tue, 24 Dec 2013 14:28:24 +0000 (UTC)
commit a5b790b6f2ac4ae9725bb58890ff8c29f1d11a8e
Author: Hans Breuer <hans breuer org>
Date: Tue Dec 24 15:16:07 2013 +0100
[gradient] interface definition DiaRenderer::set_pattern()
Step 3 of 7 for gradient support in Dia: renderer interface extension
to detect pattern capability and use it.
lib/diarenderer.c | 10 ++++++++++
lib/diarenderer.h | 9 ++++++---
lib/plug-ins.h | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 1be6227..f986b83 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -1532,6 +1532,16 @@ is_capable_to (DiaRenderer *renderer, RenderCapability cap)
return FALSE;
}
+/*!
+ * The base class has no pattern (gradient) support
+ */
+static void
+set_pattern (DiaRenderer *renderer, DiaPattern *pat)
+{
+ g_warning ("%s::set_pattern not implemented!",
+ G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
+}
+
/*
* non member functions
*/
diff --git a/lib/diarenderer.h b/lib/diarenderer.h
index 2cce06c..8cc2857 100644
--- a/lib/diarenderer.h
+++ b/lib/diarenderer.h
@@ -32,9 +32,10 @@
G_BEGIN_DECLS
typedef enum {
- RENDER_HOLES = (1<<0),
- RENDER_ALPHA = (1<<1),
- RENDER_AFFINE = (1<<2)
+ RENDER_HOLES = (1<<0),
+ RENDER_ALPHA = (1<<1),
+ RENDER_AFFINE = (1<<2),
+ RENDER_PATTERN = (1<<3)
} RenderCapability;
/*! GObject boiler plate, create runtime information */
@@ -272,6 +273,8 @@ struct _DiaRendererClass
/*! allows to adapt DiaObject implementations to certain renderer capabilities */
gboolean (*is_capable_to) (DiaRenderer *renderer,
RenderCapability cap);
+ /*! fill with a pattern, currently only gradient */
+ void (*set_pattern) (DiaRenderer *renderer, DiaPattern *pat);
};
/*
diff --git a/lib/plug-ins.h b/lib/plug-ins.h
index a4c3e8d..3fa6665 100644
--- a/lib/plug-ins.h
+++ b/lib/plug-ins.h
@@ -52,7 +52,7 @@ G_BEGIN_DECLS
*
* \ingroup Plugins
*/
-#define DIA_PLUGIN_API_VERSION 18
+#define DIA_PLUGIN_API_VERSION 19
typedef enum {
DIA_PLUGIN_INIT_OK,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]