Commit 742a7c04 authored by Christian Hergert's avatar Christian Hergert Committed by Jeremy Bicha

build: port to gtksourceview-4

This is a port to GtkSourceView-4 which alters the API a bit. The only
non-straightforward part is the fix for replaying previous search results,
although even that is not much different.
parent 94955d14
......@@ -19,7 +19,7 @@ AC_SUBST(GEDIT_API_VERSION)
# Dependencies
GLIB_REQUIRED=2.44
GTK_REQUIRED=3.22.0
GTKSOURCEVIEW_REQUIRED=3.22.0
GTKSOURCEVIEW_REQUIRED=4.0.2
LIBPEAS_REQUIRED=1.14.1
LIBXML_REQUIRED=2.5.0
GSPELL_REQUIRED=0.2.5
......@@ -288,7 +288,7 @@ PKG_CHECK_MODULES(GEDIT, [
gio-2.0 >= $GLIB_REQUIRED
gmodule-2.0
gtk+-3.0 >= $GTK_REQUIRED
gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED
gtksourceview-4 >= $GTKSOURCEVIEW_REQUIRED
libpeas-1.0 >= $LIBPEAS_REQUIRED
libpeas-gtk-1.0 >= $LIBPEAS_REQUIRED
gsettings-desktop-schemas
......
#!/bin/sh
PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-3.0 \
PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-4 \
pygobject-2.0 \
enchant iso-codes"
......
......@@ -5,7 +5,7 @@ includedir=@includedir@
Name: gedit
Description: gedit
Requires: gtksourceview-3.0 libpeas-1.0 libpeas-gtk-1.0
Requires: gtksourceview-4 libpeas-1.0 libpeas-gtk-1.0
Version: @VERSION@
Cflags: -I${includedir}/gedit-@GEDIT_API_VERSION@
Libs: -L${libdir} @GEDIT_IMPLIB@
......@@ -269,7 +269,7 @@ INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all
gedit_Gedit_3_0_gir_NAMESPACE = Gedit
gedit_Gedit_3_0_gir_VERSION = 3.0
gedit_Gedit_3_0_gir_PROGRAM = $(builddir)/gedit/gedit$(EXEEXT)
gedit_Gedit_3_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0
gedit_Gedit_3_0_gir_INCLUDES = Gtk-3.0 GtkSource-4
gedit_Gedit_3_0_gir_EXPORT_PACKAGES = gedit
gedit_Gedit_3_0_gir_SCANNERFLAGS = $(GEDIT_CFLAGS) $(foreach header,$(gedit_INST_H_FILES),--c-include="$(header)")
gedit_Gedit_3_0_gir_FILES = \
......@@ -295,7 +295,7 @@ gedit/gedit.vapi: gedit/Gedit-3.0.gir
VAPIGEN_VAPIS = gedit/gedit.vapi
gedit_gedit_vapi_DEPS = atk gdk-3.0 gio-2.0 gtk+-3.0 gtksourceview-3.0
gedit_gedit_vapi_DEPS = atk gdk-3.0 gio-2.0 gtk+-3.0 gtksourceview-4
gedit_gedit_vapi_METADATADIRS = $(top_srcdir)/gedit
gedit_gedit_vapi_FILES = gedit/Gedit-3.0.gir
......
......@@ -174,12 +174,12 @@ forward_search_finished (GtkSourceSearchContext *search_context,
GtkTextIter match_start;
GtkTextIter match_end;
found = gtk_source_search_context_forward_finish2 (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
found = gtk_source_search_context_forward_finish (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
buffer = gtk_source_search_context_get_buffer (search_context);
......@@ -280,12 +280,12 @@ backward_search_finished (GtkSourceSearchContext *search_context,
GtkTextIter match_end;
GtkSourceBuffer *buffer;
found = gtk_source_search_context_backward_finish2 (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
found = gtk_source_search_context_backward_finish (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
buffer = gtk_source_search_context_get_buffer (search_context);
......@@ -424,11 +424,11 @@ do_replace (GeditReplaceDialog *dialog,
gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &start, &end);
gtk_source_search_context_replace2 (search_context,
&start,
&end,
unescaped_replace_text,
-1,
gtk_source_search_context_replace (search_context,
&start,
&end,
unescaped_replace_text,
-1,
&error);
g_free (unescaped_replace_text);
......
......@@ -323,12 +323,12 @@ start_search_finished (GtkSourceSearchContext *search_context,
gboolean found;
GtkSourceBuffer *buffer;
found = gtk_source_search_context_forward_finish2 (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
found = gtk_source_search_context_forward_finish (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
buffer = gtk_source_search_context_get_buffer (search_context);
......@@ -387,12 +387,12 @@ forward_search_finished (GtkSourceSearchContext *search_context,
GtkTextIter match_end;
gboolean found;
found = gtk_source_search_context_forward_finish2 (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
found = gtk_source_search_context_forward_finish (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
if (found)
{
......@@ -445,12 +445,12 @@ backward_search_finished (GtkSourceSearchContext *search_context,
gboolean found;
GtkSourceBuffer *buffer;
found = gtk_source_search_context_backward_finish2 (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
found = gtk_source_search_context_backward_finish (search_context,
result,
&match_start,
&match_end,
NULL,
NULL);
buffer = gtk_source_search_context_get_buffer (search_context);
......@@ -852,11 +852,17 @@ search_entry_escaped (GtkSearchEntry *entry,
if (frame->search_mode == SEARCH &&
search_context != NULL)
{
GtkSourceSearchContext *search_context;
GtkTextBuffer *buffer;
g_clear_object (&frame->search_settings);
frame->search_settings = copy_search_settings (frame->old_search_settings);
gtk_source_search_context_set_settings (search_context,
frame->search_settings);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (frame->view));
search_context = gtk_source_search_context_new (GTK_SOURCE_BUFFER (buffer),
frame->search_settings);
gedit_document_set_search_context (GEDIT_DOCUMENT (buffer), search_context);
g_object_unref (search_context);
g_free (frame->search_text);
frame->search_text = NULL;
......
......@@ -87,7 +87,7 @@
<data>${prefix}/etc/gtk-3.0/*</data>
<!-- gtksourceview -->
<data>${prefix}/share/gtksourceview-3.0</data>
<data>${prefix}/share/gtksourceview-4</data>
<!-- gedit -->
<data>${prefix}/share/gedit</data>
......
......@@ -87,7 +87,7 @@ parts:
- libxml2-dev
- libglib2.0-dev
- libgtk-3-dev
- libgtksourceview-3.0-dev
- libgtksourceview-4-dev
- libpeas-dev
- libx11-dev
- python3
......
......@@ -104,7 +104,7 @@ remove_useless_stuff() {
find installer/SourceDir -name *.exe | xargs strip
# remove some translation which seem to add a lot of size
find installer/SourceDir/share/locale/ -type f | grep -v atk10.mo | grep -v libpeas.mo | grep -v gsettings-desktop-schemas.mo | grep -v json-glib-1.0.mo | grep -v glib20.mo | grep -v gedit.mo | grep -v gedit-plugins.mo | grep -v gdk-pixbuf.mo | grep -v gtk30.mo | grep -v gtk30-properties.mo | grep -v gtksourceview-3.0.mo | grep -v iso_*.mo | xargs rm
find installer/SourceDir/share/locale/ -type f | grep -v atk10.mo | grep -v libpeas.mo | grep -v gsettings-desktop-schemas.mo | grep -v json-glib-1.0.mo | grep -v glib20.mo | grep -v gedit.mo | grep -v gedit-plugins.mo | grep -v gdk-pixbuf.mo | grep -v gtk30.mo | grep -v gtk30-properties.mo | grep -v gtksourceview-4.mo | grep -v iso_*.mo | xargs rm
find installer/SourceDir/share/locale -type d | xargs rmdir -p --ignore-fail-on-non-empty
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment