23#include "../lout/debug.hh"
32extern "C" char *
strndup(
const char *s,
size_t size)
34 char *r = (
char *) malloc (size + 1);
99 DBG_OBJ_ENTER (
"events", 0,
"buttonPress",
"[%s], %d, %d, ...",
111 }
else if (linkNo != -1) {
134 }
else if (event->
button == 1) {
154 DBG_OBJ_MSGF (
"events", 1,
"=> %s", ret ?
"true" :
"false");
165 DBG_OBJ_ENTER (
"events", 0,
"buttonRelease",
"[%s], %d, %d, ...",
205 DBG_OBJ_MSGF (
"events", 1,
"=> %s", ret ?
"true" :
"false");
234 int charPos,
int linkNo,
296 int newToChar, cmpOld, cmpNew, cmpDiff, len;
297 bool bruteHighlighting =
false;
305 if (cmpOld == 0 || cmpNew == 0) {
308 bruteHighlighting =
true;
309 }
else if (cmpOld * cmpNew < 0) {
312 bruteHighlighting =
true;
317 if (cmpOld * cmpDiff > 0) {
326 if (cmpOld * cmpDiff < 0) {
341 if (bruteHighlighting)
348 if (bruteHighlighting)
373 int cmp, aChar, bChar;
403 i->
next (), start =
false) {
409 }
else if (cmp == 0) {
430 int cmp, aChar, bChar;
462 i->
next (), start =
false) {
470 }
else if (cmp == 0) {
A stack of iterators, to iterate recursively through a widget tree.
DeepIterator * cloneDeepIterator()
DeepIterator * createVariant(Iterator *it)
void highlight(int start, int end, HighlightLayer layer)
Highlight a part of the current content.
int compareTo(lout::object::Comparable *other)
Compare two objects, this and other.
bool next()
Move iterator forward and store content it.
Iterator * getTopIterator()
void unhighlight(int direction, HighlightLayer layer)
Represents a mouse motion event.
Iterators are used to iterate through the contents of a widget.
void intoStringBuffer(lout::misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
bool emitLinkRelease(Widget *w, int link, int img, int x, int y, EventButton *event)
bool emitLinkClick(Widget *w, int link, int img, int x, int y, EventButton *event)
bool emitLinkPress(Widget *w, int link, int img, int x, int y, EventButton *event)
void copySelection(const char *text)
Base class for all mouse events related to a specific position.
void highlight(bool fl, int dir)
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...
bool buttonPress(Iterator *it, int charPos, int linkNo, EventButton *event)
void adjustSelection(Iterator *it, int charPos)
This method is used by core::dw::SelectionState::buttonMotion and core::dw::SelectionState::buttonRel...
bool buttonRelease(Iterator *it, int charPos, int linkNo, EventButton *event)
static int correctCharPos(DeepIterator *it, int charPos)
This method deals especially with the case that a widget passes dw::core::SelectionState::END_OF_WORD...
enum dw::core::SelectionState::@17 linkState
bool buttonMotion(Iterator *it, int charPos, int linkNo, EventMotion *event)
void switchLinkToSelection(Iterator *it, int charPos)
This method is called when the user decides not to activate a link, but instead select text.
void highlight0(bool fl, DeepIterator *from, int fromChar, DeepIterator *to, int toChar, int dir)
A class for fast concatenation of a large number of strings.
void append(const char *str)
Append a NUL-terminated string to the buffer, with copying.
void appendNoCopy(char *str)
Append a NUL-terminated string to the buffer, without copying.
const char * getChars()
Return a NUL-terminated strings containing all appended strings.
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_MSGF(aspect, prio, fmt,...)
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
Dw is in this namespace, or sub namespaces of this one.
char * strndup(const char *s, size_t size)