[gtksourceviewmm] Handled some TODOs.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceviewmm] Handled some TODOs.
- Date: Tue, 2 Nov 2010 20:18:04 +0000 (UTC)
commit e4f1a0ce9cd91103fc49015a9232136b30475f43
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Tue Nov 2 21:06:35 2010 +0100
Handled some TODOs.
* codegen/m4/convert_gtksourceview.m4: Added new conversion and a note
about adding new ones.
* gtksourceview/src/sourcebuffer.ccg: Handled a TODO.
* gtksourceview/src/sourcebuffer.hg: Added default signal handler
and changed prototype of a source-mark-updated signal.
* gtksourceview/src/sourcecompletion.hg: Removed TODOs.
* gtksourceview/src/sourcecompletionproposal.hg:
* gtksourceview/src/sourcecompletionprovider.hg: Virtual functions are now
private.
* gtksourceview/src/sourceiter.ccg:
* gtksourceview/src/sourceiter.hg: Removed commented code and deprecations.
* gtksourceview/src/sourcelanguage.hg: Removed default constructor,
get_hidden() now returns bool instead of gboolean.
* gtksourceview/src/sourcelanguagemanager.hg: Changed array conversions.
The part of TODO stating about NULL termination was false anyway. Also ids
and paths are handled now as std::string instead of Glib::ustring.
* gtksourceview/src/sourcemark.ccg:
* gtksourceview/src/sourcemark.hg: Changed constructors - added the one
explicitly creating the anonymous mark and a second creating a named one.
Changed order of parameters in the latter - that may be source of headaches,
so document about API breaks needs to be written!
* gtksourceview/src/sourceprintcompositor.hg: Removed the TODOs.
* gtksourceview/src/sourcestylescheme.hg: Changed the bogus base class
to correct one.
* gtksourceview/src/sourcestyleschememanager.hg: Changed array conversions.
The part of TODO stating about NULL termination was false anyway. Also ids
and paths are handled now as std::string instead of Glib::ustring.
* gtksourceview/src/sourceundomanager.hg: Virtual functions are now private.
* gtksourceview/src/sourceview.hg: Removed a TODO.
codegen/m4/convert_gtksourceview.m4 | 17 +++++
gtksourceview/src/sourcebuffer.ccg | 14 ----
gtksourceview/src/sourcebuffer.hg | 8 +--
gtksourceview/src/sourcecompletion.hg | 2 -
gtksourceview/src/sourcecompletionproposal.hg | 2 +-
gtksourceview/src/sourcecompletionprovider.hg | 2 +-
gtksourceview/src/sourceiter.ccg | 81 +++++--------------------
gtksourceview/src/sourceiter.hg | 75 -----------------------
gtksourceview/src/sourcelanguage.hg | 9 +---
gtksourceview/src/sourcelanguagemanager.hg | 23 +++----
gtksourceview/src/sourcemark.ccg | 12 +++-
gtksourceview/src/sourcemark.hg | 34 +++++++----
gtksourceview/src/sourceprintcompositor.hg | 3 -
gtksourceview/src/sourcestylescheme.hg | 14 +----
gtksourceview/src/sourcestyleschememanager.hg | 22 +++----
gtksourceview/src/sourceundomanager.hg | 2 +-
gtksourceview/src/sourceview.hg | 2 -
17 files changed, 93 insertions(+), 229 deletions(-)
---
diff --git a/codegen/m4/convert_gtksourceview.m4 b/codegen/m4/convert_gtksourceview.m4
index 541af32..8affca8 100644
--- a/codegen/m4/convert_gtksourceview.m4
+++ b/codegen/m4/convert_gtksourceview.m4
@@ -1,15 +1,25 @@
#
+# When adding a new conversion please sort conversion first by module (GDK, GTK,
+# GTKSOURCE), then alphabetically with preference to first write conversions
+# from C type to C++, and then from C++ to C. Just see below how this is done.
+#
+
+
+#
## GDK
#
+
# Gdk::Color -> GdkColor
_CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
_CONVERSION(`Gdk::Color&',`GdkColor*',`($3).gobj()')
+
#
## GTK
#
+
# GtkCellRenderer -> Gtk::CellRenderer
_CONVERSION(`GtkCellRenderer*',`Gtk::CellRenderer*',`Glib::wrap($3)')
@@ -37,6 +47,10 @@ _CONVERSION(`Gtk::TextIter&',`GtkTextIter*',`($3).gobj()')
_CONVERSION(`const Gtk::TextIter&',`const GtkTextIter*',`($3).gobj()')
+# GtkTextMark -> Gtk::TextMark
+_CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3, true)')
+
+
# Gtk::TextTagTable -> GtkTextTagTable
_CONVERSION(`const Glib::RefPtr<Gtk::TextTagTable>&',`GtkTextTagTable*',`Glib::unwrap($3)')
@@ -57,6 +71,7 @@ _CONVERSION(`const Glib::RefPtr<Gtk::Tooltip>&',`GtkTooltip*',`const_cast<GtkToo
## GTKSOURCE
#
+
# GtkSourceBuffer -> gtksourceview::SourceBuffer
_CONVERSION(`GtkSourceBuffer*',`Glib::RefPtr<SourceBuffer>',`Glib::wrap($3)')
@@ -154,10 +169,12 @@ _CONVERSION(`const Glib::RefPtr<const SourceUndoManager>&',`GtkSourceUndoManager
_CONVERSION(`GtkSourceView*',`SourceView*',`Glib::wrap($3)')
_CONVERSION(`GtkSourceView*',`const SourceView*',`Glib::wrap($3)')
+
#
## ENUMS
#
+
_CONV_ENUM(Gtk,SourceSmartHomeEndType)
_CONV_ENUM(Gtk,SourceDrawSpacesFlags)
_CONV_ENUM(Gtk,SourceCompletionActivation)
diff --git a/gtksourceview/src/sourcebuffer.ccg b/gtksourceview/src/sourcebuffer.ccg
index edbc6ef..55658d4 100644
--- a/gtksourceview/src/sourcebuffer.ccg
+++ b/gtksourceview/src/sourcebuffer.ccg
@@ -33,23 +33,9 @@ SourceBuffer::SourceBuffer (const Glib::RefPtr<Gtk::TextTagTable>& tag_table) :
_CONSTRUCT("tag-table", Glib::unwrap(tag_table))
{}
-// TODO: check later how bug 606732 goes. krnowak
SourceBuffer::SourceBuffer (const Glib::RefPtr<SourceLanguage> &language) :
-// _CONSTRUCT("tag-table, 0")
_CONSTRUCT("tag-table", 0, "language", Glib::unwrap(language))
{
- /*
- if (language)
- {
- gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (gobject_),
- Glib::unwrap(language)) ;
- }
- else
- {
- gtk_source_buffer_set_language (GTK_SOURCE_BUFFER (gobject_),
- 0) ;
- }
- */
}
bool SourceBuffer::backward_iter_to_source_mark(Gtk::TextIter& iter)
diff --git a/gtksourceview/src/sourcebuffer.hg b/gtksourceview/src/sourcebuffer.hg
index 11592e8..c9056e4 100644
--- a/gtksourceview/src/sourcebuffer.hg
+++ b/gtksourceview/src/sourcebuffer.hg
@@ -461,9 +461,6 @@ public:
*/
_WRAP_SIGNAL(void highlight_updated(Gtk::TextIter& start, Gtk::TextIter& end), "highlight-updated", no_default_handler)
-// TODO: Use lower _CONVERSION/_WRAP_SIGNAL when we break API/ABI and remove upper ones. krnowak
-#m4 _CONVERSION(`GtkTextMark*',`const Glib::RefPtr<SourceMark>&',`Glib::RefPtr<SourceMark>::cast_dynamic(Glib::wrap($3, true))')
-//#m4 _CONVERSION(`GtkTextMark*',`const Glib::RefPtr<Gtk::TextMark>&',`Glib::wrap($3, true)')
/** Emitted whenever a marker of sourcebuffer has changed and needs to be redisplayed by the view.
*
* A change in a marker's type or location can trigger this signal.
@@ -472,8 +469,7 @@ public:
* @par Handler parameters:
* where An iterator at the location where the change occurred.
*/
- _WRAP_SIGNAL(void source_mark_updated(const Glib::RefPtr<SourceMark>& where), "source-mark-updated", no_default_handler)
-// _WRAP_SIGNAL(void source_mark_updated(const Glib::RefPtr<Gtk::TextMark>& where), "source-mark-updated")
+ _WRAP_SIGNAL(void source_mark_updated(const Glib::RefPtr<Gtk::TextMark>& where), "source-mark-updated", no_default_handler)
/** Emitted whenever undo is requested.
*
@@ -481,7 +477,7 @@ public:
*
* @newin{2,10}
*/
- _WRAP_SIGNAL(void undo(), "undo", no_default_handler)
+ _WRAP_SIGNAL(void undo(), "undo")
/** Emitted whenever redo is requested.
diff --git a/gtksourceview/src/sourcecompletion.hg b/gtksourceview/src/sourcecompletion.hg
index 278bf65..b7da82d 100644
--- a/gtksourceview/src/sourcecompletion.hg
+++ b/gtksourceview/src/sourcecompletion.hg
@@ -68,7 +68,6 @@ public:
_WRAP_METHOD(bool remove_provider(const Glib::RefPtr<SourceCompletionProvider>& provider), gtk_source_completion_remove_provider, errthrow)
#m4 _CONVERSION(`GList*',`Glib::ListHandle<Glib::RefPtr<SourceCompletionProvider> >',`$2($3, Glib::OWNERSHIP_NONE)')
- // TODO: is conversion all right? C docs states: "The returned list is owned by the completion and should not be freed." krnowak
/** Get list of providers registered on completion.
*
* @return List of SourceCompletionProvider.
@@ -78,7 +77,6 @@ public:
_WRAP_METHOD(Glib::ListHandle<Glib::RefPtr<SourceCompletionProvider> > get_providers() const, gtk_source_completion_get_providers)
#m4 _CONVERSION(`const Glib::ListHandle<Glib::RefPtr<SourceCompletionProvider> >&',`GList*',`($3).data()')
- // TODO: what does passing NULL here does? If something specific, then maybe create separate method passing it. krnowak
/** Starts a new completion with the specified SourceCompletionContext and
* a list of potential candidate providers for completion.
*
diff --git a/gtksourceview/src/sourcecompletionproposal.hg b/gtksourceview/src/sourcecompletionproposal.hg
index 0ba478a..0d3b928 100644
--- a/gtksourceview/src/sourcecompletionproposal.hg
+++ b/gtksourceview/src/sourcecompletionproposal.hg
@@ -142,7 +142,7 @@ public:
*/
_WRAP_SIGNAL(void changed(), "changed")
-// TODO: should vfuncs be protected? krnowak
+private:
_WRAP_VFUNC(Glib::ustring get_label() const, get_label)
diff --git a/gtksourceview/src/sourcecompletionprovider.hg b/gtksourceview/src/sourcecompletionprovider.hg
index f467907..8cc778b 100644
--- a/gtksourceview/src/sourcecompletionprovider.hg
+++ b/gtksourceview/src/sourcecompletionprovider.hg
@@ -194,7 +194,7 @@ public:
*/
_WRAP_METHOD(int get_priority() const, gtk_source_completion_provider_get_priority)
-// TODO: should vfuncs be protected? krnowak
+private:
_WRAP_VFUNC(Glib::ustring get_name() const, get_name)
diff --git a/gtksourceview/src/sourceiter.ccg b/gtksourceview/src/sourceiter.ccg
index 82a7c3b..a9e5a42 100644
--- a/gtksourceview/src/sourceiter.ccg
+++ b/gtksourceview/src/sourceiter.ccg
@@ -51,28 +51,6 @@ SourceIter::~SourceIter ()
{
}
-#ifndef GTKSOURCEVIEWMM_DISABLE_DEPRECATED
-bool
-SourceIter::forward_search (const Glib::ustring &a_str,
- SearchFlags a_flags,
- Gtk::TextIter &a_match_start,
- Gtk::TextIter &a_match_end,
- const Gtk::TextIter &a_limit) const
-{
- return forward_search (a_str, static_cast<SourceSearchFlags>(a_flags), a_match_start, a_match_end, a_limit);
-}
-
-bool
-SourceIter::backward_search (const Glib::ustring &a_str,
- SearchFlags a_flags,
- Gtk::TextIter &a_match_start,
- Gtk::TextIter &a_match_end,
- const Gtk::TextIter &a_limit) const
-{
- return backward_search (a_str, static_cast<SourceSearchFlags>(a_flags), a_match_start, a_match_end, a_limit);
-}
-#endif // GTKSOURCEVIEWMM_DISABLE_DEPRECATED
-
bool
SourceIter::forward_search (const Glib::ustring &str,
SourceSearchFlags flags,
@@ -80,25 +58,6 @@ SourceIter::forward_search (const Glib::ustring &str,
Gtk::TextIter &match_end,
const Gtk::TextIter &limit) const
{
-// TODO: what is the use of these things? krnowak
- /*
- const GtkTextIter *gobject (gobj ()) ;
- g_return_val_if_fail (gobject, FALSE) ; // that will never fail, since gobject is always not null.
- g_return_val_if_fail (a_str.c_str (), FALSE) ; // ditto.
-
- GtkTextIter match_start, match_end ;
- gboolean res = gtk_source_iter_forward_search (gobject,
- a_str.c_str (),
- static_cast<GtkSourceSearchFlags>(a_flags),
- &match_start,
- &match_end,
- a_limit.gobj ()) ;
- Gtk::TextIter res_match_start (&match_start) ;
- Gtk::TextIter res_match_end (&match_end) ;
- a_match_start = res_match_start ;
- a_match_end = res_match_end ;
- return res ;
- */
return gtk_source_iter_forward_search(const_cast<GtkTextIter*>(gobj()),
str.c_str(),
static_cast<GtkSourceSearchFlags>(flags),
@@ -114,28 +73,12 @@ SourceIter::backward_search (const Glib::ustring &str,
Gtk::TextIter &match_end,
const Gtk::TextIter &limit) const
{
-// TODO: what is the use of these things? krnowak
- /*
- const GtkTextIter *gobject (gobj ()) ;
- g_return_val_if_fail (gobject, FALSE) ; // that will never fail, since gobject is always not null.
- g_return_val_if_fail (a_str.c_str (), FALSE) ; // ditto.
-
- GtkTextIter match_start, match_end ;
- gboolean res = gtk_source_iter_backward_search (gobject,
- a_str.c_str (),
- static_cast<GtkSourceSearchFlags>(a_flags),
- &match_start,
- &match_end,
- a_limit.gobj ()) ;
- Gtk::TextIter res_match_start (&match_start) ;
- Gtk::TextIter res_match_end (&match_end) ;
- a_match_start = res_match_start ;
- a_match_end = res_match_end ;
- return res ;
- */
return gtk_source_iter_backward_search(const_cast<GtkTextIter*>(gobj()),
- str.c_str(), static_cast<GtkSourceSearchFlags>(flags), match_start.gobj(),
- match_end.gobj(), limit.gobj());
+ str.c_str(),
+ static_cast<GtkSourceSearchFlags>(flags),
+ match_start.gobj(),
+ match_end.gobj(),
+ limit.gobj());
}
bool
@@ -145,8 +88,11 @@ SourceIter::forward_search (const Glib::ustring &str,
Gtk::TextIter &match_end) const
{
return gtk_source_iter_forward_search(const_cast<GtkTextIter*>(gobj()),
- str.c_str(), static_cast<GtkSourceSearchFlags>(flags), match_start.gobj(),
- match_end.gobj(), 0);
+ str.c_str(),
+ static_cast<GtkSourceSearchFlags>(flags),
+ match_start.gobj(),
+ match_end.gobj(),
+ 0);
}
bool
@@ -156,8 +102,11 @@ SourceIter::backward_search (const Glib::ustring &str,
Gtk::TextIter &match_end) const
{
return gtk_source_iter_backward_search(const_cast<GtkTextIter*>(gobj()),
- str.c_str(), static_cast<GtkSourceSearchFlags>(flags), match_start.gobj(),
- match_end.gobj(), 0);
+ str.c_str(),
+ static_cast<GtkSourceSearchFlags>(flags),
+ match_start.gobj(),
+ match_end.gobj(),
+ 0);
}
}//end namespace gtksourceview
diff --git a/gtksourceview/src/sourceiter.hg b/gtksourceview/src/sourceiter.hg
index e45aa70..fa5d9cb 100644
--- a/gtksourceview/src/sourceiter.hg
+++ b/gtksourceview/src/sourceiter.hg
@@ -26,23 +26,6 @@ _CC_INCLUDE(gtksourceview/gtksourceiter.h)
namespace gtksourceview
{
-
-#ifndef GTKSOURCEVIEWMM_DISABLE_DEPRECATED
- /** Flags specifying how search has to be done.
- *
- * @deprecated Use SourceSearchFlags.
- */
- _WRAP_ENUM(SearchFlags, GtkSourceSearchFlags, s#^SOURCE_##)
- /** @var SearchFlags SEARCH_VISIBLE_ONLY
- * No whitespaces?
- */
- /** @var SearchFlags SEARCH_TEXT_ONLY
- * Text only?
- */
- /** @var SearchFlags SEARCH_CASE_INSENSITIVE
- * Perform a case insensitive search.
- */
-#endif // GTKSOURCEVIEWMM_DISABLE_DEPRECATED
/** Flags specifying how search has to be done.
*
* @newin{2,10}
@@ -92,64 +75,6 @@ public:
~SourceIter () ;
-#ifndef GTKSOURCEVIEWMM_DISABLE_DEPRECATED
- /** Searches forward for @a a_str.
- *
- * Any match is returned by setting @a a_match_start to the first character of
- * the match and @a a_match_end to the first character after the match. The
- * search will not continue past @a a_limit. Note that a search is a linear or
- * O(n) operation, so you may wish to use @a a_limit to avoid locking up your
- * UI on large buffers.
- *
- * If the SEARCH_VISIBLE_ONLY flag is present, the match may have invisible
- * text interspersed in @a a_str. i.e. @a a_str will be a
- * possibly-noncontiguous subsequence of the matched range. Similarly, if you
- * specify SEARCH_TEXT_ONLY, the match may have pixbufs or child widgets mixed
- * inside the matched range. If these flags are not given, the match must be
- * exact; the special @c 0xFFFC character in @a a_str will match embedded
- * pixbufs or child widgets. If you specify the SEARCH_CASE_INSENSITIVE flag,
- * the text will be matched regardless of what case it is in.
- *
- * Same as Gtk::TextIter::forward_search(), but supports case insensitive
- * searching.
- *
- * @param a_str A search string.
- * @param a_flags Flags affecting how the search is done.
- * @param a_match_start Return location for start of match.
- * @param a_match_end Return location for end of match.
- * @param a_limit Bound for the search.
- *
- * @return Whether a match was found
- *
- * @deprecated Use method using SourceSearchFlags.
- */
- bool forward_search (const Glib::ustring &a_str,
- SearchFlags a_flags,
- Gtk::TextIter &a_match_start,
- Gtk::TextIter &a_match_end,
- const Gtk::TextIter &a_limit) const ;
-
- /** Searches backward for @a a_str.
- *
- * Same as forward_search(), but backwards.
- *
- * @param a_str A search string.
- * @param a_flags Flags affecting how the search is done.
- * @param a_match_start Return location for start of match.
- * @param a_match_end Return location for end of match.
- * @param a_limit Bound for the search.
- *
- * @return Whether a match was found.
- *
- * @deprecated Use method using SourceSearchFlags.
- */
- bool backward_search (const Glib::ustring &a_str,
- SearchFlags a_flags,
- Gtk::TextIter &a_match_start,
- Gtk::TextIter &a_match_end,
- const Gtk::TextIter &a_limit) const ;
-#endif // GTKSOURCEVIEWMM_DISABLE_DEPRECATED
-
/** Searches forward for @a str.
*
* Any match is returned by setting @a match_start to the first character of
diff --git a/gtksourceview/src/sourcelanguage.hg b/gtksourceview/src/sourcelanguage.hg
index 89f92a1..cf0f406 100644
--- a/gtksourceview/src/sourcelanguage.hg
+++ b/gtksourceview/src/sourcelanguage.hg
@@ -45,14 +45,8 @@ class SourceLanguage : public Glib::Object
{
_CLASS_GOBJECT(SourceLanguage, GtkSourceLanguage, GTK_SOURCE_LANGUAGE, Glib::Object, GObject)
-protected:
- _CTOR_DEFAULT()
-
public:
- // TODO: C API does not provide any constructor for GtkSourceLanguage, should we delete it on API/ABI break? krnowak
- _WRAP_CREATE()
-
/** Returns the ID of a language.
*
* The ID is not locale-dependent.
@@ -75,12 +69,11 @@ public:
*/
_WRAP_METHOD(Glib::ustring get_section() const, gtk_source_language_get_section)
- //TODO: THis should return bool, not gboolean.
/** Returns whether the language should be hidden from the user.
*
* @return @c true if the language should be hidden, @c false otherwise.
*/
- _WRAP_METHOD(gboolean get_hidden() const, gtk_source_language_get_hidden)
+ _WRAP_METHOD(bool get_hidden() const, gtk_source_language_get_hidden)
#m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
diff --git a/gtksourceview/src/sourcelanguagemanager.hg b/gtksourceview/src/sourcelanguagemanager.hg
index 9f24377..f2cce5e 100644
--- a/gtksourceview/src/sourcelanguagemanager.hg
+++ b/gtksourceview/src/sourcelanguagemanager.hg
@@ -67,18 +67,16 @@ public:
*/
_WRAP_METHOD(static Glib::RefPtr<SourceLanguageManager> get_default(), gtk_source_language_manager_get_default, refreturn)
-#m4 _CONVERSION(`const gchar**',`Glib::StringArrayHandle',`$2($3)')
+#m4 _CONVERSION(`const gchar**',`Glib::ArrayHandle<std::string>',`$2($3, Glib::OWNERSHIP_NONE)')
- // TODO: define own string array to use std::string, instead of Glib::ustring, when we break API/ABI. krnowak
/** Gets the list directories where language manager looks for language files.
*
* @return An array containg a list of language files directories.
*/
- _WRAP_METHOD(Glib::StringArrayHandle get_search_path() const, gtk_source_language_manager_get_search_path)
+ _WRAP_METHOD(Glib::ArrayHandle<std::string> get_search_path() const, gtk_source_language_manager_get_search_path)
-#m4 _CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<gchar**>(($3).data())')
+#m4 _CONVERSION(`const Glib::ArrayHandle<std::string>&',`gchar**',`const_cast<gchar**>(($3).data())')
- // TODO: see previous one. Also this is probably buggy, because we need NULL termination in C array and Glib::StringArrayHandle does not provide it - fixing it will break ABI. krnowak
/** Sets the list of directories where the language manager looks for language
* files.
*
@@ -89,7 +87,7 @@ public:
*
* @param dirs An empty string terminated array of strings.
*/
- _WRAP_METHOD(void set_search_path(const Glib::StringArrayHandle& dirs), gtk_source_language_manager_set_search_path)
+ _WRAP_METHOD(void set_search_path(const Glib::ArrayHandle<std::string>& dirs), gtk_source_language_manager_set_search_path)
/** Resets the list of directories where the language manager looks for
* language files to default.
@@ -105,7 +103,7 @@ public:
*
* @return An array of string containing the ids of the available languages.
*/
- _WRAP_METHOD(Glib::StringArrayHandle get_language_ids() const, gtk_source_language_manager_get_language_ids)
+ _WRAP_METHOD(Glib::ArrayHandle<std::string> get_language_ids() const, gtk_source_language_manager_get_language_ids)
/** Gets the SourceLanguage identified by the given @a id in the language
* manager.
@@ -115,7 +113,7 @@ public:
* @return A SourceLanguage, or empty Glib::RefPtr if there is no language
* identified by the given @a id.
*/
- _WRAP_METHOD(Glib::RefPtr<SourceLanguage> get_language(const Glib::ustring& id), gtk_source_language_manager_get_language, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<SourceLanguage> get_language(const std::string& id), gtk_source_language_manager_get_language, refreturn)
/** Gets the SourceLanguage identified by the given @a id in the language
* manager.
@@ -125,9 +123,8 @@ public:
* @return A SourceLanguage, or empty Glib::RefPtr if there is no language
* identified by the given @a id.
*/
- _WRAP_METHOD(Glib::RefPtr<const SourceLanguage> get_language(const Glib::ustring& id) const, gtk_source_language_manager_get_language, constversion, refreturn)
- _IGNORE(gtk_source_language_manager_guess_language)
-// TODO: change filename parameter to std::string, when we break API/ABI. krnowak
+ _WRAP_METHOD(Glib::RefPtr<const SourceLanguage> get_language(const std::string& id) const, gtk_source_language_manager_get_language, constversion, refreturn)
+
/** Picks a SourceLanguage for given file name and content type,
* according to the information in lang files.
*
@@ -166,7 +163,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<SourceLanguage> guess_language(const Glib::ustring& filename, const Glib::ustring& content_type), gtk_source_language_manager_guess_language, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<SourceLanguage> guess_language(const std::string& filename, const std::string& content_type), gtk_source_language_manager_guess_language, refreturn)
/** Picks a SourceLanguage for given file name and content type,
* according to the information in lang files.
@@ -214,7 +211,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 std::string& filename, const std::string& content_type) const, gtk_source_language_manager_guess_language, refreturn, constversion)
};
} /* namespace gtksourceview */
diff --git a/gtksourceview/src/sourcemark.ccg b/gtksourceview/src/sourcemark.ccg
index b313adc..b8111b7 100644
--- a/gtksourceview/src/sourcemark.ccg
+++ b/gtksourceview/src/sourcemark.ccg
@@ -23,10 +23,16 @@
namespace gtksourceview
{
-//This is custom implemented because the C _new() function specifies an extra left-gravity property:
-SourceMark::SourceMark(const Glib::ustring& category, const Glib::ustring& name)
+// Both constructors are implemented by hand because the C _new() function
+// specifies an extra left-gravity property.
+SourceMark::SourceMark(const Glib::ustring& category)
:
- _CONSTRUCT("name", (name.empty() ? 0 : name.c_str()), "category", category.c_str(), "left-gravity", TRUE)
+ _CONSTRUCT("name", 0, "category", category.c_str(), "left-gravity", TRUE)
+{}
+
+SourceMark::SourceMark(const Glib::ustring& name, const Glib::ustring& category)
+:
+ _CONSTRUCT("name", name.c_str(), "category", category.c_str(), "left-gravity", TRUE)
{}
Glib::RefPtr<SourceMark> SourceMark::next()
diff --git a/gtksourceview/src/sourcemark.hg b/gtksourceview/src/sourcemark.hg
index e91426e..fcd8711 100644
--- a/gtksourceview/src/sourcemark.hg
+++ b/gtksourceview/src/sourcemark.hg
@@ -35,22 +35,34 @@ class SourceMark : public Gtk::TextMark
_CLASS_GOBJECT(SourceMark, GtkSourceMark, GTK_SOURCE_MARK, Gtk::TextMark, GtkTextMark)
protected:
- // TODO: C API does not provide default constructor for GtkSourceMark, should we delete it on API/ABI break? krnowak
- _CTOR_DEFAULT
- /* TODO: When breaking API/ABI add a constructor getting only category parameter to allow explicit anonymous mark creation and empty string names. Maybe also return to normal order of parameters. Does it have sense? krnowak
- */
- // We reversed the parameter order, because name can be NULL:
- explicit SourceMark(const Glib::ustring& category, const Glib::ustring& name = Glib::ustring());
+ explicit SourceMark(const Glib::ustring& category);
+ explicit SourceMark(const Glib::ustring& name, const Glib::ustring& category);
_IGNORE(gtk_source_mark_new)
public:
+ /** Creates an anonymous text mark.
+ *
+ * Add it to a buffer using Gtk::TextBuffer::add_mark(). Note that such marks
+ * cannot be retrieved by using Gtk::TextBuffer::get_mark(). Normally marks
+ * are created using the utility function
+ * gtksourceview::SourceBuffer::create_source_mark().
+ *
+ * @param category Is used to classify marks according to common
+ * characteristics (e.g. all the marks representing a bookmark could belong to
+ * the "bookmark" category, or all the marks representing a compilation error
+ * could belong to "error" category).
+ *
+ * @return A new anonymous SourceMark that can be added using
+ * GtkTextBuffer::add_mark().
+ */
+ _WRAP_CREATE(const Glib::ustring& category)
+
/** Creates a text mark.
*
- * Add it to a buffer using Gtk::TextBuffer::add_mark(). If @a name is empty
- * string, the mark is anonymous; otherwise, the mark can be retrieved by name
- * using Gtk::TextBuffer::get_mark(). Normally marks are created using the
- * utility function SourceBuffer::create_mark().
+ * Add it to a buffer using Gtk::TextBuffer::add_mark(). The mark can be
+ * retrieved by name by using Gtk::TextBuffer::get_mark(). Normally marks are
+ * created using the utility function SourceBuffer::create_source_mark().
*
* @param category Is used to classify marks according to common
* characteristics (e.g. all the marks representing a bookmark could belong to
@@ -60,7 +72,7 @@ public:
*
* @return A new SourceMark that can be added using GtkTextBuffer::add_mark().
*/
- _WRAP_CREATE(const Glib::ustring& category, const Glib::ustring& name = Glib::ustring())
+ _WRAP_CREATE(const Glib::ustring& name, const Glib::ustring& category)
/** Returns the mark category.
*
diff --git a/gtksourceview/src/sourceprintcompositor.hg b/gtksourceview/src/sourceprintcompositor.hg
index e3f85f0..2adc026 100644
--- a/gtksourceview/src/sourceprintcompositor.hg
+++ b/gtksourceview/src/sourceprintcompositor.hg
@@ -216,7 +216,6 @@ public:
*/
_WRAP_METHOD(void set_line_numbers_font_name(const Glib::ustring& font_name), gtk_source_print_compositor_set_line_numbers_font_name)
- // TODO: set_default_line_numbers_font_name() or set_line_numbers_font_name()? krnowak
/** Sets the default font for printing line numbers on the left margin.
*
* The font to be used will be the same used as used for the text.
@@ -254,7 +253,6 @@ public:
*/
_WRAP_METHOD(void set_header_font_name(const Glib::ustring& font_name), gtk_source_print_compositor_set_header_font_name)
- // TODO: set_default_header_font_name() or set_header_font_name()? krnowak
/** Sets the default font for printing the page header.
*
* The font to be used will be the same used as used for the text.
@@ -291,7 +289,6 @@ public:
*/
_WRAP_METHOD(void set_footer_font_name(const Glib::ustring& font_name), gtk_source_print_compositor_set_footer_font_name)
- // TODO: set_default_footer_font_name() or set_footer_font_name()? krnowak
/** Sets the default font for printing the page footer.
*
* The font to be used will be the same used as used for the text.
diff --git a/gtksourceview/src/sourcestylescheme.hg b/gtksourceview/src/sourcestylescheme.hg
index 9a53154..21cace1 100644
--- a/gtksourceview/src/sourcestylescheme.hg
+++ b/gtksourceview/src/sourcestylescheme.hg
@@ -20,12 +20,12 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm/interface.h>
+#include <glibmm/object.h>
#include <gtksourceviewmm/sourcestyle.h>
#include <gtksourceview/gtksourcestylescheme.h>
_DEFS(gtksourceviewmm,gtksourceview)
-_PINCLUDE(glibmm/private/interface_p.h)
+_PINCLUDE(glibmm/private/object_p.h)
namespace gtksourceview
{
@@ -44,18 +44,10 @@ namespace gtksourceview
*
* @newin{2,2}
*/
-class SourceStyleScheme : public Glib::Interface
-{
-
- _CLASS_INTERFACE(SourceStyleScheme, GtkSourceStyleScheme, GTK_SOURCE_STYLE_SCHEME, GTypeInterface)
-
-// TODO: This is wrong. GtkSourceStyleScheme is not an interface. Changing this breaks API. krnowak
-/*
class SourceStyleScheme : public Glib::Object
{
-
_CLASS_GOBJECT(SourceStyleScheme, GtkSourceStyleScheme, GTK_SOURCE_STYLE_SCHEME, Glib::Object, GObject)
-*/
+
public:
/** Gets scheme id.
diff --git a/gtksourceview/src/sourcestyleschememanager.hg b/gtksourceview/src/sourcestyleschememanager.hg
index 9bd02e2..35917a5 100644
--- a/gtksourceview/src/sourcestyleschememanager.hg
+++ b/gtksourceview/src/sourcestyleschememanager.hg
@@ -52,35 +52,33 @@ public:
*/
_WRAP_METHOD(static Glib::RefPtr<SourceStyleSchemeManager> get_default(), gtk_source_style_scheme_manager_get_default, refreturn)
-#m4 _CONVERSION(`const gchar**',`Glib::StringArrayHandle',`$2($3)')
+#m4 _CONVERSION(`const gchar**',`Glib::ArrayHandle<std::string>',`$2($3, Glib::OWNERSHIP_NONE)')
- // TODO: define own string array to use std::string, instead of Glib::ustring, when we break API/ABI. krnowak
/** Returns the current search path for the manager.
*
* See set_search_path() for details.
*
* @return An array of string containing the search path.
*/
- _WRAP_METHOD(Glib::StringArrayHandle get_search_path() const, gtk_source_style_scheme_manager_get_search_path)
+ _WRAP_METHOD(Glib::ArrayHandle<std::string> get_search_path() const, gtk_source_style_scheme_manager_get_search_path)
-#m4 _CONVERSION(`const Glib::StringArrayHandle&',`gchar**',`const_cast<gchar**>(($3).data())')
+#m4 _CONVERSION(`const Glib::ArrayHandle<std::string>&',`gchar**',`const_cast<gchar**>(($3).data())')
- // TODO: see previous one. Also this is probably buggy, because we need NULL termination in C array and Glib::StringArrayHandle does not provide it - fixing it will break ABI. krnowak
/** Sets the list of directories where the manager looks for style scheme
* files.
*
* @param path An empty string terminated array of strings.
*/
- _WRAP_METHOD(void set_search_path(const Glib::StringArrayHandle& path), gtk_source_style_scheme_manager_set_search_path)
+ _WRAP_METHOD(void set_search_path(const Glib::ArrayHandle<std::string>& path), gtk_source_style_scheme_manager_set_search_path)
/** Resets the list of directories where the manager looks for style scheme
- * files to default.
+ * files to default.
*/
void reset_search_path();
- _WRAP_METHOD(void append_search_path(const Glib::ustring& path), gtk_source_style_scheme_manager_append_search_path)
+ _WRAP_METHOD(void append_search_path(const std::string& path), gtk_source_style_scheme_manager_append_search_path)
- _WRAP_METHOD(void prepend_search_path(const Glib::ustring& path), gtk_source_style_scheme_manager_prepend_search_path)
+ _WRAP_METHOD(void prepend_search_path(const std::string& path), gtk_source_style_scheme_manager_prepend_search_path)
/** Looks up style scheme by id.
*
@@ -88,7 +86,7 @@ public:
*
* @return A SourceStyleScheme object.
*/
- _WRAP_METHOD(Glib::RefPtr<SourceStyleScheme> get_scheme(const Glib::ustring& scheme_id), gtk_source_style_scheme_manager_get_scheme, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<SourceStyleScheme> get_scheme(const std::string& scheme_id), gtk_source_style_scheme_manager_get_scheme, refreturn)
/** Looks up style scheme by id.
*
@@ -96,7 +94,7 @@ public:
*
* @return A SourceStyleScheme object.
*/
- _WRAP_METHOD(Glib::RefPtr<const SourceStyleScheme> get_scheme(const Glib::ustring& scheme_id) const, gtk_source_style_scheme_manager_get_scheme, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<const SourceStyleScheme> get_scheme(const std::string& scheme_id) const, gtk_source_style_scheme_manager_get_scheme, refreturn, constversion)
/** Mark any currently cached information about the available style schemes
* as invalid.
@@ -111,7 +109,7 @@ public:
* @return An array of string containing the ids of the available style
* schemes.
*/
- _WRAP_METHOD(Glib::StringArrayHandle get_scheme_ids() const, gtk_source_style_scheme_manager_get_scheme_ids)
+ _WRAP_METHOD(Glib::ArrayHandle<std::string> get_scheme_ids() const, gtk_source_style_scheme_manager_get_scheme_ids)
};//end class SourceStyleSchemeManager
diff --git a/gtksourceview/src/sourceundomanager.hg b/gtksourceview/src/sourceundomanager.hg
index f46e8fb..4a428cb 100644
--- a/gtksourceview/src/sourceundomanager.hg
+++ b/gtksourceview/src/sourceundomanager.hg
@@ -114,7 +114,7 @@ public:
*/
_WRAP_SIGNAL(void can_redo_changed(), "can-redo-changed")
-// TODO: should vfuncs be protected? krnowak
+private:
_WRAP_VFUNC(bool can_undo() const, can_undo)
diff --git a/gtksourceview/src/sourceview.hg b/gtksourceview/src/sourceview.hg
index 683cf08..c28dd69 100644
--- a/gtksourceview/src/sourceview.hg
+++ b/gtksourceview/src/sourceview.hg
@@ -500,8 +500,6 @@ public:
*/
_WRAP_SIGNAL(void line_mark_activated(Gtk::TextIter& mark, GdkEvent* event), "line-mark-activated")
- // TODO: there is no function pointer to "smart-home-end" signal handler in C class struct. - krnowak
- // TODO: bug #633407. - krnowak
/** Emitted when a the cursor was moved according to the smart home end setting.
*
* The signal is emitted after the cursor is moved, but during the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]