From ec94b42f515c771687a2f0b8ba9fb306081aaf47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sun, 26 Sep 2004 14:19:47 +0000 Subject: [PATCH] Use the preferred calling for Boost.Signal git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9010 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 +++++++ src/LaTeX.h | 4 ++-- src/buffer.h | 17 ++++++++--------- src/frontends/ChangeLog | 9 +++++++++ src/frontends/Dialogs.C | 8 ++++---- src/frontends/Dialogs.h | 7 +++---- src/frontends/LyXView.h | 8 ++++---- src/frontends/Timeout.h | 4 ++-- src/frontends/WorkArea.h | 16 +++++++--------- src/frontends/pch.h | 3 --- src/frontends/qt2/lyx_gui.C | 10 +++++----- src/frontends/xforms/ChangeLog | 7 +++++++ src/frontends/xforms/Tooltips.C | 2 +- src/frontends/xforms/Tooltips.h | 4 ++-- src/frontends/xforms/XFormsView.h | 4 ++-- src/frontends/xforms/pch.h | 2 +- src/graphics/ChangeLog | 10 ++++++++++ src/graphics/GraphicsCacheItem.C | 2 +- src/graphics/GraphicsCacheItem.h | 5 +++-- src/graphics/GraphicsConverter.C | 2 +- src/graphics/GraphicsConverter.h | 5 +++-- src/graphics/GraphicsImage.h | 6 +++--- src/graphics/GraphicsLoader.C | 2 +- src/graphics/GraphicsLoader.h | 5 +++-- src/graphics/PreviewLoader.C | 2 +- src/graphics/PreviewLoader.h | 5 +++-- src/graphics/pch.h | 3 +-- src/insets/ChangeLog | 6 ++++++ src/insets/pch.h | 2 +- src/insets/render_preview.h | 4 ++-- src/pch.h | 4 +--- src/support/ChangeLog | 11 +++++++++++ src/support/FileMonitor.C | 2 +- src/support/FileMonitor.h | 5 +++-- src/support/forkedcall.h | 4 ++-- src/support/forkedcallqueue.C | 1 - src/support/pch.h | 3 +-- 37 files changed, 122 insertions(+), 79 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5beb1f6a2f..94aa061314 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-09-26 Lars Gullik Bjonnes + + * pch.h: use proper signal include + + * LaTeX.h: Use preferred calling of Boost.Signal + * buffer.h: ditto + 2004-09-26 Lars Gullik Bjonnes * pch.h: dont include diff --git a/src/LaTeX.h b/src/LaTeX.h index 7675e039fd..fb2bd7c56b 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -17,7 +17,7 @@ #include "outputparams.h" #include -#include +#include #include #include @@ -125,7 +125,7 @@ public: }; /// This signal emits an informative message - boost::signal1 message; + boost::signal message; /** diff --git a/src/buffer.h b/src/buffer.h index 20dd748ef0..7e91df0a09 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -18,8 +18,7 @@ #include "support/types.h" #include -#include -#include +#include #include #include @@ -107,19 +106,19 @@ public: bool hasParWithID(int id) const; /// This signal is emitted when a parsing error shows up. - boost::signal1 error; + boost::signal error; /// This signal is emitted when some message shows up. - boost::signal1 message; + boost::signal message; /// This signal is emitted when the buffer busy status change. - boost::signal1 busy; + boost::signal busy; /// This signal is emitted when the buffer readonly status change. - boost::signal1 readonly; + boost::signal readonly; /// Update window titles of all users. - boost::signal0 updateTitles; + boost::signal updateTitles; /// Reset autosave timers for all users. - boost::signal0 resetAutosaveTimers; + boost::signal resetAutosaveTimers; /// This signal is emitting if the buffer is being closed. - boost::signal0 closing; + boost::signal closing; /** Save file. diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 3d1677611d..257fb188b4 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,12 @@ +2004-09-26 Lars Gullik Bjonnes + + * pch.h: include proper signal include + + * Dialogs.[Ch]: User preferred calling of Boost.Signal + * LyXView.h: ditto + * Timeout.h: ditto + * WorkArea.h: ditto + 2004-08-15 Lars Gullik Bjonnes * pch.h: new file diff --git a/src/frontends/Dialogs.C b/src/frontends/Dialogs.C index 328d73e562..0c222c045e 100644 --- a/src/frontends/Dialogs.C +++ b/src/frontends/Dialogs.C @@ -16,7 +16,7 @@ #include "controllers/Dialog.h" -#include +#include #include @@ -44,16 +44,16 @@ private: }; -boost::signal0 & Dialogs::redrawGUI() +boost::signal & Dialogs::redrawGUI() { - static BugfixSignal > thesignal; + static BugfixSignal > thesignal; return thesignal(); } namespace { -BugfixSignal > hideSignal; +BugfixSignal > hideSignal; } diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 71135cf480..8da237ecd5 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -13,8 +13,8 @@ #ifndef DIALOGS_H #define DIALOGS_H +#include #include -#include class InsetBase; class LyXView; @@ -27,8 +27,7 @@ class Dialog; /** Container of all dialogs. */ -class Dialogs : boost::noncopyable -{ +class Dialogs : boost::noncopyable { public: /// Dialogs(LyXView &); @@ -39,7 +38,7 @@ public: * Note that static boost signals break some compilers, so we return a * reference to some hidden magic ;-) */ - static boost::signal0 & redrawGUI(); + static boost::signal & redrawGUI(); /// Toggle tooltips on/off in all dialogs. static void toggleTooltips(); diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index 3f2acfe952..89b44c7dd4 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -13,11 +13,11 @@ #ifndef LYXVIEW_H #define LYXVIEW_H -#include #include #include +#include #include -#include +#include class Buffer; class Toolbars; @@ -117,10 +117,10 @@ public: void updateMenubar(); /// focus the command buffer (minibuffer) - boost::signal0 focus_command_buffer; + boost::signal focus_command_buffer; /// view state string changed - boost::signal0 view_state_changed; + boost::signal view_state_changed; /// display a message in the view virtual void message(std::string const &) = 0; diff --git a/src/frontends/Timeout.h b/src/frontends/Timeout.h index e642a989e1..27089946eb 100644 --- a/src/frontends/Timeout.h +++ b/src/frontends/Timeout.h @@ -13,7 +13,7 @@ #ifndef TIMEOUT_H #define TIMEOUT_H -#include +#include /** @@ -39,7 +39,7 @@ public: /// restart the timer void restart(); /// signal emitted on timer expiry - boost::signal0 timeout; + boost::signal timeout; /// emit the signal void emit(); /// set the timer type diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index b54e3145a4..e1fb7fffb7 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -16,9 +16,7 @@ #include "frontends/key_state.h" #include -#include -#include -#include +#include class Painter; @@ -65,17 +63,17 @@ public: virtual void putClipboard(std::string const &) const = 0; /// work area dimensions have changed - boost::signal0 workAreaResize; + boost::signal workAreaResize; /// the scrollbar has changed - boost::signal1 scrollDocView; + boost::signal scrollDocView; /// a key combination has been pressed - boost::signal2 workAreaKeyPress; + boost::signal workAreaKeyPress; /// some mouse event - boost::signal1 dispatch; + boost::signal dispatch; /// emitted when an X client has requested our selection - boost::signal0 selectionRequested; + boost::signal selectionRequested; /// emitted when another X client has stolen our selection - boost::signal0 selectionLost; + boost::signal selectionLost; }; #endif // WORKAREA_H diff --git a/src/frontends/pch.h b/src/frontends/pch.h index 9a902861fb..2a173f2b34 100644 --- a/src/frontends/pch.h +++ b/src/frontends/pch.h @@ -4,9 +4,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index fadcac418e..7cbbaea2ea 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -34,7 +34,7 @@ // Dear Lord, deliver us from Evil, aka the Qt headers // Qt defines a macro 'signals' that clashes with a boost namespace. // All is well if the namespace is visible first. -#include +#include // FIXME: Is this needed? (Lgb) #include #include @@ -179,13 +179,13 @@ void parse_init(int & argc, char * argv[]) // algorithm on some entries. It lists the menu names that // should not be moved to the LyX menu static QTranslator aqua_trans(0); - aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setting", 0, + aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setting", 0, "do_not_merge_me")); - aqua_trans.insert(QTranslatorMessage("QMenuBar", "Config", 0, + aqua_trans.insert(QTranslatorMessage("QMenuBar", "Config", 0, "do_not_merge_me")); - aqua_trans.insert(QTranslatorMessage("QMenuBar", "Options", 0, + aqua_trans.insert(QTranslatorMessage("QMenuBar", "Options", 0, "do_not_merge_me")); - aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setup", 0, + aqua_trans.insert(QTranslatorMessage("QMenuBar", "Setup", 0, "do_not_merge_me")); app.installTranslator(&aqua_trans); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index b76f33f7a1..3f26b24dc4 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,10 @@ +2004-09-26 Lars Gullik Bjonnes + + * pch.h: use proper signal include + + * Tooltips.[Ch]: Use preffered calling of Boost.Signal + * XFormsView.h: ditto + 2004-08-30 Lars Gullik Bjonnes * forms/pch.h: make it better diff --git a/src/frontends/xforms/Tooltips.C b/src/frontends/xforms/Tooltips.C index 9ea6da5f03..cca71af6cd 100644 --- a/src/frontends/xforms/Tooltips.C +++ b/src/frontends/xforms/Tooltips.C @@ -38,7 +38,7 @@ namespace frontend { bool Tooltips::enabled_ = true; -boost::signal0 Tooltips::toggled; +boost::signal Tooltips::toggled; Tooltips::Tooltips() diff --git a/src/frontends/xforms/Tooltips.h b/src/frontends/xforms/Tooltips.h index cd618d1a42..2cc357ffd5 100644 --- a/src/frontends/xforms/Tooltips.h +++ b/src/frontends/xforms/Tooltips.h @@ -18,7 +18,7 @@ #ifndef TOOLTIPS_H #define TOOLTIPS_H -#include +#include #include #include "forms_fwd.h" // Can't forward-declare FL_OBJECT @@ -55,7 +55,7 @@ private: /** Once enabled_ is changed, then this signal is emitted to update * all the tooltips. */ - static boost::signal0 toggled; + static boost::signal toggled; /// The tooltips are stored so that they can be turned on and off. typedef std::map TooltipsMap; diff --git a/src/frontends/xforms/XFormsView.h b/src/frontends/xforms/XFormsView.h index f74b4ff288..ed08ddb24a 100644 --- a/src/frontends/xforms/XFormsView.h +++ b/src/frontends/xforms/XFormsView.h @@ -18,7 +18,7 @@ #include "frontends/LyXView.h" #include // for Pixmap -#include +#include #include @@ -77,7 +77,7 @@ public: /// void updateMetrics(bool resize_form = false); /// - boost::signal0 metricsUpdated; + boost::signal metricsUpdated; private: /** diff --git a/src/frontends/xforms/pch.h b/src/frontends/xforms/pch.h index f664f8a5ca..8732b1cb82 100644 --- a/src/frontends/xforms/pch.h +++ b/src/frontends/xforms/pch.h @@ -14,8 +14,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 2f0c30b528..e51915d763 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,13 @@ +2004-09-26 Lars Gullik Bjonnes + + * pch.h: use proper signal include + + * GraphicsCacheItem.[Ch]: Use preferred calling of Boost.Signal + * GraphicsConverter.C: ditto + * GraphicsImage.h: ditto + * GraphicsLoader.[Ch]: ditto + * PreviewLoader.[Ch]: ditto + 2004-09-26 Lars Gullik Bjonnes * pch.h: include instead of diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index 59973327d4..d58057665f 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -122,7 +122,7 @@ struct CacheItem::Impl : public boost::signals::trackable { ImageStatus status_; /// This signal is emitted when the image loading status changes. - boost::signal0 statusChanged; + boost::signal statusChanged; /// The connection to the signal Image::finishedLoading boost::signals::connection cl_; diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index 69ca82ef21..e55e3885e3 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -32,7 +32,7 @@ #include #include -#include +#include class InsetGraphics; @@ -84,7 +84,8 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef boost::signal0::slot_type slot_type; + typedef boost::signal sig_type; + typedef sig_type::slot_type slot_type; /// boost::signals::connection connect(slot_type const &) const; diff --git a/src/graphics/GraphicsConverter.C b/src/graphics/GraphicsConverter.C index 4e1a754f8d..fd6697e62d 100644 --- a/src/graphics/GraphicsConverter.C +++ b/src/graphics/GraphicsConverter.C @@ -67,7 +67,7 @@ struct Converter::Impl : public boost::signals::trackable { /** At the end of the conversion process inform the outside world * by emitting a signal. */ - typedef boost::signal1 SignalType; + typedef boost::signal SignalType; /// SignalType finishedConversion; diff --git a/src/graphics/GraphicsConverter.h b/src/graphics/GraphicsConverter.h index f1b69c90a0..30021cbf1a 100644 --- a/src/graphics/GraphicsConverter.h +++ b/src/graphics/GraphicsConverter.h @@ -17,8 +17,8 @@ #ifndef GRAPHICSCONVERTER_H #define GRAPHICSCONVERTER_H -#include #include +#include #include namespace lyx { @@ -46,7 +46,8 @@ public: * finished. * If the conversion is succesful, then the listener is passed \c true. */ - typedef boost::signal1::slot_type slot_type; + typedef boost::signal sig_type; + typedef sig_type::slot_type slot_type; /// boost::signals::connection connect(slot_type const &) const; diff --git a/src/graphics/GraphicsImage.h b/src/graphics/GraphicsImage.h index 00c42f63aa..01d53b41cf 100644 --- a/src/graphics/GraphicsImage.h +++ b/src/graphics/GraphicsImage.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -66,9 +66,9 @@ public: bool isDrawable() const; /** At the end of the loading process inform the outside world - * by emitting a signal. + * by emitting a signal */ - typedef boost::signal1 SignalType; + typedef boost::signal SignalType; /// SignalType finishedLoading; diff --git a/src/graphics/GraphicsLoader.C b/src/graphics/GraphicsLoader.C index 5567841954..446bfc43e5 100644 --- a/src/graphics/GraphicsLoader.C +++ b/src/graphics/GraphicsLoader.C @@ -51,7 +51,7 @@ struct Loader::Impl : boost::signals::trackable { /// We modify a local copy of the image once it is loaded. Image::ImagePtr image_; /// This signal is emitted when the image loading status changes. - boost::signal0 signal_; + boost::signal signal_; private: /// diff --git a/src/graphics/GraphicsLoader.h b/src/graphics/GraphicsLoader.h index 3d41d9c136..79174aef95 100644 --- a/src/graphics/GraphicsLoader.h +++ b/src/graphics/GraphicsLoader.h @@ -26,8 +26,8 @@ #include "GraphicsTypes.h" -#include #include +#include class InsetOld; @@ -90,7 +90,8 @@ public: /** Connect and you'll be informed when the loading status of the image * changes. */ - typedef boost::signal0::slot_type slot_type; + typedef boost::signal sig_type; + typedef sig_type::slot_type slot_type; /// boost::signals::connection connect(slot_type const &) const; diff --git a/src/graphics/PreviewLoader.C b/src/graphics/PreviewLoader.C index aa01f6f13c..453f431487 100644 --- a/src/graphics/PreviewLoader.C +++ b/src/graphics/PreviewLoader.C @@ -139,7 +139,7 @@ struct PreviewLoader::Impl : public boost::signals::trackable { void startLoading(); /// Emit this signal when an image is ready for display. - boost::signal1 imageReady; + boost::signal imageReady; Buffer const & buffer() const { return buffer_; } diff --git a/src/graphics/PreviewLoader.h b/src/graphics/PreviewLoader.h index ecb518f1a8..84c7295c91 100644 --- a/src/graphics/PreviewLoader.h +++ b/src/graphics/PreviewLoader.h @@ -20,7 +20,7 @@ #include #include -#include +#include class Buffer; @@ -73,7 +73,8 @@ public: * has been created and is ready for loading through * lyx::graphics::PreviewImage::image(). */ - typedef boost::signal1::slot_type slot_type; + typedef boost::signal sig_type; + typedef sig_type::slot_type slot_type; /// boost::signals::connection connect(slot_type const &) const; diff --git a/src/graphics/pch.h b/src/graphics/pch.h index 866a457161..a1ac537838 100644 --- a/src/graphics/pch.h +++ b/src/graphics/pch.h @@ -3,8 +3,7 @@ #include #include #include -#include -#include +#include #include #include diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 3c41997366..4eace2f56a 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,9 @@ +2004-09-26 Lars Gullik Bjonnes + + * render_preview.h: Use preferred calling of Boost.Signal + + * pch.h: use proper signal include + 2004-09-26 Lars Gullik Bjonnes * ExternalTransforms.h: User preferred calling of Boost.Function diff --git a/src/insets/pch.h b/src/insets/pch.h index f572633358..d04e6b08bc 100644 --- a/src/insets/pch.h +++ b/src/insets/pch.h @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/insets/render_preview.h b/src/insets/render_preview.h index 0774c44a4e..46ebf16cdb 100644 --- a/src/insets/render_preview.h +++ b/src/insets/render_preview.h @@ -20,7 +20,7 @@ #include "support/FileMonitor.h" -#include +#include #include #include @@ -116,7 +116,7 @@ public: /// Connect and you'll be informed when the file changes. - typedef boost::signal0::slot_type slot_type; + typedef lyx::support::FileMonitor::slot_type slot_type; boost::signals::connection fileChanged(slot_type const &); /// equivalent to dynamic_cast diff --git a/src/pch.h b/src/pch.h index 96a24fa00d..010094feb4 100644 --- a/src/pch.h +++ b/src/pch.h @@ -15,9 +15,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 00868163bb..b1de7c53ec 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,14 @@ +2004-09-26 Lars Gullik Bjonnes + + * pch.h: use proper signal include + + * forkedcallqueue.C: remove unused include + + * FileMonitor.h: Use the preferred calling for Boost.Signal + * forkedcall.h: ditto + + * FileMonitor.C: use the new signal typedef + 2004-09-26 Lars Gullik Bjonnes * forkedcall.h: remove include of diff --git a/src/support/FileMonitor.C b/src/support/FileMonitor.C index 3d5e84326a..4a7fa07bf3 100644 --- a/src/support/FileMonitor.C +++ b/src/support/FileMonitor.C @@ -42,7 +42,7 @@ struct FileMonitor::Impl : public boost::signals::trackable { Timeout timer_; /// This signal is emitted if the file is modified (has a new checksum). - boost::signal0 fileChanged_; + FileMonitor::FileChangedSig fileChanged_; /** We use these to ascertain whether a file (once loaded successfully) * has changed. diff --git a/src/support/FileMonitor.h b/src/support/FileMonitor.h index 251c7dbdb0..ba84bb549e 100644 --- a/src/support/FileMonitor.h +++ b/src/support/FileMonitor.h @@ -17,7 +17,7 @@ #include #include -#include +#include namespace lyx { namespace support { @@ -52,7 +52,8 @@ public: unsigned long checksum() const; /// Connect and you'll be informed when the file has changed. - typedef boost::signal0::slot_type slot_type; + typedef boost::signal FileChangedSig; + typedef FileChangedSig::slot_type slot_type; /// boost::signals::connection connect(slot_type const &) const; diff --git a/src/support/forkedcall.h b/src/support/forkedcall.h index bb8ffeba0c..d746d543e7 100644 --- a/src/support/forkedcall.h +++ b/src/support/forkedcall.h @@ -27,7 +27,7 @@ #define FORKEDCALL_H #include -#include +#include #include @@ -60,7 +60,7 @@ public: * we can return easily to C++ methods, rather than just globally * accessible functions. */ - typedef boost::signal2 SignalType; + typedef boost::signal SignalType; /** The signal is connected in the calling routine to the desired * slot. We pass a shared_ptr rather than a reference to the signal diff --git a/src/support/forkedcallqueue.C b/src/support/forkedcallqueue.C index 8a51fcd18f..20997271d4 100644 --- a/src/support/forkedcallqueue.C +++ b/src/support/forkedcallqueue.C @@ -15,7 +15,6 @@ #include "debug.h" #include -#include using std::string; diff --git a/src/support/pch.h b/src/support/pch.h index b58906b398..731f43c87c 100644 --- a/src/support/pch.h +++ b/src/support/pch.h @@ -8,8 +8,7 @@ #include #include #include -#include -#include +#include #include #include #include -- 2.39.5