vfs: check userland buffers before reading them.
[haiku.git] / src / apps / softwareupdater / StripeView.h
blobd2a6ebbcd2b4c61b9bf43a5ba1745a1609bdcab7
1 /*
2 * Copyright 2007-2016 Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ryan Leavengood <leavengood@gmail.com>
7 * John Scipione <jscipione@gmail.com>
8 * Joseph Groover <looncraz@looncraz.net>
9 * Brian Hill <supernova@tycho.email>
11 #ifndef _STRIPE_VIEW_H
12 #define _STRIPE_VIEW_H
15 #include <Bitmap.h>
16 #include <View.h>
19 class StripeView : public BView {
20 public:
21 StripeView(BBitmap& icon);
23 virtual void Draw(BRect updateRect);
24 virtual BSize PreferredSize();
25 virtual void GetPreferredSize(float* _width, float* _height);
26 virtual BSize MaxSize();
28 private:
29 BBitmap fIcon;
30 float fIconSize;
31 float fPreferredWidth;
32 float fPreferredHeight;
36 static inline int32
37 icon_layout_scale()
39 return max_c(1, ((int32)be_plain_font->Size() + 15) / 16);
43 #endif /* _STRIPE_VIEW_H */