11 #include <atkmm/relationset.h> 13 #include "../views/TerminalView.h" 22 :
Model(parent), view(view) {
57 if (e->keyval == GDK_KEY_Tab || e->keyval == GDK_KEY_Right) {
61 else if (e->keyval == GDK_KEY_Escape || e->keyval == GDK_KEY_Up) {
86 auto buff =
view->get_buffer();
87 buff->insert(buff->end(), text);
88 view->set_buffer(buff);
91 buff =
view->get_buffer();
92 view->scroll_to(buff->create_mark(buff->end(),
false));
Gtk::Entry *const getInputBox()
Returns a constant pointer to the input box.
TerminalView *const getView() const
Gets a pointer to the view object.
void onClearClick()
Handles the clear button being clicked.
JimulatorState getJimulatorState() const
Return the jimulatorState member object.
Gtk::Button *const getClearButton()
Returns a constant pointer to the clear button.
void setModel(TerminalModel *const val)
Sets the model member.
const std::string readJimulator() const
Reads for any data from Jimulator.
JimulatorState
Describe the 5 states of Jimulator.
Gtk::TextView *const getTextView()
Returns a constant pointer to the output box.
void setButtonListener(Gtk::Button *const button, const T1 b, const T2 c)
Connect any button to any member function of.
void appendTextToTextView(std::string text)
Appends a string to the current text view of the terminal, and scroll to the bottom of the terminal...
A file containing the definition of the KoMo2Model class.
virtual void changeJimulatorState(const JimulatorState newState) override
Handles the internal state of Jimulator being changed.
The superclass for all other Model classes. Uses a pure virtual function, so is abastract. Keeps KoMo2Model as a friend so it alone can call setJimulatorState. This class provides basic data that are needed by all other.
const bool sendTerminalInputToJimulator(const unsigned int val)
Sends terminal information to Jimulator.
virtual const bool handleKeyPress(const GdkEventKey *const e) override
Handles any key press events.
TerminalView *const view
The view this model represents.
const bool isFocused()
Returns whether or not the input box has focus or not.
The logical model of the entire application. All other models should be member variables of this mode...
The GUI element which encapsulates the "clear" button, the output text box, and the input text box at...
TerminalModel(TerminalView *const view, KoMo2Model *const parent)
Construct a new TerminalModel::TerminalModel object.
const std::string getJimulatorTerminalMessages()
Reads for messages from Jimulator, to display in the terminal output.