diff --git a/CMakeLists.txt b/CMakeLists.txt index b8d35019c9..fec7cdfe8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -506,6 +506,7 @@ add_library(native STATIC native/base/error_context.h native/base/fastlist.h native/base/fastlist_test.cpp + native/base/functional.h native/base/linked_ptr.h native/base/logging.h native/base/mutex.h @@ -586,6 +587,8 @@ add_library(native STATIC native/net/http_client.h native/net/resolve.cpp native/net/resolve.h + native/net/url.cpp + native/net/url.h native/profiler/profiler.cpp native/profiler/profiler.h native/thread/prioritizedworkqueue.cpp diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index be8d1f1917..e2d0e25c47 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -29,6 +29,8 @@ #include "net/http_client.h" #include "net/resolve.h" +#include "net/url.h" + #include "base/buffer.h" #include @@ -46,99 +48,6 @@ namespace Reporting // Temporarily stores a reference to the hostname. static std::string lastHostname; - struct UrlEncoder - { - UrlEncoder() : paramCount(0) - { - data.reserve(256); - }; - - void Add(const std::string &key, const std::string &value) - { - if (++paramCount > 1) - data += '&'; - AppendEscaped(key); - data += '='; - AppendEscaped(value); - } - - void Add(const std::string &key, const char *value) - { - Add(key, std::string(value)); - } - - template - void AddT(const std::string &key, const char *fmt, const T value) - { - char temp[64]; - snprintf(temp, sizeof(temp), fmt, value); - temp[sizeof(temp) - 1] = '\0'; - Add(key, temp); - } - - void Add(const std::string &key, const int value) - { - AddT(key, "%d", value); - } - - void Add(const std::string &key, const u32 value) - { - AddT(key, "%u", value); - } - - void Add(const std::string &key, const u64 value) - { - AddT(key, "%llu", value); - } - - void Add(const std::string &key, const double value) - { - AddT(key, "%f", value); - } - - void Add(const std::string &key, const bool value) - { - Add(key, value ? "true" : "false"); - } - - // Percent encoding, aka application/x-www-form-urlencoded. - void AppendEscaped(const std::string &value) - { - for (size_t lastEnd = 0; lastEnd < value.length(); ) - { - size_t pos = value.find_first_not_of(unreservedChars, lastEnd); - if (pos == value.npos) - { - data += value.substr(lastEnd); - break; - } - - if (pos != lastEnd) - data += value.substr(lastEnd, pos - lastEnd); - lastEnd = pos; - - // Encode the reserved character. - char c = value[pos]; - data += '%'; - data += hexChars[(c >> 4) & 15]; - data += hexChars[(c >> 0) & 15]; - ++lastEnd; - } - } - - std::string &ToString() - { - return data; - } - - std::string data; - int paramCount; - static const char *unreservedChars; - static const char *hexChars; - }; - const char *UrlEncoder::unreservedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~"; - const char *UrlEncoder::hexChars = "0123456789ABCDEF"; - enum RequestType { MESSAGE, diff --git a/GPU/GLES/TextureScaler.h b/GPU/GLES/TextureScaler.h index 647bc0808b..6ca82764ef 100644 --- a/GPU/GLES/TextureScaler.h +++ b/GPU/GLES/TextureScaler.h @@ -21,7 +21,6 @@ #include "../Globals.h" #include "gfx/gl_common.h" -#include #include diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index de4b2554ed..8e1b4664a7 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -179,6 +179,9 @@ void LogoScreen::render() { // Menu Screen // ================== +MenuScreen::MenuScreen() : frames_(0) { +} + void MenuScreen::update(InputState &input_state) { globalUIState = UISTATE_MENU; frames_++; diff --git a/UI/MenuScreens.h b/UI/MenuScreens.h index e766bcaaff..6cc96045ee 100644 --- a/UI/MenuScreens.h +++ b/UI/MenuScreens.h @@ -24,6 +24,7 @@ #include "ui/screen.h" #include "ui/ui.h" #include "file/file_util.h" +#include "net/http_client.h" class LogoScreen : public Screen { @@ -43,7 +44,7 @@ private: class MenuScreen : public Screen { public: - MenuScreen() : frames_(0) {} + MenuScreen(); void update(InputState &input); void render(); void sendMessage(const char *message, const char *value); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index aeec4b5864..d52743bee3 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -445,16 +445,9 @@ bool NativeIsAtTopLevel() return false; } -void NativeTouch(int finger, float x, float y, double time, TouchEvent event) +void NativeTouch(const TouchInput &touch) { - switch (event) { - case TOUCH_DOWN: - break; - case TOUCH_MOVE: - break; - case TOUCH_UP: - break; - } + screenManager->touch(touch); } void NativeMessageReceived(const char *message, const char *value) diff --git a/native b/native index ceefd214c4..21a9fa2645 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit ceefd214c4a7799b47fbd2c6ba322649d3462700 +Subproject commit 21a9fa26456030be3a9b9bcbf5873cd32472b953