[gtkmm/gtkmm-2-24: 1/7] TreeViewColumn: Added get_first_cell(), deprecated get_first_cell_renderer().



commit 624bbfcbfde1e29c56de2eafa37f9d593ffabfe8
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Nov 25 10:47:49 2010 +0100

    TreeViewColumn: Added get_first_cell(), deprecated get_first_cell_renderer().
    
    * gtk/src/treeviewcolumn.[hg|ccg]: Added get_first_cell() to match
    CellLayout::get_first_cell() in gtkmm 3.0, to make porting easier.

 ChangeLog                  |   43 +++++++++++++++++++++++++------------------
 gtk/src/treeviewcolumn.ccg |   17 +++++++++++++----
 gtk/src/treeviewcolumn.hg  |   22 ++++++++++++++++++++++
 3 files changed, 60 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b15a7a9..ef8d670 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-25  Murray Cumming  <murrayc murrayc-desktop>
+
+	TreeViewColumn: Added get_first_cell(), deprecated get_first_cell_renderer().
+
+	* gtk/src/treeviewcolumn.[hg|ccg]: Added get_first_cell() to match
+	CellLayout::get_first_cell() in gtkmm 3.0, to make porting easier.
+
 2010-11-09  Armin Burgmeier  <armin arbur net>
 
 	* win32_installer/build-installer.sh: Make sure libintl-8.dll gets
@@ -102,7 +109,7 @@
 
 	gtkmm: MenuBar: Added remaining methods.
 
-	* gtk/src/menubar.hg: Added set/get_pack_direction(), 
+	* gtk/src/menubar.hg: Added set/get_pack_direction(),
 	set/ get_child_pack_direction
 	* tools/m4/convert_gtk.m4: Added guint32&->guint32* conversion.
 
@@ -110,9 +117,9 @@
 
 	gdkmm: Visual: Added methods.
 
-	* gdk/src/visual.hg: Added get_visual_type(), get_depth(), get_byte_order(), 
+	* gdk/src/visual.hg: Added get_visual_type(), get_depth(), get_byte_order(),
 	get_colormap_size(), get_bits_per_rgb(), get_red_pixel_details(),
-	get_green_pixel_details(), get_blue_pixel_details(), which are already in 
+	get_green_pixel_details(), get_blue_pixel_details(), which are already in
 	git master.
 	* tools/m4/convert_gdk.m4: Added enum conversion.
 
@@ -125,28 +132,28 @@
 	* gtk/src/scalebutton.hg: Added icons property.
 	* gtk/src/scrolledwindow.hg: Added window_placement_set property.
 	* gtk/src/separatortoolitem.hg: Added draw property.
-	* gtk/src/statusicon.hg: Added tooltips, icon-size and icon-size-set 
+	* gtk/src/statusicon.hg: Added tooltips, icon-size and icon-size-set
 	properties.
 	* gtk/src/toolbutton.hg: Added icon_name property.
 	* gtk/src/treemodelfilter.hg: Added child_model and virtual_root properties.
 	* gtk/src/treemodelsort.hg: Added model property.
 	* gtk/src/treeview.hg: Added tooltip-column property.
-	* gtk/src/treeviewcolumn.hg: Added resizable, spacing and sort-column-id 
+	* gtk/src/treeviewcolumn.hg: Added resizable, spacing and sort-column-id
 	properties.
 	* gtk/src/widget.hg: Added is_focus and double_buffered properties.
 	* gtk/src/window.hg: Added type, startup_id and opacity properties.
-		
+
 2010-09-25  Murray Cumming  <murrayc murrayc com>
 
 	gtkmm: Added yet more missing properties.
 
-	* gtk/src/menubar.hg: Added pack_direction and child_pack_direction 
+	* gtk/src/menubar.hg: Added pack_direction and child_pack_direction
 	properties, with a new PackDirection enum.
 	* gtk/src/notebook.hg: Added group_id and group properties.
 	* gtk/src/printer.hg: Added paused and accepting_jobs properties.
 	* gtk/src/printjob.hg: Added track_print_status property.
 	* gtk/src/printoperation.hg: Added track_print_status property.
-	* gtk/src/progressbar.hg: Added adjustment, bar_stye, activity_step, 
+	* gtk/src/progressbar.hg: Added adjustment, bar_stye, activity_step,
 	activity_blocks and discrete_blocks properties.
 	* gtk/src/ruler.hg: Added metric property.
 
@@ -154,15 +161,15 @@
 
 	gtkmm: Added missing properties.
 
-	* tools/extra_defs_gen/generate_defs_gtk.cc: Added GtkComboBoxEntry and 
+	* tools/extra_defs_gen/generate_defs_gtk.cc: Added GtkComboBoxEntry and
 	GtkColorSelectionDialog.
 	* gtk/src/gtk_signals.defs: Added the new sections for these widgets.
-	* gtk/src/colorselection.hg: Added color_selection, ok_button, cancel_button, 
+	* gtk/src/colorselection.hg: Added color_selection, ok_button, cancel_button,
 	and help_button properties.
 	* gtk/src/combobox.hg: Added popup_shown and button_sensitivity properties.
 	* gtk/src/comboboxentry.hg: Added text_column property.
-	* gtk/src/entry.hg: Added inner_borde, primary_icon_tooltip_text, 
-	secondary_icon_tooltip_text", primary_icon_tooltip_markup" and 
+	* gtk/src/entry.hg: Added inner_borde, primary_icon_tooltip_text,
+	secondary_icon_tooltip_text", primary_icon_tooltip_markup" and
 	secondary_icon_tooltip_markup properties.
 	* gtk/src/filechooserbutton.hg: Added dialog property.
 	* gtk/src/handlebox.hg: Added snap_edge_set and child_detached properties.
@@ -177,16 +184,16 @@
 	* gtk/src/cellrenderertoggle.hg: Added inconsistent property.
 	* gtk/src/progressbar.hg: Moved the ProgressBarOrientation enum to enums.hg.
 	* gtk/src/cellrendererprogress.hg: Added orientation property.
-	
+
 2010-09-24  Murray Cumming  <murrayc murrayc com>
 
 	CellEditable: Added editing_canceled property.
 
 	* tools/extra_defs_gen/generate_defs_gtk.cc: Added GtkCellEditable.
 	* gtk/src/gtk_signals.defs: Added the GtkCellEditable entries.
-	* gtk/src/gtk_other.defs: Remove entries that are no longer needed, 
+	* gtk/src/gtk_other.defs: Remove entries that are no longer needed,
 	because they are now in gtk_signals.defs or gtk_methods.defs
-	* gtk/src/gtk_methods.defs: Hand-edit some GtkAboutDialog entries to correct 
+	* gtk/src/gtk_methods.defs: Hand-edit some GtkAboutDialog entries to correct
 	the constness of some return types.
 	* gtk/src/celleditable.hg: Added editing_canceled property.
 
@@ -196,7 +203,7 @@
 
 	* gtk/src/accelgroup.hg: Added is_locked and modifier_mask properties.
 	* gtk/src/actiongroup.hg: Added name, sensitive and visible properties.
-	* gtk/src/adjustment.hg: Added value, lower, upper, step-increment, 
+	* gtk/src/adjustment.hg: Added value, lower, upper, step-increment,
 	page-increment and page-size properties.
 	* gtk/src/builder.hg: Added translation-domain property.
 
@@ -204,9 +211,9 @@
 
 	gdkmm: Screen: Added signals and properties.
 
-	* gdk/src/gdk_signals.defs: Regenerated by taking the part of the 
+	* gdk/src/gdk_signals.defs: Regenerated by taking the part of the
 	extra_defs_gen output for GDK.
-	* gdk/src/screen.hg: Added composited_changed() and monitors_changed() 
+	* gdk/src/screen.hg: Added composited_changed() and monitors_changed()
 	signals, but with no default signal handlers, to avoid breaking ABI.
 	Added font-options and resolution properties.
 
diff --git a/gtk/src/treeviewcolumn.ccg b/gtk/src/treeviewcolumn.ccg
index ab5cd18..af8d33f 100644
--- a/gtk/src/treeviewcolumn.ccg
+++ b/gtk/src/treeviewcolumn.ccg
@@ -82,7 +82,7 @@ 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()
+CellRenderer* TreeViewColumn::get_first_cell()
 {
   typedef std::vector<Gtk::CellRenderer*> type_vecCellRenderers;
   type_vecCellRenderers vecCellRenderers = get_cell_renderers();
@@ -92,13 +92,23 @@ CellRenderer* TreeViewColumn::get_first_cell_renderer()
     return 0;
 }
 
-const CellRenderer* TreeViewColumn::get_first_cell_renderer() const
+const CellRenderer* TreeViewColumn::get_first_cell() const
 {
   //Do some const_cast-ing to avoid repetition of code:
   return const_cast<TreeViewColumn*>(this)->get_first_cell_renderer();
 }
 
 _DEPRECATE_IFDEF_START
+CellRenderer* TreeViewColumn::get_first_cell_renderer()
+{
+  return get_first_cell();
+}
+
+const CellRenderer* TreeViewColumn::get_first_cell_renderer() const
+{
+  return get_first_cell_renderer();
+}
+
 void TreeViewColumn::set_sort_column_id(const TreeModelColumnBase& sort_column)
 {
   set_sort_column(sort_column);
@@ -108,7 +118,6 @@ void TreeViewColumn::set_sort_column_id(int sort_column_id)
 {
   set_sort_column(sort_column_id);
 }
-_DEPRECATE_IFDEF_END  
+_DEPRECATE_IFDEF_END
 
 } // namespace Gtk
-
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index ac2b957..acd3515 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -99,17 +99,39 @@ public:
 
   _WRAP_METHOD(void clear(), gtk_tree_view_column_clear)
 
+  //We replaced get_first_cell_renderer() with get_first_cell() because that
+  //is the name of the method in CellLayout, which this class derives from in gtkmm-3.0.
+  //That allows more code to be ported before actually using gtkmm-3.0.
+
   /** 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();
+
+  /** 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() const;
+
+  _DEPRECATE_IFDEF_START
+  /** 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.
+    *
+    * @deprecated Use get_first_cell().
+    */
   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.
+    *
+    * @deprecated Use get_first_cell().
     */
   const CellRenderer* get_first_cell_renderer() const;
+  _DEPRECATE_IFDEF_END
 
   // TODO: Should be deprecated, but we cannot derive from CellLayout
   // without breaking API and ABI.



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