Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
image.hh
Go to the documentation of this file.
1#ifndef __DW_IMAGE_HH__
2#define __DW_IMAGE_HH__
3
4#include "core.hh"
5
6namespace dw {
7
24{
25private:
27 private:
29 public:
31 int link;
32
33 ~ShapeAndLink () { if (shape) delete shape; };
34 };
35
36 lout::container::typed::List <ShapeAndLink> *shapesAndLinks;
38 public:
39 ImageMap ();
40 ~ImageMap ();
41
42 void draw (core::View *view, core::style::Style *style, int x, int y);
43 void add (core::Shape *shape, int link);
45 int link (int x, int y);
46 };
47
48 lout::container::typed::HashTable <lout::object::Object, ImageMap>
51
52public:
55
57 void addShapeToCurrentMap (core::Shape *shape, int link);
60 core::style::Style *style, int x, int y);
61 int link (lout::object::Object *key, int x, int y);
62};
63
120{
121private:
122 char *altText;
130 bool isMap;
131
132protected:
137
138 void draw (core::View *view, core::Rectangle *area,
139 core::DrawingContext *context);
140
148
149 //core::Iterator *iterator (Content::Type mask, bool atEnd);
150
151public:
152 static int CLASS_ID;
153
154 Image(const char *altText);
155 ~Image();
156
157 // For images, the minimal width is not well defined, and
158 // correction of the size makes not much sense.
159 virtual bool getAdjustMinWidth () { return false; }
160
161 core::Iterator *iterator (core::Content::Type mask, bool atEnd);
162
163 inline core::Imgbuf *getBuffer () { return buffer; }
164 void setBuffer (core::Imgbuf *buffer, bool resize = false);
165
166 void drawRow (int row);
167
168 void finish ();
169 void fatal ();
170
171 void setIsMap ();
172 void setUseMap (ImageMapsList *list, Object *key);
173
174 /* This is a hack for the perhaps frivolous feature of drawing image map
175 * shapes when there is no image to display. If the map is defined after
176 * an image using an image map, and the actual image data has not been
177 * loaded, tell the image to redraw.
178 */
179 void forceMapRedraw () { if (mapKey && ! buffer) queueDraw (); };
180};
181
182} // namespace dw
183
184#endif // __DW_IMAGE_HH__
void setDefaultLink(int link)
Definition image.hh:44
void add(core::Shape *shape, int link)
Definition image.cc:55
int link(int x, int y)
Definition image.cc:62
void draw(core::View *view, core::style::Style *style, int x, int y)
Definition image.cc:43
lout::container::typed::List< ShapeAndLink > * shapesAndLinks
Definition image.hh:36
Represents a list of client-side image maps.
Definition image.hh:24
void drawMap(lout::object::Object *key, core::View *view, core::style::Style *style, int x, int y)
Definition image.cc:122
ImageMap * currentMap
Definition image.hh:50
void addShapeToCurrentMap(core::Shape *shape, int link)
Add a shape to the current map-.
Definition image.cc:109
void startNewMap(lout::object::Object *key)
Start a new map and make it the current one.
Definition image.cc:97
lout::container::typed::HashTable< lout::object::Object, ImageMap > * imageMaps
Definition image.hh:49
void setCurrentMapDefaultLink(int link)
Set default link for current map-.
Definition image.cc:117
int link(lout::object::Object *key, int x, int y)
Definition image.cc:131
Displays an instance of dw::core::Imgbuf.
Definition image.hh:120
void setIsMap()
Sets image as server side image map.
Definition image.cc:540
void setUseMap(ImageMapsList *list, Object *key)
Sets image as client side image map.
Definition image.cc:553
core::Iterator * iterator(core::Content::Type mask, bool atEnd)
Return an iterator for this widget.
Definition image.cc:479
int contentY(core::MousePositionEvent *event)
Definition image.cc:348
void finish()
Called, when all image data has been retrieved.
Definition image.cc:526
core::Imgbuf * buffer
Definition image.hh:123
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
Definition image.cc:514
ImageMapsList * mapList
Definition image.hh:128
core::Imgbuf * getBuffer()
Definition image.hh:163
void sizeAllocateImpl(core::Allocation *allocation)
See Sizes of Dillo Widgets.
Definition image.cc:275
bool buttonReleaseImpl(core::EventButton *event)
Definition image.cc:398
void sizeRequestSimpl(core::Requisition *requisition)
Simple variant, to be implemented by widgets with sizes not depending on positions.
Definition image.cc:176
static int CLASS_ID
Definition image.hh:152
void containerSizeChangedForChildren()
Definition image.cc:306
bool isMap
Definition image.hh:130
void forceMapRedraw()
Definition image.hh:179
bool buttonPressImpl(core::EventButton *event)
Definition image.cc:381
void fatal()
Called, when there are problems with the retrieval of image data.
Definition image.cc:531
int contentX(core::MousePositionEvent *event)
Definition image.cc:340
void getExtremesSimpl(core::Extremes *extremes)
Simple variant, to be implemented by widgets with extremes not depending on positions.
Definition image.cc:242
void setBuffer(core::Imgbuf *buffer, bool resize=false)
Called, when an image buffer is attached.
Definition image.cc:486
Object * mapKey
Definition image.hh:129
bool clicking
Definition image.hh:126
void enterNotifyImpl(core::EventCrossing *event)
Definition image.cc:313
int altTextWidth
Definition image.hh:125
int bufWidth
Definition image.hh:124
virtual bool getAdjustMinWidth()
Definition image.hh:159
void leaveNotifyImpl(core::EventCrossing *event)
Definition image.cc:324
bool motionNotifyImpl(core::EventMotion *event)
Definition image.cc:356
char * altText
Definition image.hh:122
int bufHeight
Definition image.hh:124
void draw(core::View *view, core::Rectangle *area, core::DrawingContext *context)
Area is given in widget coordinates.
Definition image.cc:412
int currLink
Definition image.hh:127
Set at the top when drawing.
Definition types.hh:295
Represents a button press or release event.
Definition events.hh:58
Represents a enter or leave notify event.
Definition events.hh:75
Represents a mouse motion event.
Definition events.hh:68
The platform independent interface for image buffers.
Definition imgbuf.hh:162
Iterators are used to iterate through the contents of a widget.
Definition iterator.hh:20
Base class for all mouse events related to a specific position.
Definition events.hh:49
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
Abstract interface for different shapes.
Definition types.hh:59
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
The base class of all dillo widgets.
Definition widget.hh:44
Extremes extremes
Analogue to dw::core::Widget::requisition.
Definition widget.hh:166
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition widget.hh:203
Requisition requisition
Size_request() stores the result of the last call of size_request_impl().
Definition widget.hh:160
void queueDraw()
Definition widget.hh:297
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
Dw is in this namespace, or sub namespaces of this one.
Represents the allocation, i.e.
Definition types.hh:164