diff --git a/src/app/core/platform/clipboard.cc b/src/app/core/platform/clipboard.cc index 5c22b209..5607bd0c 100644 --- a/src/app/core/platform/clipboard.cc +++ b/src/app/core/platform/clipboard.cc @@ -3,6 +3,14 @@ #include #include +namespace yaze { +namespace app { +namespace core { + void CopyImageToClipboard(const std::vector& data) {} void GetImageFromClipboard(std::vector& data, int& width, - int& height) {} \ No newline at end of file + int& height) {} + +} // namespace core +} // namespace app +} // namespace yaze \ No newline at end of file diff --git a/src/app/core/platform/clipboard.h b/src/app/core/platform/clipboard.h index 93ab7575..325808ba 100644 --- a/src/app/core/platform/clipboard.h +++ b/src/app/core/platform/clipboard.h @@ -4,7 +4,15 @@ #include #include +namespace yaze { +namespace app { +namespace core { + void CopyImageToClipboard(const std::vector &data); void GetImageFromClipboard(std::vector &data, int &width, int &height); -#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H \ No newline at end of file +} // namespace core +} // namespace app +} // namespace yaze + +#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H \ No newline at end of file diff --git a/src/app/core/platform/clipboard.mm b/src/app/core/platform/clipboard.mm index bdaba4a7..e756b29e 100644 --- a/src/app/core/platform/clipboard.mm +++ b/src/app/core/platform/clipboard.mm @@ -6,7 +6,7 @@ #ifdef TARGET_OS_MAC #import -void CopyImageToClipboard(const std::vector& pngData) { +void yaze::app::core::CopyImageToClipboard(const std::vector& pngData) { NSData* data = [NSData dataWithBytes:pngData.data() length:pngData.size()]; NSImage* image = [[NSImage alloc] initWithData:data]; @@ -15,7 +15,7 @@ void CopyImageToClipboard(const std::vector& pngData) { [pasteboard writeObjects:@[ image ]]; } -void GetImageFromClipboard(std::vector& pixel_data, int& width, int& height) { +void yaze::app::core::GetImageFromClipboard(std::vector& pixel_data, int& width, int& height) { NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; NSArray* classArray = [NSArray arrayWithObject:[NSImage class]]; NSDictionary* options = [NSDictionary dictionary]; diff --git a/src/app/core/platform/file_path.h b/src/app/core/platform/file_path.h index 5cffc9de..04e2715d 100644 --- a/src/app/core/platform/file_path.h +++ b/src/app/core/platform/file_path.h @@ -1,6 +1,16 @@ #ifndef YAZE_APP_CORE_PLATFORM_FILE_PATH_H #define YAZE_APP_CORE_PLATFORM_FILE_PATH_H +#include + +namespace yaze { +namespace app { +namespace core { + std::string GetBundleResourcePath(); +} +} // namespace app +} // namespace yaze + #endif // YAZE_APP_CORE_PLATFORM_FILE_PATH_H diff --git a/src/app/core/platform/file_path.mm b/src/app/core/platform/file_path.mm index c07b14ae..617e80cf 100644 --- a/src/app/core/platform/file_path.mm +++ b/src/app/core/platform/file_path.mm @@ -1,3 +1,5 @@ +#include "file_path.h" + #include #include @@ -6,14 +8,14 @@ #include #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1 -std::string GetBundleResourcePath() { +std::string yaze::app::core::GetBundleResourcePath() { NSBundle* bundle = [NSBundle mainBundle]; NSString* resourceDirectoryPath = [bundle bundlePath]; NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"]; return [path UTF8String]; } #elif TARGET_OS_MAC == 1 -std::string GetBundleResourcePath() { +std::string yaze::app::core::GetBundleResourcePath() { NSBundle* bundle = [NSBundle mainBundle]; NSString* resourceDirectoryPath = [bundle bundlePath]; NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"]; diff --git a/src/app/editor/graphics/graphics_editor.cc b/src/app/editor/graphics/graphics_editor.cc index 7c0ac5ad..82c89b38 100644 --- a/src/app/editor/graphics/graphics_editor.cc +++ b/src/app/editor/graphics/graphics_editor.cc @@ -130,7 +130,7 @@ void GraphicsEditor::DrawGfxEditToolset() { if (Button(ICON_MD_CONTENT_COPY)) { std::vector png_data = rom()->gfx_sheets().at(current_sheet_).GetPngData(); - CopyImageToClipboard(png_data); + core::CopyImageToClipboard(png_data); } HOVER_HINT("Copy to Clipboard"); @@ -138,7 +138,7 @@ void GraphicsEditor::DrawGfxEditToolset() { if (Button(ICON_MD_CONTENT_PASTE)) { std::vector png_data; int width, height; - GetImageFromClipboard(png_data, width, height); + core::GetImageFromClipboard(png_data, width, height); if (png_data.size() > 0) { rom() ->mutable_gfx_sheets() diff --git a/src/app/editor/overworld/overworld_editor.cc b/src/app/editor/overworld/overworld_editor.cc index 751f14a1..827fa950 100644 --- a/src/app/editor/overworld/overworld_editor.cc +++ b/src/app/editor/overworld/overworld_editor.cc @@ -230,7 +230,7 @@ absl::Status OverworldEditor::DrawToolset() { std::vector png_data; if (gfx::ConvertSurfaceToPNG(maps_bmp_[current_map_].surface(), png_data)) { - CopyImageToClipboard(png_data); + core::CopyImageToClipboard(png_data); } else { status_ = absl::InternalError( "Failed to convert overworld map surface to PNG"); diff --git a/src/app/gui/zeml.cc b/src/app/gui/zeml.cc index f7e3b9ab..de541a48 100644 --- a/src/app/gui/zeml.cc +++ b/src/app/gui/zeml.cc @@ -594,7 +594,7 @@ std::string LoadFile(const std::string& filename) { #ifdef __APPLE__ #if TARGET_OS_IOS == 1 - const std::string kBundlePath = GetBundleResourcePath(); + const std::string kBundlePath = core::GetBundleResourcePath(); std::ifstream file(kBundlePath + filename); #else std::ifstream file(kPath + filename);