Dillo v3.1.1-14-g8f67d6e0
Loading...
Searching...
No Matches
ruler.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2005-2007 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 "ruler.hh"
23#include "../lout/misc.hh"
24
25#include <stdio.h>
26
27namespace dw {
28
29int Ruler::CLASS_ID = -1;
30
32{
33 DBG_OBJ_CREATE ("dw::Ruler");
34 registerName ("dw::Ruler", &CLASS_ID);
35}
36
38{
40}
41
48
58
60{
61 return true;
62}
63
65{
66 DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChangedForChildren");
67 // Nothing to do.
69}
70
72{
73 return true;
74}
75
77 core::DrawingContext *context)
78{
79 drawWidgetBox (view, area, false);
80}
81
84 *context)
85{
86 // Override (complex) implementation OOFAwareWidget::getWidgetAtPoint().
87
88 if (inAllocation (x, y))
89 return this;
90 else
91 return NULL;
92}
93
95{
97 return new core::EmptyIterator (this, mask, atEnd);
98}
99
100} // namespace dw
~Ruler()
Definition ruler.cc:37
void sizeRequestSimpl(core::Requisition *requisition)
Simple variant, to be implemented by widgets with sizes not depending on positions.
Definition ruler.cc:42
bool isBlockLevel()
Definition ruler.cc:59
bool usesAvailWidth()
Must be implemengted by a method returning true, when getAvailWidth() is called.
Definition ruler.cc:71
static int CLASS_ID
Definition ruler.hh:33
core::Widget * getWidgetAtPoint(int x, int y, core::GettingWidgetAtPointContext *context)
Definition ruler.cc:82
void draw(core::View *view, core::Rectangle *area, core::DrawingContext *context)
Area is given in widget coordinates.
Definition ruler.cc:76
void getExtremesSimpl(core::Extremes *extremes)
Simple variant, to be implemented by widgets with extremes not depending on positions.
Definition ruler.cc:49
core::Iterator * iterator(core::Content::Type mask, bool atEnd)
Return an iterator for this widget.
Definition ruler.cc:94
void containerSizeChangedForChildren()
Definition ruler.cc:64
Ruler()
Definition ruler.cc:31
Set at the top when drawing.
Definition types.hh:295
This implementation of dw::core::Iterator can be used by widgets with no contents.
Definition iterator.hh:97
Set at the top when getting the widget at the point.
Definition types.hh:313
Iterators are used to iterate through the contents of a widget.
Definition iterator.hh:20
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
The base class of all dillo widgets.
Definition widget.hh:24
Extremes extremes
Analogue to dw::core::Widget::requisition.
Definition widget.hh:146
int boxDiffWidth()
Definition widget.hh:461
int getAvailWidth(bool forceValue)
Return available width including margin/border/padding (extraSpace?), not only the content width.
Definition widget.cc:649
void drawWidgetBox(View *view, Rectangle *area, bool inverse)
Draw borders and background of a widget.
Definition widget.cc:1412
Requisition requisition
Size_request() stores the result of the last call of size_request_impl().
Definition widget.hh:140
bool inAllocation(int x, int y)
Definition widget.hh:451
int boxRestHeight()
Definition widget.hh:464
void correctExtremes(Extremes *extremes, bool useAdjustmentWidth)
Definition widget.cc:821
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_ENTER0(aspect, prio, funname)
#define DBG_OBJ_DELETE()
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_LEAVE()
Dw is in this namespace, or sub namespaces of this one.
T min(T a, T b)
Definition misc.hh:19
T max(T a, T b)
Definition misc.hh:20