[gtkmm] Inherit Buildable.



commit e44a50d20cd1b0aac51a2ca3adf68b787d7d8967
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 30 19:14:06 2009 +0200

    Inherit Buildable.
    
    * gtk/src/buildable.[hg|ccg]: Added this interface.
    * gtk/src/action.[hg|ccg]:
    * gtk/src/actiongroup.[hg|ccg]:
    * gtk/src/liststore.[hg|ccg]:
    * gtk/src/sizegroup.[hg|ccg]:
    * gtk/src/treestore.[hg|ccg]:
    * gtk/src/widget.[hg|ccg]: Inherit and Implement Buildable.

 ChangeLog              |   12 +++++++
 gtk/src/action.hg      |    7 +++-
 gtk/src/actiongroup.hg |    5 ++-
 gtk/src/buildable.ccg  |   22 +++++++++++++
 gtk/src/buildable.hg   |   79 ++++++++++++++++++++++++++++++++++++++++++++++++
 gtk/src/builder.hg     |    1 +
 gtk/src/filelist.am    |    1 +
 gtk/src/liststore.hg   |    5 ++-
 gtk/src/sizegroup.hg   |    5 ++-
 gtk/src/treestore.hg   |    5 ++-
 gtk/src/widget.hg      |    5 ++-
 11 files changed, 140 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 19f88d5..f945aa2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2009-04-30  Murray Cumming  <murrayc murrayc com>
 
+	Inherit Buildable.
+	
+	* gtk/src/buildable.[hg|ccg]: Added this interface.
+	* gtk/src/action.[hg|ccg]:
+	* gtk/src/actiongroup.[hg|ccg]:
+	* gtk/src/liststore.[hg|ccg]:
+	* gtk/src/sizegroup.[hg|ccg]:
+	* gtk/src/treestore.[hg|ccg]:
+	* gtk/src/widget.[hg|ccg]: Inherit and Implement Buildable.
+		
+2009-04-30  Murray Cumming  <murrayc murrayc com>
+
 	Inherit Activatable, and some build fixes.
 	
 	* gtk/src/button.hg:
diff --git a/gtk/src/action.hg b/gtk/src/action.hg
index c8ebb7b..37d8fb9 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -67,10 +67,13 @@ class Image;
  * Each action can have one or more proxy menu item, toolbar button or other proxy widgets.
  * Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.
  */
-class Action : public Glib::Object
+class Action
+  : public Glib::Object,
+    public Buildable
 {
   _CLASS_GOBJECT(Action, GtkAction, GTK_ACTION, Glib::Object, GObject)
-
+  _IMPLEMENTS_INTERFACE(Buildable)
+ 
 protected:
   /** Creates an empty action. */
   _CTOR_DEFAULT
diff --git a/gtk/src/actiongroup.hg b/gtk/src/actiongroup.hg
index 76ec50c..e49cd4b 100644
--- a/gtk/src/actiongroup.hg
+++ b/gtk/src/actiongroup.hg
@@ -28,9 +28,12 @@ _PINCLUDE(glibmm/private/object_p.h)
 namespace Gtk
 {
   
-class ActionGroup : public Glib::Object
+class ActionGroup
+  : public Glib::Object,
+    public Buildable
 {
   _CLASS_GOBJECT(ActionGroup, GtkActionGroup, GTK_ACTION_GROUP, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(Buildable)
 
 protected:
   _WRAP_CTOR(ActionGroup(const Glib::ustring& name = Glib::ustring()), gtk_action_group_new)
diff --git a/gtk/src/buildable.ccg b/gtk/src/buildable.ccg
new file mode 100644
index 0000000..99f9af3
--- /dev/null
+++ b/gtk/src/buildable.ccg
@@ -0,0 +1,22 @@
+// -*- c++ -*-
+/* $Id: buildable.ccg,v 1.1 2003/01/21 13:38:48 murrayc Exp $ */
+
+/* Copyright 2009 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gtk/gtk.h>
+
diff --git a/gtk/src/buildable.hg b/gtk/src/buildable.hg
new file mode 100644
index 0000000..628bdf1
--- /dev/null
+++ b/gtk/src/buildable.hg
@@ -0,0 +1,79 @@
+/* $Id: buildable.hg,v 1.3 2006/05/18 17:53:15 murrayc Exp $ */
+
+/* Copyright (C) 2009 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/interface.h>
+#include <gtk/gtk.h>
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+
+namespace Gtk
+{
+
+/** TODO.
+ *
+ * @newin3p0
+ */
+class Buildable : public Glib::Interface
+{
+  _CLASS_INTERFACE(Buildable, GtkBuildable, GTK_BUILDABLE, GtkBuildableIface)
+
+public:
+  _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_buildable_set_name)
+  _WRAP_METHOD(Glib::ustring get_name() const, gtk_buildable_get_name)
+  
+//TODO: #m4 _CONVERSION(`(const Glib::RefPtr<Builder>&',`GtkBuilder*',`($3).gobj()') 
+//TODO:  _WRAP_METHOD(void add_child(const Glib::RefPtr<Builder>& builder, const Glib::RefPtr<Glib::Object>& child, const Glib::ustring& type), gtk_buildable_add_child)
+  
+/* TODO: 
+  _WRAP_METHOD(void      gtk_buildable_set_buildable_property (
+						GtkBuilder          *builder,
+						const Glib::ustring& name,
+						const GValue        *value);
+  _WRAP_METHOD(GObject * gtk_buildable_construct_child        (
+						GtkBuilder          *builder,
+						const Glib::ustring& name);
+  _WRAP_METHOD(gboolean  gtk_buildable_custom_tag_start       (
+						GtkBuilder          *builder,
+						GObject             *child,
+						const Glib::ustring& tagname,
+						GMarkupParser       *parser,
+						gpointer            *data);
+  _WRAP_METHOD(void      gtk_buildable_custom_tag_end         (
+						GtkBuilder          *builder,
+						GObject             *child,
+						const Glib::ustring& tagname,
+						gpointer            *data);
+  _WRAP_METHOD(void      gtk_buildable_custom_finished        (
+						GtkBuilder          *builder,
+						GObject             *child,
+						const Glib::ustring& tagname,
+						gpointer             data);
+  _WRAP_METHOD(void      gtk_buildable_parser_finished        (
+						GtkBuilder          *builder);
+  _WRAP_METHOD(GObject * gtk_buildable_get_internal_child     (
+						GtkBuilder          *builder,
+						const Glib::ustring& childname);
+*/
+						
+  //TODO: Properties, signals, vfuncs.
+};
+
+} // namespace Gtk
+
diff --git a/gtk/src/builder.hg b/gtk/src/builder.hg
index e13212c..707be7c 100644
--- a/gtk/src/builder.hg
+++ b/gtk/src/builder.hg
@@ -330,6 +330,7 @@ public:
   _WRAP_METHOD(bool add_from_string(const char* buffer, gsize length), gtk_builder_add_from_string, errthrow)
 
   //TODO: Custom-implement this and prevent it from being used with GTK_WIDGET-derived types?
+  //TODO: Make this return a Glib::RefPtr<Gtk::Buildable>? Check what the C API really does - and document that if so.
   _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_object(const Glib::ustring& name), gtk_builder_get_object, refreturn)
 
   /** Get a widget from the Builder file.
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 37cb32e..591ae74 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -26,6 +26,7 @@ gtkmm_files_any_hg =		\
 	assistant.hg		\
 	bin.hg			\
 	box.hg			\
+	buildable.hg		\
 	builder.hg		\
 	button.hg		\
 	buttonbox.hg		\
diff --git a/gtk/src/liststore.hg b/gtk/src/liststore.hg
index a4aa3e6..045e9c1 100644
--- a/gtk/src/liststore.hg
+++ b/gtk/src/liststore.hg
@@ -22,6 +22,7 @@
 #include <gtkmm/treesortable.h>
 #include <gtkmm/treedragdest.h>
 #include <gtkmm/treedragsource.h>
+#include <gtkmm/buildable.h>
 // We couldn't include it in treemodel.h, but doing it here makes it easier for people.
 #include <gtkmm/treepath.h>
 
@@ -42,13 +43,15 @@ class ListStore :
   public TreeModel,
   public TreeSortable,
   public TreeDragSource,
-  public TreeDragDest
+  public TreeDragDest,
+  public Buildable
 {
   _CLASS_GOBJECT(ListStore, GtkListStore, GTK_LIST_STORE, Glib::Object, GObject)
   _IMPLEMENTS_INTERFACE(TreeModel)
   _IMPLEMENTS_INTERFACE(TreeSortable)
   _IMPLEMENTS_INTERFACE(TreeDragSource)
   _IMPLEMENTS_INTERFACE(TreeDragDest)
+  _IMPLEMENTS_INTERFACE(Buildable)
   _IGNORE(gtk_list_store_insert_after,
           gtk_list_store_prepend, gtk_list_store_append, gtk_list_store_set_value,
           gtk_list_store_insert,
diff --git a/gtk/src/sizegroup.hg b/gtk/src/sizegroup.hg
index b8d0fbe..b14e046 100644
--- a/gtk/src/sizegroup.hg
+++ b/gtk/src/sizegroup.hg
@@ -48,9 +48,12 @@ _WRAP_ENUM(SizeGroupMode, GtkSizeGroupMode)
  * Gtk::SIZE_GROUP_HORIZONTAL or Gtk::SIZE_GROUP_BOTH, and the vertical size from the vertical requisition of all widgets  
  * that can be reached from the widget by a chain of size groups of type Gtk::SIZE_GROUP_VERTICAL or Gtk::SIZE_GROUP_BOTH.
  */
-class SizeGroup : public Glib::Object
+class SizeGroup
+  : public Glib::Object,
+    public Buildable
 {
   _CLASS_GOBJECT(SizeGroup,GtkSizeGroup,GTK_SIZE_GROUP,Glib::Object,GObject)
+  _IMPLEMENTS_INTERFACE(Buildable)
 protected:
   explicit SizeGroup(SizeGroupMode mode);
 
diff --git a/gtk/src/treestore.hg b/gtk/src/treestore.hg
index 8b76356..ed1233d 100644
--- a/gtk/src/treestore.hg
+++ b/gtk/src/treestore.hg
@@ -22,6 +22,7 @@
 #include <gtkmm/treesortable.h>
 #include <gtkmm/treedragdest.h>
 #include <gtkmm/treedragsource.h>
+#include <gtkmm/buildable.h>
 // We couldn't include it in treemodel.h, but doing it here makes it easier for people.
 #include <gtkmm/treepath.h>
 
@@ -39,13 +40,15 @@ class TreeStore :
   public Gtk::TreeModel,
   public TreeSortable,
   public TreeDragSource,
-  public TreeDragDest
+  public TreeDragDest,
+  public Buildable
 {
   _CLASS_GOBJECT(TreeStore, GtkTreeStore, GTK_TREE_STORE, Glib::Object, GObject)
   _IMPLEMENTS_INTERFACE(TreeModel)
   _IMPLEMENTS_INTERFACE(TreeSortable)
   _IMPLEMENTS_INTERFACE(TreeDragSource)
   _IMPLEMENTS_INTERFACE(TreeDragDest)
+  _IMPLEMENTS_INTERFACE(Buildable)
   _IGNORE(gtk_tree_store_set, gtk_tree_store_set_valist,
           gtk_tree_store_insert, gtk_tree_store_append, gtk_tree_store_prepend,
           gtk_tree_store_reorder, gtk_tree_store_move_after, gtk_tree_store_move_before)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 15300c7..d15ca96 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -36,6 +36,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <atkmm/implementor.h>
 #endif //GTKMM_ATKMM_ENABLED
 
+#include <gtkmm/buildable.h>
 #include <gdkmm/event.h>
 #include <gdkmm/types.h>
 #include <gdkmm/window.h>
@@ -107,13 +108,15 @@ typedef Gdk::Rectangle Allocation;
  * a Gdk::Window.
  */
 class Widget
-: public Object
+: public Object,
+  public Buildable
 #ifdef GTKMM_ATKMM_ENABLED
   ,public Atk::Implementor
 #endif //GTKMM_ATKMM_ENABLED
 {
   _CLASS_GTKOBJECT(Widget,GtkWidget,GTK_WIDGET,Gtk::Object,GtkObject)
   _IMPLEMENTS_INTERFACE(Atk::Implementor, ifdef GTKMM_ATKMM_ENABLED)
+  _IMPLEMENTS_INTERFACE(Buildable)
   _IGNORE(gtk_widget_set, gtk_widget_queue_clear, gtk_widget_queue_clear_area, gtk_widget_draw,
           gtk_widget_set_uposition, gtk_widget_set_usize, gtk_widget_set_visual, gtk_widget_push_visual,
           gtk_widget_pop_visual, gtk_widget_set_default_visual, gtk_widget_set_rc_style, gtk_widget_restore_default_style)



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