]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Tooltips.h
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / Tooltips.h
index 6e461db57099fbe6d7dd8a9e89b058751ba6ea79..2cc357ffd57b1999d1d28135e0cc1d9c08ea610c 100644 (file)
@@ -1,12 +1,15 @@
 // -*- C++ -*-
-/*
+/**
  * \file Tooltips.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming
  *
- * Tooltips for xforms. xforms 0.89 supports them directly, but 0.88 needs
+ * Full author contact details are available in file CREDITS.
+ */
+
+/* Tooltips for xforms. xforms 0.89 supports them directly, but 0.88 needs
  * a bit of jiggery pokery. This class wraps it all up in a neat interface.
  * Based on code originally in Toolbar_pimpl.C that appears to have been
  * written by Matthias Ettrich and Jean-Marc Lasgouttes.
 #ifndef TOOLTIPS_H
 #define TOOLTIPS_H
 
-#include "LString.h"
-#include <boost/utility.hpp>
-#include <sigc++/signal_system.h>
-#include FORMS_H_LOCATION // Can't forward-declare FL_OBJECT
+#include <boost/signal.hpp>
+#include <boost/signals/trackable.hpp>
+
+#include "forms_fwd.h" // Can't forward-declare FL_OBJECT
+
 #include <map>
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+namespace lyx {
+namespace frontend {
 
-class Tooltips : boost::noncopyable, public SigC::Object {
+class Tooltips : boost::noncopyable, public boost::signals::trackable {
 public:
+       ///
        Tooltips();
 
-       /// Initialise a tooltip for this ob
-       void initTooltip(FL_OBJECT * ob, string const & tip);
+       /// Initialise a tooltip for this ob.
+       void init(FL_OBJECT * ob, std::string const & tip);
 
        /// Are the tooltips on or off?
        static bool enabled() { return enabled_; }
 
-#if FL_REVISION < 89
-
-       /// Return the tooltip associated with this object
-       string const getTooltip(FL_OBJECT *) const;
-
-#endif
+       /** This method is connected to Dialogs::toggleTooltips and toggles
+        *  the state of enabled_.
+        */
+       static void toggleEnabled();
 
 private:
 
+       /// This method is connected to the Tooltips::toggled signal.
+       void set();
+
        /// Are the tooltips on or off?
        static bool enabled_;
 
-       /** This method is connected to Dialogs::toggleTooltips and toggles
-        *  the state of enabled_
-        */
-       static void toggleEnabled();
-
        /** Once enabled_ is changed, then this signal is emitted to update
         *  all the tooltips.
         */
-       static SigC::Signal0<void> tooltipsToggled;
-
-       /// This method is connected to the tooltipsToggled signal.
-       void toggleTooltips();
+       static boost::signal<void()> toggled;
 
-       /// The tooltips are stored so that they can be turned on and off
-       typedef std::map<FL_OBJECT *, string> TooltipsMap;
+       /// The tooltips are stored so that they can be turned on and off.
+       typedef std::map<FL_OBJECT *, std::string> TooltipsMap;
 
        TooltipsMap tooltipsMap;
-
-#if FL_REVISION < 89
-
-       FL_OBJECT * tooltip_timer_;
-
-#endif // FL_REVISION >= 89
 };
 
+} // namespace frontend
+} // namespace lyx
+
 #endif // TOOLTIPS_H