2 * Copyright 2006-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _LAYOUT_UTILS_H
6 #define _LAYOUT_UTILS_H
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
,
33 static void FixSizeConstraints(BSize
& min
, BSize
& max
,
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
);
47 static BString
GetLayoutTreeDump(BView
* view
);
48 static BString
GetLayoutTreeDump(BLayoutItem
* item
);
51 static void _GetLayoutTreeDump(BView
* view
, int level
,
53 static void _GetLayoutTreeDump(BLayoutItem
* item
,
54 int level
, bool isViewLayout
,
58 #endif // _LAYOUT_UTILS_H