Audacity 3.2.0
Namespaces | Macros | Functions | Variables
ScreenshotCommand.cpp File Reference
#include "ScreenshotCommand.h"
#include <mutex>
#include <thread>
#include "LoadCommands.h"
#include "Project.h"
#include <wx/app.h>
#include <wx/toplevel.h>
#include <wx/dcscreen.h>
#include <wx/dcmemory.h>
#include <wx/settings.h>
#include <wx/bitmap.h>
#include <wx/valgen.h>
#include "ActiveProject.h"
#include "../AdornedRulerPanel.h"
#include "../TrackPanel.h"
#include "../toolbars/ToolManager.h"
#include "Prefs.h"
#include "ProjectWindows.h"
#include "SettingsVisitor.h"
#include "ShuttleGui.h"
#include "Track.h"
#include "../widgets/VetoDialogHook.h"
#include "CommandContext.h"
#include "CommandManager.h"
#include "CommandDispatch.h"
#include "../CommonCommandFlags.h"
Include dependency graph for ScreenshotCommand.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{ScreenshotCommand.cpp}
 

Macros

#define TRICKY_CAPTURE
 
#define CAPTURE_NYQUIST_TOO
 

Functions

void IdleHandler (wxIdleEvent &event)
 
static void Yield ()
 

Variables

BuiltinCommandsModule::Registration< ScreenshotCommandanonymous_namespace{ScreenshotCommand.cpp}::reg
 
static const EnumValueSymbol kBackgroundStrings [ScreenshotCommand::nBackgrounds]
 
static AudacityProjectpIdleHandlerProject = nullptr
 
AttachedItem anonymous_namespace{ScreenshotCommand.cpp}::sAttachment
 

Macro Definition Documentation

◆ CAPTURE_NYQUIST_TOO

#define CAPTURE_NYQUIST_TOO

◆ TRICKY_CAPTURE

#define TRICKY_CAPTURE

Function Documentation

◆ IdleHandler()

void IdleHandler ( wxIdleEvent &  event)

Definition at line 172 of file ScreenshotCommand.cpp.

172 {
173 event.Skip();
174 wxWindow * pWin = dynamic_cast<wxWindow*>(event.GetEventObject());
175 wxASSERT( pWin );
176 pWin->Unbind(wxEVT_IDLE, IdleHandler);
178 // We have the relevant window, so go and capture it.
181}
static AudacityProject * pIdleHandlerProject
void IdleHandler(wxIdleEvent &event)
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
static ScreenshotCommand * mpShooter
void CaptureWindowOnIdle(const CommandContext &context, wxWindow *pWin)

References ScreenshotCommand::CaptureWindowOnIdle(), IdleHandler(), ScreenshotCommand::mpShooter, and pIdleHandlerProject.

Referenced by IdleHandler(), and ScreenshotCommand::SetIdleHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Yield()

static void Yield ( )
static

Definition at line 222 of file ScreenshotCommand.cpp.

223{
224 using namespace std::chrono;
225 int cnt;
226 for (cnt = 10; cnt && !wxTheApp->Yield(true); cnt--)
227 std::this_thread::sleep_for(10ms);
228 std::this_thread::sleep_for(200ms);
229 for (cnt = 10; cnt && !wxTheApp->Yield(true); cnt--)
230 std::this_thread::sleep_for(10ms);
231}

Referenced by ScreenshotCommand::Capture(), and ScreenshotCommand::CaptureToolbar().

Here is the caller graph for this function:

Variable Documentation

◆ kBackgroundStrings

const EnumValueSymbol kBackgroundStrings[ScreenshotCommand::nBackgrounds]
static
Initial value:
=
{
{ XO("Blue") },
{ XC("White", "color") },
{ XO("None") },
}
XO("Cut/Copy/Paste")
#define XC(s, c)
Definition: Internat.h:37

Definition at line 111 of file ScreenshotCommand.cpp.

Referenced by ScreenshotCommand::PopulateOrExchange(), and ScreenshotCommand::VisitSettings().

◆ pIdleHandlerProject

AudacityProject* pIdleHandlerProject = nullptr
static

Definition at line 164 of file ScreenshotCommand.cpp.

Referenced by IdleHandler(), and ScreenshotCommand::SetIdleHandler().