LCOV - code coverage report
Current view: top level - svx/source/sdr/overlay - overlayanimatedbitmapex.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 32 0.0 %
Date: 2012-08-25 Functions: 0 6 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 40 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <svx/sdr/overlay/overlayanimatedbitmapex.hxx>
      30                 :            : #include <vcl/outdev.hxx>
      31                 :            : #include <svx/sdr/overlay/overlaymanager.hxx>
      32                 :            : #include <basegfx/matrix/b2dhommatrix.hxx>
      33                 :            : #include <svx/sdr/overlay/overlaytools.hxx>
      34                 :            : 
      35                 :            : //////////////////////////////////////////////////////////////////////////////
      36                 :            : 
      37                 :            : namespace sdr
      38                 :            : {
      39                 :            :     namespace overlay
      40                 :            :     {
      41                 :            :         // #i53216# check blink time value range
      42                 :          0 :         void OverlayAnimatedBitmapEx::impCheckBlinkTimeValueRange()
      43                 :            :         {
      44         [ #  # ]:          0 :             if(mnBlinkTime < 25)
      45                 :            :             {
      46                 :          0 :                 mnBlinkTime = 25;
      47                 :            :             }
      48         [ #  # ]:          0 :             else if(mnBlinkTime > 10000)
      49                 :            :             {
      50                 :          0 :                 mnBlinkTime = 10000;
      51                 :            :             }
      52                 :          0 :         }
      53                 :            : 
      54                 :          0 :         drawinglayer::primitive2d::Primitive2DSequence OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence()
      55                 :            :         {
      56         [ #  # ]:          0 :             if(mbOverlayState)
      57                 :            :             {
      58                 :            :                 const drawinglayer::primitive2d::Primitive2DReference aPrimitive(
      59                 :            :                     new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
      60                 :            :                         getBitmapEx1(),
      61                 :          0 :                         getBasePosition(),
      62                 :          0 :                         getCenterX1(),
      63 [ #  # ][ #  # ]:          0 :                         getCenterY1()));
                 [ #  # ]
      64                 :            : 
      65         [ #  # ]:          0 :                 return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
      66                 :            :             }
      67                 :            :             else
      68                 :            :             {
      69                 :            :                 const drawinglayer::primitive2d::Primitive2DReference aPrimitive(
      70                 :            :                     new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
      71                 :            :                         getBitmapEx2(),
      72                 :          0 :                         getBasePosition(),
      73                 :          0 :                         getCenterX2(),
      74 [ #  # ][ #  # ]:          0 :                         getCenterY2()));
                 [ #  # ]
      75                 :            : 
      76         [ #  # ]:          0 :                 return drawinglayer::primitive2d::Primitive2DSequence(&aPrimitive, 1);
      77                 :            :             }
      78                 :            :         }
      79                 :            : 
      80                 :          0 :         OverlayAnimatedBitmapEx::OverlayAnimatedBitmapEx(
      81                 :            :             const basegfx::B2DPoint& rBasePos,
      82                 :            :             const BitmapEx& rBitmapEx1,
      83                 :            :             const BitmapEx& rBitmapEx2,
      84                 :            :             sal_uInt32 nBlinkTime,
      85                 :            :             sal_uInt16 nCenX1,
      86                 :            :             sal_uInt16 nCenY1,
      87                 :            :             sal_uInt16 nCenX2,
      88                 :            :             sal_uInt16 nCenY2)
      89                 :            :         :   OverlayObjectWithBasePosition(rBasePos, Color(COL_WHITE)),
      90                 :            :             maBitmapEx1(rBitmapEx1),
      91                 :            :             maBitmapEx2(rBitmapEx2),
      92                 :            :             mnCenterX1(nCenX1), mnCenterY1(nCenY1),
      93                 :            :             mnCenterX2(nCenX2), mnCenterY2(nCenY2),
      94                 :            :             mnBlinkTime(nBlinkTime),
      95 [ #  # ][ #  # ]:          0 :             mbOverlayState(false)
                 [ #  # ]
      96                 :            :         {
      97                 :            :             // set AllowsAnimation flag to mark this object as animation capable
      98                 :          0 :             mbAllowsAnimation = true;
      99                 :            : 
     100                 :            :             // #i53216# check blink time value range
     101         [ #  # ]:          0 :             impCheckBlinkTimeValueRange();
     102                 :          0 :         }
     103                 :            : 
     104 [ #  # ][ #  # ]:          0 :         OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx()
     105                 :            :         {
     106         [ #  # ]:          0 :         }
     107                 :            : 
     108                 :          0 :         void OverlayAnimatedBitmapEx::Trigger(sal_uInt32 nTime)
     109                 :            :         {
     110         [ #  # ]:          0 :             if(getOverlayManager())
     111                 :            :             {
     112                 :            :                 // #i53216# produce event after nTime + x
     113                 :          0 :                 SetTime(nTime + mnBlinkTime);
     114                 :            : 
     115                 :            :                 // switch state
     116         [ #  # ]:          0 :                 if(mbOverlayState)
     117                 :            :                 {
     118                 :          0 :                     mbOverlayState = false;
     119                 :            :                 }
     120                 :            :                 else
     121                 :            :                 {
     122                 :          0 :                     mbOverlayState = true;
     123                 :            :                 }
     124                 :            : 
     125                 :            :                 // re-insert me as event
     126                 :          0 :                 getOverlayManager()->InsertEvent(this);
     127                 :            : 
     128                 :            :                 // register change (after change)
     129                 :          0 :                 objectChange();
     130                 :            :             }
     131                 :          0 :         }
     132                 :            :     } // end of namespace overlay
     133                 :            : } // end of namespace sdr
     134                 :            : 
     135                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10