[gtkmm/gtkmm-3maybe] Inherit Buildable.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtkmm/gtkmm-3maybe] Inherit Buildable.
- Date: Thu, 30 Apr 2009 13:14:34 -0400 (EDT)
commit 860549aec2bf38c98efd30c8d00502b605189103
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/Makefile_list_of_hg.am_fragment | 2 +-
gtk/src/action.hg | 5 ++-
gtk/src/actiongroup.hg | 5 ++-
gtk/src/buildable.ccg | 22 +++++++++
gtk/src/buildable.hg | 79 +++++++++++++++++++++++++++++++
gtk/src/builder.hg | 1 +
gtk/src/liststore.hg | 5 ++-
gtk/src/sizegroup.hg | 5 ++-
gtk/src/treestore.hg | 5 ++-
gtk/src/widget.hg | 5 ++-
11 files changed, 139 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fd47e39..8fde935 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/Makefile_list_of_hg.am_fragment b/gtk/src/Makefile_list_of_hg.am_fragment
index a5e70a0..20f14a8 100644
--- a/gtk/src/Makefile_list_of_hg.am_fragment
+++ b/gtk/src/Makefile_list_of_hg.am_fragment
@@ -7,7 +7,7 @@ files_posix_hg = pagesetupunixdialog.hg printunixdialog.hg \
files_win32_hg =
files_general_hg = aboutdialog.hg accelgroup.hg accellabel.hg action.hg actiongroup.hg activatable.hg adjustment.hg alignment.hg \
arrow.hg aspectframe.hg assistant.hg \
- bin.hg box.hg builder.hg button.hg buttonbox.hg \
+ bin.hg box.hg buildable.hg builder.hg button.hg buttonbox.hg \
calendar.hg celleditable.hg celllayout.hg cellview.hg \
cellrenderer.hg cellrendereraccel.hg cellrenderercombo.hg cellrendererpixbuf.hg cellrendererprogress.hg cellrendererspin.hg cellrenderertext.hg cellrenderertoggle.hg \
checkbutton.hg checkmenuitem.hg clipboard.hg colorselection.hg colorbutton.hg \
diff --git a/gtk/src/action.hg b/gtk/src/action.hg
index 0e2366d..7088d52 100644
--- a/gtk/src/action.hg
+++ b/gtk/src/action.hg
@@ -65,9 +65,12 @@ 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. */
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 4eb0430..089657c 100644
--- a/gtk/src/builder.hg
+++ b/gtk/src/builder.hg
@@ -293,6 +293,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/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 2121050..9b41e88 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -26,6 +26,7 @@
#include <atkmm/implementor.h>
#endif //GTKMM_ATKMM_ENABLED
+#include <gtkmm/buildable.h>
#include <gdkmm/event.h>
#include <gdkmm/types.h>
#include <gdkmm/window.h>
@@ -100,13 +101,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]