[gtksourceviewmm] Revert "Revert all changes that use gtkmm-4.0"
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceviewmm] Revert "Revert all changes that use gtkmm-4.0"
- Date: Sun, 14 Jan 2018 19:55:39 +0000 (UTC)
commit 53b294873395ecf8db1b80d1287af2783c1b6ebb
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Jan 10 22:38:54 2018 +0100
Revert "Revert all changes that use gtkmm-4.0"
Now gtksourceview does use gtk+ 4.
This reverts commit 102dbac557e7abf2dfdf4b760b6fffd318a16a58.
codegen/Makefile.am | 2 +-
.../extradefs/generate_extra_defs_gtksourceview.cc | 4 +-
configure.ac | 16 ++++++------
gtksourceview/src/buffer.ccg | 9 ++++---
gtksourceview/src/buffer.hg | 23 +++++++++--------
gtksourceview/src/completion.hg | 5 ++-
gtksourceview/src/completioncontext.ccg | 9 ++++++-
gtksourceview/src/completioncontext.hg | 13 +++++++++-
gtksourceview/src/completioninfo.hg | 6 ++--
gtksourceview/src/completionprovider.hg | 13 +++++----
gtksourceview/src/gutterrenderer.hg | 22 ++++++++--------
gtksourceview/src/searchcontext.hg | 4 +-
gtksourceview/src/view.ccg | 8 +++---
gtksourceview/src/view.hg | 2 +-
tests/basic/main.cc | 7 +----
tests/completion/main.cc | 12 ++++-----
tests/get_buffer/main.cc | 4 +-
tests/langs/main.cc | 5 +--
tests/search/main.cc | 26 +++++++++----------
19 files changed, 102 insertions(+), 88 deletions(-)
---
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 2ddb543..3639738 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -6,7 +6,7 @@ dist_noinst_DATA = $(addprefix m4/,$(files_codegen_m4))
noinst_PROGRAMS = extradefs/generate_extra_defs
extradefs_generate_extra_defs_SOURCES = extradefs/generate_extra_defs_gtksourceview.cc
-extradefs_generate_extra_defs_LDADD = $(GTKSOURCEVIEWMM_LIBS) -lglibmm_generate_extra_defs-2.4
+extradefs_generate_extra_defs_LDADD = $(GTKSOURCEVIEWMM_LIBS) -lglibmm_generate_extra_defs-2.54
AM_CPPFLAGS = -I$(top_builddir) $(GTHREAD_CFLAGS) $(GTKSOURCEVIEWMM_CFLAGS)
AM_CXXFLAGS = $(GTKSOURCEVIEWMM_WXXFLAGS)
diff --git a/codegen/extradefs/generate_extra_defs_gtksourceview.cc
b/codegen/extradefs/generate_extra_defs_gtksourceview.cc
index db4b5ab..3bc80d6 100644
--- a/codegen/extradefs/generate_extra_defs_gtksourceview.cc
+++ b/codegen/extradefs/generate_extra_defs_gtksourceview.cc
@@ -23,9 +23,9 @@
#include <gtksourceview/gtksource.h>
#include <gtksourceview/completion-providers/words/gtksourcecompletionwords.h>
-int main (int argc, char *argv[])
+int main ()
{
- gtk_init(&argc, &argv);
+ gtk_init();
std::cout << get_defs (GTK_SOURCE_TYPE_BUFFER)
<< get_defs (GTK_SOURCE_TYPE_COMPLETION)
diff --git a/configure.ac b/configure.ac
index bcd6d0a..de126bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,22 +27,22 @@ LT_INIT([win32-dll disable-static])
AC_PROG_CXX
MM_AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
-AC_SUBST([GTKSOURCEVIEWMM_MODULES], ['glibmm-2.4 >= 2.46.1 gtkmm-3.0 >= 3.18.0 gtksourceview-4 >= 3.99.0'])
+AC_SUBST([GTKSOURCEVIEWMM_MODULES], ['gtkmm-4.0 >= 3.18.0 gtksourceview-4 >= 3.99.0'])
PKG_CHECK_MODULES([GTKSOURCEVIEWMM], [$GTKSOURCEVIEWMM_MODULES])
MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0])
-MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.4])
-MM_PKG_CONFIG_SUBST([GMMPROC_EXTRA_M4_DIR], [--variable=gmmprocm4dir cairomm-1.0 pangomm-1.4 atkmm-1.6
gtkmm-3.0])
+MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.54])
+MM_PKG_CONFIG_SUBST([GMMPROC_EXTRA_M4_DIR], [--variable=gmmprocm4dir pangomm-2.42 atkmm-2.26 gtkmm-4.0])
MM_ARG_DISABLE_DEPRECATED_API([GTKSOURCEVIEWMM])
MM_ARG_ENABLE_DOCUMENTATION
MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
-MM_ARG_WITH_TAGFILE_DOC([libsigc++-2.0.tag], [sigc++-2.0])
-MM_ARG_WITH_TAGFILE_DOC([glibmm-2.4.tag], [glibmm-2.4])
-MM_ARG_WITH_TAGFILE_DOC([cairomm-1.0.tag], [cairomm-1.0])
-MM_ARG_WITH_TAGFILE_DOC([pangomm-1.4.tag], [pangomm-1.4])
-MM_ARG_WITH_TAGFILE_DOC([gtkmm-3.0.tag], [gtkmm-3.0])
+MM_ARG_WITH_TAGFILE_DOC([libsigc++-3.0.tag], [sigc++-3.0])
+MM_ARG_WITH_TAGFILE_DOC([glibmm-2.54.tag], [glibmm-2.54])
+MM_ARG_WITH_TAGFILE_DOC([cairomm-1.14.tag], [cairomm-1.14])
+MM_ARG_WITH_TAGFILE_DOC([pangomm-2.42.tag], [pangomm-2.42])
+MM_ARG_WITH_TAGFILE_DOC([gtkmm-4.0.tag], [gtkmm-4.0])
AC_LANG([C++])
MM_ARG_ENABLE_WARNINGS([GTKSOURCEVIEWMM_WXXFLAGS],
diff --git a/gtksourceview/src/buffer.ccg b/gtksourceview/src/buffer.ccg
index bc1e5c9..91dee97 100644
--- a/gtksourceview/src/buffer.ccg
+++ b/gtksourceview/src/buffer.ccg
@@ -25,6 +25,7 @@
#include <glibmm/vectorutils.h>
using iterator = Gsv::Buffer::iterator;
+using const_iterator = Gsv::Buffer::const_iterator;
namespace Gsv
{
@@ -53,7 +54,7 @@ bool Buffer::forward_iter_to_source_mark(iterator& iter)
}
Glib::RefPtr<Gsv::Mark>
-Buffer::create_source_mark(const Glib::ustring& category, const iterator& where)
+Buffer::create_source_mark(const Glib::ustring& category, const const_iterator& where)
{
return Glib::wrap(gtk_source_buffer_create_source_mark(gobj(), 0, category.c_str(), where.gobj()));
}
@@ -63,13 +64,13 @@ std::vector<Glib::RefPtr<Gsv::Mark> > Buffer::get_source_marks_at_line(int line)
return Glib::SListHandler<Glib::RefPtr<Gsv::Mark>
::slist_to_vector(gtk_source_buffer_get_source_marks_at_line(const_cast<GtkSourceBuffer*>(gobj()), line, 0),
Glib::OWNERSHIP_SHALLOW);
}
-std::vector<Glib::RefPtr<Gsv::Mark> > Buffer::get_source_marks_at_iter(iterator& iter) const
+std::vector<Glib::RefPtr<Gsv::Mark> > Buffer::get_source_marks_at_iter(const const_iterator& iter) const
{
- return Glib::SListHandler<Glib::RefPtr<Gsv::Mark>
::slist_to_vector(gtk_source_buffer_get_source_marks_at_iter(const_cast<GtkSourceBuffer*>(gobj()),
iter.gobj(), 0), Glib::OWNERSHIP_SHALLOW);
+ return Glib::SListHandler<Glib::RefPtr<Gsv::Mark>
::slist_to_vector(gtk_source_buffer_get_source_marks_at_iter(const_cast<GtkSourceBuffer*>(gobj()),
const_cast<GtkTextIter*>(iter.gobj()), 0), Glib::OWNERSHIP_SHALLOW);
}
void
-Buffer::remove_source_marks(const iterator& start, const iterator& end)
+Buffer::remove_source_marks(const const_iterator& start, const const_iterator& end)
{
gtk_source_buffer_remove_source_marks(gobj(), start.gobj(), end.gobj(), 0);
}
diff --git a/gtksourceview/src/buffer.hg b/gtksourceview/src/buffer.hg
index 716e9c5..1f37fba 100644
--- a/gtksourceview/src/buffer.hg
+++ b/gtksourceview/src/buffer.hg
@@ -77,6 +77,7 @@ protected:
public:
using iterator = TextBuffer::iterator;
+ using const_iterator = TextBuffer::const_iterator;
/** Create a new source buffer.
*
@@ -228,7 +229,7 @@ public:
*/
bool forward_iter_to_source_mark(iterator& iter);
-#m4 _CONVERSION(`const iterator&',`const GtkTextIter*',`($3).gobj()')
+#m4 _CONVERSION(`const const_iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
/** Forces buffer to analyze and highlight the given area synchronously.
*
* @note This is a potentially slow operation and should be used only when you
@@ -238,7 +239,7 @@ public:
* @param start Start of the area to highlight.
* @param end End of the area to highlight.
*/
- _WRAP_METHOD(void ensure_highlight(const iterator& start, const iterator& end),
gtk_source_buffer_ensure_highlight)
+ _WRAP_METHOD(void ensure_highlight(const const_iterator& start, const const_iterator& end),
gtk_source_buffer_ensure_highlight)
/** Returns the StyleScheme currently used in buffer.
*
@@ -286,7 +287,7 @@ public:
*
* @return A new Mark.
*/
- _WRAP_METHOD(Glib::RefPtr<Gsv::Mark> create_source_mark(const Glib::ustring& name, const Glib::ustring&
category, const iterator& where), gtk_source_buffer_create_source_mark, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<Gsv::Mark> create_source_mark(const Glib::ustring& name, const Glib::ustring&
category, const const_iterator& where), gtk_source_buffer_create_source_mark, refreturn)
/** Creates an anonymous source mark in the buffer of category category.
*
@@ -309,7 +310,7 @@ public:
*
* @newin{2,10}
*/
- Glib::RefPtr<Gsv::Mark> create_source_mark(const Glib::ustring& category, const iterator& where);
+ Glib::RefPtr<Gsv::Mark> create_source_mark(const Glib::ustring& category, const const_iterator& where);
#m4 _CONVERSION(`GSList*',`std::vector<Glib::RefPtr<Gsv::Mark> >',
`Glib::SListHandler<Glib::RefPtr<Gsv::Mark> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
#m4 _CONVERSION(`GSList*',`std::vector<Glib::RefPtr<const Gsv::Mark> >',
`Glib::SListHandler<Glib::RefPtr<const Gsv::Mark> >slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
@@ -339,7 +340,7 @@ public:
*
* @return A list of source marks.
*/
- _WRAP_METHOD(std::vector<Glib::RefPtr<Gsv::Mark> > get_source_marks_at_iter(iterator& iter, const
Glib::ustring& category) const, gtk_source_buffer_get_source_marks_at_iter)
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Gsv::Mark> > get_source_marks_at_iter(const const_iterator& iter,
const Glib::ustring& category) const, gtk_source_buffer_get_source_marks_at_iter)
/** Returns the list of marks of any category at @a iter.
*
@@ -347,7 +348,7 @@ public:
*
* @return A list of source marks.
*/
- std::vector<Glib::RefPtr<Gsv::Mark> > get_source_marks_at_iter(iterator& iter) const;
+ std::vector<Glib::RefPtr<Gsv::Mark> > get_source_marks_at_iter(const const_iterator& iter) const;
/** Remove all marks of @a category between start and end from the buffer.
*
@@ -355,7 +356,7 @@ public:
* @param end A iterator.
* @param category Category to search for.
*/
- _WRAP_METHOD(void remove_source_marks(const iterator& start, const iterator& end, const Glib::ustring&
category), gtk_source_buffer_remove_source_marks)
+ _WRAP_METHOD(void remove_source_marks(const const_iterator& start, const const_iterator& end, const
Glib::ustring& category), gtk_source_buffer_remove_source_marks)
/** Remove all marks of any category between start and end from the buffer.
*
@@ -364,7 +365,7 @@ public:
*
* @newin{2,10}
*/
- void remove_source_marks(const iterator& start, const iterator& end);
+ void remove_source_marks(const const_iterator& start, const const_iterator& end);
/** Check if the class @a context_class is set on @c iter.
*
@@ -375,7 +376,7 @@ public:
*
* @newin{2,10}
*/
- _WRAP_METHOD(bool iter_has_context_class(const iterator& iter, const Glib::ustring& context_class) const,
gtk_source_buffer_iter_has_context_class)
+ _WRAP_METHOD(bool iter_has_context_class(const const_iterator& iter, const Glib::ustring& context_class)
const, gtk_source_buffer_iter_has_context_class)
/** Moves backward to the next toggle (on or off) of the context class.
*
@@ -419,7 +420,7 @@ public:
*
* @newin{2,10}
*/
- _WRAP_METHOD(std::vector<Glib::ustring> get_context_classes_at_iter(const iterator& iter) const,
gtk_source_buffer_get_context_classes_at_iter)
+ _WRAP_METHOD(std::vector<Glib::ustring> get_context_classes_at_iter(const const_iterator& iter) const,
gtk_source_buffer_get_context_classes_at_iter)
/** Get the undo manager associated with the buffer.
* @return A UndoManager.
@@ -458,7 +459,7 @@ public:
_WRAP_PROPERTY("style-scheme", Glib::RefPtr<StyleScheme>)
_WRAP_PROPERTY("undo-manager", Glib::RefPtr<UndoManager>)
-#m4 _CONVERSION(`GtkTextIter*',`iterator&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`iterator&',`Glib::wrap_iter($3)')
/** Emitted whenever the syntax highlighting information has been updated,
* so that views can request a redraw if the region changed is visible.
*
diff --git a/gtksourceview/src/completion.hg b/gtksourceview/src/completion.hg
index 49a092e..5ac9a9d 100644
--- a/gtksourceview/src/completion.hg
+++ b/gtksourceview/src/completion.hg
@@ -136,7 +136,8 @@ public:
_WRAP_METHOD(const View* get_view() const, gtk_source_completion_get_view, constversion)
// 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
-#m4 _CONVERSION(`const Gtk::TextBuffer::iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
+#m4 _CONVERSION(`const
Gtk::TextBuffer::const_iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
+
/** Create a new CompletionContext for completion.
*
* The position at which the completion using the new context will consider
@@ -148,7 +149,7 @@ public:
*
* @newin{2,10}
*/
- _WRAP_METHOD(Glib::RefPtr<CompletionContext> create_context(const Gtk::TextBuffer::iterator& position),
gtk_source_completion_create_context)
+ _WRAP_METHOD(Glib::RefPtr<CompletionContext> create_context(const Gtk::TextBuffer::const_iterator&
position), gtk_source_completion_create_context)
// TODO: better wording could be used here - it is too convoluted. krnowak
/** Create a new CompletionContext for completion.
diff --git a/gtksourceview/src/completioncontext.ccg b/gtksourceview/src/completioncontext.ccg
index 2bf5bd7..a4e4b41 100644
--- a/gtksourceview/src/completioncontext.ccg
+++ b/gtksourceview/src/completioncontext.ccg
@@ -24,11 +24,18 @@
namespace Gsv
{
-Gtk::TextBuffer::iterator CompletionContext::get_iter() const
+Gtk::TextBuffer::iterator CompletionContext::get_iter()
{
Gtk::TextBuffer::iterator iter;
gtk_source_completion_context_get_iter(const_cast<GtkSourceCompletionContext*>(gobj()), iter.gobj());
return iter;
}
+Gtk::TextBuffer::const_iterator CompletionContext::get_iter() const
+{
+ Gtk::TextBuffer::const_iterator iter;
+ gtk_source_completion_context_get_iter(const_cast<GtkSourceCompletionContext*>(gobj()), iter.gobj());
+ return iter;
+}
+
} // namespace Gsv
diff --git a/gtksourceview/src/completioncontext.hg b/gtksourceview/src/completioncontext.hg
index 7a5fad0..dc50181 100644
--- a/gtksourceview/src/completioncontext.hg
+++ b/gtksourceview/src/completioncontext.hg
@@ -68,6 +68,7 @@ public:
_WRAP_METHOD(void add_proposals(const Glib::RefPtr<CompletionProvider>& provider, const
std::vector<Glib::RefPtr<CompletionProposal> >& proposals, bool finished),
gtk_source_completion_context_add_proposals)
_IGNORE(gtk_source_completion_context_get_iter)
+
/** Get the iter at which the completion was invoked.
*
* Providers can use this to determine how and if to match proposals.
@@ -76,7 +77,17 @@ public:
*
* @newin{2,10}
*/
- Gtk::TextBuffer::iterator get_iter() const;
+ Gtk::TextBuffer::iterator get_iter();
+
+ /** Get the iter at which the completion was invoked.
+ *
+ * Providers can use this to determine how and if to match proposals.
+ *
+ * @return A Gtk::TextBuffer::const_iterator.
+ *
+ * @newin{2,10}
+ */
+ Gtk::TextBuffer::const_iterator get_iter() const;
/** Get the context activation
*
diff --git a/gtksourceview/src/completioninfo.hg b/gtksourceview/src/completioninfo.hg
index b3f173d..fd9db67 100644
--- a/gtksourceview/src/completioninfo.hg
+++ b/gtksourceview/src/completioninfo.hg
@@ -49,17 +49,17 @@ public:
CompletionInfo();
#m4 _CONVERSION(`const Gtk::TextView&',`GtkTextView*',`const_cast<GtkTextView*>(($3).gobj())')
-#m4 _CONVERSION(`const Gtk::TextBuffer::iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
+#m4 _CONVERSION(`const
Gtk::TextBuffer::const_iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
/** Moves the CompletionInfo to @a iter. Moving will respect the
* Gdk::Gravity setting of the info window and will ensure the line at @a iter
* is not occluded by the window.
*
* @param view A Gtk::TextView on which the info window should be positioned.
- * @param iter A Gtk::TextBuffer::iterator.
+ * @param iter A Gtk::TextBuffer::const_iterator.
*
* @newin{2,10}
*/
- _WRAP_METHOD(void move_to_iter(const Gtk::TextView& view, const Gtk::TextBuffer::iterator& iter),
gtk_source_completion_info_move_to_iter)
+ _WRAP_METHOD(void move_to_iter(const Gtk::TextView& view, const Gtk::TextBuffer::const_iterator& iter),
gtk_source_completion_info_move_to_iter)
/** Moves the Gtk::CompletionInfo to the cursor position. Moving will
* respect the Gdk::Gravity setting of the info window and will ensure the
diff --git a/gtksourceview/src/completionprovider.hg b/gtksourceview/src/completionprovider.hg
index 42f1213..a9a8e83 100644
--- a/gtksourceview/src/completionprovider.hg
+++ b/gtksourceview/src/completionprovider.hg
@@ -147,7 +147,7 @@ public:
*/
_WRAP_METHOD(bool get_start_iter(const Glib::RefPtr<const CompletionContext>& context, const
Glib::RefPtr<const CompletionProposal>& proposal, Gtk::TextBuffer::iterator& iter),
gtk_source_completion_provider_get_start_iter)
-#m4 _CONVERSION(`const Gtk::TextBuffer::iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
+#m4 _CONVERSION(`const
Gtk::TextBuffer::const_iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
/** Activate @a proposal at @a iter.
*
* When this functions returns <tt>false</tt>, the default activation of
@@ -155,14 +155,14 @@ public:
* label of @a proposal.
*
* @param proposal A CompletionProposal.
- * @param iter A Gtk::TextBuffer::iterator.
+ * @param iter A Gtk::TextBuffer::const_iterator.
*
* @return @c true to indicate that the proposal activation has been handled,
* @c false otherwise.
*
* @newin{2,10}
*/
- _WRAP_METHOD(bool activate_proposal(const Glib::RefPtr<CompletionProposal>& proposal, const
Gtk::TextBuffer::iterator& iter), gtk_source_completion_provider_activate_proposal)
+ _WRAP_METHOD(bool activate_proposal(const Glib::RefPtr<CompletionProposal>& proposal, const
Gtk::TextBuffer::const_iterator& iter), gtk_source_completion_provider_activate_proposal)
/** Get with what kind of activation the provider should be activated.
*
@@ -223,14 +223,15 @@ private:
#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const CompletionContext>&',
`Glib::wrap($3, true)')
#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const CompletionProposal>&',
`Glib::wrap($3, true)')
-#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextBuffer::iterator&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextBuffer::iterator&',`Glib::wrap_iter($3)')
_WRAP_VFUNC(bool get_start_iter(const Glib::RefPtr<const CompletionContext>& context, const
Glib::RefPtr<const CompletionProposal>& proposal, Gtk::TextBuffer::iterator& iter), get_start_iter)
+
#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<const CompletionProposal>&',
`Glib::wrap($3)')
#m4 _CONVERSION(`GtkSourceCompletionContext*', `const Glib::RefPtr<const CompletionContext>&',
`Glib::wrap($3)')
#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<CompletionProposal>&', `Glib::wrap($3,
true)')
-#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextBuffer::iterator&',`Glib::wrap($3)')
- _WRAP_VFUNC(bool activate_proposal(const Glib::RefPtr<CompletionProposal>& proposal, const
Gtk::TextBuffer::iterator& iter), activate_proposal)
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextBuffer::const_iterator&',`Glib::wrap_const_iter($3)')
+ _WRAP_VFUNC(bool activate_proposal(const Glib::RefPtr<CompletionProposal>& proposal, const
Gtk::TextBuffer::const_iterator& iter), activate_proposal)
#m4 _CONVERSION(`GtkSourceCompletionProposal*', `const Glib::RefPtr<CompletionProposal>&', `Glib::wrap($3)')
_WRAP_VFUNC(int get_interactive_delay() const, get_interactive_delay)
diff --git a/gtksourceview/src/gutterrenderer.hg b/gtksourceview/src/gutterrenderer.hg
index c28ee57..c6360fc 100644
--- a/gtksourceview/src/gutterrenderer.hg
+++ b/gtksourceview/src/gutterrenderer.hg
@@ -40,20 +40,20 @@ class GutterRenderer : public Gtk::Object
_CLASS_GTKOBJECT(GutterRenderer, GtkSourceGutterRenderer, GTK_SOURCE_GUTTER_RENDERER, Gtk::Object,
GInitiallyUnowned)
public:
#m4 _CONVERSION(`const Cairo::RefPtr<Cairo::Context>&', `cairo_t*', `(($3) ? ($3)->cobj() : 0)')
-#m4 _CONVERSION(`Gtk::TextBuffer::iterator&',`GtkTextIter*',($3).gobj())
+#m4 _CONVERSION(`const
Gtk::TextBuffer::const_iterator&',`GtkTextIter*',const_cast<GtkTextIter*>(($3).gobj()))
_WRAP_METHOD(void begin(
const Cairo::RefPtr<Cairo::Context>& cr,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
- Gtk::TextBuffer::iterator& start,
- Gtk::TextBuffer::iterator& end), gtk_source_gutter_renderer_begin)
+ const Gtk::TextBuffer::const_iterator& start,
+ const Gtk::TextBuffer::const_iterator& end), gtk_source_gutter_renderer_begin)
_WRAP_METHOD(void draw(
const Cairo::RefPtr<Cairo::Context>& cr,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
- Gtk::TextBuffer::iterator& start,
- Gtk::TextBuffer::iterator& end,
+ const Gtk::TextBuffer::const_iterator& start,
+ const Gtk::TextBuffer::const_iterator& end,
GutterRendererState), gtk_source_gutter_renderer_draw)
_WRAP_METHOD(void end(), gtk_source_gutter_renderer_end)
@@ -116,7 +116,7 @@ public:
_WRAP_PROPERTY("background-set", bool)
#m4 _CONVERSION(`GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
-#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextBuffer::iterator&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextBuffer::iterator&',`Glib::wrap_iter($3)')
#m4 _CONVERSION(`const Gtk::TextBuffer::iterator&',`GtkTextIter*',`const_cast<GtkTextIter*>(($3).gobj())')
#m4 _CONVERSION(`GtkTooltip*', `const Glib::RefPtr<Gtk::Tooltip>&', `Glib::wrap($3, true)')
#m4 _CONVERSION(`const
Glib::RefPtr<Gtk::Tooltip>&',`GtkTooltip*',`const_cast<GtkTooltip*>(Glib::unwrap($3))')
@@ -145,19 +145,19 @@ protected:
_CTOR_DEFAULT()
#m4 _CONVERSION(`cairo_t*',`const Cairo::RefPtr<Cairo::Context>&',`Cairo::RefPtr<Cairo::Context>(new
Cairo::Context($3, false))')
-#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextBuffer::iterator&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`const Gtk::TextBuffer::const_iterator&',`Glib::wrap_const_iter($3)')
_WRAP_VFUNC(void begin(const Cairo::RefPtr<Cairo::Context>& cr,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
- Gtk::TextBuffer::iterator& start,
- Gtk::TextBuffer::iterator& end), begin)
+ const Gtk::TextBuffer::const_iterator& start,
+ const Gtk::TextBuffer::const_iterator& end), begin)
_WRAP_VFUNC(void draw(const Cairo::RefPtr<Cairo::Context>& cr,
const Gdk::Rectangle& background_area,
const Gdk::Rectangle& cell_area,
- Gtk::TextBuffer::iterator& start,
- Gtk::TextBuffer::iterator& end,
+ const Gtk::TextBuffer::const_iterator& start,
+ const Gtk::TextBuffer::const_iterator& end,
GutterRendererState), draw)
_WRAP_VFUNC(void end(), end)
diff --git a/gtksourceview/src/searchcontext.hg b/gtksourceview/src/searchcontext.hg
index 358e508..8f8eb62 100644
--- a/gtksourceview/src/searchcontext.hg
+++ b/gtksourceview/src/searchcontext.hg
@@ -130,7 +130,7 @@ public:
*
* @newin{3,10}
*/
- _WRAP_METHOD(int get_occurrence_position(const TextBuffer::iterator& match_start, const
TextBuffer::iterator& match_end) const, gtk_source_search_context_get_occurrence_position)
+ _WRAP_METHOD(int get_occurrence_position(const TextBuffer::const_iterator& match_start, const
TextBuffer::const_iterator& match_end) const, gtk_source_search_context_get_occurrence_position)
/** Synchronous forward search. It is recommended to use the asynchronous functions instead, to not block
the user interface. However, if you are sure that
* the buffer is small, this function is more convenient to use.
@@ -142,7 +142,7 @@ public:
*
* @newin{3,10}
*/
- _WRAP_METHOD(bool forward(const TextBuffer::iterator& iter, TextBuffer::iterator& match_start,
TextBuffer::iterator& match_end, bool& has_wrapped_around), gtk_source_search_context_forward)
+ _WRAP_METHOD(bool forward(const TextBuffer::const_iterator& iter, TextBuffer::iterator& match_start,
TextBuffer::iterator& match_end, bool& has_wrapped_around), gtk_source_search_context_forward)
_IGNORE(gtk_source_search_context_forward)
/** Asynchronous forward search. See the GAsyncResult documentation to know how to use this function.
diff --git a/gtksourceview/src/view.ccg b/gtksourceview/src/view.ccg
index 6a470cd..3449c9a 100644
--- a/gtksourceview/src/view.ccg
+++ b/gtksourceview/src/view.ccg
@@ -50,15 +50,15 @@ View::View(const Glib::RefPtr<Buffer> &a_buffer) :
Glib::RefPtr<const Buffer>
View::get_source_buffer () const
{
- Glib::RefPtr<const Gtk::TextBuffer> buffer = get_buffer();
- return Glib::RefPtr<const Buffer>::cast_dynamic(buffer);
+ auto buffer = get_buffer();
+ return std::dynamic_pointer_cast<const Buffer>(buffer);
}
Glib::RefPtr<Buffer>
View::get_source_buffer ()
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = get_buffer();
- return Glib::RefPtr<Buffer>::cast_dynamic(buffer);
+ auto buffer = get_buffer();
+ return std::dynamic_pointer_cast<Buffer>(buffer);
}
void
diff --git a/gtksourceview/src/view.hg b/gtksourceview/src/view.hg
index e3856cd..0a15107 100644
--- a/gtksourceview/src/view.hg
+++ b/gtksourceview/src/view.hg
@@ -338,7 +338,7 @@ public:
*/
_WRAP_SIGNAL(void undo(), "undo")
-#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextBuffer::iterator&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GtkTextIter*',`Gtk::TextBuffer::iterator&',`Glib::wrap_iter($3)')
#m4 _CONVERSION(`Gtk::TextBuffer::iterator&',`GtkTextIter*',`($3).gobj()')
/** Emitted when a line mark has been activated (for instance when there
* was a button press in the line marks gutter).
diff --git a/tests/basic/main.cc b/tests/basic/main.cc
index f87c1f2..f57da23 100644
--- a/tests/basic/main.cc
+++ b/tests/basic/main.cc
@@ -7,11 +7,10 @@ using namespace Gtk ;
using namespace Gsv;
int
-main (int a_argc, char *a_argv[])
+main ()
{
Glib::RefPtr<Gtk::Application> app =
- Gtk::Application::create(a_argc, a_argv,
- "org.gtksourceviewmm.test");
+ Gtk::Application::create("org.gtksourceviewmm.test");
Gsv::init () ;
@@ -26,8 +25,6 @@ main (int a_argc, char *a_argv[])
Window window ;
window.add (source_view) ;
- window.show_all () ;
-
app->run (window) ;
return 0 ;
diff --git a/tests/completion/main.cc b/tests/completion/main.cc
index c705279..0d8d202 100644
--- a/tests/completion/main.cc
+++ b/tests/completion/main.cc
@@ -104,7 +104,7 @@ bool TestProvider::match_vfunc(const Glib::RefPtr<const Gsv::CompletionContext>&
Gsv::CompletionActivation TestProvider::get_activation_vfunc() const
{
- return Gsv::COMPLETION_ACTIVATION_INTERACTIVE | Gsv::COMPLETION_ACTIVATION_USER_REQUESTED;
+ return Gsv::CompletionActivation::INTERACTIVE | Gsv::CompletionActivation::USER_REQUESTED;
}
int TestProvider::get_priority_vfunc() const
@@ -143,8 +143,8 @@ TestWindow::TestWindow()
m_show_icons(0)
{
// layout
- Gtk::Box* hbox (Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 1)));
- Gtk::Box* vbox (Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 1)));
+ Gtk::Box* hbox (Gtk::manage(new Gtk::Box(Gtk::Orientation::HORIZONTAL, 1)));
+ Gtk::Box* vbox (Gtk::manage(new Gtk::Box(Gtk::Orientation::VERTICAL, 1)));
m_remember = Gtk::manage(new Gtk::CheckButton("Remember info visibility"));
m_select_on_show = Gtk::manage(new Gtk::CheckButton("Select first on show"));
m_show_headers = Gtk::manage(new Gtk::CheckButton("Show headers"));
@@ -223,16 +223,14 @@ void TestWindow::show_icons_toggled()
}
int
-main (int argc, char *argv[])
+main ()
{
Glib::RefPtr<Gtk::Application> app =
- Gtk::Application::create(argc, argv,
- "org.gtksourceviewmm.test");
+ Gtk::Application::create("org.gtksourceviewmm.test");
Gsv::init();
TestWindow window;
- window.show_all();
app->run(window);
return 0;
}
diff --git a/tests/get_buffer/main.cc b/tests/get_buffer/main.cc
index 1e230e9..672688d 100644
--- a/tests/get_buffer/main.cc
+++ b/tests/get_buffer/main.cc
@@ -3,10 +3,10 @@
#include <gtksourceviewmm.h>
int
-main (int argc, char* argv[])
+main ()
{
Glib::RefPtr<Gtk::Application> app =
- Gtk::Application::create(argc, argv,
+ Gtk::Application::create(
"org.gtksourceviewmm.test");
Gsv::init () ;
diff --git a/tests/langs/main.cc b/tests/langs/main.cc
index 4573fc5..f3819de 100644
--- a/tests/langs/main.cc
+++ b/tests/langs/main.cc
@@ -8,11 +8,10 @@ using namespace std ;
using namespace Gsv ;
int
-main (int argc, char **argv)
+main ()
{
Glib::RefPtr<Gtk::Application> app =
- Gtk::Application::create(argc, argv,
- "org.gtksourceviewmm.test");
+ Gtk::Application::create("org.gtksourceviewmm.test");
Gsv::init ();
diff --git a/tests/search/main.cc b/tests/search/main.cc
index 4bab065..729619a 100644
--- a/tests/search/main.cc
+++ b/tests/search/main.cc
@@ -47,9 +47,9 @@ class SearchDialog : public Dialog {
void build_widget ()
{
- add_button ("Close", RESPONSE_ACCEPT) ;
+ add_button ("Close", ResponseType::ACCEPT) ;
- m_hbox = manage (new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL)) ;
+ m_hbox = manage (new Gtk::Box(Gtk::Orientation::HORIZONTAL)) ;
get_content_area ()->pack_start (*m_hbox) ;
Label *label = manage (new Label ("Search: ")) ;
@@ -68,7 +68,6 @@ class SearchDialog : public Dialog {
(*this, &SearchDialog::on_search_backward_button_clicked_signal));
m_hbox->pack_start (*m_search_backward_button, PACK_SHRINK) ;
- m_hbox->show_all () ;
}
void on_search_forward_button_clicked_signal ()
@@ -165,12 +164,12 @@ public:
{
try {
FileChooserDialog fc_dialog ("open a file",
- FILE_CHOOSER_ACTION_OPEN);
+ FileChooserAction::OPEN);
fc_dialog.set_select_multiple (false) ;
- fc_dialog.add_button ("Cancel", RESPONSE_CANCEL) ;
- fc_dialog.add_button ("OK", RESPONSE_ACCEPT) ;
+ fc_dialog.add_button ("Cancel", ResponseType::CANCEL) ;
+ fc_dialog.add_button ("OK", ResponseType::ACCEPT) ;
int res = fc_dialog.run () ;
- if (res != RESPONSE_ACCEPT) {return;}
+ if (res != ResponseType::ACCEPT) {return;}
ustring filename = fc_dialog.get_filename () ;
if (filename == "") {return;}
open_file (filename) ;
@@ -209,7 +208,8 @@ public:
if (!do_search (search_str, a_forward)) {
MessageDialog dialog (*a_dialog,
"Did not find string " + search_str,
- MESSAGE_WARNING) ;
+ false,
+ MessageType::WARNING) ;
dialog.run () ;
dialog.hide () ;
}
@@ -237,7 +237,7 @@ public:
limit = source_buffer->end () ;
found = search_iter.forward_search
(a_text,
- TEXT_SEARCH_TEXT_ONLY | TEXT_SEARCH_CASE_INSENSITIVE,
+ TextSearchFlags::TEXT_ONLY | TextSearchFlags::CASE_INSENSITIVE,
start,
end,
limit) ;
@@ -248,7 +248,7 @@ public:
limit = source_buffer->begin () ;
found = search_iter.backward_search
(a_text,
- TEXT_SEARCH_TEXT_ONLY | TEXT_SEARCH_CASE_INSENSITIVE,
+ TextSearchFlags::TEXT_ONLY | TextSearchFlags::CASE_INSENSITIVE,
start,
end,
limit) ;
@@ -317,7 +317,7 @@ public:
{
if (m_main_vbox) {return;}
- m_main_vbox = manage (new Gtk::Box(Gtk::ORIENTATION_VERTICAL)) ;
+ m_main_vbox = manage (new Gtk::Box(Gtk::Orientation::VERTICAL)) ;
g_return_if_fail (m_menu_bar) ;
m_main_vbox->pack_start (*m_menu_bar, PACK_SHRINK) ;
m_source_view = manage (new View) ;
@@ -363,14 +363,12 @@ int
main (int argc, char **argv)
{
Glib::RefPtr<Gtk::Application> gtkmmapp =
- Gtk::Application::create(argc, argv,
- "org.gtksourceviewmm.test");
+ Gtk::Application::create("org.gtksourceviewmm.test");
Gsv::init () ;
App app ; //TODO: Derive from Gtk::Application?
app.get_widget ().set_size_request (500, 400) ;
- app.get_widget ().show_all () ;
if (argc == 2) {
app.open_file (filename_to_utf8 (argv[1])) ;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]