summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--cairomm/pattern.cc18
-rw-r--r--cairomm/pattern.h34
3 files changed, 42 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 298b634..e80f98d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-18 Povilas Kanapickas <povilas@radix.lt>
+
+ Add Pattern::{set_extend,get_extend}
+
+ * cairomm/pattern.{cc,h}: set_extend and get_extend functions apply not
+ only to surface patterns, but to linear and radial gradients too.
+
2012-03-12 Mark Vender <markv743@yahoo.co.uk>
Use GNOME style in the documentation
diff --git a/cairomm/pattern.cc b/cairomm/pattern.cc
index 9fa27ee..a57798a 100644
--- a/cairomm/pattern.cc
+++ b/cairomm/pattern.cc
@@ -92,7 +92,18 @@ PatternType Pattern::get_type() const
return static_cast<PatternType>(pattern_type);
}
+void Pattern::set_extend(Extend extend)
+{
+ cairo_pattern_set_extend(m_cobject, (cairo_extend_t)extend);
+ check_object_status_and_throw_exception(*this);
+}
+Extend Pattern::get_extend() const
+{
+ const Extend result = static_cast<Extend>(cairo_pattern_get_extend(m_cobject));
+ check_object_status_and_throw_exception(*this);
+ return result;
+}
SolidPattern::SolidPattern(cairo_pattern_t* cobject, bool has_reference)
: Pattern(cobject, has_reference)
@@ -164,15 +175,12 @@ SurfacePattern::~SurfacePattern()
void SurfacePattern::set_extend(Extend extend)
{
- cairo_pattern_set_extend(m_cobject, (cairo_extend_t)extend);
- check_object_status_and_throw_exception(*this);
+ Pattern::set_extend(extend);
}
Extend SurfacePattern::get_extend() const
{
- const Extend result = static_cast<Extend>(cairo_pattern_get_extend(m_cobject));
- check_object_status_and_throw_exception(*this);
- return result;
+ return Pattern::get_extend();
}
void SurfacePattern::set_filter(Filter filter)
diff --git a/cairomm/pattern.h b/cairomm/pattern.h
index 2af1a73..022a346 100644
--- a/cairomm/pattern.h
+++ b/cairomm/pattern.h
@@ -108,6 +108,24 @@ public:
*/
PatternType get_type() const;
+ /**
+ * Sets the mode to be used for drawing outside the area of a pattern. See
+ * Cairo::Extend for details on the semantics of each extend strategy.
+ *
+ * The default extend mode is Cairo::EXTEND_NONE for surface patterns and
+ * Cairo::EXTEND_PAD for gradient patterns.
+ *
+ * @param Cairo::Extend describing how the area outsize of the pattern will
+ * be drawn
+ */
+ void set_extend(Extend extend);
+
+ /**
+ * Gets the current extend mode See Cairo::Extend for details on the
+ * semantics of each extend strategy.
+ */
+ Extend get_extend() const;
+
typedef cairo_pattern_t cobject;
inline cobject* cobj() { return m_cobject; }
inline const cobject* cobj() const { return m_cobject; }
@@ -218,22 +236,14 @@ public:
*/
static RefPtr<SurfacePattern> create(const RefPtr<Surface>& surface);
- /**
- * Sets the mode to be used for drawing outside the area of a pattern. See
- * Cairo::Extend for details on the semantics of each extend strategy.
- *
- * The default extend mode is Cairo::EXTEND_NONE for surface patterns.
- *
- * @param Cairo::Extend describing how the area outsize of the pattern will
- * be drawn
+ #ifndef DOXYGEN_IGNORE_THIS
+ /* The following two functions have been implemented in Pattern and are
+ * retained only because of API/ABI compatibility reasons.
*/
void set_extend(Extend extend);
- /**
- * Gets the current extend mode See Cairo::Extend for details on the
- * semantics of each extend strategy.
- */
Extend get_extend() const;
+ #endif
/**
* Sets the filter to be used for resizing when using this pattern.