Skip to content

Commit c970a6a

Browse files
authored
Merge pull request #3083 from hansu/gtk-sourceview-4-migration
Migrate to GtkSourceview 4
2 parents 25fdb58 + 73a6d15 commit c970a6a

9 files changed

Lines changed: 11 additions & 121 deletions

File tree

debian/control.main-pkg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Depends:
2222
python3-opengl,
2323
python3-configobj,
2424
python3-xlib,
25-
libgtksourceview-3.0-dev,
25+
libgtksourceview-4-dev,
2626
tcl@TCLTK_VERSION@,
2727
tk@TCLTK_VERSION@,
2828
bwidget (>= 1.7),

debian/linuxcnc.install.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ usr/share/axis
119119
usr/share/glade
120120
usr/share/gmoccapy
121121
usr/share/gscreen
122-
usr/share/gtksourceview-2.0
122+
usr/share/gtksourceview-4
123123

124124
usr/share/applications/linuxcnc.desktop
125125
usr/share/applications/linuxcnc-latency.desktop

docs/src/gui/gladevcp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ image::images/offsetpage.png[align="center"]
19191919
=== HAL_sourceview widget
19201920

19211921
This is for displaying and simple editing of G-code.
1922-
It looks for `.ngc` highlighting specs in `~/share/gtksourceview-2.0/language-specs/`.
1922+
It looks for `.ngc` highlighting specs in `~/share/gtksourceview-4/language-specs/`.
19231923
The current running line will be highlighted.
19241924

19251925
With external Python glue code it can:

lib/python/gladevcp/gtksourceview.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<glade-catalog name="gtksourceview" library="gtksourceview-2.0" depends="gtk+">
3+
<glade-catalog name="gtksourceview" library="gtksourceview-4" depends="gtk+">
44
<glade-widget-classes>
55
<glade-widget-class name="GtkSourceView" title="GtkSourceView" generic-name="gtksourceview">
66
<properties>

lib/python/gladevcp/hal_sourceview.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import gi
2626
gi.require_version("Gtk","3.0")
2727
gi.require_version("Gdk","3.0")
28-
gi.require_version("GtkSource","3.0")
28+
gi.require_version("GtkSource","4")
2929
from gi.repository import Gtk
3030
from gi.repository import Gdk
3131
from gi.repository import GObject
@@ -62,10 +62,10 @@ def __init__(self, *a, **kw):
6262
self.lm = GtkSource.LanguageManager()
6363
self.sm = GtkSource.StyleSchemeManager()
6464
if 'EMC2_HOME' in os.environ:
65-
path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-2.0/language-specs/')
65+
path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-4/language-specs/')
6666
self.lm.set_search_path(self.lm.get_search_path() + [path])
6767

68-
self.buf.set_language(self.lm.get_language('.ngc'))
68+
self.buf.set_language(self.lm.get_language('gcode'))
6969
self.set_show_line_numbers(True)
7070
self.set_show_line_marks(True)
7171
self.set_highlight_current_line(True)
@@ -116,7 +116,7 @@ def set_language(self, lang, path = None):
116116
# lang = the lang file to set
117117
if path == None:
118118
if 'EMC2_HOME' in os.environ:
119-
path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-2.0/language-specs/')
119+
path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-4/language-specs/')
120120
if path:
121121
self.lm.set_search_path(path)
122122
self.buf.set_language(self.lm.get_language(lang))

share/gtksourceview-2.0/language-specs/ngc.lang

Lines changed: 0 additions & 110 deletions
This file was deleted.
File renamed without changes.

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ install-dirs:
688688
$(DESTDIR)$(datadir)/gmoccapy/icons \
689689
$(DESTDIR)$(datadir)/glade/catalogs \
690690
$(DESTDIR)$(datadir)/glade/pixmaps/hicolor/22x22/actions \
691-
$(DESTDIR)$(datadir)/gtksourceview-2.0/language-specs \
691+
$(DESTDIR)$(datadir)/gtksourceview-4/language-specs \
692692
$(DESTDIR)$(datadir)/linuxcnc/stepconf \
693693
$(DESTDIR)$(datadir)/linuxcnc/pncconf \
694694
$(DESTDIR)$(datadir)/linuxcnc/pncconf/pncconf-help \
@@ -764,7 +764,7 @@ install-kernel-indep: install-dirs
764764
$(FILE) ../lib/python/gladevcp/hal_python.xml $(DESTDIR)$(datadir)/glade/catalogs/
765765
$(FILE) ../share/glade/pixmaps/hicolor/22x22/actions/widget*.png $(DESTDIR)$(datadir)/glade/pixmaps/hicolor/22x22/actions/
766766

767-
$(FILE) ../share/gtksourceview-2.0/language-specs/*.lang $(DESTDIR)$(datadir)/gtksourceview-2.0/language-specs/
767+
$(FILE) ../share/gtksourceview-4/language-specs/*.lang $(DESTDIR)$(datadir)/gtksourceview-4/language-specs/
768768

769769
$(FILE) ../src/hal/drivers/mesa-hostmot2/modbus/*.tmpl $(DESTDIR)$(prefix)/share/linuxcnc/
770770

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def __init__(self, argv):
426426
# check the highlighting type
427427
# the following would load the python language
428428
# self.widgets.gcode_view.set_language("python")
429-
LANGDIR = os.path.join(BASE, "share", "Gtksourceview-2.0", "language-specs")
429+
LANGDIR = os.path.join(BASE, "share", "Gtksourceview-4", "language-specs")
430430
file_path = os.path.join(LANGDIR, "gcode.lang")
431431
if os.path.isfile(file_path):
432432
LOG.info("Gcode.lang found")

0 commit comments

Comments
 (0)