Pārlūkot izejas kodu

Remove xcodeproj userdata

Don't check out dynamic file for Xcode state.
master
TheoryOfNekomata pirms 1 gada
vecāks
revīzija
c7248df922
4 mainītis faili ar 9 papildinājumiem un 22 dzēšanām
  1. +2
    -1
      .gitignore
  2. +2
    -4
      CMakeLists.txt
  3. Binārs
      cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate
  4. +5
    -17
      src/main.m

+ 2
- 1
.gitignore Parādīt failu

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

+ 2
- 4
CMakeLists.txt Parādīt failu

@@ -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ārs
cerberus.xcodeproj/project.xcworkspace/xcuserdata/theoryofnekomata.xcuserdatad/UserInterfaceState.xcuserstate Parādīt failu


+ 5
- 17
src/main.m Parādīt failu

@@ -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];


Notiek ielāde…
Atcelt
Saglabāt