diff options
author | David Robillard <d@drobilla.net> | 2017-02-23 19:01:03 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-23 19:01:03 +0100 |
commit | c505e04d5b21a317f99c0a8459b090428e845d2e (patch) | |
tree | abd178d9f36e6cecd418a231908a3d040a80f247 /src/osx | |
parent | 0b587a635b966bee3569fbd5569b091827e33ceb (diff) | |
download | jalv-osx.tar.gz jalv-osx.tar.bz2 jalv-osx.zip |
Preliminary native OSX workosx
Diffstat (limited to 'src/osx')
-rw-r--r-- | src/osx/Info.plist | 34 | ||||
-rw-r--r-- | src/osx/Jalv.icns | bin | 0 -> 202450 bytes | |||
-rw-r--r-- | src/osx/MainMenu.xib | 116 | ||||
-rw-r--r-- | src/osx/MainWindow.xib | 31 | ||||
-rw-r--r-- | src/osx/SelectPlugin.xib | 99 | ||||
-rwxr-xr-x | src/osx/bundleify.sh | 79 |
6 files changed, 359 insertions, 0 deletions
diff --git a/src/osx/Info.plist b/src/osx/Info.plist new file mode 100644 index 0000000..3192998 --- /dev/null +++ b/src/osx/Info.plist @@ -0,0 +1,34 @@ +<?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>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleDisplayName</key> + <string>Jalv</string> + <key>CFBundleExecutable</key> + <string>Jalv</string> + <key>CFBundleGetInfoString</key> + <string>Jalv, Copyright © 2016 David Robillard</string> + <key>CFBundleIconFile</key> + <string>Jalv</string> + <key>CFBundleIdentifier</key> + <string>net.drobilla.Jalv</string> + <key>CFBundleName</key> + <string>Jalv</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>1.0.0</string> + <key>CFBundleSignature</key> + <string>djlv</string> + <key>LSApplicationCategoryType</key> + <string>public.app-category.music</string> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2016 David Robillard.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> +</dict> +</plist> diff --git a/src/osx/Jalv.icns b/src/osx/Jalv.icns Binary files differnew file mode 100644 index 0000000..f3e02ef --- /dev/null +++ b/src/osx/Jalv.icns diff --git a/src/osx/MainMenu.xib b/src/osx/MainMenu.xib new file mode 100644 index 0000000..63148ba --- /dev/null +++ b/src/osx/MainMenu.xib @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> + <dependencies> + <deployment identifier="macosx"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> + </dependencies> + <objects> + <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> + <connections> + <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/> + </connections> + </customObject> + <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> + <customObject id="Voe-Tx-rLC" customClass="AppDelegate"/> + <customObject id="YLy-65-1bz" customClass="NSFontManager"/> + <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> + <items> + <menuItem title="Jalv" id="1Xt-HY-uBw"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Jalv" systemMenu="apple" id="uQy-DD-JDr"> + <items> + <menuItem title="About Jalv" id="5kV-Vb-QxS"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> + <menuItem title="Hide Jalv" keyEquivalent="h" id="Olw-nP-bQN"> + <connections> + <action selector="hide:" target="-1" id="PnN-Uc-m68"/> + </connections> + </menuItem> + <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> + <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> + <connections> + <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/> + </connections> + </menuItem> + <menuItem title="Show All" id="Kd2-mp-pUS"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/> + </connections> + </menuItem> + <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> + <menuItem title="Quit Jalv" keyEquivalent="q" id="4sb-4s-VLi"> + <connections> + <action selector="terminate:" target="-1" id="Te7-pn-YzF"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="File" id="dMs-cI-mzQ"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="File" id="bib-Uj-vzu"> + <items> + <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9"> + <connections> + <action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/> + </connections> + </menuItem> + <menuItem title="Open Recent" id="tXI-mr-wws"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ"> + <items> + <menuItem title="Clear Menu" id="vNY-rz-j42"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/> + <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG"> + <connections> + <action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/> + </connections> + </menuItem> + <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV"> + <connections> + <action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/> + </connections> + </menuItem> + <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A"> + <connections> + <action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/> + </connections> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Presets" id="PQG-aa-8LK"> + <modifierMask key="keyEquivalentModifierMask"/> + <menu key="submenu" title="Presets" id="EjZ-NH-0oW"> + <items> + <menuItem title="Save Preset..." id="TaK-sa-Ngz"> + <modifierMask key="keyEquivalentModifierMask"/> + </menuItem> + <menuItem title="Delete Current Preset..." id="Wx1-UF-PfU"> + <modifierMask key="keyEquivalentModifierMask"/> + </menuItem> + </items> + </menu> + </menuItem> + <menuItem title="Help" id="wpr-3q-Mcd"> + <modifierMask key="keyEquivalentModifierMask"/> + </menuItem> + </items> + </menu> + </objects> +</document> diff --git a/src/osx/MainWindow.xib b/src/osx/MainWindow.xib new file mode 100644 index 0000000..c07da00 --- /dev/null +++ b/src/osx/MainWindow.xib @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1108" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> + <dependencies> + <deployment identifier="macosx"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> + </dependencies> + <objects> + <customObject id="-2" userLabel="File's Owner" customClass="NSWindowController"> + <connections> + <outlet property="window" destination="VXJ-Fk-6kf" id="l2U-Nv-Glb"/> + </connections> + </customObject> + <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> + <window title="Jalv" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" animationBehavior="default" id="VXJ-Fk-6kf"> + <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> + <rect key="contentRect" x="335" y="390" width="480" height="360"/> + <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/> + <view key="contentView" id="OCp-hb-yvX"> + <rect key="frame" x="0.0" y="0.0" width="480" height="360"/> + <autoresizingMask key="autoresizingMask"/> + </view> + <point key="canvasLocation" x="420" y="400"/> + </window> + <customObject id="G8J-6G-JMX" customClass="AppDelegate"> + <connections> + <outlet property="window" destination="VXJ-Fk-6kf" id="j1L-IO-oxb"/> + </connections> + </customObject> + </objects> +</document> diff --git a/src/osx/SelectPlugin.xib b/src/osx/SelectPlugin.xib new file mode 100644 index 0000000..a5cd0fd --- /dev/null +++ b/src/osx/SelectPlugin.xib @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> + <dependencies> + <deployment identifier="macosx"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> + </dependencies> + <objects> + <customObject id="-2" userLabel="File's Owner"/> + <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> + <window title="Select Plugin" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="QvC-M9-y7g"> + <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> + <rect key="contentRect" x="196" y="240" width="480" height="270"/> + <rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/> + <view key="contentView" horizontalHuggingPriority="1" verticalHuggingPriority="1" id="EiT-Mj-1SZ"> + <rect key="frame" x="0.0" y="0.0" width="480" height="270"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <scrollView horizontalHuggingPriority="1" verticalHuggingPriority="1" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4pG-7L-hBF"> + <rect key="frame" x="0.0" y="0.0" width="480" height="271"/> + <clipView key="contentView" id="fdG-PK-0lT"> + <rect key="frame" x="1" y="23" width="478" height="247"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" headerView="aqO-vT-hPD" id="TZA-3C-Hwj"> + <rect key="frame" x="0.0" y="0.0" width="478" height="247"/> + <autoresizingMask key="autoresizingMask"/> + <size key="intercellSpacing" width="3" height="2"/> + <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> + <tableViewGridLines key="gridStyleMask" vertical="YES"/> + <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/> + <tableColumns> + <tableColumn identifier="URI" width="116" minWidth="40" maxWidth="1000" id="eOU-Hb-AhL"> + <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="URI"> + <font key="font" metaFont="smallSystem"/> + <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> + </tableHeaderCell> + <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="UOr-9T-74U"> + <font key="font" metaFont="system"/> + <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> + </tableColumn> + <tableColumn identifier="Name" width="356" minWidth="40" maxWidth="1000" id="nyV-6f-pju"> + <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name"> + <font key="font" metaFont="smallSystem"/> + <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> + </tableHeaderCell> + <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Qin-ze-9Kf"> + <font key="font" metaFont="system"/> + <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> + </tableColumn> + </tableColumns> + <connections> + <outlet property="dataSource" destination="CGu-bu-G4s" id="mMt-kO-SCQ"/> + <outlet property="delegate" destination="CGu-bu-G4s" id="Ke5-ln-be4"/> + </connections> + </tableView> + </subviews> + <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> + </clipView> + <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="CdQ-z1-cai"> + <rect key="frame" x="1" y="7" width="0.0" height="16"/> + <autoresizingMask key="autoresizingMask"/> + </scroller> + <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="35h-Jq-9bx"> + <rect key="frame" x="-15" y="23" width="16" height="0.0"/> + <autoresizingMask key="autoresizingMask"/> + </scroller> + <tableHeaderView key="headerView" id="aqO-vT-hPD"> + <rect key="frame" x="0.0" y="0.0" width="478" height="23"/> + <autoresizingMask key="autoresizingMask"/> + </tableHeaderView> + </scrollView> + </subviews> + <constraints> + <constraint firstAttribute="trailing" secondItem="4pG-7L-hBF" secondAttribute="trailing" id="FY5-7s-SAO"/> + <constraint firstItem="4pG-7L-hBF" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="-1" id="YiE-ES-X8y"/> + <constraint firstItem="4pG-7L-hBF" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="ca2-7v-KVw"/> + <constraint firstItem="4pG-7L-hBF" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="-1" id="dpl-Gw-hgW"/> + <constraint firstAttribute="bottom" secondItem="4pG-7L-hBF" secondAttribute="bottom" id="lTW-Ah-X77"/> + </constraints> + </view> + <point key="canvasLocation" x="75" y="42"/> + </window> + <customObject id="CGu-bu-G4s" customClass="TableController"/> + <customObject id="kUh-F5-FTj" customClass="AppDelegate"> + <connections> + <outlet property="selectWindow" destination="QvC-M9-y7g" id="Kwk-RP-6Dd"/> + </connections> + </customObject> + </objects> +</document> diff --git a/src/osx/bundleify.sh b/src/osx/bundleify.sh new file mode 100755 index 0000000..3806bd2 --- /dev/null +++ b/src/osx/bundleify.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +if [ "$#" != 3 ]; then + echo "USAGE: $0 LIB_PREFIX BUNDLE EXE"; + exit 1; +fi + +prefix=$1 +bundle=$2 +exe=$3 + +mkdir -p "$bundle/Contents/lib" + +# Replace Control with Command in key bindings +sed -i '' 's/GDK_CONTROL_MASK/GDK_META_MASK/' $bundle/Contents/patchage.ui + +# Copy font configuration files +cp $prefix/etc/fonts/fonts.conf $bundle/Contents/Resources + +# Copy GTK and pango modules +mkdir -p "$bundle/Contents/lib/modules" +mkdir -p "$bundle/Contents/lib/gtk-2.0/engines" +cp $prefix/lib/gtk-2.0/2.10.0/engines/libquartz.so $bundle/Contents/lib/gtk-2.0/engines +cp $(find /usr/local/Cellar/pango -name '*basic-coretext*') $bundle/Contents/lib/modules + +# Copy GdkPixbuf loaders +mkdir -p $bundle/Contents/lib/gdk-pixbuf-2.0/2.10.0/loaders/ +for fmt in icns png; do + cp $prefix/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-$fmt.so \ + $bundle/Contents/lib/gdk-pixbuf-2.0/2.10.0/loaders/; +done + +chmod -R 755 $bundle/Contents/lib/* + +# Copy libraries depended on by the executable to bundle +libs="`otool -L $exe | grep '\.dylib\|\.so' | grep '/User\|/usr/local' | sed 's/(.*//'`" +for l in $libs; do + cp $l $bundle/Contents/lib/; +done +chmod 755 $bundle/Contents/lib/* + +# ... recursively +while true; do + newlibs=$libs + + # Copy all libraries this library depends on to bundle + for l in $(find $bundle -name '*.dylib' -or -name '*.so'); do + reclibs="`otool -L $l | grep '\.dylib\|\.so' | grep '/User\|/usr/local' | sed 's/(.*//'`" + for rl in $reclibs; do + cp $rl $bundle/Contents/lib/; + done + chmod 755 $bundle/Contents/lib/* + newlibs=$(echo "$newlibs"; echo "$reclibs") + done + + # Exit once we haven't added any new libraries + newlibs=$(echo "$newlibs" | sort | uniq) + if [ "$newlibs" = "$libs" ]; then + break; + fi + libs=$newlibs +done + +echo "Bundled libraries:" +echo "$libs" + +for l in $libs; do + lname=`echo $l | sed 's/.*\///'` + lid="@executable_path/lib/$lname" + lpath="$bundle/Contents/lib/$lname" + install_name_tool -id $lid $lpath + install_name_tool -change $l $lid $exe + for j in `find $bundle -name '*.so' -or -name '*.dylib'`; do + install_name_tool -change $l $lid $j + done; +done + +echo "External library references:" +otool -L $exe `find $bundle -name '*.so' -or -name '*.dylib'` | grep -v ':' | grep -v '@executable_path' | sort | uniq |