-
Notifications
You must be signed in to change notification settings - Fork 5
/
PreviewView.h
40 lines (30 loc) · 820 Bytes
/
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
#ifndef PREVIEWVIEW_H
#define PREVIEWVIEW_H
#include <InterfaceKit.h>
class PreviewView : public BView
{
public:
// Constructors, destructors, operators...
PreviewView(BRect frame, 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);
// Public methods
public:
void SetBitmap(BBitmap * bitmap);
BBitmap * GetBitmap();
void SetGeometry(BRect geometry);
// From here, it's none of your business! ;-)
private:
BRect CenterImage();
void DrawBorders(BRect r);
rgb_color m_background_color;
BRect m_geometry;
BBitmap * m_image;
BBitmap * m_background;
};
#endif // ifdef PREVIEWVIEW_H