diff options
| author | 2016-09-18 09:38:01 +0900 | |
|---|---|---|
| committer | 2016-09-18 09:38:01 +0900 | |
| commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
| tree | 569a7f13128450bbab973236615587ff00bced5f /src/core/hle/applets/swkbd.cpp | |
| parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
| download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip | |
Sources: Run clang-format on everything.
Diffstat (limited to 'src/core/hle/applets/swkbd.cpp')
| -rw-r--r-- | src/core/hle/applets/swkbd.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index d87bf3d57..cf2775968 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp | |||
| @@ -12,9 +12,9 @@ | |||
| 12 | #include "core/hle/applets/swkbd.h" | 12 | #include "core/hle/applets/swkbd.h" |
| 13 | #include "core/hle/kernel/kernel.h" | 13 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/kernel/shared_memory.h" | 14 | #include "core/hle/kernel/shared_memory.h" |
| 15 | #include "core/hle/service/hid/hid.h" | ||
| 16 | #include "core/hle/service/gsp_gpu.h" | ||
| 17 | #include "core/hle/result.h" | 15 | #include "core/hle/result.h" |
| 16 | #include "core/hle/service/gsp_gpu.h" | ||
| 17 | #include "core/hle/service/hid/hid.h" | ||
| 18 | #include "core/memory.h" | 18 | #include "core/memory.h" |
| 19 | 19 | ||
| 20 | #include "video_core/video_core.h" | 20 | #include "video_core/video_core.h" |
| @@ -32,7 +32,8 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 32 | return ResultCode(-1); | 32 | return ResultCode(-1); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory. | 35 | // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared |
| 36 | // memory. | ||
| 36 | // Create the SharedMemory that will hold the framebuffer data | 37 | // Create the SharedMemory that will hold the framebuffer data |
| 37 | Service::APT::CaptureBufferInfo capture_info; | 38 | Service::APT::CaptureBufferInfo capture_info; |
| 38 | ASSERT(sizeof(capture_info) == parameter.buffer.size()); | 39 | ASSERT(sizeof(capture_info) == parameter.buffer.size()); |
| @@ -43,9 +44,9 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 43 | // Allocate a heap block of the required size for this applet. | 44 | // Allocate a heap block of the required size for this applet. |
| 44 | heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); | 45 | heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); |
| 45 | // Create a SharedMemory that directly points to this heap block. | 46 | // Create a SharedMemory that directly points to this heap block. |
| 46 | framebuffer_memory = Kernel::SharedMemory::CreateForApplet(heap_memory, 0, heap_memory->size(), | 47 | framebuffer_memory = Kernel::SharedMemory::CreateForApplet( |
| 47 | MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, | 48 | heap_memory, 0, heap_memory->size(), MemoryPermission::ReadWrite, |
| 48 | "SoftwareKeyboard Memory"); | 49 | MemoryPermission::ReadWrite, "SoftwareKeyboard Memory"); |
| 49 | 50 | ||
| 50 | // Send the response message with the newly created SharedMemory | 51 | // Send the response message with the newly created SharedMemory |
| 51 | Service::APT::MessageParameter result; | 52 | Service::APT::MessageParameter result; |
| @@ -60,10 +61,12 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con | |||
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) { | 63 | ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) { |
| 63 | ASSERT_MSG(parameter.buffer.size() == sizeof(config), "The size of the parameter (SoftwareKeyboardConfig) is wrong"); | 64 | ASSERT_MSG(parameter.buffer.size() == sizeof(config), |
| 65 | "The size of the parameter (SoftwareKeyboardConfig) is wrong"); | ||
| 64 | 66 | ||
| 65 | memcpy(&config, parameter.buffer.data(), parameter.buffer.size()); | 67 | memcpy(&config, parameter.buffer.data(), parameter.buffer.size()); |
| 66 | text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); | 68 | text_memory = |
| 69 | boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); | ||
| 67 | 70 | ||
| 68 | // TODO(Subv): Verify if this is the correct behavior | 71 | // TODO(Subv): Verify if this is the correct behavior |
| 69 | memset(text_memory->GetPointer(), 0, text_memory->size); | 72 | memset(text_memory->GetPointer(), 0, text_memory->size); |
| @@ -115,6 +118,5 @@ void SoftwareKeyboard::Finalize() { | |||
| 115 | 118 | ||
| 116 | started = false; | 119 | started = false; |
| 117 | } | 120 | } |
| 118 | |||
| 119 | } | 121 | } |
| 120 | } // namespace | 122 | } // namespace |