Eliminate a bunch of explicit constructors/destructors
Use explicitly defaulted destructors for base cases when possible, eliminate aggregate initialization constructors where possible, and push some more stuff to NSDMIs.
This commit is contained in:
parent
a5fdc6795c
commit
15ae2b0ccc
44 changed files with 91 additions and 177 deletions
|
@ -38,7 +38,7 @@ class SyntaxHighlighter {
|
||||||
if (ranges.size() && ranges.back().type == type)
|
if (ranges.size() && ranges.back().type == type)
|
||||||
ranges.back().length += len;
|
ranges.back().length += len;
|
||||||
else
|
else
|
||||||
ranges.push_back(DialogueToken(type, len));
|
ranges.push_back(DialogueToken{type, len});
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -101,7 +101,7 @@ class WordSplitter {
|
||||||
tokens[i].length = len;
|
tokens[i].length = len;
|
||||||
|
|
||||||
if (old.length != (size_t)len) {
|
if (old.length != (size_t)len) {
|
||||||
tokens.insert(tokens.begin() + i + 1, DialogueToken(old.type, old.length - len));
|
tokens.insert(tokens.begin() + i + 1, DialogueToken{old.type, old.length - len});
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,12 @@ namespace {
|
||||||
void Visit(Boolean const&) { }
|
void Visit(Boolean const&) { }
|
||||||
void Visit(Null const&) { is_null = true; }
|
void Visit(Null const&) { is_null = true; }
|
||||||
public:
|
public:
|
||||||
bool is_null;
|
bool is_null = false;
|
||||||
CastVisitorBase() : is_null(false) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct CastVisitor final : public CastVisitorBase {
|
struct CastVisitor final : public CastVisitorBase {
|
||||||
T *element;
|
T *element = nullptr;
|
||||||
CastVisitor() : element(0) { }
|
|
||||||
void Visit(T& ele) { element = &ele; }
|
void Visit(T& ele) { element = &ele; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ namespace ass {
|
||||||
ptrdiff_t len = it->value().end() - it->value().begin();
|
ptrdiff_t len = it->value().end() - it->value().begin();
|
||||||
assert(len > 0);
|
assert(len > 0);
|
||||||
if (data.empty() || data.back().type != id)
|
if (data.empty() || data.back().type != id)
|
||||||
data.push_back(DialogueToken(id, len));
|
data.push_back(DialogueToken{id, len});
|
||||||
else
|
else
|
||||||
data.back().length += len;
|
data.back().length += len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,6 @@ struct TimecodeRange {
|
||||||
int end;
|
int end;
|
||||||
double fps;
|
double fps;
|
||||||
bool operator<(TimecodeRange const& cmp) const { return start < cmp.start; }
|
bool operator<(TimecodeRange const& cmp) const { return start < cmp.start; }
|
||||||
TimecodeRange(int start=0, int end=0, double fps=0.)
|
|
||||||
: start(start), end(end), fps(fps) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @brief Parse a single line of a v1 timecode file
|
/// @brief Parse a single line of a v1 timecode file
|
||||||
|
@ -95,7 +93,7 @@ TimecodeRange v1_parse_line(std::string const& str) {
|
||||||
void v1_fill_range_gaps(std::list<TimecodeRange> &ranges, double fps) {
|
void v1_fill_range_gaps(std::list<TimecodeRange> &ranges, double fps) {
|
||||||
// Range for frames between start and first override
|
// Range for frames between start and first override
|
||||||
if (ranges.empty() || ranges.front().start > 0)
|
if (ranges.empty() || ranges.front().start > 0)
|
||||||
ranges.emplace_front(0, ranges.empty() ? 0 : ranges.front().start - 1, fps);
|
ranges.push_front(TimecodeRange{0, ranges.empty() ? 0 : ranges.front().start - 1, fps});
|
||||||
|
|
||||||
for (auto cur = ++begin(ranges), prev = begin(ranges); cur != end(ranges); ++cur, ++prev) {
|
for (auto cur = ++begin(ranges), prev = begin(ranges); cur != end(ranges); ++cur, ++prev) {
|
||||||
if (prev->end >= cur->start)
|
if (prev->end >= cur->start)
|
||||||
|
@ -103,7 +101,7 @@ void v1_fill_range_gaps(std::list<TimecodeRange> &ranges, double fps) {
|
||||||
// broken things with them
|
// broken things with them
|
||||||
throw UnorderedTimecodes("Override ranges must not overlap");
|
throw UnorderedTimecodes("Override ranges must not overlap");
|
||||||
if (prev->end + 1 < cur->start) {
|
if (prev->end + 1 < cur->start) {
|
||||||
ranges.emplace(cur, prev->end + 1, cur->start -1, fps);
|
ranges.insert(cur, TimecodeRange{prev->end + 1, cur->start - 1, fps});
|
||||||
++prev;
|
++prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,6 @@ namespace agi {
|
||||||
struct DialogueToken {
|
struct DialogueToken {
|
||||||
int type;
|
int type;
|
||||||
size_t length;
|
size_t length;
|
||||||
DialogueToken(int type, size_t length) : type(type), length(length) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Tokenize the passed string as the body of a dialogue line
|
/// Tokenize the passed string as the body of a dialogue line
|
||||||
|
|
|
@ -19,11 +19,9 @@ class Reader {
|
||||||
public:
|
public:
|
||||||
// this structure will be reported in one of the exceptions defined below
|
// this structure will be reported in one of the exceptions defined below
|
||||||
struct Location {
|
struct Location {
|
||||||
Location() : m_nLine(0), m_nLineOffset(0), m_nDocOffset(0) { }
|
unsigned int m_nLine = 0; // document line, zero-indexed
|
||||||
|
unsigned int m_nLineOffset = 0; // character offset from beginning of line, zero indexed
|
||||||
unsigned int m_nLine; // document line, zero-indexed
|
unsigned int m_nDocOffset = 0; // character offset from entire document, zero indexed
|
||||||
unsigned int m_nLineOffset; // character offset from beginning of line, zero indexed
|
|
||||||
unsigned int m_nDocOffset; // character offset from entire document, zero indexed
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// thrown during the first phase of reading. generally catches low-level
|
// thrown during the first phase of reading. generally catches low-level
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace json
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Visitor {
|
struct Visitor {
|
||||||
virtual ~Visitor() { }
|
virtual ~Visitor() = default;
|
||||||
|
|
||||||
virtual void Visit(Array& array) = 0;
|
virtual void Visit(Array& array) = 0;
|
||||||
virtual void Visit(Object& object) = 0;
|
virtual void Visit(Object& object) = 0;
|
||||||
|
@ -26,7 +26,7 @@ struct Visitor {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ConstVisitor {
|
struct ConstVisitor {
|
||||||
virtual ~ConstVisitor() { }
|
virtual ~ConstVisitor() = default;
|
||||||
|
|
||||||
virtual void Visit(const Array& array) = 0;
|
virtual void Visit(const Array& array) = 0;
|
||||||
virtual void Visit(const Object& object) = 0;
|
virtual void Visit(const Object& object) = 0;
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef void* iconv_t;
|
||||||
/// Helper class that abstracts away the differences between libiconv and
|
/// Helper class that abstracts away the differences between libiconv and
|
||||||
/// POSIX iconv implementations
|
/// POSIX iconv implementations
|
||||||
struct Converter {
|
struct Converter {
|
||||||
virtual ~Converter() { }
|
virtual ~Converter() = default;
|
||||||
virtual size_t Convert(const char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft) = 0;
|
virtual size_t Convert(const char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace agi {
|
||||||
unsigned char b = 0; ///< Blue component
|
unsigned char b = 0; ///< Blue component
|
||||||
unsigned char a = 0; ///< Alpha component
|
unsigned char a = 0; ///< Alpha component
|
||||||
|
|
||||||
Color() { }
|
Color() = default;
|
||||||
Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0);
|
Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0);
|
||||||
Color(std::string const& str);
|
Color(std::string const& str);
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,7 @@ void Copy(fs::path const& from, fs::path const& to) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DirectoryIterator::PrivData {
|
struct DirectoryIterator::PrivData {
|
||||||
scoped_holder<HANDLE, BOOL (__stdcall *)(HANDLE)> h;
|
scoped_holder<HANDLE, BOOL (__stdcall *)(HANDLE)> h{INVALID_HANDLE_VALUE, FindClose};
|
||||||
PrivData() : h(INVALID_HANDLE_VALUE, FindClose) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DirectoryIterator::DirectoryIterator() { }
|
DirectoryIterator::DirectoryIterator() { }
|
||||||
|
|
|
@ -75,7 +75,7 @@ protected:
|
||||||
std::string text;
|
std::string text;
|
||||||
public:
|
public:
|
||||||
AssDialogueBlock(std::string text) : text(std::move(text)) { }
|
AssDialogueBlock(std::string text) : text(std::move(text)) { }
|
||||||
virtual ~AssDialogueBlock() { }
|
virtual ~AssDialogueBlock() = default;
|
||||||
|
|
||||||
virtual AssBlockType GetType() const = 0;
|
virtual AssBlockType GetType() const = 0;
|
||||||
virtual std::string GetText() { return text; }
|
virtual std::string GetText() { return text; }
|
||||||
|
|
|
@ -51,7 +51,7 @@ using AssEntryListHook = boost::intrusive::make_list_base_hook<boost::intrusive:
|
||||||
|
|
||||||
class AssEntry {
|
class AssEntry {
|
||||||
public:
|
public:
|
||||||
virtual ~AssEntry() { }
|
virtual ~AssEntry() = default;
|
||||||
|
|
||||||
/// Section of the file this entry belongs to
|
/// Section of the file this entry belongs to
|
||||||
virtual AssEntryGroup Group() const=0;
|
virtual AssEntryGroup Group() const=0;
|
||||||
|
|
|
@ -60,7 +60,7 @@ class AssExportFilter : public boost::intrusive::make_list_base_hook<boost::intr
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AssExportFilter(std::string name, std::string description, int priority = 0);
|
AssExportFilter(std::string name, std::string description, int priority = 0);
|
||||||
virtual ~AssExportFilter() { };
|
virtual ~AssExportFilter() = default;
|
||||||
|
|
||||||
std::string const& GetName() const { return name; }
|
std::string const& GetName() const { return name; }
|
||||||
std::string const& GetDescription() const { return description; }
|
std::string const& GetDescription() const { return description; }
|
||||||
|
|
|
@ -167,13 +167,6 @@ struct AssOverrideParamProto {
|
||||||
|
|
||||||
/// Semantic type of this parameter
|
/// Semantic type of this parameter
|
||||||
AssParameterClass classification;
|
AssParameterClass classification;
|
||||||
|
|
||||||
AssOverrideParamProto(VariableDataType type, int opt, AssParameterClass classi)
|
|
||||||
: optional(opt)
|
|
||||||
, type(type)
|
|
||||||
, classification(classi)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AssOverrideTagProto {
|
struct AssOverrideTagProto {
|
||||||
|
@ -190,7 +183,7 @@ struct AssOverrideTagProto {
|
||||||
/// @param classi Semantic type of the parameter
|
/// @param classi Semantic type of the parameter
|
||||||
/// @param opt Situations in which this parameter is present
|
/// @param opt Situations in which this parameter is present
|
||||||
void AddParam(VariableDataType type, AssParameterClass classi = AssParameterClass::NORMAL, int opt = NOT_OPTIONAL) {
|
void AddParam(VariableDataType type, AssParameterClass classi = AssParameterClass::NORMAL, int opt = NOT_OPTIONAL) {
|
||||||
params.emplace_back(type, opt, classi);
|
params.push_back(AssOverrideParamProto{opt, type, classi});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Convenience function for single-argument tags
|
/// @brief Convenience function for single-argument tags
|
||||||
|
@ -200,7 +193,7 @@ struct AssOverrideTagProto {
|
||||||
/// @param opt Situations in which this parameter is present
|
/// @param opt Situations in which this parameter is present
|
||||||
void Set(const char *name, VariableDataType type, AssParameterClass classi = AssParameterClass::NORMAL, int opt = NOT_OPTIONAL) {
|
void Set(const char *name, VariableDataType type, AssParameterClass classi = AssParameterClass::NORMAL, int opt = NOT_OPTIONAL) {
|
||||||
this->name = name;
|
this->name = name;
|
||||||
params.emplace_back(type, opt, classi);
|
params.push_back(AssOverrideParamProto{opt, type, classi});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
///
|
///
|
||||||
/// Empty virtual destructor for the cases that need it.
|
/// Empty virtual destructor for the cases that need it.
|
||||||
virtual ~AudioDisplayInteractionObject() { }
|
virtual ~AudioDisplayInteractionObject() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @class AudioDisplay
|
/// @class AudioDisplay
|
||||||
|
|
|
@ -85,7 +85,7 @@ protected:
|
||||||
agi::signal::Signal<> AnnounceMarkerMoved;
|
agi::signal::Signal<> AnnounceMarkerMoved;
|
||||||
public:
|
public:
|
||||||
/// Virtual destructor, does nothing
|
/// Virtual destructor, does nothing
|
||||||
virtual ~AudioMarkerProvider() { }
|
virtual ~AudioMarkerProvider() = default;
|
||||||
|
|
||||||
/// @brief Return markers in a time range
|
/// @brief Return markers in a time range
|
||||||
virtual void GetMarkers(const TimeRange &range, AudioMarkerVector &out) const = 0;
|
virtual void GetMarkers(const TimeRange &range, AudioMarkerVector &out) const = 0;
|
||||||
|
@ -106,11 +106,10 @@ public:
|
||||||
wxString text;
|
wxString text;
|
||||||
/// Range which this label applies to
|
/// Range which this label applies to
|
||||||
TimeRange range;
|
TimeRange range;
|
||||||
AudioLabel(wxString const& text, TimeRange const& range) : text(text), range(range) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Virtual destructor, does nothing
|
/// Virtual destructor, does nothing
|
||||||
virtual ~AudioLabelProvider() { }
|
virtual ~AudioLabelProvider() = default;
|
||||||
|
|
||||||
/// @brief Get labels in a time range
|
/// @brief Get labels in a time range
|
||||||
/// @param range Range of times to get labels for
|
/// @param range Range of times to get labels for
|
||||||
|
@ -177,9 +176,9 @@ public:
|
||||||
class SecondsMarkerProvider final : public AudioMarkerProvider {
|
class SecondsMarkerProvider final : public AudioMarkerProvider {
|
||||||
struct Marker final : public AudioMarker {
|
struct Marker final : public AudioMarker {
|
||||||
Pen *style;
|
Pen *style;
|
||||||
int position;
|
int position = 0;
|
||||||
|
|
||||||
Marker(Pen *style) : style(style), position(0) { }
|
Marker(Pen *style) : style(style) { }
|
||||||
int GetPosition() const override { return position; }
|
int GetPosition() const override { return position; }
|
||||||
FeetStyle GetFeet() const override { return Feet_None; }
|
FeetStyle GetFeet() const override { return Feet_None; }
|
||||||
bool CanSnap() const override { return false; }
|
bool CanSnap() const override { return false; }
|
||||||
|
|
|
@ -115,13 +115,7 @@ public:
|
||||||
struct COMInitialization {
|
struct COMInitialization {
|
||||||
|
|
||||||
/// Flag set if an inited COM library is managed
|
/// Flag set if an inited COM library is managed
|
||||||
bool inited;
|
bool inited = false;
|
||||||
|
|
||||||
/// @brief Constructor, sets inited false
|
|
||||||
COMInitialization()
|
|
||||||
{
|
|
||||||
inited = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Destructor, de-inits COM if it is inited
|
/// @brief Destructor, de-inits COM if it is inited
|
||||||
~COMInitialization()
|
~COMInitialization()
|
||||||
|
|
|
@ -258,7 +258,7 @@ public:
|
||||||
AudioRendererBitmapProvider() : provider(nullptr), pixel_ms(0), amplitude_scale(0) { };
|
AudioRendererBitmapProvider() : provider(nullptr), pixel_ms(0), amplitude_scale(0) { };
|
||||||
|
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
virtual ~AudioRendererBitmapProvider() { }
|
virtual ~AudioRendererBitmapProvider() = default;
|
||||||
|
|
||||||
/// @brief Rendering function
|
/// @brief Rendering function
|
||||||
/// @param bmp Bitmap to render to
|
/// @param bmp Bitmap to render to
|
||||||
|
|
|
@ -173,7 +173,7 @@ public:
|
||||||
virtual void OnMarkerDrag(std::vector<AudioMarker*> const& marker, int new_position, int snap_range) = 0;
|
virtual void OnMarkerDrag(std::vector<AudioMarker*> const& marker, int new_position, int snap_range) = 0;
|
||||||
|
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
virtual ~AudioTimingController() { }
|
virtual ~AudioTimingController() = default;
|
||||||
|
|
||||||
DEFINE_SIGNAL_ADDERS(AnnounceUpdatedPrimaryRange, AddUpdatedPrimaryRangeListener)
|
DEFINE_SIGNAL_ADDERS(AnnounceUpdatedPrimaryRange, AddUpdatedPrimaryRangeListener)
|
||||||
DEFINE_SIGNAL_ADDERS(AnnounceUpdatedStyleRanges, AddUpdatedStyleRangesListener)
|
DEFINE_SIGNAL_ADDERS(AnnounceUpdatedStyleRanges, AddUpdatedStyleRangesListener)
|
||||||
|
|
|
@ -286,7 +286,7 @@ void AudioTimingControllerKaraoke::Revert() {
|
||||||
for (auto it = kara->begin(); it != kara->end(); ++it) {
|
for (auto it = kara->begin(); it != kara->end(); ++it) {
|
||||||
if (it != kara->begin())
|
if (it != kara->begin())
|
||||||
markers.emplace_back(it->start_time, &separator_pen, AudioMarker::Feet_None);
|
markers.emplace_back(it->start_time, &separator_pen, AudioMarker::Feet_None);
|
||||||
labels.emplace_back(to_wx(it->text), TimeRange(it->start_time, it->start_time + it->duration));
|
labels.push_back(AudioLabel{to_wx(it->text), TimeRange(it->start_time, it->start_time + it->duration)});
|
||||||
}
|
}
|
||||||
|
|
||||||
AnnounceUpdatedPrimaryRange();
|
AnnounceUpdatedPrimaryRange();
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace Automation4 {
|
||||||
/// panel
|
/// panel
|
||||||
class ScriptDialog {
|
class ScriptDialog {
|
||||||
public:
|
public:
|
||||||
virtual ~ScriptDialog() { }
|
virtual ~ScriptDialog() = default;
|
||||||
|
|
||||||
/// Create a window with the given parent
|
/// Create a window with the given parent
|
||||||
virtual wxWindow *CreateWindow(wxWindow *parent) = 0;
|
virtual wxWindow *CreateWindow(wxWindow *parent) = 0;
|
||||||
|
@ -155,7 +155,7 @@ namespace Automation4 {
|
||||||
Script(agi::fs::path const& filename);
|
Script(agi::fs::path const& filename);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~Script() { }
|
virtual ~Script() = default;
|
||||||
|
|
||||||
/// Reload this script
|
/// Reload this script
|
||||||
virtual void Reload() = 0;
|
virtual void Reload() = 0;
|
||||||
|
@ -253,7 +253,7 @@ namespace Automation4 {
|
||||||
ScriptFactory(std::string engine_name, std::string filename_pattern);
|
ScriptFactory(std::string engine_name, std::string filename_pattern);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~ScriptFactory() { }
|
virtual ~ScriptFactory() = default;
|
||||||
|
|
||||||
/// Name of this automation engine
|
/// Name of this automation engine
|
||||||
const std::string& GetEngineName() const { return engine_name; }
|
const std::string& GetEngineName() const { return engine_name; }
|
||||||
|
|
|
@ -196,7 +196,7 @@ namespace Automation4 {
|
||||||
LuaDialogControl(lua_State *L);
|
LuaDialogControl(lua_State *L);
|
||||||
|
|
||||||
/// Virtual destructor so this can safely be inherited from
|
/// Virtual destructor so this can safely be inherited from
|
||||||
virtual ~LuaDialogControl() { }
|
virtual ~LuaDialogControl() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A lua-generated dialog or panel in the export options dialog
|
/// A lua-generated dialog or panel in the export options dialog
|
||||||
|
|
|
@ -136,7 +136,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(CommandNotFound, CommandError, "command/notfound
|
||||||
virtual bool IsActive(const agi::Context *c) { return false; }
|
virtual bool IsActive(const agi::Context *c) { return false; }
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~Command() { };
|
virtual ~Command() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Init all builtin commands.
|
/// Init all builtin commands.
|
||||||
|
|
|
@ -114,8 +114,8 @@ void DialogAutosave::Populate(std::map<wxString, AutosaveFile> &files_map, std::
|
||||||
|
|
||||||
auto it = files_map.find(name);
|
auto it = files_map.find(name);
|
||||||
if (it == files_map.end())
|
if (it == files_map.end())
|
||||||
it = files_map.insert(std::make_pair(name, name)).first;
|
it = files_map.insert(std::make_pair(name, AutosaveFile{name})).first;
|
||||||
it->second.versions.emplace_back(wxFileName(directory, fn).GetFullPath(), date, wxString::Format(name_fmt, date.Format()));
|
it->second.versions.push_back(Version{wxFileName(directory, fn).GetFullPath(), date, wxString::Format(name_fmt, date.Format())});
|
||||||
} while (dir.GetNext(&fn));
|
} while (dir.GetNext(&fn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,11 @@ class DialogAutosave final : public wxDialog {
|
||||||
wxString filename;
|
wxString filename;
|
||||||
wxDateTime date;
|
wxDateTime date;
|
||||||
wxString display;
|
wxString display;
|
||||||
Version(wxString const& filename, wxDateTime date, wxString const& display)
|
|
||||||
: filename(filename), date(std::move(date)), display(display) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AutosaveFile {
|
struct AutosaveFile {
|
||||||
wxString name;
|
wxString name;
|
||||||
std::vector<Version> versions;
|
std::vector<Version> versions;
|
||||||
AutosaveFile(wxString const& name) : name(name) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<AutosaveFile> files;
|
std::vector<AutosaveFile> files;
|
||||||
|
|
|
@ -73,8 +73,7 @@ class KaraokeLineMatchDisplay final : public wxControl {
|
||||||
struct MatchGroup {
|
struct MatchGroup {
|
||||||
std::vector<MatchSyllable> src;
|
std::vector<MatchSyllable> src;
|
||||||
std::string dst;
|
std::string dst;
|
||||||
int last_render_width;
|
int last_render_width = 0;
|
||||||
MatchGroup() : last_render_width(0) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<MatchGroup> matched_groups;
|
std::vector<MatchGroup> matched_groups;
|
||||||
|
|
|
@ -86,9 +86,6 @@ struct AegisubUpdateDescription {
|
||||||
std::string url;
|
std::string url;
|
||||||
std::string friendly_name;
|
std::string friendly_name;
|
||||||
std::string description;
|
std::string description;
|
||||||
|
|
||||||
AegisubUpdateDescription(std::string url, std::string friendly_name, std::string description)
|
|
||||||
: url(std::move(url)), friendly_name(std::move(friendly_name)), description(std::move(description)) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class VersionCheckerResultDialog final : public wxDialog {
|
class VersionCheckerResultDialog final : public wxDialog {
|
||||||
|
@ -340,16 +337,15 @@ void DoCheck(bool interactive) {
|
||||||
boost::split(parsed, line, boost::is_any_of("|"));
|
boost::split(parsed, line, boost::is_any_of("|"));
|
||||||
if (parsed.size() != 6) continue;
|
if (parsed.size() != 6) continue;
|
||||||
|
|
||||||
// 0 and 2 being things that never got used
|
if (atoi(parsed[1].c_str()) <= GetSVNRevision())
|
||||||
std::string revision = parsed[1];
|
|
||||||
std::string url = inline_string_decode(parsed[3]);
|
|
||||||
std::string friendlyname = inline_string_decode(parsed[4]);
|
|
||||||
std::string description = inline_string_decode(parsed[5]);
|
|
||||||
|
|
||||||
if (atoi(revision.c_str()) <= GetSVNRevision())
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
results.emplace_back(url, friendlyname, description);
|
// 0 and 2 being things that never got used
|
||||||
|
results.push_back(AegisubUpdateDescription{
|
||||||
|
inline_string_decode(parsed[3]),
|
||||||
|
inline_string_decode(parsed[4]),
|
||||||
|
inline_string_decode(parsed[5])
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!results.empty() || interactive) {
|
if (!results.empty() || interactive) {
|
||||||
|
|
|
@ -56,22 +56,17 @@ namespace {
|
||||||
/// @brief Struct storing the information needed to draw a glyph
|
/// @brief Struct storing the information needed to draw a glyph
|
||||||
struct OpenGLTextGlyph {
|
struct OpenGLTextGlyph {
|
||||||
wxString str; ///< String containing the glyph(s) this is for
|
wxString str; ///< String containing the glyph(s) this is for
|
||||||
int tex; ///< OpenGL texture to draw for this glyph
|
int tex = 0; ///< OpenGL texture to draw for this glyph
|
||||||
float x1; ///< Left x coordinate of this glyph in the containing texture
|
float x1 = 0; ///< Left x coordinate of this glyph in the containing texture
|
||||||
float x2; ///< Right x coordinate of this glyph in the containing texture
|
float x2 = 0; ///< Right x coordinate of this glyph in the containing texture
|
||||||
float y1; ///< Left y coordinate of this glyph in the containing texture
|
float y1 = 0; ///< Left y coordinate of this glyph in the containing texture
|
||||||
float y2; ///< Right y coordinate of this glyph in the containing texture
|
float y2 = 0; ///< Right y coordinate of this glyph in the containing texture
|
||||||
int w; ///< Width of the glyph in pixels
|
int w = 0; ///< Width of the glyph in pixels
|
||||||
int h; ///< Height of the glyph in pixels
|
int h = 0; ///< Height of the glyph in pixels
|
||||||
wxFont font; ///< Font used for this glyph
|
wxFont font; ///< Font used for this glyph
|
||||||
|
|
||||||
OpenGLTextGlyph(int value, wxFont const& font)
|
OpenGLTextGlyph(int value, wxFont const& font)
|
||||||
: str(wxChar(value))
|
: str(wxChar(value))
|
||||||
, tex(0)
|
|
||||||
, x1(0)
|
|
||||||
, x2(0)
|
|
||||||
, y1(0)
|
|
||||||
, y2(0)
|
|
||||||
, font(font)
|
, font(font)
|
||||||
{
|
{
|
||||||
wxCoord desc,lead;
|
wxCoord desc,lead;
|
||||||
|
@ -113,13 +108,13 @@ struct OpenGLTextGlyph {
|
||||||
/// @class OpenGLTextTexture
|
/// @class OpenGLTextTexture
|
||||||
/// @brief OpenGL texture which stores one or more glyphs as sprites
|
/// @brief OpenGL texture which stores one or more glyphs as sprites
|
||||||
class OpenGLTextTexture final : boost::noncopyable {
|
class OpenGLTextTexture final : boost::noncopyable {
|
||||||
int x; ///< Next x coordinate at which a glyph can be inserted
|
int x = 0; ///< Next x coordinate at which a glyph can be inserted
|
||||||
int y; ///< Next y coordinate at which a glyph can be inserted
|
int y = 0; ///< Next y coordinate at which a glyph can be inserted
|
||||||
int nextY; ///< Y coordinate of the next line; tracked due to that lines
|
int nextY = 0; ///< Y coordinate of the next line; tracked due to that lines
|
||||||
///< are only as tall as needed to fit the glyphs in them
|
///< are only as tall as needed to fit the glyphs in them
|
||||||
int width; ///< Width of the texture
|
int width; ///< Width of the texture
|
||||||
int height; ///< Height of the texture
|
int height; ///< Height of the texture
|
||||||
GLuint tex; ///< The texture
|
GLuint tex = 0; ///< The texture
|
||||||
|
|
||||||
/// Insert the glyph into this texture at the current coordinates
|
/// Insert the glyph into this texture at the current coordinates
|
||||||
void Insert(OpenGLTextGlyph &glyph) {
|
void Insert(OpenGLTextGlyph &glyph) {
|
||||||
|
@ -161,12 +156,8 @@ class OpenGLTextTexture final : boost::noncopyable {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OpenGLTextTexture(OpenGLTextGlyph &glyph)
|
OpenGLTextTexture(OpenGLTextGlyph &glyph)
|
||||||
: x(0)
|
: width(std::max(SmallestPowerOf2(glyph.w), 64))
|
||||||
, y(0)
|
|
||||||
, nextY(0)
|
|
||||||
, width(std::max(SmallestPowerOf2(glyph.w), 64))
|
|
||||||
, height(std::max(SmallestPowerOf2(glyph.h), 64))
|
, height(std::max(SmallestPowerOf2(glyph.h), 64))
|
||||||
, tex(0)
|
|
||||||
{
|
{
|
||||||
width = height = std::max(width, height);
|
width = height = std::max(width, height);
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ using namespace agi::hotkey;
|
||||||
/// @class HotkeyModelItem
|
/// @class HotkeyModelItem
|
||||||
/// @brief A base class for things exposed by HotkeyDataViewModel
|
/// @brief A base class for things exposed by HotkeyDataViewModel
|
||||||
class HotkeyModelItem {
|
class HotkeyModelItem {
|
||||||
protected:
|
protected:
|
||||||
~HotkeyModelItem() { }
|
~HotkeyModelItem() = default;
|
||||||
public:
|
public:
|
||||||
virtual unsigned int GetChildren(wxDataViewItemArray &children) const=0;
|
virtual unsigned int GetChildren(wxDataViewItemArray &children) const=0;
|
||||||
virtual wxDataViewItem GetParent() const=0;
|
virtual wxDataViewItem GetParent() const=0;
|
||||||
|
|
|
@ -48,7 +48,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AudioPlayer(AudioProvider *provider);
|
AudioPlayer(AudioProvider *provider);
|
||||||
virtual ~AudioPlayer() { }
|
virtual ~AudioPlayer() = default;
|
||||||
|
|
||||||
virtual void Play(int64_t start,int64_t count)=0; // Play sample range
|
virtual void Play(int64_t start,int64_t count)=0; // Play sample range
|
||||||
virtual void Stop()=0; // Stop playing
|
virtual void Stop()=0; // Stop playing
|
||||||
|
|
|
@ -57,7 +57,7 @@ protected:
|
||||||
void ZeroFill(void *buf, int64_t count) const;
|
void ZeroFill(void *buf, int64_t count) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~AudioProvider() { }
|
virtual ~AudioProvider() = default;
|
||||||
|
|
||||||
void GetAudio(void *buf, int64_t start, int64_t count) const;
|
void GetAudio(void *buf, int64_t start, int64_t count) const;
|
||||||
void GetAudioWithVolume(void *buf, int64_t start, int64_t count, double volume) const;
|
void GetAudioWithVolume(void *buf, int64_t start, int64_t count, double volume) const;
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct VideoFrame;
|
||||||
|
|
||||||
class SubtitlesProvider {
|
class SubtitlesProvider {
|
||||||
public:
|
public:
|
||||||
virtual ~SubtitlesProvider() { }
|
virtual ~SubtitlesProvider() = default;
|
||||||
virtual void LoadSubtitles(AssFile *subs)=0;
|
virtual void LoadSubtitles(AssFile *subs)=0;
|
||||||
virtual void DrawSubtitles(VideoFrame &dst, double time)=0;
|
virtual void DrawSubtitles(VideoFrame &dst, double time)=0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -331,12 +331,11 @@ public:
|
||||||
|
|
||||||
class HotkeyRenderer final : public wxDataViewCustomRenderer {
|
class HotkeyRenderer final : public wxDataViewCustomRenderer {
|
||||||
wxString value;
|
wxString value;
|
||||||
wxTextCtrl *ctrl;
|
wxTextCtrl *ctrl = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HotkeyRenderer()
|
HotkeyRenderer()
|
||||||
: wxDataViewCustomRenderer("string", wxDATAVIEW_CELL_EDITABLE)
|
: wxDataViewCustomRenderer("string", wxDATAVIEW_CELL_EDITABLE)
|
||||||
, ctrl(nullptr)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
wxWindow *CreateEditorCtrl(wxWindow *parent, wxRect label_rect, wxVariant const& var) override {
|
wxWindow *CreateEditorCtrl(wxWindow *parent, wxRect label_rect, wxVariant const& var) override {
|
||||||
|
|
|
@ -260,7 +260,6 @@ struct disabler {
|
||||||
wxControl *ctrl;
|
wxControl *ctrl;
|
||||||
bool enable;
|
bool enable;
|
||||||
|
|
||||||
disabler(wxControl *ctrl, bool enable) : ctrl(ctrl), enable(enable) { }
|
|
||||||
void operator()(wxCommandEvent &evt) {
|
void operator()(wxCommandEvent &evt) {
|
||||||
ctrl->Enable(!!evt.GetInt() == enable);
|
ctrl->Enable(!!evt.GetInt() == enable);
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
|
@ -272,7 +271,7 @@ void OptionPage::EnableIfChecked(wxControl *cbx, wxControl *ctrl) {
|
||||||
if (!cb) return;
|
if (!cb) return;
|
||||||
|
|
||||||
ctrl->Enable(cb->IsChecked());
|
ctrl->Enable(cb->IsChecked());
|
||||||
cb->Bind(wxEVT_CHECKBOX, disabler(ctrl, true));
|
cb->Bind(wxEVT_CHECKBOX, disabler{ctrl, true});
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
|
void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
|
||||||
|
@ -280,5 +279,5 @@ void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
|
||||||
if (!cb) return;
|
if (!cb) return;
|
||||||
|
|
||||||
ctrl->Enable(!cb->IsChecked());
|
ctrl->Enable(!cb->IsChecked());
|
||||||
cb->Bind(wxEVT_CHECKBOX, disabler(ctrl, false));
|
cb->Bind(wxEVT_CHECKBOX, disabler{ctrl, false});
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,10 +53,10 @@ typedef std::function<MatchState (const AssDialogue*, size_t)> matcher;
|
||||||
|
|
||||||
class noop_accessor {
|
class noop_accessor {
|
||||||
boost::flyweight<std::string> AssDialogueBase::*field;
|
boost::flyweight<std::string> AssDialogueBase::*field;
|
||||||
size_t start;
|
size_t start = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
noop_accessor(SearchReplaceSettings::Field f) : field(get_dialogue_field(f)), start(0) { }
|
noop_accessor(SearchReplaceSettings::Field f) : field(get_dialogue_field(f)) { }
|
||||||
|
|
||||||
std::string get(const AssDialogue *d, size_t s) {
|
std::string get(const AssDialogue *d, size_t s) {
|
||||||
start = s;
|
start = s;
|
||||||
|
@ -64,14 +64,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
MatchState make_match_state(size_t s, size_t e, boost::u32regex *r = nullptr) {
|
MatchState make_match_state(size_t s, size_t e, boost::u32regex *r = nullptr) {
|
||||||
return MatchState(s + start, e + start, r);
|
return {r, s + start, e + start};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class skip_tags_accessor {
|
class skip_tags_accessor {
|
||||||
boost::flyweight<std::string> AssDialogueBase::*field;
|
boost::flyweight<std::string> AssDialogueBase::*field;
|
||||||
std::vector<std::pair<size_t, size_t>> blocks;
|
std::vector<std::pair<size_t, size_t>> blocks;
|
||||||
size_t start;
|
size_t start = 0;
|
||||||
|
|
||||||
void parse_str(std::string const& str) {
|
void parse_str(std::string const& str) {
|
||||||
blocks.clear();
|
blocks.clear();
|
||||||
|
@ -90,7 +90,7 @@ class skip_tags_accessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
skip_tags_accessor(SearchReplaceSettings::Field f) : field(get_dialogue_field(f)), start(0) { }
|
skip_tags_accessor(SearchReplaceSettings::Field f) : field(get_dialogue_field(f)) { }
|
||||||
|
|
||||||
std::string get(const AssDialogue *d, size_t s) {
|
std::string get(const AssDialogue *d, size_t s) {
|
||||||
auto const& str = get_normalized(d, field);
|
auto const& str = get_normalized(d, field);
|
||||||
|
@ -140,7 +140,7 @@ public:
|
||||||
// Note that blocks cannot be partially within the match
|
// Note that blocks cannot be partially within the match
|
||||||
e += block.second - block.first + 1;
|
e += block.second - block.first + 1;
|
||||||
}
|
}
|
||||||
return MatchState(s, e, r);
|
return {r, s, e};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ matcher get_matcher(SearchReplaceSettings const& settings, Accessor&& a) {
|
||||||
boost::smatch result;
|
boost::smatch result;
|
||||||
auto const& str = a.get(diag, start);
|
auto const& str = a.get(diag, start);
|
||||||
if (!u32regex_search(str, result, regex, start > 0 ? boost::match_not_bol : boost::match_default))
|
if (!u32regex_search(str, result, regex, start > 0 ? boost::match_not_bol : boost::match_default))
|
||||||
return MatchState();
|
return {nullptr, 0, -1};
|
||||||
return a.make_match_state(result.position(), result.position() + result.length(), ®ex);
|
return a.make_match_state(result.position(), result.position() + result.length(), ®ex);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -169,18 +169,19 @@ matcher get_matcher(SearchReplaceSettings const& settings, Accessor&& a) {
|
||||||
if (!settings.match_case)
|
if (!settings.match_case)
|
||||||
look_for = boost::locale::fold_case(look_for);
|
look_for = boost::locale::fold_case(look_for);
|
||||||
|
|
||||||
|
MatchState invalid{nullptr, 0, -1};
|
||||||
return [=](const AssDialogue *diag, size_t start) mutable -> MatchState {
|
return [=](const AssDialogue *diag, size_t start) mutable -> MatchState {
|
||||||
const auto str = a.get(diag, start);
|
const auto str = a.get(diag, start);
|
||||||
if (full_match_only && str.size() != look_for.size())
|
if (full_match_only && str.size() != look_for.size())
|
||||||
return MatchState();
|
return invalid;
|
||||||
|
|
||||||
if (match_case) {
|
if (match_case) {
|
||||||
const auto pos = str.find(look_for);
|
const auto pos = str.find(look_for);
|
||||||
return pos == std::string::npos ? MatchState() : a.make_match_state(pos, pos + look_for.size());
|
return pos == std::string::npos ? invalid : a.make_match_state(pos, pos + look_for.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto pos = agi::util::ifind(str, look_for);
|
const auto pos = agi::util::ifind(str, look_for);
|
||||||
return pos.first == bad_pos ? MatchState() : a.make_match_state(pos.first, pos.second);
|
return pos.first == bad_pos ? invalid : a.make_match_state(pos.first, pos.second);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ struct MatchState {
|
||||||
boost::u32regex *re;
|
boost::u32regex *re;
|
||||||
size_t start, end;
|
size_t start, end;
|
||||||
|
|
||||||
MatchState() : re(nullptr), start(0), end(-1) { }
|
|
||||||
MatchState(size_t s, size_t e, boost::u32regex *re) : re(re), start(s), end(e) { }
|
|
||||||
operator bool() const { return end != (size_t)-1; }
|
operator bool() const { return end != (size_t)-1; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,6 @@ SubtitleFormat::SubtitleFormat(std::string name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
SubtitleFormat::~SubtitleFormat() { }
|
|
||||||
|
|
||||||
bool SubtitleFormat::CanReadFile(agi::fs::path const& filename, std::string const&) const {
|
bool SubtitleFormat::CanReadFile(agi::fs::path const& filename, std::string const&) const {
|
||||||
auto wildcards = GetReadWildcards();
|
auto wildcards = GetReadWildcards();
|
||||||
return any_of(begin(wildcards), end(wildcards),
|
return any_of(begin(wildcards), end(wildcards),
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
/// @param Subtitle format name
|
/// @param Subtitle format name
|
||||||
SubtitleFormat(std::string name);
|
SubtitleFormat(std::string name);
|
||||||
/// Destructor
|
/// Destructor
|
||||||
virtual ~SubtitleFormat();
|
virtual ~SubtitleFormat() = default;
|
||||||
|
|
||||||
/// Get this format's name
|
/// Get this format's name
|
||||||
std::string const& GetName() const { return name; }
|
std::string const& GetName() const { return name; }
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#include <libaegisub/hotkey.h>
|
#include <libaegisub/hotkey.h>
|
||||||
|
|
||||||
|
#include <list>
|
||||||
#include <wx/weakref.h>
|
#include <wx/weakref.h>
|
||||||
#include <wx/window.h>
|
#include <wx/window.h>
|
||||||
|
|
||||||
|
@ -48,36 +49,15 @@ struct ToolTipBinding {
|
||||||
const char *command;
|
const char *command;
|
||||||
const char *context;
|
const char *context;
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
ToolTipBinding(wxWindow *window, wxString toolTip, const char *command, const char *context)
|
|
||||||
: window(window)
|
|
||||||
, toolTip(toolTip)
|
|
||||||
, command(command)
|
|
||||||
, context(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// clang doesn't like wxWeakRef's copy constructor, so use the assignment
|
|
||||||
// operator instead
|
|
||||||
ToolTipBinding(ToolTipBinding const& other)
|
|
||||||
: toolTip(other.toolTip)
|
|
||||||
, command(other.command)
|
|
||||||
, context(other.context)
|
|
||||||
{
|
|
||||||
window = other.window;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ToolTipManager::ToolTipManager() { }
|
|
||||||
ToolTipManager::~ToolTipManager() { }
|
|
||||||
|
|
||||||
void ToolTipManager::Bind(wxWindow *window, wxString tooltip, const char *context, const char *command) {
|
void ToolTipManager::Bind(wxWindow *window, wxString tooltip, const char *context, const char *command) {
|
||||||
ToolTipBinding tip(window, tooltip, command, context);
|
ToolTipBinding tip{window, tooltip, command, context};
|
||||||
tip.Update();
|
tip.Update();
|
||||||
|
|
||||||
static ToolTipManager instance;
|
static std::list<ToolTipBinding> tips;
|
||||||
instance.tips.push_back(tip);
|
tips.push_back(tip);
|
||||||
hotkey::inst->AddHotkeyChangeListener(&ToolTipBinding::Update, &instance.tips.back());
|
hotkey::inst->AddHotkeyChangeListener(&ToolTipBinding::Update, &tips.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolTipBinding::Update() {
|
void ToolTipBinding::Update() {
|
||||||
|
|
|
@ -27,26 +27,10 @@
|
||||||
//
|
//
|
||||||
// Aegisub Project http://www.aegisub.org/
|
// Aegisub Project http://www.aegisub.org/
|
||||||
|
|
||||||
/// @file tooltip_manager.h
|
|
||||||
/// @see tooltip_manager.cpp
|
|
||||||
/// @ingroup custom_control
|
|
||||||
///
|
|
||||||
|
|
||||||
#include <boost/container/list.hpp>
|
|
||||||
|
|
||||||
struct ToolTipBinding;
|
|
||||||
|
|
||||||
class wxString;
|
class wxString;
|
||||||
class wxWindow;
|
class wxWindow;
|
||||||
|
|
||||||
class ToolTipManager {
|
class ToolTipManager {
|
||||||
ToolTipManager();
|
|
||||||
~ToolTipManager();
|
|
||||||
ToolTipManager(ToolTipManager const&);
|
|
||||||
ToolTipManager& operator=(ToolTipManager const&);
|
|
||||||
|
|
||||||
boost::container::list<ToolTipBinding> tips;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void Bind(wxWindow *window, wxString tooltip, const char *context, const char *command);
|
static void Bind(wxWindow *window, wxString tooltip, const char *context, const char *command);
|
||||||
};
|
};
|
||||||
|
|
|
@ -142,7 +142,7 @@ public:
|
||||||
virtual void Draw()=0;
|
virtual void Draw()=0;
|
||||||
virtual void SetDisplayArea(int x, int y, int w, int h);
|
virtual void SetDisplayArea(int x, int y, int w, int h);
|
||||||
virtual void SetToolbar(wxToolBar *) { }
|
virtual void SetToolbar(wxToolBar *) { }
|
||||||
virtual ~VisualToolBase() { }
|
virtual ~VisualToolBase() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Visual tool base class containing all common feature-related functionality
|
/// Visual tool base class containing all common feature-related functionality
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
|
|
||||||
/// VisualDraggableFeature with siblings
|
/// VisualDraggableFeature with siblings
|
||||||
struct ClipCorner final : public VisualDraggableFeature {
|
struct ClipCorner final : public VisualDraggableFeature {
|
||||||
ClipCorner *horiz; ///< Other corner on this corner's horizontal line
|
ClipCorner *horiz = nullptr; ///< Other corner on this corner's horizontal line
|
||||||
ClipCorner *vert; ///< Other corner on this corner's vertical line
|
ClipCorner *vert = nullptr; ///< Other corner on this corner's vertical line
|
||||||
ClipCorner() : VisualDraggableFeature() , horiz(nullptr) , vert(nullptr) { type = DRAG_SMALL_CIRCLE; }
|
ClipCorner() { type = DRAG_SMALL_CIRCLE; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class VisualToolClip final : public VisualTool<ClipCorner> {
|
class VisualToolClip final : public VisualTool<ClipCorner> {
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
/// @brief VisualDraggableFeature with a time value
|
/// @brief VisualDraggableFeature with a time value
|
||||||
class VisualToolDragDraggableFeature final : public VisualDraggableFeature {
|
class VisualToolDragDraggableFeature final : public VisualDraggableFeature {
|
||||||
public:
|
public:
|
||||||
int time;
|
int time = 0;
|
||||||
VisualToolDragDraggableFeature *parent;
|
VisualToolDragDraggableFeature *parent = nullptr;
|
||||||
VisualToolDragDraggableFeature() : VisualDraggableFeature(), time(0), parent(nullptr) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxBitmapButton;
|
class wxBitmapButton;
|
||||||
|
|
|
@ -32,12 +32,7 @@ struct VisualToolVectorClipDraggableFeature final : public VisualDraggableFeatur
|
||||||
/// Which curve in the spline this feature is a point on
|
/// Which curve in the spline this feature is a point on
|
||||||
Spline::iterator curve;
|
Spline::iterator curve;
|
||||||
/// 0-3; indicates which part of the curve this point is
|
/// 0-3; indicates which part of the curve this point is
|
||||||
int point;
|
int point = 0;
|
||||||
/// @brief Constructor
|
|
||||||
VisualToolVectorClipDraggableFeature()
|
|
||||||
: VisualDraggableFeature()
|
|
||||||
, point(0)
|
|
||||||
{ }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class VisualToolVectorClip final : public VisualTool<VisualToolVectorClipDraggableFeature> {
|
class VisualToolVectorClip final : public VisualTool<VisualToolVectorClipDraggableFeature> {
|
||||||
|
|
Loading…
Reference in a new issue