diff --git a/OpenBoard.pro b/OpenBoard.pro index 50a7cfa1..a1b2ee3e 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -71,11 +71,6 @@ include(src/pdf-merger/pdfMerger.pri) include(plugins/plugins.pri) INCLUDEPATH += plugins/cffadaptor/src -#ThirdParty -DEPENDPATH += $$THIRD_PARTY_PATH/quazip/ -INCLUDEPATH += $$THIRD_PARTY_PATH/quazip/ -include($$THIRD_PARTY_PATH/quazip/quazip.pri) - FORMS += resources/forms/mainWindow.ui \ resources/forms/preferences.ui \ resources/forms/brushProperties.ui \ @@ -166,11 +161,15 @@ macx { LIBS += -lcrypto LIBS += -L/usr/local/opt/openssl/lib - LIBS += -L/usr/local/opt/quazip/lib + LIBS += -L/usr/local/opt/quazip/lib -lquazip LIBS += -L/usr/local/opt/ffmpeg/lib INCLUDEPATH += /usr/local/opt/openssl/include INCLUDEPATH += /usr/local/opt/ffmpeg/include - INCLUDEPATH += /usr/local/opt/quazip/include + INCLUDEPATH += /usr/local/opt/quazip/include/quazip + + LIBS += -L/usr/local/opt/poppler/lib -lpoppler + INCLUDEPATH += /usr/local/opt/poppler/include + INCLUDEPATH += /usr/local/opt/poppler/include/poppler CONFIG(release, debug|release):CONFIG += x86_64 CONFIG(debug, debug|release):CONFIG += x86_64 diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index 45d818e8..7b3b26c6 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -34,9 +34,15 @@ #include "UBCFFConstants.h" //THIRD_PARTY_WARNINGS_DISABLE -#include "quazip.h" -#include "quazipfile.h" -#include "quazipfileinfo.h" +#ifdef Q_OS_OSX + #include + #include + #include +#else + #include "quazip.h" + #include "quazipfile.h" + #include "quazipfileinfo.h" +#endif //THIRD_PARTY_WARNINGS_ENABLE UBCFFAdaptor::UBCFFAdaptor() diff --git a/release_scripts/osx/refnum/dmgutil.pl b/release_scripts/osx/refnum/dmgutil.pl new file mode 100644 index 00000000..3d250242 --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil.pl @@ -0,0 +1,728 @@ +#!/usr/bin/perl -w +#============================================================================ +# NAME: +# dmgutil.pl +# +# DESCRIPTION: +# Disk image creation utility. +# +# COPYRIGHT: +# Copyright (c) 2006-2008, refNum Software +# +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# o Redistributions of source code must retain the above +# copyright notice, this list of conditions and the following +# disclaimer. +# +# o Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# o Neither the name of refNum Software nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================ +# Imports +#---------------------------------------------------------------------------- +use strict; +use Getopt::Long; + + + + + +#============================================================================ +# Constants +#---------------------------------------------------------------------------- +my $kLogging = "-quiet"; + +my $Rez = "/Developer/Tools/Rez"; +my $SetFile = "/Developer/Tools/SetFile"; + +my $kManPage = <$theFile") or die "Can't open $theFile for writing: $!\n"; + print OUTPUT $theScript; + close(OUTPUT); + + + + # And execute it + system("osascript", $theFile); + unlink($theFile); +} + + + + + +#============================================================================ +# isVolume : Is a path to the root of a volume? +#---------------------------------------------------------------------------- +sub isVolume +{ + + + # Retrieve our parameters + my ($thePath) = @_; + + + + # Check the state + # + # After stripping out the leading /Volumes, any further slashes + # indicate we have a folder rather than a volume. + $thePath =~ s/\/Volumes\///; + + my $isVolume = ($thePath =~ /.*\/.*/) ? 0 : 1; + + return($isVolume); +} + + + + + +#============================================================================ +# setFolderState : Set the state for a folder. +#---------------------------------------------------------------------------- +sub setFolderState +{ + + + # Retrieve our parameters + my ($thePath, $iconSize, $flagToolbar, $bgImage, $bgColor) = @_; + + + + # Initialise ourselves + my $cmdBackground = ""; + my $cmdIconSize = ""; + my $cmdToolbar = ""; + + + + # Prepare the background + # + # As of 10.5, the Finder refuses to manipulate files whose names start with + # a period (rdar://5582578). As such we need to use an underscore for the + # image, then make it invisible using SetFile. + if (-f $bgImage) + { + $bgImage =~ /.*\.(\w+)/; + my $dstImage = "$thePath/_Background.$1"; + + `cp "$bgImage" "$dstImage"`; + + $cmdBackground .= "set theImage to posix file \"$dstImage\"\n"; + $cmdBackground .= " set background picture of theOptions to theImage\n"; + $cmdBackground .= " do shell script \"/Developer/Tools/SetFile -a V '$dstImage'\"\n"; + } + + elsif ($bgColor ne "") + { + $cmdBackground = "set background color of theOptions to {$bgColor} as RGB color"; + } + + + + # Prepare the icon size + if ($iconSize != 0) + { + $cmdIconSize = "set icon size of theOptions to $iconSize"; + } + + + + # Prepare the toolbar + # + # The window must be made visible in order to change the toolbar state. + if ($flagToolbar ne "") + { + $cmdToolbar = " open theWindow \n"; + $cmdToolbar .= " set toolbar visible of theWindow to $flagToolbar \n"; + $cmdToolbar .= " close theWindow \n"; + } + + + + # Identify the target + # + # AppleScript requires the correct nomenclature for the target item. + my $theTarget = "folder \"$thePath\""; + + if (isVolume($thePath)) + { + $theTarget =~ s/folder "\/Volumes\//disk "/; + } + + + + # Set the folder state + # + # Once a change has been made, it must be flushed to disk with update. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= " set theWindow to window of theTarget \n"; + $theScript .= "\n"; + $theScript .= " set current view of theWindow to icon view \n"; + $theScript .= " set theOptions to icon view options of theWindow \n"; + $theScript .= " set arrangement of theOptions to not arranged \n"; + $theScript .= "\n"; + $theScript .= " $cmdBackground\n"; + $theScript .= " $cmdIconSize \n"; + $theScript .= " $cmdToolbar \n"; + $theScript .= "\n"; + $theScript .= " update theTarget\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# setCustomIcon : Set a custom icon. +#---------------------------------------------------------------------------- +sub setCustomIcon +{ + + + # Retrieve our parameters + my ($thePath, $theIcon) = @_; + + + + # Validate our state + # + # We require several tools inside /Developer/Tools. + die("Setting an icon requires $Rez") if (! -e $Rez); + die("Setting an icon requires $SetFile") if (! -e $SetFile); + + + + # Prepare the flags + # + # Prior to Mac OS X 10.4, SetFile can only set an attribute if it is + # first cleared (rdar://3738867). + my $sysVers = `uname -r`; + my $setHidden = ($sysVers =~ /^[0-7]\./) ? "vV" : "V"; + my $setIcon = ($sysVers =~ /^[0-7]\./) ? "cC" : "C"; + + + + # Set a volume icon + # + # Volume custom icons are contained in a .VolumeIcon.icns file. + if (isVolume($thePath)) + { + my $iconFile = "$thePath/.VolumeIcon.icns"; + + `cp "$theIcon" "$iconFile"`; + + `$SetFile -a $setHidden "$iconFile"`; + `$SetFile -a $setIcon "$thePath"`; + } + + + # Set a folder icon + # + # Folder custom icons are contained in an ('icns', -16455) resource, + # placed in an invisible "Icon\r" file inside the folder. + elsif (-d $thePath) + { + my $iconFile = "$thePath/Icon\r"; + my $tmpR = "/tmp/dmgutil.r"; + + `echo "read 'icns' (-16455) \\"$theIcon\\";\n" > $tmpR`; + `cd /tmp; $Rez dmgutil.r -append -o "$iconFile"`; + + `$SetFile -a $setHidden "$iconFile"`; + `$SetFile -a $setIcon "$thePath"`; + + unlink($tmpR); + } + + + # Set a file icon + # + # File custom icons are contained in an ('icns', -16455) resource. + else + { + my $tmpR = "/tmp/dmgutil.r"; + + `echo "read 'icns' (-16455) \\"$theIcon\\";\n" > $tmpR`; + `cd /tmp; $Rez dmgutil.r -append -o "$thePath"`; + + `$SetFile -a $setIcon "$thePath"`; + + unlink($tmpR); + } +} + + + + + +#============================================================================ +# setWindowPos : Set the position of a window. +#---------------------------------------------------------------------------- +sub setWindowPos +{ + + + # Retrieve our parameters + my ($thePath, $posX, $posY, $theWidth, $theHeight) = @_; + + + + # Initialise ourselves + my $bottom = $posY + $theHeight; + my $right = $posX + $theWidth; + + + + # Identify the target + # + # AppleScript requires the correct nomenclature for the target item. + my $theTarget = "folder \"$thePath\""; + + if (isVolume($thePath)) + { + $theTarget =~ s/folder "\/Volumes\//disk "/; + } + + + + # Set the window position + # + # In theory, the "set bounds" command is all that should be necessary + # to set the bounds of a Finder window. + # + # Unfortunately, under 10.4 this will result in a window that will be + # taller than the specified size when the window is next opened. + # + # To reliably set the bounds of a window we must open the window, show + # the status bar, and set the window bounds to be 20 pixels taller (the + # height of the status bar) than necessary. + # + # The status bar can then be hidden, the window closed, and the bounds + # bounds will be the desired size when the window is next opened. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= " set theWindow to window of theTarget \n"; + $theScript .= "\n"; + $theScript .= " open theWindow \n"; + $theScript .= " set statusbar visible of theWindow to true \n"; + $theScript .= " set bounds of theWindow to {$posX, $posY, $right, $bottom+20} \n"; + $theScript .= " set statusbar visible of theWindow to false \n"; + $theScript .= " close theWindow \n"; + $theScript .= "\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# setIconPos : Set the position of an icon. +#---------------------------------------------------------------------------- +sub setIconPos +{ + + + # Retrieve our parameters + my ($theFile, $posX, $posY) = @_; + + + + # Identify the target + # + # Since the 'posix file' command follows symlinks, in order to set the + # position of a symlink (vs its target) we need to use an HFS path and + # reference it as a file rather than an alias. + my $theTarget = "alias (posix file \"$theFile\")"; + + if (-l $theFile) + { + $theTarget = $theFile; + + $theTarget =~ s/\/Volumes\///; + $theTarget =~ s/\//:/g; + $theTarget = "file \"$theTarget\""; + } + + + + # Set the icon position + # + # Once a change has been made, it must be flushed to disk with update. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= "\n"; + $theScript .= " set position of theTarget to {$posX, $posY} \n"; + $theScript .= " update theTarget\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# doOpen : Open a new disk image. +#---------------------------------------------------------------------------- +sub doOpen +{ + + + # Retrieve our parameters + my ($dmgFile, $volName) = @_; + + + + # Clean up any previous image + system("rm", "-f", "$dmgFile.sparseimage"); + system("rm", "-f", "$dmgFile"); + + + + # Create the image + # + # A large sparse disk image is created, which will be shrunk down + # and compressed when the disk image is finally closed. + print " creating $dmgFile\n" if ($kLogging eq "-quiet"); + + system("hdiutil", "create", $dmgFile, + "-volname", $volName, + "-megabytes", "1000", + "-type", "SPARSE", + "-fs", "HFS+", + $kLogging); + + system("hdiutil", "mount", $kLogging, "$dmgFile.sparseimage"); +} + + + + + +#============================================================================ +# doClose : Close a disk image. +#---------------------------------------------------------------------------- +sub doClose +{ + + + # Retrieve our parameters + my ($dmgFile, $volName) = @_; + + + + # Bless the volume + # + # Blessing the volume ensures that the volume always opens in the current + # view, overriding the user's "Open new windows in column view" preference. + system("bless", "--openfolder", "/Volumes/$volName"); + + + + # Compress the image + # + # On 10.5, the disk image must be ejected rather than unmounted to allow + # it to be converted from a sparse image to a compressed image. + print " compressing $dmgFile\n" if ($kLogging eq "-quiet"); + + system("hdiutil", "eject", $kLogging, "/Volumes/$volName"); + + system("hdiutil", "convert", "$dmgFile.sparseimage", + "-format", "UDZO", + "-o", $dmgFile, + "-imagekey", "zlib-level=9", + $kLogging); + + + + # Clean up + system("rm", "-f", "$dmgFile.sparseimage"); +} + + + + + +#============================================================================ +# doSet : Set a file/folder state. +#---------------------------------------------------------------------------- +sub doSet +{ + + + # Retrieve our parameters + my ($thePath, $posX, $posY, $theWidth, $theHeight, $iconSize, $theIcon, $bgImage, $bgColor, $flagToolbar) = @_; + + + + # Set the custom icon + if ($theIcon ne "") + { + setCustomIcon($thePath, $theIcon); + } + + + + # Set the folder state + if ($iconSize != 0 || $bgImage ne "" || $bgColor ne "" || $flagToolbar ne "") + { + setFolderState($thePath, $iconSize, $flagToolbar, $bgImage, $bgColor); + } + + + + # Set the position + # + # Window position must be set after applying the folder state. + if ($posX != 0 && $posY != 0) + { + if ($theWidth != 0 && $theHeight != 0) + { + setWindowPos($thePath, $posX, $posY, $theWidth, $theHeight); + } + else + { + setIconPos($thePath, $posX, $posY); + } + } +} + + + + + +#============================================================================ +# dmgUtil : Manipulate a disk image. +#---------------------------------------------------------------------------- +sub dmgUtil +{ + + + # Retrieve our parameters + my ($doOpen, $doClose, $doSet) = (0, 0, 0); + my ($posX, $posY, $theWidth, $theHeight, $iconSize) = (0, 0, 0, 0, 0); + my ($volName, $theIcon, $bgImage, $bgColor, $flagToolbar) = ("", "", "", "", ""); + + GetOptions( "--open+", => \$doOpen, + "--close+", => \$doClose, + "--set+", => \$doSet, + "--volume=s", => \$volName, + "--x=i", => \$posX, + "--y=i", => \$posY, + "--width=i", => \$theWidth, + "--height=i", => \$theHeight, + "--iconsize=i", => \$iconSize, + "--icon=s", => \$theIcon, + "--background=s", => \$bgImage, + "--bgcol=s", => \$bgColor, + "--toolbar=s", => \$flagToolbar); + + my ($thePath) = @ARGV; + + $thePath = "" if (!defined($thePath)); + + + + # Perform the action + if ($doOpen && $thePath ne "" && $volName ne "") + { + doOpen($thePath, $volName); + } + + elsif ($doClose && $thePath ne "" && $volName ne "") + { + doClose($thePath, $volName); + } + + elsif ($doSet && $thePath ne "") + { + doSet($thePath, $posX, $posY, $theWidth, $theHeight, $iconSize, $theIcon, $bgImage, $bgColor, $flagToolbar); + } + + else + { + print $kManPage; + } +} + + + + + +#============================================================================ +# Script entry point +#---------------------------------------------------------------------------- +dmgUtil(); diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/index.html b/release_scripts/osx/refnum/dmgutil/Documentation/index.html new file mode 100644 index 00000000..ee7f8f46 --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/Documentation/index.html @@ -0,0 +1,145 @@ + + + + refNum › dmgutil + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + + + + + + +
+ + + + + +

dmgutil

+

+dmgutil is a command line tool for creating, configuring, and compressing Mac OS X +disk images for distribution. +

+ +

+dmgutil allows you to automate your build process, preparing a release without pre-existing +templates or user interaction. +

+ +

+dmgutil can adjust the size, position, and appearance of Finder windows. It can also apply +custom icons to volumes, folders, or files and assign a license agreement. +

+ +
+Download +  +GitHub +
+ + + + + +

Using dmgutil

+

+To create a new disk image for your "MyApp 1.0" release, invoke dmgutil as: +

+ +
dmgutil.pl --open --volume="MyApp 1.0" myapp_1.0.dmg +
+ +

+Once the disk image has been populated with files, invoke dmgutil to configure it: +

+ +
dmgutil.pl --set --iconsize=128 --background=flowers.jpg "/Volumes/MyApp 1.0" +dmgutil.pl --set --x=20 --y=60 --width=300 --height=200 "/Volumes/MyApp 1.0" +
+ +

+You can also use dmgutil to set the position of file or folder icons within the window: +

+ +
dmgutil.pl --set --x=100 --y=100 "/Volumes/MyApp 1.0/Read Me.rtf" +dmgutil.pl --set --x=200 --y=100 "/Volumes/MyApp 1.0/MyApp.app" +
+ +

+dmgutil can also adjust the background color or toolbar visibility of the window, and +apply custom icons to the volume or its contents. +

+ +

+Once the volume has been prepared, compress the disk image with: +

+ +
dmgutil.pl --close --volume="MyApp 1.0" myapp_1.0.dmg +
+ +

+By invoking dmgutil from a post-build shell script, builds can be automatically converted +into a user-friendly disk image for distribution. +

+ + + + + +
+ + + +
+
+ +
+ + + + + + + + diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/licence.html b/release_scripts/osx/refnum/dmgutil/Documentation/licence.html new file mode 100644 index 00000000..db3482fa --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/Documentation/licence.html @@ -0,0 +1,124 @@ + + + + refNum › dmgutil › Licence + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + + + + + + +
+ + + + + +

Licence

+

+dmgutil is distributed under the Open Source BSD licence: +

+ +
+

+dmgutil is Copyright © 2006-2010, refNum Software
+All rights reserved. +

+ +

+Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: +

+ +
    +
  • Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer.
  • + +
  • Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution.
  • + +
  • Neither the name of refNum Software, Nano, nor the names of its contributors may be + used to endorse or promote products derived from this software without specific prior + written permission.
  • +
+ +

+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +

+
+ +

+This licence allows usage in both Open Source and commercial software, and does not require any +reciprocal licencing or release of source code when incorporated into commercial software. +

+ + + + + +
+ + + +
+
+ +
+ + + + + + + + diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/css/refnum.css b/release_scripts/osx/refnum/dmgutil/Documentation/src/css/refnum.css new file mode 100644 index 00000000..0f5923dd --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/Documentation/src/css/refnum.css @@ -0,0 +1,380 @@ +/* Global */ +html { + overflow-y: scroll; +} +body { + background: #600d0d url("../img/background.jpg") no-repeat fixed center top; + font: 12px "Lucida Grande", "Arial", sans-serif; +} + +#content { + width: 820px; + min-height: 500px; + margin: 75px auto 10px auto; +} + +#footer { + color: #eeeeee; + font: 9px "Monaco", "Courier", monospace; + text-align: center; + text-shadow: #444444 0px 2px 2px; +} + +#footer a { + color: #eeeeee; + border-bottom: none; + text-decoration: none; +} + +.caption { + color: #cccccc; + font: italic 11px "Lucida Grande", "Arial", sans-serif; +} + +h1, h2, h3, h4, h5 { + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05); +} + +a img { border: none; } +a:focus { outline: none; } +a:link { border-bottom: 1px dotted; text-decoration: none; } +a:visited { border-bottom: 1px dotted; text-decoration: none; } +a:active { border-bottom: 1px dotted; text-decoration: none; } +a:hover { border-bottom: 1px dotted; text-decoration: none; } +a.plain { border-bottom: none; } + +h1 { font-size: x-large; } +h2 { font-size: large; } +h3 { font-size: medium; } +h4 { font-size: small; } +h5 { font-size: x-small; } +h6 { font-size: xx-small; } + + + + + +/* Navigation */ +#nav { + width: 820px; + height: 45px; + margin-top: 20px; + margin-bottom: 10px; +} + +#nav_bar { + float: right; + padding-right: 15px; +} + +#nav a { + display: -moz-inline-stack; + display: inline-block; + height: 45px; + border-bottom: none; +} + +#nav a#apps { width:78px; } +#nav a#apps { background-image:url("../img/nav_apps_normal.png"); } +#nav a#apps:hover { background-image:url("../img/nav_apps_hover.png"); } +#nav a#apps.selected { background-image:url("../img/nav_apps_selected.png"); } + +#nav a#projects { width:90px; } +#nav a#projects { background-image:url("../img/nav_projects_normal.png"); } +#nav a#projects:hover { background-image:url("../img/nav_projects_hover.png"); } +#nav a#projects.selected { background-image:url("../img/nav_projects_selected.png"); } + +#nav a#contact { width:86px; } +#nav a#contact { background-image:url("../img/nav_contact_normal.png"); } +#nav a#contact:hover { background-image:url("../img/nav_contact_hover.png"); } +#nav a#contact.selected { background-image:url("../img/nav_contact_selected.png"); } + +#nav a#dev { width:78px; } +#nav a#dev { background-image:url("../img/nav_dev_normal.png"); } +#nav a#dev:hover { background-image:url("../img/nav_dev_hover.png"); } +#nav a#dev.selected { background-image:url("../img/nav_dev_selected.png"); } + + + + + +/* Menu */ +#menu { + margin: 0px; + padding: 0px; + width: 140px; + font-size: 11px; + line-height: 17px; + list-style-type: none; +} + +#menu .subtitle { + margin-top: 10px; + font-weight: bold; + color: #222222; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05); +} + +#menu a { + color: #444444; + text-decoration: none; + border-bottom: none; +} + +#menu li a:hover, +#menu li a:active { + border-bottom: 1px dotted; + text-decoration: none; +} + + + + + +/* Page */ +#page_strap_frame { + width: 820px; + height: 215px; +} + +#page_strap_content { + width: 820px; + height: 215px; +} + +#page_body { + background: url("../img/page_body.png") repeat-y; + width: 820px; + min-height: 190px; +} + +#page_content { + padding: 5px 40px; +} + +#page_footer { + background: url("../img/page_footer.png"); + width: 820px; + height: 30px; +} + + + + + +/* Home */ +#logo { + width: 440px; + height: 620px; + margin: auto; +} + +#logo_offset { + height: 120px; +} + + + + + +/* Tables */ +table.icons { + border-spacing: 40px 5px; +} + +table.icons td { + vertical-align: top; + text-align: center; + width: 128px; +} + +table.icons img { + width: 128px; + height: 128px; +} + +table.badges { + margin: 40px auto 20px auto; + width: 80%; +} + +table.list_header { + background: #ddddff; + font-weight: bold; + line-height: 200%; + margin: 20px 10px 0px 10px; + padding-left: 10px; + text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); + width: 95%; + + -moz-border-radius-topright: 5px; + -moz-border-radius-topleft: 5px; + + -webkit-border-top-right-radius: 5px; + -webkit-border-top-left-radius: 5px; +} + +table.list { + background: #eeeeff; + background: -webkit-gradient(linear, left top, left bottom, from(#eeeeff), to(#fcfcff)); + margin: 0px 10px 0px 10px; + padding-left: 10px; + width: 95%; + + -moz-border-radius-bottomright: 5px; + -moz-border-radius-bottomleft: 5px; + + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; +} + +table.list th { + font-weight: normal; + text-align: left; + width: 150px; +} + + + + + +/* Boxes */ +.box { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.box_image { + border: 1px solid #888888; +} + +.box_button { + text-align: center; + margin: 24px; +} + +.box_code_yellow { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + font-family: monospace; + white-space: pre; + font-size: 12px; + border: 1px solid #bbbbbb; + padding: 10px; + background: #ffffe0; + background: -webkit-gradient(linear, left top, right top, from(#fffff0), to(#fffffd)); +} + +.box_licence { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + font-family: monospace; + font-size: 12px; + background-color: #eeeeff; + border: 1px solid #bbbbbb; + padding: 10px; + background: -webkit-gradient(linear, left top, right top, from(#eeeeff), to(#fefeff)); +} + + + + + +/* Layout */ +.padding20 { + padding: 20px; +} + +.width450 { + width: 450px; + height: auto; +} + + + + + +/* Buttons */ +a.button { + display: inline-block; + height: 23px; + padding: 0 0 0 3px; + font-size: 11px; + font-weight: bold; + color: #333333; + text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.9); + background: url('../img/button_thin_cell.png') 0 0 no-repeat; + white-space: nowrap; + border: none; + overflow: visible; + cursor: pointer; + text-decoration: none; +} + +a.button>span { + display: block; + height: 23px; + padding: 0 10px 0 8px; + line-height: 23px; + background: url('../img/button_thin_cell.png') 100% 0 no-repeat; +} + +a.button:hover, +a.button:focus { + color: #ffffff; + text-decoration: none; + text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3); + background-position: 0 -30px; +} +a.button:hover>span, +a.button:focus>span { + background-position: 100% -30px; +} + +a.button:active { + background-position: 0 -60px; +} + +a.button:active>span { + background-position: 100% -60px; +} + + +a.icon_download .icon, +a.icon_github .icon { + float: left; + margin-left: -4px; + width: 18px; + height: 22px; + background: url('../img/button_thin_icons.png') 0 0 no-repeat; +} + + +a.icon_download .icon { + background-position: -0px 0; +} + +a.icon_download:hover .icon, +a.icon_download:focus .icon { + background-position: -0px -25px; +} + + +a.icon_github .icon { + background-position: -20px 0; +} + +a.icon_github:hover .icon, +a.icon_github:focus .icon { + background-position: -20px -25px; +} + + + + + + + + + + \ No newline at end of file diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/background.jpg b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/background.jpg new file mode 100644 index 00000000..6d810a3a Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/background.jpg differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_cell.png b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_cell.png new file mode 100644 index 00000000..e69f0eb4 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_cell.png differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_icons.png b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_icons.png new file mode 100644 index 00000000..15ca7ef4 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/button_thin_icons.png differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_body.png b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_body.png new file mode 100644 index 00000000..e6fbaf89 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_body.png differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_footer.png b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_footer.png new file mode 100644 index 00000000..f1f1f8f1 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_footer.png differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.jpg b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.jpg new file mode 100644 index 00000000..81a576c2 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.jpg differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.png b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.png new file mode 100644 index 00000000..5424b893 Binary files /dev/null and b/release_scripts/osx/refnum/dmgutil/Documentation/src/img/page_strap_dmgutil.png differ diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/src/js/refnum.js b/release_scripts/osx/refnum/dmgutil/Documentation/src/js/refnum.js new file mode 100644 index 00000000..cf70b435 --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/Documentation/src/js/refnum.js @@ -0,0 +1,34 @@ +function loadImage(theURL) +{ + theImage = new Image; + theImage.src = theURL; +} + + +function navSelect(theID) +{ + document.getElementById(theID).setAttribute("class", "selected"); +} + + +var prevOnLoad = window.onload; +window.onload = function() +{ + if (prevOnLoad) + prevOnLoad(); + + + // Preload images + if (document.domain != "") + { + loadImage("/src/img/nav_apps_hover.png"); + loadImage("/src/img/nav_apps_selected.png"); + loadImage("/src/img/nav_projects_hover.png"); + loadImage("/src/img/nav_projects_selected.png"); + loadImage("/src/img/nav_contact_hover.png"); + loadImage("/src/img/nav_contact_selected.png"); + loadImage("/src/img/nav_dev_hover.png"); + loadImage("/src/img/nav_dev_selected.png"); + } +} + diff --git a/release_scripts/osx/refnum/dmgutil/Documentation/version.html b/release_scripts/osx/refnum/dmgutil/Documentation/version.html new file mode 100644 index 00000000..f7177a49 --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/Documentation/version.html @@ -0,0 +1,109 @@ + + + + refNum › dmgutil › Version History + + + + + + + + + + + + + + +
+ + + + +
+
+
+
+ + + + + + + + +
+ + + + + +

Version History

+

dmgutil 1.3

+
    +
  • Released 2008/05/01 +
  • Added workaround for Finder bug when setting background image on 10.5 +
  • Added workaround for hdiutil bug when closing disk image on 10.5 +
+ + +

dmgutil 1.2

+
    +
  • Released 2007/03/07 +
  • Fixed typo in zlib-level flag, was defaulting to 1 not 9 +
+ + +

dmgutil 1.1

+
    +
  • Released 2006/07/31 +
  • Added --icon parameter to set custom icons +
  • Added --bgcol parameter to set background color +
  • Added --toolbar flag to control toolbar visibility +
+ + +

dmgutil 1.0

+
    +
  • Released 2006/07/22 +
  • Initial release +
+ + + + + +
+ + + +
+
+ +
+ + + + + + + + diff --git a/release_scripts/osx/refnum/dmgutil/dmgutil.pl b/release_scripts/osx/refnum/dmgutil/dmgutil.pl new file mode 100755 index 00000000..9904b5e5 --- /dev/null +++ b/release_scripts/osx/refnum/dmgutil/dmgutil.pl @@ -0,0 +1,738 @@ +#!/usr/bin/perl -w +#============================================================================ +# NAME: +# dmgutil.pl +# +# DESCRIPTION: +# Disk image creation utility. +# +# COPYRIGHT: +# Copyright (c) 2006-2009, refNum Software +# +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# o Redistributions of source code must retain the above +# copyright notice, this list of conditions and the following +# disclaimer. +# +# o Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# o Neither the name of refNum Software nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================ +# Imports +#---------------------------------------------------------------------------- +use strict; +use Getopt::Long; + + + + + +#============================================================================ +# Constants +#---------------------------------------------------------------------------- +my $kLogging = "-quiet"; + +my $Rez = "/Developer/Tools/Rez"; +my $SetFile = "/Developer/Tools/SetFile"; + +my $kManPage = <$theFile") or die "Can't open $theFile for writing: $!\n"; + print OUTPUT $theScript; + close(OUTPUT); + + + + # And execute it + system("osascript", $theFile); + unlink($theFile); +} + + + + + +#============================================================================ +# isVolume : Is a path to the root of a volume? +#---------------------------------------------------------------------------- +sub isVolume +{ + + + # Retrieve our parameters + my ($thePath) = @_; + + + + # Check the state + # + # After stripping out the leading /Volumes, any further slashes + # indicate we have a folder rather than a volume. + $thePath =~ s/\/Volumes\///; + + my $isVolume = ($thePath =~ /.*\/.*/) ? 0 : 1; + + return($isVolume); +} + + + + + +#============================================================================ +# setFolderState : Set the state for a folder. +#---------------------------------------------------------------------------- +sub setFolderState +{ + + + # Retrieve our parameters + my ($thePath, $iconSize, $flagToolbar, $bgImage, $bgColor) = @_; + + + + # Initialise ourselves + my $cmdBackground = ""; + my $cmdIconSize = ""; + my $cmdToolbar = ""; + + + + # Prepare the background + # + # As of 10.5, the Finder refuses to manipulate files whose names start with + # a period (rdar://5582578). As such we need to use an underscore for the + # image, then make it invisible using SetFile. + if (-f $bgImage) + { + $bgImage =~ /.*\.(\w+)/; + my $dstImage = "$thePath/_Background.$1"; + + `cp "$bgImage" "$dstImage"`; + + $cmdBackground .= "set theImage to posix file \"$dstImage\"\n"; + $cmdBackground .= " set background picture of theOptions to theImage\n"; + $cmdBackground .= " do shell script \"/Developer/Tools/SetFile -a V '$dstImage'\"\n"; + } + + elsif ($bgColor ne "") + { + $cmdBackground = "set background color of theOptions to {$bgColor} as RGB color"; + } + + + + # Prepare the icon size + if ($iconSize != 0) + { + $cmdIconSize = "set icon size of theOptions to $iconSize"; + } + + + + # Prepare the toolbar + # + # The window must be made visible in order to change the toolbar state. + if ($flagToolbar ne "") + { + $cmdToolbar = " open theWindow \n"; + $cmdToolbar .= " set toolbar visible of theWindow to $flagToolbar \n"; + $cmdToolbar .= " close theWindow \n"; + } + + + + # Identify the target + # + # AppleScript requires the correct nomenclature for the target item. + my $theTarget = "folder \"$thePath\""; + + if (isVolume($thePath)) + { + $theTarget =~ s/folder "\/Volumes\//disk "/; + } + + + + # Set the folder state + # + # Once a change has been made, it must be flushed to disk with update. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= " set theWindow to window of theTarget \n"; + $theScript .= "\n"; + $theScript .= " set current view of theWindow to icon view \n"; + $theScript .= " set theOptions to icon view options of theWindow \n"; + $theScript .= " set arrangement of theOptions to not arranged \n"; + $theScript .= "\n"; + $theScript .= " $cmdBackground\n"; + $theScript .= " $cmdIconSize \n"; + $theScript .= " $cmdToolbar \n"; + $theScript .= "\n"; + $theScript .= " update theTarget\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# setCustomIcon : Set a custom icon. +#---------------------------------------------------------------------------- +sub setCustomIcon +{ + + + # Retrieve our parameters + my ($thePath, $theIcon) = @_; + + + + # Validate our state + # + # We require several tools inside /Developer/Tools. + die("Setting an icon requires $Rez") if (! -e $Rez); + die("Setting an icon requires $SetFile") if (! -e $SetFile); + + + + # Prepare the flags + # + # Prior to Mac OS X 10.4, SetFile can only set an attribute if it is + # first cleared (rdar://3738867). + my $sysVers = `uname -r`; + my $setHidden = ($sysVers =~ /^[0-7]\./) ? "vV" : "V"; + my $setIcon = ($sysVers =~ /^[0-7]\./) ? "cC" : "C"; + + + + # Set a volume icon + # + # Volume custom icons are contained in a .VolumeIcon.icns file. + if (isVolume($thePath)) + { + my $iconFile = "$thePath/.VolumeIcon.icns"; + + `cp "$theIcon" "$iconFile"`; + + `$SetFile -a $setHidden "$iconFile"`; + `$SetFile -a $setIcon "$thePath"`; + } + + + # Set a folder icon + # + # Folder custom icons are contained in an ('icns', -16455) resource, + # placed in an invisible "Icon\r" file inside the folder. + elsif (-d $thePath) + { + my $iconFile = "$thePath/Icon\r"; + my $tmpR = "/tmp/dmgutil.r"; + + `echo "read 'icns' (-16455) \\"$theIcon\\";\n" > $tmpR`; + `cd /tmp; $Rez dmgutil.r -append -o "$iconFile"`; + + `$SetFile -a $setHidden "$iconFile"`; + `$SetFile -a $setIcon "$thePath"`; + + unlink($tmpR); + } + + + # Set a file icon + # + # File custom icons are contained in an ('icns', -16455) resource. + else + { + my $tmpR = "/tmp/dmgutil.r"; + + `echo "read 'icns' (-16455) \\"$theIcon\\";\n" > $tmpR`; + `cd /tmp; $Rez dmgutil.r -append -o "$thePath"`; + + `$SetFile -a $setIcon "$thePath"`; + + unlink($tmpR); + } +} + + + + + +#============================================================================ +# setWindowPos : Set the position of a window. +#---------------------------------------------------------------------------- +sub setWindowPos +{ + + + # Retrieve our parameters + my ($thePath, $posX, $posY, $theWidth, $theHeight) = @_; + + + + # Initialise ourselves + my $bottom = $posY + $theHeight; + my $right = $posX + $theWidth; + + + + # Identify the target + # + # AppleScript requires the correct nomenclature for the target item. + my $theTarget = "folder \"$thePath\""; + + if (isVolume($thePath)) + { + $theTarget =~ s/folder "\/Volumes\//disk "/; + } + + + + # Set the window position + # + # In theory, the "set bounds" command is all that should be necessary + # to set the bounds of a Finder window. + # + # Unfortunately, under 10.4 this will result in a window that will be + # taller than the specified size when the window is next opened. + # + # To reliably set the bounds of a window we must open the window, show + # the status bar, and set the window bounds to be 20 pixels taller (the + # height of the status bar) than necessary. + # + # The status bar can then be hidden, the window closed, and the bounds + # bounds will be the desired size when the window is next opened. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= " set theWindow to window of theTarget \n"; + $theScript .= "\n"; + $theScript .= " open theWindow \n"; + $theScript .= " set statusbar visible of theWindow to true \n"; + $theScript .= " set bounds of theWindow to {$posX, $posY, $right, $bottom+20} \n"; + $theScript .= " set statusbar visible of theWindow to false \n"; + $theScript .= " close theWindow \n"; + $theScript .= "\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# setIconPos : Set the position of an icon. +#---------------------------------------------------------------------------- +sub setIconPos +{ + + + # Retrieve our parameters + my ($theFile, $posX, $posY) = @_; + + + + # Identify the target + # + # Since the 'posix file' command follows symlinks, in order to set the + # position of a symlink (vs its target) we need to use an HFS path and + # reference it as a file rather than an alias. + my $theTarget = "alias (posix file \"$theFile\")"; + + if (-l $theFile) + { + $theTarget = $theFile; + + $theTarget =~ s/\/Volumes\///; + $theTarget =~ s/\//:/g; + $theTarget = "file \"$theTarget\""; + } + + + + # Set the icon position + # + # Once a change has been made, it must be flushed to disk with update. + my $theScript = ""; + + $theScript .= "tell application \"Finder\"\n"; + $theScript .= " set theTarget to $theTarget \n"; + $theScript .= "\n"; + $theScript .= " set position of theTarget to {$posX, $posY} \n"; + $theScript .= " update theTarget\n"; + $theScript .= "end tell"; + + appleScript($theScript); +} + + + + + +#============================================================================ +# doOpen : Open a new disk image. +#---------------------------------------------------------------------------- +sub doOpen +{ + + + # Retrieve our parameters + my ($dmgFile, $volName) = @_; + + + + # Clean up any previous image + system("rm", "-f", "$dmgFile.sparseimage"); + system("rm", "-f", "$dmgFile"); + + + + # Create the image + # + # A large sparse disk image is created, which will be shrunk down + # and compressed when the disk image is finally closed. + print " creating $dmgFile\n" if ($kLogging eq "-quiet"); + + system("hdiutil", "create", $dmgFile, + "-volname", $volName, + "-megabytes", "1000", + "-type", "SPARSE", + "-fs", "HFS+", + $kLogging); + + system("hdiutil", "mount", $kLogging, "$dmgFile.sparseimage"); +} + + + + + +#============================================================================ +# doClose : Close a disk image. +#---------------------------------------------------------------------------- +sub doClose +{ + + + # Retrieve our parameters + my ($dmgFile, $volName, $theLicense) = @_; + + + + # Bless the volume + # + # Blessing the volume ensures that the volume always opens in the current + # view, overriding the user's "Open new windows in column view" preference. + system("bless", "--openfolder", "/Volumes/$volName"); + + + + # Compress the image + # + # On 10.5, the disk image must be ejected rather than unmounted to allow + # it to be converted from a sparse image to a compressed image. + print " compressing $dmgFile\n" if ($kLogging eq "-quiet"); + + system("hdiutil", "eject", $kLogging, "/Volumes/$volName"); + + if ($theLicense ne "") + { + system("hdiutil", "unflatten", $kLogging, "$dmgFile.sparseimage"); + `$Rez -a "$theLicense" -o "$dmgFile.sparseimage"`; + system("hdiutil", "flatten", $kLogging, "$dmgFile.sparseimage"); + } + + system("hdiutil", "convert", "$dmgFile.sparseimage", + "-format", "UDZO", + "-o", $dmgFile, + "-imagekey", "zlib-level=9", + $kLogging); + + + + # Clean up + system("rm", "-f", "$dmgFile.sparseimage"); +} + + + + + +#============================================================================ +# doSet : Set a file/folder state. +#---------------------------------------------------------------------------- +sub doSet +{ + + + # Retrieve our parameters + my ($thePath, $posX, $posY, $theWidth, $theHeight, $iconSize, $theIcon, $bgImage, $bgColor, $flagToolbar) = @_; + + + + # Set the custom icon + if ($theIcon ne "") + { + setCustomIcon($thePath, $theIcon); + } + + + + # Set the folder state + if ($iconSize != 0 || $bgImage ne "" || $bgColor ne "" || $flagToolbar ne "") + { + setFolderState($thePath, $iconSize, $flagToolbar, $bgImage, $bgColor); + } + + + + # Set the position + # + # Window position must be set after applying the folder state. + if ($posX != 0 && $posY != 0) + { + if ($theWidth != 0 && $theHeight != 0) + { + setWindowPos($thePath, $posX, $posY, $theWidth, $theHeight); + } + else + { + setIconPos($thePath, $posX, $posY); + } + } +} + + + + + +#============================================================================ +# dmgUtil : Manipulate a disk image. +#---------------------------------------------------------------------------- +sub dmgUtil +{ + + + # Retrieve our parameters + my ($doOpen, $doClose, $doSet) = (0, 0, 0); + my ($posX, $posY, $theWidth, $theHeight, $iconSize) = (0, 0, 0, 0, 0); + my ($volName, $theIcon, $bgImage, $bgColor, $flagToolbar, $theLicense) = ("", "", "", "", "", ""); + + GetOptions( "--open+", => \$doOpen, + "--close+", => \$doClose, + "--set+", => \$doSet, + "--volume=s", => \$volName, + "--x=i", => \$posX, + "--y=i", => \$posY, + "--width=i", => \$theWidth, + "--height=i", => \$theHeight, + "--iconsize=i", => \$iconSize, + "--icon=s", => \$theIcon, + "--background=s", => \$bgImage, + "--bgcol=s", => \$bgColor, + "--toolbar=s", => \$flagToolbar, + "--license=s", => \$theLicense); + + my ($thePath) = @ARGV; + + $thePath = "" if (!defined($thePath)); + + + + # Perform the action + if ($doOpen && $thePath ne "" && $volName ne "") + { + doOpen($thePath, $volName); + } + + elsif ($doClose && $thePath ne "" && $volName ne "") + { + doClose($thePath, $volName, $theLicense); + } + + elsif ($doSet && $thePath ne "") + { + doSet($thePath, $posX, $posY, $theWidth, $theHeight, $iconSize, $theIcon, $bgImage, $bgColor, $flagToolbar); + } + + else + { + print $kManPage; + } +} + + + + + +#============================================================================ +# Script entry point +#---------------------------------------------------------------------------- +dmgUtil(); diff --git a/release_scripts/osx/release.macx.sh b/release_scripts/osx/release.macx.sh index 5e5fc161..1e602c7f 100755 --- a/release_scripts/osx/release.macx.sh +++ b/release_scripts/osx/release.macx.sh @@ -1,4 +1,4 @@ -#!/bin/bash +:#!/bin/bash # -------------------------------------------------------------------- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,11 +19,11 @@ PROJECT_ROOT="$SCRIPT_PATH/../.." APPLICATION_NAME="OpenBoard" -BASE_QT_DIR=~/qt/5.5/clang_64 +BASE_QT_DIR=~/Qt/5.13.1/clang_64 # Executables QMAKE=$BASE_QT_DIR/bin/qmake MACDEPLOYQT=$BASE_QT_DIR/bin/macdeployqt -DMGUTIL="$PROJECT_ROOT/../OpenBoard-ThirdParty/refnum/dmgutil/dmgutil.pl" +DMGUTIL="$PROJECT_ROOT/release_scripts/osx/refnum/dmgutil/dmgutil.pl" DSYMUTIL=/usr/bin/dsymutil STRIP=/usr/bin/strip PLISTBUDDY=/usr/libexec/PlistBuddy @@ -201,30 +201,30 @@ $MACDEPLOYQT "`pwd`/$APPLICATION_NAME.app" cd - # make sure libs installed via homebrew 2.0 refer to in-app libs -# notify "relinking libs ..." + notify "relinking libs ..." # libavformat -# install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavcodec.58.dylib @executable_path/../Frameworks/libavcodec.58.dylib -# install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib -# install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libavcodec.58.dylib @executable_path/../Frameworks/libavcodec.58.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib # libavcodec -# install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib -# install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib #libswresample -# install_name_tool "$APP/Contents/Frameworks/libswresample.3.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib +install_name_tool "$APP/Contents/Frameworks/libswresample.3.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib #libswscale -# install_name_tool "$APP/Contents/Frameworks/libswscale.5.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib +install_name_tool "$APP/Contents/Frameworks/libswscale.5.dylib" -change /usr/local/Cellar/ffmpeg/4.2.1/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib # libhogweed -# install_name_tool "$APP/Contents/Frameworks/libhogweed.4.dylib" -change /usr/local/Cellar/nettle/3.4.1/lib/libnettle.6.dylib @executable_path/../Frameworks/libnettle.6.dylib +install_name_tool "$APP/Contents/Frameworks/libhogweed.4.dylib" -change /usr/local/Cellar/nettle/3.4.1/lib/libnettle.6.dylib @executable_path/../Frameworks/libnettle.6.dylib # libssl -# install_name_tool "$APP/Contents/Frameworks/libssl.1.1.dylib" -change /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib +install_name_tool "$APP/Contents/Frameworks/libssl.1.1.dylib" -change /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib # libvorbis -# install_name_tool "$APP/Contents/Frameworks/libvorbisenc.2.dylib" -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib @executable_path/../Frameworks/libvorbis.0.dylib +install_name_tool "$APP/Contents/Frameworks/libvorbisenc.2.dylib" -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib @executable_path/../Frameworks/libvorbis.0.dylib notify "Extracting debug information ..." $DSYMUTIL "$APP/Contents/MacOS/$APPLICATION_NAME" -o "$DSYM" diff --git a/src/adaptors/UBExportDocument.cpp b/src/adaptors/UBExportDocument.cpp index 069baebc..3d5abadc 100644 --- a/src/adaptors/UBExportDocument.cpp +++ b/src/adaptors/UBExportDocument.cpp @@ -39,10 +39,13 @@ #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE -#include "quazip.h" -#include "quazipfile.h" -THIRD_PARTY_WARNINGS_ENABLE +#ifdef Q_OS_OSX + #include + #include +#else + #include "quazip.h" + #include "quazipfile.h" +#endif #include "core/memcheck.h" diff --git a/src/adaptors/UBExportDocumentSetAdaptor.cpp b/src/adaptors/UBExportDocumentSetAdaptor.cpp index b3a72d54..a54f4641 100644 --- a/src/adaptors/UBExportDocumentSetAdaptor.cpp +++ b/src/adaptors/UBExportDocumentSetAdaptor.cpp @@ -40,10 +40,13 @@ #include "core/UBPersistenceManager.h" #include "core/UBForeignObjectsHandler.h" -THIRD_PARTY_WARNINGS_DISABLE -#include "quazip.h" -#include "quazipfile.h" -THIRD_PARTY_WARNINGS_ENABLE +#ifdef Q_OS_OSX + #include + #include +#else + #include "quazip.h" + #include "quazipfile.h" +#endif #include "core/memcheck.h" diff --git a/src/adaptors/UBExportDocumentSetAdaptor.h b/src/adaptors/UBExportDocumentSetAdaptor.h index 144ff8f2..9c7a0f0b 100644 --- a/src/adaptors/UBExportDocumentSetAdaptor.h +++ b/src/adaptors/UBExportDocumentSetAdaptor.h @@ -33,10 +33,8 @@ #include "frameworks/UBFileSystemUtils.h" #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE #include "quazip.h" #include "quazipfile.h" -THIRD_PARTY_WARNINGS_ENABLE class UBDocumentProxy; class UBDocumentTreeModel; diff --git a/src/adaptors/UBExportWeb.cpp b/src/adaptors/UBExportWeb.cpp index 01442e77..a69d5a14 100644 --- a/src/adaptors/UBExportWeb.cpp +++ b/src/adaptors/UBExportWeb.cpp @@ -39,10 +39,8 @@ #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE #include "quazip.h" #include "quazipfile.h" -THIRD_PARTY_WARNINGS_ENABLE #include "core/memcheck.h" diff --git a/src/adaptors/UBImportCFF.cpp b/src/adaptors/UBImportCFF.cpp index 83497abd..ddfeba87 100644 --- a/src/adaptors/UBImportCFF.cpp +++ b/src/adaptors/UBImportCFF.cpp @@ -43,11 +43,17 @@ #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE -#include "quazip.h" -#include "quazipfile.h" -#include "quazipfileinfo.h" -THIRD_PARTY_WARNINGS_ENABLE +//THIRD_PARTY_WARNINGS_DISABLE +#ifdef Q_OS_OSX + #include + #include + #include +#else + #include "quazip.h" + #include "quazipfile.h" + #include "quazipfileinfo.h" +#endif +//THIRD_PARTY_WARNINGS_ENABLE #include "core/memcheck.h" diff --git a/src/adaptors/UBImportDocument.cpp b/src/adaptors/UBImportDocument.cpp index 5e632f36..b99b6d85 100644 --- a/src/adaptors/UBImportDocument.cpp +++ b/src/adaptors/UBImportDocument.cpp @@ -38,11 +38,15 @@ #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE -#include "quazip.h" -#include "quazipfile.h" -#include "quazipfileinfo.h" -THIRD_PARTY_WARNINGS_ENABLE +#ifdef Q_OS_WIN + #include + #include + #include +#else + #include "quazip.h" + #include "quazipfile.h" + #include "quazipfileinfo.h" +#endif #include "core/memcheck.h" diff --git a/src/adaptors/UBImportDocumentSetAdaptor.cpp b/src/adaptors/UBImportDocumentSetAdaptor.cpp index a2397b21..cdc9250b 100644 --- a/src/adaptors/UBImportDocumentSetAdaptor.cpp +++ b/src/adaptors/UBImportDocumentSetAdaptor.cpp @@ -36,11 +36,15 @@ #include "globals/UBGlobals.h" -THIRD_PARTY_WARNINGS_DISABLE +#ifdef Q_OS_WIN + #include + #include + #include +#else #include "quazip.h" -#include "quazipfile.h" -#include "quazipfileinfo.h" -THIRD_PARTY_WARNINGS_ENABLE + #include "quazipfile.h" + #include "quazipfileinfo.h" +#endif #include "core/memcheck.h" diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index 99f53453..59c72aad 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -36,7 +36,11 @@ #include "globals/UBGlobals.h" THIRD_PARTY_WARNINGS_DISABLE -#include "quazipfile.h" +#ifdef Q_OS_OSX + #include +#else + #include "quazipfile.h" +#endif #include THIRD_PARTY_WARNINGS_ENABLE diff --git a/src/podcast/podcast.pri b/src/podcast/podcast.pri index e96263fa..873658c9 100644 --- a/src/podcast/podcast.pri +++ b/src/podcast/podcast.pri @@ -32,7 +32,7 @@ macx { src/podcast/ffmpeg/UBMicrophoneInput.h LIBS += -lavformat -lavcodec -lswscale -lswresample -lavutil \ - -lpthread -lvpx -lvorbisenc -lfreetype -llzma -lbz2 -lz -ldl -lavutil -lm + -lpthread -lvpx -lvorbisenc -llzma -lbz2 -lz -ldl -lavutil -lm # (ffmpeg-4.0 with all options (to clean)) # brew install ffmpeg --with-chromaprint --with-fdk-aac --with-libass --with-librsvg --with-libsoxr --with-libssh --with-tesseract @@ -41,14 +41,12 @@ macx { # brew install opus LIBS += -L/usr/local/opt/x264/lib - LIBS += -L/usr/local/opt/sdl/lib LIBS += -L/usr/local/opt/libvorbis/lib LIBS += -L/usr/local/opt/libvpx/lib LIBS += -L/usr/local/opt/theora/lib LIBS += -L/usr/local/opt/libogg/lib LIBS += -L/usr/local/opt/opus/lib LIBS += -L/usr/local/opt/lame/lib - LIBS += -L/usr/local/opt/fdk-aac/lib LIBS += -L/usr/local/opt/libass/lib }