diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-07-24 21:49:24 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-07-25 15:12:14 +0200 |
commit | 31300a1b6f84aaf548af421037f9dab5e66fe48a (patch) | |
tree | c7727867d3367f76dc5331e519ff0d28adfaae01 /slideshow | |
parent | a5eb2da14e3fe7e41e1f7eb16b702644a190a463 (diff) |
Remove unused Debugging stuff
If this is still needed, please revert it.
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/Library_slideshow.mk | 1 | ||||
-rw-r--r-- | slideshow/source/engine/animationnodes/basenode.cxx | 5 | ||||
-rw-r--r-- | slideshow/source/engine/debug.cxx | 327 | ||||
-rw-r--r-- | slideshow/source/engine/eventqueue.cxx | 1 | ||||
-rw-r--r-- | slideshow/source/inc/debug.hxx | 80 | ||||
-rw-r--r-- | slideshow/source/inc/delayevent.hxx | 1 | ||||
-rw-r--r-- | slideshow/source/inc/event.hxx | 1 |
7 files changed, 0 insertions, 416 deletions
diff --git a/slideshow/Library_slideshow.mk b/slideshow/Library_slideshow.mk index abbaa56762df..7e690c03cefa 100644 --- a/slideshow/Library_slideshow.mk +++ b/slideshow/Library_slideshow.mk @@ -98,7 +98,6 @@ $(eval $(call gb_Library_add_exception_objects,slideshow,\ slideshow/source/engine/animationnodes/sequentialtimecontainer \ slideshow/source/engine/attributemap \ slideshow/source/engine/color \ - slideshow/source/engine/debug \ slideshow/source/engine/delayevent \ slideshow/source/engine/effectrewinder \ slideshow/source/engine/eventmultiplexer \ diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index cc3cd5b6da55..f5f8113a5a2c 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -48,7 +48,6 @@ #include "tools.hxx" #include "nodetools.hxx" #include "generateevent.hxx" -#include "debug.hxx" #include <boost/bind.hpp> #include <vector> @@ -311,10 +310,6 @@ public: mpNode->meCurrState = meToState; clear(); } - - // Uncomment the following line to write the node tree to file on - // every state change of one of its nodes. - // Debug_ShowNodeTree(mpNode->mpSelf); } void clear() { diff --git a/slideshow/source/engine/debug.cxx b/slideshow/source/engine/debug.cxx deleted file mode 100644 index bc5f24f95509..000000000000 --- a/slideshow/source/engine/debug.cxx +++ /dev/null @@ -1,327 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "precompiled_slideshow.hxx" - -#include "debug.hxx" - -#if OSL_DEBUG_LEVEL > 1 - -#include "animationnodes/basecontainernode.hxx" -#include "animationnodes/paralleltimecontainer.hxx" -#include "animationnodes/sequentialtimecontainer.hxx" -#include "animationnodes/animationtransitionfilternode.hxx" -#include "animationnodes/animationaudionode.hxx" -#include "animationnodes/animationcolornode.hxx" -#include "animationnodes/animationcommandnode.hxx" -#include "animationnodes/animationpathmotionnode.hxx" -#include "animationnodes/animationsetnode.hxx" -#include "animationnodes/animationtransformnode.hxx" -#include "animationnodes/propertyanimationnode.hxx" - -#include <com/sun/star/animations/XAnimationNode.hpp> -#include <com/sun/star/animations/Event.hpp> - -#include <cstdio> -#include <cstdarg> - -using ::rtl::OUString; -using namespace ::com::sun::star; - - -namespace slideshow { namespace internal { - -namespace { - -class NodeContainer : public BaseContainerNode -{ -public: - void ShowChildrenState (void) const; -}; - - - - -OUString DebugGetDescription (const AnimationNodeSharedPtr& rpNode) -{ - if (::boost::dynamic_pointer_cast<BaseContainerNode>(rpNode)) - { - // Node is a container. - if (::boost::dynamic_pointer_cast<ParallelTimeContainer>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("ParallelTimeContainer")); - else if (::boost::dynamic_pointer_cast<SequentialTimeContainer>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("SequentialTimeContainer")); - else - return OUString(RTL_CONSTASCII_USTRINGPARAM("<unknown container>")); - } - else if (::boost::dynamic_pointer_cast<AnimationTransitionFilterNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationTransitionFilterNode")); - else if (::boost::dynamic_pointer_cast<AnimationAudioNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationAudioNode")); - else if (::boost::dynamic_pointer_cast<AnimationColorNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationColorNode")); - else if (::boost::dynamic_pointer_cast<AnimationCommandNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationCommandNode")); - else if (::boost::dynamic_pointer_cast<AnimationPathMotionNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationPathMotionNode")); - else if (::boost::dynamic_pointer_cast<AnimationSetNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationSetNode")); - else if (::boost::dynamic_pointer_cast<AnimationTransformNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("AnimationTransformNode")); - else if (::boost::dynamic_pointer_cast<PropertyAnimationNode>(rpNode)) - return OUString(RTL_CONSTASCII_USTRINGPARAM("PropertyAnimationNode")); - else - return OUString(RTL_CONSTASCII_USTRINGPARAM("<unknown node type>")); -} - - - - -void DebugShowState (const AnimationNodeSharedPtr& rpNode) -{ - if ( ! rpNode) - return; - - OUString sState; - OUString sStateColor; - switch (rpNode->getState()) - { - default: - case AnimationNode::INVALID: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("firebrick1")); - break; - case AnimationNode::UNRESOLVED: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Unresolved")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("dodgerblue4")); - break; - case AnimationNode::RESOLVED: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Resolved")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("dodgerblue")); - break; - case AnimationNode::ACTIVE: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Active")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("seagreen1")); - break; - case AnimationNode::FROZEN: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Frozen")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("lightskyblue1")); - break; - case AnimationNode::ENDED: - sState = OUString(RTL_CONSTASCII_USTRINGPARAM("Ended")); - sStateColor = OUString(RTL_CONSTASCII_USTRINGPARAM("slategray3")); - break; - } - - const uno::Any aBegin (rpNode->getXAnimationNode()->getBegin()); - OUString sTrigger; - if (aBegin.hasValue()) - { - animations::Event aEvent; - double nTimeOffset; - const static char* sEventTriggers[] = { - "NONE", "ON_BEGIN", "ON_END", "BEGIN_EVENT", "END_EVENT", "ON_CLICK", - "ON_DBL_CLICK", "ON_MOUSE_ENTER", "ON_MOUSE_LEAVE", "ON_NEXT", "ON_PREV", - "ON_STOP_AUDIO", "REPEAT"}; - if (aBegin >>= aEvent) - { - sTrigger = OUString::createFromAscii(sEventTriggers[aEvent.Trigger]); - } - else if (aBegin >>= nTimeOffset) - { - sTrigger = OUString::valueOf(nTimeOffset); - } - else - { - sTrigger = OUString(RTL_CONSTASCII_USTRINGPARAM("other")); - } - } - else - sTrigger = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("void")); - - TRACE("Node state: n%x [label=\"%x / %x / %s\\n%s\\n%s\",style=filled,fillcolor=\"%s\"]\r", - rpNode.get(), - rpNode.get(), - rpNode->getXAnimationNode().get(), - ::rtl::OUStringToOString(sState, RTL_TEXTENCODING_ASCII_US).getStr(), - ::rtl::OUStringToOString(DebugGetDescription(rpNode), RTL_TEXTENCODING_ASCII_US).getStr(), - ::rtl::OUStringToOString(sTrigger, RTL_TEXTENCODING_ASCII_US).getStr(), - ::rtl::OUStringToOString(sStateColor, RTL_TEXTENCODING_ASCII_US).getStr()); - - BaseContainerNodeSharedPtr pContainer ( - ::boost::dynamic_pointer_cast<BaseContainerNode>(rpNode)); - if (pContainer) - ::boost::static_pointer_cast<NodeContainer>(rpNode)->ShowChildrenState(); -} - - - - -void NodeContainer::ShowChildrenState (void) const -{ - for (std::size_t nIndex=0; nIndex<maChildren.size(); ++nIndex) - { - TRACE("Node connection: n%x -> n%x", this, maChildren[nIndex].get()); - DebugShowState(maChildren[nIndex]); - } -} - - - - -AnimationNodeSharedPtr DebugGetTreeRoot (const BaseNodeSharedPtr& rpNode) -{ - BaseNodeSharedPtr pNode (rpNode); - if (pNode) - { - BaseNodeSharedPtr pParent (pNode->getParentNode()); - while (pParent) - { - pNode = pParent; - pParent = pNode->getParentNode(); - } - } - return pNode; -} - -} // end of anonymous namespace - - - - -void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode) -{ - DebugTraceScope aTraceScope ("NodeTree"); - - DebugShowState(DebugGetTreeRoot(::boost::dynamic_pointer_cast<BaseNode>(rpNode))); -} - - - - -//----- Tracing --------------------------------------------------------------- - -extern "C" { - - namespace { - - class TraceData - { - public: - TraceData (void) - : mnIndentation(0), - mpFile(fopen(TRACE_LOG_FILE_NAME, "w")), - maTime() - { - } - - int mnIndentation; - FILE* mpFile; - ::canvas::tools::ElapsedTime maTime; - }; - static TraceData gTraceData; - - inline void SAL_CALL DebugTrace ( - const int nIndentationOffset, - const sal_Char* sFormat, - va_list args) - { - if (gTraceData.mpFile != NULL) - { - // Write line head with current time and indentation. - // Adapt indentation. - if (nIndentationOffset < 0) - gTraceData.mnIndentation += nIndentationOffset; - fprintf(gTraceData.mpFile, "%10.8f ", gTraceData.maTime.getElapsedTime()); - for (int nIndentation=0; nIndentation<gTraceData.mnIndentation; ++nIndentation) - fprintf(gTraceData.mpFile, " "); - if (nIndentationOffset > 0) - gTraceData.mnIndentation += nIndentationOffset; - - // Write message. - vfprintf(gTraceData.mpFile, sFormat, args); - fprintf(gTraceData.mpFile, "\n"); - fflush(gTraceData.mpFile); - } - } - -} // end of anonymous namespace - - -} // end of extern "C" - -void SAL_CALL DebugTraceBegin (const sal_Char* sFormat, ...) -{ - va_list args; - va_start(args, sFormat); - DebugTrace(+1,sFormat, args); - va_end(args); -} - -void SAL_CALL DebugTraceEnd (const sal_Char* sFormat, ...) -{ - va_list args; - va_start(args, sFormat); - DebugTrace(-1,sFormat, args); - va_end(args); -} - -void SAL_CALL DebugTraceMessage (const sal_Char* sFormat, ...) -{ - va_list args; - va_start(args, sFormat); - DebugTrace(0,sFormat, args); - va_end(args); -} - - - -DebugTraceScope::DebugTraceScope (const sal_Char* sFormat, ...) - : msMessage(new sal_Char[mnBufferSize]) -{ - va_list args; - va_start(args, sFormat); - - msMessage[mnBufferSize-1] = 0; - vsnprintf(msMessage, mnBufferSize-1, sFormat, args); - TRACE_BEGIN("[ %s", msMessage); - va_end(args); -} - -DebugTraceScope::~DebugTraceScope (void) -{ - TRACE_END("] %s", msMessage); - delete [] msMessage; -} - - -} } - -#endif // OSL_DEBUG_LEVEL > 1 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index cc19ede90867..a2a4452f4df7 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -33,7 +33,6 @@ #include <canvas/debug.hxx> #include <tools/diagnose_ex.h> #include <canvas/verbosetrace.hxx> -#include "debug.hxx" #include <comphelper/anytostring.hxx> #include <cppuhelper/exc_hlp.hxx> diff --git a/slideshow/source/inc/debug.hxx b/slideshow/source/inc/debug.hxx deleted file mode 100644 index 17742121981f..000000000000 --- a/slideshow/source/inc/debug.hxx +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_SLIDESHOW_DEBUG_HXX -#define INCLUDED_SLIDESHOW_DEBUG_HXX - -#include <osl/diagnose.h> - -#if OSL_DEBUG_LEVEL > 1 - -#include "animationnode.hxx" - - -namespace slideshow { namespace internal { - -void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode); - -// Change this to a valid filename. The file is created anew with every -// office start (and execution of at least one TRACE... command.) -#define TRACE_LOG_FILE_NAME "d:\\tmp\\log.txt" - -class DebugTraceScope -{ -public: - DebugTraceScope (const sal_Char* sFormat, ...); - ~DebugTraceScope (void); -private: - static const sal_Int32 mnBufferSize = 512; - sal_Char* msMessage; -}; - -void SAL_CALL DebugTraceBegin (const sal_Char* sFormat, ...); -void SAL_CALL DebugTraceEnd (const sal_Char* sFormat, ...); -void SAL_CALL DebugTraceMessage (const sal_Char* sFormat, ...); - -} } // end of namespace ::slideshow::internal - - -#define TRACE_BEGIN DebugTraceBegin -#define TRACE_END DebugTraceEnd -#define TRACE DebugTraceMessage -#define TRACE_SCOPE DebugTraceScope aTraceScope - -#else // OSL_DEBUG_LEVEL > 1 - -#define TRACE_BEGIN 1 ? ((void)0) : DebugTraceBegin -#define TRACE_END 1 ? ((void)0) : DebugTraceEnd -#define TRACE 1 ? ((void)0) : DebugTraceMessage -#define TRACE_SCOPE - -#endif // OSL_DEBUG_LEVEL > 1 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx index 4086aa2aba77..13353d922bf6 100644 --- a/slideshow/source/inc/delayevent.hxx +++ b/slideshow/source/inc/delayevent.hxx @@ -31,7 +31,6 @@ #include <boost/function.hpp> #include "event.hxx" -#include "debug.hxx" #include <boost/noncopyable.hpp> namespace slideshow { diff --git a/slideshow/source/inc/event.hxx b/slideshow/source/inc/event.hxx index 9f3199f294ce..778065e59858 100644 --- a/slideshow/source/inc/event.hxx +++ b/slideshow/source/inc/event.hxx @@ -29,7 +29,6 @@ #define INCLUDED_SLIDESHOW_EVENT_HXX #include "disposable.hxx" -#include "debug.hxx" #include <rtl/ustring.hxx> #include <boost/shared_ptr.hpp> #include <vector> |