diff --git a/aegisub/libaegisub/common/hotkey.cpp b/aegisub/libaegisub/common/hotkey.cpp index a40efe78389349c8f1d79151994327ae9e7d128f..e259d51dfb1409ca806002965351a53e63970365 100644 --- a/aegisub/libaegisub/common/hotkey.cpp +++ b/aegisub/libaegisub/common/hotkey.cpp @@ -22,12 +22,7 @@ #include <algorithm> #include <cmath> #include <memory> -#endif - -#ifdef _WIN32 #include <tuple> -#else -#include <tr1/tuple> #endif #include "libaegisub/hotkey.h" @@ -98,7 +93,7 @@ std::string Hotkey::Scan(const std::string &context, const std::string &str, boo std::string local, dfault; HotkeyMap::const_iterator index, end; - for (std::tr1::tie(index, end) = str_map.equal_range(str); index != end; ++index) { + for (std::tie(index, end) = str_map.equal_range(str); index != end; ++index) { std::string const& ctext = index->second.Context(); if (always && ctext == "Always") { @@ -127,7 +122,7 @@ std::vector<std::string> Hotkey::GetHotkeys(const std::string &context, const st std::vector<std::string> ret; HotkeyMap::const_iterator it, end; - for (std::tr1::tie(it, end) = cmd_map.equal_range(command); it != end; ++it) { + for (std::tie(it, end) = cmd_map.equal_range(command); it != end; ++it) { std::string ctext = it->second.Context(); if (ctext == "Always" || ctext == "Default" || ctext == context) ret.push_back(it->second.StrMenu()); @@ -142,7 +137,7 @@ std::vector<std::string> Hotkey::GetHotkeys(const std::string &context, const st std::string Hotkey::GetHotkey(const std::string &context, const std::string &command) const { std::string ret; HotkeyMap::const_iterator it, end; - for (std::tr1::tie(it, end) = cmd_map.equal_range(command); it != end; ++it) { + for (std::tie(it, end) = cmd_map.equal_range(command); it != end; ++it) { std::string ctext = it->second.Context(); if (ctext == context) return it->second.StrMenu(); if (ctext == "Default") diff --git a/aegisub/libaegisub/include/libaegisub/background_runner.h b/aegisub/libaegisub/include/libaegisub/background_runner.h index 2f009aca80f4eb78c0c2474587de3b3551ab767a..69e942fa5ffffd001db1033c1fb7364bea59cdc0 100644 --- a/aegisub/libaegisub/include/libaegisub/background_runner.h +++ b/aegisub/libaegisub/include/libaegisub/background_runner.h @@ -19,14 +19,9 @@ #pragma once #ifndef LAGI_PRE -#include <stdint.h> -#include <string> - -#ifdef _WIN32 +#include <cstdint> #include <functional> -#else -#include <tr1/functional> -#endif +#include <string> #endif namespace agi { @@ -82,6 +77,6 @@ namespace agi { /// Progress updates sent to the progress sink passed to the task should /// be displayed to the user in some way, along with some way for the /// user to cancel the task. - virtual void Run(std::tr1::function<void(ProgressSink *)> task, int priority=-1)=0; + virtual void Run(std::function<void(ProgressSink *)> task, int priority=-1)=0; }; } diff --git a/aegisub/libaegisub/include/libaegisub/exception.h b/aegisub/libaegisub/include/libaegisub/exception.h index 9d8e07efe172fa7616f45029ffa782b6e8f29673..cd4f34693c96c3cd907caabe73c222a4709f0dde 100644 --- a/aegisub/libaegisub/include/libaegisub/exception.h +++ b/aegisub/libaegisub/include/libaegisub/exception.h @@ -34,12 +34,8 @@ #pragma once -#include <string> -#ifdef _WIN32 #include <memory> -#else -#include <tr1/memory> -#endif +#include <string> /// @see aegisub.h namespace agi { @@ -99,7 +95,7 @@ namespace agi { std::string message; /// An inner exception, the cause of this exception - std::tr1::shared_ptr<Exception> inner; + std::shared_ptr<Exception> inner; protected: diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index 44fe62f967271c772821572a3e622cc78c6db950..eceaaa2eb153f77fffbb7628172db08a0f2bd470 100644 --- a/aegisub/libaegisub/include/libaegisub/line_iterator.h +++ b/aegisub/libaegisub/include/libaegisub/line_iterator.h @@ -20,11 +20,7 @@ #ifndef LAGI_PRE #include <iterator> -#ifdef _WIN32 #include <memory> -#else -#include <tr1/memory> -#endif #include <sstream> #include <stdint.h> @@ -42,7 +38,7 @@ class line_iterator : public std::iterator<std::input_iterator_tag, OutputType> bool valid; ///< Are there any more values to read? OutputType value; ///< Value to return when this is dereference std::string encoding; ///< Encoding of source stream - std::tr1::shared_ptr<agi::charset::IconvWrapper> conv; + std::shared_ptr<agi::charset::IconvWrapper> conv; int cr; ///< CR character in the source encoding int lf; ///< LF character in the source encoding size_t width; ///< width of LF character in the source encoding diff --git a/aegisub/libaegisub/include/libaegisub/signal.h b/aegisub/libaegisub/include/libaegisub/signal.h index fe95a789864d51c099cb5b77f20aae7f9217bd8a..88aa20e96316e0d546895f613a77b8b68d1139ac 100644 --- a/aegisub/libaegisub/include/libaegisub/signal.h +++ b/aegisub/libaegisub/include/libaegisub/signal.h @@ -21,19 +21,14 @@ #ifndef LAGI_PRE #include <boost/container/map.hpp> -#ifdef _WIN32 #include <functional> #include <memory> -#else -#include <tr1/functional> -#include <tr1/memory> -#endif #endif namespace agi { namespace signal { -using namespace std::tr1::placeholders; +using namespace std::placeholders; class Connection; @@ -59,7 +54,7 @@ namespace detail { /// @class Connection /// @brief Object representing a connection to a signal class Connection { - std::tr1::shared_ptr<detail::ConnectionToken> token; + std::shared_ptr<detail::ConnectionToken> token; public: Connection() { } Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; } @@ -167,15 +162,15 @@ namespace detail { } template<class F, class Arg1> UnscopedConnection Connect(F func, Arg1 a1) { - return Connect(std::tr1::bind(func, a1)); + return Connect(std::bind(func, a1)); } template<class F, class Arg1, class Arg2> UnscopedConnection Connect(F func, Arg1 a1, Arg2 a2) { - return Connect(std::tr1::bind(func, a1, a2)); + return Connect(std::bind(func, a1, a2)); } template<class F, class Arg1, class Arg2, class Arg3> UnscopedConnection Connect(F func, Arg1 a1, Arg2 a2, Arg3 a3) { - return Connect(std::tr1::bind(func, a1, a2, a3)); + return Connect(std::bind(func, a1, a2, a3)); } }; } @@ -193,8 +188,8 @@ 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::tr1::function<void (Arg1, Arg2)> > { - typedef detail::SignalBaseImpl<std::tr1::function<void (Arg1, Arg2)> > super; +class Signal : public detail::SignalBaseImpl<std::function<void (Arg1, Arg2)> > { + typedef detail::SignalBaseImpl<std::function<void (Arg1, Arg2)> > super; using super::Blocked; using super::slots; public: @@ -220,7 +215,7 @@ public: /// sig.Connect(&Class::Foo, this, _1, _2) template<class T> UnscopedConnection Connect(void (T::*func)(Arg1, Arg2), T* a1) { - return Connect(std::tr1::bind(func, a1, _1, _2)); + return Connect(std::bind(func, a1, _1, _2)); } }; @@ -228,8 +223,8 @@ public: /// @brief One-argument signal /// @param Arg1 Type of the argument to pass to slots template<class Arg1> -class Signal<Arg1, void> : public detail::SignalBaseImpl<std::tr1::function<void (Arg1)> > { - typedef detail::SignalBaseImpl<std::tr1::function<void (Arg1)> > super; +class Signal<Arg1, void> : public detail::SignalBaseImpl<std::function<void (Arg1)> > { + typedef detail::SignalBaseImpl<std::function<void (Arg1)> > super; using super::Blocked; using super::slots; public: @@ -253,15 +248,15 @@ public: /// sig.Connect(&Class::Foo, this) rather than sig.Connect(&Class::Foo, this, _1) template<class T> UnscopedConnection Connect(void (T::*func)(Arg1), T* a1) { - return Connect(std::tr1::bind(func, a1, _1)); + return Connect(std::bind(func, a1, _1)); } }; /// @class Signal /// @brief Zero-argument signal template<> -class Signal<void> : public detail::SignalBaseImpl<std::tr1::function<void ()> > { - typedef detail::SignalBaseImpl<std::tr1::function<void ()> > super; +class Signal<void> : public detail::SignalBaseImpl<std::function<void ()> > { + typedef detail::SignalBaseImpl<std::function<void ()> > super; using super::Blocked; using super::slots; public: diff --git a/aegisub/libaegisub/lagi_pre.h b/aegisub/libaegisub/lagi_pre.h index bba770bac2afa2e4b9c8f0c1034cffe7a47433cd..4e8d4808065b5e9864391c72532c261ee87ecb73 100644 --- a/aegisub/libaegisub/lagi_pre.h +++ b/aegisub/libaegisub/lagi_pre.h @@ -33,26 +33,22 @@ #include <algorithm> #include <deque> #include <fstream> +#include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <locale> #include <map> +#include <memory> #include <numeric> #include <set> #include <sstream> #include <stdexcept> #include <string> +#include <tuple> #include <vector> -#ifdef _WIN32 -#include <functional> -#include <memory> -#else -#include <tr1/functional> -#include <tr1/memory> -#endif // Boost #include <boost/container/list.hpp> diff --git a/aegisub/src/agi_pre.h b/aegisub/src/agi_pre.h index 821c83de118d23c314dfbb21b91b9d1675f7d6e7..2ae26a4f5d499147fef3c9045b9096ae153d1a0a 100644 --- a/aegisub/src/agi_pre.h +++ b/aegisub/src/agi_pre.h @@ -53,12 +53,7 @@ #define AGI_PRE // General headers -#ifdef _WIN32 #include <array> -#else -#include <tr1/array> -#endif - #include <clocale> #include <cstdlib> #include <cctype> diff --git a/aegisub/src/ass_attachment.h b/aegisub/src/ass_attachment.h index a79a0fd08f97858d816a4173b1f01e08715fb4e8..17168f4eaf00514bce93f6dd95f13333e6c007f1 100644 --- a/aegisub/src/ass_attachment.h +++ b/aegisub/src/ass_attachment.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include <tr1/memory> +#include <memory> #include <vector> #endif @@ -43,7 +43,7 @@ /// @brief DOCME class AssAttachment : public AssEntry { /// Decoded file data - std::tr1::shared_ptr<std::vector<char> > data; + std::shared_ptr<std::vector<char> > data; /// Encoded data which has been read from the script but not yet decoded wxString buffer; diff --git a/aegisub/src/ass_style.h b/aegisub/src/ass_style.h index 29490c46d88de172b42f8a924c874129049d7f4a..e7dea9ae9df22145b4ef77eec522fec7c1a17c40 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include <tr1/array> +#include <array> #include <wx/colour.h> #endif @@ -66,7 +66,7 @@ public: double outline_w; ///< Outline width in pixels double shadow_w; ///< Shadow distance in pixels int alignment; ///< \an-style line alignment - std::tr1::array<int, 3> Margin; ///< Left/Right/Vertical + std::array<int, 3> Margin; ///< Left/Right/Vertical int encoding; ///< ASS font encoding needed for some non-unicode fonts /// Update the raw line data after one or more of the public members have been changed diff --git a/aegisub/src/ass_style_storage.cpp b/aegisub/src/ass_style_storage.cpp index fe5d15e65059dd294f0c7f3ff673b803b6aa49ef..249ea7098c72346a7c987318c579ee8639d7dee7 100644 --- a/aegisub/src/ass_style_storage.cpp +++ b/aegisub/src/ass_style_storage.cpp @@ -37,7 +37,7 @@ #include "ass_style_storage.h" #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #endif #include "ass_style.h" diff --git a/aegisub/src/audio_karaoke.cpp b/aegisub/src/audio_karaoke.cpp index 325449a66ab466cba7f591c99476cdbac519e8db..91724dde2b66a7c9bffe7ff2b01fc04c580228a1 100644 --- a/aegisub/src/audio_karaoke.cpp +++ b/aegisub/src/audio_karaoke.cpp @@ -74,7 +74,7 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c) , click_will_remove_split(false) , enabled(false) { - using std::tr1::bind; + using std::bind; cancel_button = new wxBitmapButton(this, -1, GETIMAGE(kara_split_cancel_16)); cancel_button->SetToolTip(_("Discard all uncommitted splits")); @@ -241,7 +241,7 @@ void AudioKaraoke::RenderText() { void AudioKaraoke::AddMenuItem(wxMenu &menu, wxString const& tag, wxString const& help, wxString const& selected) { wxMenuItem *item = menu.AppendCheckItem(-1, tag, help); - menu.Bind(wxEVT_COMMAND_MENU_SELECTED, std::tr1::bind(&AudioKaraoke::SetTagType, this, tag), item->GetId()); + menu.Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&AudioKaraoke::SetTagType, this, tag), item->GetId()); item->Check(tag == selected); } diff --git a/aegisub/src/audio_provider_hd.cpp b/aegisub/src/audio_provider_hd.cpp index 9b0279ea858ae28b1c58fdcbcca97062a74768e4..f1ad633a28ee9bf966c8db74ba3c32fdffc30645 100644 --- a/aegisub/src/audio_provider_hd.cpp +++ b/aegisub/src/audio_provider_hd.cpp @@ -123,7 +123,7 @@ HDAudioProvider::HDAudioProvider(AudioProvider *src, agi::BackgroundRunner *br) try { { agi::io::Save out(STD_STR(diskCacheFilename), true); - br->Run(bind(&HDAudioProvider::FillCache, this, src, &out.Get(), std::tr1::placeholders::_1)); + br->Run(bind(&HDAudioProvider::FillCache, this, src, &out.Get(), std::placeholders::_1)); } cache_provider.reset(new RawAudioProvider(diskCacheFilename, src)); } diff --git a/aegisub/src/audio_provider_ram.cpp b/aegisub/src/audio_provider_ram.cpp index 810ac593fdd1a1cb4a86d84ac3ea3a2fe4f075eb..4af93354eecfdc2f7e575a69fddade4a69846e54 100644 --- a/aegisub/src/audio_provider_ram.cpp +++ b/aegisub/src/audio_provider_ram.cpp @@ -78,7 +78,7 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *src, agi::BackgroundRunner *br filename = source->GetFilename(); float_samples = source->AreSamplesFloat(); - br->Run(std::tr1::bind(&RAMAudioProvider::FillCache, this, src, std::tr1::placeholders::_1)); + br->Run(std::bind(&RAMAudioProvider::FillCache, this, src, std::placeholders::_1)); } RAMAudioProvider::~RAMAudioProvider() { diff --git a/aegisub/src/audio_renderer.cpp b/aegisub/src/audio_renderer.cpp index dbe9f6efe9851180917db9ea7f6303a33b36f980..a74f8d0dbc89a72aaf53cf4657c56018a315ce82 100644 --- a/aegisub/src/audio_renderer.cpp +++ b/aegisub/src/audio_renderer.cpp @@ -39,7 +39,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #include <wx/bitmap.h> #include <wx/dcmemory.h> @@ -52,7 +52,7 @@ template<class C, class F> static void for_each(C &container, F const& func) std::for_each(container.begin(), container.end(), func); } -using std::tr1::placeholders::_1; +using std::placeholders::_1; AudioRendererBitmapCacheBitmapFactory::AudioRendererBitmapCacheBitmapFactory(AudioRenderer *renderer) : renderer(renderer) @@ -182,7 +182,7 @@ void AudioRenderer::ResetBlockCount() double duration = provider->GetNumSamples() * 1000.0 / provider->GetSampleRate(); size_t rendered_width = (size_t)ceil(duration / pixel_ms); cache_numblocks = rendered_width / cache_bitmap_width; - for_each(bitmaps, bind(&AudioRendererBitmapCache::SetBlockCount, _1, cache_numblocks)); + for_each(bitmaps, std::bind(&AudioRendererBitmapCache::SetBlockCount, _1, cache_numblocks)); } } @@ -253,7 +253,7 @@ void AudioRenderer::Render(wxDC &dc, wxPoint origin, int start, int length, Audi void AudioRenderer::Invalidate() { - for_each(bitmaps, bind(&AudioRendererBitmapCache::Age, _1, 0)); + for_each(bitmaps, std::bind(&AudioRendererBitmapCache::Age, _1, 0)); needs_age = false; } diff --git a/aegisub/src/audio_timing_dialogue.cpp b/aegisub/src/audio_timing_dialogue.cpp index c82329b74b9e3858b7cad3910650304a5afd7b4f..52c2ccce05d63c99823af5075e0b42a1870facdc 100644 --- a/aegisub/src/audio_timing_dialogue.cpp +++ b/aegisub/src/audio_timing_dialogue.cpp @@ -435,9 +435,9 @@ AudioTimingControllerDialogue::AudioTimingControllerDialogue(agi::Context *c) , active_line_connection(c->selectionController->AddActiveLineListener(&AudioTimingControllerDialogue::OnActiveLineChanged, this)) , selection_connection(c->selectionController->AddSelectionListener(&AudioTimingControllerDialogue::OnSelectedSetChanged, this)) { - keyframes_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); - video_position_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); - seconds_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); + keyframes_provider.AddMarkerMovedListener(std::bind(std::ref(AnnounceMarkerMoved))); + video_position_provider.AddMarkerMovedListener(std::bind(std::ref(AnnounceMarkerMoved))); + seconds_provider.AddMarkerMovedListener(std::bind(std::ref(AnnounceMarkerMoved))); Revert(); } @@ -502,9 +502,9 @@ void AudioTimingControllerDialogue::GetRenderingStyles(AudioRenderingStyleRanges { active_line.GetStyleRange(&ranges); for_each(selected_lines.begin(), selected_lines.end(), - bind(&TimeableLine::GetStyleRange, std::tr1::placeholders::_1, &ranges)); + std::bind(&TimeableLine::GetStyleRange, std::placeholders::_1, &ranges)); for_each(inactive_lines.begin(), inactive_lines.end(), - bind(&TimeableLine::GetStyleRange, std::tr1::placeholders::_1, &ranges)); + std::bind(&TimeableLine::GetStyleRange, std::placeholders::_1, &ranges)); } void AudioTimingControllerDialogue::Next(NextMode mode) @@ -547,7 +547,7 @@ void AudioTimingControllerDialogue::DoCommit(bool user_triggered) if (modified_lines.size()) { for_each(modified_lines.begin(), modified_lines.end(), - std::tr1::mem_fn(&TimeableLine::Apply)); + std::mem_fn(&TimeableLine::Apply)); commit_connection.Block(); if (user_triggered) @@ -824,9 +824,9 @@ void AudioTimingControllerDialogue::RegenerateMarkers() active_line.GetMarkers(&markers); for_each(selected_lines.begin(), selected_lines.end(), - bind(&TimeableLine::GetMarkers, std::tr1::placeholders::_1, &markers)); + std::bind(&TimeableLine::GetMarkers, std::placeholders::_1, &markers)); for_each(inactive_lines.begin(), inactive_lines.end(), - bind(&TimeableLine::GetMarkers, std::tr1::placeholders::_1, &markers)); + std::bind(&TimeableLine::GetMarkers, std::placeholders::_1, &markers)); sort(markers.begin(), markers.end(), marker_ptr_cmp()); AnnounceMarkerMoved(); @@ -838,7 +838,7 @@ std::vector<AudioMarker*> AudioTimingControllerDialogue::GetLeftMarkers() ret.reserve(selected_lines.size() + 1); ret.push_back(active_line.GetLeftMarker()); transform(selected_lines.begin(), selected_lines.end(), back_inserter(ret), - bind(&TimeableLine::GetLeftMarker, std::tr1::placeholders::_1)); + std::bind(&TimeableLine::GetLeftMarker, std::placeholders::_1)); return ret; } @@ -848,7 +848,7 @@ std::vector<AudioMarker*> AudioTimingControllerDialogue::GetRightMarkers() ret.reserve(selected_lines.size() + 1); ret.push_back(active_line.GetRightMarker()); transform(selected_lines.begin(), selected_lines.end(), back_inserter(ret), - bind(&TimeableLine::GetRightMarker, std::tr1::placeholders::_1)); + std::bind(&TimeableLine::GetRightMarker, std::placeholders::_1)); return ret; } diff --git a/aegisub/src/audio_timing_karaoke.cpp b/aegisub/src/audio_timing_karaoke.cpp index 0081e21bf39aa8362294f3f867bf404a5ec858b3..bf346143fa7e29ada73e7c9af63d4366b7c0b80c 100644 --- a/aegisub/src/audio_timing_karaoke.cpp +++ b/aegisub/src/audio_timing_karaoke.cpp @@ -171,8 +171,8 @@ AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, AssK slots.push_back(kara->AddSyllablesChangedListener(&AudioTimingControllerKaraoke::Revert, this)); slots.push_back(OPT_SUB("Audio/Auto/Commit", &AudioTimingControllerKaraoke::OnAutoCommitChange, this)); - keyframes_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); - video_position_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved))); + keyframes_provider.AddMarkerMovedListener(std::bind(std::ref(AnnounceMarkerMoved))); + video_position_provider.AddMarkerMovedListener(std::bind(std::ref(AnnounceMarkerMoved))); Revert(); diff --git a/aegisub/src/auto4_base.cpp b/aegisub/src/auto4_base.cpp index 3ed097d17fa00679ebdd03f61524efdd0944b904..9c8d273a93b5d815b1a655ca06b8839eb8aac2b8 100644 --- a/aegisub/src/auto4_base.cpp +++ b/aegisub/src/auto4_base.cpp @@ -39,6 +39,8 @@ #ifndef AGI_PRE #ifdef __WINDOWS__ #include <tchar.h> +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #endif #include <wx/button.h> @@ -50,14 +52,8 @@ #include <wx/msgdlg.h> #include <wx/thread.h> #include <wx/tokenzr.h> -#endif -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include <windows.h> #include <tuple> -#else -#include <tr1/tuple> #endif #ifndef __WINDOWS__ @@ -251,7 +247,7 @@ namespace Automation4 { int ret = 0; wxSemaphore sema(0, 1); wxThreadEvent *evt = new wxThreadEvent(EVT_SHOW_DIALOG); - evt->SetPayload(std::tr1::make_tuple(dialog, &sema, &ret)); + evt->SetPayload(std::make_tuple(dialog, &sema, &ret)); bsr->QueueEvent(evt); sema.Wait(); return ret; @@ -288,7 +284,7 @@ namespace Automation4 { void BackgroundScriptRunner::OnDialog(wxThreadEvent &evt) { - using namespace std::tr1; + using namespace std; tuple<wxDialog*, wxSemaphore*, int*> payload = evt.GetPayload<tuple<wxDialog*, wxSemaphore*, int*> >(); *get<2>(payload) = get<0>(payload)->ShowModal(); get<1>(payload)->Post(); @@ -301,13 +297,13 @@ namespace Automation4 { // Convert a function taking an Automation4::ProgressSink to one taking an // agi::ProgressSink so that we can pass it to an agi::BackgroundWorker - static void progress_sink_wrapper(std::tr1::function<void (ProgressSink*)> task, agi::ProgressSink *ps, BackgroundScriptRunner *bsr) + static void progress_sink_wrapper(std::function<void (ProgressSink*)> task, agi::ProgressSink *ps, BackgroundScriptRunner *bsr) { ProgressSink aps(ps, bsr); task(&aps); } - void BackgroundScriptRunner::Run(std::tr1::function<void (ProgressSink*)> task) + void BackgroundScriptRunner::Run(std::function<void (ProgressSink*)> task) { int prio = OPT_GET("Automation/Thread Priority")->GetInt(); if (prio == 0) prio = 50; // normal @@ -315,7 +311,7 @@ namespace Automation4 { else if (prio == 2) prio = 10; // lowest else prio = 50; // fallback normal - impl->Run(bind(progress_sink_wrapper, task, std::tr1::placeholders::_1, this), prio); + impl->Run(bind(progress_sink_wrapper, task, std::placeholders::_1, this), prio); } wxWindow *BackgroundScriptRunner::GetParentWindow() const @@ -574,10 +570,10 @@ namespace Automation4 { bool ScriptFactory::CanHandleScriptFormat(wxString const& filename) { - using std::tr1::placeholders::_1; + using std::placeholders::_1; // Just make this always return true to bitch about unknown script formats in autoload return find_if(Factories().begin(), Factories().end(), - bind(&wxString::Matches, filename, bind(&ScriptFactory::GetFilenamePattern, _1))) != Factories().end(); + [&](ScriptFactory *sf) { return filename.Matches(sf->GetFilenamePattern()); }) != Factories().end(); } std::vector<ScriptFactory*>& ScriptFactory::Factories() diff --git a/aegisub/src/auto4_base.h b/aegisub/src/auto4_base.h index 8d60e474723d89d5affad1014fe7572851115463..292348c89bf8012ccbbb223eaef367cbcc0d7784 100644 --- a/aegisub/src/auto4_base.h +++ b/aegisub/src/auto4_base.h @@ -130,7 +130,7 @@ namespace Automation4 { void QueueEvent(wxEvent *evt); wxWindow *GetParentWindow() const; - void Run(std::tr1::function<void(ProgressSink*)> task); + void Run(std::function<void(ProgressSink*)> task); BackgroundScriptRunner(wxWindow *parent, wxString const& title); ~BackgroundScriptRunner(); diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index c4b4dae2697e8110e02b8dbde720a7cb936176cc..40219bfe2f14eb18b51a93ace2046e7a0b4ed202 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -743,7 +743,7 @@ namespace Automation4 { { bool failed = false; BackgroundScriptRunner bsr(parent, title); - bsr.Run(bind(lua_threaded_call, std::tr1::placeholders::_1, L, nargs, nresults, can_open_config, &failed)); + bsr.Run(std::bind(lua_threaded_call, std::placeholders::_1, L, nargs, nresults, can_open_config, &failed)); if (failed) throw agi::UserCancelException("Script threw an error"); } diff --git a/aegisub/src/base_grid.cpp b/aegisub/src/base_grid.cpp index 1f077877ff6392bc003afaad1f7f6064123a4c4f..feccc7538902d1745f21f25023af3d36de6a0b35 100644 --- a/aegisub/src/base_grid.cpp +++ b/aegisub/src/base_grid.cpp @@ -95,7 +95,7 @@ BaseGrid::BaseGrid(wxWindow* parent, agi::Context *context, const wxSize& size, , active_line(0) , batch_level(0) , batch_active_line_changed(false) -, seek_listener(context->videoController->AddSeekListener(std::tr1::bind(&BaseGrid::Refresh, this, false, (wxRect*)NULL))) +, seek_listener(context->videoController->AddSeekListener(std::bind(&BaseGrid::Refresh, this, false, (wxRect*)NULL))) , context_menu(0) , yPos(0) , context(context) @@ -132,7 +132,7 @@ BaseGrid::BaseGrid(wxWindow* parent, agi::Context *context, const wxSize& size, OPT_SUB("Colour/Subtitle Grid/Lines", &BaseGrid::UpdateStyle, this); OPT_SUB("Colour/Subtitle Grid/Selection", &BaseGrid::UpdateStyle, this); OPT_SUB("Colour/Subtitle Grid/Standard", &BaseGrid::UpdateStyle, this); - OPT_SUB("Subtitle/Grid/Hide Overrides", std::tr1::bind(&BaseGrid::Refresh, this, false, (wxRect*)NULL)); + OPT_SUB("Subtitle/Grid/Hide Overrides", std::bind(&BaseGrid::Refresh, this, false, (wxRect*)NULL)); Bind(wxEVT_CONTEXT_MENU, &BaseGrid::OnContextMenu, this); } @@ -272,7 +272,7 @@ void BaseGrid::UpdateMaps(bool preserve_selected_rows) { if (preserve_selected_rows) { sel_rows.reserve(selection.size()); transform(selection.begin(), selection.end(), back_inserter(sel_rows), - bind1st(std::mem_fun(&BaseGrid::GetDialogueIndex), this)); + std::bind(&BaseGrid::GetDialogueIndex, this)); } index_line_map.clear(); @@ -426,7 +426,7 @@ wxArrayInt BaseGrid::GetSelection() const { wxArrayInt res; res.reserve(selection.size()); transform(selection.begin(), selection.end(), std::back_inserter(res), - bind(&BaseGrid::GetDialogueIndex, this, std::tr1::placeholders::_1)); + std::bind(&BaseGrid::GetDialogueIndex, this, std::placeholders::_1)); std::sort(res.begin(), res.end()); return res; } @@ -784,7 +784,6 @@ void BaseGrid::OnContextMenu(wxContextMenuEvent &evt) { } void BaseGrid::ScrollTo(int y) { - int h = GetClientSize().GetHeight(); int nextY = mid(0, y, GetRows() - 1); if (yPos != nextY) { yPos = nextY; diff --git a/aegisub/src/command/edit.cpp b/aegisub/src/command/edit.cpp index 46df7e5afb1941ff042e626d6576859710ea1899..9c07b14cefe2181389aeeca2cdaf789f2aa6ccbb 100644 --- a/aegisub/src/command/edit.cpp +++ b/aegisub/src/command/edit.cpp @@ -274,7 +274,7 @@ void set_text(AssDialogue *line, wxString const& value) { void commit_text(agi::Context const * const c, wxString const& desc, int sel_start = -1, int sel_end = -1, int *commit_id = 0) { SubtitleSelection const& sel = c->selectionController->GetSelectedSet(); for_each(sel.begin(), sel.end(), - bind(set_text, std::tr1::placeholders::_1, c->selectionController->GetActiveLine()->Text)); + std::bind(set_text, std::placeholders::_1, c->selectionController->GetActiveLine()->Text)); int new_commit_id = c->ass->Commit(desc, AssFile::COMMIT_DIAG_TEXT, commit_id ? *commit_id : -1, sel.size() == 1 ? *sel.begin() : 0); if (commit_id) *commit_id = new_commit_id; @@ -322,7 +322,7 @@ void show_color_picker(const agi::Context *c, agi::Color (AssStyle::*field), con color = get_value(*line, blockn, color, tag, alt); int commit_id = -1; - bool ok = GetColorFromUser(c->parent, color, bind(got_color, c, tag, &commit_id, std::tr1::placeholders::_1)); + bool ok = GetColorFromUser(c->parent, color, std::bind(got_color, c, tag, &commit_id, std::placeholders::_1)); line->ClearBlocks(); commit_text(c, _("set color"), -1, -1, &commit_id); diff --git a/aegisub/src/dialog_automation.cpp b/aegisub/src/dialog_automation.cpp index f93d001061387452d5c004a1a4a09dcec6515d53..48d6931e630e75cee90bc9459d3e4643a6876f63 100644 --- a/aegisub/src/dialog_automation.cpp +++ b/aegisub/src/dialog_automation.cpp @@ -57,7 +57,7 @@ #include "main.h" #include "subtitle_format.h" -using std::tr1::placeholders::_1; +using std::placeholders::_1; DialogAutomation::DialogAutomation(agi::Context *c) : wxDialog(c->parent, -1, _("Automation Manager"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) @@ -78,8 +78,8 @@ DialogAutomation::DialogAutomation(agi::Context *c) wxButton *reload_autoload_button = new wxButton(this, -1, _("Re&scan Autoload Dir")); wxButton *close_button = new wxButton(this, wxID_CANCEL, _("&Close")); - list->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, std::tr1::bind(&DialogAutomation::UpdateDisplay, this)); - list->Bind(wxEVT_COMMAND_LIST_ITEM_DESELECTED, std::tr1::bind(&DialogAutomation::UpdateDisplay, this)); + list->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, std::bind(&DialogAutomation::UpdateDisplay, this)); + list->Bind(wxEVT_COMMAND_LIST_ITEM_DESELECTED, std::bind(&DialogAutomation::UpdateDisplay, this)); add_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnAdd, this); remove_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnRemove, this); reload_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnReload, this); diff --git a/aegisub/src/dialog_colorpicker.cpp b/aegisub/src/dialog_colorpicker.cpp index 10808dcc7ce630cd56642afcefad34f70b58461f..cf4ede75f53873b2a21a1769982255e3c04e5e8c 100644 --- a/aegisub/src/dialog_colorpicker.cpp +++ b/aegisub/src/dialog_colorpicker.cpp @@ -240,10 +240,10 @@ class DialogColorPicker : public wxDialog { void OnMouse(wxMouseEvent &evt); void OnCaptureLost(wxMouseCaptureLostEvent&); - std::tr1::function<void (agi::Color)> callback; + std::function<void (agi::Color)> callback; public: - DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::tr1::function<void (agi::Color)> callback); + DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::function<void (agi::Color)> callback); ~DialogColorPicker(); void SetColor(agi::Color new_color); @@ -583,7 +583,7 @@ void ColorPickerScreenDropper::DropFromScreenXY(int x, int y) Refresh(false); } -bool GetColorFromUser(wxWindow* parent, agi::Color original, std::tr1::function<void (agi::Color)> callback) +bool GetColorFromUser(wxWindow* parent, agi::Color original, std::function<void (agi::Color)> callback) { DialogColorPicker dialog(parent, original, callback); bool ok = dialog.ShowModal() == wxID_OK; @@ -605,7 +605,7 @@ static wxBitmap *make_rgb_image(int width, int offset) { return new wxBitmap(img); } -DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::tr1::function<void (agi::Color)> callback) +DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::function<void (agi::Color)> callback) : wxDialog(parent, -1, _("Select Color")) , callback(callback) { @@ -739,7 +739,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color, SetColor(initial_color); recent_box->Load(OPT_GET("Tool/Colour Picker/Recent Colours")->GetListColor()); - using std::tr1::bind; + using std::bind; for (int i = 0; i < 3; ++i) { rgb_input[i]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromRGB, this, true)); rgb_input[i]->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromRGB, this, true)); diff --git a/aegisub/src/dialog_colorpicker.h b/aegisub/src/dialog_colorpicker.h index f810b5d081ff53b4a48f1d25890b80c5436627b9..a64e5e37dd5b1dbe67788d9aacd08b04a8baf6d2 100644 --- a/aegisub/src/dialog_colorpicker.h +++ b/aegisub/src/dialog_colorpicker.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #endif namespace agi { struct Color; } @@ -44,7 +44,7 @@ class wxWindow; /// @param original Initial color to select /// @param callback Function called whenever the selected color changes /// @return Did the user accept the new color? -bool GetColorFromUser(wxWindow* parent, agi::Color original, std::tr1::function<void (agi::Color)> callback); +bool GetColorFromUser(wxWindow* parent, agi::Color original, std::function<void (agi::Color)> callback); /// @brief Get a color from the user via a color picker dialog /// @param T Class which the callback method belongs to @@ -55,5 +55,5 @@ bool GetColorFromUser(wxWindow* parent, agi::Color original, std::tr1::function< /// @return Did the user accept the new color? template<class T, void (T::*method)(agi::Color)> bool GetColorFromUser(wxWindow* parent, agi::Color original, T* callbackObj) { - return GetColorFromUser(parent, original, bind(method, callbackObj, std::tr1::placeholders::_1)); + return GetColorFromUser(parent, original, std::bind(method, callbackObj, std::placeholders::_1)); } diff --git a/aegisub/src/dialog_dummy_video.cpp b/aegisub/src/dialog_dummy_video.cpp index 2d0ab7c2fc35e2b0b14b0a922075aaeb81facf6d..5f56e6d41154242494460eb2d693f9efbf2b46fc 100644 --- a/aegisub/src/dialog_dummy_video.cpp +++ b/aegisub/src/dialog_dummy_video.cpp @@ -38,7 +38,7 @@ #include "dialog_dummy_video.h" #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #include <wx/checkbox.h> #include <wx/combobox.h> @@ -181,7 +181,7 @@ DialogDummyVideo::DialogDummyVideo(wxWindow *parent) wxStdDialogButtonSizer *btnSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); ok_button = btnSizer->GetAffirmativeButton(); - btnSizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Dummy Video")); + btnSizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Dummy Video")); main_sizer->Add(new wxStaticLine(this,wxHORIZONTAL),0,wxALL|wxEXPAND,5); main_sizer->Add(btnSizer,0,wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND,5); diff --git a/aegisub/src/dialog_export.cpp b/aegisub/src/dialog_export.cpp index 79644f2cb6d3530f8304a4c2021ccd5b12ff633b..2b4666abcbcc2d4a2acb9061e5ac8abf641bbbb0 100644 --- a/aegisub/src/dialog_export.cpp +++ b/aegisub/src/dialog_export.cpp @@ -113,7 +113,7 @@ DialogExport::DialogExport(agi::Context *c) wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); btn_sizer->GetAffirmativeButton()->SetLabelText(_("Export...")); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogExport::OnProcess, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Export"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Export"), wxID_HELP); wxSizer *horz_sizer = new wxBoxSizer(wxHORIZONTAL); opt_sizer = new wxBoxSizer(wxVERTICAL); diff --git a/aegisub/src/dialog_fonts_collector.cpp b/aegisub/src/dialog_fonts_collector.cpp index 921cd1b22fc84166dc6cc7a14a78b46352f6b6ae..d5eddc776c2dc76abda6823aa190d84e883697b5 100644 --- a/aegisub/src/dialog_fonts_collector.cpp +++ b/aegisub/src/dialog_fonts_collector.cpp @@ -76,7 +76,7 @@ class FontsCollectorThread : public wxThread { FcMode oper; ///< Copying mode void Collect() { - using namespace std::tr1::placeholders; + using namespace std::placeholders; FontCollectorStatusCallback callback(bind(&FontsCollectorThread::AppendText, this, _1, _2)); @@ -272,7 +272,7 @@ DialogFontsCollector::DialogFontsCollector(agi::Context *c) start_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogFontsCollector::OnStart, this); dest_browse_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogFontsCollector::OnBrowse, this); collection_mode->Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &DialogFontsCollector::OnRadio, this); - button_sizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Fonts Collector")); + button_sizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Fonts Collector")); Bind(EVT_ADD_TEXT, &DialogFontsCollector::OnAddText, this); Bind(EVT_COLLECTION_DONE, &DialogFontsCollector::OnCollectionComplete, this); } diff --git a/aegisub/src/dialog_jumpto.cpp b/aegisub/src/dialog_jumpto.cpp index 4208f603a3c297c833c25eaa6e45016bf6d73364..5568b54fddb6cdacc0baeec2e7b51bd34078b45d 100644 --- a/aegisub/src/dialog_jumpto.cpp +++ b/aegisub/src/dialog_jumpto.cpp @@ -92,7 +92,7 @@ DialogJumpTo::DialogJumpTo(agi::Context *c) Bind(wxEVT_INIT_DIALOG, &DialogJumpTo::OnInitDialog, this); Bind(wxEVT_COMMAND_TEXT_ENTER, &DialogJumpTo::OnOK, this); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogJumpTo::OnOK, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogJumpTo::EndModal, this, 0), wxID_CANCEL); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogJumpTo::EndModal, this, 0), wxID_CANCEL); JumpTime->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogJumpTo::OnEditTime, this); JumpFrame->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogJumpTo::OnEditFrame, this); } diff --git a/aegisub/src/dialog_kara_timing_copy.cpp b/aegisub/src/dialog_kara_timing_copy.cpp index 1e38cc2363df94d659134b34407d0e2fac5f87e5..b8cabc7d905caa89a6af81c0e9eed14d9c8adccf 100644 --- a/aegisub/src/dialog_kara_timing_copy.cpp +++ b/aegisub/src/dialog_kara_timing_copy.cpp @@ -146,8 +146,8 @@ KaraokeLineMatchDisplay::KaraokeLineMatchDisplay(wxWindow *parent) SetMaxSize(wxSize(-1, best_size.GetHeight())); SetMinSize(best_size); - Bind(wxEVT_SET_FOCUS, std::tr1::bind(&wxControl::Refresh, this, true, (const wxRect*)0)); - Bind(wxEVT_KILL_FOCUS, std::tr1::bind(&wxControl::Refresh, this, true, (const wxRect*)0)); + Bind(wxEVT_SET_FOCUS, std::bind(&wxControl::Refresh, this, true, (const wxRect*)0)); + Bind(wxEVT_KILL_FOCUS, std::bind(&wxControl::Refresh, this, true, (const wxRect*)0)); Bind(wxEVT_PAINT, &KaraokeLineMatchDisplay::OnPaint, this); } diff --git a/aegisub/src/dialog_log.cpp b/aegisub/src/dialog_log.cpp index 826b1caf6823bc85c939a0e079009ff82cce9f3c..e956d72f95f41a7d54b8505216c913c1dd00f7a0 100644 --- a/aegisub/src/dialog_log.cpp +++ b/aegisub/src/dialog_log.cpp @@ -39,7 +39,7 @@ #ifndef AGI_PRE #include <algorithm> #include <ctime> -#include <tr1/functional> +#include <functional> #include <string> #include <wx/button.h> @@ -59,7 +59,7 @@ public: : text_ctrl(t) { const agi::log::Sink *sink = agi::log::log->GetSink(); - for_each(sink->begin(), sink->end(), bind(&EmitLog::log, this, std::tr1::placeholders::_1)); + for_each(sink->begin(), sink->end(), bind(&EmitLog::log, this, std::placeholders::_1)); } void log(agi::log::SinkMessage *sm) { diff --git a/aegisub/src/dialog_paste_over.cpp b/aegisub/src/dialog_paste_over.cpp index d4025456717f93c6acce250a5db49cc13b9e3d96..ed973efe0667720ea3c1aacee9e5a0b33e758bc5 100644 --- a/aegisub/src/dialog_paste_over.cpp +++ b/aegisub/src/dialog_paste_over.cpp @@ -37,7 +37,7 @@ #include "dialog_paste_over.h" #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #include <wx/button.h> #include <wx/checklst.h> @@ -82,9 +82,9 @@ DialogPasteOver::DialogPasteOver(wxWindow *parent) wxSizer *TopButtonSizer = new wxBoxSizer(wxHORIZONTAL); TopButtonSizer->Add(btn = new wxButton(this, -1, _("&All")), wxSizerFlags(1)); - btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogPasteOver::CheckAll, this, true)); + btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogPasteOver::CheckAll, this, true)); TopButtonSizer->Add(btn = new wxButton(this, -1, _("&None")), wxSizerFlags(1)); - btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogPasteOver::CheckAll, this, false)); + btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogPasteOver::CheckAll, this, false)); TopButtonSizer->Add(btn = new wxButton(this, -1, _("&Times")), wxSizerFlags(1)); btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnTimes, this); TopButtonSizer->Add(btn = new wxButton(this, -1, _("T&ext")), wxSizerFlags(1)); @@ -93,7 +93,7 @@ DialogPasteOver::DialogPasteOver(wxWindow *parent) // Buttons wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnOK, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Paste Over"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Paste Over"), wxID_HELP); // Main sizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); diff --git a/aegisub/src/dialog_progress.cpp b/aegisub/src/dialog_progress.cpp index 548ce1f0225371167fb3ca86240247b85ae9e70d..a6c17b78c3802a8ade90445b16715c6275c2a076 100644 --- a/aegisub/src/dialog_progress.cpp +++ b/aegisub/src/dialog_progress.cpp @@ -92,12 +92,12 @@ public: }; class TaskRunner : public wxThread { - std::tr1::function<void(agi::ProgressSink*)> task; + std::function<void(agi::ProgressSink*)> task; agi::ProgressSink *ps; wxDialog *dialog; public: - TaskRunner(std::tr1::function<void(agi::ProgressSink*)> task, agi::ProgressSink *ps, wxDialog *dialog, int priority) + TaskRunner(std::function<void(agi::ProgressSink*)> task, agi::ProgressSink *ps, wxDialog *dialog, int priority) : task(task) , ps(ps) , dialog(dialog) @@ -160,7 +160,7 @@ DialogProgress::DialogProgress(wxWindow *parent, wxString const& title_text, wxS Bind(EVT_LOG, &DialogProgress::OnLog, this); } -void DialogProgress::Run(std::tr1::function<void(agi::ProgressSink*)> task, int priority) { +void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int priority) { DialogProgressSink ps(this); this->ps = &ps; new TaskRunner(task, &ps, this, priority); diff --git a/aegisub/src/dialog_progress.h b/aegisub/src/dialog_progress.h index a08c5579366bd5657d2cde5a82e301ba6b481a74..40dac705c83a8483da7608c32d7555651d6ee3e6 100644 --- a/aegisub/src/dialog_progress.h +++ b/aegisub/src/dialog_progress.h @@ -66,5 +66,5 @@ public: DialogProgress(wxWindow *parent, wxString const& title="", wxString const& message=""); /// BackgroundWorker implementation - void Run(std::tr1::function<void(agi::ProgressSink *)> task, int priority=-1); + void Run(std::function<void(agi::ProgressSink *)> task, int priority=-1); }; diff --git a/aegisub/src/dialog_properties.cpp b/aegisub/src/dialog_properties.cpp index cff7a141040c03dc5e8f4c5f557ddbba599d597b..63f00f27a870e89a0aab0adf60925a0320a1e410 100644 --- a/aegisub/src/dialog_properties.cpp +++ b/aegisub/src/dialog_properties.cpp @@ -122,7 +122,7 @@ DialogProperties::DialogProperties(agi::Context *c) // Button sizer wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProperties::OnOK, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); // MainSizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); diff --git a/aegisub/src/dialog_resample.cpp b/aegisub/src/dialog_resample.cpp index c8845f9898491d3a46f10d0eebc0d8cb0db578c1..a1797d1d3c84acb5b1bbbac752cc81415d087862 100644 --- a/aegisub/src/dialog_resample.cpp +++ b/aegisub/src/dialog_resample.cpp @@ -23,7 +23,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #include <wx/checkbox.h> #include <wx/sizer.h> @@ -115,7 +115,7 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings) CenterOnParent(); // Bind events - using std::tr1::bind; + using std::bind; Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&HelpButton::OpenPage, "Resample resolution"), wxID_HELP); from_video->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogResample::SetDestFromVideo, this); symmetrical->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &DialogResample::OnSymmetrical, this); @@ -248,7 +248,7 @@ void ResampleResolution(AssFile *ass, ResampleSettings const& settings) { if (settings.change_ar) state.ar = state.rx / state.ry; - for_each(ass->Line.begin(), ass->Line.end(), bind(resample_line, &state, std::tr1::placeholders::_1)); + for_each(ass->Line.begin(), ass->Line.end(), bind(resample_line, &state, std::placeholders::_1)); ass->SetScriptInfo("PlayResX", wxString::Format("%d", settings.script_x)); ass->SetScriptInfo("PlayResY", wxString::Format("%d", settings.script_y)); diff --git a/aegisub/src/dialog_search_replace.cpp b/aegisub/src/dialog_search_replace.cpp index 5d69f16b7e833a047679892b1ea9848c76f8a168..0f5fa755cb5ccd7b26b68c0fc1aee63737a477f8 100644 --- a/aegisub/src/dialog_search_replace.cpp +++ b/aegisub/src/dialog_search_replace.cpp @@ -136,11 +136,11 @@ DialogSearchReplace::DialogSearchReplace(agi::Context* c, bool withReplace) Search.OnDialogOpen(); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogSearchReplace::FindReplace, this, 0), BUTTON_FIND_NEXT); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogSearchReplace::FindReplace, this, 1), BUTTON_REPLACE_NEXT); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogSearchReplace::FindReplace, this, 2), BUTTON_REPLACE_ALL); - Bind(wxEVT_SET_FOCUS, std::tr1::bind(&SearchReplaceEngine::SetFocus, &Search, true)); - Bind(wxEVT_KILL_FOCUS, std::tr1::bind(&SearchReplaceEngine::SetFocus, &Search, false)); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 0), BUTTON_FIND_NEXT); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 1), BUTTON_REPLACE_NEXT); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 2), BUTTON_REPLACE_ALL); + Bind(wxEVT_SET_FOCUS, std::bind(&SearchReplaceEngine::SetFocus, &Search, true)); + Bind(wxEVT_KILL_FOCUS, std::bind(&SearchReplaceEngine::SetFocus, &Search, false)); } DialogSearchReplace::~DialogSearchReplace() { diff --git a/aegisub/src/dialog_selection.cpp b/aegisub/src/dialog_selection.cpp index 902ebb54567c8d0a0fd3abe321775efbf5ff2dde..2afc738b3950420755a7618bdb4753c6b9c9314d 100644 --- a/aegisub/src/dialog_selection.cpp +++ b/aegisub/src/dialog_selection.cpp @@ -77,8 +77,8 @@ static wxString AssDialogue::* get_field(int field_n) { } } -std::tr1::function<bool (wxString)> get_predicate(int mode, wxRegEx *re, bool match_case, wxString const& match_text) { - using std::tr1::placeholders::_1; +std::function<bool (wxString)> get_predicate(int mode, wxRegEx *re, bool match_case, wxString const& match_text) { + using std::placeholders::_1; switch (mode) { case MODE_REGEXP: @@ -110,7 +110,7 @@ static std::set<AssDialogue*> process(wxString match_text, bool match_case, int } wxString AssDialogue::*field = get_field(field_n); - std::tr1::function<bool (wxString)> pred = get_predicate(mode, &re, match_case, match_text); + std::function<bool (wxString)> pred = get_predicate(mode, &re, match_case, match_text); std::set<AssDialogue*> matches; for (entryIter it = ass->Line.begin(); it != ass->Line.end(); ++it) { @@ -189,9 +189,9 @@ wxDialog (c->parent, -1, _("Select"), wxDefaultPosition, wxDefaultSize, wxCAPTIO match_mode->SetSelection(OPT_GET("Tool/Select Lines/Mode")->GetInt()); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogSelection::Process, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Select Lines"), wxID_HELP); - apply_to_comments->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::tr1::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_dialogue)); - apply_to_dialogue->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::tr1::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_comments)); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Select Lines"), wxID_HELP); + apply_to_comments->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_dialogue)); + apply_to_dialogue->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_comments)); } DialogSelection::~DialogSelection() { diff --git a/aegisub/src/dialog_shift_times.cpp b/aegisub/src/dialog_shift_times.cpp index 4a8395c9f981a7fb8e63658bc1081a37f6fd9a99..911dc331216573ad7239b751e561c19b76191b76 100644 --- a/aegisub/src/dialog_shift_times.cpp +++ b/aegisub/src/dialog_shift_times.cpp @@ -192,7 +192,7 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context) CenterOnParent(); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogShiftTimes::Process, this, wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Shift Times"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Shift Times"), wxID_HELP); shift_time->Bind(wxEVT_COMMAND_TEXT_ENTER, &DialogShiftTimes::Process, this); history_box->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &DialogShiftTimes::OnHistoryClick, this); } diff --git a/aegisub/src/dialog_style_editor.cpp b/aegisub/src/dialog_style_editor.cpp index 10ddab4eec48d245a2bb3e211b6ae06cd4669622..98b7a5e9c1bdf04e5acece085ed60d96cd152387 100644 --- a/aegisub/src/dialog_style_editor.cpp +++ b/aegisub/src/dialog_style_editor.cpp @@ -399,13 +399,13 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con PreviewText->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogStyleEditor::OnPreviewTextChange, this); } - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogStyleEditor::Apply, this, true, true), wxID_OK); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogStyleEditor::Apply, this, true, false), wxID_APPLY); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogStyleEditor::Apply, this, false, true), wxID_CANCEL); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Style Editor"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, true, true), wxID_OK); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, true, false), wxID_APPLY); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, false, true), wxID_CANCEL); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Style Editor"), wxID_HELP); for (int i = 0; i < 4; ++i) - colorButton[i]->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleEditor::OnSetColor, this, i + 1, std::tr1::placeholders::_1)); + colorButton[i]->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleEditor::OnSetColor, this, i + 1, std::placeholders::_1)); } DialogStyleEditor::~DialogStyleEditor() { diff --git a/aegisub/src/dialog_style_manager.cpp b/aegisub/src/dialog_style_manager.cpp index 02cca8797a88b0626d565054d8ae1b5cd24bada4..a6708314025cb6cf7ce10114d2af5a146ae4cd04 100644 --- a/aegisub/src/dialog_style_manager.cpp +++ b/aegisub/src/dialog_style_manager.cpp @@ -37,7 +37,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #include <wx/bmpbuttn.h> #include <wx/clipbrd.h> @@ -67,7 +67,7 @@ #include "subtitle_format.h" #include "utils.h" -using std::tr1::placeholders::_1; +using std::placeholders::_1; namespace { @@ -156,7 +156,7 @@ DialogStyleManager::DialogStyleManager(agi::Context *context) , commit_connection(c->ass->AddCommitListener(&DialogStyleManager::LoadCurrentStyles, this)) , active_line_connection(c->selectionController->AddActiveLineListener(&DialogStyleManager::OnActiveLineChanged, this)) { - using std::tr1::bind; + using std::bind; SetIcon(GETICON(style_toolbutton_16)); // Catalog diff --git a/aegisub/src/dialog_timing_processor.cpp b/aegisub/src/dialog_timing_processor.cpp index 2c1096346663e10235a854a59915bb5cdff51388..aa48581e291ef24f832e49ee3948994a4613a768 100644 --- a/aegisub/src/dialog_timing_processor.cpp +++ b/aegisub/src/dialog_timing_processor.cpp @@ -38,7 +38,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #include <wx/button.h> #include <wx/checkbox.h> @@ -64,7 +64,7 @@ #include "video_context.h" namespace { -using std::tr1::placeholders::_1; +using std::placeholders::_1; void set_ctrl_state(wxCommandEvent &evt, wxCheckBox *cb, wxTextCtrl *tc) { tc->Enable(cb->IsChecked()); @@ -103,7 +103,7 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c) : wxDialog(c->parent, -1, _("Timing Post-Processor")) , c(c) { - using std::tr1::bind; + using std::bind; SetIcon(GETICON(timing_processor_toolbutton_16)); diff --git a/aegisub/src/dialog_version_check.cpp b/aegisub/src/dialog_version_check.cpp index 4847881375cce6b5823b162469171f4ef09a7f22..f8940f7f2cade4ca9605767168dfe6d7ed2d7392 100644 --- a/aegisub/src/dialog_version_check.cpp +++ b/aegisub/src/dialog_version_check.cpp @@ -64,9 +64,9 @@ #include <wx/txtstrm.h> #include <algorithm> +#include <functional> #include <memory> #include <set> -#include <tr1/functional> #include <vector> #endif @@ -547,7 +547,7 @@ VersionCheckerResultDialog::VersionCheckerResultDialog(const wxString &main_text Centre(); Show(); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&VersionCheckerResultDialog::Close, this, false), wxID_OK); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&VersionCheckerResultDialog::Close, this, false), wxID_OK); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VersionCheckerResultDialog::OnRemindMeLater, this, wxID_NO); Bind(wxEVT_CLOSE_WINDOW, &VersionCheckerResultDialog::OnClose, this); } diff --git a/aegisub/src/ffmpegsource_common.cpp b/aegisub/src/ffmpegsource_common.cpp index 5cafcfb668655ed9d271a951303831f15c9060c9..59dcc0aff6d8589a934875fb1feefa0d48e4056e 100644 --- a/aegisub/src/ffmpegsource_common.cpp +++ b/aegisub/src/ffmpegsource_common.cpp @@ -117,7 +117,7 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, const wxStri // index all audio tracks FFMS_Index *Index; - Progress.Run(bind(DoIndexingWrapper, &Index, Indexer, Trackmask, IndexEH, std::tr1::placeholders::_1, &ErrInfo)); + Progress.Run(std::bind(DoIndexingWrapper, &Index, Indexer, Trackmask, IndexEH, std::placeholders::_1, &ErrInfo)); if (Index == NULL) { MsgString.Append("Failed to index: ").Append(wxString(ErrInfo.Buffer, wxConvUTF8)); diff --git a/aegisub/src/font_file_lister.cpp b/aegisub/src/font_file_lister.cpp index c6209366a1a34208bfdb3c35de6eeae11cd7c98d..1b68b4725b772c4d914eb7cd491dd775ff3e651a 100644 --- a/aegisub/src/font_file_lister.cpp +++ b/aegisub/src/font_file_lister.cpp @@ -35,7 +35,7 @@ #include <wx/intl.h> #endif -using namespace std::tr1::placeholders; +using namespace std::placeholders; FontCollector::FontCollector(FontCollectorStatusCallback status_callback, FontFileLister &lister) : status_callback(status_callback) diff --git a/aegisub/src/font_file_lister.h b/aegisub/src/font_file_lister.h index 5582ea66af374daa81d25fc2e82e8de4ffc349d8..a378371c0d9c008af99e9ec2b1481a2b2f30805a 100644 --- a/aegisub/src/font_file_lister.h +++ b/aegisub/src/font_file_lister.h @@ -24,7 +24,7 @@ #ifndef AGI_PRE #include <list> #include <map> -#include <tr1/functional> +#include <functional> #include <set> #include <vector> @@ -34,7 +34,7 @@ class AssDialogue; class AssFile; -typedef std::tr1::function<void (wxString, int)> FontCollectorStatusCallback; +typedef std::function<void (wxString, int)> FontCollectorStatusCallback; /// @class FontFileLister /// @brief Font lister interface diff --git a/aegisub/src/gl_text.cpp b/aegisub/src/gl_text.cpp index 5a230fd7f402589c95e928dd63af52ccd51f6225..7da92756ae975a8730f91b6e73875541740d4ff8 100644 --- a/aegisub/src/gl_text.cpp +++ b/aegisub/src/gl_text.cpp @@ -233,7 +233,7 @@ OpenGLTextGlyph const& OpenGLText::CreateGlyph(int n) { // No texture could fit it, create a new one if (!ok) { - textures.push_back(std::tr1::shared_ptr<OpenGLTextTexture>(new OpenGLTextTexture(glyph))); + textures.push_back(std::shared_ptr<OpenGLTextTexture>(new OpenGLTextTexture(glyph))); } return glyph; diff --git a/aegisub/src/gl_text.h b/aegisub/src/gl_text.h index 2199afac1afd2764885559d5ebc2807ff0b73eb4..ef3e0c4cfe0042941fc0199a953673983e406e2b 100644 --- a/aegisub/src/gl_text.h +++ b/aegisub/src/gl_text.h @@ -35,7 +35,7 @@ #ifndef AGI_PRE #include <boost/container/map.hpp> -#include <tr1/memory> +#include <memory> #include <vector> #include <wx/colour.h> @@ -86,7 +86,7 @@ class OpenGLText { glyphMap glyphs; /// DOCME - std::vector<std::tr1::shared_ptr<OpenGLTextTexture> > textures; + std::vector<std::shared_ptr<OpenGLTextTexture> > textures; OpenGLText(OpenGLText const&); OpenGLText& operator=(OpenGLText const&); diff --git a/aegisub/src/help_button.cpp b/aegisub/src/help_button.cpp index e9513782a84f8580940feafa83c56bdd0ab2b426..ed0c71045795e78c02588a7ca8a1771c4fafd449 100644 --- a/aegisub/src/help_button.cpp +++ b/aegisub/src/help_button.cpp @@ -38,8 +38,8 @@ #ifndef AGI_PRE #include <algorithm> +#include <functional> #include <map> -#include <tr1/functional> #include <wx/filename.h> #include <wx/msgdlg.h> @@ -83,7 +83,7 @@ static void init_static() { HelpButton::HelpButton(wxWindow *parent, wxString const& page, wxPoint position, wxSize size) : wxButton(parent, wxID_HELP, "", position, size) { - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, page)); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, page)); init_static(); if (pages->find(page) == pages->end()) throw agi::InternalError("Invalid help page", 0); diff --git a/aegisub/src/hotkey_data_view_model.cpp b/aegisub/src/hotkey_data_view_model.cpp index ec1b7ada0f2d04dfc5e790181b8918b6a1740471..7e111e1cd3b8d171f6adf8fdd33bc266744fceac 100644 --- a/aegisub/src/hotkey_data_view_model.cpp +++ b/aegisub/src/hotkey_data_view_model.cpp @@ -166,7 +166,7 @@ public: void Apply(Hotkey::HotkeyMap *hk_map) { for_each(children.begin(), children.end(), - bind(&HotkeyModelCombo::Apply, std::tr1::placeholders::_1, hk_map)); + bind(&HotkeyModelCombo::Apply, std::placeholders::_1, hk_map)); } void SetFilter(wxRegEx const& new_filter) { @@ -239,7 +239,7 @@ public: void Apply(Hotkey::HotkeyMap *hk_map) { for_each(categories.begin(), categories.end(), - bind(&HotkeyModelCategory::Apply, std::tr1::placeholders::_1, hk_map)); + bind(&HotkeyModelCategory::Apply, std::placeholders::_1, hk_map)); } void SetFilter(wxString filter) { @@ -250,7 +250,7 @@ public: // Using wxRegEx for case-insensitive contains wxRegEx re(filter, wxRE_ADVANCED | wxRE_ICASE | wxRE_NOSUB); for_each(categories.begin(), categories.end(), - bind(&HotkeyModelCategory::SetFilter, std::tr1::placeholders::_1, std::tr1::ref(re))); + bind(&HotkeyModelCategory::SetFilter, std::placeholders::_1, std::ref(re))); } wxDataViewItem GetParent() const { return wxDataViewItem(0); } @@ -305,7 +305,7 @@ bool HotkeyDataViewModel::IsContainer(wxDataViewItem const& item) const { bool HotkeyDataViewModel::SetValue(wxVariant const& variant, wxDataViewItem const& item, unsigned int col) { if (!has_pending_changes) { has_pending_changes = true; - parent->AddPendingChange(std::tr1::bind(&HotkeyDataViewModel::Apply, this)); + parent->AddPendingChange(std::bind(&HotkeyDataViewModel::Apply, this)); } return get(item)->SetValue(variant, col); } @@ -329,7 +329,7 @@ void HotkeyDataViewModel::Delete(wxDataViewItem const& item) { if (!has_pending_changes) { has_pending_changes = true; - parent->AddPendingChange(std::tr1::bind(&HotkeyDataViewModel::Apply, this)); + parent->AddPendingChange(std::bind(&HotkeyDataViewModel::Apply, this)); } } diff --git a/aegisub/src/menu.cpp b/aegisub/src/menu.cpp index 430cb32d85c0a353d4e7e50de93bb7c6f21bfd8f..1b70e45406ab26c4430a604752af9149f8e0dfeb 100644 --- a/aegisub/src/menu.cpp +++ b/aegisub/src/menu.cpp @@ -51,8 +51,8 @@ namespace { /// Window ID of first menu item static const int MENU_ID_BASE = 10000; -using std::tr1::placeholders::_1; -using std::tr1::bind; +using std::placeholders::_1; +using std::bind; class MruMenu : public wxMenu { std::string type; diff --git a/aegisub/src/mkv_wrap.cpp b/aegisub/src/mkv_wrap.cpp index fa1e861055d5ce19b00d35669ef61835bdda4dfe..db4daa2272d123cde6ea4516fbd4ae1454ddf233 100644 --- a/aegisub/src/mkv_wrap.cpp +++ b/aegisub/src/mkv_wrap.cpp @@ -220,7 +220,7 @@ void MatroskaWrapper::GetSubtitles(wxString const& filename, AssFile *target) { // Progress bar double totalTime = double(segInfo->Duration) / timecodeScale; DialogProgress progress(NULL, _("Parsing Matroska"), _("Reading subtitles from Matroska file.")); - progress.Run(bind(read_subtitles, std::tr1::placeholders::_1, file, &input, srt, totalTime, &parser)); + progress.Run(bind(read_subtitles, std::placeholders::_1, file, &input, srt, totalTime, &parser)); } catch (...) { mkv_Close(file); diff --git a/aegisub/src/preferences.cpp b/aegisub/src/preferences.cpp index 4f77d0191816d7800e80bcae7bd0010a7979b5ee..4035b3625884e56f669cc6fd5eae68a492d37af1 100644 --- a/aegisub/src/preferences.cpp +++ b/aegisub/src/preferences.cpp @@ -714,7 +714,7 @@ Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences" Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnOK, this, wxID_OK); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnApply, this, wxID_APPLY); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Options"), wxID_HELP); + Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Options"), wxID_HELP); defaultButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnResetDefault, this); } diff --git a/aegisub/src/preferences.h b/aegisub/src/preferences.h index 63d0be4740f99d7f919cd1db97d2e2aa5cc7815d..579ebb19156263af3495d5b2178d55dd3e90f044 100644 --- a/aegisub/src/preferences.h +++ b/aegisub/src/preferences.h @@ -19,7 +19,7 @@ #ifndef AGI_PRE #include <deque> -#include <tr1/functional> +#include <functional> #include <map> #include <wx/dialog.h> @@ -37,7 +37,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(PreferenceNotSupported, PreferencesError, "prefe class Preferences : public wxDialog { public: - typedef std::tr1::function<void ()> Thunk; + typedef std::function<void ()> Thunk; private: wxTreebook *book; wxButton *applyButton; diff --git a/aegisub/src/preferences_base.cpp b/aegisub/src/preferences_base.cpp index 2c56b101ad009d3072971c31b8ef7a8361f5bc78..07a3d775f403322335dfe837c681876895cf92d7 100644 --- a/aegisub/src/preferences_base.cpp +++ b/aegisub/src/preferences_base.cpp @@ -225,7 +225,7 @@ void OptionPage::OptionBrowse(wxFlexGridSizer *flex, const wxString &name, const text->Bind(wxEVT_COMMAND_TEXT_UPDATED, StringUpdater(opt_name, parent)); wxButton *browse = new wxButton(this, -1, _("Browse...")); - browse->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(browse_button, text)); + browse->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(browse_button, text)); wxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL); button_sizer->Add(text, wxSizerFlags(1).Expand()); @@ -260,7 +260,7 @@ void OptionPage::OptionFont(wxSizer *sizer, std::string opt_prefix) { font_size->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, IntUpdater(size_opt->GetName().c_str(), parent)); wxButton *pick_btn = new wxButton(this, -1, _("Choose...")); - pick_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(font_button, parent, font_name, font_size)); + pick_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(font_button, parent, font_name, font_size)); wxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL); button_sizer->Add(font_name, wxSizerFlags(1).Expand()); diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 48fae1fa0d3c6a225e65d5136a1d01183d7b79e7..ddc9e83eee91f69c6ba64662145cb03f2105a0f6 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -35,7 +35,7 @@ #include "config.h" #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #include <wx/button.h> #include <wx/checkbox.h> @@ -105,7 +105,7 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context) , commitId(-1) , undoTimer(GetEventHandler()) { - using std::tr1::bind; + using std::bind; // Top controls TopSizer = new wxBoxSizer(wxHORIZONTAL); @@ -235,7 +235,7 @@ void SubsEditBox::MakeButton(const char *cmd_name) { ToolTipManager::Bind(btn, command->StrHelp(), "Subtitle Edit Box", cmd_name); MiddleBotSizer->Add(btn, wxSizerFlags().Center().Expand()); - btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&SubsEditBox::CallCommand, this, cmd_name)); + btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&SubsEditBox::CallCommand, this, cmd_name)); } wxComboBox *SubsEditBox::MakeComboBox(wxString const& initial_text, int style, void (SubsEditBox::*handler)(wxCommandEvent&), wxString const& tooltip) { @@ -391,7 +391,7 @@ void SubsEditBox::OnUndoTimer(wxTimerEvent&) { template<class T, class setter> void SubsEditBox::SetSelectedRows(setter set, T value, wxString desc, int type, bool amend) { - for_each(sel.begin(), sel.end(), bind(set, std::tr1::placeholders::_1, value)); + for_each(sel.begin(), sel.end(), bind(set, std::placeholders::_1, value)); file_changed_slot.Block(); commitId = c->ass->Commit(desc, type, (amend && desc == lastCommitType) ? commitId : -1, sel.size() == 1 ? *sel.begin() : 0); diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index 2203a34ef8ee0d7cb49382096ca68b76112cef37..f2bac0146d8b72733aaa74c28538fa1e493a625b 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -35,11 +35,8 @@ #include "config.h" #ifndef AGI_PRE -#ifdef _WIN32 #include <functional> -#else -#include <tr1/functional> -#endif + #include <wx/clipbrd.h> #include <wx/intl.h> #include <wx/menu.h> @@ -166,7 +163,7 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a proto.Add("fax;Factor"); proto.Add("fay;Factor"); - using namespace std::tr1; + using std::bind; Bind(wxEVT_CHAR_HOOK, &SubsTextEditCtrl::OnKeyDown, this); diff --git a/aegisub/src/subtitle_format.cpp b/aegisub/src/subtitle_format.cpp index 07eda799c73c8b14a48fb13096a68fcc883f4d97..1280511dbf40669f7d1c2d5dbe0040f8493253a0 100644 --- a/aegisub/src/subtitle_format.cpp +++ b/aegisub/src/subtitle_format.cpp @@ -57,7 +57,7 @@ #include "utils.h" #include "video_context.h" -using namespace std::tr1::placeholders; +using namespace std::placeholders; SubtitleFormat::SubtitleFormat(wxString const& name) : name(name) diff --git a/aegisub/src/subtitles_provider_libass.cpp b/aegisub/src/subtitles_provider_libass.cpp index c6e9b5092fc3a5622e2a243c4bb1400bf6741f12..d4022715ce4f9a0fd962e3fee1147507556bd1ed 100644 --- a/aegisub/src/subtitles_provider_libass.cpp +++ b/aegisub/src/subtitles_provider_libass.cpp @@ -124,7 +124,7 @@ static void wait_for_cache_thread(FontConfigCacheThread const * const * const ca if (!*cache_worker) return; DialogProgress progress(wxGetApp().frame, "Updating font index", "This may take several minutes"); - progress.Run(bind(do_wait, std::tr1::placeholders::_1, cache_worker)); + progress.Run(std::bind(do_wait, std::placeholders::_1, cache_worker)); } /// @brief Constructor diff --git a/aegisub/src/threaded_frame_source.cpp b/aegisub/src/threaded_frame_source.cpp index 36f98c892923bcbb367494e2c1389a1aafd79274..5a4f219428760d4d9a914c284f169862197d302f 100644 --- a/aegisub/src/threaded_frame_source.cpp +++ b/aegisub/src/threaded_frame_source.cpp @@ -65,8 +65,8 @@ static void delete_frame(AegiVideoFrame *frame) { delete frame; } -std::tr1::shared_ptr<AegiVideoFrame> ThreadedFrameSource::ProcFrame(int frameNum, double time, bool raw) { - std::tr1::shared_ptr<AegiVideoFrame> frame(new AegiVideoFrame, delete_frame); +std::shared_ptr<AegiVideoFrame> ThreadedFrameSource::ProcFrame(int frameNum, double time, bool raw) { + std::shared_ptr<AegiVideoFrame> frame(new AegiVideoFrame, delete_frame); { wxMutexLocker locker(providerMutex); try { @@ -225,7 +225,7 @@ void ThreadedFrameSource::RequestFrame(int frame, double time) throw() { jobReady.Signal(); } -std::tr1::shared_ptr<AegiVideoFrame> ThreadedFrameSource::GetFrame(int frame, double time, bool raw) { +std::shared_ptr<AegiVideoFrame> ThreadedFrameSource::GetFrame(int frame, double time, bool raw) { return ProcFrame(frame, time, raw); } diff --git a/aegisub/src/threaded_frame_source.h b/aegisub/src/threaded_frame_source.h index 29021b4c9dec83d7a937ef55f4482afdcd2c5897..c9ddd5c0a374ac29cb1c5c89a1e2204c326b95d8 100644 --- a/aegisub/src/threaded_frame_source.h +++ b/aegisub/src/threaded_frame_source.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include <tr1/memory> +#include <memory> #include <wx/event.h> #include <wx/thread.h> @@ -78,7 +78,7 @@ class ThreadedFrameSource : public wxThread { bool run; ///< Should the thread continue to run void *Entry(); - std::tr1::shared_ptr<AegiVideoFrame> ProcFrame(int frameNum, double time, bool raw = false); + std::shared_ptr<AegiVideoFrame> ProcFrame(int frameNum, double time, bool raw = false); public: /// @brief Load the passed subtitle file /// @param subs File to load @@ -99,7 +99,7 @@ public: /// @brief frame Frame number /// @brief time Exact start time of the frame in seconds /// @brief raw Get raw frame without subtitles - std::tr1::shared_ptr<AegiVideoFrame> GetFrame(int frame, double time, bool raw = false); + std::shared_ptr<AegiVideoFrame> GetFrame(int frame, double time, bool raw = false); /// Get a reference to the video provider this is using VideoProvider *GetVideoProvider() const { return videoProvider.get(); } @@ -116,11 +116,11 @@ public: class FrameReadyEvent : public wxEvent { public: /// Frame which is ready - std::tr1::shared_ptr<AegiVideoFrame> frame; + std::shared_ptr<AegiVideoFrame> frame; /// Time which was used for subtitle rendering double time; wxEvent *Clone() const { return new FrameReadyEvent(*this); }; - FrameReadyEvent(std::tr1::shared_ptr<AegiVideoFrame> frame, double time) + FrameReadyEvent(std::shared_ptr<AegiVideoFrame> frame, double time) : frame(frame), time(time) { } }; diff --git a/aegisub/src/timeedit_ctrl.cpp b/aegisub/src/timeedit_ctrl.cpp index acefe6a2add2c40e9ba08609e19c934d0ea0a91b..fa8b76fe7f87493283b9ea8d012c7903f6980fdc 100644 --- a/aegisub/src/timeedit_ctrl.cpp +++ b/aegisub/src/timeedit_ctrl.cpp @@ -37,7 +37,7 @@ #include "timeedit_ctrl.h" #ifndef AGI_PRE -#include <tr1/functional> +#include <functional> #include <wx/clipbrd.h> #include <wx/dataobj.h> @@ -88,8 +88,8 @@ TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const wxStr // Other stuff if (!value) SetValue(time.GetAssFormated()); - Bind(wxEVT_COMMAND_MENU_SELECTED, std::tr1::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy); - Bind(wxEVT_COMMAND_MENU_SELECTED, std::tr1::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste); + Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy); + Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste); Bind(wxEVT_COMMAND_TEXT_UPDATED, &TimeEdit::OnModified, this); Bind(wxEVT_CONTEXT_MENU, &TimeEdit::OnContextMenu, this); Bind(wxEVT_KEY_DOWN, &TimeEdit::OnKeyDown, this); diff --git a/aegisub/src/video_box.cpp b/aegisub/src/video_box.cpp index 91b0e8de3bb745f881e7c34fddaaccec6dcd3d3c..c6b720b7f4cb47f4ebd4d08fe300baf3e38d99f7 100644 --- a/aegisub/src/video_box.cpp +++ b/aegisub/src/video_box.cpp @@ -68,7 +68,7 @@ static void add_button(wxWindow *parent, wxSizer *sizer, const char *command, agi::Context *context) { cmd::Command *c = cmd::get(command); wxBitmapButton *btn = new wxBitmapButton(parent, -1, c->Icon(24)); - btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&cmd::Command::operator(), c, context)); + btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&cmd::Command::operator(), c, context)); ToolTipManager::Bind(btn, c->StrHelp(), "Video", command); sizer->Add(btn, 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2); } diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index e91db03ddbdedb12870104e29931e9e06413baf6..f1814508a1d41762261ae53e68adb3e1e972bfcd 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -290,7 +290,7 @@ void VideoContext::GetFrameAsync(int n) { provider->RequestFrame(n, TimeAtFrame(n) / 1000.0); } -std::tr1::shared_ptr<AegiVideoFrame> VideoContext::GetFrame(int n, bool raw) { +std::shared_ptr<AegiVideoFrame> VideoContext::GetFrame(int n, bool raw) { return provider->GetFrame(n, TimeAtFrame(n) / 1000.0, raw); } diff --git a/aegisub/src/video_context.h b/aegisub/src/video_context.h index 429f6a06566c83fbdee442de6bd15bde164eedd8..5d056bfc98d9d5a41321b41cb605d0aee8e2ea3d 100644 --- a/aegisub/src/video_context.h +++ b/aegisub/src/video_context.h @@ -165,7 +165,7 @@ public: /// @param n Frame number to get /// @param raw If true, subtitles are not rendered on the frame /// @return The requested frame - std::tr1::shared_ptr<AegiVideoFrame> GetFrame(int n, bool raw = false); + std::shared_ptr<AegiVideoFrame> GetFrame(int n, bool raw = false); /// Asynchronously get a video frame, triggering a EVT_FRAME_READY event when it's ready /// @param n Frame number to get diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 3be739e5cfb65ccb1c6480a8d304698eca73350b..1f74adf1ba2caa4c9dc6361ef1cd32bdd7e9226e 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -114,7 +114,7 @@ VideoDisplay::VideoDisplay( slots.push_back(con->ass->AddFileSaveListener(&VideoDisplay::OnSubtitlesSave, this)); - Bind(wxEVT_PAINT, std::tr1::bind(&VideoDisplay::Render, this)); + Bind(wxEVT_PAINT, std::bind(&VideoDisplay::Render, this)); Bind(wxEVT_SIZE, &VideoDisplay::OnSizeEvent, this); Bind(wxEVT_CONTEXT_MENU, &VideoDisplay::OnContextMenu, this); Bind(wxEVT_ENTER_WINDOW, &VideoDisplay::OnMouseEvent, this); diff --git a/aegisub/src/video_display.h b/aegisub/src/video_display.h index c9bf0814068aac45a1185a73f49f8cf8dbfe5192..90b644d437e7c6fcfda10e06c7dc06ad1c5a5fde 100644 --- a/aegisub/src/video_display.h +++ b/aegisub/src/video_display.h @@ -35,7 +35,7 @@ #ifndef AGI_PRE #include <list> -#include <tr1/memory> +#include <memory> #include <wx/glcanvas.h> #endif @@ -115,7 +115,7 @@ class VideoDisplay : public wxGLCanvas { bool freeSize; /// Frame which will replace the currently visible frame on the next render - std::tr1::shared_ptr<AegiVideoFrame> pending_frame; + std::shared_ptr<AegiVideoFrame> pending_frame; /// @brief Draw an overscan mask /// @param horizontal_percent The percent of the video reserved horizontally diff --git a/aegisub/src/video_provider_cache.cpp b/aegisub/src/video_provider_cache.cpp index a11a90eca525d14be61eb8d4c48ce388ea124bb2..7f754d0b63167c21271cb4a3046b854f77f5d636 100644 --- a/aegisub/src/video_provider_cache.cpp +++ b/aegisub/src/video_provider_cache.cpp @@ -41,7 +41,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #endif /// A video frame and its frame number @@ -56,7 +56,7 @@ VideoProviderCache::VideoProviderCache(VideoProvider *parent) } VideoProviderCache::~VideoProviderCache() { - for_each(cache.begin(), cache.end(), std::tr1::mem_fn(&AegiVideoFrame::Clear)); + for_each(cache.begin(), cache.end(), std::mem_fn(&AegiVideoFrame::Clear)); } const AegiVideoFrame VideoProviderCache::GetFrame(int n) { diff --git a/aegisub/src/visual_tool.cpp b/aegisub/src/visual_tool.cpp index b680448145c4732e5c002083410d83f0738c9811..df4dc57a90e716bc5f16b0876c744f120ff9f5af 100644 --- a/aegisub/src/visual_tool.cpp +++ b/aegisub/src/visual_tool.cpp @@ -47,7 +47,7 @@ static void for_each(C &range, F func) { std::for_each(range.begin(), range.end(), func); } -using std::tr1::placeholders::_1; +using std::placeholders::_1; const wxColour VisualToolBase::colour[4] = {wxColour(106,32,19), wxColour(255,169,40), wxColour(255,253,185), wxColour(187,0,0)}; diff --git a/aegisub/src/visual_tool_drag.cpp b/aegisub/src/visual_tool_drag.cpp index 4b0dbaf6a926aad8fafc7edef19db677fb79f34f..0b39d3ba103d5cf73fe994f8417f0e72a3cd46ca 100644 --- a/aegisub/src/visual_tool_drag.cpp +++ b/aegisub/src/visual_tool_drag.cpp @@ -24,7 +24,7 @@ #ifndef AGI_PRE #include <algorithm> -#include <tr1/functional> +#include <functional> #include <wx/bmpbuttn.h> #include <wx/toolbar.h> @@ -160,7 +160,7 @@ template<class T> static bool cmp_line(T const& lft, T const& rgt) { } template<class C, class T> static bool line_not_present(C const& set, T const& it) { - return find_if(set.begin(), set.end(), bind(cmp_line<T>, it, std::tr1::placeholders::_1)) == set.end(); + return find_if(set.begin(), set.end(), bind(cmp_line<T>, it, std::placeholders::_1)) == set.end(); } void VisualToolDrag::OnSelectedSetChanged(const SubtitleSelection &added, const SubtitleSelection &removed) { diff --git a/aegisub/tests/libaegisub_hotkey.cpp b/aegisub/tests/libaegisub_hotkey.cpp index 9c8fed82901560d7fc258a26365d88dd0ceeb63f..0466b4b91774938d70856294321c8f207db3892e 100644 --- a/aegisub/tests/libaegisub_hotkey.cpp +++ b/aegisub/tests/libaegisub_hotkey.cpp @@ -14,9 +14,6 @@ // // $Id$ -// gtest's tr1 tuple implementation lacks tie, and we require tr1 support anyway -#define GTEST_USE_OWN_TR1_TUPLE 0 - #include "main.h" #include "util.h" @@ -188,10 +185,10 @@ TEST(lagi_hotkey, combo_stuff) { Hotkey::HotkeyMap hm = Hotkey("", simple_valid).GetHotkeyMap(); Hotkey::HotkeyMap::const_iterator it, end; - std::tr1::tie(it, end) = hm.equal_range("cmd1"); + std::tie(it, end) = hm.equal_range("cmd1"); EXPECT_EQ(3, std::distance(it, end)); - std::tr1::tie(it, end) = hm.equal_range("cmd2"); + std::tie(it, end) = hm.equal_range("cmd2"); ASSERT_EQ(1, std::distance(it, end)); Combo c = it->second; diff --git a/aegisub/tests/libaegisub_iconv.cpp b/aegisub/tests/libaegisub_iconv.cpp index dea9ecabf9ac37bb8695f1c0c477b7d8e9bae24a..070d68afe9e074733438a7c287cb888278aee6b7 100644 --- a/aegisub/tests/libaegisub_iconv.cpp +++ b/aegisub/tests/libaegisub_iconv.cpp @@ -158,7 +158,7 @@ TEST(lagi_iconv, Iso6937) { // 7-bit is same as ISO-8859 for (int i = 0; i < 128; ++i) { - const char buf[] = { i, 0 }; + const char buf[] = { (char)i, 0 }; std::string ret; EXPECT_NO_THROW(ret = subst.Convert(buf)); EXPECT_STREQ(buf, ret.c_str());