[gtkmm] Gtk: Fix some TODO comments



commit a829f9d06e6cf63f91978237975f1583121600f8
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Nov 5 18:20:30 2020 +0100

    Gtk: Fix some TODO comments
    
    * gtk/src/cellareabox.hg: pack_start/pack_end(): Change default values
    of arguments.
    * gtk/src/comboboxtext.hg: Document set_active_text().
    * gtk/src/recentinfo.hg: equal(), operator==(), operator!=():
    RefPtr<RecentInfo>& instead of RecentInfo&. This should have been fixed
    long ago, when RecentInfo became ref-counted.
    * gtk/src/styleprovider.hg: Make the class docs more similar to
    GtkStyleProvider's docs.
    * gtk/src/tooltip.hg: Rename set_icon_from_icon_name() to set_icon().
    
    Some TODO comments have been removed without action.

 gtk/src/cellareabox.hg        |  7 ++++---
 gtk/src/cellrenderertoggle.hg |  2 --
 gtk/src/combobox.hg           |  2 +-
 gtk/src/comboboxtext.hg       |  6 +++++-
 gtk/src/frame.hg              |  2 --
 gtk/src/grid.hg               |  3 ---
 gtk/src/label.hg              |  3 ---
 gtk/src/printoperation.hg     |  5 -----
 gtk/src/printsettings.hg      |  1 -
 gtk/src/recentinfo.hg         | 15 +++++----------
 gtk/src/scrolledwindow.hg     |  2 --
 gtk/src/settings.hg           |  4 ----
 gtk/src/statusbar.hg          |  2 --
 gtk/src/styleprovider.hg      | 10 +++++++---
 gtk/src/tooltip.hg            |  4 +---
 15 files changed, 23 insertions(+), 45 deletions(-)
---
diff --git a/gtk/src/cellareabox.hg b/gtk/src/cellareabox.hg
index b6120a71..3472336c 100644
--- a/gtk/src/cellareabox.hg
+++ b/gtk/src/cellareabox.hg
@@ -56,9 +56,10 @@ public:
   _WRAP_CREATE()
   _IGNORE(gtk_cell_area_box_new)
 
-  //TODO: Are these good default values:
-  _WRAP_METHOD(void pack_start(CellRenderer& renderer,  bool expand = false, bool align = true, bool fixed = 
false), gtk_cell_area_box_pack_start)
-  _WRAP_METHOD(void pack_end(CellRenderer& renderer, bool expand = false, bool align = true, bool fixed = 
false), gtk_cell_area_box_pack_end)
+  // The default values of expand, align and fixed are the default values of
+  // CELL_PROP_[EXPAND,ALIGN,FIXED_SIZE] in gtkcellareabox.c.
+  _WRAP_METHOD(void pack_start(CellRenderer& renderer, bool expand = false, bool align = false, bool fixed = 
true), gtk_cell_area_box_pack_start)
+  _WRAP_METHOD(void pack_end(CellRenderer& renderer, bool expand = false, bool align = false, bool fixed = 
true), gtk_cell_area_box_pack_end)
   _WRAP_METHOD(int get_spacing() const, gtk_cell_area_box_get_spacing)
   _WRAP_METHOD(void set_spacing(int spacing), gtk_cell_area_box_set_spacing)
 
diff --git a/gtk/src/cellrenderertoggle.hg b/gtk/src/cellrenderertoggle.hg
index 04f6059b..033a4326 100644
--- a/gtk/src/cellrenderertoggle.hg
+++ b/gtk/src/cellrenderertoggle.hg
@@ -45,7 +45,6 @@ public:
   _WRAP_METHOD(void set_activatable(bool setting = true), gtk_cell_renderer_toggle_set_activatable)
 
 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
-  //TODO: Maybe the parameter should be a TreePath.
   // no_default_handler because GtkCellRendererToggleClass is private.
   _WRAP_SIGNAL(void toggled(const Glib::ustring& path), "toggled", no_default_handler)
 
@@ -58,4 +57,3 @@ public:
 };
 
 } //namespace Gtk
-
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index e2ab10d9..76093f4a 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -104,7 +104,7 @@ public:
   _WRAP_METHOD(void set_active(int index), gtk_combo_box_set_active)
   _WRAP_METHOD(void set_active(const TreeModel::const_iterator& iter), gtk_combo_box_set_active_iter)
 
-  //TODO: See https://bugzilla.gnome.org/show_bug.cgi?id=612396#c30
+  // See https://bugzilla.gnome.org/show_bug.cgi?id=612396#c30
   /** Get the text in the entry, if there is an entry.
    *
    * @newin{2,24}
diff --git a/gtk/src/comboboxtext.hg b/gtk/src/comboboxtext.hg
index e1997260..308c45aa 100644
--- a/gtk/src/comboboxtext.hg
+++ b/gtk/src/comboboxtext.hg
@@ -59,7 +59,11 @@ public:
 
   _WRAP_METHOD(void remove_all(), gtk_combo_box_text_remove_all)
 
-  //TODO: Add a C function?
+  /** Sets the active item of the combo box.
+   *
+   * If @a text is one of the strings in the combo box, set that item as active,
+   * else set no item as active.
+   */
   void set_active_text(const Glib::ustring& text);
 };
 
diff --git a/gtk/src/frame.hg b/gtk/src/frame.hg
index 9d83227f..46c347fc 100644
--- a/gtk/src/frame.hg
+++ b/gtk/src/frame.hg
@@ -45,8 +45,6 @@ public:
   _CTOR_DEFAULT()
   _WRAP_CTOR(Frame(const Glib::ustring& label), gtk_frame_new)
 
-  //TODO: Add a bool use_markup arg to set_label() as a convenience - it would have to use 
set_label_widget().
-
   /** Set the label to appear in the top edge of the frame.
    * Label alignment defaults to the upper left corner of the frame.
    */
diff --git a/gtk/src/grid.hg b/gtk/src/grid.hg
index 33ba5578..63fee572 100644
--- a/gtk/src/grid.hg
+++ b/gtk/src/grid.hg
@@ -51,9 +51,6 @@ class GTKMM_API Grid
 public:
   _CTOR_DEFAULT
 
-  //TODO: Add a Grid(Orientation orientation = Orientation::HORIZONTAL) constructor to match the Paned and 
Box ones?
-  //Probably not, because a vertical GtkGrid is not very useful. murrayc.
-
   _WRAP_METHOD(void attach(Widget& child, int column, int row, int width = 1, int height = 1), 
gtk_grid_attach)
 
   /** Adds a widget to the grid.
diff --git a/gtk/src/label.hg b/gtk/src/label.hg
index a27ac686..6cbc2592 100644
--- a/gtk/src/label.hg
+++ b/gtk/src/label.hg
@@ -63,15 +63,12 @@ public:
    */
   Label(const Glib::ustring& label, Align halign, Align valign = Align::CENTER, bool mnemonic = false);
 
-
-  /// Doesn't use markup.
   _WRAP_METHOD(void set_text(const Glib::ustring &str), gtk_label_set_text)
   _WRAP_METHOD(Glib::ustring get_text() const, gtk_label_get_text)
 
   _WRAP_METHOD(void set_attributes(Pango::AttrList& attrs), gtk_label_set_attributes)
   _WRAP_METHOD(Pango::AttrList get_attributes() const, gtk_label_get_attributes)
 
-  //TODO: Remove set_label() or set_text()?
   _WRAP_METHOD(void set_label(const Glib::ustring& str), gtk_label_set_label)
   _WRAP_METHOD(Glib::ustring get_label() const, gtk_label_get_label)
   _WRAP_METHOD(void set_markup(const Glib::ustring& str), gtk_label_set_markup)
diff --git a/gtk/src/printoperation.hg b/gtk/src/printoperation.hg
index 9e464930..82d4c3cb 100644
--- a/gtk/src/printoperation.hg
+++ b/gtk/src/printoperation.hg
@@ -121,13 +121,8 @@ public:
   _WRAP_METHOD(int get_n_pages_to_print() const, gtk_print_operation_get_n_pages_to_print)
 
   _IGNORE(gtk_print_run_page_setup_dialog, gtk_print_run_page_setup_dialog_async)
-
-  #m4 _CONVERSION(`GtkPrintOperationResult',`Result',`($2)$3')
-
   _IGNORE(gtk_print_operation_get_error)
 
-  //TODO: point out in the docs that the Result enum may also indicate
-  // that an error occurred, and in that case it is up to the application developer to handle it.
   _WRAP_SIGNAL(void done(Result result), "done")
 
   #m4 _CONVERSION(`GtkPrintContext*',`const Glib::RefPtr<PrintContext>&',`Glib::wrap($3, true)')
diff --git a/gtk/src/printsettings.hg b/gtk/src/printsettings.hg
index dc554bc6..15e3e92e 100644
--- a/gtk/src/printsettings.hg
+++ b/gtk/src/printsettings.hg
@@ -195,7 +195,6 @@ public:
    */
   void save_to_key_file(const Glib::RefPtr<Glib::KeyFile>& key_file) const;
 
-  //TODO: add a @see link?
   _WRAP_METHOD(bool has_key(const Glib::ustring& key) const, gtk_print_settings_has_key)
 
   _WRAP_METHOD(Glib::ustring get(const Glib::ustring& key) const, gtk_print_settings_get)
diff --git a/gtk/src/recentinfo.hg b/gtk/src/recentinfo.hg
index 988e1453..4d00a6e5 100644
--- a/gtk/src/recentinfo.hg
+++ b/gtk/src/recentinfo.hg
@@ -90,10 +90,7 @@ public:
   _WRAP_METHOD(int get_age() const, gtk_recent_info_get_age)
   _WRAP_METHOD(bool is_local() const, gtk_recent_info_is_local)
   _WRAP_METHOD(bool exists() const, gtk_recent_info_exists)
-#m4begin
-_CONVERSION(`const RecentInfo&',`GtkRecentInfo*', `const_cast<GtkRecentInfo*>(($3).gobj())')
-#m4end
-  _WRAP_METHOD(bool equal(const RecentInfo& info_b) const, gtk_recent_info_match)
+  _WRAP_METHOD(bool equal(const Glib::RefPtr<const RecentInfo>& info_b) const, gtk_recent_info_match)
 };
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -112,15 +109,13 @@ struct RecentInfoTraits
 };
 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
 
-// TODO: These are almost impossible to use without RefPtr<>::operator*()
-
 /** @relates Gtk::RecentInfo */
-inline bool operator==(const RecentInfo& lhs, const RecentInfo& rhs)
-  { return lhs.equal(rhs); }
+inline bool operator==(const Glib::RefPtr<const RecentInfo>& lhs, const Glib::RefPtr<const RecentInfo>& rhs)
+  { return lhs->equal(rhs); }
 
 /** @relates Gtk::RecentInfo */
-inline bool operator!=(const RecentInfo& lhs, const RecentInfo& rhs)
-  { return !lhs.equal(rhs); }
+inline bool operator!=(const Glib::RefPtr<const RecentInfo>& lhs, const Glib::RefPtr<const RecentInfo>& rhs)
+  { return !lhs->equal(rhs); }
 
 } // namespace Gtk
 
diff --git a/gtk/src/scrolledwindow.hg b/gtk/src/scrolledwindow.hg
index 9c16d955..cd00e1fd 100644
--- a/gtk/src/scrolledwindow.hg
+++ b/gtk/src/scrolledwindow.hg
@@ -52,8 +52,6 @@ class GTKMM_API ScrolledWindow : public Widget
 public:
   _CTOR_DEFAULT
 
-  //TODO: Add unset_*adjustment().
-  //But the C API does not do that. murrayc.
   _WRAP_METHOD(void set_hadjustment(const Glib::RefPtr<Adjustment>& hadjustment), 
gtk_scrolled_window_set_hadjustment)
   _WRAP_METHOD(void set_vadjustment(const Glib::RefPtr<Adjustment>& vadjustment), 
gtk_scrolled_window_set_vadjustment)
 
diff --git a/gtk/src/settings.hg b/gtk/src/settings.hg
index f99d96ff..1b37270f 100644
--- a/gtk/src/settings.hg
+++ b/gtk/src/settings.hg
@@ -51,7 +51,6 @@ public:
   _WRAP_PROPERTY("gtk-theme-name", Glib::ustring)
   _WRAP_PROPERTY("gtk-dnd-drag-threshold", int)
   _WRAP_PROPERTY("gtk-font-name", Glib::ustring)
-//#ifdef GDK_WINDOWING_X11
   _WRAP_PROPERTY("gtk-xft-antialias", int)
   _WRAP_PROPERTY("gtk-xft-hinting", int)
   _WRAP_PROPERTY("gtk-xft-hintstyle", Glib::ustring)
@@ -59,7 +58,6 @@ public:
   _WRAP_PROPERTY("gtk-xft-dpi", int)
   _WRAP_PROPERTY("gtk-cursor-theme-name", Glib::ustring)
   _WRAP_PROPERTY("gtk-cursor-theme-size", int)
-//#endif
   _WRAP_PROPERTY("gtk-alternative-button-order", bool)
   _WRAP_PROPERTY("gtk-alternative-sort-arrows", bool)
   _WRAP_PROPERTY("gtk-enable-animations", bool)
@@ -81,7 +79,6 @@ public:
 
   _WRAP_PROPERTY("gtk-label-select-on-focus", bool) //since 3.4
   _WRAP_PROPERTY("gtk-entry-password-hint-timeout", guint) //since 3.4
-  //TODO: Add others added since?
 
   _WRAP_PROPERTY("gtk-entry-select-on-focus", bool)
 
@@ -102,4 +99,3 @@ public:
 };
 
 } //namespace Gtk
-
diff --git a/gtk/src/statusbar.hg b/gtk/src/statusbar.hg
index 0eb3f1aa..c749e0ab 100644
--- a/gtk/src/statusbar.hg
+++ b/gtk/src/statusbar.hg
@@ -46,8 +46,6 @@ public:
 
   _WRAP_METHOD(guint get_context_id(const Glib::ustring& context_description), gtk_statusbar_get_context_id)
 
-  //TODO: Remove the default 0 context_id values in all these methods?
-
   /** Pushes a new message onto a statusbar's stack.
    * @param text The message to add to the statusbar.
    * @param context_id The message's context id, as returned by get_context_id()
diff --git a/gtk/src/styleprovider.hg b/gtk/src/styleprovider.hg
index 6619452c..d0bbe0fb 100644
--- a/gtk/src/styleprovider.hg
+++ b/gtk/src/styleprovider.hg
@@ -30,9 +30,13 @@ typedef struct _GtkStyleProviderIface GtkStyleProviderIface;
 namespace Gtk
 {
 
-/**  This is a base class used to provide style information to a StyleContext.
- * See StyleContext::add_provider() and StyleContext::add_provider_for_screen().
+/** Interface to provide style information to Gtk::StyleContext.
  *
+ * %Gtk::StyleProvider is an interface used to provide style information to a Gtk::StyleContext.
+ * See StyleContext::add_provider() and StyleContext::add_provider_for_display().
+ *
+ * @see Gtk::StyleContext, Gtk::CssProvider
+
  * @newin{3,0}
  */
 class GTKMM_API StyleProvider : public Glib::Interface
@@ -40,7 +44,7 @@ class GTKMM_API StyleProvider : public Glib::Interface
   _CLASS_INTERFACE(StyleProvider, GtkStyleProvider, GTK_STYLE_PROVIDER, GtkStyleProviderIface, , , GTKMM_API)
 
 public:
-  //TODO
+  // There is no public API.
 };
 
 } // namespace Gtk
diff --git a/gtk/src/tooltip.hg b/gtk/src/tooltip.hg
index 3c635480..492fddd1 100644
--- a/gtk/src/tooltip.hg
+++ b/gtk/src/tooltip.hg
@@ -76,9 +76,7 @@ public:
 
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Paintable>& paintable), gtk_tooltip_set_icon)
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gio::Icon>& gicon), gtk_tooltip_set_icon_from_gicon)
-
-  //TODO: Remove the _from_*() suffixes?
-  _WRAP_METHOD(void set_icon_from_icon_name(const Glib::ustring& icon_name), 
gtk_tooltip_set_icon_from_icon_name)
+  _WRAP_METHOD(void set_icon(const Glib::ustring& icon_name{NULL}), gtk_tooltip_set_icon_from_icon_name)
 
   /** Hide the image.
    * @newin{3,2}


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