KHtml

animprovider.cpp
1 /*
2  Large image displaying library.
3 
4  Copyright (C) 2004 Maks Orlovich ([email protected])
5 
6  Permission is hereby granted, free of charge, to any person obtaining a copy
7  of this software and associated documentation files (the "Software"), to deal
8  in the Software without restriction, including without limitation the rights
9  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  copies of the Software, and to permit persons to whom the Software is
11  furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20  AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 
23 */
24 
25 #include "animprovider.h"
26 #include "pixmapplane.h"
27 #include "imagemanager.h"
28 #include "image.h"
29 
30 namespace khtmlImLoad
31 {
32 
33 void AnimProvider::nextFrame()
34 {
35  curFrame = curFrame->nextFrame;
36  if (!curFrame) {
37  curFrame = frame0;
38  }
39 }
40 
41 void AnimProvider::switchFrame()
42 {
43  if (animationAdvice == KHTMLSettings::KAnimationDisabled) {
44  return;
45  }
46  shouldSwitchFrame = true;
47  image->notifyFrameChange();
48 }
49 
50 AnimProvider::~AnimProvider()
51 {
52  ImageManager::animTimer()->destroyed(this);
53 }
54 
55 void AnimProvider::setShowAnimations(KHTMLSettings::KAnimationAdvice newAdvice)
56 {
57  animationAdvice = newAdvice;
58 }
59 
60 }
61 
void notifyFrameChange()
Called when animation frame changes, requesting the owner to repaint.
Definition: image.cpp:89
void setShowAnimations(KHTMLSettings::KAnimationAdvice)
Enables or disables animations.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 22:47:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.