dd5ac13b5f
max, preferred) size triple so that they are compatible with each other. * Implemented AlignInFrame(BView*, BRect). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21353 a95241bf-73f2-0310-859d-f6bbb57e9c96
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
/*
|
|
* Copyright 2006, Haiku Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _LAYOUT_UTILS_H
|
|
#define _LAYOUT_UTILS_H
|
|
|
|
#include <Alignment.h>
|
|
#include <Rect.h>
|
|
#include <Size.h>
|
|
|
|
class BView;
|
|
|
|
class BLayoutUtils {
|
|
public:
|
|
// static float AddSizesFloat(float a, float b);
|
|
// static float AddSizesFloat(float a, float b, float c);
|
|
static float AddDistances(float a, float b);
|
|
static float AddDistances(float a, float b, float c);
|
|
static int32 AddSizesInt32(int32 a, int32 b);
|
|
static int32 AddSizesInt32(int32 a, int32 b, int32 c);
|
|
// static float SubtractSizesFloat(float a, float b);
|
|
static int32 SubtractSizesInt32(int32 a, int32 b);
|
|
static float SubtractDistances(float a, float b);
|
|
|
|
static void FixSizeConstraints(float& min, float& max,
|
|
float& preferred);
|
|
static void FixSizeConstraints(BSize& min, BSize& max,
|
|
BSize& preferred);
|
|
|
|
static BSize ComposeSize(BSize size, BSize layoutSize);
|
|
static BAlignment ComposeAlignment(BAlignment alignment,
|
|
BAlignment layoutAlignment);
|
|
|
|
static BRect AlignInFrame(BRect frame, BSize maxSize,
|
|
BAlignment alignment);
|
|
static void AlignInFrame(BView* view, BRect frame);
|
|
};
|
|
|
|
#endif // _LAYOUT_UTILS_H
|