diff --git a/aegisub/libaegisub/common/hotkey.cpp b/aegisub/libaegisub/common/hotkey.cpp index a40efe783..e259d51df 100644 --- a/aegisub/libaegisub/common/hotkey.cpp +++ b/aegisub/libaegisub/common/hotkey.cpp @@ -22,12 +22,7 @@ #include #include #include -#endif - -#ifdef _WIN32 #include -#else -#include #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 Hotkey::GetHotkeys(const std::string &context, const st std::vector 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 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 2f009aca8..69e942fa5 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 -#include - -#ifdef _WIN32 +#include #include -#else -#include -#endif +#include #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 task, int priority=-1)=0; + virtual void Run(std::function task, int priority=-1)=0; }; } diff --git a/aegisub/libaegisub/include/libaegisub/exception.h b/aegisub/libaegisub/include/libaegisub/exception.h index 9d8e07efe..cd4f34693 100644 --- a/aegisub/libaegisub/include/libaegisub/exception.h +++ b/aegisub/libaegisub/include/libaegisub/exception.h @@ -34,12 +34,8 @@ #pragma once -#include -#ifdef _WIN32 #include -#else -#include -#endif +#include /// @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 inner; + std::shared_ptr inner; protected: diff --git a/aegisub/libaegisub/include/libaegisub/line_iterator.h b/aegisub/libaegisub/include/libaegisub/line_iterator.h index 44fe62f96..eceaaa2eb 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 -#ifdef _WIN32 #include -#else -#include -#endif #include #include @@ -42,7 +38,7 @@ class line_iterator : public std::iterator 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 conv; + std::shared_ptr 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 fe95a7898..88aa20e96 100644 --- a/aegisub/libaegisub/include/libaegisub/signal.h +++ b/aegisub/libaegisub/include/libaegisub/signal.h @@ -21,19 +21,14 @@ #ifndef LAGI_PRE #include -#ifdef _WIN32 #include #include -#else -#include -#include -#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 token; + std::shared_ptr token; public: Connection() { } Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; } @@ -167,15 +162,15 @@ namespace detail { } template UnscopedConnection Connect(F func, Arg1 a1) { - return Connect(std::tr1::bind(func, a1)); + return Connect(std::bind(func, a1)); } template UnscopedConnection Connect(F func, Arg1 a1, Arg2 a2) { - return Connect(std::tr1::bind(func, a1, a2)); + return Connect(std::bind(func, a1, a2)); } template 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 Signal : public detail::SignalBaseImpl > { - typedef detail::SignalBaseImpl > super; +class Signal : public detail::SignalBaseImpl > { + typedef detail::SignalBaseImpl > super; using super::Blocked; using super::slots; public: @@ -220,7 +215,7 @@ public: /// sig.Connect(&Class::Foo, this, _1, _2) template 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 Signal : public detail::SignalBaseImpl > { - typedef detail::SignalBaseImpl > super; +class Signal : public detail::SignalBaseImpl > { + typedef detail::SignalBaseImpl > 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 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 : public detail::SignalBaseImpl > { - typedef detail::SignalBaseImpl > super; +class Signal : public detail::SignalBaseImpl > { + typedef detail::SignalBaseImpl > super; using super::Blocked; using super::slots; public: diff --git a/aegisub/libaegisub/lagi_pre.h b/aegisub/libaegisub/lagi_pre.h index bba770bac..4e8d48080 100644 --- a/aegisub/libaegisub/lagi_pre.h +++ b/aegisub/libaegisub/lagi_pre.h @@ -33,26 +33,22 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include #include #include +#include #include -#ifdef _WIN32 -#include -#include -#else -#include -#include -#endif // Boost #include diff --git a/aegisub/src/agi_pre.h b/aegisub/src/agi_pre.h index 821c83de1..2ae26a4f5 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 -#else -#include -#endif - #include #include #include diff --git a/aegisub/src/ass_attachment.h b/aegisub/src/ass_attachment.h index a79a0fd08..17168f4ea 100644 --- a/aegisub/src/ass_attachment.h +++ b/aegisub/src/ass_attachment.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include +#include #include #endif @@ -43,7 +43,7 @@ /// @brief DOCME class AssAttachment : public AssEntry { /// Decoded file data - std::tr1::shared_ptr > data; + std::shared_ptr > 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 29490c46d..e7dea9ae9 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include +#include #include #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 Margin; ///< Left/Right/Vertical + std::array 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 fe5d15e65..249ea7098 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 +#include #endif #include "ass_style.h" diff --git a/aegisub/src/audio_karaoke.cpp b/aegisub/src/audio_karaoke.cpp index 325449a66..91724dde2 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 9b0279ea8..f1ad633a2 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 810ac593f..4af93354e 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 dbe9f6efe..a74f8d0db 100644 --- a/aegisub/src/audio_renderer.cpp +++ b/aegisub/src/audio_renderer.cpp @@ -39,7 +39,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -52,7 +52,7 @@ template 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 c82329b74..52c2ccce0 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 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 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 0081e21bf..bf346143f 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 3ed097d17..9c8d273a9 100644 --- a/aegisub/src/auto4_base.cpp +++ b/aegisub/src/auto4_base.cpp @@ -39,6 +39,8 @@ #ifndef AGI_PRE #ifdef __WINDOWS__ #include +#define WIN32_LEAN_AND_MEAN +#include #endif #include @@ -50,14 +52,8 @@ #include #include #include -#endif -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include #include -#else -#include #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 payload = evt.GetPayload >(); *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 task, agi::ProgressSink *ps, BackgroundScriptRunner *bsr) + static void progress_sink_wrapper(std::function task, agi::ProgressSink *ps, BackgroundScriptRunner *bsr) { ProgressSink aps(ps, bsr); task(&aps); } - void BackgroundScriptRunner::Run(std::tr1::function task) + void BackgroundScriptRunner::Run(std::function 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::Factories() diff --git a/aegisub/src/auto4_base.h b/aegisub/src/auto4_base.h index 8d60e4747..292348c89 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 task); + void Run(std::function task); BackgroundScriptRunner(wxWindow *parent, wxString const& title); ~BackgroundScriptRunner(); diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index c4b4dae26..40219bfe2 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 1f077877f..feccc7538 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 46df7e5af..9c07b14ce 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 f93d00106..48d6931e6 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 10808dcc7..cf4ede75f 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 callback; + std::function callback; public: - DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::tr1::function callback); + DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::function 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 callback) +bool GetColorFromUser(wxWindow* parent, agi::Color original, std::function 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 callback) +DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color, std::function 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 f810b5d08..a64e5e37d 100644 --- a/aegisub/src/dialog_colorpicker.h +++ b/aegisub/src/dialog_colorpicker.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include +#include #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 callback); +bool GetColorFromUser(wxWindow* parent, agi::Color original, std::function 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 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 2d0ab7c2f..5f56e6d41 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 +#include #include #include @@ -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 79644f2cb..2b4666abc 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 921cd1b22..d5eddc776 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 4208f603a..5568b54fd 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 1e38cc236..b8cabc7d9 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 826b1caf6..e956d72f9 100644 --- a/aegisub/src/dialog_log.cpp +++ b/aegisub/src/dialog_log.cpp @@ -39,7 +39,7 @@ #ifndef AGI_PRE #include #include -#include +#include #include #include @@ -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 d40254567..ed973efe0 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 +#include #include #include @@ -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 548ce1f02..a6c17b78c 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 task; + std::function task; agi::ProgressSink *ps; wxDialog *dialog; public: - TaskRunner(std::tr1::function task, agi::ProgressSink *ps, wxDialog *dialog, int priority) + TaskRunner(std::function 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 task, int priority) { +void DialogProgress::Run(std::function 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 a08c55793..40dac705c 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 task, int priority=-1); + void Run(std::function task, int priority=-1); }; diff --git a/aegisub/src/dialog_properties.cpp b/aegisub/src/dialog_properties.cpp index cff7a1410..63f00f27a 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 c8845f989..a1797d1d3 100644 --- a/aegisub/src/dialog_resample.cpp +++ b/aegisub/src/dialog_resample.cpp @@ -23,7 +23,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -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 5d69f16b7..0f5fa755c 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 902ebb545..2afc738b3 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 get_predicate(int mode, wxRegEx *re, bool match_case, wxString const& match_text) { - using std::tr1::placeholders::_1; +std::function 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 process(wxString match_text, bool match_case, int } wxString AssDialogue::*field = get_field(field_n); - std::tr1::function pred = get_predicate(mode, &re, match_case, match_text); + std::function pred = get_predicate(mode, &re, match_case, match_text); std::set 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 4a8395c9f..911dc3312 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 10ddab4ee..98b7a5e9c 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 02cca8797..a67083140 100644 --- a/aegisub/src/dialog_style_manager.cpp +++ b/aegisub/src/dialog_style_manager.cpp @@ -37,7 +37,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -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 2c1096346..aa48581e2 100644 --- a/aegisub/src/dialog_timing_processor.cpp +++ b/aegisub/src/dialog_timing_processor.cpp @@ -38,7 +38,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -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 484788137..f8940f7f2 100644 --- a/aegisub/src/dialog_version_check.cpp +++ b/aegisub/src/dialog_version_check.cpp @@ -64,9 +64,9 @@ #include #include +#include #include #include -#include #include #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 5cafcfb66..59dcc0aff 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 c6209366a..1b68b4725 100644 --- a/aegisub/src/font_file_lister.cpp +++ b/aegisub/src/font_file_lister.cpp @@ -35,7 +35,7 @@ #include #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 5582ea66a..a378371c0 100644 --- a/aegisub/src/font_file_lister.h +++ b/aegisub/src/font_file_lister.h @@ -24,7 +24,7 @@ #ifndef AGI_PRE #include #include -#include +#include #include #include @@ -34,7 +34,7 @@ class AssDialogue; class AssFile; -typedef std::tr1::function FontCollectorStatusCallback; +typedef std::function FontCollectorStatusCallback; /// @class FontFileLister /// @brief Font lister interface diff --git a/aegisub/src/gl_text.cpp b/aegisub/src/gl_text.cpp index 5a230fd7f..7da92756a 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(new OpenGLTextTexture(glyph))); + textures.push_back(std::shared_ptr(new OpenGLTextTexture(glyph))); } return glyph; diff --git a/aegisub/src/gl_text.h b/aegisub/src/gl_text.h index 2199afac1..ef3e0c4cf 100644 --- a/aegisub/src/gl_text.h +++ b/aegisub/src/gl_text.h @@ -35,7 +35,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -86,7 +86,7 @@ class OpenGLText { glyphMap glyphs; /// DOCME - std::vector > textures; + std::vector > textures; OpenGLText(OpenGLText const&); OpenGLText& operator=(OpenGLText const&); diff --git a/aegisub/src/help_button.cpp b/aegisub/src/help_button.cpp index e9513782a..ed0c71045 100644 --- a/aegisub/src/help_button.cpp +++ b/aegisub/src/help_button.cpp @@ -38,8 +38,8 @@ #ifndef AGI_PRE #include +#include #include -#include #include #include @@ -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 ec1b7ada0..7e111e1cd 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 430cb32d8..1b70e4540 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 fa1e86105..db4daa227 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 4f77d0191..4035b3625 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 63d0be474..579ebb191 100644 --- a/aegisub/src/preferences.h +++ b/aegisub/src/preferences.h @@ -19,7 +19,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -37,7 +37,7 @@ DEFINE_SIMPLE_EXCEPTION_NOINNER(PreferenceNotSupported, PreferencesError, "prefe class Preferences : public wxDialog { public: - typedef std::tr1::function Thunk; + typedef std::function Thunk; private: wxTreebook *book; wxButton *applyButton; diff --git a/aegisub/src/preferences_base.cpp b/aegisub/src/preferences_base.cpp index 2c56b101a..07a3d775f 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 48fae1fa0..ddc9e83ee 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 +#include #include #include @@ -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 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 2203a34ef..f2bac0146 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 -#else -#include -#endif + #include #include #include @@ -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 07eda799c..1280511db 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 c6e9b5092..d4022715c 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 36f98c892..5a4f21942 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 ThreadedFrameSource::ProcFrame(int frameNum, double time, bool raw) { - std::tr1::shared_ptr frame(new AegiVideoFrame, delete_frame); +std::shared_ptr ThreadedFrameSource::ProcFrame(int frameNum, double time, bool raw) { + std::shared_ptr 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 ThreadedFrameSource::GetFrame(int frame, double time, bool raw) { +std::shared_ptr 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 29021b4c9..c9ddd5c0a 100644 --- a/aegisub/src/threaded_frame_source.h +++ b/aegisub/src/threaded_frame_source.h @@ -33,7 +33,7 @@ /// #ifndef AGI_PRE -#include +#include #include #include @@ -78,7 +78,7 @@ class ThreadedFrameSource : public wxThread { bool run; ///< Should the thread continue to run void *Entry(); - std::tr1::shared_ptr ProcFrame(int frameNum, double time, bool raw = false); + std::shared_ptr 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 GetFrame(int frame, double time, bool raw = false); + std::shared_ptr 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 frame; + std::shared_ptr frame; /// Time which was used for subtitle rendering double time; wxEvent *Clone() const { return new FrameReadyEvent(*this); }; - FrameReadyEvent(std::tr1::shared_ptr frame, double time) + FrameReadyEvent(std::shared_ptr frame, double time) : frame(frame), time(time) { } }; diff --git a/aegisub/src/timeedit_ctrl.cpp b/aegisub/src/timeedit_ctrl.cpp index acefe6a2a..fa8b76fe7 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 +#include #include #include @@ -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 91b0e8de3..c6b720b7f 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 e91db03dd..f1814508a 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 VideoContext::GetFrame(int n, bool raw) { +std::shared_ptr 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 429f6a065..5d056bfc9 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 GetFrame(int n, bool raw = false); + std::shared_ptr 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 3be739e5c..1f74adf1b 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 c9bf08140..90b644d43 100644 --- a/aegisub/src/video_display.h +++ b/aegisub/src/video_display.h @@ -35,7 +35,7 @@ #ifndef AGI_PRE #include -#include +#include #include #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 pending_frame; + std::shared_ptr 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 a11a90eca..7f754d0b6 100644 --- a/aegisub/src/video_provider_cache.cpp +++ b/aegisub/src/video_provider_cache.cpp @@ -41,7 +41,7 @@ #ifndef AGI_PRE #include -#include +#include #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 b68044814..df4dc57a9 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 4b0dbaf6a..0b39d3ba1 100644 --- a/aegisub/src/visual_tool_drag.cpp +++ b/aegisub/src/visual_tool_drag.cpp @@ -24,7 +24,7 @@ #ifndef AGI_PRE #include -#include +#include #include #include @@ -160,7 +160,7 @@ template static bool cmp_line(T const& lft, T const& rgt) { } template static bool line_not_present(C const& set, T const& it) { - return find_if(set.begin(), set.end(), bind(cmp_line, it, std::tr1::placeholders::_1)) == set.end(); + return find_if(set.begin(), set.end(), bind(cmp_line, 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 9c8fed829..0466b4b91 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 dea9ecabf..070d68afe 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());