[glom] Remove ifdefs for disabled gtkmm vfuncs.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glom] Remove ifdefs for disabled gtkmm vfuncs.
- Date: Mon, 1 Jun 2009 08:32:44 -0400 (EDT)
commit ca2a9ed735f35b384f5c28e5065ba403933c502e
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jun 1 12:28:44 2009 +0200
Remove ifdefs for disabled gtkmm vfuncs.
* glom/mode_data/flowtablewithfields.cc:
* glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc:
* glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h:
* glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc:
* glom/utility_widgets/db_adddel/cellrenderer_buttontext.h:
* glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc:
* glom/utility_widgets/db_adddel/db_adddel_withbuttons.h:
* glom/utility_widgets/db_adddel/glom_db_treemodel.cc:
* glom/utility_widgets/db_adddel/glom_db_treemodel.h:
* glom/utility_widgets/flowtable.cc:
* glom/utility_widgets/flowtable.h: Remove ifdefs for disabled gtkmm vfuncs,
because they are no enabled in Maemo 5 (Fremantle).
---
ChangeLog | 17 ++
glom/mode_data/flowtablewithfields.cc | 4 +-
.../db_adddel/cellrenderer_buttonimage.cc | 46 +----
.../db_adddel/cellrenderer_buttonimage.h | 3 -
.../db_adddel/cellrenderer_buttontext.cc | 47 +----
.../db_adddel/cellrenderer_buttontext.h | 3 -
.../db_adddel/db_adddel_withbuttons.cc | 2 -
.../db_adddel/db_adddel_withbuttons.h | 2 -
.../utility_widgets/db_adddel/glom_db_treemodel.cc | 221 --------------------
glom/utility_widgets/db_adddel/glom_db_treemodel.h | 17 --
glom/utility_widgets/flowtable.cc | 117 +----------
glom/utility_widgets/flowtable.h | 7 +-
12 files changed, 27 insertions(+), 459 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4c0efe9..e2ee2b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2009-06-01 Murray Cumming <murrayc murrayc com>
+
+ Remove ifdefs for disabled gtkmm vfuncs.
+
+ * glom/mode_data/flowtablewithfields.cc:
+ * glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc:
+ * glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h:
+ * glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc:
+ * glom/utility_widgets/db_adddel/cellrenderer_buttontext.h:
+ * glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc:
+ * glom/utility_widgets/db_adddel/db_adddel_withbuttons.h:
+ * glom/utility_widgets/db_adddel/glom_db_treemodel.cc:
+ * glom/utility_widgets/db_adddel/glom_db_treemodel.h:
+ * glom/utility_widgets/flowtable.cc:
+ * glom/utility_widgets/flowtable.h: Remove ifdefs for disabled gtkmm vfuncs,
+ because they are no enabled in Maemo 5 (Fremantle).
+
2009-05-29 Armin Burgmeier <armin openismus com>
* glom/libglom/connectionpool.cc: After invalidating a cached
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 3640619..7580cf1 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -50,13 +50,13 @@ FlowTableWithFields::Info::Info()
FlowTableWithFields::FlowTableWithFields(const Glib::ustring& table_name)
:
-#if !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#if !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
// This creates a custom GType for us, to override vfuncs and default
// signal handlers even with the reduced API (done in flowtable.cc).
// TODO: It is necessary to do this in all derived classes which is
// rather annoying, though I don't see another possibility at the moment. armin.
Glib::ObjectBase("Glom_FlowTable"),
-#endif // !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#endif // !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
m_placeholder(0),
m_table_name(table_name)
{
diff --git a/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc b/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc
index 4b5a9f5..7fb7816 100644
--- a/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc
+++ b/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.cc
@@ -23,35 +23,6 @@
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkcellrendererpixbuf.h>
-#ifndef GLIBMM_VFUNCS_ENABLED
-namespace
-{
- GtkCellRendererPixbufClass* parent_class;
-}
-#endif
-
-namespace Glom
-{
-
-#ifndef GLIBMM_VFUNCS_ENABLED
- gboolean GlomCellRenderer_ButtonImage::activate_impl(GtkCellRenderer* cell, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)cell));
- if(obj_base)
- {
- GlomCellRenderer_ButtonImage* const obj = dynamic_cast<GlomCellRenderer_ButtonImage*>(obj_base);
- if(obj)
- {
- return obj->activate_vfunc(event, *Glib::wrap(widget), path, Glib::wrap(background_area), Glib::wrap(cell_area), static_cast<Gtk::CellRendererState>(flags));
- }
- }
- else if(GTK_CELL_RENDERER_CLASS(parent_class)->activate)
- return GTK_CELL_RENDERER_CLASS(parent_class)->activate(cell, event, widget, path, background_area, cell_area, flags);
- else
- return FALSE;
- }
-#endif
-} // namespace Glom
namespace Glom
{
@@ -59,15 +30,6 @@ namespace Glom
GlomCellRenderer_ButtonImage::GlomCellRenderer_ButtonImage():
Glib::ObjectBase("GlomCellRenderer_ButtonImage") // Create a new GType for us
{
-#ifndef GLIBMM_VFUNCS_ENABLED
- if(parent_class == NULL)
- {
- GtkCellRendererClass* klass = GTK_CELL_RENDERER_GET_CLASS(gobj());
- klass->activate = &GlomCellRenderer_ButtonImage::activate_impl;
- parent_class = GTK_CELL_RENDERER_PIXBUF_CLASS(g_type_class_peek_parent(klass));
- }
-#endif
-
const Gtk::StockID stock_id = Gtk::Stock::OPEN; //A default.
set_property("stock_id", stock_id.get_string());
@@ -88,13 +50,7 @@ bool GlomCellRenderer_ButtonImage::activate_vfunc(GdkEvent* event, Gtk::Widget&
//TODO: It would be nice to depress this like a real button.
//Call base class:
- bool result = false;
-#ifdef GLIBMM_VFUNCS_ENABLED
- result = CellRendererPixbuf::activate_vfunc(event, widget, path, background_area, cell_area, flags);
-#else
- if(GTK_CELL_RENDERER_CLASS(parent_class)->activate)
- result = GTK_CELL_RENDERER_CLASS(parent_class)->activate(GTK_CELL_RENDERER(gobj()), event, widget.gobj(), path.c_str(), const_cast<GdkRectangle*>(background_area.gobj()), const_cast<GdkRectangle*>(cell_area.gobj()), static_cast<GtkCellRendererState>(flags));
-#endif
+ bool result = CellRendererPixbuf::activate_vfunc(event, widget, path, background_area, cell_area, flags);
m_signal_clicked.emit( Gtk::TreeModel::Path(path) );
diff --git a/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h b/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h
index 1b1b826..342c5c6 100644
--- a/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h
+++ b/glom/utility_widgets/db_adddel/cellrenderer_buttonimage.h
@@ -39,9 +39,6 @@ public:
type_signal_clicked signal_clicked();
private:
-#ifndef GLIBMM_VFUNCS_ENABLED
- static gboolean activate_impl(GtkCellRenderer* cell, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags);
-#endif
virtual bool activate_vfunc(GdkEvent* event, Gtk::Widget& widget, const Glib::ustring& path, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::CellRendererState flags);
diff --git a/glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc b/glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc
index 99ba39c..08ba653 100644
--- a/glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc
+++ b/glom/utility_widgets/db_adddel/cellrenderer_buttontext.cc
@@ -21,35 +21,6 @@
#include "cellrenderer_buttontext.h"
#include <gtk/gtkcellrenderertext.h>
-#ifndef GLIBMM_VFUNCS_ENABLED
-namespace
-{
- GtkCellRendererTextClass* parent_class;
-}
-#endif
-
-namespace Glom
-{
-
-#ifndef GLIBMM_VFUNCS_ENABLED
- gboolean GlomCellRenderer_ButtonText::activate_impl(GtkCellRenderer* cell, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)cell));
- if(obj_base)
- {
- GlomCellRenderer_ButtonText* const obj = dynamic_cast<GlomCellRenderer_ButtonText*>(obj_base);
- if(obj)
- {
- return obj->activate_vfunc(event, *Glib::wrap(widget), path, Glib::wrap(background_area), Glib::wrap(cell_area), static_cast<Gtk::CellRendererState>(flags));
- }
- }
- else if(GTK_CELL_RENDERER_CLASS(parent_class)->activate)
- return GTK_CELL_RENDERER_CLASS(parent_class)->activate(cell, event, widget, path, background_area, cell_area, flags);
- else
- return FALSE;
- }
-#endif
-} // namespace Glom
namespace Glom
{
@@ -57,15 +28,6 @@ namespace Glom
GlomCellRenderer_ButtonText::GlomCellRenderer_ButtonText():
Glib::ObjectBase("GlomCellRenderer_ButtonText") // Create a new GType for us
{
-#ifndef GLIBMM_VFUNCS_ENABLED
- if(parent_class == NULL)
- {
- GtkCellRendererClass* klass = GTK_CELL_RENDERER_GET_CLASS(gobj());
- klass->activate = &GlomCellRenderer_ButtonText::activate_impl;
- parent_class = GTK_CELL_RENDERER_TEXT_CLASS(g_type_class_peek_parent(klass));
- }
-#endif
-
//const Gtk::StockID stock_id = Gtk::Stock::OPEN; //A default.
//property_stock_id() = stock_id.get_string();
@@ -85,14 +47,7 @@ bool GlomCellRenderer_ButtonText::activate_vfunc(GdkEvent* event, Gtk::Widget& w
//TODO: It would be nice to depress this like a real button.
//Call base class:
- bool result = false;
-#ifdef GLIBMM_VFUNCS_ENABLED
- CellRendererText::activate_vfunc(event, widget, path, background_area, cell_area, flags);
-#else
- if(GTK_CELL_RENDERER_CLASS(parent_class)->activate)
- result = GTK_CELL_RENDERER_CLASS(parent_class)->activate(GTK_CELL_RENDERER(gobj()), event, widget.gobj(), path.c_str(), const_cast<GdkRectangle*>(background_area.gobj()), const_cast<GdkRectangle*>(cell_area.gobj()), static_cast<GtkCellRendererState>(flags));
-#endif
-
+ bool result = CellRendererText::activate_vfunc(event, widget, path, background_area, cell_area, flags);
m_signal_clicked.emit( Gtk::TreeModel::Path(path) );
return result;
diff --git a/glom/utility_widgets/db_adddel/cellrenderer_buttontext.h b/glom/utility_widgets/db_adddel/cellrenderer_buttontext.h
index 5ca230f..19bdcfb 100644
--- a/glom/utility_widgets/db_adddel/cellrenderer_buttontext.h
+++ b/glom/utility_widgets/db_adddel/cellrenderer_buttontext.h
@@ -39,9 +39,6 @@ public:
type_signal_clicked signal_clicked();
private:
-#ifndef GLIBMM_VFUNCS_ENABLED
- static gboolean activate_impl(GtkCellRenderer* cell, GdkEvent* event, GtkWidget* widget, const gchar* path, GdkRectangle* background_area, GdkRectangle* cell_area, GtkCellRendererState flags);
-#endif
virtual bool activate_vfunc(GdkEvent* event, Gtk::Widget& widget, const Glib::ustring& path, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, Gtk::CellRendererState flags);
diff --git a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
index 9e3846d..6bc3551 100644
--- a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
@@ -110,7 +110,6 @@ void DbAddDel_WithButtons::setup_buttons()
m_HBox.show();
}
-#ifdef GLIBMM_VFUNCS_ENABLED
// TODO_maemo: Why is this show_all_vfunc, and not on_show()? Where is the
// difference? If this was on_show we could just connect to signal_show()
// when vfuncs and/or default signal handlers are not available.
@@ -122,7 +121,6 @@ void DbAddDel_WithButtons::show_all_vfunc()
//Hide some stuff:
setup_buttons();
}
-#endif
void DbAddDel_WithButtons::set_allow_view_details(bool val)
{
diff --git a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
index 0b7c99f..a462981 100644
--- a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
+++ b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
@@ -46,9 +46,7 @@ private:
void on_button_del();
void on_button_edit();
-#ifdef GLIBMM_VFUNCS_ENABLED
virtual void show_all_vfunc();
-#endif
//member widgets:
Gtk::HBox m_HBox;
diff --git a/glom/utility_widgets/db_adddel/glom_db_treemodel.cc b/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
index d825de0..8f04ced 100644
--- a/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
+++ b/glom/utility_widgets/db_adddel/glom_db_treemodel.cc
@@ -30,211 +30,6 @@
namespace Glom
{
-#ifndef GLIBMM_VFUNCS_ENABLED
- // C vfuncs implementation. Merely copied from gtkmm.
- GtkTreeModelFlags DbTreeModel::glom_get_flags_impl(GtkTreeModel* model)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return GtkTreeModelFlags(cpp_model->get_flags_vfunc());
- }
- else
- return GtkTreeModelFlags(0);
- }
-
- gint DbTreeModel::glom_get_n_columns_impl(GtkTreeModel* model)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return cpp_model->get_n_columns_vfunc();
- }
- else
- return 0;
- }
-
- GType DbTreeModel::glom_get_column_type_impl(GtkTreeModel* model, gint index)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return cpp_model->get_column_type_vfunc(index);
- }
- else
- return G_TYPE_NONE;
- }
-
- void DbTreeModel::glom_get_value_impl(GtkTreeModel* model, GtkTreeIter* iter, gint column, GValue* value)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- cpp_model->get_value_vfunc(Gtk::TreeModel::iterator(model, iter), column, *reinterpret_cast<Glib::ValueBase*>(value));
- }
- }
-
- gboolean DbTreeModel::glom_iter_next_impl(GtkTreeModel* model, GtkTreeIter* iter)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
-
- TreeModel::iterator iter_input = TreeModel::iterator(model, iter);
- TreeModel::iterator iter_next(model, iter);
- const gboolean retval = cpp_model->iter_next_vfunc(iter_input, iter_next);
-
- if(retval)
- *iter = *(iter_next.gobj());
-
- return retval;
- }
- else
- return FALSE;
- }
-
- gboolean DbTreeModel::glom_iter_children_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
-
- TreeModel::iterator iter_out(model, iter);
- const gboolean retval = cpp_model->iter_children_vfunc(TreeModel::iterator(model, parent), iter_out);
-
- if(retval)
- *iter = *(iter_out.gobj());
-
- return retval;
- }
- else
- return FALSE;
- }
-
- gboolean DbTreeModel::glom_iter_has_child_impl(GtkTreeModel* model, GtkTreeIter* iter)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return cpp_model->iter_has_child_vfunc(TreeModel::iterator(model, iter));
- }
- else
- return FALSE;
- }
-
- gint DbTreeModel::glom_iter_n_children_impl(GtkTreeModel* model, GtkTreeIter* iter)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return cpp_model->iter_n_children_vfunc(TreeModel::iterator(model, iter));
- }
- else
- return 0;
- }
-
- gboolean DbTreeModel::glom_iter_nth_child_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent, gint n)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
-
- TreeModel::iterator iter_out(model, iter);
- gboolean retval = false;
-
- // Deal with this special case, documented in the C docs as:
- // "As a special case, if @parent is %NULL, then the nth root node is set.":
- if(!parent)
- retval = cpp_model->iter_nth_root_child_vfunc(n, iter_out);
- else
- retval = cpp_model->iter_nth_child_vfunc(TreeModel::iterator(model, parent), n, iter_out);
-
- if(retval)
- *iter = *(iter_out.gobj());
-
- return retval;
- }
- else
- return FALSE;
- }
-
- gboolean DbTreeModel::glom_iter_parent_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* child)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
-
- TreeModel::iterator iter_out(model, iter);
- const gboolean retval = cpp_model->iter_parent_vfunc(TreeModel::iterator(model, child), iter_out);
-
- if(retval)
- *iter = *(iter_out.gobj());
-
- return retval;
- }
- else
- return FALSE;
- }
-
- GtkTreePath* DbTreeModel::glom_get_path_impl(GtkTreeModel* model, GtkTreeIter* iter)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
- return cpp_model->get_path_vfunc(TreeModel::iterator(model, iter)).gobj_copy();
- }
- else
- return NULL;
- }
-
- gboolean DbTreeModel::glom_get_iter_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreePath* path)
- {
- Glib::ObjectBase* const obj_base = static_cast<Glib::ObjectBase*>(Glib::ObjectBase::_get_current_wrapper((GObject*)model));
- if(obj_base)
- {
- Glom::DbTreeModel* cpp_model = dynamic_cast<Glom::DbTreeModel*>(obj_base);
- g_assert(cpp_model);
-
- TreeModel::iterator iter_out(model, iter);
-
- const gboolean retval = cpp_model->get_iter_vfunc(Gtk::TreeModel::Path(path, true), iter_out);
-
- if(retval)
- *iter = *(iter_out.gobj());
-
- return retval;
- }
- else
- return FALSE;
- }
-#endif // !GLIBMM_VFUNCS_ENABLED
-} // namespace Glom
-
-namespace Glom
-{
-
DbTreeModelRow::DbTreeModelRow()
: m_values_retrieved(false),
m_removed(false),
@@ -390,22 +185,6 @@ DbTreeModel::DbTreeModel(const Gtk::TreeModelColumnRecord& columns, const FoundS
//GType gtype = G_OBJECT_TYPE(gobj()); //The custom GType created in the Object constructor, from the typeid.
//Gtk::TreeModel::add_interface( gtype );
-#ifndef GLIBMM_VFUNCS_ENABLED
- GtkTreeModelIface* iface = GTK_TREE_MODEL_GET_IFACE(gobj());
- iface->get_flags = glom_get_flags_impl;
- iface->get_n_columns = glom_get_n_columns_impl;
- iface->get_column_type = glom_get_column_type_impl;
- iface->get_value = glom_get_value_impl;
- iface->iter_next = glom_iter_next_impl;
- iface->iter_children = glom_iter_children_impl;
- iface->iter_has_child = glom_iter_has_child_impl;
- iface->iter_n_children = glom_iter_n_children_impl;
- iface->iter_nth_child = glom_iter_nth_child_impl;
- iface->iter_parent = glom_iter_parent_impl;
- iface->get_path = glom_get_path_impl;
- iface->get_iter = glom_get_iter_impl;
-#endif // !GLIBMM_VFUNCS_ENABLED
-
m_iface_initialized = true; //Prevent us from calling add_interface() on the same gtype again.
}
diff --git a/glom/utility_widgets/db_adddel/glom_db_treemodel.h b/glom/utility_widgets/db_adddel/glom_db_treemodel.h
index 14d7150..286282c 100644
--- a/glom/utility_widgets/db_adddel/glom_db_treemodel.h
+++ b/glom/utility_widgets/db_adddel/glom_db_treemodel.h
@@ -140,23 +140,6 @@ private:
virtual void set_value_impl(const iterator& row, int column, const Glib::ValueBase& value);
-#ifndef GLIBMM_VFUNCS_ENABLED
- // These are the hand-coded C vfunc implementations in case the vfuncs API
- // has been disabled in glibmm.
- static GtkTreeModelFlags glom_get_flags_impl(GtkTreeModel* model);
- static gint glom_get_n_columns_impl(GtkTreeModel* model);
- static GType glom_get_column_type_impl(GtkTreeModel* model, gint index);
- static void glom_get_value_impl(GtkTreeModel* model, GtkTreeIter* iter, gint column, GValue* value);
- static gboolean glom_iter_next_impl(GtkTreeModel* model, GtkTreeIter* iter);
- static gboolean glom_iter_children_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent);
- static gboolean glom_iter_has_child_impl(GtkTreeModel* model, GtkTreeIter* iter);
- static gint glom_iter_n_children_impl(GtkTreeModel* model, GtkTreeIter* iter);
- static gboolean glom_iter_nth_child_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent, gint n);
- static gboolean glom_iter_parent_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* child);
- static GtkTreePath* glom_get_path_impl(GtkTreeModel* model, GtkTreeIter* iter);
- static gboolean glom_get_iter_impl(GtkTreeModel* model, GtkTreeIter* iter, GtkTreePath* path);
-#endif // !GLIBMM_VUFNCS_ENABLED
-
private:
typedef DbTreeModelRow typeRow; //X columns, all of type Value.
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 9b788b2..2880413 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -26,111 +26,9 @@
#include <gdkmm/window.h>
#include <gtk/gtk.h>
-// So we don't need to check for the condition above all the time
-
-// A GObject for the flowtable to allow overriding vfuncs even with the
-// reduced glibmm API
-namespace
-{
-#if 0
-#define GLOM_TYPE_FLOWTABLE (glom_flowtable_get_type())
-#define GLOM_FLOWTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GLOM_TYPE_FLOWTABLE, GlomFlowtable))
-#endif
-
-#ifndef GLIBMM_VFUNCS_ENABLED
- GtkContainerClass* parent_class = NULL;
-#endif
-
-#if 0
- struct GlomFlowtableClass
- {
- GtkContainerClass parent_class;
- }
-
- struct GlomFlowtable
- {
- GtkContainer parent_instance;
- Glom::FlowTable* cpp_table;
- }
-
- void glom_flowtable_init(GlowFlowtable* object)
- {
- object->cpp_table = NULL;
- }
-#endif
-
-#if 0
- void glom_flowtable_class_init(gpointer g_class, gpointer class_data)
- {
- GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(g_class);
- GtkContainerClass* container_class = GTK_CONTAINER_CLASS(g_class);
-
- parent_class = GTK_CONTAINER_CLASS(g_type_class_peek_parent(g_class));
-
- }
-
- GType glom_flowtable_get_type()
- {
- static GType flowtable_type = 0;
-
- if(!flowtable_type)
- {
- static const GTypeInfo flowtable_type_info = {
- sizeof(GlomFlowtableClass), /* class_size */
- NULL, /* base_init */
- NULL, /* base_finalize */
- glom_flowtable_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof(GlomFlowtable), /* instance_size */
- 0, /* n_preallocs */
- glom_flowtable_init, /* instance_init */
- NULL /* value_table */
- };
-
- flowtable_type = g_type_register_static(GTK_TYPE_CONTAINER, "GlomFlowtable", &flowtable_type_info, 0);
- }
-
- return flowtable_type;
- }
-#endif
-}
namespace Glom
{
-#ifndef GLIBMM_VFUNCS_ENABLED
- void FlowTable::glom_forall_impl(GtkContainer* container, gboolean include_internals, GtkCallback callback, gpointer callback_data)
- {
- Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
- Glib::ObjectBase::_get_current_wrapper((GObject*)container));
-
- if(obj_base)
- {
- Glom::FlowTable* table = dynamic_cast<Glom::FlowTable*>(obj_base);
- g_assert(table);
- table->forall_vfunc(include_internals, callback, callback_data);
- }
- else if(parent_class->forall)
- parent_class->forall(container, include_internals, callback, callback_data);
- }
-
- GType FlowTable::glom_child_type_impl(GtkContainer* container)
- {
- Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
- Glib::ObjectBase::_get_current_wrapper((GObject*)container));
-
- if(obj_base)
- {
- Glom::FlowTable* table = dynamic_cast<Glom::FlowTable*>(obj_base);
- g_assert(table);
- return table->child_type_vfunc();
- }
- else if(parent_class->child_type)
- return parent_class->child_type(container);
- else
- return G_TYPE_NONE;
- }
-#endif // !GLIBMM_VFUNCS_ENABLED
#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
// TODO: It is probably OK doing static_cast here.
@@ -244,7 +142,7 @@ namespace Glom
return FALSE;
}
#endif // !GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
-}
+} //namespace Glom
namespace Glom
{
@@ -292,18 +190,18 @@ FlowTable::FlowTableItem::FlowTableItem(Gtk::Widget* first, Gtk::Widget* second,
FlowTable::FlowTable()
:
-#if !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#if !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
// This creates a custom GType for us, to override vfuncs and default
// signal handlers even with the reduced API.
// TODO: It is necessary to do this in all derived classes which is
// rather annoying, though I don't see another possibility at the moment. armin.
Glib::ObjectBase("Glom_FlowTable"),
-#endif // !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#endif // ! !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
m_columns_count(1),
m_padding(0),
m_design_mode(false)
{
-#if !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#if !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
// TODO: Thread safety?
// TODO: We could also set up a Glib::Class derived object with a custom
// class init function so we do not need to lookup the class object by
@@ -313,11 +211,6 @@ FlowTable::FlowTable()
GtkContainerClass* container_class = G_TYPE_INSTANCE_GET_CLASS(gobj(), G_TYPE_FROM_INSTANCE(gobj()), GtkContainerClass);
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(container_class);
-#ifndef GLIBMM_VFUNCS_ENABLED
- container_class->forall = &Glom::FlowTable::glom_forall_impl;
- container_class->child_type = &Glom::FlowTable::glom_child_type_impl;
-#endif // !GLIBMM_VFUNCS_ENABLED
-
#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
container_class->add = &Glom::FlowTable::glom_add_impl;
container_class->remove = &Glom::FlowTable::glom_remove_impl;
@@ -331,7 +224,7 @@ FlowTable::FlowTable()
parent_class = GTK_CONTAINER_CLASS(g_type_class_peek_parent(container_class));
}
-#endif // !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
+#endif // !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
set_flags(Gtk::NO_WINDOW);
set_redraw_on_allocate(false);
diff --git a/glom/utility_widgets/flowtable.h b/glom/utility_widgets/flowtable.h
index ed937ed..db57674 100644
--- a/glom/utility_widgets/flowtable.h
+++ b/glom/utility_widgets/flowtable.h
@@ -59,12 +59,7 @@ public:
void forall(const ForallSlot& slot);
protected:
-#ifndef GLIBMM_VFUNCS_ENABLED
- // These are the hand-coded C vfunc implementations in case the
- // corresponding glibmm API has been disabled
- static void glom_forall_impl(GtkContainer* container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
- static GType glom_child_type_impl(GtkContainer* container);
-#endif
+
#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
// These are the hand-coded C default signal handlers in case the
// corresponding glibmm API has been disabled
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]