summaryrefslogtreecommitdiffabout
path: root/microkde/qlayoutengine_p.h
Unidiff
Diffstat (limited to 'microkde/qlayoutengine_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/qlayoutengine_p.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/microkde/qlayoutengine_p.h b/microkde/qlayoutengine_p.h
new file mode 100644
index 0000000..2d6a556
--- a/dev/null
+++ b/microkde/qlayoutengine_p.h
@@ -0,0 +1,111 @@
1// THIS IS A COPY OF THE FILE FOUND IN $QTDIR/src/kernel. Needed to modify qsplitter
2
3/****************************************************************************
4** $Id$
5**
6** Internal header file.
7**
8** Created : 981027
9**
10** Copyright (C) 1998-99 by Trolltech AS. All rights reserved.
11**
12** This file is part of the kernel module of the Qt GUI Toolkit.
13**
14** This file may be distributed under the terms of the Q Public License
15** as defined by Trolltech AS of Norway and appearing in the file
16** LICENSE.QPL included in the packaging of this file.
17**
18** This file may be distributed and/or modified under the terms of the
19** GNU General Public License version 2 as published by the Free Software
20** Foundation and appearing in the file LICENSE.GPL included in the
21** packaging of this file.
22**
23** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
24** licenses may use this file in accordance with the Qt Commercial License
25** Agreement provided with the Software.
26**
27** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29**
30** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
31** information about Qt Commercial License Agreements.
32** See http://www.trolltech.com/qpl/ for QPL licensing information.
33** See http://www.trolltech.com/gpl/ for GPL licensing information.
34**
35** Contact info@trolltech.com if any conditions of this licensing are
36** not clear to you.
37**
38**********************************************************************/
39
40#ifndef QLAYOUTENGINE_P_H
41#define QLAYOUTENGINE_P_H
42
43
44//
45// W A R N I N G
46// -------------
47//
48// This file is not part of the Qt API. It exists for the convenience
49// of qlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp.
50// This header file may change from version to version without notice,
51// or even be removed.
52//
53// We mean it.
54//
55//
56
57
58#ifndef QT_H
59#include "qabstractlayout.h"
60#endif // QT_H
61
62#ifndef QT_NO_LAYOUT
63struct QLayoutStruct
64{
65 void initParameters() { minimumSize = sizeHint = 0;
66 maximumSize = QWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; }
67 void init() { stretch = 0; initParameters(); }
68 //permanent storage:
69 int stretch;
70 //parameters:
71 QCOORD sizeHint;
72 QCOORD maximumSize;
73 QCOORD minimumSize;
74 bool expansive;
75 bool empty;
76 //temporary storage:
77 bool done;
78 //result:
79 int pos;
80 int size;
81};
82
83
84void qGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos,
85 int space, int spacer );
86
87
88
89/*
90 Modify total maximum (max) and total expansion (exp)
91 when adding boxmax/boxexp.
92
93 Expansive boxes win over non-expansive boxes.
94*/
95static inline void qMaxExpCalc( QCOORD & max, bool &exp,
96 QCOORD boxmax, bool boxexp )
97{
98 if ( exp ) {
99 if ( boxexp )
100 max = QMAX( max, boxmax );
101 } else {
102 if ( boxexp )
103 max = boxmax;
104 else
105 max = QMIN( max, boxmax );
106 }
107 exp = exp || boxexp;
108}
109
110#endif //QT_NO_LAYOUT
111#endif