1 |
/* |
2 |
Copyright (c) 2014 Christian Schoenebeck |
3 |
|
4 |
This file is part of "gigedit" and released under the terms of the |
5 |
GNU General Public License version 2. |
6 |
*/ |
7 |
|
8 |
#ifndef GIGEDIT_SCRIPTEDITOR_H |
9 |
#define GIGEDIT_SCRIPTEDITOR_H |
10 |
|
11 |
#include <gig.h> |
12 |
#include <gtkmm.h> |
13 |
|
14 |
#include "compat.h" |
15 |
|
16 |
class ScriptEditor : public Gtk::Window { |
17 |
public: |
18 |
ScriptEditor(); |
19 |
~ScriptEditor(); |
20 |
void setScript(gig::Script* script); |
21 |
protected: |
22 |
Gtk::VBox m_vbox; |
23 |
Gtk::HButtonBox m_buttonBox; |
24 |
Gtk::ScrolledWindow m_scrolledWindow; |
25 |
Glib::RefPtr<Gtk::TextBuffer> m_textBuffer; |
26 |
Glib::RefPtr<Gtk::TextBuffer::TagTable> m_tagTable; |
27 |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_keywordTag; |
28 |
Glib::RefPtr<Gtk::TextBuffer::Tag> m_eventTag; |
29 |
Gtk::TextView m_textView; |
30 |
Gtk::Button m_applyButton; |
31 |
Gtk::Button m_cancelButton; |
32 |
|
33 |
gig::Script* m_script; |
34 |
|
35 |
void onButtonCancel(); |
36 |
void onButtonApply(); |
37 |
void onWindowHide(); |
38 |
void onTextInserted(const Gtk::TextBuffer::iterator& it, const Glib::ustring& txt, int length); |
39 |
void onTextErased(const Gtk::TextBuffer::iterator& itStart, const Gtk::TextBuffer::iterator& itEnd); |
40 |
void onModifiedChanged(); |
41 |
}; |
42 |
|
43 |
#endif // GIGEDIT_SCRIPTEDITOR_H |