7#include <gtkmm/eventbox.h>
10#include <gtkmm/drawingarea.h>
11#if GTKMM_MAJOR_VERSION>3 || (GTKMM_MAJOR_VERSION==3 && GTKMM_MINOR_VERSION>=10)
12#include <gtkmm/revealer.h>
17#include "../common/TeXEngine.hh"
45 std::shared_ptr<TeXEngine::TeXRequest>
content;
72 bool draw_impl(
const Cairo::RefPtr<Cairo::Context>&
cr);
74 void draw(
const Cairo::RefPtr<Cairo::Context>&
cr,
int width,
int height);
76 virtual bool on_draw(
const Cairo::RefPtr<Cairo::Context>&
cr)
override;
82 void update_image(std::shared_ptr<TeXEngine::TeXRequest>);
159 virtual void on_show()
override;
Compatibility helpers that let the gtkmm frontend build against both gtkmm-3 and gtkmm-4 from a singl...
TeXEngine is used to convert LaTeX strings into PNG images.
Definition TeXEngine.hh:23
std::string fixed
Definition TeXView.hh:124
std::string unfixed
Definition TeXView.hh:124
int _laid_out_width
Definition TeXView.hh:131
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 siz...
Definition TeXView.cc:171
void get_preferred_width_for_height_vfunc(int height, int &minimum_width, int &natural_width) const override
Definition TeXView.cc:266
TeXView * owner
Definition TeXView.hh:118
void set_latex(const std::string &latex)
MicroTeX: set the LaTeX string and replace/substitute so that MicroTeX can render it (but do not actu...
Definition TeXView.cc:464
int padding_x
Definition TeXView.hh:120
void layout_latex() const
MicroTeX: just run the LaTeX layout algorithms, do not draw.
Definition TeXView.cc:360
std::string _laid_out_text
Definition TeXView.hh:130
virtual bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition TeXView.cc:421
float _laid_out_text_size
Definition TeXView.hh:132
std::string verbatimise(const std::string &) const
Definition TeXView.cc:453
microtex::Render * _render
Definition TeXView.hh:123
void measure_height_for_width(int width, int &minimum_height, int &natural_height) const
The MicroTeX size logic, shared between the two toolkits.
Definition TeXView.cc:131
float _text_size
Definition TeXView.hh:84
int need_height(int width) const
Definition TeXView.cc:201
int padding_y
Definition TeXView.hh:120
bool draw_impl(const Cairo::RefPtr< Cairo::Context > &cr)
The actual painting, shared between the two toolkits.
Definition TeXView.cc:432
int rendering_width
Definition TeXView.hh:119
Gtk::SizeRequestMode get_request_mode_vfunc() const override
Definition TeXView.cc:123
~TeXArea()
Definition TeXView.cc:634
void on_size_allocate(Gtk::Allocation &allocation) override
Definition TeXView.cc:283
void get_preferred_height_for_width_vfunc(int width, int &minimum_height, int &natural_height) const override
Definition TeXView.cc:260
TeXEngine & engine
Definition TeXView.hh:172
void dim(bool)
Dim the output to indicate that the result is no longer guaranteed to be correlated with the input ce...
Definition TeXView.cc:313
Gtk::Revealer rbox
Definition TeXView.hh:58
virtual ~TeXView()
Definition TeXView.cc:63
float text_size() const
Definition TeXView.cc:78
TeXArea image
Definition TeXView.hh:140
DTree::iterator datacell
Definition TeXView.hh:57
sigc::signal< bool(std::string)> tex_error
Definition TeXView.hh:150
bool is_error
Definition TeXView.hh:173
void update_image()
Update the TeX image.
Definition TeXView.cc:342
Gtk::Box hbox
Definition TeXView.hh:60
void on_button_pressed(int n_press, double x, double y)
Button handling goes through a gesture controller rather than the on_button_{press,...
Definition TeXView.cc:327
cdb::ContextMenu context_menu
Definition TeXView.hh:175
virtual void on_show() override
Definition TeXView.cc:114
void on_button_released(int n_press, double x, double y)
Definition TeXView.cc:319
sigc::signal< bool(DTree::iterator)> show_hide_requested
Definition TeXView.hh:47
std::shared_ptr< TeXEngine::TeXRequest > content
Definition TeXView.hh:45
sigc::signal< void()> select_requested
Emitted on a button press which is not the context-menu button, so that the owner can select this cel...
Definition TeXView.hh:53
int window_width
Definition TeXView.hh:62
sigc::signal< bool()> signal_on_copy_as_latex
Definition TeXView.hh:151
void convert()
Definition TeXView.cc:299
Glib::RefPtr< cdb::ClickGesture > click_gesture
Definition TeXView.hh:177
Gtk::Box vbox
Definition TeXView.hh:59
void on_copy_as_latex() const
Definition TeXView.cc:68
void set_is_error(bool)
Definition TeXView.cc:73
Gtk::EventBox TeXViewBase
TeXView is a widget which knows how to turn a string into a LaTeX-rendered image and display that.
Definition TeXView.hh:37
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1180