openclonk/src/platform/C4AppT.cpp

115 lines
2.8 KiB
C++
Raw Permalink Normal View History

2009-05-08 13:28:41 +00:00
/*
* OpenClonk, http://www.openclonk.org
*
* Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de/
2016-04-03 18:18:29 +00:00
* Copyright (c) 2009-2016, The OpenClonk Team and contributors
2009-05-08 13:28:41 +00:00
*
* Distributed under the terms of the ISC license; see accompanying file
* "COPYING" for details.
2009-05-08 13:28:41 +00:00
*
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
* See accompanying file "TRADEMARK" for details.
2009-05-08 13:28:41 +00:00
*
* To redistribute this file separately, substitute the full license texts
* for the above references.
2009-05-08 13:28:41 +00:00
*/
/* A wrapper class to OS dependent event and window interfaces, Text version */
#include "C4Include.h"
#include "platform/C4App.h"
#include "game/C4Application.h"
#include "graphics/C4Draw.h"
#include "platform/C4Window.h"
2009-05-08 13:28:41 +00:00
2011-08-27 14:20:39 +00:00
/* C4AbstractApp */
2009-05-08 13:28:41 +00:00
C4AbstractApp::C4AbstractApp()
2010-03-28 18:58:01 +00:00
// main thread
2009-05-08 13:28:41 +00:00
#ifdef HAVE_PTHREAD
: MainThread (pthread_self())
2009-05-08 13:28:41 +00:00
#endif
{
// C4StdInProc is broken on Windows
#ifndef STDSCHEDULER_USE_EVENTS
Add(&InProc);
#endif
2009-05-08 13:28:41 +00:00
}
2011-08-27 14:20:39 +00:00
C4AbstractApp::~C4AbstractApp()
2010-03-28 18:58:01 +00:00
{
Remove(&InProc);
2009-05-08 13:28:41 +00:00
}
2011-08-27 14:20:39 +00:00
bool C4AbstractApp::Init(int argc, char * argv[])
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
// Set locale
setlocale(LC_ALL,"");
// Custom initialization
return DoInit (argc, argv);
2009-05-08 13:28:41 +00:00
}
2011-08-27 14:20:39 +00:00
void C4AbstractApp::Clear()
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
}
2011-08-27 14:20:39 +00:00
void C4AbstractApp::Quit()
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
fQuitMsgReceived = true;
}
2011-08-27 14:20:39 +00:00
bool C4AbstractApp::GetIndexedDisplayMode(int32_t iIndex, int32_t *piXRes, int32_t *piYRes, int32_t *piBitDepth, int32_t *piRefreshRate, uint32_t iMonitor)
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
return false;
}
2011-08-27 14:20:39 +00:00
void C4AbstractApp::RestoreVideoMode() {}
2009-05-08 13:28:41 +00:00
bool C4AbstractApp::SetVideoMode(int, int, unsigned int, unsigned int, bool)
{
return true;
}
2009-05-08 13:28:41 +00:00
// Copy the text to the clipboard or the primary selection
2017-03-11 18:52:24 +00:00
bool C4AbstractApp::Copy(const std::string &text, bool fClipboard)
2010-03-28 18:58:01 +00:00
{
return false;
2009-05-08 13:28:41 +00:00
}
// Paste the text from the clipboard or the primary selection
2017-03-11 18:52:24 +00:00
std::string C4AbstractApp::Paste(bool fClipboard)
2010-03-28 18:58:01 +00:00
{
2017-03-11 18:52:24 +00:00
return std::string();
2009-05-08 13:28:41 +00:00
}
// Is there something in the clipboard?
2011-08-27 14:20:39 +00:00
bool C4AbstractApp::IsClipboardFull(bool fClipboard)
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
return false;
}
void C4AbstractApp::MessageDialog(const char * message) {}
2009-05-08 13:28:41 +00:00
2011-08-27 14:20:39 +00:00
bool C4AbstractApp::FlushMessages()
2009-05-08 13:28:41 +00:00
{
// Always fail after quit message
if (fQuitMsgReceived)
return false;
return true;
2009-05-08 13:28:41 +00:00
}
2011-08-27 21:12:01 +00:00
void C4Window::Clear() {}
C4Window::C4Window() = default;
C4Window::~C4Window() = default;
2011-08-27 21:12:01 +00:00
void C4Window::EnumerateMultiSamples(std::vector<int, std::allocator<int> >&) const {}
void C4Window::FlashWindow() {}
2016-02-12 21:40:55 +00:00
void C4Window::GrabMouse(bool) {}
bool C4Window::GetSize(C4Rect*) {return false;}
C4Window* C4Window::Init(C4Window::WindowKind, C4AbstractApp*, char const*, const C4Rect *) {return this;}
bool C4Window::ReInit(C4AbstractApp*) {return false;}
bool C4Window::RestorePosition(char const*, char const*, bool) {return false;}
2012-03-25 00:54:07 +00:00
void C4Window::RequestUpdate() {}
2011-08-27 21:12:01 +00:00
void C4Window::SetSize(unsigned int, unsigned int) {}
void C4Window::SetTitle(char const*) {}