Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
cadabra::CodeInput::exp_input_tv Class Reference

Description

The actual text widget used by CodeInput.

#include <CodeInput.hh>

Inheritance diagram for cadabra::CodeInput::exp_input_tv:

Public Member Functions

 exp_input_tv (DTree::iterator, Glib::RefPtr< Gtk::TextBuffer >, double scale, double display_scale, Glib::RefPtr< Gtk::Adjustment >)
virtual void on_show () override
bool handle_key_press (guint keyval, Gdk::ModifierType state)
 Key handling, shared between the toolkits.
void on_focus_entered ()
 Side effects of focus and pointer motion, likewise shared.
void on_focus_left ()
void on_pointer_motion ()
virtual bool on_key_press_event (GdkEventKey *) override
virtual bool on_focus_in_event (GdkEventFocus *) override
virtual bool on_focus_out_event (GdkEventFocus *) override
virtual bool on_motion_notify_event (GdkEventMotion *event) override
virtual Gtk::SizeRequestMode get_request_mode_vfunc () const override
void draw_gutter (const Cairo::RefPtr< Cairo::Context > &cr, int height)
 Paint the coloured bar down the left-hand side of the cell, on top of the TextView's own rendering.
bool measure_width_for_height (int &minimum_width, int &natural_width) const
 Width logic for LaTeX cells, shared between the toolkits; returns false when the base class should decide instead.
virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &) override
virtual void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override
virtual void on_size_allocate (Gtk::Allocation &allocation) override
void shift_enter_pressed ()
void on_textbuf_change ()

Public Attributes

sigc::signal< bool(DTree::iterator)> content_execute
sigc::signal< bool(DTree::iterator)> content_changed
sigc::signal< bool(std::string, int, DTree::iterator)> content_insert
sigc::signal< bool(int, int, DTree::iterator)> content_erase
sigc::signal< bool(DTree::iterator)> cell_got_focus
sigc::signal< bool(DTree::iterator, int)> complete_request
friend CodeInput
int window_width = 100

Private Attributes

double scale_
double display_scale_
DTree::iterator datacell
Glib::RefPtr< Gtk::Adjustment > vadjustment
double previous_value = -99.0

Constructor & Destructor Documentation

◆ exp_input_tv()

CodeInput::exp_input_tv::exp_input_tv ( DTree::iterator it,
Glib::RefPtr< Gtk::TextBuffer > tb,
double scale,
double display_scale,
Glib::RefPtr< Gtk::Adjustment > vadjustment_ )

Member Function Documentation

◆ draw_gutter()

void CodeInput::exp_input_tv::draw_gutter ( const Cairo::RefPtr< Cairo::Context > & cr,
int h )

Paint the coloured bar down the left-hand side of the cell, on top of the TextView's own rendering.

Paint the coloured bar down the left-hand side of an input cell, which indicates the cell type and whether it is running.

Drawn on top of the TextView's own rendering by both toolkits.

◆ get_preferred_width_for_height_vfunc()

void CodeInput::exp_input_tv::get_preferred_width_for_height_vfunc ( int height,
int & minimum_width,
int & natural_width ) const
overridevirtual

◆ get_request_mode_vfunc()

Gtk::SizeRequestMode CodeInput::exp_input_tv::get_request_mode_vfunc ( ) const
overridevirtual

◆ handle_key_press()

bool CodeInput::exp_input_tv::handle_key_press ( guint keyval,
Gdk::ModifierType state )

Key handling, shared between the toolkits.

Handle a key press.

Returns true when the key was consumed; false lets the TextView's own default handling run. gtkmm-3 reaches it through the on_key_press_event vfunc, GTK4 through an Gtk::EventControllerKey, which has the same contract.

Returns true when the key was consumed; false means the TextView's own default handling should run. Shared between gtkmm-3's on_key_press_event vfunc and GTK4's Gtk::EventControllerKey, which has the same true/false contract.

◆ measure_width_for_height()

bool CodeInput::exp_input_tv::measure_width_for_height ( int & minimum_width,
int & natural_width ) const

Width logic for LaTeX cells, shared between the toolkits; returns false when the base class should decide instead.

LaTeX cells are forced to the window width.

Shared between gtkmm-3's get_preferred_width_for_height_vfunc and GTK4's measure_vfunc; returns false when the caller should defer to the base class.

◆ on_draw()

bool CodeInput::exp_input_tv::on_draw ( const Cairo::RefPtr< Cairo::Context > & cr)
overridevirtual

◆ on_focus_entered()

void CodeInput::exp_input_tv::on_focus_entered ( )

Side effects of focus and pointer motion, likewise shared.

The side effects of gaining focus, losing focus and pointer motion.

Shared between gtkmm-3's vfuncs and GTK4's Gtk::EventControllerFocus / Gtk::EventControllerMotion, neither of which gtkmm-3 wraps.

◆ on_focus_in_event()

bool CodeInput::exp_input_tv::on_focus_in_event ( GdkEventFocus * event)
overridevirtual

◆ on_focus_left()

void CodeInput::exp_input_tv::on_focus_left ( )

◆ on_focus_out_event()

bool CodeInput::exp_input_tv::on_focus_out_event ( GdkEventFocus * event)
overridevirtual

◆ on_key_press_event()

bool CodeInput::exp_input_tv::on_key_press_event ( GdkEventKey * event)
overridevirtual

◆ on_motion_notify_event()

bool CodeInput::exp_input_tv::on_motion_notify_event ( GdkEventMotion * event)
overridevirtual

◆ on_pointer_motion()

void CodeInput::exp_input_tv::on_pointer_motion ( )

◆ on_show()

void CodeInput::exp_input_tv::on_show ( )
overridevirtual

◆ on_size_allocate()

void CodeInput::exp_input_tv::on_size_allocate ( Gtk::Allocation & allocation)
overridevirtual

◆ on_textbuf_change()

void CodeInput::exp_input_tv::on_textbuf_change ( )

◆ shift_enter_pressed()

void CodeInput::exp_input_tv::shift_enter_pressed ( )

Member Data Documentation

◆ cell_got_focus

sigc::signal<bool(DTree::iterator)> cadabra::CodeInput::exp_input_tv::cell_got_focus

◆ CodeInput

friend cadabra::CodeInput::exp_input_tv::CodeInput

◆ complete_request

sigc::signal<bool(DTree::iterator, int)> cadabra::CodeInput::exp_input_tv::complete_request

◆ content_changed

sigc::signal<bool(DTree::iterator)> cadabra::CodeInput::exp_input_tv::content_changed

◆ content_erase

sigc::signal<bool(int, int, DTree::iterator)> cadabra::CodeInput::exp_input_tv::content_erase

◆ content_execute

sigc::signal<bool(DTree::iterator)> cadabra::CodeInput::exp_input_tv::content_execute

◆ content_insert

sigc::signal<bool(std::string, int, DTree::iterator)> cadabra::CodeInput::exp_input_tv::content_insert

◆ datacell

DTree::iterator cadabra::CodeInput::exp_input_tv::datacell
private

◆ display_scale_

double cadabra::CodeInput::exp_input_tv::display_scale_
private

◆ previous_value

double cadabra::CodeInput::exp_input_tv::previous_value = -99.0
private

◆ scale_

double cadabra::CodeInput::exp_input_tv::scale_
private

◆ vadjustment

Glib::RefPtr<Gtk::Adjustment> cadabra::CodeInput::exp_input_tv::vadjustment
private

◆ window_width

int cadabra::CodeInput::exp_input_tv::window_width = 100

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