remove app namespace

This commit is contained in:
scawful
2024-12-28 21:28:51 -05:00
parent 3ebe17c7bd
commit e05e7c35db
174 changed files with 475 additions and 658 deletions

View File

@@ -206,8 +206,8 @@
}
- (void)openFileAction:(id)sender {
if (!yaze::app::SharedRom::shared_rom_
->LoadFromFile(yaze::app::core::FileDialogWrapper::ShowOpenFileDialog())
if (!yaze::SharedRom::shared_rom_
->LoadFromFile(yaze::core::FileDialogWrapper::ShowOpenFileDialog())
.ok()) {
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Error"];
@@ -238,7 +238,7 @@ extern "C" void yaze_initialize_cococa() {
extern "C" void yaze_run_cocoa_app_delegate(const char *filename) {
yaze_initialize_cococa();
yaze::app::core::Controller controller;
yaze::core::Controller controller;
RETURN_VOID_IF_ERROR(controller.OnEntry(filename));
while (controller.IsActive()) {
@autoreleasepool {

View File

@@ -4,7 +4,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
void CopyImageToClipboard(const std::vector<uint8_t>& data) {}
@@ -12,5 +11,4 @@ void GetImageFromClipboard(std::vector<uint8_t>& data, int& width,
int& height) {}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -5,14 +5,12 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
void CopyImageToClipboard(const std::vector<uint8_t> &data);
void GetImageFromClipboard(std::vector<uint8_t> &data, int &width, int &height);
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_CLIPBOARD_H

View File

@@ -6,7 +6,7 @@
#ifdef TARGET_OS_MAC
#import <Cocoa/Cocoa.h>
void yaze::app::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData) {
void yaze::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData) {
NSData* data = [NSData dataWithBytes:pngData.data() length:pngData.size()];
NSImage* image = [[NSImage alloc] initWithData:data];
@@ -15,7 +15,7 @@ void yaze::app::core::CopyImageToClipboard(const std::vector<uint8_t>& pngData)
[pasteboard writeObjects:@[ image ]];
}
void yaze::app::core::GetImageFromClipboard(std::vector<uint8_t>& pixel_data, int& width, int& height) {
void yaze::core::GetImageFromClipboard(std::vector<uint8_t>& pixel_data, int& width, int& height) {
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
NSArray* classArray = [NSArray arrayWithObject:[NSImage class]];
NSDictionary* options = [NSDictionary dictionary];

View File

@@ -7,12 +7,11 @@
#endif // _WIN32
namespace yaze {
namespace app {
namespace core {
#ifdef _WIN32
std::string FileDialogWrapper::ShowOpenFileDialog() {
std::string FileDialogWrapper::ShowOpenFileDialog() {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
IFileDialog *pfd = NULL;
@@ -44,7 +43,7 @@ namespace core {
return file_path_windows;
}
std::string FileDialogWrapper::ShowOpenFolderDialog() {
std::string FileDialogWrapper::ShowOpenFolderDialog() {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
IFileDialog *pfd = NULL;
@@ -141,5 +140,4 @@ std::vector<std::string> FileDialogWrapper::GetFilesInFolder(
#endif
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -5,7 +5,6 @@
#include <vector>
namespace yaze {
namespace app {
namespace core {
class FileDialogWrapper {
@@ -28,7 +27,6 @@ class FileDialogWrapper {
};
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FILE_DIALOG_H

View File

@@ -37,20 +37,18 @@ std::string ShowOpenFileDialogSync() {
return result;
}
}
} // namespace
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
return ShowOpenFileDialogSync();
}
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() { return ShowOpenFileDialogSync(); }
std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() { return ""; }
std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() { return ""; }
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetFilesInFolder(
const std::string &folder) {
return {};
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
const std::string &folder) {
return {};
}
@@ -60,7 +58,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesIn
#import <Cocoa/Cocoa.h>
std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:YES];
[openPanel setCanChooseDirectories:NO];
@@ -75,7 +73,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFileDialog() {
return "";
}
std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
std::string yaze::core::FileDialogWrapper::ShowOpenFolderDialog() {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:NO];
[openPanel setCanChooseDirectories:YES];
@@ -90,7 +88,7 @@ std::string yaze::app::core::FileDialogWrapper::ShowOpenFolderDialog() {
return "";
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetFilesInFolder(
const std::string& folder) {
std::vector<std::string> filenames;
NSFileManager* fileManager = [NSFileManager defaultManager];
@@ -106,7 +104,7 @@ std::vector<std::string> yaze::app::core::FileDialogWrapper::GetFilesInFolder(
return filenames;
}
std::vector<std::string> yaze::app::core::FileDialogWrapper::GetSubdirectoriesInFolder(
std::vector<std::string> yaze::core::FileDialogWrapper::GetSubdirectoriesInFolder(
const std::string& folder) {
std::vector<std::string> subdirectories;
NSFileManager* fileManager = [NSFileManager defaultManager];

View File

@@ -4,7 +4,6 @@
#include <string>
namespace yaze {
namespace app {
namespace core {
/**
@@ -14,7 +13,6 @@ namespace core {
std::string GetBundleResourcePath();
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FILE_PATH_H

View File

@@ -8,14 +8,14 @@
#include <TargetConditionals.h>
#if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
std::string yaze::app::core::GetBundleResourcePath() {
std::string yaze::core::GetBundleResourcePath() {
NSBundle* bundle = [NSBundle mainBundle];
NSString* resourceDirectoryPath = [bundle bundlePath];
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];
return [path UTF8String];
}
#elif TARGET_OS_MAC == 1
std::string yaze::app::core::GetBundleResourcePath() {
std::string yaze::core::GetBundleResourcePath() {
NSBundle* bundle = [NSBundle mainBundle];
NSString* resourceDirectoryPath = [bundle bundlePath];
NSString* path = [resourceDirectoryPath stringByAppendingString:@"/"];

View File

@@ -13,7 +13,6 @@
#include "imgui/imgui.h"
namespace yaze {
namespace app {
namespace core {
absl::Status LoadPackageFonts() {
@@ -240,5 +239,4 @@ void LoadSystemFonts() {
#endif
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -4,14 +4,12 @@
#include "absl/status/status.h"
namespace yaze {
namespace app {
namespace core {
void LoadSystemFonts();
absl::Status LoadPackageFonts();
} // namespace core
} // namespace app
} // namespace yaze
#endif // YAZE_APP_CORE_PLATFORM_FONTLOADER_H

View File

@@ -8,13 +8,13 @@
#if TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1
/* iOS */
void yaze::app::core::LoadSystemFonts() {}
void yaze::core::LoadSystemFonts() {}
#elif TARGET_OS_MAC == 1
/* macOS */
#import <Cocoa/Cocoa.h>
void yaze::app::core::LoadSystemFonts() {
void yaze::core::LoadSystemFonts() {
NSArray *fontNames = @[ @"Helvetica", @"Times New Roman", @"Courier", @"Arial", @"Verdana" ];
for (NSString *fontName in fontNames) {

View File

@@ -11,7 +11,6 @@
#include "app/gfx/bitmap.h"
namespace yaze {
namespace app {
namespace core {
/**
@@ -77,7 +76,6 @@ class Renderer {
};
} // namespace core
} // namespace app
} // namespace yaze
#endif

View File

@@ -10,7 +10,7 @@
@end
#else
@interface AppViewController : UIViewController <MTKViewDelegate>
@property(nonatomic) yaze::app::core::Controller *controller;
@property(nonatomic) yaze::core::Controller *controller;
@property(nonatomic) UIHoverGestureRecognizer *hoverGestureRecognizer;
@property(nonatomic) UIPinchGestureRecognizer *pinchRecognizer;
@property(nonatomic) UISwipeGestureRecognizer *swipeRecognizer;