[gtkmm] Gtk::LevelBar, Toolbar: Implement the Orientable interface



commit 894c9a3ce226520025ab09de168eadd6fd86a4bc
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Dec 28 19:15:15 2016 +0100

    Gtk::LevelBar, Toolbar: Implement the Orientable interface

 gtk/src/levelbar.ccg |    9 ---------
 gtk/src/levelbar.hg  |   27 ++++++++++-----------------
 gtk/src/toolbar.hg   |    7 ++++---
 3 files changed, 14 insertions(+), 29 deletions(-)
---
diff --git a/gtk/src/levelbar.ccg b/gtk/src/levelbar.ccg
index 8e13222..1247a37 100644
--- a/gtk/src/levelbar.ccg
+++ b/gtk/src/levelbar.ccg
@@ -17,12 +17,3 @@
 
 #include <gtk/gtk.h>
 
-namespace Gtk
-{
-
-void LevelBar::set_orientation(Orientation orientation)
-{
-  gtk_orientable_set_orientation(GTK_ORIENTABLE(gobj()), ((GtkOrientation)(orientation)));
-}
-
-} //namespace Gtk
diff --git a/gtk/src/levelbar.hg b/gtk/src/levelbar.hg
index c655296..d780f45 100644
--- a/gtk/src/levelbar.hg
+++ b/gtk/src/levelbar.hg
@@ -17,6 +17,7 @@
  */
 
 #include <gtkmm/widget.h>
+#include <gtkmm/orientable.h>
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/widget_p.h)
 
@@ -26,19 +27,17 @@ namespace Gtk
 
 _WRAP_ENUM(LevelBarMode, GtkLevelBarMode)
 
-//TODO: Derive/Implement from Gtk::Orientable (and remove our mention of that
-//in the class documentation when we can break ABI.
-
-/** A bar that can used as a level indicator
+/** A bar that can be used as a level indicator.
  *
  * Typical use cases are displaying the strength
  * of a password, or showing the charge level of a battery.
  *
  * Use set_value() to set the current value, and
  * add_offset_value() to set the value offsets at which
- * the bar will be considered in a different state. There will be two offsets
- * by default on the level bar: Gtk::LEVEL_BAR_OFFSET_LOW and
- * Gtk::LEVEL_BAR_OFFSET_HIGH, with values 0.25 and 0.75 respectively.
+ * the bar will be considered in a different state. There will be three offsets
+ * by default on the level bar: GTK_LEVEL_BAR_OFFSET_LOW,
+ * GTK_LEVEL_BAR_OFFSET_HIGH and GTK_LEVEL_BAR_OFFSET_FULL, with
+ * values 0.25, 0.75 and 1.0 respectively.
  *
  * The default interval of values is between zero and one, but it's possible to
  * modify the interval using set_min_value() and
@@ -56,23 +55,17 @@ _WRAP_ENUM(LevelBarMode, GtkLevelBarMode)
  * @ingroup Widgets
  * @newin{3,6}
  */
-class LevelBar : public Widget
+class LevelBar
+: public Widget,
+  public Orientable
 {
   _CLASS_GTKOBJECT(LevelBar, GtkLevelBar, GTK_LEVEL_BAR, Gtk::Widget, GtkWidget)
+  _IMPLEMENTS_INTERFACE(Orientable)
 public:
 
   _CTOR_DEFAULT()
   _IGNORE(gtk_level_bar_new)
 
-  //TODO: Remove this when we can break ABI to derive from Orientable.
-  /** Sets the orientation of the widget.
-   *
-   * @newin{3,18}
-   *
-   * @param orientation The widget’s new orientation.
-   */
-  void set_orientation(Orientation orientation);
-
   _WRAP_METHOD(void set_mode(LevelBarMode mode), gtk_level_bar_set_mode)
   _WRAP_METHOD(LevelBarMode get_mode() const, gtk_level_bar_get_mode)
 
diff --git a/gtk/src/toolbar.hg b/gtk/src/toolbar.hg
index c8962d9..8a9161f 100644
--- a/gtk/src/toolbar.hg
+++ b/gtk/src/toolbar.hg
@@ -20,6 +20,7 @@
 _CONFIGINCLUDE(gtkmmconfig.h)
 
 #include <gtkmm/toolshell.h>
+#include <gtkmm/orientable.h>
 #include <gtkmm/toolitem.h>
 #include <gtkmm/toolbutton.h>
 #include <gtkmm/toggletoolbutton.h>
@@ -31,7 +32,6 @@ _PINCLUDE(gtkmm/private/container_p.h)
 namespace Gtk
 {
 
-//TODO: Derive from Toolshell when we can break ABI.
 /** Bars of buttons and other widgets.
  * @ingroup Widgets
  * @ingroup Containers
@@ -39,10 +39,12 @@ namespace Gtk
  */
 class Toolbar
  : public Container,
-   public ToolShell
+   public ToolShell,
+   public Orientable
 {
   _CLASS_GTKOBJECT(Toolbar,GtkToolbar,GTK_TOOLBAR,Gtk::Container,GtkContainer)
   _IMPLEMENTS_INTERFACE(ToolShell)
+  _IMPLEMENTS_INTERFACE(Orientable)
 public:
   _CTOR_DEFAULT()
 
@@ -99,4 +101,3 @@ public:
 };
 
 } // namespace Gtk
-


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