Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
cadabra::Console::TextViewProxy Class Reference
Inheritance diagram for cadabra::Console::TextViewProxy:

Public Member Functions

 TextViewProxy (Console &parent)
 
bool handle_key_press (guint keyval, Gdk::ModifierType state)
 The keys the console interprets itself (Return, Up, Down).
 
void sync_to_view ()
 Mirror this (model) buffer and its selection into the parent's visible buffer.
 
bool on_key_press_event (GdkEventKey *key_event) override
 

Public Attributes

size_t history_max_length
 

Private Member Functions

void set_text_quietly (const Glib::ustring &text)
 Replace the buffer contents without it counting as user editing.
 
void remember_partial_input ()
 Remember the partially typed line, so that walking down off the end of the history can restore it.
 

Private Attributes

Console & parent
 
std::string temp_in
 
std::list< std::string > history
 
std::list< std::string >::iterator history_ptr
 
bool updating_buffer = false
 Set while we rewrite the buffer ourselves, so that the GTK4 buffer-changed handler does not mistake it for user editing.
 

Constructor & Destructor Documentation

◆ TextViewProxy()

Console::TextViewProxy::TextViewProxy ( Console &  parent)

Member Function Documentation

◆ handle_key_press()

bool Console::TextViewProxy::handle_key_press ( guint  keyval,
Gdk::ModifierType  state 
)

The keys the console interprets itself (Return, Up, Down).

Handle the keys the console interprets itself: Return submits, Up/Down walk the history.

Returns true when consumed; false lets the TextView edit its own buffer. gtkmm-3 reaches this through the on_key_press_event vfunc, GTK4 through an Gtk::EventControllerKey on this widget.

Returns true when the key was consumed; false means the TextView's own editing should run. Shared between gtkmm-3's on_key_press_event vfunc and GTK4's Gtk::EventControllerKey.

◆ on_key_press_event()

bool Console::TextViewProxy::on_key_press_event ( GdkEventKey *  key_event)
override

◆ remember_partial_input()

void Console::TextViewProxy::remember_partial_input ( )
private

Remember the partially typed line, so that walking down off the end of the history can restore it.

◆ set_text_quietly()

void Console::TextViewProxy::set_text_quietly ( const Glib::ustring &  text)
private

Replace the buffer contents without it counting as user editing.

◆ sync_to_view()

void Console::TextViewProxy::sync_to_view ( )

Mirror this (model) buffer and its selection into the parent's visible buffer.

Mirror this (model) buffer, and its selection, into the parent's visible buffer.

Member Data Documentation

◆ history

std::list<std::string> cadabra::Console::TextViewProxy::history
private

◆ history_max_length

size_t cadabra::Console::TextViewProxy::history_max_length

◆ history_ptr

std::list<std::string>::iterator cadabra::Console::TextViewProxy::history_ptr
private

◆ parent

Console& cadabra::Console::TextViewProxy::parent
private

◆ temp_in

std::string cadabra::Console::TextViewProxy::temp_in
private

◆ updating_buffer

bool cadabra::Console::TextViewProxy::updating_buffer = false
private

Set while we rewrite the buffer ourselves, so that the GTK4 buffer-changed handler does not mistake it for user editing.


The documentation for this class was generated from the following files: