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:
parent
9da8addeb2
commit
e10daeaaa6
120 changed files with 551 additions and 105 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <Spectre/System/File.h>
|
||||
|
||||
namespace File
|
||||
namespace sp { namespace file
|
||||
{
|
||||
std::string getBasename(const std::string& path) {
|
||||
|
||||
|
|
@ -37,4 +37,4 @@ namespace File
|
|||
}
|
||||
return buf;
|
||||
}
|
||||
};
|
||||
} } // namespace sp::file
|
||||
|
|
|
|||
|
|
@ -3,11 +3,14 @@
|
|||
#include <stdio.h>
|
||||
#include <Spectre/System/Log.h>
|
||||
|
||||
void log(const char *fmt, ...) {
|
||||
namespace sp
|
||||
{
|
||||
void log(const char *fmt, ...) {
|
||||
|
||||
va_list vl;
|
||||
va_list vl;
|
||||
|
||||
va_start(vl, fmt);
|
||||
vfprintf(stderr, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
va_start(vl, fmt);
|
||||
vfprintf(stderr, fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
} // namespace sp
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@
|
|||
#include <Spectre/Display/Display.h>
|
||||
#include <Spectre/System/MessageHandler.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
void MessageHandler::onSizeChanged(Display* display, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
#include <Spectre/System/MessageQueue.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
void MessageQueue::postEvent(SysEvent& event)
|
||||
{
|
||||
m_queue.push_back(event);
|
||||
|
|
@ -20,3 +22,5 @@ bool MessageQueue::isEmpty() const
|
|||
{
|
||||
return m_queue.empty();
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
#include <Spectre/System/SystemEvent.h>
|
||||
|
||||
SysEvent::SysEvent(Type type) :
|
||||
namespace sp {
|
||||
|
||||
SysEvent::SysEvent(Type type) :
|
||||
type (type)
|
||||
{
|
||||
}
|
||||
|
|
@ -14,3 +16,5 @@ SysEvent SysEvent::sizeEvent(Display *display, int width, int height)
|
|||
event.size.height = height;
|
||||
return event;
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
Loading…
Add table
Add a link
Reference in a new issue