1 |
/* |
/* |
2 |
Copyright (c) 2014-2017 Christian Schoenebeck |
Copyright (c) 2014-2020 Christian Schoenebeck |
3 |
|
|
4 |
This file is part of "gigedit" and released under the terms of the |
This file is part of "gigedit" and released under the terms of the |
5 |
GNU General Public License version 2. |
GNU General Public License version 2. |
139 |
m_stringTag->property_foreground() = "#c40c0c"; // red |
m_stringTag->property_foreground() = "#c40c0c"; // red |
140 |
m_tagTable->add(m_stringTag); |
m_tagTable->add(m_stringTag); |
141 |
|
|
142 |
|
m_patchTag = Gtk::TextBuffer::Tag::create(); |
143 |
|
m_patchTag->property_foreground() = "#FF4FF3"; // pink |
144 |
|
m_patchTag->property_weight() = PANGO_WEIGHT_BOLD; |
145 |
|
m_tagTable->add(m_patchTag); |
146 |
|
|
147 |
m_commentTag = Gtk::TextBuffer::Tag::create(); |
m_commentTag = Gtk::TextBuffer::Tag::create(); |
148 |
m_commentTag->property_foreground() = "#9c9c9c"; // gray |
m_commentTag->property_foreground() = "#9c9c9c"; // gray |
149 |
m_tagTable->add(m_commentTag); |
m_tagTable->add(m_commentTag); |
171 |
m_lineNrTag->property_foreground() = "#CCCCCC"; |
m_lineNrTag->property_foreground() = "#CCCCCC"; |
172 |
m_tagTable->add(m_lineNrTag); |
m_tagTable->add(m_lineNrTag); |
173 |
|
|
174 |
|
m_metricTag = Gtk::TextBuffer::Tag::create(); |
175 |
|
m_metricTag->property_foreground() = "#000000"; // black |
176 |
|
m_tagTable->add(m_metricTag); |
177 |
|
|
178 |
|
m_stdUnitTag = Gtk::TextBuffer::Tag::create(); |
179 |
|
m_stdUnitTag->property_foreground() = "#50BC00"; // greenish |
180 |
|
m_tagTable->add(m_stdUnitTag); |
181 |
|
|
182 |
// create menu |
// create menu |
183 |
#if USE_GTKMM_BUILDER |
#if USE_GTKMM_BUILDER |
184 |
m_actionGroup = Gio::SimpleActionGroup::create(); |
m_actionGroup = Gio::SimpleActionGroup::create(); |
278 |
#endif |
#endif |
279 |
color.set("#F5F5F5"); |
color.set("#F5F5F5"); |
280 |
GtkWidget* widget = (GtkWidget*) m_lineNrView.gobj(); |
GtkWidget* widget = (GtkWidget*) m_lineNrView.gobj(); |
281 |
#if GTK_MAJOR_VERSION < 3 || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION <= 22) |
#if GTK_MAJOR_VERSION < 3 || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION <= 24) |
282 |
gtk_widget_modify_base(widget, GTK_STATE_NORMAL, color.gobj()); |
gtk_widget_modify_base(widget, GTK_STATE_NORMAL, color.gobj()); |
283 |
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, color.gobj()); |
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, color.gobj()); |
284 |
#endif |
#endif |
291 |
#endif |
#endif |
292 |
color.set("#EEEEEE"); |
color.set("#EEEEEE"); |
293 |
GtkWidget* widget = (GtkWidget*) m_lineNrTextViewSpacer.gobj(); |
GtkWidget* widget = (GtkWidget*) m_lineNrTextViewSpacer.gobj(); |
294 |
#if GTK_MAJOR_VERSION < 3 || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION <= 22) |
#if GTK_MAJOR_VERSION < 3 || (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION <= 24) |
295 |
gtk_widget_modify_base(widget, GTK_STATE_NORMAL, color.gobj()); |
gtk_widget_modify_base(widget, GTK_STATE_NORMAL, color.gobj()); |
296 |
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, color.gobj()); |
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, color.gobj()); |
297 |
#endif |
#endif |
382 |
#if HAS_GTKMM_SHOW_ALL_CHILDREN |
#if HAS_GTKMM_SHOW_ALL_CHILDREN |
383 |
show_all_children(); |
show_all_children(); |
384 |
#endif |
#endif |
385 |
|
|
386 |
|
#if !USE_LS_SCRIPTVM |
387 |
|
// make user aware about gigedit had been compiled without liblinuxsampler support |
388 |
|
m_statusLabel.set_markup(_("Limited editor features (since Gigedit was compiled without liblinuxsampler support)!")); |
389 |
|
m_statusImage.set(m_warningIcon); |
390 |
|
#endif |
391 |
} |
} |
392 |
|
|
393 |
ScriptEditor::~ScriptEditor() { |
ScriptEditor::~ScriptEditor() { |
610 |
const LinuxSampler::VMSourceToken& token = tokens[i]; |
const LinuxSampler::VMSourceToken& token = tokens[i]; |
611 |
|
|
612 |
if (token.isKeyword()) { |
if (token.isKeyword()) { |
613 |
applyCodeTag(m_textBuffer, token, m_keywordTag); |
if (token.text() == "patch") |
614 |
|
applyCodeTag(m_textBuffer, token, m_patchTag); |
615 |
|
else |
616 |
|
applyCodeTag(m_textBuffer, token, m_keywordTag); |
617 |
} else if (token.isVariableName()) { |
} else if (token.isVariableName()) { |
618 |
applyCodeTag(m_textBuffer, token, m_variableTag); |
applyCodeTag(m_textBuffer, token, m_variableTag); |
619 |
} else if (token.isIdentifier()) { |
} else if (token.isIdentifier()) { |
630 |
applyCodeTag(m_textBuffer, token, m_commentTag); |
applyCodeTag(m_textBuffer, token, m_commentTag); |
631 |
} else if (token.isPreprocessor()) { |
} else if (token.isPreprocessor()) { |
632 |
applyCodeTag(m_textBuffer, token, m_preprocTag); |
applyCodeTag(m_textBuffer, token, m_preprocTag); |
633 |
|
} else if (token.isMetricPrefix()) { |
634 |
|
applyCodeTag(m_textBuffer, token, m_metricTag); |
635 |
|
} else if (token.isStdUnit()) { |
636 |
|
applyCodeTag(m_textBuffer, token, m_stdUnitTag); |
637 |
} else if (token.isNewLine()) { |
} else if (token.isNewLine()) { |
638 |
} |
} |
639 |
} |
} |
785 |
//TODO: event throttling would be a good idea here |
//TODO: event throttling would be a good idea here |
786 |
updateIssueTooltip(e); |
updateIssueTooltip(e); |
787 |
#endif |
#endif |
788 |
#if GTKMM_MAJOR_VERSION < 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION <= 22) |
#if GTKMM_MAJOR_VERSION < 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION <= 24) |
789 |
return ManagedWindow::on_motion_notify_event(e); |
return ManagedWindow::on_motion_notify_event(e); |
790 |
#else |
#else |
791 |
Gdk::EventMotion em = Glib::wrap(e, true); |
Gdk::EventMotion em = Glib::wrap(e, true); |