Explorar el Código

Remove xcodeproj userdata

Don't check out dynamic file for Xcode state.
master
TheoryOfNekomata hace 1 año
padre
commit
c7248df922
Se han modificado 4 ficheros con 9 adiciones y 22 borrados
  1. +2
    -1
      .gitignore
  2. +2
    -4
      CMakeLists.txt
  3. BIN
      cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate
  4. +5
    -17
      src/main.m

+ 2
- 1
.gitignore Ver fichero

@@ -1,3 +1,4 @@
.idea/
cmake-build-debug/
.DS_Store
.DS_Store
*.xcodeproj/project.xcworkspace/xcuserdata/

+ 2
- 4
CMakeLists.txt Ver fichero

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.24)
project(cerberus C)

set(CMAKE_C_STANDARD 11)
project(cerberus C)

if (WIN32)
# TODO set arch on target instead of generator
@@ -17,9 +17,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# does not work, use Xcode to build
# TODO use makefile instead of cmake?
add_definitions(-DMACOS)
add_executable(cerberus src/main.h src/main.m)
include_directories(/usr/include)
link_directories()
add_executable(cerberus MACOSX_BUNDLE src/main.h src/main.m)
elseif(UNIX)
add_definitions(-DUNIX)
endif ()

BIN
cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate Ver fichero


+ 5
- 17
src/main.m Ver fichero

@@ -1,26 +1,14 @@
#import <Cocoa/Cocoa.h>
#import "main.h"


int main() {
// https://stackoverflow.com/questions/30269329/creating-window-application-in-pure-c-on-mac-osx
@autoreleasepool {
@autoreleasepool{
[NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
id applicationName = [[NSProcessInfo processInfo] processName];
id window = [
[NSWindow alloc]
initWithContentRect: NSMakeRect(WINDOW_X, WINDOW_Y, WINDOW_WIDTH, WINDOW_HEIGHT)
styleMask:
NSWindowStyleMaskTitled
| NSWindowStyleMaskClosable
| NSWindowStyleMaskMiniaturizable
| NSWindowStyleMaskResizable
backing:NSBackingStoreBuffered
defer:NO
];
[window cascadeTopLeftFromPoint:NSMakePoint(20, 20)];
[window setTitle:applicationName];
id window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 120, 120)
styleMask:NSWindowStyleMaskTitled backing:NSBackingStoreBuffered defer:NO];
[window cascadeTopLeftFromPoint:NSMakePoint(20,20)];
[window setTitle: applicationName];
[window makeKeyAndOrderFront:nil];
[NSApp activateIgnoringOtherApps:YES];
[NSApp run];


Cargando…
Cancelar
Guardar