mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 21:22:31 +00:00
Converted sigc++ slots to std::tr1::function.
This commit is contained in:
+16
-16
@@ -38,31 +38,31 @@
|
||||
#define RTORRENT_INPUT_BINDINGS_H
|
||||
|
||||
#include <map>
|
||||
#include <sigc++/functors/slot.h>
|
||||
#include <tr1/functional>
|
||||
|
||||
#include "display/attributes.h"
|
||||
|
||||
namespace input {
|
||||
|
||||
class Bindings : private std::map<int, sigc::slot0<void> > {
|
||||
class Bindings : private std::map<int, std::tr1::function<void ()> > {
|
||||
public:
|
||||
typedef sigc::slot0<void> Slot;
|
||||
typedef std::map<int, Slot > Base;
|
||||
typedef std::tr1::function<void ()> slot_void;
|
||||
typedef std::map<int, slot_void> base_type;
|
||||
|
||||
using Base::iterator;
|
||||
using Base::const_iterator;
|
||||
using Base::reverse_iterator;
|
||||
using Base::const_reverse_iterator;
|
||||
using base_type::iterator;
|
||||
using base_type::const_iterator;
|
||||
using base_type::reverse_iterator;
|
||||
using base_type::const_reverse_iterator;
|
||||
|
||||
using Base::begin;
|
||||
using Base::end;
|
||||
using Base::rbegin;
|
||||
using Base::rend;
|
||||
using Base::find;
|
||||
using base_type::begin;
|
||||
using base_type::end;
|
||||
using base_type::rbegin;
|
||||
using base_type::rend;
|
||||
using base_type::find;
|
||||
|
||||
using Base::erase;
|
||||
using base_type::erase;
|
||||
|
||||
using Base::operator[];
|
||||
using base_type::operator[];
|
||||
|
||||
Bindings() : m_enabled(true) {}
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
bool pressed(int key);
|
||||
|
||||
void ignore(int key) { (*this)[key] = Slot(); }
|
||||
void ignore(int key) { (*this)[key] = slot_void(); }
|
||||
|
||||
private:
|
||||
bool m_enabled;
|
||||
|
||||
@@ -37,15 +37,15 @@
|
||||
#ifndef RTORRENT_INPUT_INPUT_EVENT_H
|
||||
#define RTORRENT_INPUT_INPUT_EVENT_H
|
||||
|
||||
#include <sigc++/functors/slot.h>
|
||||
#include <torrent/event.h>
|
||||
#include <torrent/poll.h>
|
||||
#include <tr1/functional>
|
||||
|
||||
namespace input {
|
||||
|
||||
class InputEvent : public torrent::Event {
|
||||
public:
|
||||
typedef sigc::slot<void, int> SlotInt;
|
||||
typedef std::tr1::function<void (int)> slot_int;
|
||||
|
||||
InputEvent(int fd) { m_fileDesc = fd; }
|
||||
|
||||
@@ -56,10 +56,10 @@ public:
|
||||
void event_write();
|
||||
void event_error();
|
||||
|
||||
void slot_pressed(SlotInt s) { m_slotPressed = s; }
|
||||
void slot_pressed(slot_int s) { m_slotPressed = s; }
|
||||
|
||||
private:
|
||||
SlotInt m_slotPressed;
|
||||
slot_int m_slotPressed;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ TextInput::pressed(int key) {
|
||||
}
|
||||
}
|
||||
|
||||
m_slotDirty();
|
||||
mark_dirty();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ namespace input {
|
||||
|
||||
class TextInput : private std::string {
|
||||
public:
|
||||
typedef std::string Base;
|
||||
typedef sigc::slot0<void> SlotDirty;
|
||||
typedef std::string Base;
|
||||
typedef std::tr1::function<void ()> slot_void;
|
||||
|
||||
using Base::c_str;
|
||||
using Base::empty;
|
||||
@@ -64,8 +64,8 @@ public:
|
||||
|
||||
void clear() { m_pos = 0; m_alt = false; Base::clear(); }
|
||||
|
||||
void slot_dirty(SlotDirty s) { m_slotDirty = s; }
|
||||
void mark_dirty() { m_slotDirty(); }
|
||||
void slot_dirty(slot_void s) { m_slot_dirty = s; }
|
||||
void mark_dirty() { if (m_slot_dirty) m_slot_dirty(); }
|
||||
|
||||
std::string& str() { return *this; }
|
||||
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
size_type m_pos;
|
||||
|
||||
bool m_alt;
|
||||
SlotDirty m_slotDirty;
|
||||
slot_void m_slot_dirty;
|
||||
|
||||
Bindings m_bindings;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user