libyui
2.42.5
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
Friends
YSquash.cc
1
/*
2
Copyright (C) 2000-2012 Novell, Inc
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: YSquash.cc
20
21
Author: Stefan Hundhammer <sh@suse.de>
22
23
/-*/
24
25
#include "YSquash.h"
26
#include "YBothDim.h"
27
28
29
struct
YSquashPrivate
30
{
31
/**
32
* Constructor.
33
**/
34
YSquashPrivate
(
bool
horSquash,
bool
vertSquash )
35
{
36
squash.hor = horSquash;
37
squash.vert = vertSquash;
38
}
39
40
YBothDim<bool>
squash;
41
};
42
43
44
YSquash::YSquash
(
YWidget
* parent,
bool
horSquash,
bool
vertSquash )
45
:
YSingleChildContainerWidget
( parent )
46
, priv( new
YSquashPrivate
( horSquash, vertSquash ) )
47
{
48
YUI_CHECK_NEW( priv );
49
}
50
51
52
YSquash::~YSquash
()
53
{
54
// NOP
55
}
56
57
58
bool
YSquash::horSquash
()
const
59
{
60
return
priv->squash.hor;
61
}
62
63
64
bool
YSquash::vertSquash
()
const
65
{
66
return
priv->squash.vert;
67
}
68
69
70
bool
YSquash::stretchable
( YUIDimension dim )
const
71
{
72
if
( !
hasChildren
() )
73
return
false
;
74
75
return
! priv->squash[ dim ] &&
firstChild
()->
stretchable
( dim );
76
}
77
78
79
const
char
*
80
YSquash::widgetClass
()
const
81
{
82
if
( priv->squash.hor && priv->squash.vert )
return
"YHVSquash"
;
83
else
if
( priv->squash.hor )
return
"YHSquash"
;
84
else
if
( priv->squash.vert )
return
"YVSquash"
;
85
else
return
"YSquash_NoSquash"
;
86
}
src
YSquash.cc
Generated by
1.8.3