diff options
author | corvid <corvid@lavabit.com> | 2009-10-29 03:37:12 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-10-29 03:37:12 +0000 |
commit | 80c557e230bda1f68a8c3adcfd51981c814c1b12 (patch) | |
tree | 133dddb5f9dce28edc5e80285d0dc70ca5a7a505 /dw/widget.cc | |
parent | 29de414515b2e79ca975d21a99235ebbb4f0801b (diff) |
rm event emitter/receiver from Widget
If we want it back someday, we know where to find it.
Given the coarse-grained nature of Textblock, I imagine that whatever
Dillo might use in a javascript future would be somewhat different anyway.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 109 |
1 files changed, 3 insertions, 106 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index 531a25f3..670e2c43 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -30,101 +30,6 @@ using namespace lout::object; namespace dw { namespace core { -bool Widget::EventReceiver::buttonPress (Widget *widget, EventButton *event) -{ - return false; -} - -bool Widget::EventReceiver::buttonRelease (Widget *widget, EventButton *event) -{ - return false; -} - -bool Widget::EventReceiver::motionNotify (Widget *widget, EventMotion *event) -{ - return false; -} - -void Widget::EventReceiver::enterNotify (Widget *widget, EventCrossing *event) -{ -} - -void Widget::EventReceiver::leaveNotify (Widget *widget, EventCrossing *event) -{ -} - - -bool Widget::EventEmitter::emitToReceiver (lout::signal::Receiver *receiver, - int signalNo, int argc, - lout::object::Object **argv) -{ - EventReceiver *eventReceiver = (EventReceiver*)receiver; - - switch (signalNo) { - case BUTTON_PRESS: - return eventReceiver->buttonPress ((Widget*)argv[0], - (EventButton*)argv[1]); - - case BUTTON_RELEASE: - return eventReceiver->buttonRelease ((Widget*)argv[0], - (EventButton*)argv[1]); - - case MOTION_NOTIFY: - return eventReceiver->motionNotify ((Widget*)argv[0], - (EventMotion*)argv[1]); - - case ENTER_NOTIFY: - eventReceiver->enterNotify ((Widget*)argv[0], - (EventCrossing*)argv[1]); - break; - - case LEAVE_NOTIFY: - eventReceiver->leaveNotify ((Widget*)argv[1], - (EventCrossing*)argv[0]); - break; - - default: - misc::assertNotReached (); - } - - /* Compiler happiness. */ - return false; -} - -bool Widget::EventEmitter::emitButtonPress (Widget *widget, EventButton *event) -{ - Object *argv[2] = { widget, event }; - return emitBool (BUTTON_PRESS, 2, argv); -} - -bool Widget::EventEmitter::emitButtonRelease (Widget *widget, - EventButton *event) -{ - Object *argv[2] = { widget, event }; - return emitBool (BUTTON_RELEASE, 2, argv); -} - -bool Widget::EventEmitter::emitMotionNotify (Widget *widget, - EventMotion *event) -{ - Object *argv[2] = { widget, event }; - return emitBool (MOTION_NOTIFY, 2, argv); -} - -void Widget::EventEmitter::emitEnterNotify (Widget *widget, - EventCrossing *event) -{ - Object *argv[2] = { widget, event }; - emitVoid (ENTER_NOTIFY, 2, argv); -} - -void Widget::EventEmitter::emitLeaveNotify (Widget *widget, - EventCrossing *event) -{ - Object *argv[2] = { widget, event }; - emitVoid (LEAVE_NOTIFY, 2, argv); -} - // ---------------------------------------------------------------------- int Widget::CLASS_ID = -1; @@ -353,35 +258,27 @@ void Widget::sizeAllocate (Allocation *allocation) bool Widget::buttonPress (EventButton *event) { - bool b1 = buttonPressImpl (event); - bool b2 = eventEmitter.emitButtonPress (this, event); - return b1 || b2; + return buttonPressImpl (event); } bool Widget::buttonRelease (EventButton *event) { - bool b1 = buttonReleaseImpl (event); - bool b2 = eventEmitter.emitButtonRelease (this, event); - return b1 || b2; + return buttonReleaseImpl (event); } bool Widget::motionNotify (EventMotion *event) { - bool b1 = motionNotifyImpl (event); - bool b2 = eventEmitter.emitMotionNotify (this, event); - return b1 || b2; + return motionNotifyImpl (event); } void Widget::enterNotify (EventCrossing *event) { enterNotifyImpl (event); - eventEmitter.emitEnterNotify (this, event); } void Widget::leaveNotify (EventCrossing *event) { leaveNotifyImpl (event); - eventEmitter.emitLeaveNotify (this, event); } /** |