1
0
Fork 0

Move everything from global namespace to "sp" namespace

When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine.

So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
This commit is contained in:
Henrik Hautakoski 2019-09-29 23:47:57 +02:00
parent 9da8addeb2
commit e10daeaaa6
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
120 changed files with 551 additions and 105 deletions

View file

@ -5,7 +5,7 @@
#include <vector>
#include <string>
namespace File
namespace sp { namespace file
{
std::string getBasename(const std::string& path);
@ -14,6 +14,6 @@ namespace File
std::string getPathname(const std::string& path);
std::vector<unsigned char> read(const std::string& path);
};
} }
#endif /* SPECTRE_SYSTEM_FILE_H */

View file

@ -2,6 +2,10 @@
#ifndef SYSTEM_LOG_H
#define SYSTEM_LOG_H
void log(const char *fmt, ...);
namespace sp {
void log(const char *fmt, ...);
} // namespace sp
#endif /* SYSTEM_LOG_H */

View file

@ -4,6 +4,8 @@
#include "SystemEvent.h"
namespace sp {
class Display;
class MessageHandler
@ -12,4 +14,6 @@ public :
virtual void onSizeChanged(Display* display, int width, int height);
};
} // namespace sp
#endif /* SPECTRE_SYSTEM_MESSAGEHANDLER_H */

View file

@ -5,6 +5,8 @@
#include <Spectre/System/SystemEvent.h>
#include <queue>
namespace sp {
class MessageQueue
{
public :
@ -18,4 +20,6 @@ protected :
std::deque<SysEvent> m_queue;
};
} // namespace sp
#endif /* SPECTRE_MESSAGE_QUEUE_H */

View file

@ -2,11 +2,12 @@
#ifndef SPECTRE_SYSTEM_SYSTEM_H
#define SPECTRE_SYSTEM_SYSTEM_H
namespace System
namespace sp { namespace system
{
unsigned long getMilliseconds();
void sleep(int milliseconds);
};
} } // namespace sp::system
#endif /* SPECTRE_SYSTEM_SYSTEM_H */

View file

@ -2,6 +2,8 @@
#ifndef SYSTEM_EVENT_H
#define SYSTEM_EVENT_H
namespace sp {
class Display;
struct SysEvent
@ -32,7 +34,8 @@ public :
// Helper methods
static SysEvent sizeEvent(Display *display, int width, int height);
};
} // namespace sp
#endif /* SYSTEM_EVENT_H */