Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cadabra::TeXView::TeXArea Class Reference

#include <TeXView.hh>

Inheritance diagram for cadabra::TeXView::TeXArea:

Public Member Functions

 TeXArea (TeXView *owner_)
 
 ~TeXArea ()
 
bool draw_impl (const Cairo::RefPtr< Cairo::Context > &cr)
 The actual painting, shared between the two toolkits.
 
virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &cr) override
 
void update_image (std::shared_ptr< TeXEngine::TeXRequest >)
 Propagate a change in the TeXRequest (i.e.
 
void set_latex (const std::string &latex)
 MicroTeX: set the LaTeX string and replace/substitute so that MicroTeX can render it (but do not actually render).
 
void layout_latex () const
 MicroTeX: just run the LaTeX layout algorithms, do not draw.
 
int need_height (int width) const
 

Public Attributes

float _text_size
 

Protected Member Functions

Gtk::SizeRequestMode get_request_mode_vfunc () const override
 
void measure_height_for_width (int width, int &minimum_height, int &natural_height) const
 The MicroTeX size logic, shared between the two toolkits.
 
void relayout_for_allocation (int width, int height)
 The re-layout that follows a new allocation, shared between gtkmm-3's on_size_allocate and GTK4's size_allocate_vfunc.
 
void get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const override
 
void get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const override
 
void on_size_allocate (Gtk::Allocation &allocation) override
 

Private Member Functions

std::string verbatimise (const std::string &) const
 

Private Attributes

TeXView * owner
 
int rendering_width
 
int padding_x
 
int padding_y
 
microtex::Render * _render
 
std::string unfixed
 
std::string fixed
 
std::string _laid_out_text
 
int _laid_out_width = -1
 
float _laid_out_text_size = -1.f
 

Constructor & Destructor Documentation

◆ TeXArea()

TeXView::TeXArea::TeXArea ( TeXView *  owner_)

◆ ~TeXArea()

TeXView::TeXArea::~TeXArea ( )

Member Function Documentation

◆ draw_impl()

bool TeXView::TeXArea::draw_impl ( const Cairo::RefPtr< Cairo::Context > &  cr)

The actual painting, shared between the two toolkits.

gtkmm-3 reaches it through the on_draw vfunc, GTK4 through the callback registered with set_draw_func().

◆ get_preferred_height_for_width_vfunc()

void TeXView::TeXArea::get_preferred_height_for_width_vfunc ( int  width,
int &  minimum_height,
int &  natural_height 
) const
overrideprotected

◆ get_preferred_width_for_height_vfunc()

void TeXView::TeXArea::get_preferred_width_for_height_vfunc ( int  height,
int &  minimum_width,
int &  natural_width 
) const
overrideprotected

◆ get_request_mode_vfunc()

Gtk::SizeRequestMode TeXView::TeXArea::get_request_mode_vfunc ( ) const
overrideprotected

◆ layout_latex()

void TeXView::TeXArea::layout_latex ( ) const

MicroTeX: just run the LaTeX layout algorithms, do not draw.

◆ measure_height_for_width()

void TeXView::TeXArea::measure_height_for_width ( int  width,
int &  minimum_height,
int &  natural_height 
) const
protected

The MicroTeX size logic, shared between the two toolkits.

The MicroTeX height-for-width computation, shared between gtkmm-3's get_preferred_height_for_width_vfunc and GTK4's measure_vfunc.

◆ need_height()

int TeXView::TeXArea::need_height ( int  width) const

◆ on_draw()

bool TeXView::TeXArea::on_draw ( const Cairo::RefPtr< Cairo::Context > &  cr)
overridevirtual

◆ on_size_allocate()

void TeXView::TeXArea::on_size_allocate ( Gtk::Allocation &  allocation)
overrideprotected

◆ relayout_for_allocation()

void TeXView::TeXArea::relayout_for_allocation ( int  width,
int  height 
)
protected

The re-layout that follows a new allocation, shared between gtkmm-3's on_size_allocate and GTK4's size_allocate_vfunc.

◆ set_latex()

void TeXView::TeXArea::set_latex ( const std::string &  latex)

MicroTeX: set the LaTeX string and replace/substitute so that MicroTeX can render it (but do not actually render).

◆ update_image()

void TeXView::TeXArea::update_image ( std::shared_ptr< TeXEngine::TeXRequest >  content)

Propagate a change in the TeXRequest (i.e.

a new LaTeX string) through to the visible widget.

◆ verbatimise()

std::string TeXView::TeXArea::verbatimise ( const std::string &  inp) const
private

Member Data Documentation

◆ _laid_out_text

std::string cadabra::TeXView::TeXArea::_laid_out_text
mutableprivate

◆ _laid_out_text_size

float cadabra::TeXView::TeXArea::_laid_out_text_size = -1.f
mutableprivate

◆ _laid_out_width

int cadabra::TeXView::TeXArea::_laid_out_width = -1
mutableprivate

◆ _render

microtex::Render* cadabra::TeXView::TeXArea::_render
mutableprivate

◆ _text_size

float cadabra::TeXView::TeXArea::_text_size

◆ fixed

std::string cadabra::TeXView::TeXArea::fixed
private

◆ owner

TeXView* cadabra::TeXView::TeXArea::owner
private

◆ padding_x

int cadabra::TeXView::TeXArea::padding_x
private

◆ padding_y

int cadabra::TeXView::TeXArea::padding_y
private

◆ rendering_width

int cadabra::TeXView::TeXArea::rendering_width
mutableprivate

◆ unfixed

std::string cadabra::TeXView::TeXArea::unfixed
private

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