[gtkmm] Entry: Change EntryIconPosition to Entry::IconPosition.



commit f2cf0e29a46c5973fc35d2d63bbf7e2d7b0cc899
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 27 21:36:42 2017 +0200

    Entry: Change EntryIconPosition to Entry::IconPosition.

 gtk/src/entry.ccg       |   20 +++++++++++---------
 gtk/src/entry.hg        |   47 +++++++++++++++++++++++------------------------
 tools/m4/convert_gtk.m4 |    2 +-
 3 files changed, 35 insertions(+), 34 deletions(-)
---
diff --git a/gtk/src/entry.ccg b/gtk/src/entry.ccg
index 950c266..8c2893a 100644
--- a/gtk/src/entry.ccg
+++ b/gtk/src/entry.ccg
@@ -18,52 +18,54 @@
 
 #include <gtk/gtk.h>
 
+using IconPosition = Gtk::Entry::IconPosition;
+
 namespace Gtk
 {
 
 
-void Entry::set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos)
+void Entry::set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, IconPosition icon_pos)
 {
   gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), Glib::unwrap(pixbuf));
 }
 
-void Entry::set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos)
+void Entry::set_icon_from_icon_name(const Glib::ustring& icon_name, IconPosition icon_pos)
 {
   gtk_entry_set_icon_from_icon_name(gobj(), ((GtkEntryIconPosition)(icon_pos)), icon_name.c_str());
 }
 
-void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPosition icon_pos)
+void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, IconPosition icon_pos)
 {
   gtk_entry_set_icon_from_gicon(gobj(), ((GtkEntryIconPosition)(icon_pos)), 
const_cast<GIcon*>(Glib::unwrap<Gio::Icon>(icon)));
 }
 
-void Entry::unset_icon(EntryIconPosition icon_pos)
+void Entry::unset_icon(IconPosition icon_pos)
 {
   //We could use any one of these set_icon_from_* functions:
   gtk_entry_set_icon_from_pixbuf(gobj(), ((GtkEntryIconPosition)(icon_pos)), nullptr);
 }
 
-void Entry::set_icon_activatable(bool activatable, EntryIconPosition icon_pos)
+void Entry::set_icon_activatable(bool activatable, IconPosition icon_pos)
 {
   gtk_entry_set_icon_activatable(gobj(), ((GtkEntryIconPosition)(icon_pos)), static_cast<int>(activatable));
 }
 
-void Entry::set_icon_tooltip_text(const Glib::ustring& tooltip, EntryIconPosition icon_pos)
+void Entry::set_icon_tooltip_text(const Glib::ustring& tooltip, IconPosition icon_pos)
 {
   gtk_entry_set_icon_tooltip_text(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str());
 }
 
-void Entry::set_icon_tooltip_markup(const Glib::ustring& tooltip, EntryIconPosition icon_pos)
+void Entry::set_icon_tooltip_markup(const Glib::ustring& tooltip, IconPosition icon_pos)
 {
   gtk_entry_set_icon_tooltip_markup(gobj(), ((GtkEntryIconPosition)(icon_pos)), tooltip.c_str());
 }
 
-void Entry::set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions, 
EntryIconPosition icon_pos)
+void Entry::set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions, 
IconPosition icon_pos)
 {
   gtk_entry_set_icon_drag_source(gobj(), ((GtkEntryIconPosition)(icon_pos)), 
const_cast<GtkTargetList*>(Glib::unwrap(target_list)), ((GdkDragAction)(actions)));
 }
 
-Gdk::Rectangle Entry::get_icon_area(EntryIconPosition icon_pos) const
+Gdk::Rectangle Entry::get_icon_area(IconPosition icon_pos) const
 {
   Gdk::Rectangle result;
   gtk_entry_get_icon_area(const_cast<GtkEntry*>(gobj()), (GtkEntryIconPosition)icon_pos, result.gobj());
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 2d47b1b..a10d0a1 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -34,8 +34,6 @@ _PINCLUDE(gtkmm/private/widget_p.h)
 namespace Gtk
 {
 
-_WRAP_ENUM(EntryIconPosition, GtkEntryIconPosition)
-
 /** A single line text entry field.
  *
  * The Gtk::Entry widget is a single line text entry widget. A fairly large
@@ -57,6 +55,7 @@ class Entry
   _IMPLEMENTS_INTERFACE(Editable)
   _IMPLEMENTS_INTERFACE(CellEditable)
 public:
+  _WRAP_ENUM(IconPosition, GtkEntryIconPosition)
 
   _CTOR_DEFAULT
   _WRAP_CTOR(Entry(const Glib::RefPtr<EntryBuffer>& buffer), gtk_entry_new_with_buffer)
@@ -116,15 +115,15 @@ public:
 
   //We hand-code these so we can change the parameter order, so we can have a default parameter value:
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_pixbuf)
-  void set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, IconPosition icon_pos = 
IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_pixbuf)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_icon_name)
-  void set_icon_from_icon_name(const Glib::ustring& icon_name, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_from_icon_name(const Glib::ustring& icon_name, IconPosition icon_pos = 
IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_icon_name)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_gicon)
-  void set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, IconPosition icon_pos = 
IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_from_gicon)
 
   /** Do not show any icon in the specified position.
@@ -134,38 +133,38 @@ public:
    *
    * @newin{3,0}
    */
-  void unset_icon(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY);
+  void unset_icon(IconPosition icon_pos = IconPosition::PRIMARY);
 
-  _WRAP_METHOD(Image::Type get_icon_storage_type(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY) 
const, gtk_entry_get_icon_storage_type)
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon_pixbuf(EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY), gtk_entry_get_icon_pixbuf, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_icon_pixbuf(EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY) const, gtk_entry_get_icon_pixbuf, refreturn, constversion)
-  _WRAP_METHOD(Glib::ustring get_icon_name(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY) const, 
gtk_entry_get_icon_name)
-  _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon_gicon(EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY), gtk_entry_get_icon_gicon, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_icon_gicon(EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY) const, gtk_entry_get_icon_gicon, refreturn, constversion)
+  _WRAP_METHOD(Image::Type get_icon_storage_type(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_storage_type)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_icon_pixbuf(IconPosition icon_pos = IconPosition::PRIMARY), 
gtk_entry_get_icon_pixbuf, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> get_icon_pixbuf(IconPosition icon_pos = 
IconPosition::PRIMARY) const, gtk_entry_get_icon_pixbuf, refreturn, constversion)
+  _WRAP_METHOD(Glib::ustring get_icon_name(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_name)
+  _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon_gicon(IconPosition icon_pos = IconPosition::PRIMARY), 
gtk_entry_get_icon_gicon, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_icon_gicon(IconPosition icon_pos = IconPosition::PRIMARY) 
const, gtk_entry_get_icon_gicon, refreturn, constversion)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_activatable)
-  void set_icon_activatable(bool activatable = true, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_activatable(bool activatable = true, IconPosition icon_pos = IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_activatable)
 
-  _WRAP_METHOD(bool get_icon_activatable(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY) const, 
gtk_entry_get_icon_activatable)
-  _WRAP_METHOD(void set_icon_sensitive(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY, bool 
sensitive = true), gtk_entry_set_icon_sensitive)
-  _WRAP_METHOD(bool get_icon_sensitive(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY), 
gtk_entry_get_icon_sensitive)
+  _WRAP_METHOD(bool get_icon_activatable(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_activatable)
+  _WRAP_METHOD(void set_icon_sensitive(IconPosition icon_pos = IconPosition::PRIMARY, bool sensitive = 
true), gtk_entry_set_icon_sensitive)
+  _WRAP_METHOD(bool get_icon_sensitive(IconPosition icon_pos = IconPosition::PRIMARY), 
gtk_entry_get_icon_sensitive)
   _WRAP_METHOD(int get_icon_at_pos(int x, int y) const, gtk_entry_get_icon_at_pos)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_tooltip_text)
-  void set_icon_tooltip_text(const Glib::ustring& tooltip, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_tooltip_text(const Glib::ustring& tooltip, IconPosition icon_pos = IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_tooltip_text)
 
-  _WRAP_METHOD(Glib::ustring get_icon_tooltip_text(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY) 
const, gtk_entry_get_icon_tooltip_text)
+  _WRAP_METHOD(Glib::ustring get_icon_tooltip_text(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_tooltip_text)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_tooltip_markup)
-  void set_icon_tooltip_markup(const Glib::ustring& tooltip, EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY);
+  void set_icon_tooltip_markup(const Glib::ustring& tooltip, IconPosition icon_pos = IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_tooltip_markup)
 
-  _WRAP_METHOD(Glib::ustring get_icon_tooltip_markup(EntryIconPosition icon_pos = 
EntryIconPosition::PRIMARY) const, gtk_entry_get_icon_tooltip_markup)
+  _WRAP_METHOD(Glib::ustring get_icon_tooltip_markup(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_tooltip_markup)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_drag_source)
-  void set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions = 
Gdk::DragAction::COPY, EntryIconPosition icon_pos = EntryIconPosition::PRIMARY);
+  void set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions = 
Gdk::DragAction::COPY, IconPosition icon_pos = IconPosition::PRIMARY);
   _IGNORE(gtk_entry_set_icon_drag_source)
 
   /** Returns the area where entry's icon at @a icon_pos is drawn.
@@ -177,7 +176,7 @@ public:
    *
    * @newin{3,0}
    */
-  Gdk::Rectangle get_icon_area(EntryIconPosition icon_pos = EntryIconPosition::PRIMARY) const;
+  Gdk::Rectangle get_icon_area(IconPosition icon_pos = IconPosition::PRIMARY) const;
   _IGNORE(gtk_entry_get_icon_area)
 
   _WRAP_METHOD(int get_current_icon_drag_source(), gtk_entry_get_current_icon_drag_source)
@@ -208,8 +207,8 @@ public:
   //Note that the GTK+ C documentation for the activate signal says (as of 2012-06) that it should be used 
by applications even though it is a keybinding signal.
   _WRAP_SIGNAL(void activate(), "activate")
 
-  _WRAP_SIGNAL(void icon_release(EntryIconPosition icon_position, const GdkEventButton* event), 
"icon-release", no_default_handler)
-  _WRAP_SIGNAL(void icon_press(EntryIconPosition icon_position, const GdkEventButton* event), "icon-press", 
no_default_handler)
+  _WRAP_SIGNAL(void icon_release(IconPosition icon_position, const GdkEventButton* event), "icon-release", 
no_default_handler)
+  _WRAP_SIGNAL(void icon_press(IconPosition icon_position, const GdkEventButton* event), "icon-press", 
no_default_handler)
 
   _IGNORE_SIGNAL("move_cursor")
   _IGNORE_SIGNAL("delete_from_cursor")
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 3b6f2a9..92104bd 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -152,7 +152,7 @@ _CONV_ENUM(Gtk,PrintError)
 _CONV_ENUM(Gtk,PrintCapabilities)
 _CONV_ENUM(Gtk,DragResult)
 _CONV_ENUM(Gtk,NumberUpLayout)
-_CONV_ENUM(Gtk,EntryIconPosition)
+_CONV_INCLASS_ENUM(Gtk,Entry,IconPosition)
 _CONV_ENUM(Gtk,WrapAllocationMode)
 _CONV_ENUM(Gtk,WrapBoxPacking)
 _CONV_ENUM(Gtk,WrapBoxSpreading)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]