Audacity  3.0.3
ProjectWindows.h
Go to the documentation of this file.
1 /*!********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  @file ProjectWindows.h
6  @brief accessors for certain important windows associated with each project
7 
8  Paul Licameli split from Project.h
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_PROJECT_WINDOWS__
13 #define __AUDACITY_PROJECT_WINDOWS__
14 
15 #include "ClientData.h"
16 
17 class AudacityProject;
18 class wxFrame;
19 class wxWindow;
20 namespace BasicUI { class WindowPlacement; }
21 
24 AUDACITY_DLL_API wxFrame &GetProjectFrame( AudacityProject &project );
25 AUDACITY_DLL_API const wxFrame &GetProjectFrame( const AudacityProject &project );
26 
29 AUDACITY_DLL_API wxFrame *FindProjectFrame( AudacityProject *project );
30 
33 AUDACITY_DLL_API const wxFrame *FindProjectFrame( const AudacityProject *project );
34 
36 
37 AUDACITY_DLL_API std::unique_ptr<const BasicUI::WindowPlacement>
39 
41 // (as a wxWindow only, when you do not need to use the subclass TrackPanel)
42 AUDACITY_DLL_API wxWindow &GetProjectPanel( AudacityProject &project );
43 AUDACITY_DLL_API const wxWindow &GetProjectPanel(
44  const AudacityProject &project );
45 
46 AUDACITY_DLL_API void SetProjectPanel(
47  AudacityProject &project, wxWindow &panel );
48 AUDACITY_DLL_API void SetProjectFrame(
49  AudacityProject &project, wxFrame &frame );
50 
51 // Container of pointers to various windows associated with the project, which
52 // is not responsible for destroying them -- wxWidgets handles that instead
54  AttachedWindows, wxWindow, ClientData::SkipCopying, ClientData::BarePtr
55 >
56 {
57 public:
58  explicit AttachedWindows(AudacityProject &project)
59  : mProject{project} {}
60  operator AudacityProject & () const { return mProject; }
61 private:
63 };
64 
65 AUDACITY_DLL_API AttachedWindows &GetAttachedWindows(AudacityProject &project);
66 
67 #endif
SetProjectFrame
AUDACITY_DLL_API void SetProjectFrame(AudacityProject &project, wxFrame &frame)
Definition: ProjectWindows.cpp:109
AttachedWindows
Definition: ProjectWindows.h:56
ProjectFramePlacement
AUDACITY_DLL_API std::unique_ptr< const BasicUI::WindowPlacement > ProjectFramePlacement(AudacityProject *project)
Make a WindowPlacement object suitable for project (which may be null)
Definition: ProjectWindows.cpp:101
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
FindProjectFrame
AUDACITY_DLL_API wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
Definition: ProjectWindows.cpp:88
AttachedWindows::mProject
AudacityProject & mProject
Definition: ProjectWindows.h:62
SetProjectPanel
AUDACITY_DLL_API void SetProjectPanel(AudacityProject &project, wxWindow &panel)
Definition: ProjectWindows.cpp:66
ClientData.h
Utility ClientData::Site to register hooks into a host class that attach client data.
GetProjectFrame
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
Definition: ProjectWindows.cpp:72
GetProjectPanel
AUDACITY_DLL_API wxWindow & GetProjectPanel(AudacityProject &project)
Get the main sub-window of the project frame that displays track data.
Definition: ProjectWindows.cpp:49
ClientData::Site
Utility to register hooks into a host class that attach client data.
Definition: ClientData.h:220
AttachedWindows::AttachedWindows
AttachedWindows(AudacityProject &project)
Definition: ProjectWindows.h:58
BasicUI
Definition: Export.h:39
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92