Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
simpletablecell.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2014 Sebastian Geerken <sgeerken@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21
22#include "simpletablecell.hh"
23#include "tablecell.hh"
24#include "../lout/debug.hh"
25
26using namespace lout;
27
28namespace dw {
29
31
33 Textblock (limitTextWidth)
34{
35 DBG_OBJ_CREATE ("dw::SimpleTableCell");
36 registerName ("dw::SimpleTableCell", &CLASS_ID);
37}
38
43
48
53
58
59int SimpleTableCell::getAvailWidthOfChild (Widget *child, bool forceValue)
60{
61 DBG_OBJ_ENTER ("resize", 0, "SimpleTableCell::getAvailWidthOfChild",
62 "%p, %s", child, forceValue ? "true" : "false");
63
65 (this, child, Textblock::getAvailWidthOfChild (child, forceValue),
66 forceValue);
67
69 return width;
70}
71
72int SimpleTableCell::getAvailHeightOfChild (Widget *child, bool forceValue)
73{
74 DBG_OBJ_ENTER ("resize", 0, "SimpleTableCell::getAvailHeightOfChild",
75 "%p, %s", child, forceValue ? "true" : "false");
76
78 (this, child, Textblock::getAvailHeightOfChild (child, forceValue),
79 forceValue);
80
82 return height;
83}
84
86 core::Requisition *requisition,
87 void (*splitHeightFun) (int,
88 int*,
89 int*),
90 bool allowDecreaseWidth,
91 bool allowDecreaseHeight)
92{
93 DBG_OBJ_ENTER ("resize", 0, "SimpleTableCell::correctRequisitionOfChild",
94 "%p, %d * (%d + %d), ..., %s, %s", child, requisition->width,
96 misc::boolToStr (allowDecreaseWidth),
97 misc::boolToStr (allowDecreaseHeight));
98
100 allowDecreaseWidth,
101 allowDecreaseHeight);
103 splitHeightFun,
104 allowDecreaseWidth,
105 allowDecreaseHeight);
106
107 DBG_OBJ_LEAVE ();
108}
109
111 core::Extremes *extremes,
112 bool useAdjustmentWidth)
113{
114 DBG_OBJ_ENTER ("resize", 0, "SimpleTableCell::correctExtremesOfChild",
115 "%p, %d (%d) / %d (%d)",
118
119 Textblock::correctExtremesOfChild (child, extremes, useAdjustmentWidth);
121 useAdjustmentWidth);
122
123 DBG_OBJ_LEAVE ();
124}
125
126int SimpleTableCell::applyPerWidth (int containerWidth,
127 core::style::Length perWidth)
128{
129 return tablecell::applyPerWidth (this, containerWidth, perWidth);
130}
131
132int SimpleTableCell::applyPerHeight (int containerHeight,
133 core::style::Length perHeight)
134{
135 return tablecell::applyPerHeight (this, containerHeight, perHeight);
136}
137
142
143} // namespace dw
void correctExtremesOfChild(Widget *child, core::Extremes *extremes, bool useAdjustmentWidth)
int getAvailWidthOfChild(Widget *child, bool forceValue)
int getAvailHeightOfChild(Widget *child, bool forceValue)
void correctRequisitionOfChild(Widget *child, core::Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight)
bool adjustExtraSpaceWhenCorrectingRequisitionByOOF()
int applyPerHeight(int containerHeight, core::style::Length perHeight)
SimpleTableCell(bool limitTextWidth)
int applyPerWidth(int containerWidth, core::style::Length perWidth)
A Widget for rendering text blocks, i.e.
Definition textblock.hh:206
int getAvailHeightOfChild(core::Widget *child, bool forceValue)
Definition textblock.cc:809
int getAvailWidthOfChild(core::Widget *child, bool forceValue)
Computes the content width available of a child widget.
Definition textblock.cc:755
Extremes extremes
Analogue to dw::core::Widget::requisition.
Definition widget.hh:166
Requisition requisition
Size_request() stores the result of the last call of size_request_impl().
Definition widget.hh:160
virtual void correctRequisitionOfChild(Widget *child, Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight)
Definition widget.cc:1810
virtual void correctExtremesOfChild(Widget *child, Extremes *extremes, bool useAdjustmentWidth)
Definition widget.cc:1911
void registerName(const char *className, int *classId)
This method must be called in the constructor for the sub class.
Definition identity.cc:83
#define DBG_OBJ_DELETE()
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
#define DBG_OBJ_LEAVE()
int Length
Type for representing all lengths within dw::core::style.
Definition style.hh:428
int applyPerHeight(core::Widget *widget, int containerHeight, core::style::Length perHeight)
Definition tablecell.cc:121
int correctAvailHeightOfChild(core::Widget *widget, core::Widget *child, int height, bool forceValue)
Definition tablecell.cc:72
bool adjustExtraSpaceWhenCorrectingRequisitionByOOF()
Definition tablecell.hh:36
bool getAdjustMinWidth()
Definition tablecell.cc:37
int applyPerWidth(core::Widget *widget, int containerWidth, core::style::Length perWidth)
Definition tablecell.cc:115
int correctAvailWidthOfChild(core::Widget *widget, core::Widget *child, int width, bool forceValue)
Definition tablecell.cc:47
bool isBlockLevel()
Definition tablecell.cc:42
bool usesMaxGeneratorWidth()
Definition tablecell.hh:10
void correctCorrectedRequisitionOfChild(core::Widget *widget, core::Widget *child, core::Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight)
Definition tablecell.cc:79
void correctCorrectedExtremesOfChild(core::Widget *widget, core::Widget *child, core::Extremes *extremes, bool useAdjustmentWidth)
Definition tablecell.cc:108
Dw is in this namespace, or sub namespaces of this one.
const char * boolToStr(bool b)
Definition misc.hh:88