From 87ab129e0112e750cf4f40182e9b0cdba088b3d7 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 18 Aug 2015 12:43:30 -1000 Subject: [PATCH] Compile fixes --- CMakeLists.txt | 27 ++++++++------- InputDeviceClasses.cpp | 4 +-- include/{ => boo}/IApplication.hpp | 33 ++++++++++--------- include/{ => boo}/IGraphicsContext.hpp | 0 include/{ => boo}/IWindow.hpp | 0 include/{ => boo}/boo.hpp | 0 include/{ => boo}/inputdev/CafeProPad.hpp | 0 include/{ => boo}/inputdev/DeviceBase.hpp | 0 include/{ => boo}/inputdev/DeviceFinder.hpp | 0 .../{ => boo}/inputdev/DeviceSignature.hpp | 0 include/{ => boo}/inputdev/DeviceToken.hpp | 0 .../inputdev/DolphinSmashAdapter.hpp | 0 include/{ => boo}/inputdev/DualshockPad.hpp | 0 include/{ => boo}/inputdev/GenericPad.hpp | 0 include/{ => boo}/inputdev/IHIDListener.hpp | 0 include/{ => boo}/inputdev/RevolutionPad.hpp | 0 lib/inputdev/CafeProPad.cpp | 2 +- lib/inputdev/DeviceBase.cpp | 4 +-- lib/inputdev/DeviceSignature.cpp | 6 ++-- lib/inputdev/DolphinSmashAdapter.cpp | 2 +- lib/inputdev/DualshockPad.cpp | 2 +- lib/inputdev/GenericPad.cpp | 4 +-- lib/inputdev/HIDDeviceUdev.cpp | 4 +-- lib/inputdev/HIDListenerUdev.cpp | 4 +-- lib/inputdev/IHIDDevice.hpp | 2 +- lib/inputdev/RevolutionPad.cpp | 2 +- lib/x11/ApplicationUnix.cpp | 19 ++++++----- lib/x11/ApplicationWayland.hpp | 2 +- lib/x11/ApplicationXCB.hpp | 2 +- lib/x11/GraphicsContextWayland.cpp | 4 +-- lib/x11/GraphicsContextXCB.cpp | 4 +-- lib/x11/WindowWayland.cpp | 4 +-- lib/x11/WindowXCB.cpp | 6 ++-- test/CMakeLists.txt | 2 +- test/main.cpp | 10 +++--- 35 files changed, 78 insertions(+), 71 deletions(-) rename include/{ => boo}/IApplication.hpp (60%) rename include/{ => boo}/IGraphicsContext.hpp (100%) rename include/{ => boo}/IWindow.hpp (100%) rename include/{ => boo}/boo.hpp (100%) rename include/{ => boo}/inputdev/CafeProPad.hpp (100%) rename include/{ => boo}/inputdev/DeviceBase.hpp (100%) rename include/{ => boo}/inputdev/DeviceFinder.hpp (100%) rename include/{ => boo}/inputdev/DeviceSignature.hpp (100%) rename include/{ => boo}/inputdev/DeviceToken.hpp (100%) rename include/{ => boo}/inputdev/DolphinSmashAdapter.hpp (100%) rename include/{ => boo}/inputdev/DualshockPad.hpp (100%) rename include/{ => boo}/inputdev/GenericPad.hpp (100%) rename include/{ => boo}/inputdev/IHIDListener.hpp (100%) rename include/{ => boo}/inputdev/RevolutionPad.hpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index db93c13..dd76d72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,22 +73,25 @@ else() endif() +set(BOO_SYS_LIBS ${BOO_SYS_LIBS} CACHE PATH "Boo System Libraries" FORCE) + include_directories(include) add_library(Boo - lib/inputdev/CafeProPad.cpp include/inputdev/CafeProPad.hpp - lib/inputdev/RevolutionPad.cpp include/inputdev/RevolutionPad.hpp - lib/inputdev/DolphinSmashAdapter.cpp include/inputdev/DolphinSmashAdapter.hpp - lib/inputdev/DualshockPad.cpp include/inputdev/DualshockPad.hpp - lib/inputdev/GenericPad.cpp include/inputdev/GenericPad.hpp - lib/inputdev/DeviceBase.cpp include/inputdev/DeviceBase.hpp - lib/inputdev/DeviceSignature.cpp include/inputdev/DeviceSignature.hpp - include/inputdev/IHIDListener.hpp + lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp + lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp + lib/inputdev/DolphinSmashAdapter.cpp include/boo/inputdev/DolphinSmashAdapter.hpp + lib/inputdev/DualshockPad.cpp include/boo/inputdev/DualshockPad.hpp + lib/inputdev/GenericPad.cpp include/boo/inputdev/GenericPad.hpp + lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp + lib/inputdev/DeviceSignature.cpp include/boo/inputdev/DeviceSignature.hpp + include/boo/inputdev/IHIDListener.hpp lib/inputdev/IHIDDevice.hpp - include/IGraphicsContext.hpp - include/IWindow.hpp - include/IApplication.hpp - include/boo.hpp + include/boo/IGraphicsContext.hpp + include/boo/IWindow.hpp + include/boo/IApplication.hpp + include/boo/boo.hpp + InputDeviceClasses.cpp ${PLAT_SRCS}) add_subdirectory(test) diff --git a/InputDeviceClasses.cpp b/InputDeviceClasses.cpp index 25a4ef4..1db9ff8 100644 --- a/InputDeviceClasses.cpp +++ b/InputDeviceClasses.cpp @@ -1,5 +1,5 @@ -#include "inputdev/DeviceSignature.hpp" -#include "inputdev/DolphinSmashAdapter.hpp" +#include "boo/inputdev/DeviceSignature.hpp" +#include "boo/inputdev/DolphinSmashAdapter.hpp" namespace boo { diff --git a/include/IApplication.hpp b/include/boo/IApplication.hpp similarity index 60% rename from include/IApplication.hpp rename to include/boo/IApplication.hpp index ad0f227..2693a1e 100644 --- a/include/IApplication.hpp +++ b/include/boo/IApplication.hpp @@ -1,6 +1,7 @@ #ifndef IRUNLOOP_HPP #define IRUNLOOP_HPP +#include #include #include @@ -55,28 +56,30 @@ public: }; -IApplication* IApplicationBootstrap(IApplication::EPlatformType platform, - IApplicationCallback& cb, - const std::string& uniqueName, - const std::string& friendlyName, - const std::string& pname, - const std::vector& args, - bool singleInstance=true); +std::shared_ptr +ApplicationBootstrap(IApplication::EPlatformType platform, + IApplicationCallback& cb, + const std::string& uniqueName, + const std::string& friendlyName, + const std::string& pname, + const std::vector& args, + bool singleInstance=true); extern IApplication* APP; -static inline IApplication* IApplicationBootstrap(IApplication::EPlatformType platform, - IApplicationCallback& cb, - const std::string& uniqueName, - const std::string& friendlyName, - int argc, char** argv, - bool singleInstance=true) +static inline std::shared_ptr +ApplicationBootstrap(IApplication::EPlatformType platform, + IApplicationCallback& cb, + const std::string& uniqueName, + const std::string& friendlyName, + int argc, const char** argv, + bool singleInstance=true) { if (APP) - return APP; + return std::shared_ptr(APP); std::vector args; for (int i=1 ; i #include diff --git a/lib/inputdev/DualshockPad.cpp b/lib/inputdev/DualshockPad.cpp index 0ba7fb8..56b066d 100644 --- a/lib/inputdev/DualshockPad.cpp +++ b/lib/inputdev/DualshockPad.cpp @@ -1 +1 @@ -#include "inputdev/DualshockPad.hpp" +#include "boo/inputdev/DualshockPad.hpp" diff --git a/lib/inputdev/GenericPad.cpp b/lib/inputdev/GenericPad.cpp index 1e9ea41..f4839b0 100644 --- a/lib/inputdev/GenericPad.cpp +++ b/lib/inputdev/GenericPad.cpp @@ -1,5 +1,5 @@ -#include "inputdev/GenericPad.hpp" -#include "inputdev/DeviceToken.hpp" +#include "boo/inputdev/GenericPad.hpp" +#include "boo/inputdev/DeviceToken.hpp" namespace boo { diff --git a/lib/inputdev/HIDDeviceUdev.cpp b/lib/inputdev/HIDDeviceUdev.cpp index b91ce7d..17e8d93 100644 --- a/lib/inputdev/HIDDeviceUdev.cpp +++ b/lib/inputdev/HIDDeviceUdev.cpp @@ -1,6 +1,6 @@ #include "IHIDDevice.hpp" -#include "inputdev/DeviceToken.hpp" -#include "inputdev/DeviceBase.hpp" +#include "boo/inputdev/DeviceToken.hpp" +#include "boo/inputdev/DeviceBase.hpp" #include #include #include diff --git a/lib/inputdev/HIDListenerUdev.cpp b/lib/inputdev/HIDListenerUdev.cpp index c3ee3ce..eeacd44 100644 --- a/lib/inputdev/HIDListenerUdev.cpp +++ b/lib/inputdev/HIDListenerUdev.cpp @@ -1,5 +1,5 @@ -#include "inputdev/IHIDListener.hpp" -#include "inputdev/DeviceFinder.hpp" +#include "boo/inputdev/IHIDListener.hpp" +#include "boo/inputdev/DeviceFinder.hpp" #include #include #include diff --git a/lib/inputdev/IHIDDevice.hpp b/lib/inputdev/IHIDDevice.hpp index 318385f..6b0b43c 100644 --- a/lib/inputdev/IHIDDevice.hpp +++ b/lib/inputdev/IHIDDevice.hpp @@ -1,7 +1,7 @@ #ifndef IHIDDEVICE_HPP #define IHIDDEVICE_HPP -#include "inputdev/DeviceToken.hpp" +#include "boo/inputdev/DeviceToken.hpp" namespace boo { diff --git a/lib/inputdev/RevolutionPad.cpp b/lib/inputdev/RevolutionPad.cpp index d034459..8d8d4c9 100644 --- a/lib/inputdev/RevolutionPad.cpp +++ b/lib/inputdev/RevolutionPad.cpp @@ -1 +1 @@ -#include "inputdev/RevolutionPad.hpp" +#include "boo/inputdev/RevolutionPad.hpp" diff --git a/lib/x11/ApplicationUnix.cpp b/lib/x11/ApplicationUnix.cpp index 158dc5d..d7af3bd 100644 --- a/lib/x11/ApplicationUnix.cpp +++ b/lib/x11/ApplicationUnix.cpp @@ -6,6 +6,7 @@ #include "ApplicationXCB.hpp" #include "ApplicationWayland.hpp" +#include #include #include @@ -47,13 +48,13 @@ namespace boo { IApplication* APP = NULL; -IApplication* IApplicationBootstrap(IApplication::EPlatformType platform, - IApplicationCallback& cb, - const std::string& uniqueName, - const std::string& friendlyName, - const std::string& pname, - const std::vector& args, - bool singleInstance) +std::shared_ptr ApplicationBootstrap(IApplication::EPlatformType platform, + IApplicationCallback& cb, + const std::string& uniqueName, + const std::string& friendlyName, + const std::string& pname, + const std::vector& args, + bool singleInstance) { if (!APP) { @@ -63,9 +64,9 @@ IApplication* IApplicationBootstrap(IApplication::EPlatformType platform, platform == IApplication::PLAT_AUTO) APP = new ApplicationXCB(cb, uniqueName, friendlyName, pname, args, singleInstance); else - return NULL; + return std::shared_ptr(); } - return APP; + return std::shared_ptr(APP); } } diff --git a/lib/x11/ApplicationWayland.hpp b/lib/x11/ApplicationWayland.hpp index fa05c51..c157bf2 100644 --- a/lib/x11/ApplicationWayland.hpp +++ b/lib/x11/ApplicationWayland.hpp @@ -2,7 +2,7 @@ #error This file may only be included from CApplicationUnix.cpp #endif -#include "IApplication.hpp" +#include "boo/IApplication.hpp" #include DBusConnection* registerDBus(const char* appName, bool& isFirst); diff --git a/lib/x11/ApplicationXCB.hpp b/lib/x11/ApplicationXCB.hpp index 95d38e7..626a8f9 100644 --- a/lib/x11/ApplicationXCB.hpp +++ b/lib/x11/ApplicationXCB.hpp @@ -2,7 +2,7 @@ #error This file may only be included from CApplicationUnix.cpp #endif -#include "IApplication.hpp" +#include "boo/IApplication.hpp" #define explicit explicit_c #include diff --git a/lib/x11/GraphicsContextWayland.cpp b/lib/x11/GraphicsContextWayland.cpp index 4eaf925..e84ae38 100644 --- a/lib/x11/GraphicsContextWayland.cpp +++ b/lib/x11/GraphicsContextWayland.cpp @@ -1,5 +1,5 @@ -#include "IGraphicsContext.hpp" -#include "IWindow.hpp" +#include "boo/IGraphicsContext.hpp" +#include "boo/IWindow.hpp" namespace boo { diff --git a/lib/x11/GraphicsContextXCB.cpp b/lib/x11/GraphicsContextXCB.cpp index a76ecaa..8544e14 100644 --- a/lib/x11/GraphicsContextXCB.cpp +++ b/lib/x11/GraphicsContextXCB.cpp @@ -1,5 +1,5 @@ -#include "IGraphicsContext.hpp" -#include "IWindow.hpp" +#include "boo/IGraphicsContext.hpp" +#include "boo/IWindow.hpp" #include #include diff --git a/lib/x11/WindowWayland.cpp b/lib/x11/WindowWayland.cpp index 2c22167..442836d 100644 --- a/lib/x11/WindowWayland.cpp +++ b/lib/x11/WindowWayland.cpp @@ -1,5 +1,5 @@ -#include "IWindow.hpp" -#include "IGraphicsContext.hpp" +#include "boo/IWindow.hpp" +#include "boo/IGraphicsContext.hpp" namespace boo { diff --git a/lib/x11/WindowXCB.cpp b/lib/x11/WindowXCB.cpp index 10d2366..b2200ec 100644 --- a/lib/x11/WindowXCB.cpp +++ b/lib/x11/WindowXCB.cpp @@ -1,6 +1,6 @@ -#include "IWindow.hpp" -#include "IGraphicsContext.hpp" -#include "IApplication.hpp" +#include "boo/IWindow.hpp" +#include "boo/IGraphicsContext.hpp" +#include "boo/IApplication.hpp" #include #include diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index eb8aa24..1eaf7b6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,2 +1,2 @@ -add_executable(booTest main.cpp ../InputDeviceClasses.cpp) +add_executable(booTest main.cpp) target_link_libraries(booTest Boo ${BOO_SYS_LIBS}) diff --git a/test/main.cpp b/test/main.cpp index e77710f..22d4989 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace boo { @@ -134,13 +134,13 @@ struct TestApplicationCallback : IApplicationCallback } -int main(int argc, char** argv) +int main(int argc, const char** argv) { boo::TestApplicationCallback appCb; - boo::IApplication* app = IApplicationBootstrap(boo::IApplication::PLAT_AUTO, - appCb, "rwk", "RWK", argc, argv); + std::shared_ptr app = + ApplicationBootstrap(boo::IApplication::PLAT_AUTO, + appCb, "rwk", "RWK", argc, argv); app->run(); - delete app; printf("IM DYING!!\n"); return 0; }