repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / fontdemo / FontDemoView.h
blob23b1395eff97f705455c22c0dbfa3db4dc4ebb55
1 /*
2 * Copyright 2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Mikael Konradson, mikael.konradson@gmail.com
7 */
8 #ifndef FONT_DEMO_VIEW_H
9 #define FONT_DEMO_VIEW_H
12 #include <View.h>
13 #include <Region.h>
14 #include <String.h>
16 class BShape;
17 class BBitmap;
20 class FontDemoView : public BView {
21 public:
22 FontDemoView(BRect rect);
23 virtual ~FontDemoView();
25 virtual void Draw(BRect updateRect);
26 virtual void MessageReceived(BMessage* message);
27 virtual void FrameResized(float width, float height);
29 virtual void SetFontSize(float size);
30 const float FontSize() const { return fFont.Size(); }
32 void SetDrawBoundingBoxes(bool state);
33 bool BoundingBoxes() const { return fBoundingBoxes; }
35 void SetFontShear(float shear);
36 const float Shear() const { return fFont.Shear(); }
38 void SetFontRotation(float rotation);
39 const float Rotation() const { return fFont.Rotation(); }
41 void SetString(BString string);
42 BString String() const;
44 void SetAntialiasing(bool state);
46 void SetSpacing(float space);
47 const float Spacing() const { return fSpacing; }
49 void SetOutlineLevel(int8 outline);
50 const int8 OutLineLevel() const { return fOutLineLevel; }
52 private:
53 void _AddShapes(BString string);
54 void _DrawView(BView* view);
56 BView* _GetView(BRect rect);
57 void _NewBitmap(BRect rect);
59 BBitmap* fBitmap;
60 BView* fBufferView;
62 BString fString;
63 float fFontSize;
64 float fSpacing;
65 int8 fOutLineLevel;
66 drawing_mode fDrawingMode;
68 BRegion fBoxRegion;
69 BFont fFont;
70 bool fBoundingBoxes;
71 bool fDrawShapes;
72 BShape** fShapes;
75 #endif // FONT_DEMO_VIEW_H