forked from I2P_Developers/i2p.i2p
Mac OS X Launcher: Unfinished experimental code, adding so other people can compile the xcode project.
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="oLh-xo-y8T">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="macosx"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--Window Controller-->
|
||||||
|
<scene sceneID="g0w-9k-Acs">
|
||||||
|
<objects>
|
||||||
|
<windowController id="oLh-xo-y8T" sceneMemberID="viewController">
|
||||||
|
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="5Sr-7Y-gfA">
|
||||||
|
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||||
|
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||||
|
<rect key="contentRect" x="294" y="362" width="480" height="270"/>
|
||||||
|
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
|
||||||
|
<connections>
|
||||||
|
<outlet property="delegate" destination="oLh-xo-y8T" id="Fxx-ke-F0n"/>
|
||||||
|
</connections>
|
||||||
|
</window>
|
||||||
|
<connections>
|
||||||
|
<segue destination="nXM-BR-Lxj" kind="relationship" relationship="window.shadowedContentViewController" id="3cB-Gf-aj2"/>
|
||||||
|
</connections>
|
||||||
|
</windowController>
|
||||||
|
<customObject id="K5y-Qa-lNJ" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="50" y="118"/>
|
||||||
|
</scene>
|
||||||
|
<!--Console View Controller-->
|
||||||
|
<scene sceneID="MSW-MZ-pqs">
|
||||||
|
<objects>
|
||||||
|
<viewController id="nXM-BR-Lxj" customClass="ConsoleViewController" customModule="I2PLauncher" customModuleProvider="target" sceneMemberID="viewController">
|
||||||
|
<view key="view" id="Omy-Aq-Pw7">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<customObject id="LZW-ak-seY" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="757" y="93"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
@@ -0,0 +1,88 @@
|
|||||||
|
//
|
||||||
|
// EmbeddedConsoleView.swift
|
||||||
|
// I2PLauncher
|
||||||
|
//
|
||||||
|
// Created by Mikal Villa on 08/12/2018.
|
||||||
|
// Copyright © 2018 The I2P Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import AppKit
|
||||||
|
import WebKit
|
||||||
|
|
||||||
|
/*
|
||||||
|
protocol EConsoleViewWrapper {}
|
||||||
|
|
||||||
|
class WebViewSource {
|
||||||
|
class func webView() -> EConsoleViewWrapper {
|
||||||
|
if #available(OSX 10.12, *) {
|
||||||
|
//
|
||||||
|
return EmbeddedConsoleView(coder: NSCoder())!
|
||||||
|
} else {
|
||||||
|
// Sorry
|
||||||
|
return EmbeddedConsoleViewDummy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension EConsoleViewWrapper {
|
||||||
|
static func instantiate(frame frameRect: NSRect) -> EConsoleViewWrapper {
|
||||||
|
return WebViewSource.webView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ConsoleWindowController: NSWindowController {
|
||||||
|
override func windowDidLoad() {
|
||||||
|
super.windowDidLoad()
|
||||||
|
/* let v: NSView = WebViewSource.webView() as! NSView
|
||||||
|
v.wantsLayer = true
|
||||||
|
self.window?.contentView?.addSubview(v)*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConsoleViewController: NSViewController {
|
||||||
|
var webView: WKWebView!
|
||||||
|
let consoleWebUrl = URL(string: "http://127.0.0.1:7657")
|
||||||
|
|
||||||
|
override func loadView() {
|
||||||
|
let webConfiguration = WKWebViewConfiguration()
|
||||||
|
webView = WKWebView(frame: .zero, configuration: webConfiguration)
|
||||||
|
//webView.uiDelegate = self
|
||||||
|
view = webView
|
||||||
|
}
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
|
||||||
|
webView.load(URLRequest(url: consoleWebUrl!))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
@available(OSX 10.12, *)
|
||||||
|
class EmbeddedConsoleView: WKWebView, EConsoleViewWrapper {
|
||||||
|
|
||||||
|
let consoleWebUrl = URL(string: "http://127.0.0.1:7657")
|
||||||
|
|
||||||
|
func setupWebViewForConsole(_ f: NSRect = NSRect(x: 0, y: 0, width: 800, height: 400)) {
|
||||||
|
self.allowsBackForwardNavigationGestures = true
|
||||||
|
self.configuration.preferences.javaScriptEnabled = true
|
||||||
|
self.configuration.preferences.plugInsEnabled = false
|
||||||
|
|
||||||
|
self.load(URLRequest(url: consoleWebUrl!))
|
||||||
|
}
|
||||||
|
|
||||||
|
override func viewWillDraw() {
|
||||||
|
super.viewWillDraw()
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder decoder: NSCoder) {
|
||||||
|
super.init(coder: decoder)
|
||||||
|
self.setupWebViewForConsole()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmbeddedConsoleViewDummy: NSView, EConsoleViewWrapper {}
|
||||||
|
*/
|
||||||
|
|
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// FirefoxManager.swift
|
||||||
|
// I2PLauncher
|
||||||
|
//
|
||||||
|
// Created by Mikal Villa on 08/12/2018.
|
||||||
|
// Copyright © 2018 The I2P Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
|
||||||
|
class FirefoxManager {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user