Просмотр исходного кода

Switch core to lowercase namespace

Daniele Bartolini 13 лет назад
Родитель
Сommit
662a99c6b8

+ 0 - 154
src/RenderWindow.cpp

@@ -1,154 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include "RenderWindow.h"
-#include "Types.h"
-#include "Config.h"
-
-#if defined(LINUX) && defined(CROWN_USE_OPENGL)
-	#include "GLXRenderWindow.h"
-#elif defined(WINDOWS) && defined(CROWN_USE_OPENGL)
-	#include "WGLRenderWindow.h"
-#elif defined(LINUX) && defined(CROWN_USE_OPENGLES)
-	#include "EGLRenderWindow.h"
-#elif defined(CROWN_OS_ANDROID)
-	#include "AndroidRenderWindow.h"
-#endif
-
-namespace Crown
-{
-
-RenderWindow* RenderWindow::CreateWindow(uint x, uint y, uint width, uint height, uint depth, bool fullscreen)
-{
-	RenderWindow* window = NULL;
-
-	#if defined(LINUX) && defined(CROWN_USE_OPENGL)
-		window = new GLXRenderWindow;
-	#elif defined(WINDOWS) && defined(CROWN_USE_OPENGL)
-		window = new WGLRenderWindow;
-	#elif defined(LINUX) && defined(CROWN_USE_OPENGLES)
-		window = new EGLRenderWindow;
-	#elif defined(CROWN_OS_ANDROID)
-		window = new AndroidRenderWindow;
-	#endif
-
-	if (window)
-	{
-		window->Create(x, y, width, height, depth, fullscreen);
-	}
-
-	return window;
-}
-
-void RenderWindow::DestroyWindow(RenderWindow* window)
-{
-	if (!window)
-	{
-		throw NullPointerException("RenderWindow::DestroyWindow: window == NULL");
-	}
-
-	window->Destroy();
-
-	delete window;
-}
-
-RenderWindow::RenderWindow() :
-	mX(0), mY(0),
-	mWidth(0), mHeight(0),
-	mVisible(false),
-	mActive(false),
-	mFull(false),
-	mCreated(false),
-	mMain(false),
-	mTitle("Crown"),
-	mAdditionalTitleText("")
-{
-}
-
-RenderWindow::~RenderWindow()
-{
-}
-
-bool RenderWindow::IsMain() const
-{
-	return mMain;
-}
-
-void RenderWindow::_SetMain(bool main)
-{
-	mMain = main;
-}
-
-bool RenderWindow::IsVisible() const
-{
-	return mVisible;
-}
-
-void RenderWindow::GetPosition(uint& x, uint& y)
-{
-	x = mX;
-	y = mY;
-}
-
-void RenderWindow::GetMetrics(uint& width, uint& height) const
-{
-	width = mWidth;
-	height = mHeight;
-}
-
-bool RenderWindow::IsFullscreen() const
-{
-	return mFull;
-}
-
-const Str& RenderWindow::GetTitle() const
-{
-	return mTitle;
-}
-
-void RenderWindow::SetTitle(const Str& title)
-{
-	mTitle = title;
-	_SetTitleAndAdditionalTextToWindow();
-}
-
-const Str& RenderWindow::GetAdditionalTitleText() const
-{
-	return mAdditionalTitleText;
-}
-
-void RenderWindow::SetAdditionalTitleText(const Str& text)
-{
-	mAdditionalTitleText = text;
-	_SetTitleAndAdditionalTextToWindow();
-}
-
-Str RenderWindow::GetDisplayedTitle() const
-{
-	return mTitle + Str(" - ") + mAdditionalTitleText;
-}
-
-} // namespace Crown
-

+ 0 - 95
src/RenderWindow.h

@@ -1,95 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "Types.h"
-#include "Str.h"
-
-namespace Crown
-{
-
-/**
-	Rendering window interface.
-
-	The primary target for render operations.
-*/
-class RenderWindow
-{
-
-public:
-
-	static RenderWindow*	CreateWindow(uint x, uint y, uint width, uint height, uint depth, bool fullscreen);
-	static void				DestroyWindow(RenderWindow* window);
-
-							RenderWindow();									//!< Constructor
-	virtual					~RenderWindow();								//!< Destructor
-
-	virtual bool			Create(uint x, uint y, uint width, uint height, uint depth, bool fullscreen) = 0;	//! Creates the window
-	virtual void			Destroy() = 0;									//!< Destroys the window
-
-	virtual bool			IsMain() const;									//!< Returns whether is the main
-	virtual bool			IsVisible() const;								//!< Returns whether is visible
-	virtual void			SetVisible(bool visible) = 0;					//!< Sets whether is visible
-
-	virtual void			GetPosition(uint& x, uint& y);					//!< Returns the position
-	virtual void			Move(uint x, uint y) = 0;						//!< Sets the position
-
-	virtual void			GetMetrics(uint& width, uint& height) const;	//!< Returns width and height
-	virtual void			Resize(uint width, uint height) = 0;			//!< Sets width and height
-
-	virtual bool			IsFullscreen() const;							//!< Returns whether in fullscreen
-	virtual void			SetFullscreen(bool full) = 0;					//!< Switches to fullscreen
-
-	const Str&				GetTitle() const;								//!< Returns the title
-	void					SetTitle(const Str& title);						//!< Sets the title
-	const Str&				GetAdditionalTitleText() const;					//!< Get the additional title text
-	void					SetAdditionalTitleText(const Str& title);		//!< Set the additional title text
-	Str						GetDisplayedTitle() const;						//!< Returns the actual title
-
-	virtual void			Update() = 0;									//!< Updates displayed content
-	virtual void			EventLoop() = 0;								//!< Manages window events
-
-protected:
-
-	void					_SetMain(bool main);							//!< Sets as the main window, only Device should use it
-
-	uint					mX, mY;
-	uint					mWidth, mHeight;
-	bool					mVisible;
-	bool					mActive;
-	bool					mFull;
-	bool					mCreated;
-	bool					mMain;
-	Str						mTitle;
-	Str						mAdditionalTitleText;
-
-	virtual void	_SetTitleAndAdditionalTextToWindow() = 0;		//!< Sets the title and the additional title text
-
-	friend class	Device;
-};
-
-} // namespace Crown
-

+ 0 - 94
src/os/linux/GLXRenderWindow.h

@@ -1,94 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "RenderWindow.h"
-#include "Types.h"
-#include <X11/Xlib.h>
-#include <GL/glx.h>
-
-namespace Crown
-{
-
-class GLXRenderWindow : public RenderWindow
-{
-
-public:
-
-	//! See RenderWindow
-	GLXRenderWindow();
-
-	//! See RenderWindow
-	~GLXRenderWindow();
-
-	//! See RenderWindow
-	virtual bool Create(uint x, uint y, uint width, uint height, uint depth, bool fullscreen);
-
-	//! See RenderWindow
-	virtual void Destroy();
-
-	//! See RenderWindow
-	virtual void SetVisible(bool visible);
-
-	//! See RenderWindow
-	virtual void Move(uint x, uint y);
-
-	//! See RenderWindow
-	virtual void Resize(uint width, uint height);
-
-	//! See RenderWindow
-	virtual void SetFullscreen(bool full);
-
-	virtual void Bind();
-
-	virtual void Unbind();
-
-	//! See RenderWindow
-	virtual void Update();
-
-	//! See RenderWindow
-	virtual void EventLoop();
-
-	//! Returns the associated X Window
-	unsigned long GetXWindow() const
-	{
-		return mXWindow;
-	}
-
-private:
-
-	void _NotifyMetricsChange(uint x, uint y, uint width, uint height);
-	//! Sets the window's title plus the additional title text in the window
-	virtual void _SetTitleAndAdditionalTextToWindow();
-
-	Display* mXDisplay;
-	Window mXWindow;
-	GLXContext mGLXContext;
-	GLXDrawable mGLXWindow;
-};
-
-} // namespace Crown
-

+ 0 - 72
src/os/linux/X11InputManager.cpp

@@ -1,72 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include "X11InputManager.h"
-#include "X11Mouse.h"
-#include "X11Keyboard.h"
-
-namespace Crown
-{
-
-//-----------------------------------------------------------------------------
-X11InputManager::X11InputManager() :
-	mIsMouseAvailable(false),
-	mIsKeyboardAvailable(false),
-	mXWindow(0)
-{
-}
-
-//-----------------------------------------------------------------------------
-X11InputManager::~X11InputManager()
-{
-	if (mMouse)
-	{
-		delete mMouse;
-	}
-
-	if (mKeyboard)
-	{
-		delete mKeyboard;
-	}
-}
-
-//-----------------------------------------------------------------------------
-void X11InputManager::Init(const EventSource& source)
-{
-	mXWindow = source.WindowHandle;
-
-	if (!mMouse)
-	{
-		mMouse = new X11Mouse(this);
-	}
-
-	if (!mKeyboard)
-	{
-		mKeyboard = new X11Keyboard(this);
-	}
-}
-
-} // namespace Crown
-

+ 0 - 91
src/os/linux/X11InputManager.h

@@ -1,91 +0,0 @@
-/*
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "InputManager.h"
-
-namespace Crown
-{
-
-class X11InputManager : public InputManager
-{
-
-	friend class X11Mouse;
-	friend class X11Keyboard;
-
-public:
-
-	/** @copydoc InputManager::InputManager() */
-	X11InputManager();
-
-	/** @copydoc InputManager::~InputManager() */
-	virtual ~X11InputManager();
-
-	/** @copydoc InputManager::Init() */
-	virtual void Init(const EventSource& source);
-
-	/** @copydoc InputManager::IsMouseAvailable() */
-	virtual bool IsMouseAvailable()
-	{
-		return mIsMouseAvailable;
-	}
-
-	/** @copydoc InputManager::IsKeyboardAvailable() */
-	virtual bool IsKeyboardAvailable()
-	{
-		return mIsKeyboardAvailable;
-	}
-
-	/** @copydoc InputManager::IsTouchAvailable() */
-	virtual bool IsTouchAvailable()
-	{
-		return false;
-	}
-
-	/**
-		Returns the X11 Window "attached" to this manager.
-	@return
-		The X11 Window
-	*/
-	inline unsigned long GetXWindow()
-	{
-		return mXWindow;
-	}
-
-private:
-
-	void SetMouseAvailable(bool available) { mIsMouseAvailable = available; }
-	void SetKeyboardAvailable(bool available) { mIsKeyboardAvailable = available; }
-
-	bool mIsMouseAvailable		: 1;
-	bool mIsKeyboardAvailable	: 1;
-
-	// X11 related
-	unsigned long mXWindow;
-};
-
-} // namespace Crown
-