Make everything final that can be

Apparently gcc does use final for devirtualization.
This commit is contained in:
Thomas Goyne 2014-03-12 18:39:07 -07:00
parent ab39cfe362
commit ea96c6e2ad
159 changed files with 412 additions and 412 deletions

View File

@ -38,7 +38,7 @@ namespace {
};
template<class T>
struct CastVisitor : public CastVisitorBase {
struct CastVisitor final : public CastVisitorBase {
T *element;
CastVisitor() : element(0) { }
void Visit(T& ele) { element = &ele; }
@ -64,7 +64,7 @@ public:
template <typename ElementTypeT>
class UnknownElement::Imp_T : public UnknownElement::Imp
class UnknownElement::Imp_T final : public UnknownElement::Imp
{
public:
Imp_T(const ElementTypeT& element) : m_Element(element) { }

View File

@ -35,7 +35,7 @@
namespace {
using namespace agi::charset;
class UCDetect : public nsUniversalDetector {
class UCDetect final : public nsUniversalDetector {
/// List of detected character sets
CharsetListDetected list;

View File

@ -25,7 +25,7 @@ namespace agi { namespace charset {
///
/// While glibc iconv supports ISO-6937-2, GNU libiconv does not due to that
/// it's not used by anything but old subtitle formats
class Converter6937 : public Converter {
class Converter6937 final : public Converter {
/// Converter to UCS-4 so that we only have to deal with unicode codepoints
std::unique_ptr<IconvWrapper> to_ucs4;

View File

@ -135,7 +135,7 @@ namespace {
}
#ifdef ICONV_POSIX
class ConverterImpl : public agi::charset::Converter {
class ConverterImpl final : public agi::charset::Converter {
size_t bomSize;
iconv_t cd;
public:
@ -175,7 +175,7 @@ namespace {
#else
class ConverterImpl : public iconv_fallbacks, public agi::charset::Converter {
class ConverterImpl final : public iconv_fallbacks, public agi::charset::Converter {
size_t bomSize;
char invalidRep[8];
size_t invalidRepSize;

View File

@ -32,19 +32,19 @@ namespace {
std::function<void (agi::dispatch::Thunk)> invoke_main;
std::atomic<uint_fast32_t> threads_running;
class MainQueue : public agi::dispatch::Queue {
class MainQueue final : public agi::dispatch::Queue {
void DoInvoke(agi::dispatch::Thunk thunk) override {
invoke_main(thunk);
}
};
class BackgroundQueue : public agi::dispatch::Queue {
class BackgroundQueue final : public agi::dispatch::Queue {
void DoInvoke(agi::dispatch::Thunk thunk) override {
service->post(thunk);
}
};
class SerialQueue : public agi::dispatch::Queue {
class SerialQueue final : public agi::dispatch::Queue {
boost::asio::io_service::strand strand;
void DoInvoke(agi::dispatch::Thunk thunk) override {

View File

@ -31,7 +31,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionJsonValueArray, OptionJsonValueError, "opt
DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionJsonValueSingle, OptionJsonValueError, "options/value")
DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionJsonValueNull, OptionJsonValueError, "options/value")
class ConfigVisitor : public json::ConstVisitor {
class ConfigVisitor final : public json::ConstVisitor {
/// Option map being populated
OptionValueMap &values;
/// Option name prefix to add to read names

View File

@ -109,7 +109,7 @@ struct color_grammar : qi::grammar<Iterator, agi::Color()> {
};
template <typename Lexer>
struct dialogue_tokens : lex::lexer<Lexer> {
struct dialogue_tokens final : lex::lexer<Lexer> {
int paren_depth;
template<typename KT>

View File

@ -29,7 +29,7 @@ public:
// thrown during the first phase of reading. generally catches low-level
// problems such as errant characters or corrupt/incomplete documents
class ScanException : public Exception {
class ScanException final : public Exception {
public:
ScanException(std::string const& sMessage, Reader::Location locError)
: Exception(sMessage)
@ -41,7 +41,7 @@ public:
// thrown during the second phase of reading. generally catches
// higher-level problems such as missing commas or brackets
class ParseException : public Exception {
class ParseException final : public Exception {
public:
ParseException(std::string const& sMessage, Reader::Location locTokenBegin, Reader::Location locTokenEnd)
: Exception(sMessage)

View File

@ -15,7 +15,7 @@ Author: Terry Caton
namespace json {
class Writer : private ConstVisitor {
class Writer final : private ConstVisitor {
Writer(std::ostream& ostr);
void Write(const Object& object);
void Write(const Array& array);

View File

@ -32,7 +32,7 @@ namespace agi {
/// @class line_iterator
/// @brief An iterator over lines in a stream
template<class OutputType = std::string>
class line_iterator : public std::iterator<std::input_iterator_tag, OutputType> {
class line_iterator final : public std::iterator<std::input_iterator_tag, OutputType> {
std::istream *stream; ///< Stream to iterator over
OutputType value; ///< Value to return when this is dereference
std::shared_ptr<agi::charset::IconvWrapper> conv;

View File

@ -120,7 +120,7 @@ public:
};
/// A simple emitter which writes the log to a file in json format
class JsonEmitter : public Emitter {
class JsonEmitter final : public Emitter {
std::unique_ptr<std::ostream> fp;
void WriteTime(const char *key);

View File

@ -39,7 +39,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(OptionErrorDuplicateKey, OptionError, "options/d
class OptionValue;
class OptionValueMap : public std::map<std::string, std::unique_ptr<OptionValue>> {
class OptionValueMap final : public std::map<std::string, std::unique_ptr<OptionValue>> {
private:
OptionValueMap(const OptionValueMap& x);
OptionValueMap& operator=(const OptionValueMap& x);

View File

@ -99,7 +99,7 @@ public:
};
#define CONFIG_OPTIONVALUE(type_name, type) \
class OptionValue##type_name : public OptionValue { \
class OptionValue##type_name final : public OptionValue { \
type value; \
type value_default; \
public: \
@ -121,7 +121,7 @@ CONFIG_OPTIONVALUE(Color, Color)
CONFIG_OPTIONVALUE(Bool, bool)
#define CONFIG_OPTIONVALUE_LIST(type_name, type) \
class OptionValueList##type_name : public OptionValue { \
class OptionValueList##type_name final : public OptionValue { \
std::vector<type> array; \
std::vector<type> array_default; \
std::string name; \

View File

@ -21,7 +21,7 @@
namespace agi {
template<typename T>
class owning_intrusive_list : private boost::intrusive::make_list<T, boost::intrusive::constant_time_size<false>>::type {
class owning_intrusive_list final : private boost::intrusive::make_list<T, boost::intrusive::constant_time_size<false>>::type {
typedef typename boost::intrusive::make_list<T, boost::intrusive::constant_time_size<false>>::type base;
public:
using base::back;

View File

@ -133,7 +133,7 @@ namespace detail {
/// @brief Templated common code for signals
template<class Slot>
class SignalBaseImpl : public SignalBase {
class SignalBaseImpl final : public SignalBase {
protected:
typedef boost::container::map<ConnectionToken*, Slot> SlotMap;
@ -187,7 +187,7 @@ namespace detail {
/// @param Arg1 Type of first argument to pass to slots
/// @param Arg2 Type of second argument to pass to slots
template<class Arg1 = void, class Arg2 = void>
class Signal : public detail::SignalBaseImpl<std::function<void (Arg1, Arg2)> > {
class Signal final : public detail::SignalBaseImpl<std::function<void (Arg1, Arg2)> > {
typedef detail::SignalBaseImpl<std::function<void (Arg1, Arg2)> > super;
using super::Blocked;
using super::slots;
@ -266,7 +266,7 @@ public:
/// @class Signal
/// @brief Zero-argument signal
template<>
class Signal<void> : public detail::SignalBaseImpl<std::function<void ()> > {
class Signal<void> final : public detail::SignalBaseImpl<std::function<void ()> > {
typedef detail::SignalBaseImpl<std::function<void ()> > super;
using super::Blocked;
using super::slots;

View File

@ -22,7 +22,7 @@
#include <vector>
/// @class AssAttachment
class AssAttachment : public AssEntry {
class AssAttachment final : public AssEntry {
/// ASS uuencoded entry data, including header.
boost::flyweight<std::string> entry_data;

View File

@ -83,20 +83,20 @@ public:
virtual std::string GetText() { return text; }
};
class AssDialogueBlockPlain : public AssDialogueBlock {
class AssDialogueBlockPlain final : public AssDialogueBlock {
public:
using AssDialogueBlock::text;
AssBlockType GetType() const override { return AssBlockType::PLAIN; }
AssDialogueBlockPlain(std::string const& text = std::string()) : AssDialogueBlock(text) { }
};
class AssDialogueBlockComment : public AssDialogueBlock {
class AssDialogueBlockComment final : public AssDialogueBlock {
public:
AssBlockType GetType() const override { return AssBlockType::COMMENT; }
AssDialogueBlockComment(std::string const& text = std::string()) : AssDialogueBlock("{" + text + "}") { }
};
class AssDialogueBlockDrawing : public AssDialogueBlock {
class AssDialogueBlockDrawing final : public AssDialogueBlock {
public:
using AssDialogueBlock::text;
int Scale;
@ -105,7 +105,7 @@ public:
AssDialogueBlockDrawing(std::string const& text, int scale) : AssDialogueBlock(text), Scale(scale) { }
};
class AssDialogueBlockOverride : public AssDialogueBlock {
class AssDialogueBlockOverride final : public AssDialogueBlock {
public:
AssDialogueBlockOverride(std::string const& text = std::string()) : AssDialogueBlock(text) { }
@ -150,7 +150,7 @@ struct AssDialogueBase {
boost::flyweight<std::string> Text;
};
class AssDialogue : public AssEntry, public AssDialogueBase, public AssEntryListHook {
class AssDialogue final : public AssEntry, public AssDialogueBase, public AssEntryListHook {
std::string GetData(bool ssa) const;
/// @brief Parse raw ASS data into everything else

View File

@ -18,7 +18,7 @@
#include <boost/algorithm/string/predicate.hpp>
class AssInfo : public AssEntry {
class AssInfo final : public AssEntry {
std::string key;
std::string value;

View File

@ -62,7 +62,7 @@ enum class VariableDataType {
};
/// A single parameter to an override tag
class AssOverrideParameter : boost::noncopyable {
class AssOverrideParameter final : boost::noncopyable {
std::string value;
mutable std::unique_ptr<AssDialogueBlockOverride> block;
VariableDataType type;
@ -87,7 +87,7 @@ public:
}
};
class AssOverrideTag : boost::noncopyable {
class AssOverrideTag final : boost::noncopyable {
bool valid;
public:

View File

@ -39,7 +39,7 @@
#include <array>
#include <wx/arrstr.h>
class AssStyle : public AssEntry, public AssEntryListHook {
class AssStyle final : public AssEntry, public AssEntryListHook {
std::string data;
public:

View File

@ -53,7 +53,7 @@ class wxSlider;
/// @class AudioBox
/// @brief Panel with audio playback and timing controls, also containing an AudioDisplay
class AudioBox : public wxSashWindow {
class AudioBox final : public wxSashWindow {
/// The controller controlling this audio box
AudioController *controller;

View File

@ -63,7 +63,7 @@ class TimeRange;
/// providers or players owned by a controller. If some operation that isn't
/// possible in the existing design is needed, the controller should be
/// extended in some way to allow it.
class AudioController : public wxEvtHandler {
class AudioController final : public wxEvtHandler {
/// Project context this controller belongs to
agi::Context *context;

View File

@ -108,7 +108,7 @@ public:
wxColour Selection() const { return focused ? sel_focused_colour : sel_colour; }
};
class AudioDisplayScrollbar : public AudioDisplayInteractionObject {
class AudioDisplayScrollbar final : public AudioDisplayInteractionObject {
static const int height = 15;
static const int min_width = 10;
@ -247,7 +247,7 @@ public:
const int AudioDisplayScrollbar::min_width;
class AudioDisplayTimeline : public AudioDisplayInteractionObject {
class AudioDisplayTimeline final : public AudioDisplayInteractionObject {
int duration; ///< Total duration in ms
double ms_per_pixel; ///< Milliseconds per pixel
int pixel_left; ///< Leftmost visible pixel (i.e. scroll position)
@ -460,7 +460,7 @@ public:
}
};
class AudioMarkerInteractionObject : public AudioDisplayInteractionObject {
class AudioMarkerInteractionObject final : public AudioDisplayInteractionObject {
// Object-pair being interacted with
std::vector<AudioMarker*> markers;
AudioTimingController *timing_controller;
@ -502,7 +502,7 @@ public:
int GetPosition() const { return markers.front()->GetPosition(); }
};
class AudioStyleRangeMerger : public AudioRenderingStyleRanges {
class AudioStyleRangeMerger final : public AudioRenderingStyleRanges {
typedef std::map<int, AudioRenderingStyle> style_map;
public:
typedef style_map::iterator iterator;

View File

@ -67,7 +67,7 @@ namespace agi { struct Context; }
/// actually updated until the line is committed (which if auto-commit timing
/// changes is on, will happen as soon as the user adjusts the timing of the
/// new syllable).
class AudioKaraoke : public wxWindow {
class AudioKaraoke final : public wxWindow {
agi::Context *c; ///< Project context
agi::signal::Connection file_changed; ///< File changed slot
agi::signal::Connection audio_opened; ///< Audio opened connection

View File

@ -32,7 +32,7 @@
#include <algorithm>
class AudioMarkerKeyframe : public AudioMarker {
class AudioMarkerKeyframe final : public AudioMarker {
Pen *style;
int position;
public:
@ -86,7 +86,7 @@ void AudioMarkerProviderKeyframes::GetMarkers(TimeRange const& range, AudioMarke
out.push_back(&*a);
}
class VideoPositionMarker : public AudioMarker {
class VideoPositionMarker final : public AudioMarker {
Pen style;
int position;

View File

@ -122,7 +122,7 @@ public:
/// Marker provider for video keyframes
class AudioMarkerProviderKeyframes : public AudioMarkerProvider {
class AudioMarkerProviderKeyframes final : public AudioMarkerProvider {
/// Video controller to get keyframes from
VideoContext *vc;
@ -155,7 +155,7 @@ public:
};
/// Marker provider for the current video playback position
class VideoPositionMarkerProvider : public AudioMarkerProvider {
class VideoPositionMarkerProvider final : public AudioMarkerProvider {
VideoContext *vc;
std::unique_ptr<VideoPositionMarker> marker;
@ -174,8 +174,8 @@ public:
};
/// Marker provider for lines every second
class SecondsMarkerProvider : public AudioMarkerProvider {
struct Marker : public AudioMarker {
class SecondsMarkerProvider final : public AudioMarkerProvider {
struct Marker final : public AudioMarker {
Pen *style;
int position;

View File

@ -40,7 +40,7 @@
struct PlaybackState;
class AlsaPlayer : public AudioPlayer {
class AlsaPlayer final : public AudioPlayer {
std::unique_ptr<PlaybackState> ps;
pthread_t thread;

View File

@ -43,7 +43,7 @@
class DirectSoundPlayer;
class DirectSoundPlayerThread : public wxThread {
class DirectSoundPlayerThread final : public wxThread {
DirectSoundPlayer *parent;
HANDLE stopnotify;
@ -55,7 +55,7 @@ public:
wxThread::ExitCode Entry();
};
class DirectSoundPlayer : public AudioPlayer {
class DirectSoundPlayer final : public AudioPlayer {
friend class DirectSoundPlayerThread;
volatile bool playing;

View File

@ -117,7 +117,7 @@ struct COMObjectRetainer {
};
/// @brief RAII wrapper around Win32 HANDLE type
struct Win32KernelHandle : public agi::scoped_holder<HANDLE, BOOL (__stdcall *)(HANDLE)> {
struct Win32KernelHandle final : public agi::scoped_holder<HANDLE, BOOL (__stdcall *)(HANDLE)> {
/// @brief Create with a managed handle
/// @param handle Win32 handle to manage
Win32KernelHandle(HANDLE handle = 0)

View File

@ -44,7 +44,7 @@ class DirectSoundPlayer2Thread;
/// The core design idea is to have a playback thread that owns the DirectSound COM objects
/// and performs all playback operations, and use the player object as a proxy to
/// send commands to the playback thread.
class DirectSoundPlayer2 : public AudioPlayer {
class DirectSoundPlayer2 final : public AudioPlayer {
/// The playback thread
std::unique_ptr<DirectSoundPlayer2Thread> thread;

View File

@ -51,7 +51,7 @@
#include <wx/timer.h>
class OpenALPlayer : public AudioPlayer, wxTimer {
class OpenALPlayer final : public AudioPlayer, wxTimer {
/// Number of OpenAL buffers to use
static const ALsizei num_buffers = 8;

View File

@ -52,7 +52,7 @@ class AudioProvider;
class OSSPlayer;
/// Worker thread to asynchronously write audio data to the output device
class OSSPlayerThread : public wxThread {
class OSSPlayerThread final : public wxThread {
/// Parent player
OSSPlayer *parent;
@ -65,7 +65,7 @@ public:
wxThread::ExitCode Entry();
};
class OSSPlayer : public AudioPlayer {
class OSSPlayer final : public AudioPlayer {
friend class OSSPlayerThread;
/// sample rate of audio

View File

@ -49,7 +49,7 @@ class wxArrayString;
/// @class PortAudioPlayer
/// @brief PortAudio Player
///
class PortAudioPlayer : public AudioPlayer {
class PortAudioPlayer final : public AudioPlayer {
typedef std::vector<PaDeviceIndex> DeviceVec;
/// Map of supported output devices from name -> device index
std::map<std::string, DeviceVec> devices;

View File

@ -39,7 +39,7 @@
class PulseAudioPlayer;
class PulseAudioPlayer : public AudioPlayer {
class PulseAudioPlayer final : public AudioPlayer {
float volume = 1.f;
bool is_playing = false;

View File

@ -38,7 +38,7 @@
#include "avisynth.h"
#include "avisynth_wrap.h"
class AvisynthAudioProvider : public AudioProvider {
class AvisynthAudioProvider final : public AudioProvider {
AviSynthWrapper avs_wrapper;
PClip clip;

View File

@ -33,7 +33,7 @@
/// Anything integral -> 16 bit signed machine-endian audio converter
template<class Target>
class BitdepthConvertAudioProvider : public AudioProviderWrapper {
class BitdepthConvertAudioProvider final : public AudioProviderWrapper {
int src_bytes_per_sample;
public:
BitdepthConvertAudioProvider(std::unique_ptr<AudioProvider> src) : AudioProviderWrapper(std::move(src)) {
@ -74,7 +74,7 @@ public:
/// Floating point -> 16 bit signed machine-endian audio converter
template<class Source, class Target>
class FloatConvertAudioProvider : public AudioProviderWrapper {
class FloatConvertAudioProvider final : public AudioProviderWrapper {
public:
FloatConvertAudioProvider(std::unique_ptr<AudioProvider> src) : AudioProviderWrapper(std::move(src)) {
bytes_per_sample = sizeof(Target);
@ -105,7 +105,7 @@ public:
};
/// Non-mono 16-bit signed machine-endian -> mono 16-bit signed machine endian converter
class DownmixAudioProvider : public AudioProviderWrapper {
class DownmixAudioProvider final : public AudioProviderWrapper {
int src_channels;
public:
DownmixAudioProvider(std::unique_ptr<AudioProvider> src) : AudioProviderWrapper(std::move(src)) {
@ -136,7 +136,7 @@ public:
/// Sample doubler with linear interpolation for the agi::util::make_unique<samples>
/// Requires 16-bit mono input
class SampleDoublingAudioProvider : public AudioProviderWrapper {
class SampleDoublingAudioProvider final : public AudioProviderWrapper {
public:
SampleDoublingAudioProvider(std::unique_ptr<AudioProvider> src) : AudioProviderWrapper(std::move(src)) {
if (source->GetBytesPerSample() != 2)

View File

@ -34,7 +34,7 @@
#include "include/aegisub/audio_provider.h"
class DummyAudioProvider : public AudioProvider {
class DummyAudioProvider final : public AudioProvider {
bool noise;
void FillBuffer(void *buf, int64_t start, int64_t count) const override;

View File

@ -39,7 +39,7 @@
/// @class FFmpegSourceAudioProvider
/// @brief Implements audio loading with the FFMS library.
class FFmpegSourceAudioProvider : public AudioProvider, FFmpegSourceProvider {
class FFmpegSourceAudioProvider final : public AudioProvider, FFmpegSourceProvider {
/// audio source object
agi::scoped_holder<FFMS_AudioSource*, void (FFMS_CC *)(FFMS_AudioSource*)> AudioSource;

View File

@ -71,7 +71,7 @@ agi::fs::path cache_path() {
}
/// A PCM audio provider for raw dumps with no header
class RawAudioProvider : public PCMAudioProvider {
class RawAudioProvider final : public PCMAudioProvider {
public:
RawAudioProvider(agi::fs::path const& cache_filename, AudioProvider *src)
: PCMAudioProvider(cache_filename)

View File

@ -39,7 +39,7 @@ namespace agi {
class ProgressSink;
}
class HDAudioProvider : public AudioProviderWrapper {
class HDAudioProvider final : public AudioProviderWrapper {
/// Name of the file which the decoded audio is written to
agi::fs::path diskCacheFilename;
/// Audio provider which reads from the decoded cache

View File

@ -21,7 +21,7 @@
#include <memory>
#include <mutex>
class LockAudioProvider : public AudioProviderWrapper {
class LockAudioProvider final : public AudioProviderWrapper {
mutable std::mutex mutex;
void FillBuffer(void *buf, int64_t start, int64_t count) const override;

View File

@ -351,7 +351,7 @@ static const uint8_t w64Guiddata[16] = {
/// @brief Sony Wave64 audio provider
///
/// http://www.vcs.de/fileadmin/user_upload/MBS/PDF/Whitepaper/Informations_about_Sony_Wave64.pdf
class Wave64AudioProvider : public PCMAudioProvider {
class Wave64AudioProvider final : public PCMAudioProvider {
// Here's some copy-paste from the FFmpegSource2 code
/// http://msdn.microsoft.com/en-us/library/dd757720(VS.85).aspx

View File

@ -42,7 +42,7 @@ namespace agi {
class ProgressSink;
}
class RAMAudioProvider : public AudioProviderWrapper {
class RAMAudioProvider final : public AudioProviderWrapper {
#ifdef _MSC_VER
boost::container::stable_vector<char[1 << 22]> blockcache;
#else

View File

@ -52,7 +52,7 @@ struct AudioSpectrumCacheBlockFactory;
///
/// Renders frequency-power spectrum graphs of PCM audio data using a derivation function
/// such as the fast fourier transform.
class AudioSpectrumRenderer : public AudioRendererBitmapProvider {
class AudioSpectrumRenderer final : public AudioRendererBitmapProvider {
friend struct AudioSpectrumCacheBlockFactory;
/// Internal cache management for the spectrum

View File

@ -40,7 +40,7 @@ class AudioColorScheme;
#include "audio_renderer.h"
class AudioWaveformRenderer : public AudioRendererBitmapProvider {
class AudioWaveformRenderer final : public AudioRendererBitmapProvider {
/// Colour tables used for rendering
std::vector<AudioColorScheme> colors;

View File

@ -54,7 +54,7 @@ class TimeableLine;
///
/// Audio marker intended to live in pairs of two, taking styles depending
/// on which marker in the pair is to the left and which is to the right.
class DialogueTimingMarker : public AudioMarker {
class DialogueTimingMarker final : public AudioMarker {
/// Current ms position of this marker
int position;
@ -285,7 +285,7 @@ void DialogueTimingMarker::SetPosition(int new_position) {
/// addition, any markers for inactive lines that start/end at the same time
/// as the active line starts/ends can optionally be dragged along with the
/// active line's markers, updating those lines as well.
class AudioTimingControllerDialogue : public AudioTimingController {
class AudioTimingControllerDialogue final : public AudioTimingController {
/// The rendering style for the active line's start marker
Pen style_left;
/// The rendering style for the active line's end marker

View File

@ -43,7 +43,7 @@
/// @class KaraokeMarker
/// @brief AudioMarker implementation for AudioTimingControllerKaraoke
class KaraokeMarker : public AudioMarker {
class KaraokeMarker final : public AudioMarker {
int position;
Pen *pen;
FeetStyle style;
@ -81,7 +81,7 @@ public:
///
/// This does not support \kt, as it inherently requires that the end time of
/// one syllable be the same as the start time of the next one.
class AudioTimingControllerKaraoke : public AudioTimingController {
class AudioTimingControllerKaraoke final : public AudioTimingController {
std::deque<agi::signal::Connection> slots;
agi::signal::Connection& file_changed_slot;

View File

@ -123,7 +123,7 @@ namespace Automation4 {
/// A wrapper around agi::ProgressSink which adds the ability to open
/// dialogs on the GUI thread
class ProgressSink : public agi::ProgressSink {
class ProgressSink final : public agi::ProgressSink {
agi::ProgressSink *impl;
BackgroundScriptRunner *bsr;
int trace_level;
@ -218,7 +218,7 @@ namespace Automation4 {
};
/// Manager for scripts specified by a subtitle file
class LocalScriptManager : public ScriptManager {
class LocalScriptManager final : public ScriptManager {
std::deque<agi::signal::Connection> slots;
agi::Context *context;
@ -229,7 +229,7 @@ namespace Automation4 {
};
/// Manager for scripts in the autoload directory
class AutoloadScriptManager : public ScriptManager {
class AutoloadScriptManager final : public ScriptManager {
std::string path;
public:
AutoloadScriptManager(std::string path);
@ -281,7 +281,7 @@ namespace Automation4 {
/// A script which represents a file not recognized by any registered
/// automation engines
class UnknownScript : public Script {
class UnknownScript final : public Script {
public:
UnknownScript(agi::fs::path const& filename) : Script(filename) { }

View File

@ -300,7 +300,7 @@ int luaopen_lpeg (lua_State *L);
namespace Automation4 {
int regex_init(lua_State *L);
class LuaScript : public Script {
class LuaScript final : public Script {
lua_State *L;
std::string name;

View File

@ -200,7 +200,7 @@ namespace Automation4 {
};
/// A lua-generated dialog or panel in the export options dialog
class LuaDialog : public ScriptDialog {
class LuaDialog final : public ScriptDialog {
/// Controls in this dialog
std::vector<std::unique_ptr<LuaDialogControl>> controls;
/// The names and IDs of buttons in this dialog if non-default ones were used
@ -250,7 +250,7 @@ namespace Automation4 {
/// @throws agi::UserCancelException if the function fails to run to completion (either due to cancelling or errors)
void LuaThreadedCall(lua_State *L, int nargs, int nresults, std::string const& title, wxWindow *parent, bool can_open_config);
class LuaCommand : public cmd::Command, private LuaFeature {
class LuaCommand final : public cmd::Command, private LuaFeature {
std::string cmd_name;
wxString display;
wxString help;
@ -274,7 +274,7 @@ namespace Automation4 {
static int LuaRegister(lua_State *L);
};
class LuaExportFilter : public ExportFilter, private LuaFeature {
class LuaExportFilter final : public ExportFilter, private LuaFeature {
bool has_config;
LuaDialog *config_dialog;

View File

@ -141,7 +141,7 @@ namespace Automation4 {
namespace LuaControl {
/// A static text label
class Label : public LuaDialogControl {
class Label final : public LuaDialogControl {
std::string label;
public:
Label(lua_State *L) : LuaDialogControl(L), label(get_field(L, "label")) { }
@ -193,7 +193,7 @@ namespace Automation4 {
};
/// A color-picker button
class Color : public LuaDialogControl {
class Color final : public LuaDialogControl {
agi::Color color;
bool alpha;
@ -221,7 +221,7 @@ namespace Automation4 {
};
/// A multiline text edit control
class Textbox : public Edit {
class Textbox final : public Edit {
public:
Textbox(lua_State *L) : Edit(L) { }
@ -236,7 +236,7 @@ namespace Automation4 {
/// Integer only edit
class IntEdit : public Edit {
class IntEdit final : public Edit {
wxSpinCtrl *cw;
int value;
int min, max;
@ -272,14 +272,14 @@ namespace Automation4 {
};
// Float only edit
class FloatEdit : public Edit {
class FloatEdit final : public Edit {
double value;
double min;
double max;
double step;
wxSpinCtrlDouble *scd;
struct DoubleValidator : public wxValidator {
struct DoubleValidator final : public wxValidator {
double *value;
DoubleValidator(double *value) : value(value) { }
wxValidator *Clone() const override { return new DoubleValidator(value); }
@ -341,7 +341,7 @@ namespace Automation4 {
};
/// A dropdown list
class Dropdown : public LuaDialogControl {
class Dropdown final : public LuaDialogControl {
std::vector<std::string> items;
std::string value;
wxComboBox *cw;
@ -371,7 +371,7 @@ namespace Automation4 {
}
};
class Checkbox : public LuaDialogControl {
class Checkbox final : public LuaDialogControl {
std::string label;
bool value;
wxCheckBox *cw;

View File

@ -35,7 +35,7 @@
#include "auto4_base.h"
namespace Automation4 {
class LuaScriptFactory : public ScriptFactory {
class LuaScriptFactory final : public ScriptFactory {
std::unique_ptr<Script> Produce(agi::fs::path const& filename) const override;
public:
LuaScriptFactory();

View File

@ -49,7 +49,7 @@ namespace agi {
}
class AssDialogue;
class BaseGrid : public wxWindow, public SubtitleSelectionController {
class BaseGrid final : public wxWindow, public SubtitleSelectionController {
int lineHeight = 1; ///< Height of a line in pixels in the current font
bool holding = false; ///< Is a drag selection in process?
wxFont font; ///< Current grid font

View File

@ -43,7 +43,7 @@ public:
agi::Color GetColor() { return colour; }
};
struct ColorValidator : public wxValidator {
struct ColorValidator final : public wxValidator {
agi::Color *color;
ColorValidator(agi::Color *color) : color(color) { }
wxValidator *Clone() const override { return new ColorValidator(color); }

View File

@ -57,7 +57,7 @@
namespace {
using cmd::Command;
struct app_about : public Command {
struct app_about final : public Command {
CMD_NAME("app/about")
CMD_ICON(about_menu)
STR_MENU("&About")
@ -69,7 +69,7 @@ struct app_about : public Command {
}
};
struct app_display_audio_subs : public Command {
struct app_display_audio_subs final : public Command {
CMD_NAME("app/display/audio_subs")
STR_MENU("&Audio+Subs View")
STR_DISP("Audio+Subs View")
@ -89,7 +89,7 @@ struct app_display_audio_subs : public Command {
}
};
struct app_display_full : public Command {
struct app_display_full final : public Command {
CMD_NAME("app/display/full")
STR_MENU("&Full view")
STR_DISP("Full view")
@ -109,7 +109,7 @@ struct app_display_full : public Command {
}
};
struct app_display_subs : public Command {
struct app_display_subs final : public Command {
CMD_NAME("app/display/subs")
STR_MENU("S&ubs Only View")
STR_DISP("Subs Only View")
@ -125,7 +125,7 @@ struct app_display_subs : public Command {
}
};
struct app_display_video_subs : public Command {
struct app_display_video_subs final : public Command {
CMD_NAME("app/display/video_subs")
STR_MENU("&Video+Subs View")
STR_DISP("Video+Subs View")
@ -145,7 +145,7 @@ struct app_display_video_subs : public Command {
}
};
struct app_exit : public Command {
struct app_exit final : public Command {
CMD_NAME("app/exit")
STR_MENU("E&xit")
STR_DISP("Exit")
@ -156,7 +156,7 @@ struct app_exit : public Command {
}
};
struct app_language : public Command {
struct app_language final : public Command {
CMD_NAME("app/language")
CMD_ICON(languages_menu)
STR_MENU("&Language...")
@ -181,7 +181,7 @@ struct app_language : public Command {
}
};
struct app_log : public Command {
struct app_log final : public Command {
CMD_NAME("app/log")
CMD_ICON(about_menu)
STR_MENU("&Log window")
@ -193,7 +193,7 @@ struct app_log : public Command {
}
};
struct app_new_window : public Command {
struct app_new_window final : public Command {
CMD_NAME("app/new_window")
CMD_ICON(new_window_menu)
STR_MENU("New &Window")
@ -205,7 +205,7 @@ struct app_new_window : public Command {
}
};
struct app_options : public Command {
struct app_options final : public Command {
CMD_NAME("app/options")
CMD_ICON(options_button)
STR_MENU("&Options...")
@ -221,7 +221,7 @@ struct app_options : public Command {
}
};
struct app_toggle_global_hotkeys : public Command {
struct app_toggle_global_hotkeys final : public Command {
CMD_NAME("app/toggle/global_hotkeys")
CMD_ICON(toggle_audio_medusa)
STR_MENU("Toggle global hotkey overrides")
@ -239,7 +239,7 @@ struct app_toggle_global_hotkeys : public Command {
}
};
struct app_toggle_toolbar : public Command {
struct app_toggle_toolbar final : public Command {
CMD_NAME("app/toggle/toolbar")
STR_HELP("Toggle the main toolbar")
CMD_TYPE(COMMAND_DYNAMIC_NAME)
@ -260,7 +260,7 @@ struct app_toggle_toolbar : public Command {
}
};
struct app_updates : public Command {
struct app_updates final : public Command {
CMD_NAME("app/updates")
STR_MENU("&Check for Updates...")
STR_DISP("Check for Updates")

View File

@ -60,7 +60,7 @@ namespace {
}
};
struct audio_close : public validate_audio_open {
struct audio_close final : public validate_audio_open {
CMD_NAME("audio/close")
CMD_ICON(close_audio_menu)
STR_MENU("&Close Audio")
@ -72,7 +72,7 @@ struct audio_close : public validate_audio_open {
}
}