Remove references to tr1

This commit is contained in:
Thomas Goyne 2012-09-24 16:35:27 -07:00
parent 4500edef39
commit 0893ed3f0a
71 changed files with 180 additions and 223 deletions

View file

@ -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")

View file

@ -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;
};
}

View file

@ -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:

View file

@ -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

View file

@ -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:

View file

@ -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>

View file

@ -53,12 +53,7 @@
#define AGI_PRE
// General headers
#ifdef _WIN32
#include <array>
#else
#include <tr1/array>
#endif
#include <clocale>
#include <cstdlib>
#include <cctype>

View file

@ -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;

View file

@ -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

View file

@ -37,7 +37,7 @@
#include "ass_style_storage.h"
#ifndef AGI_PRE
#include <tr1/functional>
#include <functional>
#endif
#include "ass_style.h"

View file

@ -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);
}

View file

@ -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));
}

View file

@ -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() {

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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();

View file

@ -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()

View file

@ -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();

View file

@ -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");
}

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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));

View file

@ -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));
}

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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);
};

View file

@ -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);

View file

@ -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));

View file

@ -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() {

View file

@ -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() {

View file

@ -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);