Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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/image.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 
18 
19  class TeXView : public Gtk::EventBox {
20  public:
21  TeXView(TeXEngine&, DTree::iterator, int hmargin=25);
22  virtual ~TeXView();
23 
24  std::shared_ptr<TeXEngine::TeXRequest> content;
25 
26  sigc::signal1<bool, DTree::iterator> show_hide_requested;
27 
28  DTree::iterator datacell;
29 #if GTKMM_MINOR_VERSION>=10
30  Gtk::Revealer rbox;
31 #endif
32  Gtk::VBox vbox;
33  Gtk::HBox hbox;
34  Gtk::Image image;
35 
39 
40  Glib::RefPtr<Gdk::Pixbuf> pixbuf;
41 
45 
46  void update_image();
47 
50 
51  void dim(bool);
52 
53  sigc::signal1<bool, std::string> tex_error;
54 
55  protected:
56  virtual bool on_button_release_event(GdkEventButton *) override;
57  virtual void on_show() override;
58 // virtual bool on_configure_event(GdkEventConfigure *) override;
59 
60  void convert();
61 
62  private:
64  };
65 
66 }
67 
TeXView(TeXEngine &, DTree::iterator, int hmargin=25)
Definition: TeXView.cc:7
sigc::signal1< bool, std::string > tex_error
Definition: TeXView.hh:53
sigc::signal1< bool, DTree::iterator > show_hide_requested
Definition: TeXView.hh:26
virtual bool on_button_release_event(GdkEventButton *) override
Definition: TeXView.cc:85
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:79
TeXView is a widget which knows how to turn a string into a LaTeX-rendered image and display that...
Definition: TeXView.hh:19
std::shared_ptr< TeXEngine::TeXRequest > content
Definition: TeXView.hh:24
DTree::iterator datacell
Definition: TeXView.hh:28
void update_image()
Update the visible image from the pixbuf.
Definition: TeXView.cc:91
TeXEngine & engine
Definition: TeXView.hh:63
TeXEngine is used to convert LaTeX strings into PNG images.
Definition: TeXEngine.hh:26
virtual ~TeXView()
Definition: TeXView.cc:30
Glib::RefPtr< Gdk::Pixbuf > pixbuf
The actual image is stored in the image referenced by pixbuf.
Definition: TeXView.hh:40
Gtk::HBox hbox
Definition: TeXView.hh:33
void convert()
Definition: TeXView.cc:49
Gtk::VBox vbox
Definition: TeXView.hh:32
virtual void on_show() override
Definition: TeXView.cc:35
Gtk::Image image
Definition: TeXView.hh:34