Merge namespace signals2 into namespace lyx

This commit is contained in:
Yuriy Skalko 2020-12-14 20:46:39 +02:00
parent b89910af0f
commit 4f0981e7bb
16 changed files with 30 additions and 28 deletions

View File

@ -163,7 +163,7 @@ public:
};
/// This signal emits an informative message
signals2::signal<void(docstring)> message;
signal<void(docstring)> message;
/**

View File

@ -119,7 +119,7 @@ public:
ImageStatus status_;
/// This signal is emitted when the image loading status changes.
signals2::signal<void()> statusChanged;
signal<void()> statusChanged;
///
unique_ptr<Converter> converter_;
@ -195,7 +195,7 @@ ImageStatus CacheItem::status() const
}
signals2::connection CacheItem::connect(slot_type const & slot) const
connection CacheItem::connect(slot_type const & slot) const
{
return pimpl_->statusChanged.connect(slot);
}

View File

@ -81,9 +81,9 @@ public:
/** Connect and you'll be informed when the loading status of the image
* changes.
*/
typedef signals2::signal<void()>::slot_type slot_type;
typedef signal<void()>::slot_type slot_type;
///
signals2::connection connect(slot_type const &) const;
connection connect(slot_type const &) const;
private:
/// noncopyable

View File

@ -55,7 +55,7 @@ public:
/** At the end of the conversion process inform the outside world
* by emitting a signal.
*/
typedef signals2::signal<void(bool)> sig;
typedef signal<void(bool)> sig;
///
sig finishedConversion;
@ -96,7 +96,7 @@ void Converter::startConversion() const
}
signals2::connection Converter::connect(slot_type const & slot) const
connection Converter::connect(slot_type const & slot) const
{
return pimpl_->finishedConversion.connect(slot);
}

View File

@ -48,10 +48,10 @@ public:
* If the conversion is successful, then the listener is passed \c true.
* The connection is closed when this is destroyed.
*/
typedef signals2::signal<void(bool)> sig_type;
typedef signal<void(bool)> sig_type;
typedef sig_type::slot_type slot_type;
///
signals2::connection connect(slot_type const &) const;
connection connect(slot_type const &) const;
/** If the conversion is successful, this returns the name of the
* resulting file.

View File

@ -192,9 +192,9 @@ public:
/// We modify a local copy of the image once it is loaded.
ImagePtr image_;
/// This signal is emitted when the image loading status changes.
signals2::signal<void()> signal_;
signal<void()> signal_;
/// The connection of the signal statusChanged
signals2::scoped_connection connection_;
scoped_connection connection_;
double displayPixelRatio() const
{
@ -364,7 +364,7 @@ void Loader::setDisplayPixelRatio(double scale)
}
signals2::connection Loader::connect(slot const & slot) const
connection Loader::connect(slot const & slot) const
{
return pimpl_->signal_.connect(slot);
}

View File

@ -90,10 +90,10 @@ public:
/** Connect and you'll be informed when the loading status of the image
* changes.
*/
typedef signals2::signal<void()> sig;
typedef signal<void()> sig;
typedef sig::slot_type slot;
///
signals2::connection connect(slot const &) const;
connection connect(slot const &) const;
/** The loaded image with Pixmap set.
* If the Pixmap is not yet set (see status() for why...), returns 0.

View File

@ -180,7 +180,7 @@ public:
void refreshPreviews();
/// Emit this signal when an image is ready for display.
signals2::signal<void(PreviewImage const &)> imageReady;
signal<void(PreviewImage const &)> imageReady;
Buffer const & buffer() const { return buffer_; }
@ -282,7 +282,7 @@ void PreviewLoader::refreshPreviews()
}
signals2::connection PreviewLoader::connect(slot const & slot) const
connection PreviewLoader::connect(slot const & slot) const
{
return pimpl_->imageReady.connect(slot);
}

View File

@ -76,10 +76,10 @@ public:
* has been created and is ready for loading through
* lyx::graphics::PreviewImage::image().
*/
typedef signals2::signal<void(PreviewImage const &)> sig;
typedef signal<void(PreviewImage const &)> sig;
typedef sig::slot_type slot;
///
signals2::connection connect(slot const &) const;
connection connect(slot const &) const;
/** When PreviewImage has finished loading the image file into memory,
* it tells the PreviewLoader to tell the outside world

View File

@ -288,7 +288,7 @@ void RenderMonitoredPreview::draw(PainterInfo & pi, int x, int y, bool const) co
}
signals2::connection RenderMonitoredPreview::connect(slot const & slot)
connection RenderMonitoredPreview::connect(slot const & slot)
{
return changed_.connect(slot);
}

View File

@ -101,7 +101,7 @@ private:
/** Store the connection to the preview loader so that we connect
* only once.
*/
signals2::scoped_connection ploader_connection_;
scoped_connection ploader_connection_;
/// Inform the core that the inset has changed.
Inset const * parent_;
@ -122,9 +122,9 @@ public:
/// Connect and you'll be informed when the file changes.
/// Do not forget to track objects used by the slot.
typedef signals2::signal<void()> sig;
typedef signal<void()> sig;
typedef sig::slot_type slot;
signals2::connection connect(slot const & slot);
connection connect(slot const & slot);
/// equivalent to dynamic_cast
RenderMonitoredPreview * asMonitoredPreview() override { return this; }

View File

@ -188,7 +188,7 @@ void FileMonitor::connectToFileMonitorGuard()
}
signals2::connection FileMonitor::connect(slot const & slot)
connection FileMonitor::connect(slot const & slot)
{
return fileChanged_.connect(slot);
}

View File

@ -130,10 +130,10 @@ class FileMonitor : public QObject
public:
FileMonitor(std::shared_ptr<FileMonitorGuard> monitor);
typedef signals2::signal<void(bool)> sig;
typedef signal<void(bool)> sig;
typedef sig::slot_type slot;
/// Connect and you'll be informed when the file has changed.
signals2::connection connect(slot const &);
connection connect(slot const &);
/// absolute path being tracked
std::string const & filename() { return monitor_->filename(); }
/// Make sure the good file is being monitored, after e.g. a move or a

View File

@ -53,7 +53,7 @@ public:
* we can return easily to C++ methods, rather than just globally
* accessible functions.
*/
typedef signals2::signal<void(pid_t, int)> sig;
typedef signal<void(pid_t, int)> sig;
typedef sig::slot_type slot;
/** The signal is connected in the calling routine to the desired

View File

@ -40,7 +40,7 @@ public:
/// restart the timer
void restart();
/// signal emitted on timer expiry
signals2::signal<void()> timeout;
signal<void()> timeout;
/// emit the signal
void emit();
/// set the timer type

View File

@ -18,7 +18,9 @@
namespace lyx {
namespace signals2 = ::nod;
using nod::signal;
using nod::connection;
using nod::scoped_connection;
namespace support {