Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / LayoutUtils.h
blob124f732cb02ec3fbf8d7ca51ba47a2bc4f9fedb7
1 /*
2 * Copyright 2006-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _LAYOUT_UTILS_H
6 #define _LAYOUT_UTILS_H
9 #include <Alignment.h>
10 #include <Rect.h>
11 #include <Size.h>
12 #include <String.h>
15 class BLayoutItem;
16 class BView;
19 class BLayoutUtils {
20 public:
21 // static float AddSizesFloat(float a, float b);
22 // static float AddSizesFloat(float a, float b, float c);
23 static float AddDistances(float a, float b);
24 static float AddDistances(float a, float b, float c);
25 static int32 AddSizesInt32(int32 a, int32 b);
26 static int32 AddSizesInt32(int32 a, int32 b, int32 c);
27 // static float SubtractSizesFloat(float a, float b);
28 static int32 SubtractSizesInt32(int32 a, int32 b);
29 static float SubtractDistances(float a, float b);
31 static void FixSizeConstraints(float& min, float& max,
32 float& preferred);
33 static void FixSizeConstraints(BSize& min, BSize& max,
34 BSize& preferred);
36 static BSize ComposeSize(BSize size, BSize layoutSize);
37 static BAlignment ComposeAlignment(BAlignment alignment,
38 BAlignment layoutAlignment);
40 static BRect AlignInFrame(BRect frame, BSize maxSize,
41 BAlignment alignment);
42 static void AlignInFrame(BView* view, BRect frame);
43 static BRect AlignOnRect(BRect rect, BSize size, BAlignment alignment);
44 static BRect MoveIntoFrame(BRect rect, BSize frameSize);
46 // debugging
47 static BString GetLayoutTreeDump(BView* view);
48 static BString GetLayoutTreeDump(BLayoutItem* item);
50 private:
51 static void _GetLayoutTreeDump(BView* view, int level,
52 BString& _output);
53 static void _GetLayoutTreeDump(BLayoutItem* item,
54 int level, bool isViewLayout,
55 BString& _output);
58 #endif // _LAYOUT_UTILS_H