[gtksourceviewmm] Added const getters to completion stuff.



commit c22637868277b5a786d5eb48505fee88dbb7cd4b
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Tue Apr 6 20:25:25 2010 +0200

    Added const getters to completion stuff.
    
    * gtksourceview/src/sourcecompletion.hg:
    * gtksourceview/src/sourcecompletionprovider.hg: Added some const
    version of getters.

 gtksourceview/src/sourcecompletion.hg         |   24 ++++++++++++++++++++----
 gtksourceview/src/sourcecompletionprovider.hg |   20 ++++++++++++++++++--
 gtksourceview/src/sourcelanguagemanager.hg    |    2 +-
 3 files changed, 39 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index 0115674..efcec58 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -98,7 +98,6 @@ public:
    */
   _WRAP_METHOD(void hide(), gtk_source_completion_hide)
 
-  //TODO: This should not be const. There should be an extra const overload.
   /** Gets the SourceCompletionInfo window.
    *
    * The info widget is the window where the completion displays optional extra information of the proposal.
@@ -107,16 +106,33 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(SourceCompletionInfo* get_info_window() const, gtk_source_completion_get_info_window)
+  _WRAP_METHOD(SourceCompletionInfo* get_info_window(), gtk_source_completion_get_info_window)
+
+  /** Gets the SourceCompletionInfo window.
+   *
+   * The info widget is the window where the completion displays optional extra information of the proposal.
+   *
+   * @return The SourceCompletionInfo window.
+   *
+   * @newin{2,10}
+   */
+  _WRAP_METHOD(const SourceCompletionInfo* get_info_window() const, gtk_source_completion_get_info_window)
+
+  /** Gets the SourceView associated with completion.
+   *
+   * @return The SourceView associated with completion.
+   *
+   * @newin{2,10}
+   */
+  _WRAP_METHOD(SourceView* get_view(), gtk_source_completion_get_view)
 
-  //TODO: This should not be const. There should be an extra const overload.
   /** Gets the SourceView associated with completion.
    *
    * @return The SourceView associated with completion.
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(SourceView* get_view() const, gtk_source_completion_get_view)
+  _WRAP_METHOD(const SourceView* get_view() const, gtk_source_completion_get_view)
 
   // TODO: Does "The reference being returned is a 'floating' reference, so if you invoke gtk_source_completion_show with this context you don't need to unref it." something mean for us? krnowak
   /** Create a new SourceCompletionContext for completion.
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index d04923b..f467907 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -83,7 +83,6 @@ public:
    */
   _WRAP_METHOD(bool match(const Glib::RefPtr<const SourceCompletionContext>& context) const, gtk_source_completion_provider_match)
 
-  //TODO: This should not be const. There should be an extra const overload.
   /** Get a customized info widget to show extra information of a proposal.
    *
    * This allows for customized widgets on a proposal basis, although in general
@@ -99,7 +98,24 @@ public:
    *
    * @newin{2,10}
    */
-  _WRAP_METHOD(Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal) const, gtk_source_completion_provider_get_info_widget)
+  _WRAP_METHOD(Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal), gtk_source_completion_provider_get_info_widget)
+
+  /** Get a customized info widget to show extra information of a proposal.
+   *
+   * This allows for customized widgets on a proposal basis, although in general
+   * providers will have the same custom widget for all their proposals and
+   * @a proposal can be ignored. The implementation of this function is
+   * optional. If implemented, update_info() @b must also be implemented. If not
+   * implemented, the default get_info() will be used to display extra
+   * information about a SourceCompletionProposal.
+   *
+   * @param proposal The currently selected SourceCompletionProposal.
+   *
+   * @return A custom Gtk::Widget to show extra information about @a proposal.
+   *
+   * @newin{2,10}
+   */
+  _WRAP_METHOD(const Gtk::Widget* get_info_widget(const Glib::RefPtr<const SourceCompletionProposal>& proposal) const, gtk_source_completion_provider_get_info_widget)
 
   /** Update extra information shown in @a info for @a proposal.
    *
diff --git a/gtksourceview/src/sourcelanguagemanager.hg b/gtksourceview/src/sourcelanguagemanager.hg
index 96db8aa..9f24377 100644
--- a/gtksourceview/src/sourcelanguagemanager.hg
+++ b/gtksourceview/src/sourcelanguagemanager.hg
@@ -214,7 +214,7 @@ public:
    * @return A SourceLanguage, or empty Glib::RefPtr if there is no suitable
    * language for given @a filename and/or @a content_type.
    */
-  _WRAP_METHOD(Glib::RefPtr<const SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type) const, gtk_source_language_manager_guess_language, refreturn, constversion) 
+  _WRAP_METHOD(Glib::RefPtr<const SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type) const, gtk_source_language_manager_guess_language, refreturn, constversion)
 };
 
 } /* namespace gtksourceview */



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