forked from HaikuArchives/sanity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PreviewView.h
57 lines (44 loc) · 1.21 KB
/
PreviewView.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef PREVIEWVIEW_H
#define PREVIEWVIEW_H
#include <Application.h>
#include <InterfaceKit.h>
#include <Cursor.h>
class PreviewView : public BView
{
public:
// Constructors, destructors, operators...
PreviewView(BRect area);
~PreviewView();
typedef BView inherited;
// Virtual function overrides
public:
virtual void Draw(BRect invalid);
virtual void AttachedToWindow(void);
virtual void FrameResized(float width, float height);
virtual void MouseDown(BPoint p);
virtual void MouseUp(BPoint p);
virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
// Public methods
public:
void SetBitmap(BBitmap * bitmap);
BBitmap * GetBitmap();
void SetGeometry(BRect geometry);
void SetFrame(BRect frame);
void SetImageFrame(void);
BRect GetGeometry(void);
BRect GetFrame(void);
// From here, it's none of your business! ;-)
private:
BRect CenterImage();
void DrawBorders(BRect r);
rgb_color m_background_color;
BRect m_geometry;
BRect m_frame;
BRect m_image_frame;
BBitmap * m_image;
BBitmap * m_background;
bool m_mouse_button;
BPoint m_mouse_point_1;
BCursor * m_move_cursor;
};
#endif // ifdef PREVIEWVIEW_H