Skip to content

Commit

Permalink
Merge branch 'devel/quicklook-extension'
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Sep 14, 2024
2 parents 12d0cd8 + 319b307 commit 1451caf
Show file tree
Hide file tree
Showing 18 changed files with 931 additions and 149 deletions.
513 changes: 484 additions & 29 deletions Poedit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

114 changes: 0 additions & 114 deletions Poedit.xcworkspace/xcshareddata/xcschemes/PoeditQuicklook.xcscheme

This file was deleted.

101 changes: 101 additions & 0 deletions Poedit.xcworkspace/xcshareddata/xcschemes/QuicklookPreview.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DACF10FC779DD2159DD15360"
BuildableName = "QuicklookPreview.appex"
BlueprintName = "QuicklookPreview"
ReferencedContainer = "container:Poedit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B24ACD5A16F6201F00399242"
BuildableName = "Poedit.app"
BlueprintName = "Poedit"
ReferencedContainer = "container:Poedit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.finder"
RemotePath = "/Finder">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B24ACD5A16F6201F00399242"
BuildableName = "Poedit.app"
BlueprintName = "Poedit"
ReferencedContainer = "container:Poedit.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B24ACD5A16F6201F00399242"
BuildableName = "Poedit.app"
BlueprintName = "Poedit"
ReferencedContainer = "container:Poedit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 2 additions & 2 deletions deps/custom_build/wxWidgets.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -2678,7 +2678,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1540;
};
buildConfigurationList = 6976B5F5F3A63A21A92029E3 /* Build configuration list for PBXProject "wxWidgets" */;
compatibilityVersion = "Xcode 3.2";
Expand Down
2 changes: 1 addition & 1 deletion macos/Poedit-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${POEDIT_VERSION}</string>
<string>${MARKETING_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
2 changes: 2 additions & 0 deletions macos/poedit.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

MARKETING_VERSION = 3.5

HEADER_SEARCH_PATHS = deps/icu/macos $(inherited)

BOOST = "$(SRCROOT)/deps/boost"
Expand Down
4 changes: 2 additions & 2 deletions scripts/chversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ replace_ver src/version.h \
'\(POEDIT_VERSION_SHORT *"\).*\("\)' "\1$VERSION_SHORT\2"
replace_ver src/version.h \
'\(POEDIT_VERSION_WIN *\).*' "\1$VER_WIN"
replace_ver Poedit.xcodeproj/project.pbxproj \
'\(POEDIT_VERSION = \).*\(;\)' "\1$VERSION\2"
replace_ver macos/poedit.xcconfig \
'\(MARKETING_VERSION = \).*' "\1$VERSION"
replace_ver snap/snapcraft.yaml \
'\(version: \"\).*\("\)' "\1$VERSION\2"
touch macos/Poedit-Info.plist
14 changes: 14 additions & 0 deletions src/gexecute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ struct ProcessOutput
};


#ifdef MACOS_BUILD_WITHOUT_APPKIT

ProcessOutput ExecuteCommandAndCaptureOutput(const CommandInvocation&, const wxExecuteEnv*)
{
// wxExecute() uses NSWorkspace, which is unavailable in extensions; it's the only AppKit
// dependency in wxBase and can be avoided
wxFAIL_MSG("attempt to execute commands in non-exec binaries: %s");
return {666};
}

#else

bool ReadOutput(wxInputStream& s, std::vector<wxString>& out)
{
// the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
Expand Down Expand Up @@ -146,6 +158,8 @@ ProcessOutput ExecuteCommandAndCaptureOutput(const CommandInvocation& cmd, const
return pout;
}

#endif


#define GETTEXT_VERSION_NUM(x, y, z) ((x*1000*1000) + (y*1000) + (z))

Expand Down
4 changes: 4 additions & 0 deletions src/quicklook/GeneratePreviewForURL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#error "compiled with GUI features of wx - not needed"
#endif

#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_12_0
#error "This code should be removed when targeting macOS 12 or newer"
#endif

namespace
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>${POEDIT_VERSION}</string>
<string>${MARKETING_VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
33 changes: 33 additions & 0 deletions src/quicklook/InfoPreview.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>CFBundleDisplayName</key>
<string>Poedit File Previews</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>QLIsDataBasedPreview</key>
<true/>
<key>QLSupportedContentTypes</key>
<array>
<string>net.poedit.po</string>
<string>net.poedit.pot</string>
<string>com.microsoft.powerpoint.pot</string>
<string>org.oasis-open.xliff</string>
<string>org.oasis.xliff</string>
<string>net.poedit.arb</string>
</array>
<key>QLSupportsSearchableItems</key>
<false/>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.quicklook.preview</string>
<key>NSExtensionPrincipalClass</key>
<string>PreviewProvider</string>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015-2024 Václav Slavík. All rights reserved.</string>
</dict>
</plist>
31 changes: 31 additions & 0 deletions src/quicklook/InfoThumbnails.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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>CFBundleDisplayName</key>
<string>Poedit Thumbnails</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>QLSupportedContentTypes</key>
<array>
<string>net.poedit.po</string>
<string>net.poedit.pot</string>
<string>com.microsoft.powerpoint.pot</string>
<string>org.oasis-open.xliff</string>
<string>org.oasis.xliff</string>
<string>net.poedit.arb</string>
</array>
<key>QLThumbnailMinimumDimension</key>
<integer>400</integer>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.quicklook.thumbnail</string>
<key>NSExtensionPrincipalClass</key>
<string>ThumbnailProvider</string>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015-2024 Václav Slavík. All rights reserved.</string>
</dict>
</plist>
Loading

0 comments on commit 1451caf

Please sign in to comment.