void BoxStack::processMessage(Message* m)
{
- if (m->to != this)
+ if ((m->p_to != Message::BOXSTACK) && (m->to != this))
{
for (int i = numBoxes-1; i >= 0; i--)
{
return;
}
- /* Handle mouse events*/
- // They come in with m->to = NULL? and just need to be delivered to top box?
- if ((numBoxes > 1) && ((m->message == Message::MOUSE_MOVE) || (m->message == Message::MOUSE_LBDOWN)
- || (m->message == Message::MOUSE_SCROLL)))
+ // Handle mouse events
+ // They just need to be delivered to top box
+ if (m->p_to == Message::MOUSE_RECEIVER)
{
- boxes[numBoxes-1]->processMessage(m);
+ if (numBoxes > 1) boxes[numBoxes-1]->processMessage(m);
return;
}
Message* m = new Message(); // break master loop
m->message = Message::SHUTDOWN;
- m->to = this;
+ m->p_to = Message::CONTROL;
postMessage(m);
}
logger->log("Command", Log::DEBUG, "processing message %i", m->message);
- if ((m->p_to == Message::CONTROL) || (m->to == this))
+ if ((m->p_to == Message::CONTROL) || (m->to == this)) // Maybe don't check m->to here? Always use predefined?
{
switch(m->message)
{
}
}
+/*
void Command::sig1()
{
#ifdef DEV
postMessage(m);
#endif
}
+*/
void Command::doStandby()
{
logger->unsetExternLogger();
Message* m = new Message(); // break into master mutex
m->message = Message::CONNECTION_LOST;
- m->to = this;
+ m->p_to = Message::CONTROL;
postMessage(m);
}
void doWallpaper();
void doFromTheTop(bool which); // true - show vinfo,wait. false - del vinfo,restart
void buildCrashedBox();
- void sig1();
+// void sig1();
void clearMQInputEvents();
static Command* instance;
{
NA = 0,
CONTROL,
- BOXSTACK
+ BOXSTACK,
+ MOUSE_RECEIVER
};
Message();
// Close me
m = new Message(); // Delete self
m->from = this;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m);
}
Message* m = new Message();
m->message = Message::ADD_VIEW;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
}
Message* m = new Message();
m->message = Message::ADD_VIEW;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
}
void VMediaView::sendViewMsg(Boxx *v) {
Message* m = new Message();
m->message = Message::CLOSE_ME;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->from = v;
m->parameter=(ULONG)v;
MessageQueue::getInstance()->postMessage(m);
// delete me!
Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->from = this;
MessageQueue::getInstance()->postMessage(m);
}
Message* m = new Message();
m->message = Message::CLOSE_ME;
m->from = this;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
MessageQueue::getInstance()->postMessage(m);
VInfo* vi = new VInfo();
m = new Message();
m->message = Message::ADD_VIEW;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
}
Message* m = new Message();
m->message = Message::ADD_VIEW;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
{
Message* m2 = new Message(); // Delete self
m2->from = this;
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
{
Message* m2 = new Message(); // Delete self
m2->from = this;
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
{
Message* m2 = new Message(); // Delete self
m2->from = this;
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
{
Message* m2 = new Message(); // Delete self
m2->from = this;
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
Message* m1 = new Message();
m1->message = Message::ADD_VIEW;
- m1->to = BoxStack::getInstance();
+ m1->p_to = Message::BOXSTACK;
m1->data = reinterpret_cast<void*>(count);
MessageQueue::getInstance()->postMessage(m1);
}
// delete me!
Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->from = this;
MessageQueue::getInstance()->postMessage(m);
}
// delete me!
Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->from = this;
MessageQueue::getInstance()->postMessage(m);
}
{
Message* m2 = new Message(); // Delete self
m2->from = this;
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
Message* m = new Message();
m->message = Message::CLOSE_ME;
m->from = this;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
MessageQueue::getInstance()->postMessage(m);
VInfo* vi = new VInfo();
m = new Message();
m->message = Message::ADD_VIEW;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
}
case PlayerMedia::STREAM_END:
{
Message* m2 = new Message(); // Must be done after this thread finishes, and must break into master mutex
- m2->to = BoxStack::getInstance();
+ m2->p_to = Message::BOXSTACK;
m2->message = Message::CLOSE_ME;
MessageQueue::getInstance()->postMessage(m2);
break;
Message* m = new Message();
m->message = Message::CLOSE_ME;
m->from = this;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
MessageQueue::getInstance()->postMessage(m);
VInfo* vi = new VInfo();
m = new Message();
m->message = Message::ADD_VIEW;
- m->to = boxstack;
+ m->p_to = Message::BOXSTACK;
m->data = reinterpret_cast<void*>(vi);
MessageQueue::getInstance()->postMessage(m);
}
// delete me!
Message* m = new Message(); // Delete self
m->message = Message::CLOSE_ME;
- m->to = BoxStack::getInstance();
+ m->p_to = Message::BOXSTACK;
m->from = this;
MessageQueue::getInstance()->postMessage(m);
}
Message *mousemes=new Message();
mousemes->message=Message::MOUSE_MOVE;
mousemes->from=NULL;
- mousemes->to=BoxStack::getInstance();
+ mousemes->p_to = Message::MOUSE_RECEIVER;
mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
mousemes->tag=0;
messageQueue->postMessage(mousemes);
Message *mousemes=new Message();
mousemes->message=Message::MOUSE_LBDOWN;
mousemes->from=NULL;
- mousemes->to=BoxStack::getInstance();
+ mousemes->p_to = Message::MOUSE_RECEIVER;
mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF);
mousemes->tag=0;
messageQueue->postMessage(mousemes);
Message *mousemes = new Message();
mousemes->message = Message::MOUSE_SCROLL;
mousemes->from = NULL;
- mousemes->to = BoxStack::getInstance();
+ mousemes->p_to = Message::MOUSE_RECEIVER;
mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) &0xFFFF);
mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF);
messageQueue->postMessage(mousemes);