Cadabra
Computer algebra system for field theory problems
TeXView.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <gtkmm/eventbox.h>
5 #include <gtkmm/box.h>
6 #include <gtkmm/drawingarea.h>
7 #if GTKMM_MINOR_VERSION>=10
8 #include <gtkmm/revealer.h>
9 #endif
10 
11 #include "DataCell.hh"
12 #include "../common/TeXEngine.hh"
13 
14 namespace cadabra {
15 
19 
20  class TeXView : public Gtk::EventBox {
21  public:
22  TeXView(TeXEngine&, DTree::iterator, int hmargin=25);
23  virtual ~TeXView();
24 
25  std::shared_ptr<TeXEngine::TeXRequest> content;
26 
27  sigc::signal1<bool, DTree::iterator> show_hide_requested;
28 
29  DTree::iterator datacell;
30 #if GTKMM_MINOR_VERSION>=10
31  Gtk::Revealer rbox;
32 #endif
33  Gtk::VBox vbox;
34  Gtk::HBox hbox;
35 
36  class TeXArea : public Gtk::DrawingArea {
37  public:
38  virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
39 
43 
44  void update_image(std::shared_ptr<TeXEngine::TeXRequest>, double scale);
45 
49 
50  Glib::RefPtr<Gdk::Pixbuf> pixbuf;
51  double scale_;
52  };
53 
55 
57  void update_image();
58 
61 
62  void dim(bool);
63 
64  sigc::signal1<bool, std::string> tex_error;
65 
66  protected:
67  virtual bool on_button_release_event(GdkEventButton *) override;
68  virtual void on_show() override;
69  // virtual bool on_configure_event(GdkEventConfigure *) override;
70 
71  void convert();
72 
73  private:
75  };
76 
77  }
78 
cadabra::TeXView::datacell
DTree::iterator datacell
Definition: TeXView.hh:29
cadabra::TeXView::dim
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:76
cadabra::TeXView::show_hide_requested
sigc::signal1< bool, DTree::iterator > show_hide_requested
Definition: TeXView.hh:27
cadabra::TeXView::update_image
void update_image()
Update the TeX image.
Definition: TeXView.cc:88
cadabra::TeXView::TeXArea
Definition: TeXView.hh:36
cadabra::TeXView::tex_error
sigc::signal1< bool, std::string > tex_error
Definition: TeXView.hh:64
cadabra::TeXEngine
Definition: TeXEngine.hh:23
cadabra::TeXView::TeXArea::scale_
double scale_
Definition: TeXView.hh:51
cadabra::TeXView::on_show
virtual void on_show() override
Definition: TeXView.cc:39
cadabra::TeXView::convert
void convert()
Definition: TeXView.cc:53
cadabra::TeXView
Definition: TeXView.hh:20
cadabra::TeXView::image
TeXArea image
Definition: TeXView.hh:54
cadabra::TeXView::TeXView
TeXView(TeXEngine &, DTree::iterator, int hmargin=25)
Definition: TeXView.cc:11
cadabra::TeXView::engine
TeXEngine & engine
Definition: TeXView.hh:74
cadabra::TeXView::~TeXView
virtual ~TeXView()
Definition: TeXView.cc:34
DataCell.hh
cadabra::TeXView::hbox
Gtk::HBox hbox
Definition: TeXView.hh:34
cadabra::TeXView::TeXArea::on_draw
virtual bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition: TeXView.cc:110
cadabra::TeXView::TeXArea::pixbuf
Glib::RefPtr< Gdk::Pixbuf > pixbuf
The actual image is stored in the image referenced by pixbuf.
Definition: TeXView.hh:50
cadabra::TeXView::vbox
Gtk::VBox vbox
Definition: TeXView.hh:33
cadabra::TeXView::TeXArea::update_image
void update_image(std::shared_ptr< TeXEngine::TeXRequest >, double scale)
Update the visible image from the pixbuf.
Definition: TeXView.cc:93
cadabra
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:80
cadabra::TeXView::on_button_release_event
virtual bool on_button_release_event(GdkEventButton *) override
Definition: TeXView.cc:82
cadabra::TeXView::content
std::shared_ptr< TeXEngine::TeXRequest > content
Definition: TeXView.hh:25