-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
2,008 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Xcode | ||
# | ||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
||
## User settings | ||
xcuserdata/ | ||
|
||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) | ||
*.xcscmblueprint | ||
*.xccheckout | ||
|
||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) | ||
build/ | ||
DerivedData/ | ||
*.moved-aside | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
|
||
## Gcc Patch | ||
/*.gcno | ||
*.dmg |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
tinyphone-osx/Tinyphone.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
tinyphone-osx/Tinyphone.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
8 changes: 8 additions & 0 deletions
8
...one-osx/Tinyphone.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>PreviewsEnabled</key> | ||
<false/> | ||
</dict> | ||
</plist> |
78 changes: 78 additions & 0 deletions
78
tinyphone-osx/Tinyphone.xcodeproj/xcshareddata/xcschemes/Tinyphone.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1110" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B3DDA55825515DF700D269C9" | ||
BuildableName = "Tinyphone.app" | ||
BlueprintName = "Tinyphone" | ||
ReferencedContainer = "container:Tinyphone.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B3DDA55825515DF700D269C9" | ||
BuildableName = "Tinyphone.app" | ||
BlueprintName = "Tinyphone" | ||
ReferencedContainer = "container:Tinyphone.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "B3DDA55825515DF700D269C9" | ||
BuildableName = "Tinyphone.app" | ||
BlueprintName = "Tinyphone" | ||
ReferencedContainer = "container:Tinyphone.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# Install appdmg | ||
# npm install -g appdmg | ||
|
||
|
||
# Run program | ||
rm -f tinyphone.dmg | ||
appdmg release-spec.json tinyphone.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"title": "Tinyphone", | ||
"background": "", | ||
"background-color" : "#d6c8c8", | ||
"icon-size": 80, | ||
"contents": [ | ||
{ "x": 192, "y": 200, "type": "file", "path": "release/Tinyphone.app" }, | ||
{ "x": 448, "y": 200, "type": "link", "path": "/Applications" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
#include "app.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Tinyphone-C-Interface.h | ||
// Tinyphone | ||
// | ||
// Created by Kinshuk Bairagi on 04/11/20. | ||
// Copyright © 2020 Kinshuk Bairagi. All rights reserved. | ||
// | ||
|
||
#ifndef Tinyphone_C_Interface_h | ||
#define Tinyphone_C_Interface_h | ||
|
||
// This is the C "ShowOSXAlert" function that will be used | ||
// to invoke a specific Objective-C method FROM C++ | ||
void ShowOSXAlert (const char *message, bool blocking); | ||
|
||
const char* GetAppSupportDirectory(); | ||
|
||
const char* GetOSXProductVersion(); | ||
|
||
const char* GetResourceFilePath(const char * name); | ||
|
||
|
||
#endif /* Tinyphone_C_Interface_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// NSRunAlertPanel.hpp | ||
// Tinyphone | ||
// | ||
// Created by Kinshuk Bairagi on 04/11/20. | ||
// Copyright © 2020 Kinshuk Bairagi. All rights reserved. | ||
// | ||
#import "Tinyphone-C-Interface.h" | ||
#include <string> | ||
|
||
//// An Objective-C class that needs to be accessed from C++ | ||
@interface TinyphoneOC : NSObject | ||
{ | ||
|
||
} | ||
|
||
// The Objective-C member function you want to call from C++ | ||
- (void) ShowAlert:(NSString *) message; | ||
|
||
- (const char *) GetAppSupportDirectory; | ||
|
||
- (const char *) GetProductVersion; | ||
|
||
@end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// | ||
// NSRunAlertPanel.mmm | ||
// Tinyphone | ||
// | ||
// Created by Kinshuk Bairagi on 04/11/20. | ||
// Copyright © 2020 Kinshuk Bairagi. All rights reserved. | ||
// | ||
|
||
|
||
#include <Foundation/Foundation.h> | ||
#import <CoreData/CoreData.h> | ||
#import <AppKit/AppKit.h> | ||
#include "Tinyphone-OC.hpp" | ||
#include "Tinyphone-C-Interface.h" | ||
|
||
@implementation TinyphoneOC | ||
|
||
- (void)ShowAlert: (NSString *) dataPayload { | ||
NSAlert *alert = [[NSAlert alloc] init]; | ||
[alert setMessageText: @"Error"]; | ||
[alert addButtonWithTitle:@"OK"]; | ||
[alert setInformativeText:dataPayload]; | ||
[alert setAlertStyle:NSAlertStyleCritical]; | ||
[alert runModal]; | ||
} | ||
|
||
- (const char *) GetAppSupportDirectory { | ||
NSError *error; | ||
NSFileManager *manager = [NSFileManager defaultManager]; | ||
NSURL *applicationSupport = [manager URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:false error:&error]; | ||
NSString *identifier = [[NSBundle mainBundle] bundleIdentifier]; | ||
// NSString *identifier = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]; | ||
NSURL *folder = [applicationSupport URLByAppendingPathComponent:identifier]; | ||
[manager createDirectoryAtURL:folder withIntermediateDirectories:true attributes:nil error:&error]; | ||
NSString *myString = folder.path; | ||
return myString.UTF8String; | ||
} | ||
|
||
- (const char *) GetProductVersion { | ||
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; | ||
NSString* version = [infoDict objectForKey:@"CFBundleShortVersionString"]; | ||
return version.UTF8String; | ||
} | ||
|
||
@end | ||
|
||
void ShowOSXAlert(const char *dataPayload, bool blocking) { | ||
NSString *convertedString = [[NSString alloc] initWithCString: dataPayload encoding:NSUTF8StringEncoding]; | ||
TinyphoneOC *myInstance = [[TinyphoneOC alloc] init]; | ||
// [myInstance ShowAlert: convertedString]; | ||
[myInstance performSelectorOnMainThread:@selector(ShowAlert:) withObject:convertedString waitUntilDone: blocking ? YES : NO]; | ||
} | ||
|
||
|
||
const char* GetAppSupportDirectory(){ | ||
TinyphoneOC *myInstance = [[TinyphoneOC alloc] init]; | ||
return [myInstance GetAppSupportDirectory]; | ||
} | ||
|
||
const char* GetOSXProductVersion(){ | ||
TinyphoneOC *myInstance = [[TinyphoneOC alloc] init]; | ||
return [myInstance GetProductVersion]; | ||
} | ||
|
||
const char* GetResourceFilePath(const char * name){ | ||
CFURLRef appUrlRef = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("config.json"), NULL, NULL); | ||
if (appUrlRef != nullptr){ | ||
CFStringRef filePathRef = CFURLCopyPath(appUrlRef); | ||
const char* filePath = CFStringGetCStringPtr(filePathRef, kCFStringEncodingUTF8); | ||
CFRelease(filePathRef); | ||
CFRelease(appUrlRef); | ||
return filePath; | ||
} | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
#ifdef __cplusplus | ||
#include <string> | ||
extern "C" { | ||
#endif | ||
|
||
struct UIAccountInfo{ | ||
char * name; | ||
char * status; | ||
int active; | ||
int primary; | ||
}; | ||
typedef struct UIAccountInfo UIAccountInfo; | ||
|
||
struct UIAccountInfoArray { | ||
int count; | ||
UIAccountInfo accounts[10]; | ||
}; | ||
|
||
void Start(); | ||
void Stop(); | ||
struct UIAccountInfoArray Accounts(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.