1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-07 07:39:29 +02:00
audacity/src/commands/ScreenshotCommand.h
James Crook c6b4e2fffe Add code to capture menus
So far, this only walks the menus, printing out their contents to debug.
2017-03-20 17:06:29 +00:00

67 lines
1.8 KiB
C++

/**********************************************************************
Audacity - A Digital Audio Editor
Copyright 1999-2009 Audacity Team
License: GPL v2 - see LICENSE.txt
Dominic Mazzoni
Dan Horgan
**********************************************************************/
#ifndef __SCREENSHOTCOMMAND__
#define __SCREENSHOTCOMMAND__
#include "Command.h"
#include "CommandType.h"
#include <wx/colour.h>
class wxWindow;
class wxTopLevelWindow;
class wxCommandEvent;
class wxRect;
class ToolManager;
class CommandOutputTarget;
class ScreenshotCommandType final : public CommandType
{
public:
wxString BuildName() override;
void BuildSignature(CommandSignature &signature) override;
CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
};
class ScreenshotCommand final : public CommandImplementation
{
private:
// May need to ignore the screenshot dialog
wxWindow *mIgnore;
bool mBackground;
wxColour mBackColor;
wxString MakeFileName(const wxString &path, const wxString &basename);
wxRect GetBackgroundRect();
void Capture(const wxString &basename,
wxWindow *window,
int x, int y, int width, int height,
bool bg = false);
void CaptureToolbar(ToolManager *man, int type, const wxString &name);
void CaptureDock(wxWindow *win, const wxString &fileName);
void CaptureMenus(wxMenuBar*pBar, const wxString &fileName);
public:
wxTopLevelWindow *GetFrontWindow(AudacityProject *project);
ScreenshotCommand(CommandType &type,
std::unique_ptr<CommandOutputTarget> &&output,
wxWindow *ignore = NULL)
: CommandImplementation(type, std::move(output)),
mIgnore(ignore),
mBackground(false)
{ }
bool Apply(CommandExecutionContext context);
};
#endif /* End of include guard: __SCREENSHOTCOMMAND__ */