Cadabra
Computer algebra system for field theory problems
Public Member Functions | Public Attributes | Protected 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 (bool use_microtex)
 
 ~TeXArea ()
 
virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &cr) override
 
void update_image (std::shared_ptr< TeXEngine::TeXRequest >, double scale)
 Update the visible image from the pixbuf. More...
 
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). More...
 
void layout_latex () const
 MicroTeX: just run the LaTeX layout algorithms, do not draw. More...
 

Public Attributes

Glib::RefPtr< Gdk::Pixbuf > pixbuf
 The actual image is stored in the image referenced by pixbuf. More...
 
double scale_
 
float _text_size
 
bool use_microtex
 

Protected Member Functions

Gtk::SizeRequestMode get_request_mode_vfunc () const override
 
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 Attributes

int rendering_width
 
int padding_x
 
int padding_y
 
microtex::Render * _render
 
std::string unfixed
 
std::string fixed
 

Constructor & Destructor Documentation

◆ TeXArea()

TeXView::TeXArea::TeXArea ( bool  use_microtex)

◆ ~TeXArea()

TeXView::TeXArea::~TeXArea ( )

Member Function Documentation

◆ 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.

◆ 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

◆ 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,
double  scale 
)

Update the visible image from the pixbuf.

Call this in order to propagate changes to the pixbuf (e.g. from re-running the TeXRequest) to the visible widget itself.

Member Data Documentation

◆ _render

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

◆ _text_size

float cadabra::TeXView::TeXArea::_text_size

◆ fixed

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

◆ padding_x

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

◆ padding_y

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

◆ pixbuf

Glib::RefPtr<Gdk::Pixbuf> cadabra::TeXView::TeXArea::pixbuf

The actual image is stored in the image referenced by pixbuf.

FIXME: This pointer is not yet shared among instances which show the same content.

◆ rendering_width

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

◆ scale_

double cadabra::TeXView::TeXArea::scale_

◆ unfixed

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

◆ use_microtex

bool cadabra::TeXView::TeXArea::use_microtex

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