From f81962dfef42a5f259b5cdfdb8990d254acddf1c Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 23 Apr 2020 18:25:00 +0100 Subject: [PATCH] Reorganise mouse data in Message objects --- boxx.cc | 6 +- vaudioselector.cc | 12 ++-- vchannellist.cc | 4 +- vepg.cc | 8 +-- vepglistadvanced.cc | 16 +++--- vepgsettimer.cc | 8 +-- vepgsummary.cc | 14 ++--- vmedialist.cc | 4 +- vopts.cc | 17 ++---- vpicturebanner.cc | 4 +- vquestion.cc | 8 +-- vradiorec.cc | 4 +- vrecmove.cc | 4 +- vrecording.cc | 15 +++-- vrecordinglist.cc | 4 +- vrecordingmenu.cc | 4 +- vserverselect.cc | 4 +- vtimeredit.cc | 4 +- vtimerlist.cc | 6 +- vvideolivetv.cc | 4 +- vvideomedia.cc | 4 +- vvideorec.cc | 4 +- vwelcome.cc | 4 +- winmain.cc | 128 ++++++++++++++++++++++++----------------- wremoteconfig.cc | 8 +-- wwinaudiofilter.cc | 8 +-- wwinmp3audiofilter.cc | 8 +-- wwinvideofilter.cc | 8 +-- wwinvideoh264filter.cc | 8 +-- 29 files changed, 174 insertions(+), 156 deletions(-) diff --git a/boxx.cc b/boxx.cc index f3f6aff..e0d092f 100644 --- a/boxx.cc +++ b/boxx.cc @@ -598,12 +598,12 @@ bool Boxx::mouseLBDOWN(int x, int y) bool Boxx::coordsOutsideBox(Message* m) { - /* Helper function to look at parameter in m, decode the x and y coords + /* Helper function to look at x and y in m * and see if the point is outside this Boxx's area */ - int x = (m->parameter >> 16) - getScreenX(); - int y = (m->parameter & 0xFFFF) - getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if ( (x < 0) || (y < 0) diff --git a/vaudioselector.cc b/vaudioselector.cc index de94e9c..142565d 100644 --- a/vaudioselector.cc +++ b/vaudioselector.cc @@ -534,7 +534,7 @@ void VAudioSelector::processMessage(Message* m) { int lastsel = asl.getCurrentOption(); - if (((m->parameter >> 16) - getScreenX()) < 200 && asl.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if ((m->parameter - getScreenX()) < 200 && asl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { editsubtitles = false; ssl.setDarkSelOption(true); @@ -559,7 +559,7 @@ void VAudioSelector::processMessage(Message* m) lastsel = ssl.getCurrentOption(); - if (ssl.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (ssl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { editsubtitles = true; ssl.setDarkSelOption(false); @@ -584,7 +584,7 @@ void VAudioSelector::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (asl.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (asl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { editsubtitles = false; ssl.setDarkSelOption(true); @@ -593,7 +593,7 @@ void VAudioSelector::processMessage(Message* m) ssl.draw(); BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } - else if (ssl.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + else if (ssl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { editsubtitles = true; ssl.setDarkSelOption(false); @@ -605,8 +605,8 @@ void VAudioSelector::processMessage(Message* m) else { //check if press is outside this view! then simulate cancel - int x = (m->parameter >> 16) - getScreenX(); - int y = (m->parameter & 0xFFFF) - getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x < 0 || y < 0 || x > static_cast(getWidth()) || y > static_cast(getHeight())) { diff --git a/vchannellist.cc b/vchannellist.cc index 7c33c16..8067efd 100644 --- a/vchannellist.cc +++ b/vchannellist.cc @@ -270,7 +270,7 @@ void VChannelList::processMessage(Message* m) } else */if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { quickUpdate(); boxstack->update(this); @@ -278,7 +278,7 @@ void VChannelList::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } diff --git a/vepg.cc b/vepg.cc index 72bd1f9..6607ee1 100644 --- a/vepg.cc +++ b/vepg.cc @@ -763,7 +763,7 @@ void VEpg::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (chanListbox.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (chanListbox.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { drawData(); boxstack->update(this); @@ -771,15 +771,15 @@ void VEpg::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (chanListbox.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (chanListbox.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); int keyx = chanListbox.getRootBoxOffsetX(); int keyy = chanListbox.getRootBoxOffsetY() + chanListbox.getHeight() + 2; diff --git a/vepglistadvanced.cc b/vepglistadvanced.cc index cd3c15c..ed01b89 100644 --- a/vepglistadvanced.cc +++ b/vepglistadvanced.cc @@ -921,7 +921,7 @@ void VEpgListAdvanced::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { quickUpdate(); boxstack->update(this); @@ -929,23 +929,25 @@ void VEpgListAdvanced::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); + if (sl.mouseLBDOWN(x, y)) { boxstack->handleCommand(Input::OK); //simulate OK press } - else if (boxRed.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + else if (boxRed.mouseLBDOWN(x, y)) { boxstack->handleCommand(Input::RED); } - else if (boxGreen.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + else if (boxGreen.mouseLBDOWN(x, y)) { - boxstack->handleCommand(Input::GREEN); + boxstack->handleCommand(Input::GREEN); // FIXME all these green? is this right? } - else if (boxYellow.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + else if (boxYellow.mouseLBDOWN(x, y)) { boxstack->handleCommand(Input::GREEN); } - else if (boxBlue.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + else if (boxBlue.mouseLBDOWN(x, y)) { boxstack->handleCommand(Input::GREEN); } diff --git a/vepgsettimer.cc b/vepgsettimer.cc index b6f74b3..59704d9 100644 --- a/vepgsettimer.cc +++ b/vepgsettimer.cc @@ -286,14 +286,14 @@ void VEpgSetTimer::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (buttonYes.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { buttonNo.setActive(0); selectedOption = YES; draw(); boxstack->update(this); } - else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + else if (buttonNo.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { buttonYes.setActive(0); selectedOption = NO; @@ -303,11 +303,11 @@ void VEpgSetTimer::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (buttonYes.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } - else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + else if (buttonNo.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } diff --git a/vepgsummary.cc b/vepgsummary.cc index 4262dc9..42fb17e 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -206,7 +206,7 @@ void VEpgSummary::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (tabbar.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->update(this); } @@ -214,8 +214,8 @@ void VEpgSummary::processMessage(Message* m) else if (m->message == Message::MOUSE_LBDOWN) { int cancel = true; - int x = (m->parameter >> 16) - getScreenX(); - int y = (m->parameter & 0xFFFF) - getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) && (boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) { @@ -224,7 +224,7 @@ void VEpgSummary::processMessage(Message* m) } - if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (cancel && tabbar.mouseLBDOWN(x, y)) { BoxStack::getInstance()->update(this); cancel = false; @@ -236,10 +236,10 @@ void VEpgSummary::processMessage(Message* m) BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press } } - } else if (m->message == Message::MOUSE_SCROLL) + } + else if (m->message == Message::MOUSE_SCROLL) { - if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(), - (short)(m->parameter >> 16), (short)(m->parameter & 0xFFFF))) + if (tabbar.mouseAndroidScroll(m->parameter - getScreenX(), m->tag - getScreenY(), 0, reinterpret_cast(m->data))) { BoxStack::getInstance()->update(this); return; diff --git a/vmedialist.cc b/vmedialist.cc index 1db39aa..47b21d2 100644 --- a/vmedialist.cc +++ b/vmedialist.cc @@ -1064,7 +1064,7 @@ void VMediaList::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.draw(); doShowingBar(); @@ -1074,7 +1074,7 @@ void VMediaList::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { updateSelection(); boxstack->handleCommand(Input::OK); //simulate OK press diff --git a/vopts.cc b/vopts.cc index 95c5fbf..8a96f73 100644 --- a/vopts.cc +++ b/vopts.cc @@ -492,19 +492,15 @@ void VOpts::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); - if (tabbar.mouseMove(x,y)) - { - BoxStack::getInstance()->update(this); - } - + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); + if (tabbar.mouseMove(x, y)) BoxStack::getInstance()->update(this); } else if (m->message == Message::MOUSE_LBDOWN) { - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); - if (tabbar.mouseLBDOWN(x,y)) + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); + if (tabbar.mouseLBDOWN(x, y)) { BoxStack::getInstance()->update(this); } @@ -514,4 +510,3 @@ void VOpts::processMessage(Message* m) } } } - diff --git a/vpicturebanner.cc b/vpicturebanner.cc index ad91656..5a99be4 100644 --- a/vpicturebanner.cc +++ b/vpicturebanner.cc @@ -104,8 +104,8 @@ void VPictureBanner::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - int x = (m->parameter >> 16) - getScreenX(); - int y = (m->parameter & 0xFFFF) - getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (coordsOutsideBox(m)) { diff --git a/vquestion.cc b/vquestion.cc index c0d0b87..d9f52eb 100644 --- a/vquestion.cc +++ b/vquestion.cc @@ -124,14 +124,14 @@ void VQuestion::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (buttonYes.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (buttonYes.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { buttonNo.setActive(0); selectedOption = YES; draw(); BoxStack::getInstance()->update(this); } - else if (buttonNo.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + else if (buttonNo.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { buttonYes.setActive(0); selectedOption = NO; @@ -141,11 +141,11 @@ void VQuestion::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (buttonYes.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (buttonYes.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } - else if (buttonNo.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + else if (buttonNo.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } diff --git a/vradiorec.cc b/vradiorec.cc index 71d243c..fc54662 100644 --- a/vradiorec.cc +++ b/vradiorec.cc @@ -274,8 +274,8 @@ void VRadioRec::processMessage(Message* m) { if (m->message == Message::MOUSE_LBDOWN) { - int x=(m->parameter>>16)-(int)getScreenX(); - int y=(m->parameter&0xFFFF)-(int)getScreenY(); + int x = m->parameter - (int)getScreenX(); + int y = m->tag - (int)getScreenY(); if (!barShowing) { boxstack->handleCommand(Input::OK); //simulate rok press diff --git a/vrecmove.cc b/vrecmove.cc index 425abdb..527dfdd 100644 --- a/vrecmove.cc +++ b/vrecmove.cc @@ -146,7 +146,7 @@ void VRecMove::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.draw(); BoxStack::getInstance()->update(this); @@ -154,7 +154,7 @@ void VRecMove::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } diff --git a/vrecording.cc b/vrecording.cc index 9c763cd..3ae8b98 100644 --- a/vrecording.cc +++ b/vrecording.cc @@ -373,20 +373,20 @@ void VRecording::processMessage(Message* m) { for (int i = PLAY; i < last; i++) { - if (button[i].mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (button[i].mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { for (int j = PLAY; j < last; j++) button[j].setActive(0); button[i].setActive(1); - tabbar.activateFocus(false); - buttons = true; + tabbar.activateFocus(false); + buttons = true; selected=i; draw(); BoxStack::getInstance()->update(this); break; } } - if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (tabbar.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->update(this); return; @@ -394,8 +394,7 @@ void VRecording::processMessage(Message* m) } else if (m->message == Message::MOUSE_SCROLL) { - if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(), - (short)(m->parameter >> 16), (short) (m->parameter & 0xFFFF))) + if (tabbar.mouseAndroidScroll(m->parameter - getScreenX(), m->tag - getScreenY(), 0, reinterpret_cast(m->data))) { BoxStack::getInstance()->update(this); return; @@ -406,7 +405,7 @@ void VRecording::processMessage(Message* m) int cancel = true; for (int i = PLAY; i < last; i++) { - if (button[i].mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (button[i].mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press buttons = true; @@ -414,7 +413,7 @@ void VRecording::processMessage(Message* m) break; } } - if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY())) + if (cancel && tabbar.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { buttons = false; button[selected].setActive(0); diff --git a/vrecordinglist.cc b/vrecordinglist.cc index cbbfe9b..a9b6caa 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -56,7 +56,7 @@ void VRecordingList::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { quickUpdate(); boxstack->update(this); @@ -64,7 +64,7 @@ void VRecordingList::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } diff --git a/vrecordingmenu.cc b/vrecordingmenu.cc index 7627ee2..06e108a 100644 --- a/vrecordingmenu.cc +++ b/vrecordingmenu.cc @@ -198,7 +198,7 @@ void VRecordingMenu::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.draw(); BoxStack::getInstance()->update(this); @@ -206,7 +206,7 @@ void VRecordingMenu::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } diff --git a/vserverselect.cc b/vserverselect.cc index 767a556..1f4175a 100644 --- a/vserverselect.cc +++ b/vserverselect.cc @@ -102,7 +102,7 @@ void VServerSelect::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.draw(); BoxStack::getInstance()->update(this); @@ -110,7 +110,7 @@ void VServerSelect::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } diff --git a/vtimeredit.cc b/vtimeredit.cc index 214cff8..dbc8fac 100644 --- a/vtimeredit.cc +++ b/vtimeredit.cc @@ -235,8 +235,8 @@ void VTimerEdit::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (buttonBack.mouseMove(x,y)) { selectedButton=0; buttonDelete.setActive(false); diff --git a/vtimerlist.cc b/vtimerlist.cc index 4b35947..d093e04 100644 --- a/vtimerlist.cc +++ b/vtimerlist.cc @@ -317,15 +317,15 @@ void VTimerList::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { - quickUpdate(); + quickUpdate(); BoxStack::getInstance()->update(this); } } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { BoxStack::getInstance()->handleCommand(Input::OK); //simulate OK press } diff --git a/vvideolivetv.cc b/vvideolivetv.cc index 2f3bb74..dcaaa04 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -1010,8 +1010,8 @@ void VVideoLiveTV::processMessage(Message* m) if (m->message == Message::MOUSE_LBDOWN) { //check if press is outside this view! then simulate cancel - int x = (m->parameter >> 16) - osd.getScreenX(); - int y = (m->parameter & 0xFFFF) - osd.getScreenY(); + int x = m->parameter - osd.getScreenX(); + int y = m->tag - osd.getScreenY(); if (osd.getVisible()) { if ((boxRed.getX()<=x) && (boxRed.getX()+(int)boxRed.getWidth()>=x ) && diff --git a/vvideomedia.cc b/vvideomedia.cc index 03d8558..ca02084 100644 --- a/vvideomedia.cc +++ b/vvideomedia.cc @@ -333,8 +333,8 @@ void VVideoMedia::processMessage(Message* m) if (m->message == Message::MOUSE_LBDOWN) { - UINT x = (m->parameter>>16) - getScreenX(); - UINT y = (m->parameter&0xFFFF) - getScreenY(); + UINT x = m->parameter - getScreenX(); + UINT y = m->tag - getScreenY(); if (!barShowing) { diff --git a/vvideorec.cc b/vvideorec.cc index 0be40e1..ebc076e 100644 --- a/vvideorec.cc +++ b/vvideorec.cc @@ -447,8 +447,8 @@ void VVideoRec::processMessage(Message* m) if (m->message == Message::MOUSE_LBDOWN) { - UINT x = (m->parameter>>16) - getScreenX(); - UINT y = (m->parameter&0xFFFF) - getScreenY(); + UINT x = m->parameter - getScreenX(); + UINT y = m->tag - getScreenY(); if (!barShowing) { diff --git a/vwelcome.cc b/vwelcome.cc index dc3655b..a3bace7 100644 --- a/vwelcome.cc +++ b/vwelcome.cc @@ -395,7 +395,7 @@ void VWelcome::processMessage(Message* m) { if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.draw(); boxstack->update(this); @@ -403,7 +403,7 @@ void VWelcome::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { boxstack->handleCommand(Input::OK); //simulate OK press } diff --git a/winmain.cc b/winmain.cc index 17b9b4a..53d24c2 100644 --- a/winmain.cc +++ b/winmain.cc @@ -540,26 +540,12 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam) return DefWindowProc(wind,msg,wparam, lparam); } break; - case WM_MOUSEMOVE: { - - lastmousemove=timeGetTime(); - SetCursor(LoadCursor(NULL,IDC_ARROW)); - SetTimer(wind,VOMP_CURSORUPDATE,4500,NULL); - POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)}; - ClientToScreen(wind,&mpos); - if (TranslateMousePosition(&mpos)) { - Message *mousemes=new Message(); - mousemes->message=Message::MOUSE_MOVE; - mousemes->from=NULL; - mousemes->p_to = Message::MOUSE_RECEIVER; - mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF); - mousemes->tag=0; - messageQueue->postMessage(mousemes); + case WM_CONTEXTMENU: + if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) { + return DefWindowProc(wind, msg, wparam, lparam); + } else { + return 0; } - - return 0; - //return DefWindowProc(wind,msg,wparam, lparam); - } break; case WM_TIMER: if (wparam==VOMP_CURSORUPDATE) { @@ -567,46 +553,82 @@ LONG FAR PASCAL WindowProc(HWND wind, UINT msg, WPARAM wparam, LPARAM lparam) return 0; } return DefWindowProc(wind, msg, wparam, lparam); - break; - case WM_CONTEXTMENU: - if (!ContextMenu(wind,GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam))) { - return DefWindowProc(wind, msg, wparam, lparam); - } else { - return 0; + + // Mouse events + // param = X + // tag = Y + // data = wheel delta + + case WM_MOUSEMOVE: + { + lastmousemove = timeGetTime(); + SetCursor(LoadCursor(NULL,IDC_ARROW)); + SetTimer(wind, VOMP_CURSORUPDATE, 4500, NULL); + POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) }; + ClientToScreen(wind, &mpos); + if (TranslateMousePosition(&mpos)) + { + Message* mousemes = new Message(); + mousemes->message = Message::MOUSE_MOVE; + mousemes->from = NULL; + mousemes->p_to = Message::MOUSE_RECEIVER; + mousemes->parameter = mpos.x; + mousemes->tag = mpos.y; + + //mousemes->parameter = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF); + //mousemes->tag = 0; + messageQueue->postMessage(mousemes); + } + //return DefWindowProc(wind,msg,wparam, lparam); + break; } - break; - case WM_LBUTTONDOWN:{ - POINT mpos={GET_X_LPARAM(lparam),GET_Y_LPARAM(lparam)}; - ClientToScreen(wind,&mpos); - if (TranslateMousePosition(&mpos)) { - Message *mousemes=new Message(); - mousemes->message=Message::MOUSE_LBDOWN; - mousemes->from=NULL; - mousemes->p_to = Message::MOUSE_RECEIVER; - mousemes->parameter=(mpos.x & 0xFFFF)<< 16| (mpos.y & 0xFFFF); - mousemes->tag=0; - messageQueue->postMessage(mousemes); + case WM_LBUTTONDOWN: + { + POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) }; + ClientToScreen(wind, &mpos); + if (TranslateMousePosition(&mpos)) + { + Message* mousemes = new Message(); + mousemes->message = Message::MOUSE_LBDOWN; + mousemes->from = NULL; + mousemes->p_to = Message::MOUSE_RECEIVER; + mousemes->parameter = mpos.x; + mousemes->tag = mpos.y; + + //mousemes->parameter = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF); + //mousemes->tag = 0; + messageQueue->postMessage(mousemes); + } + break; } - }break; - case WM_MOUSEWHEEL:{ - POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) }; - ClientToScreen(wind, &mpos); - if (TranslateMousePosition(&mpos)) { - Message *mousemes = new Message(); - mousemes->message = Message::MOUSE_SCROLL; - mousemes->from = NULL; + case WM_MOUSEWHEEL: + { + POINT mpos = { GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) }; + ClientToScreen(wind, &mpos); + if (TranslateMousePosition(&mpos)) + { + Message* mousemes = new Message(); + mousemes->message = Message::MOUSE_SCROLL; + mousemes->from = NULL; 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); - } + mousemes->parameter = mpos.x; + mousemes->tag = mpos.y; + mousemes->data = GET_WHEEL_DELTA_WPARAM(wparam) & 0xFFFF; // filter prob not necessary - } break; - default: - return DefWindowProc(wind, msg, wparam, lparam); + //mousemes->parameter = (0 & 0xFFFF) << 16 | (GET_WHEEL_DELTA_WPARAM(wparam) & 0xFFFF); + //mousemes->tag = (mpos.x & 0xFFFF) << 16 | (mpos.y & 0xFFFF); + messageQueue->postMessage(mousemes); + } + break; } - return 0L; + + + default: + return DefWindowProc(wind, msg, wparam, lparam); + } + + return 0L; } diff --git a/wremoteconfig.cc b/wremoteconfig.cc index fa5a13f..d7f1e0f 100644 --- a/wremoteconfig.cc +++ b/wremoteconfig.cc @@ -138,7 +138,7 @@ void WRemoteConfig::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.setShowSelOption(true); sl.draw(); @@ -147,15 +147,15 @@ void WRemoteConfig::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press diff --git a/wwinaudiofilter.cc b/wwinaudiofilter.cc index 9e1737c..f498ee1 100644 --- a/wwinaudiofilter.cc +++ b/wwinaudiofilter.cc @@ -135,7 +135,7 @@ void WWinAudioFilter::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.setShowSelOption(true); sl.draw(); @@ -145,15 +145,15 @@ void WWinAudioFilter::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press diff --git a/wwinmp3audiofilter.cc b/wwinmp3audiofilter.cc index 68e7019..2cbf964 100644 --- a/wwinmp3audiofilter.cc +++ b/wwinmp3audiofilter.cc @@ -143,7 +143,7 @@ void WWinMp3AudioFilter::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.setShowSelOption(true); sl.draw(); @@ -153,15 +153,15 @@ void WWinMp3AudioFilter::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press diff --git a/wwinvideofilter.cc b/wwinvideofilter.cc index 8dd34e6..95d2219 100644 --- a/wwinvideofilter.cc +++ b/wwinvideofilter.cc @@ -135,7 +135,7 @@ void WWinVideoFilter::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.setShowSelOption(true); sl.draw(); @@ -145,15 +145,15 @@ void WWinVideoFilter::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press diff --git a/wwinvideoh264filter.cc b/wwinvideoh264filter.cc index b82ccac..8e71e15 100644 --- a/wwinvideoh264filter.cc +++ b/wwinvideoh264filter.cc @@ -135,7 +135,7 @@ void WWinVideoH264Filter::processMessage(Message* m) if (m->message == Message::MOUSE_MOVE) { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseMove(m->parameter - getScreenX(), m->tag - getScreenY())) { sl.setShowSelOption(true); sl.draw(); @@ -145,15 +145,15 @@ void WWinVideoH264Filter::processMessage(Message* m) } else if (m->message == Message::MOUSE_LBDOWN) { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) + if (sl.mouseLBDOWN(m->parameter - getScreenX(), m->tag - getScreenY())) { ViewMan::getInstance()->handleCommand(Input::OK); //simulate OK press } else { //check if press is outside this view! then simulate cancel - int x=(m->parameter>>16)-getScreenX(); - int y=(m->parameter&0xFFFF)-getScreenY(); + int x = m->parameter - getScreenX(); + int y = m->tag - getScreenY(); if (x<0 || y <0 || x>getWidth() || y>getHeight()) { ViewMan::getInstance()->handleCommand(Input::BACK); //simulate cancel press -- 2.39.5