[gtkmm/gtkmm-3maybe: 19/19] Remove more deprecated methods.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3maybe: 19/19] Remove more deprecated methods.
- Date: Tue, 5 Jan 2010 09:53:56 +0000 (UTC)
commit 32897f83a8ea53ba8dcb34b37f3ce2ac07da9a4b
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Jan 5 10:53:30 2010 +0100
Remove more deprecated methods.
* gtk/src/filelist.am:
* gtk/src/curve.[hg|cc]:
* gtk/src/inputdialog.[hg|ccg]: Removed deprecated classes.
* gtk/gtkmm/border.h: Removed because this file is now generated.
* gtk/src/toolbar: Inherit (and implement) from CellLayout.
* gtk/src/button.hg, fixed.hg, recentmanager.hg, scalebutton.hg,
toolbar.hg, treeview.hg, treeviewcolumn.hg, widget.hg:
Removed deprecated methods, discovered by removing undefs.
* gtk/src/celllayout.hg: Added get_first_cell() as a replacement for
TreeViewColumng::get_first_cell().
ChangeLog | 15 ++++++++
gtk/gtkmm/border.h | 61 -------------------------------
gtk/src/button.hg | 4 +--
gtk/src/celllayout.ccg | 18 +++++++++-
gtk/src/celllayout.hg | 12 ++++++
gtk/src/curve.ccg | 42 ---------------------
gtk/src/curve.hg | 87 --------------------------------------------
gtk/src/filelist.am | 1 +
gtk/src/fixed.hg | 8 +----
gtk/src/inputdialog.ccg | 26 -------------
gtk/src/inputdialog.hg | 74 -------------------------------------
gtk/src/recentmanager.hg | 7 +---
gtk/src/scalebutton.hg | 13 ++-----
gtk/src/statusicon.hg | 3 --
gtk/src/toolbar.hg | 13 +++----
gtk/src/toolitem.hg | 3 --
gtk/src/treeview.ccg | 2 +-
gtk/src/treeview.hg | 7 +---
gtk/src/treeviewcolumn.ccg | 15 --------
gtk/src/treeviewcolumn.hg | 24 ++-----------
gtk/src/widget.ccg | 3 --
gtk/src/widget.hg | 12 +++----
22 files changed, 69 insertions(+), 381 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8a8a61d..c3077de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-05 Murray Cumming <murrayc murrayc com>
+
+ Remove more deprecated methods.
+
+ * gtk/src/filelist.am:
+ * gtk/src/curve.[hg|cc]:
+ * gtk/src/inputdialog.[hg|ccg]: Removed deprecated classes.
+ * gtk/gtkmm/border.h: Removed because this file is now generated.
+ * gtk/src/toolbar: Inherit (and implement) from CellLayout.
+ * gtk/src/button.hg, fixed.hg, recentmanager.hg, scalebutton.hg,
+ toolbar.hg, treeview.hg, treeviewcolumn.hg, widget.hg:
+ Removed deprecated methods, discovered by removing undefs.
+ * gtk/src/celllayout.hg: Added get_first_cell() as a replacement for
+ TreeViewColumng::get_first_cell().
+
2010-01-04 Murray Cumming <murrayc murrayc com>
Fix the build with new GTK+ deprecations, when using fatal warnings.
diff --git a/gtk/src/button.hg b/gtk/src/button.hg
index 8b484c8..6f6988c 100644
--- a/gtk/src/button.hg
+++ b/gtk/src/button.hg
@@ -81,9 +81,7 @@ public:
explicit Button(const StockID& stock_id);
- _WRAP_METHOD(void pressed(), gtk_button_pressed, deprecated)
- _WRAP_METHOD(void released(),gtk_button_released, deprecated)
- _WRAP_METHOD(void clicked(), gtk_button_clicked, deprecated)
+ _IGNORE(gtk_button_pressed, gtk_button_released, gtk_button_clicked) //deprecated
_WRAP_METHOD(void enter(), gtk_button_enter)
_WRAP_METHOD(void leave(), gtk_button_leave)
diff --git a/gtk/src/celllayout.ccg b/gtk/src/celllayout.ccg
index 5ea3f88..891798c 100644
--- a/gtk/src/celllayout.ccg
+++ b/gtk/src/celllayout.ccg
@@ -74,7 +74,23 @@ void CellLayout::set_cell_data_func(CellRenderer& cell, const SlotCellData& slot
&SignalProxy_CellData_gtk_callback, slot_copy,
&SignalProxy_CellData_gtk_callback_destroy);
}
-
+
+CellRenderer* CellLayout::get_first_cell()
+{
+ typedef std::vector<Gtk::CellRenderer*> type_vecCellRenderers;
+ type_vecCellRenderers vecCellRenderers = get_cells();
+ if(!vecCellRenderers.empty())
+ return vecCellRenderers[0];
+ else
+ return 0;
+}
+
+const CellRenderer* CellLayout::get_first_cell() const
+{
+ //Do some const_cast-ing to avoid repetition of code:
+ return const_cast<CellLayout*>(this)->get_first_cell();
+}
+
} //namespace Gtk
diff --git a/gtk/src/celllayout.hg b/gtk/src/celllayout.hg
index d796c33..3fbfd64 100644
--- a/gtk/src/celllayout.hg
+++ b/gtk/src/celllayout.hg
@@ -57,6 +57,18 @@ public:
_WRAP_METHOD(Glib::ListHandle<CellRenderer*> get_cells(), gtk_cell_layout_get_cells)
_WRAP_METHOD(Glib::ListHandle<const CellRenderer*> get_cells() const, gtk_cell_layout_get_cells)
+ /** Gets the CellRenderer for the column.
+ * You should dynamic_cast<> to the expected derived CellRenderer type.
+ * This assumes that the CellLayout contains only one CellRenderer.
+ */
+ CellRenderer* get_first_cell();
+
+ /** Gets the CellRenderer for the column.
+ * You should dynamic_cast<> to the expected derived CellRenderer type.
+ * This assumes that the CellLayout contains only one CellRenderer.
+ */
+ const CellRenderer* get_first_cell() const;
+
_WRAP_METHOD(void clear(), gtk_cell_layout_clear)
_IGNORE(gtk_cell_layout_set_attributes) //I think this is just a convenience method, equivalent to clear() and multiple add_attribute()s. murrayc.
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 3d7f0fb..a76e8b5 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -49,6 +49,7 @@ gtkmm_files_any_hg = \
clipboard.hg \
colorbutton.hg \
colorselection.hg \
+ combobox.hg \
comboboxentry.hg \
container.hg \
dialog.hg \
diff --git a/gtk/src/fixed.hg b/gtk/src/fixed.hg
index 93feaa6..a3d9c36 100644
--- a/gtk/src/fixed.hg
+++ b/gtk/src/fixed.hg
@@ -19,11 +19,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-// So we can still wrap the (deprecated) function.
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
-
#include <gtkmm/container.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/container_p.h)
@@ -53,8 +48,7 @@ public:
_WRAP_METHOD(void put(Widget& widget, int x, int y), gtk_fixed_put)
_WRAP_METHOD(void move(Widget& widget, int x, int y), gtk_fixed_move)
- _WRAP_METHOD(void set_has_window(bool has_window = true), gtk_fixed_set_has_window, deprecated)
- _WRAP_METHOD(bool get_has_window() const, gtk_fixed_get_has_window, deprecated)
+ _IGNORE(gtk_fixed_set_has_window, gtk_fixed_get_has_window) // deprecated
};
} /* namespace Gtk */
diff --git a/gtk/src/recentmanager.hg b/gtk/src/recentmanager.hg
index f27efcb..6101636 100644
--- a/gtk/src/recentmanager.hg
+++ b/gtk/src/recentmanager.hg
@@ -15,9 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
_CONFIGINCLUDE(gtkmmconfig.h)
#include <gdkmm/screen.h>
@@ -74,7 +71,7 @@ public:
_WRAP_CREATE()
_WRAP_METHOD(static Glib::RefPtr<RecentManager> get_default(), gtk_recent_manager_get_default, refreturn)
- _IGNORE(gtk_recent_manager_get_for_screen, refreturn, deprecated)
+ _IGNORE(gtk_recent_manager_get_for_screen) //deprecated
/** Meta-data passed to add_item(). You should
* use RecentManager::Data if you want to control the meta-data associated
@@ -105,7 +102,7 @@ public:
bool is_private;
};
- _WRAP_METHOD(void set_screen(const Glib::RefPtr<Gdk::Screen>& screen), gtk_recent_manager_set_screen)
+ _IGNORE(gtk_recent_manager_set_screen) //deprecated
/** Adds a new resource into the recently used resources list. This function
* will try and guess some of the meta-data associated to a URI. If you
diff --git a/gtk/src/scalebutton.hg b/gtk/src/scalebutton.hg
index 9328016..ec57060 100644
--- a/gtk/src/scalebutton.hg
+++ b/gtk/src/scalebutton.hg
@@ -16,9 +16,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
_CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/button.h>
@@ -54,16 +51,12 @@ public:
_WRAP_METHOD(double get_value() const, gtk_scale_button_get_value)
_WRAP_METHOD(void set_value(double value), gtk_scale_button_set_value)
- // TODO: The overload makes no sense, as the same type is returned
- // by both methods. Also, the refreturn looks fishy to me.
- _WRAP_METHOD(Gtk::Adjustment* get_adjustment(), gtk_scale_button_get_adjustment, refreturn)
- _WRAP_METHOD(Gtk::Adjustment* get_adjustment() const, gtk_scale_button_get_adjustment, constversion)
+ _WRAP_METHOD(Gtk::Adjustment* get_adjustment(), gtk_scale_button_get_adjustment)
+ _WRAP_METHOD(const Gtk::Adjustment* get_adjustment() const, gtk_scale_button_get_adjustment, constversion)
_WRAP_METHOD(void set_adjustment(Gtk::Adjustment& adjustment), gtk_scale_button_set_adjustment)
- // TODO: Should be deprecated, but we have no replacement yet.
- _WRAP_METHOD(Orientation get_orientation(), gtk_scale_button_get_orientation)
- _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_scale_button_set_orientation)
+ _IGNORE(gtk_scale_button_get_orientation, gtk_scale_button_set_orientation) //deprecated
_WRAP_METHOD(Widget* get_plus_button(), gtk_scale_button_get_plus_button)
_WRAP_METHOD(const Widget* get_plus_button() const, gtk_scale_button_get_plus_button, constversion)
diff --git a/gtk/src/statusicon.hg b/gtk/src/statusicon.hg
index 7297dee..f21cbb6 100644
--- a/gtk/src/statusicon.hg
+++ b/gtk/src/statusicon.hg
@@ -15,9 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
_CONFIGINCLUDE(gtkmmconfig.h)
_DEFS(gtkmm,gtk)
diff --git a/gtk/src/toolbar.hg b/gtk/src/toolbar.hg
index c5bdabf..0bdd11c 100644
--- a/gtk/src/toolbar.hg
+++ b/gtk/src/toolbar.hg
@@ -15,13 +15,11 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
// This is for including the config header before any code (such as
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <gtkmm/toolshell.h>
#include <gtkmm/toolitem.h>
#include <gtkmm/toolbutton.h>
#include <gtkmm/toggletoolbutton.h>
@@ -41,9 +39,12 @@ namespace Gtk
* @ingroup Containers
* @ingroup Toolbars
*/
-class Toolbar : public Container
+class Toolbar
+ : public Container,
+ public ToolShell
{
_CLASS_GTKOBJECT(Toolbar,GtkToolbar,GTK_TOOLBAR,Gtk::Container,GtkContainer)
+ _IMPLEMENTS_INTERFACE(ToolShell)
public:
_CTOR_DEFAULT()
@@ -68,9 +69,7 @@ public:
/* Style methods */
- // TODO: Remove these when we derive from ToolShell, which has the same methods:
- _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_toolbar_set_orientation)
- _WRAP_METHOD(Orientation get_orientation() const, gtk_toolbar_get_orientation)
+ _IGNORE(gtk_toolbar_set_orientation, gtk_toolbar_get_orientation) //deprecated
_WRAP_METHOD(void set_toolbar_style(ToolbarStyle style), gtk_toolbar_set_style)
_WRAP_METHOD(ToolbarStyle get_toolbar_style() const, gtk_toolbar_get_style)
diff --git a/gtk/src/toolitem.hg b/gtk/src/toolitem.hg
index 9b9a85f..23429ae 100644
--- a/gtk/src/toolitem.hg
+++ b/gtk/src/toolitem.hg
@@ -16,9 +16,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
// This is for including the config header before any code (such as
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 97910cf..9ea5016 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -332,7 +332,7 @@ CellRenderer* TreeView::get_column_cell_renderer(int n)
{
TreeViewColumn* pColumn = get_column(n);
if(pColumn)
- return pColumn->get_first_cell_renderer();
+ return pColumn->get_first_cell();
else
return 0;
}
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index a4e5df9..e1fa1f8 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -15,9 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
// This is for including the config header before any code (such as
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
@@ -915,7 +912,7 @@ int TreeView::append_column_editable(const Glib::ustring& title, const TreeModel
TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
//connect signal handlers for auto-storing of edited cell data
- CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
+ CellRenderer* pCellRender = pViewColumn->get_first_cell();
TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, pCellRender, model_column);
return append_column(*pViewColumn);
@@ -939,7 +936,7 @@ int TreeView::insert_column_editable(const Glib::ustring& title, const TreeModel
TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
//connect signal handlers for auto-storing of edited cell data
- CellRenderer* pCellRender = pViewColumn->get_first_cell_renderer();
+ CellRenderer* pCellRender = pViewColumn->get_first_cell();
TreeView_Private::_connect_auto_store_editable_signal_handler(this, pCellRender, model_column);
return insert_column(*pViewColumn, position);
diff --git a/gtk/src/treeviewcolumn.ccg b/gtk/src/treeviewcolumn.ccg
index 7e6dcb7..cb3e7b9 100644
--- a/gtk/src/treeviewcolumn.ccg
+++ b/gtk/src/treeviewcolumn.ccg
@@ -88,21 +88,6 @@ void TreeViewColumn::unset_cell_data_func(CellRenderer& cell_renderer)
gtk_tree_view_column_set_cell_data_func(gobj(), cell_renderer.gobj(), 0, 0, 0);
}
-CellRenderer* TreeViewColumn::get_first_cell_renderer()
-{
- typedef std::vector<Gtk::CellRenderer*> type_vecCellRenderers;
- type_vecCellRenderers vecCellRenderers = get_cell_renderers();
- if(!vecCellRenderers.empty())
- return vecCellRenderers[0];
- else
- return 0;
-}
-
-const CellRenderer* TreeViewColumn::get_first_cell_renderer() const
-{
- //Do some const_cast-ing to avoid repetition of code:
- return const_cast<TreeViewColumn*>(this)->get_first_cell_renderer();
-}
} // namespace Gtk
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index af138fa..94ae31d 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -15,9 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
// This is for including the config header before any code (such as
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
_CONFIGINCLUDE(gtkmmconfig.h)
@@ -78,7 +75,7 @@ public:
* the cell is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which @a expand is <tt>true</tt>.
*
- * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
+ * You can use get_first_cell() or get_cells() to access the generated CellRenderer.
*
* @param column The model column that will be rendered by the view cell.
* @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
@@ -91,7 +88,7 @@ public:
* the cell is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which @a expand is <tt>true</tt>.
*
- * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
+ * You can use get_first_cell() or get_cells() to access the generated CellRenderer.
*
* @param column The model column that will be rendered by the view cell.
* @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
@@ -101,22 +98,7 @@ public:
_WRAP_METHOD(void clear(), gtk_tree_view_column_clear)
- /** Gets the CellRenderer for the column.
- * You should dynamic_cast<> to the expected derived CellRenderer type.
- * This assumes that the TreeViewColumn contains only one CellRenderer.
- */
- CellRenderer* get_first_cell_renderer();
-
- /** Gets the CellRenderer for the column.
- * You should dynamic_cast<> to the expected derived CellRenderer type.
- * This assumes that the TreeViewColumn contains only one CellRenderer.
- */
- const CellRenderer* get_first_cell_renderer() const;
-
- // TODO: Should be deprecated, but we cannot derive from CellLayout
- // without breaking API and ABI.
- _WRAP_METHOD(Glib::ListHandle<CellRenderer*> get_cell_renderers(), gtk_tree_view_column_get_cell_renderers)
- _WRAP_METHOD(Glib::ListHandle<const CellRenderer*> get_cell_renderers() const, gtk_tree_view_column_get_cell_renderers)
+ _IGNORE(gtk_tree_view_column_get_cell_renderers, gtk_tree_view_column_get_cell_renderers) //deprecated
_WRAP_METHOD(void add_attribute(CellRenderer& cell_renderer, const Glib::ustring& attribute, int column),
gtk_tree_view_column_add_attribute)
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 54ab381..74c4b4a 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -336,9 +336,6 @@ bool Widget::parent_sensitive() const
bool Widget::rc_style() const
{ return GTK_WIDGET_RC_STYLE(gobj()); }
-bool Widget::is_composite_child() const
- { return GTK_WIDGET_COMPOSITE_CHILD(gobj()); }
-
WidgetFlags Widget::get_flags() const
{ return static_cast<WidgetFlags>(GTK_WIDGET_FLAGS(gobj())); }
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 01b93e6..00f9231 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -15,9 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GTK_DISABLE_DEPRECATED
-#m4 _POP()
_CONFIGINCLUDE(gtkmmconfig.h)
#include <pangomm/context.h>
@@ -627,7 +624,6 @@ _DEPRECATE_IFDEF_END
bool parent_sensitive() const;
bool rc_style() const;
- bool is_composite_child() const;
WidgetFlags get_flags() const;
void set_flags(WidgetFlags flags);
@@ -638,9 +634,9 @@ _DEPRECATE_IFDEF_END
_WRAP_METHOD(bool is_composited() const, gtk_widget_is_composited)
- // TODO: Deprecated, but we cannot replace them without breaking API and ABI.
- _WRAP_METHOD(Glib::RefPtr<Action> get_action(), gtk_widget_get_action, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Action> get_action() const, gtk_widget_get_action, refreturn, constversion)
+ _IGNORE(gtk_widget_get_action) //deprecated
+ _WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_widget_get_related_action, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_widget_get_related_action, refreturn, constversion)
_MEMBER_GET(saved_state, saved_state, Gtk::StateType, guint8)
_MEMBER_GET(requisition, requisition, Requisition, GtkRequisition)
@@ -953,6 +949,8 @@ dnl
_WRAP_PROPERTY("tooltip_markup", Glib::ustring)
_WRAP_PROPERTY("tooltip_text", Glib::ustring)
_WRAP_PROPERTY("window", Glib::RefPtr<Gdk::Window>)
+ _WRAP_PROPERTY("no-show-all", bool)
+
protected:
//comment in GTK+ header: "seldomly overidden"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]