Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
ImageView.hh
Go to the documentation of this file.
1
2#pragma once
3
4#include <gtkmm/box.h>
5#include <gtkmm/image.h>
6#include <gtkmm/eventbox.h>
7
8namespace cadabra {
9
13
14 class ImageView : public Gtk::EventBox {
15 public:
16 ImageView(double scale);
17 virtual ~ImageView();
18
19 void set_image_from_base64(const std::string& b64);
20 void set_image_from_svg(const std::string& svg);
21
22 virtual bool on_motion_notify_event(GdkEventMotion *event) override;
23 virtual bool on_button_press_event(GdkEventButton *event) override;
24 virtual bool on_button_release_event(GdkEventButton *event) override;
25
26 private:
27 std::string decoded; // raw byte content of image
29
30 Gtk::VBox vbox;
31 Gtk::Image image;
32 Glib::RefPtr<Gdk::Pixbuf> pixbuf;
33
34 bool sizing;
35 double prev_x, prev_y;
37 double scale;
38
39 // Re-render the image from the raw bytes at the current
40 // resolution of the image widget (or 400 if not set).
41 void rerender(int override_width=0);
42 };
43
44 };
An image viewing widget.
Definition ImageView.hh:14
void set_image_from_svg(const std::string &svg)
Definition ImageView.cc:76
Gtk::Image image
Definition ImageView.hh:31
void set_image_from_base64(const std::string &b64)
Definition ImageView.cc:64
virtual bool on_button_release_event(GdkEventButton *event) override
Definition ImageView.cc:55
Gtk::VBox vbox
Definition ImageView.hh:30
int height_at_press
Definition ImageView.hh:36
virtual bool on_motion_notify_event(GdkEventMotion *event) override
Definition ImageView.cc:30
virtual bool on_button_press_event(GdkEventButton *event) override
Definition ImageView.cc:43
int width_at_press
Definition ImageView.hh:36
void rerender(int override_width=0)
Definition ImageView.cc:83
virtual ~ImageView()
Definition ImageView.cc:26
bool sizing
Definition ImageView.hh:34
std::string decoded
Definition ImageView.hh:27
bool is_raster
Definition ImageView.hh:28
Glib::RefPtr< Gdk::Pixbuf > pixbuf
Definition ImageView.hh:32
double prev_x
Definition ImageView.hh:35
double prev_y
Definition ImageView.hh:35
double scale
Definition ImageView.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:1063