diff options
author | corvid <corvid@lavabit.com> | 2009-10-29 02:21:08 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-10-29 02:21:08 +0000 |
commit | 21f85b39f22ff0f5cd373a4cfedba115ee533e98 (patch) | |
tree | 2f0f83b174694e8bca454480942bc0f1bcdec799 /dw/widget.hh | |
parent | 2949961d999576c217bb5be79fd643d53eb6698a (diff) |
move link signal emitter/receiver from Widget to Layout
http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-October/006936.html
Diffstat (limited to 'dw/widget.hh')
-rw-r--r-- | dw/widget.hh | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/dw/widget.hh b/dw/widget.hh index 56f115f6..b21415bb 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -35,80 +35,6 @@ public: virtual void leaveNotify (Widget *widget, EventCrossing *event); }; - /** - * \brief This receiver is for signals related to HTML pages. - * - * The \em link argument to all signals defines a number, which has - * been passed before, e.g. by setting dw::core::style::Style::x_link. - * When defining this number (e.g in dw::core::style::Style::x_link), - * and when receiving the signal, the caller must interpret these numbers - * in a consistent way. In the HTML link block, this number is an index - * to an array of URLs. - * - * \em link = -1 represents an undefined link. - * - * The \em img argument to all signals defines a number which has - * been passed before, e.g. by setting dw::core::style::Style::x_img. - * When defining this number (e.g in dw::core::style::Style::x_img), - * and when receiving the signal, the caller must interpret these numbers - * in a consistent way. In the HTML link block, this number is an index - * to an array of structures containing image information. - * - * \em img = -1 represents an undefined image. - * - * \em x and \em y define the coordinates within the link area. They are - * only used for server-side image maps, see dw::Image. - * - * \sa dw::Image, dw::Textblock - */ - class LinkReceiver: public lout::signal::Receiver - { - public: - /** - * \brief Called, when a link is entered, left, or the position has - * changed. - * - * When a link is entered, this method is called with the respective - * arguments. When a link is left, this method is called with all - * three arguments (\em link, \em x, \em y) set to -1. - * - * When coordinates are supported, a change of the coordinates also - * causes emitting this signal. - */ - virtual bool enter (Widget *widget, int link, int img, int x, int y); - - /** - * \brief Called, when the user has pressed the mouse button on a - * link (but not yet released). - * - * The causing event is passed as \em event. - */ - virtual bool press (Widget *widget, int link, int img, int x, int y, - EventButton *event); - - /** - * \brief Called, when the user has released the mouse button on a - * link. - * - * The causing event is passed as \em event. - */ - virtual bool release (Widget *widget, int link, int img, int x, int y, - EventButton *event); - - /** - * \brief Called, when the user has clicked on a link. - * - * For mouse interaction, this is equivalent to "press" and "release" - * on the same link. In this case, \em event contains the "release" - * event. - * - * When activating links via keyboard is supported, only a "clicked" - * signal will be emitted, and \em event will be NULL. - */ - virtual bool click (Widget *widget, int link, int img, int x, int y, - EventButton *event); - }; - private: class EventEmitter: public lout::signal::Emitter { @@ -131,27 +57,6 @@ private: void emitLeaveNotify (Widget *widget, EventCrossing *event); }; - class LinkEmitter: public lout::signal::Emitter - { - private: - enum { ENTER, PRESS, RELEASE, CLICK }; - - protected: - bool emitToReceiver (lout::signal::Receiver *receiver, int signalNo, - int argc, lout::object::Object **argv); - - public: - inline void connectLink (LinkReceiver *receiver) { connect (receiver); } - - bool emitEnter (Widget *widget, int link, int img, int x, int y); - bool emitPress (Widget *widget, int link, int img, int x, int y, - EventButton *event); - bool emitRelease (Widget *widget, int link, int img, int x, int y, - EventButton *event); - bool emitClick (Widget *widget, int link, int img, int x, int y, - EventButton *event); - }; - EventEmitter eventEmitter; style::Style *style; @@ -248,7 +153,6 @@ public: int parentRef; protected: - LinkEmitter linkEmitter; /** * \brief The current allocation: size and position, always relative to the @@ -373,24 +277,6 @@ public: inline void connectEvent (EventReceiver *receiver) { eventEmitter.connectEvent (receiver); } - inline void connectLink (LinkReceiver *receiver) - { linkEmitter.connectLink (receiver); } - - inline bool emitLinkEnter (int link, int img, int x, int y) - { return linkEmitter.emitEnter (this, link, img, x, y); } - - inline bool emitLinkPress (int link, int img, - int x, int y, EventButton *event) - { return linkEmitter.emitPress (this, link, img, x, y, event); } - - inline bool emitLinkRelease (int link, int img, - int x, int y, EventButton *event) - { return linkEmitter.emitRelease (this, link, img, x, y, event); } - - inline bool emitLinkClick (int link, int img, - int x, int y, EventButton *event) - { return linkEmitter.emitClick (this, link, img, x, y, event); } - inline bool usesHints () { return flags & USES_HINTS; } inline bool hasContents () { return flags & HAS_CONTENTS; } |