Skip to content

Commit 9c5e88a

Browse files
committed
macOS Test
1 parent 3e3479f commit 9c5e88a

File tree

15 files changed

+1972
-1
lines changed

15 files changed

+1972
-1
lines changed

example/macOS Test App

-1
This file was deleted.

example/macOS Test App copy/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# macOS Test App
2+
3+
This is a test app for macOS using the curl, openssl and nghttp2 libraries.
4+
5+
## Screenshots
6+
7+
macOS Test Build
8+
9+
<img width="641" alt="Image" src="https://github.com/user-attachments/assets/a05b76b5-2052-4033-be18-fdf45f7342e0" />
10+
11+
## Build Instructions
12+
13+
Build the libraries with macOS support:
14+
15+
```bash
16+
# Standard Build
17+
./build.sh
18+
19+
# Option: Build only macOS
20+
./build.sh -p macos
21+
```
22+
23+
Load and build the project using Xcode. Example lib binaries (xcframework) and header files are included but will be replaced when you run the build script.
24+
25+
## New Project Setup Details
26+
27+
If you are setting up a new Xcode project, there are few things you will need to set up. These are all set up for you already in the xcodeproj file:
28+
29+
* You will also need to add the xcframework files (libs) and header files (include). You will also need to add libz.tbd, liblapd.tgb, CoreFoundation.framework, and SystemConfiguraiton.framework to the Xcode project ("General").
30+
<img width="482" alt="Image" src="https://github.com/user-attachments/assets/29fd3b15-f130-41cd-91d8-689a6b8b3f50" />
31+
32+
* You will need to allow "Outgoing Connection (Client)" in the "Signing & Capabilities" of the project target "Sandbox" settings.
33+
<img width="482" alt="Image" src="https://github.com/user-attachments/assets/cd7f5e68-bc3e-4b5c-94d6-cb44c4c2ad23" />
34+

example/macOS Test App copy/macOS Test App.xcodeproj/project.pbxproj

+713
Large diffs are not rendered by default.

example/macOS Test App copy/macOS Test App.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AppDelegate.h
3+
// macOS Test App
4+
//
5+
// Created by Jason Cox on 1/19/25.
6+
//
7+
8+
#import <Cocoa/Cocoa.h>
9+
#import <curl/curl.h>
10+
#import <openssl/ssl.h>
11+
12+
@interface AppDelegate : NSResponder <NSApplicationDelegate>
13+
14+
@property (strong, nonatomic) NSWindow *window;
15+
16+
@end
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// AppDelegate.m
3+
// macOS Test App
4+
//
5+
// Created by Jason Cox on 1/19/25.
6+
//
7+
8+
#import "AppDelegate.h"
9+
10+
@interface AppDelegate ()
11+
12+
13+
@end
14+
15+
@implementation AppDelegate
16+
17+
18+
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
19+
// Insert code here to initialize your application
20+
// libcurl - see http://curl.haxx.se/libcurl/
21+
curl_global_init(0L);
22+
}
23+
24+
- (void)applicationWillTerminate:(NSNotification *)aNotification {
25+
// Insert code here to tear down your application
26+
// libcurl cleanup
27+
curl_global_cleanup();
28+
}
29+
30+
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app {
31+
return YES;
32+
}
33+
34+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "mac",
5+
"scale" : "1x",
6+
"size" : "16x16"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"scale" : "2x",
11+
"size" : "16x16"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"scale" : "1x",
16+
"size" : "32x32"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"scale" : "2x",
21+
"size" : "32x32"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"scale" : "1x",
26+
"size" : "128x128"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"scale" : "2x",
31+
"size" : "128x128"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"scale" : "1x",
36+
"size" : "256x256"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"scale" : "2x",
41+
"size" : "256x256"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"scale" : "1x",
46+
"size" : "512x512"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"scale" : "2x",
51+
"size" : "512x512"
52+
}
53+
],
54+
"info" : {
55+
"author" : "xcode",
56+
"version" : 1
57+
}
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

example/macOS Test App copy/macOS Test App/Base.lproj/Main.storyboard

+783
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// ViewController.h
3+
// macOS Test App
4+
//
5+
// Created by Jason Cox on 1/19/25.
6+
//
7+
8+
#import <Cocoa/Cocoa.h>
9+
#import <curl/curl.h>
10+
#import <openssl/ssl.h>
11+
12+
@interface ViewController : NSViewController
13+
{
14+
IBOutlet NSTextField *_urlText; // user field for URL address
15+
IBOutlet NSTextView *_resultText; // user field for resulting cURL data
16+
IBOutlet NSButton *_getButton; // user button to start GET
17+
IBOutlet NSTextField *_appTitle; // application title to update for version
18+
19+
// CURL global data
20+
CURL *_curl; // curl handle
21+
NSData *_dataToSend;
22+
size_t _dataToSendBookmark;
23+
NSMutableData *_dataReceived;
24+
NSString *cacertPath; // path to cacert.pem file
25+
}
26+
27+
@property (retain, nonatomic) NSTextField *_urlText;
28+
@property (retain, nonatomic) NSTextView *_resultText;
29+
@property (retain, nonatomic) NSButton *_getButton;
30+
@property (retain, nonatomic) NSTextField *_appTitle;
31+
32+
- (IBAction)Get: (id)sender; // action method to run GET
33+
34+
@end
35+

0 commit comments

Comments
 (0)