mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Merge namespace signals2 into namespace lyx
This commit is contained in:
parent
b89910af0f
commit
4f0981e7bb
@ -163,7 +163,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// This signal emits an informative message
|
/// This signal emits an informative message
|
||||||
signals2::signal<void(docstring)> message;
|
signal<void(docstring)> message;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,7 +119,7 @@ public:
|
|||||||
ImageStatus status_;
|
ImageStatus status_;
|
||||||
|
|
||||||
/// This signal is emitted when the image loading status changes.
|
/// This signal is emitted when the image loading status changes.
|
||||||
signals2::signal<void()> statusChanged;
|
signal<void()> statusChanged;
|
||||||
|
|
||||||
///
|
///
|
||||||
unique_ptr<Converter> converter_;
|
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);
|
return pimpl_->statusChanged.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,9 @@ public:
|
|||||||
/** Connect and you'll be informed when the loading status of the image
|
/** Connect and you'll be informed when the loading status of the image
|
||||||
* changes.
|
* 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:
|
private:
|
||||||
/// noncopyable
|
/// noncopyable
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
/** At the end of the conversion process inform the outside world
|
/** At the end of the conversion process inform the outside world
|
||||||
* by emitting a signal.
|
* by emitting a signal.
|
||||||
*/
|
*/
|
||||||
typedef signals2::signal<void(bool)> sig;
|
typedef signal<void(bool)> sig;
|
||||||
///
|
///
|
||||||
sig finishedConversion;
|
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);
|
return pimpl_->finishedConversion.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,10 @@ public:
|
|||||||
* If the conversion is successful, then the listener is passed \c true.
|
* If the conversion is successful, then the listener is passed \c true.
|
||||||
* The connection is closed when this is destroyed.
|
* 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;
|
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
|
/** If the conversion is successful, this returns the name of the
|
||||||
* resulting file.
|
* resulting file.
|
||||||
|
@ -192,9 +192,9 @@ public:
|
|||||||
/// We modify a local copy of the image once it is loaded.
|
/// We modify a local copy of the image once it is loaded.
|
||||||
ImagePtr image_;
|
ImagePtr image_;
|
||||||
/// This signal is emitted when the image loading status changes.
|
/// This signal is emitted when the image loading status changes.
|
||||||
signals2::signal<void()> signal_;
|
signal<void()> signal_;
|
||||||
/// The connection of the signal statusChanged
|
/// The connection of the signal statusChanged
|
||||||
signals2::scoped_connection connection_;
|
scoped_connection connection_;
|
||||||
|
|
||||||
double displayPixelRatio() const
|
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);
|
return pimpl_->signal_.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -90,10 +90,10 @@ public:
|
|||||||
/** Connect and you'll be informed when the loading status of the image
|
/** Connect and you'll be informed when the loading status of the image
|
||||||
* changes.
|
* changes.
|
||||||
*/
|
*/
|
||||||
typedef signals2::signal<void()> sig;
|
typedef signal<void()> sig;
|
||||||
typedef sig::slot_type slot;
|
typedef sig::slot_type slot;
|
||||||
///
|
///
|
||||||
signals2::connection connect(slot const &) const;
|
connection connect(slot const &) const;
|
||||||
|
|
||||||
/** The loaded image with Pixmap set.
|
/** The loaded image with Pixmap set.
|
||||||
* If the Pixmap is not yet set (see status() for why...), returns 0.
|
* If the Pixmap is not yet set (see status() for why...), returns 0.
|
||||||
|
@ -180,7 +180,7 @@ public:
|
|||||||
void refreshPreviews();
|
void refreshPreviews();
|
||||||
|
|
||||||
/// Emit this signal when an image is ready for display.
|
/// 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_; }
|
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);
|
return pimpl_->imageReady.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -76,10 +76,10 @@ public:
|
|||||||
* has been created and is ready for loading through
|
* has been created and is ready for loading through
|
||||||
* lyx::graphics::PreviewImage::image().
|
* lyx::graphics::PreviewImage::image().
|
||||||
*/
|
*/
|
||||||
typedef signals2::signal<void(PreviewImage const &)> sig;
|
typedef signal<void(PreviewImage const &)> sig;
|
||||||
typedef sig::slot_type slot;
|
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,
|
/** When PreviewImage has finished loading the image file into memory,
|
||||||
* it tells the PreviewLoader to tell the outside world
|
* it tells the PreviewLoader to tell the outside world
|
||||||
|
@ -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);
|
return changed_.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ private:
|
|||||||
/** Store the connection to the preview loader so that we connect
|
/** Store the connection to the preview loader so that we connect
|
||||||
* only once.
|
* only once.
|
||||||
*/
|
*/
|
||||||
signals2::scoped_connection ploader_connection_;
|
scoped_connection ploader_connection_;
|
||||||
|
|
||||||
/// Inform the core that the inset has changed.
|
/// Inform the core that the inset has changed.
|
||||||
Inset const * parent_;
|
Inset const * parent_;
|
||||||
@ -122,9 +122,9 @@ public:
|
|||||||
|
|
||||||
/// Connect and you'll be informed when the file changes.
|
/// Connect and you'll be informed when the file changes.
|
||||||
/// Do not forget to track objects used by the slot.
|
/// Do not forget to track objects used by the slot.
|
||||||
typedef signals2::signal<void()> sig;
|
typedef signal<void()> sig;
|
||||||
typedef sig::slot_type slot;
|
typedef sig::slot_type slot;
|
||||||
signals2::connection connect(slot const & slot);
|
connection connect(slot const & slot);
|
||||||
|
|
||||||
/// equivalent to dynamic_cast
|
/// equivalent to dynamic_cast
|
||||||
RenderMonitoredPreview * asMonitoredPreview() override { return this; }
|
RenderMonitoredPreview * asMonitoredPreview() override { return this; }
|
||||||
|
@ -188,7 +188,7 @@ void FileMonitor::connectToFileMonitorGuard()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
signals2::connection FileMonitor::connect(slot const & slot)
|
connection FileMonitor::connect(slot const & slot)
|
||||||
{
|
{
|
||||||
return fileChanged_.connect(slot);
|
return fileChanged_.connect(slot);
|
||||||
}
|
}
|
||||||
|
@ -130,10 +130,10 @@ class FileMonitor : public QObject
|
|||||||
public:
|
public:
|
||||||
FileMonitor(std::shared_ptr<FileMonitorGuard> monitor);
|
FileMonitor(std::shared_ptr<FileMonitorGuard> monitor);
|
||||||
|
|
||||||
typedef signals2::signal<void(bool)> sig;
|
typedef signal<void(bool)> sig;
|
||||||
typedef sig::slot_type slot;
|
typedef sig::slot_type slot;
|
||||||
/// Connect and you'll be informed when the file has changed.
|
/// Connect and you'll be informed when the file has changed.
|
||||||
signals2::connection connect(slot const &);
|
connection connect(slot const &);
|
||||||
/// absolute path being tracked
|
/// absolute path being tracked
|
||||||
std::string const & filename() { return monitor_->filename(); }
|
std::string const & filename() { return monitor_->filename(); }
|
||||||
/// Make sure the good file is being monitored, after e.g. a move or a
|
/// Make sure the good file is being monitored, after e.g. a move or a
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
* we can return easily to C++ methods, rather than just globally
|
* we can return easily to C++ methods, rather than just globally
|
||||||
* accessible functions.
|
* accessible functions.
|
||||||
*/
|
*/
|
||||||
typedef signals2::signal<void(pid_t, int)> sig;
|
typedef signal<void(pid_t, int)> sig;
|
||||||
typedef sig::slot_type slot;
|
typedef sig::slot_type slot;
|
||||||
|
|
||||||
/** The signal is connected in the calling routine to the desired
|
/** The signal is connected in the calling routine to the desired
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
/// restart the timer
|
/// restart the timer
|
||||||
void restart();
|
void restart();
|
||||||
/// signal emitted on timer expiry
|
/// signal emitted on timer expiry
|
||||||
signals2::signal<void()> timeout;
|
signal<void()> timeout;
|
||||||
/// emit the signal
|
/// emit the signal
|
||||||
void emit();
|
void emit();
|
||||||
/// set the timer type
|
/// set the timer type
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
namespace signals2 = ::nod;
|
using nod::signal;
|
||||||
|
using nod::connection;
|
||||||
|
using nod::scoped_connection;
|
||||||
|
|
||||||
namespace support {
|
namespace support {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user