Dillo v3.1.1-14-g8f67d6e0
Loading...
Searching...
No Matches
bullet.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 "bullet.hh"
23
24#include <stdio.h>
25
26namespace dw {
27
29{
30 DBG_OBJ_CREATE ("dw::Bullet");
31}
32
37
39{
40 requisition->width = lout::misc::max (getStyle()->font->xHeight * 4 / 5, 1);
41 requisition->ascent = lout::misc::max (getStyle()->font->xHeight, 1);
43}
44
51
53{
54 DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChangedForChildren");
55 // Nothing to do.
57}
58
60 core::DrawingContext *context)
61{
62 int x, y, l;
63 bool filled = true;
64
66 x = allocation.x;
68
69 switch (getStyle()->listStyleType) {
71 view->drawRectangle (getStyle()->color,
73 false, x, y, l, l);
74 break;
76 filled = false;
77 // Fall Through
79 default:
81 filled, x + l/2, y + l/2, l, l, 0, 360);
82 }
83}
84
86{
87 //return new core::TextIterator (this, mask, atEnd, "*");
89 return new core::EmptyIterator (this, mask, atEnd);
90}
91
92} // namespace dw
void getExtremesSimpl(core::Extremes *extremes)
Simple variant, to be implemented by widgets with extremes not depending on positions.
Definition bullet.cc:45
void containerSizeChangedForChildren()
Definition bullet.cc:52
void draw(core::View *view, core::Rectangle *area, core::DrawingContext *context)
Area is given in widget coordinates.
Definition bullet.cc:59
void sizeRequestSimpl(core::Requisition *requisition)
Simple variant, to be implemented by widgets with sizes not depending on positions.
Definition bullet.cc:38
core::Iterator * iterator(core::Content::Type mask, bool atEnd)
Return an iterator for this widget.
Definition bullet.cc:85
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
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
virtual void drawArc(style::Color *color, style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2)=0
virtual void drawRectangle(style::Color *color, style::Color::Shading shading, bool filled, int x, int y, int width, int height)=0
Extremes extremes
Analogue to dw::core::Widget::requisition.
Definition widget.hh:146
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition widget.hh:183
style::Style * getStyle()
Definition widget.hh:448
Requisition requisition
Size_request() stores the result of the last call of size_request_impl().
Definition widget.hh:140
#define DBG_OBJ_ENTER0(aspect, prio, funname)
#define DBG_OBJ_DELETE()
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_LEAVE()
@ LIST_STYLE_TYPE_DISC
Definition style.hh:302
@ LIST_STYLE_TYPE_CIRCLE
Definition style.hh:303
@ LIST_STYLE_TYPE_SQUARE
Definition style.hh:304
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