Audacity 3.2.0
ScreenshotCommand.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity - A Digital Audio Editor
4 Copyright 1999-2018 Audacity Team
5 License: GPL v2 or later - see LICENSE.txt
6
7 Dominic Mazzoni
8 Dan Horgan
9 James Crook
10
11**********************************************************************/
12
13#ifndef __SCREENSHOT_COMMAND__
14#define __SCREENSHOT_COMMAND__
15
16#include "Command.h"
17
18#include <wx/colour.h> // member variable
19
20class wxWindow;
21class wxTopLevelWindow;
22class wxCommandEvent;
23class wxRect;
24class ToolManager;
26class TrackPanel;
28class AudacityProject;
29class CommandContext;
30
31class AUDACITY_DLL_API ScreenshotCommand : public AudacityCommand
32{
33public:
35 {
39 nBackgrounds
40 };
41
43 {
64 nCaptureWhats
65 };
66
67 EnumValueSymbols kCaptureWhatStrings();
68
70
72 // ComponentInterface overrides
73 ComponentInterfaceSymbol GetSymbol() const override {return Symbol;};
74 TranslatableString GetDescription() const override {return XO("Takes screenshots.");};
75 template<bool Const> bool VisitSettings( SettingsVisitorBase<Const> &S );
76 bool VisitSettings( SettingsVisitor & S ) override;
77 bool VisitSettings( ConstSettingsVisitor & S ) override;
78 void PopulateOrExchange(ShuttleGui & S) override;
79
80 // AudacityCommand overrides
81 ManualPageID ManualPage() override {return L"Extra_Menu:_Scriptables_II#screenshot_short_format";}
82
83private:
84 int mWhat;
85 int mBack;
86 wxString mPath;
90 friend class ScreenshotBigDialog;
91
92public:
93 bool Apply(const CommandContext & context) override;
94 void GetDerivedParams();
95
96private:
98
99 // May need to ignore the screenshot dialog
100 // Appears not to be used anymore.
101 wxWindow *mIgnore;
102
104 wxColour mBackColor;
106
107 wxString mFilePath;
108 wxString mFileName;
110
111 wxString MakeFileName(const wxString &path, const wxString &basename);
112
113 wxRect GetBackgroundRect();
114
115 bool CaptureToolbar(const CommandContext & Context, ToolManager *man, Identifier type, const wxString &name);
116 bool CaptureDock(const CommandContext & Context, wxWindow *win, const wxString &fileName);
117 void CaptureCommands(const CommandContext & Context, const wxArrayStringEx &Commands );
118 void CaptureEffects(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );
119 void CaptureScriptables(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );
120 void CapturePreferences(const CommandContext & Context, AudacityProject * pProject, const wxString &fileName );
121 bool Capture(
122 const CommandContext & Context,
123 const wxString &basename,
124 wxWindow *window, wxRect rect,
125 bool bg = false);
126 wxRect GetWindowRect(wxTopLevelWindow *w);
127 wxRect GetFullWindowRect(wxTopLevelWindow *w);
128 wxRect GetScreenRect();
129 wxRect GetPanelRect(TrackPanel * panel);
130 wxRect GetRulerRect(AdornedRulerPanel *ruler);
131 wxRect GetTracksRect(TrackPanel * panel);
132 wxRect GetTrackRect( AudacityProject * pProj, TrackPanel * panel,int n);
133 wxString WindowFileName(AudacityProject * proj, wxTopLevelWindow *w);
134
135public:
137 static void (*mIdleHandler)(wxIdleEvent& event);
138 static void SetIdleHandler( AudacityProject &project );
139 static bool MayCapture( wxDialog * pDlg );
140
141 void CaptureWindowOnIdle( const CommandContext & context, wxWindow * pWin );
142 wxTopLevelWindow *GetFrontWindow(AudacityProject *project);
143};
144
145#endif /* End of include guard: __SCREENSHOT_COMMAND__ */
Contains declaration of Command base class.
const TranslatableString name
Definition: Distortion.cpp:76
XO("Cut/Copy/Paste")
const auto project
#define S(N)
Definition: ToChars.cpp:64
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
Base class for command in Audacity.
virtual bool Apply(const CommandContext &WXUNUSED(context))
virtual bool VisitSettings(SettingsVisitor &)
virtual void PopulateOrExchange(ShuttleGui &WXUNUSED(S))
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
CommandOutputTargets a mix of three output classes to output progress indication, status messages and...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
ScreenshotBigDialog provides an alternative Gui for ScreenshotCommand. It adds a timer that allows a ...
Definition: Screenshot.cpp:60
Implements a command for capturing various areas of the screen or project window. It's one big if-els...
static ScreenshotCommand * mpShooter
ManualPageID ManualPage() override
TranslatableString GetDescription() const override
ComponentInterfaceSymbol GetSymbol() const override
EnumValueSymbols mSymbols
static const ComponentInterfaceSymbol Symbol
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
class ToolManager
Definition: ToolManager.h:55
The TrackPanel class coordinates updates and operations on the main part of the screen which contains...
Definition: TrackPanel.h:63
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
void Capture(wxWindow *handler)