11 |
#include <gig.h> |
#include <gig.h> |
12 |
#include <gtkmm.h> |
#include <gtkmm.h> |
13 |
#include <config.h> |
#include <config.h> |
|
|
|
14 |
#include "compat.h" |
#include "compat.h" |
15 |
|
#include "ManagedWindow.h" |
16 |
|
|
17 |
// Should we use a very simple (and buggy) local NKSP syntax parser, or should |
// Should we use a very simple (and buggy) local NKSP syntax parser, or should |
18 |
// we rather use the full features NKSP syntax highlighting backend from |
// we rather use the full features NKSP syntax highlighting backend from |
22 |
#endif |
#endif |
23 |
|
|
24 |
#if USE_LS_SCRIPTVM |
#if USE_LS_SCRIPTVM |
25 |
namespace LinuxSampler { |
# include <linuxsampler/scriptvm/ScriptVM.h> |
26 |
class ScriptVM; |
# include <linuxsampler/scriptvm/ScriptVMFactory.h> |
|
} |
|
27 |
#endif |
#endif |
28 |
|
|
29 |
class ScriptEditor : public Gtk::Window { |
class ScriptEditor : public ManagedWindow { |
30 |
public: |
public: |
31 |
ScriptEditor(); |
ScriptEditor(); |
32 |
~ScriptEditor(); |
~ScriptEditor(); |
33 |
void setScript(gig::Script* script); |
void setScript(gig::Script* script); |
34 |
|
|
35 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
36 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->scriptEditorWindowX; } |
37 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->scriptEditorWindowY; } |
38 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->scriptEditorWindowW; } |
39 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->scriptEditorWindowH; } |
40 |
|
|
41 |
protected: |
protected: |
42 |
Gtk::VBox m_vbox; |
Gtk::VBox m_vbox; |
43 |
Gtk::HButtonBox m_buttonBox; |
Gtk::HButtonBox m_buttonBox; |
52 |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_stringTag; |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_stringTag; |
53 |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_commentTag; |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_commentTag; |
54 |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_preprocTag; |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_preprocTag; |
55 |
|
Glib::RefPtr<Gtk::TextBuffer::Tag> m_errorTag; |
56 |
|
Glib::RefPtr<Gtk::TextBuffer::Tag> m_warningTag; |
57 |
Gtk::TextView m_textView; |
Gtk::TextView m_textView; |
58 |
Gtk::Button m_applyButton; |
Gtk::Button m_applyButton; |
59 |
Gtk::Button m_cancelButton; |
Gtk::Button m_cancelButton; |
61 |
gig::Script* m_script; |
gig::Script* m_script; |
62 |
#if USE_LS_SCRIPTVM |
#if USE_LS_SCRIPTVM |
63 |
LinuxSampler::ScriptVM* m_vm; |
LinuxSampler::ScriptVM* m_vm; |
64 |
|
std::vector<LinuxSampler::ParserIssue> m_issues; |
65 |
#endif |
#endif |
66 |
|
|
67 |
void onButtonCancel(); |
void onButtonCancel(); |
72 |
void onModifiedChanged(); |
void onModifiedChanged(); |
73 |
#if USE_LS_SCRIPTVM |
#if USE_LS_SCRIPTVM |
74 |
void updateSyntaxHighlightingByVM(); |
void updateSyntaxHighlightingByVM(); |
75 |
|
void updateParserIssuesByVM(); |
76 |
|
LinuxSampler::ScriptVM* GetScriptVM(); |
77 |
|
void updateIssueTooltip(GdkEventMotion* e); |
78 |
#endif |
#endif |
79 |
|
bool on_motion_notify_event(GdkEventMotion* e); |
80 |
}; |
}; |
81 |
|
|
82 |
#endif // GIGEDIT_SCRIPTEDITOR_H |
#endif // GIGEDIT_SCRIPTEDITOR_H |