[gtkmm/vector] Added TypeTraits for Gdk::Point.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/vector] Added TypeTraits for Gdk::Point.
- Date: Sun, 23 Jan 2011 11:20:03 +0000 (UTC)
commit 19cdf19786bac518b0f29b019b4b89a24f1760bd
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Sun Jan 23 12:17:27 2011 +0100
Added TypeTraits for Gdk::Point.
This allows us to avoid reinterpreting Gdk::Color into GdkColor.
gdk/src/types.hg | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/src/types.hg b/gdk/src/types.hg
index 7e9c86b..f9a5774 100644
--- a/gdk/src/types.hg
+++ b/gdk/src/types.hg
@@ -100,6 +100,18 @@ inline bool operator!=(const Point& lhs, const Point& rhs)
{ return !lhs.equal(rhs); }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
+struct PointTraits
+{
+ typedef Gdk::Point CppType;
+ typedef const GdkPoint CType;
+ typedef GdkPoint CTypeNonConst;
+
+ static CType to_c_type (CType c_obj) { return c_obj; }
+ static void release_c_type (CType) {}
+ static CType to_c_type (const CppType& cpp_obj) { return *(cpp_obj.gobj ()); }
+ static CppType to_cpp_type (CType c_obj) { return CppType (c_obj.x, c_obj.y); }
+};
+
struct AtomStringTraits
{
typedef std::string CppType;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]