From 1fefbcd8731981cc6fe95938e3b0476af4f37553 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Wed, 23 Oct 2019 17:42:38 +0100 Subject: [PATCH] Two Windows compilation fixes, remove vremoteconfig class --- tcp.cc | 6 +- vdp6.cc | 4 +- vremoteconfig.cc | 270 ----------------------------------------------- vremoteconfig.h | 58 ---------- 4 files changed, 5 insertions(+), 333 deletions(-) delete mode 100644 vremoteconfig.cc delete mode 100644 vremoteconfig.h diff --git a/tcp.cc b/tcp.cc index fb66ace..f5c8e5b 100644 --- a/tcp.cc +++ b/tcp.cc @@ -19,12 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef WIN32 +#include +#else #include #include #include - -#ifdef WIN32 -#include #endif #include "log.h" diff --git a/vdp6.cc b/vdp6.cc index 69d70d3..5fb4daa 100644 --- a/vdp6.cc +++ b/vdp6.cc @@ -17,6 +17,8 @@ along with VOMP. If not, see . */ +#if IPV6 + #include #include #include @@ -33,8 +35,6 @@ #include "log.h" #include "vdp6.h" -#if IPV6 - VDP6::VDP6() { } diff --git a/vremoteconfig.cc b/vremoteconfig.cc deleted file mode 100644 index 8630e6a..0000000 --- a/vremoteconfig.cc +++ /dev/null @@ -1,270 +0,0 @@ -/* - Copyright 2004-2007 Chris Tallon, Marten Richter - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "vremoteconfig.h" - -#include "remote.h" -#include "wsymbol.h" -#include "viewman.h" -#include "vdr.h" -#include "colour.h" -#include "video.h" -#include "i18n.h" -#include "command.h" -#include "message.h" - -VRemoteConfig::VRemoteConfig(void* tparent) -{ - parent = tparent; - viewman = ViewMan::getInstance(); - remote = Remote::getInstance(); - learnmode = false; - - - create(530, 320); - if (Video::getInstance()->getFormat() == Video::PAL) - { - setScreenPos(80, 70); - } - else - { - setScreenPos(70, 35); - } - - setBackgroundColour(Colour::VIEWBACKGROUND); - setTitleBarOn(1); - setTitleBarColour(Colour::TITLEBARBACKGROUND); - setTitleText(tr("Remote control")); - - - - initSelectList(true); - sl.setShowSelOption(false); - - - -} - -VRemoteConfig::~VRemoteConfig() -{ - -} - -void VRemoteConfig::initSelectList(bool startup) -{ - ULONG selection=0; - ULONG top=0; - if (!startup) - { - selection=sl.getCurrentOption(); - top=sl.getTopOption(); - - } -// sl.setSurface(surface); -// sl.setSurfaceOffset(10, 40); -// sl.setDimensions(area.w - 20, area.h - 30 - 15 -30 ); - sl.clear(); - sl.addColumn(0); - sl.addColumn(150); - sl.addColumn(300); - ULONG i; - for (i = 0; i < 256;i++) - { - const char * name = remote->CommandDesc((UCHAR)i); - if (name != NULL) - { - char *line = remote->CommandTranslateStr((UCHAR)i); - // char * desc=new char [strlen(line)+1]; // CJT memory leak and unneccessary? - // strcpy(desc,line); - sl.addOption(line,i,0); - } - } - if (!startup) - { - sl.hintSetCurrent(selection); - sl.hintSetTop(top); - } -} - - -void VRemoteConfig::draw() -{ - View::draw(); - - drawText(tr("Command"), 15, 15, Colour::LIGHTTEXT); - drawText(tr("Hard wired"), 165, 15, Colour::LIGHTTEXT); - drawText(tr("User assignable"), 315, 15, Colour::LIGHTTEXT); - sl.draw(); - if (learnmode) - { - drawText(tr("Learning! Press any hardwired key to exit."), 15, area.h - 30, Colour::SELECTHIGHLIGHT); - } - else - { - drawText(tr("Press [ok] for learning or MENU to reset to defaults."), 15, area.h - 30, Colour::LIGHTTEXT); - } - - - - -} - - -void VRemoteConfig::processMessage(Message* m) -{ - Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message); - - if (m->message == Message::MOUSE_MOVE) - { - if (sl.mouseMove((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) - { - sl.setShowSelOption(true); - sl.draw(); - viewman->updateView(this); - } - } - else if (m->message == Message::MOUSE_LBDOWN) - { - if (sl.mouseLBDOWN((m->parameter>>16)-getScreenX(),(m->parameter&0xFFFF)-getScreenY())) - { - ViewMan::getInstance()->handleCommand(Remote::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(); - if (x<0 || y <0 || x>getWidth() || y>getHeight()) - { - ViewMan::getInstance()->handleCommand(Remote::BACK); //simulate cancel press - } - } - } -} - -void VRemoteConfig::doSave() -{ - Message* m = new Message(); - m->message = Message::CHANGED_REMOTECONTROL; - m->to = parent; - m->parameter = 0; - Command::getInstance()->postMessageNoLock(m); -} - -int VRemoteConfig::handleCommand(int command) -{ - if (learnmode) - { - learnmode = false; - if (command == Remote::NA_LEARN) - { - initSelectList(false); - } - draw(); - viewman->updateView(this); - return 2; - } - switch(command) - { - case Remote::DF_UP: - case Remote::UP: - { - if (sl.getCurrentOption() != 0) - { - sl.up(); - sl.setShowSelOption(true); - draw(); - viewman->updateView(this); - return 2; - } - else - { - sl.setShowSelOption(false); - return 0; //Control to tab control - } - } - case Remote::DF_DOWN: - case Remote::DOWN: - { - sl.down(); - sl.setShowSelOption(true); - draw(); - viewman->updateView(this); - return 2; - } - case Remote::SKIPBACK: - { - sl.pageUp(); - sl.draw(); - - - viewman->updateView(this); - return 2; - } - case Remote::SKIPFORWARD: - { - sl.pageDown(); - sl.draw(); - - - viewman->updateView(this); - return 2; - } - case Remote::OK: - { - learnmode = true; - draw(); - remote->EnterLearningMode(sl.getCurrentOptionData()); - viewman->updateView(this); - return 2; - } - case Remote::BACK: - { - doSave(); - - // Instead of returning 4 here which would delete this view - // before the doSave message is processed, let the message queue - // do the doSave then this close message. That will make the options menu - // disappear before this view - - Message* m = new Message(); - m->message = Message::CLOSE_ME; - m->from = this; - m->to = viewman; - Command::getInstance()->postMessageNoLock(m); - return 2; - - } - case Remote::MENU: - { - remote->ResetToDefault(); - initSelectList(false); - draw(); - viewman->updateView(this); - return 2; - } - - - } - // stop command getting to any more views - return 1; -} - - diff --git a/vremoteconfig.h b/vremoteconfig.h deleted file mode 100644 index 9c9cc80..0000000 --- a/vremoteconfig.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2004-2005 Chris Tallon - - This file is part of VOMP. - - VOMP is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - VOMP is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with VOMP; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef VREMOTECONFIG_H -#define VREMOTECONFIG_H - -#include -#include -#include -#include -#include - -#include "view.h" -#include "wselectlist.h" - -class Remote; -class Message; - -class VRemoteConfig : public View -{ - public: - VRemoteConfig (void* tparent); - ~VRemoteConfig (); - - int handleCommand(int command); - void processMessage(Message* m); - void draw(); - - - private: - WSelectList sl; - Remote *remote; - bool learnmode; - void initSelectList(bool startup); - void doSave(); - void* parent; - -}; - -#endif - -- 2.39.2