Initial release of Maemo 5 port of gnuplot
[gnuplot] / src / beos / GPView.h
1 /*[
2  * Copyright 1986 - 1993, 1998, 2004   Thomas Williams, Colin Kelley
3  *
4  * Permission to use, copy, and distribute this software and its
5  * documentation for any purpose with or without fee is hereby granted,
6  * provided that the above copyright notice appear in all copies and
7  * that both that copyright notice and this permission notice appear
8  * in supporting documentation.
9  *
10  * Permission to modify the software is granted, but not the right to
11  * distribute the complete modified source code.  Modifications are to
12  * be distributed as patches to the released version.  Permission to
13  * distribute binaries produced by compiling modified sources is granted,
14  * provided you
15  *   1. distribute the corresponding source modifications from the
16  *    released version in the form of a patch file along with the binaries,
17  *   2. add special version identification to distinguish your version
18  *    in addition to the base release version number,
19  *   3. provide your name and address as the primary contact for the
20  *    support of your modified version, and
21  *   4. retain our contact information in regard to use of the base
22  *    software.
23  * Permission to distribute the released version of the source code along
24  * with corresponding source modifications in the form of a patch file is
25  * granted with same provisions 2 through 4 for binary distributions.
26  *
27  * This software is provided "as is" without express or implied warranty
28  * to the extent permitted by applicable law.
29 ]*/
30
31 #ifndef GPView_h
32 #define GPView_h
33
34 #include <SupportDefs.h>
35 #include <GraphicsDefs.h>
36 #include <List.h>
37 #include <Bitmap.h>
38 #include <Rect.h>
39
40
41 class GPView : public BView
42 {
43         protected:
44
45                 GPBitmap                *       m_bitmap;
46                 float                           m_scale;
47
48         public:
49                                                         GPView(BRect rect, ulong resizeMode,
50                                                                 ulong flags, GPBitmap *bitmap);
51                                                         ~GPView();
52
53         GPBitmap *              Document() { return m_bitmap; };
54
55                                 void            SetScale(float scale);
56                                 float           Scale();
57
58                                 void            GetMaxSize(float *width, float *height);
59
60                 virtual void            MouseDown(BPoint point);
61                 virtual void            MouseUp(BPoint point);
62                 virtual void            Draw(BRect updateRect);
63                 virtual void            AttachedToWindow();
64                 virtual void            MessageReceived(BMessage *msg);
65                 virtual void            FrameResized(float width, float height);
66                                 void            FixupScrollbars();
67 };
68
69 #endif