summaryrefslogtreecommitdiff
path: root/slideshow/source/inc/delayevent.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/source/inc/delayevent.hxx')
-rw-r--r--slideshow/source/inc/delayevent.hxx55
1 files changed, 36 insertions, 19 deletions
diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx
index 10960e395feb..1c4e09faa7da 100644
--- a/slideshow/source/inc/delayevent.hxx
+++ b/slideshow/source/inc/delayevent.hxx
@@ -33,6 +33,7 @@
#include <boost/function.hpp>
#include "event.hxx"
+#include "debug.hxx"
#include <boost/noncopyable.hpp>
namespace slideshow {
@@ -46,16 +47,23 @@ public:
typedef ::boost::function0<void> FunctorT;
template <typename FuncT>
- Delay( FuncT const& func, double nTimeout )
- : mnTimeout(nTimeout), maFunc(func), mbWasFired(false) {}
+ Delay( FuncT const& func,
+ double nTimeout
+#if OSL_DEBUG_LEVEL > 1
+ , const ::rtl::OUString& rsDescription
+ ) : Event(rsDescription),
+#else
+ ) :
+#endif
+ mnTimeout(nTimeout), maFunc(func), mbWasFired(false) {}
-#if defined(VERBOSE) && defined(DBG_UTIL)
Delay( const boost::function0<void>& func,
- double nTimeout,
- char const* const ) :
+ double nTimeout
+#if OSL_DEBUG_LEVEL > 1
+ , const ::rtl::OUString& rsDescription
+ ) : Event(rsDescription),
#else
- Delay( const boost::function0<void>& func,
- double nTimeout ) :
+ ) :
#endif
mnTimeout(nTimeout),
maFunc(func),
@@ -74,7 +82,7 @@ private:
bool mbWasFired;
};
-#if OSL_DEBUG_LEVEL < 1
+#if OSL_DEBUG_LEVEL <= 1
/** Generate delay event
@@ -87,7 +95,7 @@ private:
@return generated delay event
*/
template <typename FuncT>
-inline EventSharedPtr makeDelay( FuncT const& func, double nTimeout )
+inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout )
{
return EventSharedPtr( new Delay( func, nTimeout ) );
}
@@ -100,19 +108,25 @@ inline EventSharedPtr makeDelay( FuncT const& func, double nTimeout )
@return generated immediate event.
*/
template <typename FuncT>
-inline EventSharedPtr makeEvent( FuncT const& func )
+inline EventSharedPtr makeEvent_( FuncT const& func )
{
return EventSharedPtr( new Delay( func, 0.0 ) );
}
+
+// Strip away description.
+#define makeDelay(f, t, d) makeDelay_(f, t)
+#define makeEvent(f, d) makeEvent_(f)
+
#else // OSL_DEBUG_LEVEL > 1
class Delay_ : public Delay {
public:
template <typename FuncT>
Delay_( FuncT const& func, double nTimeout,
- char const* from_function, char const* from_file, int from_line )
- : Delay(func, nTimeout),
+ char const* from_function, char const* from_file, int from_line,
+ const ::rtl::OUString& rsDescription)
+ : Delay(func, nTimeout, rsDescription),
FROM_FUNCTION(from_function),
FROM_FILE(from_file), FROM_LINE(from_line) {}
@@ -124,18 +138,21 @@ public:
template <typename FuncT>
inline EventSharedPtr makeDelay_(
FuncT const& func, double nTimeout,
- char const* from_function, char const* from_file, int from_line )
+ char const* from_function, char const* from_file, int from_line,
+ const ::rtl::OUString& rsDescription)
{
return EventSharedPtr( new Delay_( func, nTimeout,
- from_function, from_file, from_line ) );
+ from_function, from_file, from_line, rsDescription) );
}
-#define makeDelay(f, t) makeDelay_(f, t, \
-BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)
-#define makeEvent(f) makeDelay_(f, 0.0, \
-BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)
+#define makeDelay(f, t, d) makeDelay_(f, t, \
+ BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(d)))
+#define makeEvent(f, d) makeDelay_(f, 0.0, \
+ BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(d)))
-#endif // OSL_DEBUG_LEVEL < 1
+#endif // OSL_DEBUG_LEVEL <= 1
} // namespace internal
} // namespace presentation