mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 08:29:27 +02:00
Avoid Objective-C
This commit is contained in:
parent
b29cc8ae48
commit
9fe848ed66
@ -2979,7 +2979,7 @@
|
|||||||
28FEC1B21A12B6FB00FACE48 /* EffectAutomationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EffectAutomationParameters.h; path = ../include/audacity/EffectAutomationParameters.h; sourceTree = SOURCE_ROOT; };
|
28FEC1B21A12B6FB00FACE48 /* EffectAutomationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EffectAutomationParameters.h; path = ../include/audacity/EffectAutomationParameters.h; sourceTree = SOURCE_ROOT; };
|
||||||
5E02BFF01D1164DF00EB7578 /* Distortion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Distortion.cpp; sourceTree = "<group>"; };
|
5E02BFF01D1164DF00EB7578 /* Distortion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Distortion.cpp; sourceTree = "<group>"; };
|
||||||
5E02BFF11D1164DF00EB7578 /* Distortion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Distortion.h; sourceTree = "<group>"; };
|
5E02BFF11D1164DF00EB7578 /* Distortion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Distortion.h; sourceTree = "<group>"; };
|
||||||
5E0A0E301D23019A00CD2567 /* MenusMac.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = MenusMac.cpp; sourceTree = "<group>"; };
|
5E0A0E301D23019A00CD2567 /* MenusMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MenusMac.cpp; sourceTree = "<group>"; };
|
||||||
5E4685F81CCA9D84008741F2 /* CommandFunctors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommandFunctors.h; sourceTree = "<group>"; };
|
5E4685F81CCA9D84008741F2 /* CommandFunctors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommandFunctors.h; sourceTree = "<group>"; };
|
||||||
5E61EE0C1CBAA6BB0009FCF1 /* MemoryX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryX.h; sourceTree = "<group>"; };
|
5E61EE0C1CBAA6BB0009FCF1 /* MemoryX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryX.h; sourceTree = "<group>"; };
|
||||||
5E74D2D91CC4427B00D88B0B /* TrackPanelCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelCell.h; sourceTree = "<group>"; };
|
5E74D2D91CC4427B00D88B0B /* TrackPanelCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelCell.h; sourceTree = "<group>"; };
|
||||||
|
@ -9,15 +9,19 @@
|
|||||||
#include "Audacity.h"
|
#include "Audacity.h"
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
|
|
||||||
|
#undef USE_COCOA
|
||||||
|
|
||||||
|
#ifdef USE_COCOA
|
||||||
#include <AppKit/AppKit.h>
|
#include <AppKit/AppKit.h>
|
||||||
#include <wx/osx/private.h>
|
#include <wx/osx/private.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void AudacityProject::OnMacMinimize()
|
void AudacityProject::OnMacMinimize()
|
||||||
{
|
{
|
||||||
auto window = wxWindow::FindFocus();
|
auto window = this;
|
||||||
while (window && ! window->IsTopLevel())
|
|
||||||
window = window->GetParent();
|
|
||||||
if (window) {
|
if (window) {
|
||||||
|
#ifdef USE_COCOA
|
||||||
|
// Adapted from mbarman.mm in wxWidgets 3.0.2
|
||||||
auto peer = window->GetPeer();
|
auto peer = window->GetPeer();
|
||||||
peer->GetWXPeer();
|
peer->GetWXPeer();
|
||||||
auto widget = static_cast<wxWidgetCocoaImpl*>(peer)->GetWXWidget();
|
auto widget = static_cast<wxWidgetCocoaImpl*>(peer)->GetWXWidget();
|
||||||
@ -25,24 +29,32 @@ void AudacityProject::OnMacMinimize()
|
|||||||
if (nsWindow) {
|
if (nsWindow) {
|
||||||
[nsWindow performMiniaturize:widget];
|
[nsWindow performMiniaturize:widget];
|
||||||
}
|
}
|
||||||
if (nsWindow) {
|
#else
|
||||||
this->UpdateMenus();
|
window->Iconize(true);
|
||||||
}
|
#endif
|
||||||
|
|
||||||
|
// So that the Minimize menu command disables
|
||||||
|
window->UpdateMenus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnMacZoom()
|
void AudacityProject::OnMacZoom()
|
||||||
{
|
{
|
||||||
auto window = wxWindow::FindFocus();
|
auto window = this;
|
||||||
while (window && ! window->IsTopLevel())
|
auto topWindow = static_cast<wxTopLevelWindow*>(window);
|
||||||
window = window->GetParent();
|
auto maximized = topWindow->IsMaximized();
|
||||||
if (window) {
|
if (window) {
|
||||||
|
#ifdef USE_COCOA
|
||||||
|
// Adapted from mbarman.mm in wxWidgets 3.0.2
|
||||||
auto peer = window->GetPeer();
|
auto peer = window->GetPeer();
|
||||||
peer->GetWXPeer();
|
peer->GetWXPeer();
|
||||||
auto widget = static_cast<wxWidgetCocoaImpl*>(peer)->GetWXWidget();
|
auto widget = static_cast<wxWidgetCocoaImpl*>(peer)->GetWXWidget();
|
||||||
auto nsWindow = [widget window];
|
auto nsWindow = [widget window];
|
||||||
if (nsWindow)
|
if (nsWindow)
|
||||||
[nsWindow performZoom:widget];
|
[nsWindow performZoom:widget];
|
||||||
|
#else
|
||||||
|
topWindow->Maximize(!maximized);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user