Cadabra
Computer algebra system for field theory problems
DiffViewer.hh
Go to the documentation of this file.
1 #include <gtkmm.h>
2 #include <gtkmm/frame.h>
3 #include <string>
4 #include <istream>
5 
6 class DiffTextView : public Gtk::TextView {
7  public:
8  DiffTextView();
9  };
10 
11 class CellDiff : public Gtk::Frame {
12  public:
13  CellDiff(const std::string& a, const std::string& b);
14 
15  protected:
16  void compare(const std::string& a_str, const std::string& b_str);
17  Gtk::Grid grid;
19  Gtk::ScrolledWindow sw_lhs, sw_rhs;
20  };
21 
22 class DiffViewer : public Gtk::Dialog {
23  public:
24  DiffViewer(std::istream& a, std::istream& b, Gtk::Window& parent);
25  void run_noblock();
26  protected:
27  using Cells = std::pair<std::vector<std::string>, std::vector<std::string>>;
28 
29  void populate(std::istream& a, std::istream& b);
30  Cells make_cells(std::istream& stream);
31 
32  Gtk::Box box;
33  Gtk::ScrolledWindow scrolled_window;
34  std::vector<CellDiff> cells;
35  };
std::pair< std::vector< std::string >, std::vector< std::string > > Cells
Definition: DiffViewer.hh:27
DiffTextView tv_lhs
Definition: DiffViewer.hh:18
Gtk::Grid grid
Definition: DiffViewer.hh:17
Gtk::Box box
Definition: DiffViewer.hh:32
Gtk::ScrolledWindow sw_rhs
Definition: DiffViewer.hh:19
CellDiff(const std::string &a, const std::string &b)
Definition: DiffViewer.cc:24
Gtk::ScrolledWindow scrolled_window
Definition: DiffViewer.hh:33
DiffTextView tv_rhs
Definition: DiffViewer.hh:18
DiffViewer(std::istream &a, std::istream &b, Gtk::Window &parent)
Definition: DiffViewer.cc:125
void populate(std::istream &a, std::istream &b)
Definition: DiffViewer.cc:153
Definition: DiffViewer.hh:6
Cells make_cells(std::istream &stream)
Definition: DiffViewer.cc:181
DiffTextView()
Definition: DiffViewer.cc:12
std::vector< CellDiff > cells
Definition: DiffViewer.hh:34
void run_noblock()
Definition: DiffViewer.cc:144
Definition: DiffViewer.hh:22
Definition: DiffViewer.hh:11
void compare(const std::string &a_str, const std::string &b_str)
Definition: DiffViewer.cc:51
Gtk::ScrolledWindow sw_lhs
Definition: DiffViewer.hh:19