diff --git a/debian/linuxcnc.install.in b/debian/linuxcnc.install.in index a6b50d6a1e6..04a3d15228b 100644 --- a/debian/linuxcnc.install.in +++ b/debian/linuxcnc.install.in @@ -119,7 +119,7 @@ usr/share/axis usr/share/glade usr/share/gmoccapy usr/share/gscreen -usr/share/gtksourceview-2.0 +usr/share/gtksourceview-4 usr/share/applications/linuxcnc.desktop usr/share/applications/linuxcnc-latency.desktop diff --git a/docs/src/gui/gladevcp.adoc b/docs/src/gui/gladevcp.adoc index 9f9c6388b9b..36c927f2d04 100644 --- a/docs/src/gui/gladevcp.adoc +++ b/docs/src/gui/gladevcp.adoc @@ -1919,7 +1919,7 @@ image::images/offsetpage.png[align="center"] === HAL_sourceview widget This is for displaying and simple editing of G-code. -It looks for `.ngc` highlighting specs in `~/share/gtksourceview-2.0/language-specs/`. +It looks for `.ngc` highlighting specs in `~/share/gtksourceview-4/language-specs/`. The current running line will be highlighted. With external Python glue code it can: diff --git a/lib/python/gladevcp/gtksourceview.xml b/lib/python/gladevcp/gtksourceview.xml index 67afa186a4b..e97e798d20f 100644 --- a/lib/python/gladevcp/gtksourceview.xml +++ b/lib/python/gladevcp/gtksourceview.xml @@ -1,6 +1,6 @@ - + diff --git a/lib/python/gladevcp/hal_sourceview.py b/lib/python/gladevcp/hal_sourceview.py index 7c29f4faa99..b1db41ee1c0 100644 --- a/lib/python/gladevcp/hal_sourceview.py +++ b/lib/python/gladevcp/hal_sourceview.py @@ -25,7 +25,7 @@ import gi gi.require_version("Gtk","3.0") gi.require_version("Gdk","3.0") -gi.require_version("GtkSource","3.0") +gi.require_version("GtkSource","4") from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject @@ -62,10 +62,10 @@ def __init__(self, *a, **kw): self.lm = GtkSource.LanguageManager() self.sm = GtkSource.StyleSchemeManager() if 'EMC2_HOME' in os.environ: - path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-2.0/language-specs/') + path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-4/language-specs/') self.lm.set_search_path(self.lm.get_search_path() + [path]) - self.buf.set_language(self.lm.get_language('.ngc')) + self.buf.set_language(self.lm.get_language('gcode')) self.set_show_line_numbers(True) self.set_show_line_marks(True) self.set_highlight_current_line(True) @@ -116,7 +116,7 @@ def set_language(self, lang, path = None): # lang = the lang file to set if path == None: if 'EMC2_HOME' in os.environ: - path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-2.0/language-specs/') + path = os.path.join(os.environ['EMC2_HOME'], 'share/gtksourceview-4/language-specs/') if path: self.lm.set_search_path(path) self.buf.set_language(self.lm.get_language(lang)) diff --git a/share/gtksourceview-2.0/language-specs/ngc.lang b/share/gtksourceview-2.0/language-specs/ngc.lang deleted file mode 100644 index 39943e9c2f6..00000000000 --- a/share/gtksourceview-2.0/language-specs/ngc.lang +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - \( - \) - - - - ;.* - - - - (#[0-9]+)|(#<[a-zA-Z0-9_]+>) - - - sin - cos - tan - asin - acos - atan - exp - ln - sqrt - fup - fix - abs - or|xor|and - mod - gt|lt|ge|le|eq|ne - - - (([-/|\=\+\*])|(\])|(\[)) - - - ^[n|N]([ |\t]*[0-9]){1,5} - - - - [0-5] - 1[ \t]*[07-9] - 2[ \t]*[018] - 3[ \t]*[03] - 3[ \t]*3[ \t]*.[ \t]*1 - 3[ \t]*8[ \t]*.[ \t]*[2-5] - 4[ \t]*[1-3][ \t]*.[ \t]*1 - 4[ \t]*[0-39] - 5[ \t]*[3-9] - 6[ \t]*[14] - 6[ \t]*.[ \t]*1 - 7[ \t]*6 - 8[ \t]*[0-9] - 9[ \t]*[0-489] - 9[ \t]*2[ \t]*.[ \t]*[1-3] - - - [0-9] - 5[ \t]*[0-3] - 3[ \t]*0 - 6[ \t]*0 - 1[ \t]*[0-9][ \t]*[1-9] - 1[ \t]*[1-9][ \t]*0 - - - [f|F|s|S]([ \t]*[0-9])*[ \t]*[.]?([ \t]*[0-9])* - - - [t|T|h|H]([ \t]*[0-9])* - - - [x|X|y|Y|z|Z|a|A|b|B|c|C|u|U|v|V|w|W|i|I|j|J|k|K|p|P|r|R|l|L][ \t]*[+|-]?[ \t]*([ \t]*[0-9]*)*[ \t]*[.]?([ \t]*[0-9]*)* - - - - sub - endsub - while - endwhile - if - else - endif - do - call - break - continue - return - - diff --git a/share/gtksourceview-2.0/language-specs/gcode.lang b/share/gtksourceview-4/language-specs/gcode.lang similarity index 100% rename from share/gtksourceview-2.0/language-specs/gcode.lang rename to share/gtksourceview-4/language-specs/gcode.lang diff --git a/src/Makefile b/src/Makefile index daeb4aa151e..5c359cb19dc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -688,7 +688,7 @@ install-dirs: $(DESTDIR)$(datadir)/gmoccapy/icons \ $(DESTDIR)$(datadir)/glade/catalogs \ $(DESTDIR)$(datadir)/glade/pixmaps/hicolor/22x22/actions \ - $(DESTDIR)$(datadir)/gtksourceview-2.0/language-specs \ + $(DESTDIR)$(datadir)/gtksourceview-4/language-specs \ $(DESTDIR)$(datadir)/linuxcnc/stepconf \ $(DESTDIR)$(datadir)/linuxcnc/pncconf \ $(DESTDIR)$(datadir)/linuxcnc/pncconf/pncconf-help \ @@ -764,7 +764,7 @@ install-kernel-indep: install-dirs $(FILE) ../lib/python/gladevcp/hal_python.xml $(DESTDIR)$(datadir)/glade/catalogs/ $(FILE) ../share/glade/pixmaps/hicolor/22x22/actions/widget*.png $(DESTDIR)$(datadir)/glade/pixmaps/hicolor/22x22/actions/ - $(FILE) ../share/gtksourceview-2.0/language-specs/*.lang $(DESTDIR)$(datadir)/gtksourceview-2.0/language-specs/ + $(FILE) ../share/gtksourceview-4/language-specs/*.lang $(DESTDIR)$(datadir)/gtksourceview-4/language-specs/ $(FILE) ../src/hal/drivers/mesa-hostmot2/modbus/*.tmpl $(DESTDIR)$(prefix)/share/linuxcnc/ diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 7782f54a61b..b3ed91fd6e1 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -426,7 +426,7 @@ def __init__(self, argv): # check the highlighting type # the following would load the python language # self.widgets.gcode_view.set_language("python") - LANGDIR = os.path.join(BASE, "share", "Gtksourceview-2.0", "language-specs") + LANGDIR = os.path.join(BASE, "share", "Gtksourceview-4", "language-specs") file_path = os.path.join(LANGDIR, "gcode.lang") if os.path.isfile(file_path): LOG.info("Gcode.lang found")