[gtkmm] Derive classes from CellLayout, CellEditable, and Orientable.



commit cd87c117087742ff20ba711e84b1343ea7b299c0
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 24 18:56:48 2009 +0200

    Derive classes from CellLayout, CellEditable, and Orientable.
    
    * gtk/src/accelgroup.hg:
    * gtk/src/actiongroup.hg:
    * gtk/src/clipboard.hg:
    * gtk/src/cellrenderercombo.hg: Put back the no_default_handler option
    because the C structs have no default handlers.
    
    * gtk/src/box.hg:
    * gtk/src/buttonbox.hg:
    * gtk/src/paned.hg:
    * gtk/src/ruler.hg:
    * gtk/src/scalebutton.hg:
    * gtk/src/scrollbar.hg:
    * gtk/src/separator.hg:
    * gtk/src/spinbutton.hg: Derive from Orientable.
    
    * gtk/src/combobox.hg: Derived from CellEditable.
    
    * gtk/src/entrycompletion.hg:
    * gtk/src/iconview.hg:
    * gtk/src/treeviewcolumn.hg: Derive from CellLayout.

 ChangeLog                    |   25 +++++++++++++++++++++++++
 gtk/src/accelgroup.hg        |    4 ++--
 gtk/src/actiongroup.hg       |    8 ++++----
 gtk/src/box.hg               |    8 +++++---
 gtk/src/buttonbox.hg         |    6 +++---
 gtk/src/cellrenderercombo.hg |    2 +-
 gtk/src/clipboard.hg         |    2 +-
 gtk/src/combobox.hg          |    6 ++++--
 gtk/src/entrycompletion.hg   |    7 +++++--
 gtk/src/iconview.hg          |    7 ++++---
 gtk/src/paned.hg             |    7 ++++---
 gtk/src/ruler.hg             |    7 ++++---
 gtk/src/scalebutton.hg       |    8 ++++----
 gtk/src/scrollbar.hg         |   10 +++++-----
 gtk/src/separator.hg         |    8 ++++----
 gtk/src/spinbutton.hg        |    2 +-
 gtk/src/textbuffer.hg        |    1 +
 gtk/src/treeviewcolumn.hg    |    7 ++++---
 18 files changed, 81 insertions(+), 44 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2e3df15..c95ba61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2009-04-24  Murray Cumming  <murrayc murrayc com>
 
+	Derive classes from CellLayout, CellEditable, and Orientable.
+ 
+	* gtk/src/accelgroup.hg:
+	* gtk/src/actiongroup.hg: 
+	* gtk/src/clipboard.hg:
+	* gtk/src/cellrenderercombo.hg: Put back the no_default_handler option 
+	because the C structs have no default handlers.
+	
+	* gtk/src/box.hg:
+	* gtk/src/buttonbox.hg:
+	* gtk/src/paned.hg:
+	* gtk/src/ruler.hg:
+	* gtk/src/scalebutton.hg:
+	* gtk/src/scrollbar.hg:
+	* gtk/src/separator.hg:
+	* gtk/src/spinbutton.hg: Derive from Orientable.
+	
+	* gtk/src/combobox.hg: Derived from CellEditable.
+		
+	* gtk/src/entrycompletion.hg: 
+	* gtk/src/iconview.hg: 
+	* gtk/src/treeviewcolumn.hg: Derive from CellLayout.
+
+2009-04-24  Murray Cumming  <murrayc murrayc com>
+
 	Remove uses of no_default_handler.	
 	
 	* gdk/src/pixbufloader.hg:
diff --git a/gtk/src/accelgroup.hg b/gtk/src/accelgroup.hg
index 9ca0c4a..c44bff7 100644
--- a/gtk/src/accelgroup.hg
+++ b/gtk/src/accelgroup.hg
@@ -113,11 +113,11 @@ public:
   _WRAP_METHOD(static bool activate(Gtk::Object& object, guint accel_key, Gdk::ModifierType accel_mods), gtk_accel_groups_activate)
 
 
-  _WRAP_SIGNAL(bool accel_activate(const Glib::RefPtr<Glib::Object>& acceleratable, guint keyval, Gdk::ModifierType modifier), "accel_activate")   
+  _WRAP_SIGNAL(bool accel_activate(const Glib::RefPtr<Glib::Object>& acceleratable, guint keyval, Gdk::ModifierType modifier), "accel_activate", no_default_handler)   
 
   //TODO: The C type is unpleasant:
   //This has C docs, but it isn't worth mentioning them for such a useless signal. murrayc.
-  _WRAP_SIGNAL(void accel_changed(guint keyval, Gdk::ModifierType modifier, GClosure* accel_closure), "accel_changed")
+  _WRAP_SIGNAL(void accel_changed(guint keyval, Gdk::ModifierType modifier, GClosure* accel_closure), "accel_changed", no_default_handler)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/actiongroup.hg b/gtk/src/actiongroup.hg
index 2e3164b..76ec50c 100644
--- a/gtk/src/actiongroup.hg
+++ b/gtk/src/actiongroup.hg
@@ -93,7 +93,7 @@ public:
    * @param action the action
    * @param proxy the proxy
    */
-  _WRAP_SIGNAL(void connect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "connect_proxy")
+  _WRAP_SIGNAL(void connect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "connect_proxy", no_default_handler)
   
   /** The disconnect_proxy signal is emitted after disconnecting a proxy 
    * from an action in the group. 
@@ -105,7 +105,7 @@ public:
    * @param action the action
    * @param proxy the proxy
    */
-  _WRAP_SIGNAL(void disconnect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "disconnect_proxy")
+  _WRAP_SIGNAL(void disconnect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy), "disconnect_proxy", no_default_handler)
   
   /** The pre_activate signal is emitted just before the @action in the
    * action_group is activated
@@ -115,7 +115,7 @@ public:
    *
    * @action the action
    */          
-  _WRAP_SIGNAL(void pre_activate(const Glib::RefPtr<Action>& action), "pre_activate")
+  _WRAP_SIGNAL(void pre_activate(const Glib::RefPtr<Action>& action), "pre_activate", no_default_handler)
   
   /** The post_activate signal is emitted just after the @action in the
    * @action_group is activated
@@ -125,7 +125,7 @@ public:
    *
    * @param action the action
    */ 
-  _WRAP_SIGNAL(void post_activate(const Glib::RefPtr<Action>& action), "post_activate") 
+  _WRAP_SIGNAL(void post_activate(const Glib::RefPtr<Action>& action), "post_activate", no_default_handler) 
 };
 
 } // namespace Gtk
diff --git a/gtk/src/box.hg b/gtk/src/box.hg
index 0366f70..7c488b1 100644
--- a/gtk/src/box.hg
+++ b/gtk/src/box.hg
@@ -27,6 +27,7 @@ _PINCLUDE(gtkmm/private/container_p.h)
 #m4 _POP()
 
 #include <gtkmm/container.h>
+#include <gtkmm/orientable.h>
 #include <glibmm/helperlist.h>
 #include <gtk/gtk.h>  /* For _GtkBoxChild */
 
@@ -128,8 +129,6 @@ struct EndElem : public Element
 } /* namespace Box_Helpers */
 
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
 /** A base class for box containers.
  *
  * Abstract base class for horizontal and vertical boxes, which organize a
@@ -160,9 +159,12 @@ struct EndElem : public Element
  * set_child_packing() to reset the pack options and padding attributes of any
  * Gtk::Box child. Use query_child_packing() to query these fields.
  */
-class Box : public Container
+class Box
+  : public Container,
+    public Orientable
 {
   _CLASS_GTKOBJECT(Box,GtkBox,GTK_BOX,Gtk::Container,GtkContainer)
+  _IMPLEMENTS_INTERFACE(Orientable)
   _IGNORE(gtk_box_pack_end_defaults, gtk_box_set_child_packing, gtk_box_pack_start_defaults, gtk_box_query_child_packing)
 public:
   typedef Box_Helpers::BoxList BoxList;
diff --git a/gtk/src/buttonbox.hg b/gtk/src/buttonbox.hg
index 3bcee26..3935b5a 100644
--- a/gtk/src/buttonbox.hg
+++ b/gtk/src/buttonbox.hg
@@ -38,17 +38,17 @@ namespace Gtk
 enum { BUTTONBOX_DEFAULT = -1 };
 
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
 /** Base class for Gtk::HButtonBox and Gtk::VButtonBox
  *
  * A button box should be used to provide a consistent layout of buttons
  * throughout your application.  There is one default layout and a default
  * spacing value that are persistant across all ButtonBox widgets.
  */
-class ButtonBox : public Box
+class ButtonBox
+  : public Box
 {
   _CLASS_GTKOBJECT(ButtonBox,GtkButtonBox,GTK_BUTTON_BOX,Gtk::Box,GtkBox)
+  _IMPLEMENTS_INTERFACE(Orientable)
   _IGNORE(gtk_button_box_set_spacing, gtk_button_box_get_spacing, gtk_button_box_set_child_size,
           gtk_button_box_set_child_ipadding, gtk_button_box_get_child_size, gtk_button_box_get_child_ipadding)
 public:
diff --git a/gtk/src/cellrenderercombo.hg b/gtk/src/cellrenderercombo.hg
index ca1d454..9590de9 100644
--- a/gtk/src/cellrenderercombo.hg
+++ b/gtk/src/cellrenderercombo.hg
@@ -55,7 +55,7 @@ dnl // not.
 #m4end
 
 #m4 _CONVERSION(`const gchar*',`const Glib::ustring&',__GCHARP_TO_USTRING)
-  _WRAP_SIGNAL(void changed(const Glib::ustring& path, const TreeModel::iterator& iter), "changed")
+  _WRAP_SIGNAL(void changed(const Glib::ustring& path, const TreeModel::iterator& iter), "changed", no_default_handler)
  
   _WRAP_PROPERTY("model", Glib::RefPtr<Gtk::TreeModel>)
   _WRAP_PROPERTY("text_column", int)
diff --git a/gtk/src/clipboard.hg b/gtk/src/clipboard.hg
index 22edabc..7d251fe 100644
--- a/gtk/src/clipboard.hg
+++ b/gtk/src/clipboard.hg
@@ -296,7 +296,7 @@ public:
 
   _WRAP_METHOD(void store(), gtk_clipboard_store)
 
-  _WRAP_SIGNAL(void owner_change(GdkEventOwnerChange* event), "owner_change")
+  _WRAP_SIGNAL(void owner_change(GdkEventOwnerChange* event), "owner_change", no_default_handler)
            
 };
 
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index 4329545..4b60ed3 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -21,6 +21,7 @@
 
 #include <gtkmm/bin.h>
 #include <gtkmm/celllayout.h>
+#include <gtkmm/celleditable.h>
 #include <gtkmm/treemodel.h>
 #include <gtkmm/cellrenderer.h>
 #include <gtkmm/treeview.h>
@@ -55,11 +56,12 @@ namespace Gtk
  */
 class ComboBox
 : public Bin,
-  public CellLayout
-//TODO: Since GTK+ 2.6, this should now inherit also from CellEditable, but we can't add this base without breaking ABI.
+  public CellLayout,
+  public CellEditable
 {
   _CLASS_GTKOBJECT(ComboBox, GtkComboBox, GTK_COMBO_BOX, Gtk::Bin, GtkBin)
   _IMPLEMENTS_INTERFACE(CellLayout)
+  _IMPLEMENTS_INTERFACE(CellEditable)
 public:
   _CTOR_DEFAULT()
   
diff --git a/gtk/src/entrycompletion.hg b/gtk/src/entrycompletion.hg
index 19ade6d..6107958 100644
--- a/gtk/src/entrycompletion.hg
+++ b/gtk/src/entrycompletion.hg
@@ -18,6 +18,7 @@
  */
 
 #include <gtkmm/widget.h>
+#include <gtkmm/celllayout.h>
 #include <gtkmm/treemodel.h>
  
 _DEFS(gtkmm,gtk)
@@ -29,7 +30,6 @@ namespace Gtk
 
 class Entry;
 
-//TODO: This should derive+implement from CellLayout, when we can break ABI.
 //Then we should add "It derives from the Gtk::CellLayout, to allow the user to add extra cells to the Gtk::TreeView with completion matches".
 
 /** Completion functionality for Gtk::Entry.
@@ -58,9 +58,12 @@ class Entry;
  * to differentiate them clearly from completion strings. When an action is 
  * selected, the action_activated signal is emitted. 
  */
-class EntryCompletion : public Glib::Object
+class EntryCompletion
+ : public Glib::Object,
+   public Gtk::CellLayout
 {
   _CLASS_GOBJECT(EntryCompletion, GtkEntryCompletion, GTK_ENTRY_COMPLETION, Glib::Object, GObject)
+  _IMPLEMENT_INTERFACE(CellLayout)
 
 protected:
   _CTOR_DEFAULT()
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index 8ef6492..be54aaa 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -33,8 +33,6 @@ namespace Gtk
 
 _WRAP_ENUM(IconViewDropPosition, GtkIconViewDropPosition)
 
-//TODO: This should derive+implement from CellLayout when we can break ABI.
-
 /** The IconView provides an alternative view of a list model.
  * It displays the model as a grid of icons with labels. 
  * Like the TreeView, it allows the user to select one or multiple items 
@@ -45,9 +43,12 @@ _WRAP_ENUM(IconViewDropPosition, GtkIconViewDropPosition)
  * @ingroup Widgets
  * @ingroup Containers
  */
-class IconView : public Container
+class IconView
+ : public Container,
+   public CellLayout
 {
   _CLASS_GTKOBJECT(IconView, GtkIconView, GTK_ICON_VIEW, Gtk::Container, GtkContainer)
+  _IMPLEMENT_INTERFACE(CellLayout)
 public:
 
   _CTOR_DEFAULT()
diff --git a/gtk/src/paned.hg b/gtk/src/paned.hg
index db33ca9..e131918 100644
--- a/gtk/src/paned.hg
+++ b/gtk/src/paned.hg
@@ -30,8 +30,6 @@ _PINCLUDE(gtkmm/private/container_p.h)
 namespace Gtk
 {
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
 /** This is the base class for widgets with two panes, arranged either
  * horizontally (Gtk::HPaned) or vertically (Gtk::VPaned).
  *
@@ -58,9 +56,12 @@ namespace Gtk
  * @ingroup Widgets
  * @ingroup Containers
  */
-class Paned : public Container
+class Paned
+ : public Container,
+   public Orientable
 {
   _CLASS_GTKOBJECT(Paned,GtkPaned,GTK_PANED,Gtk::Container,GtkContainer)
+  _IMPLEMENTS_INTERFACE(Orientable)
   _IGNORE(gtk_paned_compute_position)
 
 public:
diff --git a/gtk/src/ruler.hg b/gtk/src/ruler.hg
index cbfcc8e..83ec56c 100644
--- a/gtk/src/ruler.hg
+++ b/gtk/src/ruler.hg
@@ -33,8 +33,6 @@ _PINCLUDE(gtkmm/private/widget_p.h)
 namespace Gtk
 {
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
 /** Base class for horizontal or vertical rulers.
  *
  * NOTE this widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest. However, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.
@@ -45,9 +43,12 @@ namespace Gtk
  *
  * @ingroup Widgets
  */
-class Ruler : public Widget
+class Ruler
+ : public Widget,
+   public Orientable
 {
   _CLASS_GTKOBJECT(Ruler,GtkRuler,GTK_RULER,Gtk::Widget,GtkWidget)
+  _IMPLEMENTS_INTERFACE(Orientable)
 protected:
   _CTOR_DEFAULT
 
diff --git a/gtk/src/scalebutton.hg b/gtk/src/scalebutton.hg
index 29d1de9..d83cfbf 100644
--- a/gtk/src/scalebutton.hg
+++ b/gtk/src/scalebutton.hg
@@ -30,8 +30,6 @@ _PINCLUDE(gtkmm/private/button_p.h)
 namespace Gtk
 {
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
 /** A button which pops up a scale widget.
  *
  * This kind of widget is commonly used for volume controls in multimedia
@@ -41,10 +39,12 @@ namespace Gtk
  * @ingroup Widgets
  * @newin{2,12}
  */
-class ScaleButton : public Button
+class ScaleButton
+ : public Button,
+   public Orientable
 {
   _CLASS_GTKOBJECT(ScaleButton, GtkScaleButton, GTK_SCALE_BUTTON, Gtk::Button, GtkButton)
-
+  _IMPLEMENTS_INTERFACE(Orientable)
 public:
   _WRAP_CTOR(ScaleButton(IconSize size, double min, double max, double step, const Glib::StringArrayHandle& icons), gtk_scale_button_new)
 
diff --git a/gtk/src/scrollbar.hg b/gtk/src/scrollbar.hg
index 3a16fd2..5f82360 100644
--- a/gtk/src/scrollbar.hg
+++ b/gtk/src/scrollbar.hg
@@ -29,10 +29,7 @@ _PINCLUDE(gtkmm/private/range_p.h)
 namespace Gtk
 {
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
-/** 
- * The Gtk::Scrollbar widget is an abstract base class for Gtk::HScrollbar
+/**  The Gtk::Scrollbar widget is an abstract base class for Gtk::HScrollbar
  * and Gtk::VScrollbar. It is not very useful in itself. 
  *
  * The position of the thumb in a scrollbar is controlled by the scroll
@@ -46,9 +43,12 @@ namespace Gtk
  *
  * @ingroup Widgets
  */
-class Scrollbar : public Range
+class Scrollbar
+ : public Range,
+   public Orientable
 {
   _CLASS_GTKOBJECT(Scrollbar,GtkScrollbar,GTK_SCROLLBAR,Gtk::Range,GtkRange)
+  _IMPLEMENTS_INTERFACE(Orientable)
 
 protected:
   
diff --git a/gtk/src/separator.hg b/gtk/src/separator.hg
index 025a495..aa20e2e 100644
--- a/gtk/src/separator.hg
+++ b/gtk/src/separator.hg
@@ -28,15 +28,15 @@ _PINCLUDE(gtkmm/private/widget_p.h)
 namespace Gtk
 {
 
-//TODO: Inherit/Implement Orientation when we can break ABI.
-
-
 /** Separator base class.
  * Abstract base class for Gtk::VSeperator and Gtk::HSeperator.
  */
-class Separator : public Widget
+class Separator
+ : public Widget,
+   public Orientable
 {
   _CLASS_GTKOBJECT(Separator,GtkSeparator,GTK_SEPARATOR,Gtk::Widget,GtkWidget)
+  _IMPLEMENTS_INTERFACE(Orientable)
 public:
   
 
diff --git a/gtk/src/spinbutton.hg b/gtk/src/spinbutton.hg
index 6683b12..3a2ba9b 100644
--- a/gtk/src/spinbutton.hg
+++ b/gtk/src/spinbutton.hg
@@ -111,7 +111,7 @@ public:
    */
   _WRAP_SIGNAL(bool output(), "output")
 
-  _WRAP_SIGNAL(bool wrapped(), "wrapped")
+  _WRAP_SIGNAL(void wrapped(), "wrapped")
 
   _WRAP_SIGNAL(void value_changed(), "value_changed")
 
diff --git a/gtk/src/textbuffer.hg b/gtk/src/textbuffer.hg
index 1af6bfa..b596ea7 100644
--- a/gtk/src/textbuffer.hg
+++ b/gtk/src/textbuffer.hg
@@ -576,6 +576,7 @@ _CONVERSION(`const char*',`const Glib::ustring&',`Glib::ustring(p1, p1 + p2)')
   _WRAP_SIGNAL(void end_user_action(), "end_user_action")
 
 #m4 _CONVERSION(`GtkClipboard*',`const Glib::RefPtr<Gtk::Clipboard>&', Glib::wrap($3, true))
+#m4 _CONVERSION(`const Glib::RefPtr<Gtk::Clipboard>&', `GtkClipboard*', Glib::unwrap($3))
   _WRAP_SIGNAL(void paste_done(const Glib::RefPtr<Gtk::Clipboard>& clipboard), "paste_done")
 
   _WRAP_PROPERTY("text", Glib::ustring)
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index 8a003a4..11870a1 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -42,8 +42,6 @@ _WRAP_ENUM(TreeViewColumnSizing, GtkTreeViewColumnSizing)
 // when using --export-all and auto-import.
 // See http://bugzilla.gnome.org/show_bug.cgi?id=309030.
 
-//TODO: This should derive+implement from CellLayout when we can break ABI.
-
 class TreeView;
 
 /** Typedefed as Gtk::TreeView::Column.
@@ -51,9 +49,12 @@ class TreeView;
  *
  * @ingroup TreeView
 */
-class GTKMM_API TreeViewColumn : public Gtk::Object
+class GTKMM_API TreeViewColumn
+  : public Gtk::Object,
+    public CellLayout
 {
   _CLASS_GTKOBJECT(TreeViewColumn, GtkTreeViewColumn, GTK_TREE_VIEW_COLUMN, Gtk::Object, GtkObject)
+  _IMPLEMENT_INTERFACE(CellLayout)
   _IGNORE(gtk_tree_view_column_set_cell_data_func)
 public:
   typedef TreeViewColumn Column;



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