/[svn]/gigedit/trunk/src/gigedit/scripteditor.h
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/scripteditor.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2890 by schoenebeck, Mon Apr 25 17:35:21 2016 UTC revision 2899 by schoenebeck, Mon May 2 14:36:40 2016 UTC
# Line 11  Line 11 
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 featured NKSP syntax highlighting backend from
19  // liblinuxsampler for syntax highlighting of this text editor?  // liblinuxsampler for syntax highlighting of this text editor?
20  #if HAVE_LINUXSAMPLER  #if HAVE_LINUXSAMPLER
21  # define USE_LS_SCRIPTVM 1  # define USE_LS_SCRIPTVM 1
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::HBox m_footerHBox;
44        Gtk::HBox m_statusHBox;
45      Gtk::HButtonBox m_buttonBox;      Gtk::HButtonBox m_buttonBox;
46      Gtk::ScrolledWindow m_scrolledWindow;      Gtk::ScrolledWindow m_scrolledWindow;
47      Glib::RefPtr<Gtk::TextBuffer> m_textBuffer;      Glib::RefPtr<Gtk::TextBuffer> m_textBuffer;
# Line 49  protected: Line 57  protected:
57      Glib::RefPtr<Gtk::TextBuffer::Tag> m_errorTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_errorTag;
58      Glib::RefPtr<Gtk::TextBuffer::Tag> m_warningTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_warningTag;
59      Gtk::TextView m_textView;      Gtk::TextView m_textView;
60        Gtk::Image m_statusImage;
61        Gtk::Label m_statusLabel;
62      Gtk::Button m_applyButton;      Gtk::Button m_applyButton;
63      Gtk::Button m_cancelButton;      Gtk::Button m_cancelButton;
64    
65        Glib::RefPtr<Gdk::Pixbuf> m_warningIcon;
66        Glib::RefPtr<Gdk::Pixbuf> m_errorIcon;
67        Glib::RefPtr<Gdk::Pixbuf> m_successIcon;
68    
69      gig::Script* m_script;      gig::Script* m_script;
70  #if USE_LS_SCRIPTVM  #if USE_LS_SCRIPTVM
71      LinuxSampler::ScriptVM* m_vm;      LinuxSampler::ScriptVM* m_vm;
72        std::vector<LinuxSampler::ParserIssue> m_issues;
73        std::vector<LinuxSampler::ParserIssue> m_errors;
74        std::vector<LinuxSampler::ParserIssue> m_warnings;
75  #endif  #endif
76    
77        bool isModified() const;
78      void onButtonCancel();      void onButtonCancel();
79      void onButtonApply();      void onButtonApply();
80      void onWindowHide();      void onWindowHide();
# Line 67  protected: Line 85  protected:
85      void updateSyntaxHighlightingByVM();      void updateSyntaxHighlightingByVM();
86      void updateParserIssuesByVM();      void updateParserIssuesByVM();
87      LinuxSampler::ScriptVM* GetScriptVM();      LinuxSampler::ScriptVM* GetScriptVM();
88        void updateIssueTooltip(GdkEventMotion* e);
89        void updateStatusBar();
90  #endif  #endif
91        bool on_motion_notify_event(GdkEventMotion* e);
92        bool onWindowDelete(GdkEventAny* e);
93  };  };
94    
95  #endif // GIGEDIT_SCRIPTEDITOR_H  #endif // GIGEDIT_SCRIPTEDITOR_H

Legend:
Removed from v.2890  
changed lines
  Added in v.2899

  ViewVC Help
Powered by ViewVC