openclonk/src/platform/C4AppT.cpp

120 lines
3.1 KiB
C++
Raw Normal View History

2009-05-08 13:28:41 +00:00
/*
* OpenClonk, http://www.openclonk.org
*
* Copyright (c) 2005 Peter Wortmann
2013-01-09 23:23:06 +00:00
* Copyright (c) 2005-2006, 2008-2009, 2011-2012 Günther Brammer
* Copyright (c) 2006 Armin Burgmeier
* Copyright (c) 2009 Nicolas Hake
* Copyright (c) 2010 Benjamin Herr
2009-05-08 13:28:41 +00:00
* Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de
*
* Portions might be copyrighted by other authors who have contributed
* to OpenClonk.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
* See isc_license.txt for full license and disclaimer.
*
* "Clonk" is a registered trademark of Matthes Bender.
* See clonk_trademark_license.txt for full license.
*/
/* A wrapper class to OS dependent event and window interfaces, Text version */
#include <C4Include.h>
#include "C4App.h"
#include <C4Window.h>
#include <C4Draw.h>
#include <C4Application.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
2011-08-27 14:20:39 +00:00
C4AbstractApp::C4AbstractApp(): Active(false), fQuitMsgReceived(false),
2010-03-28 18:58:01 +00:00
// main thread
2009-05-08 13:28:41 +00:00
#ifdef HAVE_PTHREAD
2010-03-28 18:58:01 +00:00
MainThread (pthread_self()),
2009-05-08 13:28:41 +00:00
#endif
2010-03-28 18:58:01 +00:00
fDspModeSet(false)
2009-05-08 13:28:41 +00:00
{
Add(&InProc);
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(unsigned int, unsigned int, unsigned 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
2011-08-27 14:20:39 +00:00
bool C4AbstractApp::Copy(const StdStrBuf & 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
2011-08-27 14:20:39 +00:00
StdStrBuf C4AbstractApp::Paste(bool fClipboard)
2010-03-28 18:58:01 +00:00
{
2009-05-08 13:28:41 +00:00
return StdStrBuf("");
}
// 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;
}
bool C4AbstractApp::ApplyGammaRamp(_GAMMARAMP&, bool) { return true; }
bool C4AbstractApp::SaveDefaultGammaRamp(_GAMMARAMP&) { return true; }
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() {}
C4Window::~C4Window() {}
void C4Window::EnumerateMultiSamples(std::vector<int, std::allocator<int> >&) const {}
void C4Window::FlashWindow() {}
bool C4Window::GetSize(C4Rect*) {return 0;}
C4Window* C4Window::Init(C4Window::WindowKind, C4AbstractApp*, char const*, const C4Rect *) {return this;}
2011-08-27 21:12:01 +00:00
bool C4Window::ReInit(C4AbstractApp*) {return 0;}
bool C4Window::RestorePosition(char const*, char const*, bool) {return 0;}
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*) {}