summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-03 00:04:31 +0200
committerCarl Hetherington <cth@carlh.net>2022-04-03 23:25:19 +0200
commitd311043bf3c1e3e7f41b314f7ab7c91ed7e5aa7f (patch)
treeab41f58144bda078f96ce23f6328bd36cbd18dc6 /src/wx
parent8c39f950ec8f8b3cf4d258279ab499d7e71dafc8 (diff)
C++11 and whitespace cleanups.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/recipient_dialog.cc16
-rw-r--r--src/wx/subtitle_appearance_dialog.cc7
-rw-r--r--src/wx/timecode.h4
-rw-r--r--src/wx/timeline_content_view.cc6
-rw-r--r--src/wx/timeline_time_axis_view.h2
-rw-r--r--src/wx/wx_util.cc2
6 files changed, 21 insertions, 16 deletions
diff --git a/src/wx/recipient_dialog.cc b/src/wx/recipient_dialog.cc
index eecb7c040..e833f2e36 100644
--- a/src/wx/recipient_dialog.cc
+++ b/src/wx/recipient_dialog.cc
@@ -61,7 +61,7 @@ RecipientDialog::RecipientDialog (
: wxDialog (parent, wxID_ANY, title)
, _recipient (recipient)
{
- wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+ auto overall_sizer = new wxBoxSizer (wxVERTICAL);
SetSizer (overall_sizer);
_sizer = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
@@ -97,14 +97,14 @@ RecipientDialog::RecipientDialog (
++r;
wxClientDC dc (this);
- wxFont font = _name->GetFont ();
+ auto font = _name->GetFont ();
font.SetFamily (wxFONTFAMILY_TELETYPE);
dc.SetFont (font);
- wxSize size = dc.GetTextExtent (wxT ("1234567890123456789012345678"));
- size.SetHeight (-1);
+ auto size = dc.GetTextExtent(wxT("1234567890123456789012345678"));
+ size.SetHeight (-1);
add_label_to_sizer (_sizer, this, _("Recipient certificate"), true, wxGBPosition (r, 0));
- wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+ auto s = new wxBoxSizer (wxHORIZONTAL);
_recipient_thumbprint = new StaticText (this, wxT (""), wxDefaultPosition, size);
_recipient_thumbprint->SetFont (font);
set_recipient (recipient);
@@ -122,7 +122,7 @@ RecipientDialog::RecipientDialog (
overall_sizer->Add (_sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+ auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
if (buttons) {
overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
@@ -186,7 +186,7 @@ RecipientDialog::load_recipient (boost::filesystem::path file)
void
RecipientDialog::get_recipient_from_file ()
{
- wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File"));
+ auto d = new wxFileDialog (this, _("Select Certificate File"));
if (d->ShowModal () == wxID_OK) {
load_recipient (boost::filesystem::path (wx_to_std (d->GetPath ())));
}
@@ -199,7 +199,7 @@ RecipientDialog::get_recipient_from_file ()
void
RecipientDialog::setup_sensitivity ()
{
- wxButton* ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this));
+ auto ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this));
if (ok) {
ok->Enable (static_cast<bool>(_recipient) && !_name->GetValue().IsEmpty());
}
diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc
index b5ab8c2db..5ae9f5da4 100644
--- a/src/wx/subtitle_appearance_dialog.cc
+++ b/src/wx/subtitle_appearance_dialog.cc
@@ -39,11 +39,12 @@ DCPOMATIC_DISABLE_WARNINGS
DCPOMATIC_ENABLE_WARNINGS
+using std::dynamic_pointer_cast;
using std::map;
-using std::string;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
using boost::bind;
-using std::dynamic_pointer_cast;
using boost::optional;
using namespace dcpomatic;
#if BOOST_VERSION >= 106100
@@ -68,7 +69,7 @@ SubtitleAppearanceDialog::SubtitleAppearanceDialog (wxWindow* parent, shared_ptr
/* XXX: assuming that all FFmpeg streams have bitmap subs */
if (_stream->colours().empty()) {
_job_manager_connection = JobManager::instance()->ActiveJobsChanged.connect(boost::bind(&SubtitleAppearanceDialog::active_jobs_changed, this, _1));
- _job = JobManager::instance()->add(shared_ptr<Job>(new ExamineFFmpegSubtitlesJob(film, ff)));
+ _job = JobManager::instance()->add(make_shared<ExamineFFmpegSubtitlesJob>(film, ff));
}
}
diff --git a/src/wx/timecode.h b/src/wx/timecode.h
index c31a6740c..84ef5cc1b 100644
--- a/src/wx/timecode.h
+++ b/src/wx/timecode.h
@@ -18,9 +18,11 @@
*/
+
#ifndef DCPOMATIC_WX_TIMECODE_H
#define DCPOMATIC_WX_TIMECODE_H
+
#include "wx_util.h"
#include "lib/dcpomatic_time.h"
#include "lib/types.h"
@@ -28,6 +30,7 @@
#include <wx/wx.h>
#include <boost/signals2.hpp>
+
class TimecodeBase : public wxPanel
{
public:
@@ -58,6 +61,7 @@ protected:
bool _ignore_changed = false;
};
+
template <class T>
class Timecode : public TimecodeBase
{
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index 677b83bdd..481e8100d 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -95,7 +95,7 @@ TimelineContentView::track () const
}
void
-TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> > overlaps)
+TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>> overlaps)
{
DCPOMATIC_ASSERT (_track);
@@ -105,8 +105,8 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
return;
}
- DCPTime const position = cont->position ();
- DCPTime const len = cont->length_after_trim (film);
+ auto const position = cont->position ();
+ auto const len = cont->length_after_trim (film);
wxColour selected (background_colour().Red() / 2, background_colour().Green() / 2, background_colour().Blue() / 2);
diff --git a/src/wx/timeline_time_axis_view.h b/src/wx/timeline_time_axis_view.h
index 5477e61f1..100228ae8 100644
--- a/src/wx/timeline_time_axis_view.h
+++ b/src/wx/timeline_time_axis_view.h
@@ -29,7 +29,7 @@ public:
void set_y (int y);
private:
- void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps);
+ void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps);
int _y; ///< y position in tracks (not pixels)
};
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index fad3779bd..493743d4a 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -297,7 +297,7 @@ checked_set (wxChoice* widget, string value)
void
-checked_set (wxChoice* widget, vector<pair<string, string> > items)
+checked_set (wxChoice* widget, vector<pair<string, string>> items)
{
vector<pair<string, string>> current;
for (unsigned int i = 0; i < widget->GetCount(); ++i) {