[gtkmm] Gdk::Cursor: Change CursorType to Cursor::Type.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gdk::Cursor: Change CursorType to Cursor::Type.
- Date: Thu, 27 Apr 2017 15:26:54 +0000 (UTC)
commit 5e391908699d2ba807e6140e87891812bb165e31
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Apr 27 14:06:22 2017 +0200
Gdk::Cursor: Change CursorType to Cursor::Type.
demos/gtk-demo/example_change_display.cc | 2 +-
gdk/src/cursor.ccg | 2 ++
gdk/src/cursor.hg | 8 ++++----
tools/m4/convert_gdk.m4 | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 03b8d92..71f3758 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -303,7 +303,7 @@ Gtk::Window* Example_ChangeDisplay::query_for_toplevel(const Glib::RefPtr<Gdk::S
m_pPopup->show();
- auto cursor = Gdk::Cursor::create(refDisplay, Gdk::CursorType::CROSSHAIR);
+ auto cursor = Gdk::Cursor::create(refDisplay, Gdk::Cursor::Type::CROSSHAIR);
Gtk::Window* toplevel = nullptr;
diff --git a/gdk/src/cursor.ccg b/gdk/src/cursor.ccg
index ee567b3..07829cf 100644
--- a/gdk/src/cursor.ccg
+++ b/gdk/src/cursor.ccg
@@ -18,6 +18,8 @@
#include <gdk/gdk.h>
+using Type = Gdk::Cursor::Type;
+
namespace Gdk
{
diff --git a/gdk/src/cursor.hg b/gdk/src/cursor.hg
index e5f9719..bb07a8f 100644
--- a/gdk/src/cursor.hg
+++ b/gdk/src/cursor.hg
@@ -25,8 +25,6 @@ _PINCLUDE(glibmm/private/object_p.h)
namespace Gdk
{
-_WRAP_ENUM(CursorType, GdkCursorType)
-
/** This represents a cursor.
*/
class Cursor : public Glib::Object
@@ -40,12 +38,14 @@ protected:
_IGNORE(gdk_cursor_new_from_name)
public:
+ _WRAP_ENUM(Type, GdkCursorType)
+
//We use _WRAP_METHOD() instead of _WRAP_CREATE() and constructors,
//because the gdk_cursor_new_*() functions actually return existing instances sometimes,
//but constructors assume that they own the instance.
//And we would have to have to use the gdk_cursor_new_*() functions in the constructors anyway,
//because they do more than just call g_object_new().
- _WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<Display>& display, CursorType
cursor_type), gdk_cursor_new_for_display)
+ _WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<Display>& display, Type cursor_type),
gdk_cursor_new_for_display)
_WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<Display>& display, const
Glib::RefPtr<Pixbuf>& pixbuf, int x, int y), gdk_cursor_new_from_pixbuf)
#m4 _CONVERSION(`const ::Cairo::RefPtr< ::Cairo::Surface>&',`cairo_surface_t*',`($3) ?
const_cast<cairo_surface_t*>(($3)->cobj()) : nullptr')
@@ -65,7 +65,7 @@ public:
_WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> get_surface(double& x_hot, double& y_hot),
gdk_cursor_get_surface)
_WRAP_METHOD(::Cairo::RefPtr<const ::Cairo::Surface> get_surface(double& x_hot, double& y_hot) const,
gdk_cursor_get_surface, constversion)
- _WRAP_METHOD(CursorType get_cursor_type() const, gdk_cursor_get_cursor_type)
+ _WRAP_METHOD(Type get_cursor_type() const, gdk_cursor_get_cursor_type)
};
} //namespace Gdk
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 66cd630..85b37c4 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -31,7 +31,7 @@ _CONV_ENUM(Gdk,AxisUse)
_CONV_ENUM(Gdk,ByteOrder)
_CONV_ENUM(Gdk,CapStyle)
_CONV_ENUM(Gdk,Colorspace)
-_CONV_ENUM(Gdk,CursorType)
+_CONV_INCLASS_ENUM(Gdk,Cursor,Type)
_CONV_ENUM(Gdk,DeviceType)
_CONV_ENUM(Gdk,DragAction)
_CONV_ENUM(Gdk,DragProtocol)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]