/[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 2956 by schoenebeck, Sat Jul 16 15:31:47 2016 UTC revision 3566 by schoenebeck, Sat Aug 24 13:42:17 2019 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (c) 2014-2016 Christian Schoenebeck      Copyright (c) 2014-2019 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.
# Line 8  Line 8 
8  #ifndef GIGEDIT_SCRIPTEDITOR_H  #ifndef GIGEDIT_SCRIPTEDITOR_H
9  #define GIGEDIT_SCRIPTEDITOR_H  #define GIGEDIT_SCRIPTEDITOR_H
10    
11  #include <gig.h>  #ifdef LIBGIG_HEADER_FILE
12  #include <gtkmm.h>  # include LIBGIG_HEADER_FILE(gig.h)
13  #include <config.h>  #else
14    # include <gig.h>
15    #endif
16    
17    #ifdef GTKMM_HEADER_FILE
18    # include GTKMM_HEADER_FILE(gtkmm.h)
19    #else
20    # include <gtkmm.h>
21    #endif
22    #if HAVE_CONFIG_H
23    # include <config.h>
24    #endif
25  #include "compat.h"  #include "compat.h"
26  #include <gtkmm/uimanager.h>  
27  #include <gtkmm/actiongroup.h>  #if USE_GTKMM_BUILDER
28    # include <gtkmm/builder.h>
29    #else
30    # include <gtkmm/uimanager.h> // deprecated in gtkmm >= 3.21.4
31    #endif
32    
33    #if USE_GLIB_ACTION
34    # include <giomm/simpleactiongroup.h>
35    #else
36    # include <gtkmm/actiongroup.h>
37    #endif
38    
39  #include "ManagedWindow.h"  #include "ManagedWindow.h"
40    
41  // 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
# Line 24  Line 46 
46  #endif  #endif
47    
48  #if USE_LS_SCRIPTVM  #if USE_LS_SCRIPTVM
49  # include <linuxsampler/scriptvm/ScriptVM.h>  # ifdef LIBLINUXSAMPLER_HEADER_FILE
50  # include <linuxsampler/scriptvm/ScriptVMFactory.h>  #  include LIBLINUXSAMPLER_HEADER_FILE(scriptvm/ScriptVM.h)
51    #  include LIBLINUXSAMPLER_HEADER_FILE(scriptvm/ScriptVMFactory.h)
52    # else
53    #  include <linuxsampler/scriptvm/ScriptVM.h>
54    #  include <linuxsampler/scriptvm/ScriptVMFactory.h>
55    # endif
56  #endif  #endif
57    
58  class ScriptEditor : public ManagedWindow {  class ScriptEditor : public ManagedWindow {
# Line 44  public: Line 71  public:
71      virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->scriptEditorWindowH; }      virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->scriptEditorWindowH; }
72    
73  protected:  protected:
74      Gtk::VBox m_vbox;      VBox m_vbox;
75      Gtk::HBox m_footerHBox;      HBox m_footerHBox;
76      Gtk::HBox m_statusHBox;      HBox m_statusHBox;
77      Gtk::HButtonBox m_buttonBox;      HButtonBox m_buttonBox;
78      Gtk::ScrolledWindow m_scrolledWindow;      Gtk::ScrolledWindow m_scrolledWindow;
79        HBox m_textViewHBox;
80        Glib::RefPtr<Gtk::TextBuffer> m_lineNrBuffer;
81      Glib::RefPtr<Gtk::TextBuffer> m_textBuffer;      Glib::RefPtr<Gtk::TextBuffer> m_textBuffer;
82      Glib::RefPtr<Gtk::TextBuffer::TagTable> m_tagTable;      Glib::RefPtr<Gtk::TextBuffer::TagTable> m_tagTable;
83      Glib::RefPtr<Gtk::TextBuffer::Tag> m_keywordTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_keywordTag;
# Line 61  protected: Line 90  protected:
90      Glib::RefPtr<Gtk::TextBuffer::Tag> m_preprocTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_preprocTag;
91      Glib::RefPtr<Gtk::TextBuffer::Tag> m_errorTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_errorTag;
92      Glib::RefPtr<Gtk::TextBuffer::Tag> m_warningTag;      Glib::RefPtr<Gtk::TextBuffer::Tag> m_warningTag;
93        Glib::RefPtr<Gtk::TextBuffer::Tag> m_preprocCommentTag;
94        Glib::RefPtr<Gtk::TextBuffer::Tag> m_lineNrTag;
95        Glib::RefPtr<Gtk::TextBuffer::Tag> m_metricTag;
96        Glib::RefPtr<Gtk::TextBuffer::Tag> m_stdUnitTag;
97        Gtk::TextView m_lineNrView;
98        Gtk::TextView m_lineNrTextViewSpacer;
99      Gtk::TextView m_textView;      Gtk::TextView m_textView;
100      Gtk::Image m_statusImage;      Gtk::Image m_statusImage;
101      Gtk::Label m_statusLabel;      Gtk::Label m_statusLabel;
102      Gtk::Button m_applyButton;      Gtk::Button m_applyButton;
103      Gtk::Button m_cancelButton;      Gtk::Button m_cancelButton;
104    
105    #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION >= 20)
106        Glib::RefPtr<Gtk::CssProvider> m_css;
107    #endif
108    
109      Glib::RefPtr<Gdk::Pixbuf> m_warningIcon;      Glib::RefPtr<Gdk::Pixbuf> m_warningIcon;
110      Glib::RefPtr<Gdk::Pixbuf> m_errorIcon;      Glib::RefPtr<Gdk::Pixbuf> m_errorIcon;
111      Glib::RefPtr<Gdk::Pixbuf> m_successIcon;      Glib::RefPtr<Gdk::Pixbuf> m_successIcon;
112    
113    #if USE_GLIB_ACTION
114        Glib::RefPtr<Gio::SimpleActionGroup> m_actionGroup;
115    #else
116      Glib::RefPtr<Gtk::ActionGroup> m_actionGroup;      Glib::RefPtr<Gtk::ActionGroup> m_actionGroup;
117    #endif
118    #if USE_GTKMM_BUILDER
119        Glib::RefPtr<Gtk::Builder> m_uiManager;
120    #else
121      Glib::RefPtr<Gtk::UIManager> m_uiManager;      Glib::RefPtr<Gtk::UIManager> m_uiManager;
122    #endif
123    
124      gig::Script* m_script;      gig::Script* m_script;
125  #if USE_LS_SCRIPTVM  #if USE_LS_SCRIPTVM
# Line 80  protected: Line 127  protected:
127      std::vector<LinuxSampler::ParserIssue> m_issues;      std::vector<LinuxSampler::ParserIssue> m_issues;
128      std::vector<LinuxSampler::ParserIssue> m_errors;      std::vector<LinuxSampler::ParserIssue> m_errors;
129      std::vector<LinuxSampler::ParserIssue> m_warnings;      std::vector<LinuxSampler::ParserIssue> m_warnings;
130        std::vector<LinuxSampler::CodeBlock> m_preprocComments;
131  #endif  #endif
132    
133      bool isModified() const;      bool isModified() const;
# Line 97  protected: Line 145  protected:
145      void updateStatusBar();      void updateStatusBar();
146  #endif  #endif
147      bool on_motion_notify_event(GdkEventMotion* e);      bool on_motion_notify_event(GdkEventMotion* e);
148      bool onWindowDelete(GdkEventAny* e);  #if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 91 || (GTKMM_MINOR_VERSION == 91 && GTKMM_MICRO_VERSION >= 2))) // GTKMM >= 3.91.2
149        bool onWindowDelete(Gdk::Event& e);
150    #endif
151        bool onWindowDeleteP(GdkEventAny* e);
152      void onMenuChangeFontSize();      void onMenuChangeFontSize();
153      int  currentFontSize() const;      int  currentFontSize() const;
154      void setFontSize(int size, bool save);      void setFontSize(int size, bool save);
155        void updateLineNumbers();
156  };  };
157    
158  #endif // GIGEDIT_SCRIPTEDITOR_H  #endif // GIGEDIT_SCRIPTEDITOR_H

Legend:
Removed from v.2956  
changed lines
  Added in v.3566

  ViewVC Help
Powered by ViewVC