Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
selection.hh
Go to the documentation of this file.
1#ifndef __DW_SELECTION_H__
2#define __DW_SELECTION_H__
3
4#ifndef __INCLUDED_FROM_DW_CORE_HH__
5# error Do not include this file directly, use "core.hh" instead.
6#endif
7
8namespace dw {
9namespace core {
10
179{
180public:
181 enum { END_OF_WORD = 1 << 30 };
182
183private:
185
186 // selection
187 enum {
192
195
196 // link handling
197 enum {
201
205
206 void resetSelection ();
207 void resetLink ();
208 void switchLinkToSelection (Iterator *it, int charPos);
209 void adjustSelection (Iterator *it, int charPos);
210 static int correctCharPos (DeepIterator *it, int charPos);
211
212 void highlight (bool fl, int dir)
213 { highlight0 (fl, from, fromChar, to, toChar, dir); }
214
215 void highlight0 (bool fl, DeepIterator *from, int fromChar,
216 DeepIterator *to, int toChar, int dir);
217 void copy ();
218
219public:
221
224
225 inline void setLayout (Layout *layout) { this->layout = layout; }
226 void reset ();
227 bool buttonPress (Iterator *it, int charPos, int linkNo,
228 EventButton *event);
229 bool buttonRelease (Iterator *it, int charPos, int linkNo,
230 EventButton *event);
231 bool buttonMotion (Iterator *it, int charPos, int linkNo,
232 EventMotion *event);
233
234 bool handleEvent (EventType eventType, Iterator *it, int charPos,
235 int linkNo, MousePositionEvent *event);
236};
237
238} // namespace core
239} // namespace dw
240
241#endif // __DW_SELECTION_H__
A stack of iterators, to iterate recursively through a widget tree.
Definition iterator.hh:147
Represents a button press or release event.
Definition events.hh:58
Represents a mouse motion event.
Definition events.hh:68
Iterators are used to iterate through the contents of a widget.
Definition iterator.hh:20
The central class for managing and drawing a widget tree.
Definition layout.hh:17
Base class for all mouse events related to a specific position.
Definition events.hh:49
This class handles selections, as well as activation of links, which is closely related.
Definition selection.hh:179
void setLayout(Layout *layout)
Definition selection.hh:225
void highlight(bool fl, int dir)
Definition selection.hh:212
enum dw::core::SelectionState::@16 selectionState
bool handleEvent(EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event)
General form of dw::core::SelectionState::buttonPress, dw::core::SelectionState::buttonRelease and dw...
Definition selection.cc:233
bool buttonPress(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition selection.cc:93
void adjustSelection(Iterator *it, int charPos)
This method is used by core::dw::SelectionState::buttonMotion and core::dw::SelectionState::buttonRel...
Definition selection.cc:293
bool buttonRelease(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition selection.cc:159
static int correctCharPos(DeepIterator *it, int charPos)
This method deals especially with the case that a widget passes dw::core::SelectionState::END_OF_WORD...
Definition selection.cc:356
enum dw::core::SelectionState::@17 linkState
bool buttonMotion(Iterator *it, int charPos, int linkNo, EventMotion *event)
Definition selection.cc:210
void switchLinkToSelection(Iterator *it, int charPos)
This method is called when the user decides not to activate a link, but instead select text.
Definition selection.cc:260
void highlight0(bool fl, DeepIterator *from, int fromChar, DeepIterator *to, int toChar, int dir)
Definition selection.cc:369
Dw is in this namespace, or sub namespaces of this one.