Browse Source

Remove WString.h, fix some compilation errors

Michael Ragazzon 6 years ago
parent
commit
6e2aecc127

+ 0 - 2
Build/cmake/FileList.cmake

@@ -196,7 +196,6 @@ set(Core_PUB_HDR_FILES
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Vector4.inl
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/Vertex.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/ViewState.h
-    ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/WString.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/XMLNodeHandler.h
     ${PROJECT_SOURCE_DIR}/Include/Rocket/Core/XMLParser.h
 )
@@ -344,7 +343,6 @@ set(Core_SRC_FILES
     ${PROJECT_SOURCE_DIR}/Source/Core/ViewState.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/WidgetSlider.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/WidgetSliderScroll.cpp
-    ${PROJECT_SOURCE_DIR}/Source/Core/WString.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/XMLNodeHandler.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/XMLNodeHandlerBody.cpp
     ${PROJECT_SOURCE_DIR}/Source/Core/XMLNodeHandlerDefault.cpp

+ 1 - 1
Include/Rocket/Controls/Clipboard.h

@@ -28,7 +28,7 @@
 #ifndef ROCKETCONTROLSCLIPBOARD_H
 #define ROCKETCONTROLSCLIPBOARD_H
 
-#include "../Core/WString.h"
+#include "../Core/String.h"
 
 namespace Rocket {
 namespace Controls {

+ 2 - 2
Include/Rocket/Core/ComputedValues.h

@@ -205,8 +205,8 @@ struct ComputedValues
 // Resolves a computed LengthPercentage value to the base unit 'px'. 
 // Percentages are scaled by the base_value.
 // Note: Auto must be manually handled during layout, here it returns zero.
-float ResolveValue(Style::LengthPercentageAuto length, float base_value);
-float ResolveValue(Style::LengthPercentage length, float base_value);
+ROCKETCORE_API float ResolveValue(Style::LengthPercentageAuto length, float base_value);
+ROCKETCORE_API float ResolveValue(Style::LengthPercentage length, float base_value);
 
 
 using ComputedValues = Style::ComputedValues;

+ 1 - 1
Include/Rocket/Core/ElementText.h

@@ -30,7 +30,7 @@
 
 #include "Header.h"
 #include "Element.h"
-#include "WString.h"
+#include "String.h"
 
 namespace Rocket {
 namespace Core {

+ 1 - 1
Include/Rocket/Core/ElementUtilities.h

@@ -30,7 +30,7 @@
 
 #include "Header.h"
 #include "Box.h"
-#include "WString.h"
+#include "String.h"
 #include "Types.h"
 
 namespace Rocket {

+ 6 - 6
Include/Rocket/Core/String.h

@@ -45,14 +45,14 @@ typedef std::vector< String > StringList;
 	#define strncasecmp strnicmp
 #endif
 
-int FormatString(String& string, size_t max_size, const char* format, ...);
-String CreateString(size_t max_size, const char* format, ...);
+ROCKETCORE_API int FormatString(String& string, size_t max_size, const char* format, ...);
+ROCKETCORE_API String CreateString(size_t max_size, const char* format, ...);
 
-String ToLower(const String& string);
-String Replace(String subject, const String& search, const String& replace);
+ROCKETCORE_API String ToLower(const String& string);
+ROCKETCORE_API String Replace(String subject, const String& search, const String& replace);
 
-WString ToWideString(const String& str);
-String ToUTF8(const WString& wstr);
+ROCKETCORE_API WString ToWideString(const String& str);
+ROCKETCORE_API String ToUTF8(const WString& wstr);
 
 }
 }

+ 0 - 43
Include/Rocket/Core/WString.h

@@ -1,43 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * 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.
- *
- */
-
-#ifndef ROCKETCOREWSTRING_H
-#define ROCKETCOREWSTRING_H
-
-#include "Types.h"
-#include "Header.h"
-#include <string>
-
-namespace Rocket {
-namespace Core {
-
-typedef std::wstring WString;
-
-}
-}
-
-#endif

+ 1 - 0
Samples/shell/src/macosx/ShellMacOSX.cpp

@@ -33,6 +33,7 @@
 #include <AGL/agl.h>
 #include <sys/time.h>
 #include <stdio.h>
+#include <stdarg.h>
 
 static const EventTypeSpec INPUT_EVENTS[] = {
 	{ kEventClassKeyboard, kEventRawKeyDown },

+ 1 - 0
Samples/shell/src/win32/ShellWin32.cpp

@@ -31,6 +31,7 @@
 #include "ShellFileInterface.h"
 #include <windows.h>
 #include <stdio.h>
+#include <stdarg.h>
 
 static LRESULT CALLBACK WindowProcedure(HWND window_handle, UINT message, WPARAM w_param, LPARAM l_param);
 

+ 1 - 0
Samples/shell/src/x11/ShellX11.cpp

@@ -36,6 +36,7 @@
 #include <time.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <stdarg.h>
 
 static bool running = false;
 static int screen = -1;

+ 0 - 1
Source/Controls/Clipboard.cpp

@@ -27,7 +27,6 @@
 
 #include "../../Include/Rocket/Controls/Clipboard.h"
 #include "../../Include/Rocket/Core/Types.h"
-#include "../../Include/Rocket/Core/WString.h"
 #if defined ROCKET_PLATFORM_WIN32
 #include <windows.h>
 #endif

+ 1 - 1
Source/Controls/WidgetTextInput.h

@@ -30,7 +30,7 @@
 
 #include "../../Include/Rocket/Core/EventListener.h"
 #include "../../Include/Rocket/Core/Geometry.h"
-#include "../../Include/Rocket/Core/WString.h"
+#include "../../Include/Rocket/Core/String.h"
 #include "../../Include/Rocket/Core/Vertex.h"
 
 namespace Rocket {

+ 1 - 0
Source/Core/Log.cpp

@@ -28,6 +28,7 @@
 #include "precompiled.h"
 #include "../../Include/Rocket/Core/Log.h"
 #include "../../Include/Rocket/Core.h"
+#include <stdarg.h>
 #ifdef ROCKET_PLATFORM_WIN32
 #include <windows.h>
 #endif

+ 0 - 35
Source/Core/WString.cpp

@@ -1,35 +0,0 @@
-/*
- * This source file is part of libRocket, the HTML/CSS Interface Middleware
- *
- * For the latest information, see http://www.librocket.com
- *
- * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
- *
- * 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 "precompiled.h"
-#include "../../Include/Rocket/Core/WString.h"
-
-namespace Rocket {
-namespace Core {
-
-}
-}