blob: bdab6df1e0d9cb6af4482e9c4fc659fc74a4f3ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// notes:
/*
* hold en gdkpixbuf ved lige, og tegn den på en gtkdrawingarea
* ved passende lejligheder
*/
#include "model.hh"
#include <gtk/gtk.h>
#include "painter.hh"
enum {
BASE_DPI = 300,
PAPER_WIDTH = 7, // inches
PAPER_HEIGHT = 17 // inches
};
class View : public Observer {
private:
Model *model;
GtkWidget *drawing_area;
GdkPixmap *pixmap;
public:
View (Model *model_arg);
GtkWidget *get_widget (void) { return drawing_area; }
void create_pixmap (void);
void expose (GdkEventExpose *event);
void notify (void) const;
void redraw (void) const;
};
void on_da_realize (GtkDrawingArea *da,
View *v);
int on_da_expose (GtkWidget *widget,
GdkEventExpose *event,
View *v);
|