• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KWinLibraries

KWin::TimeLine

KWin::TimeLine Class Reference
[KWin effects library]

Wrapper class for using timelines in KWin effects. More...

#include <kwineffects.h>

List of all members.


Public Types

enum  CurveShape {
  EaseInCurve = 0, EaseOutCurve, EaseInOutCurve, LinearCurve,
  SineCurve
}

Public Member Functions

void addProgress (const double progress)
void addTime (const int msec)
int duration () const
double progress () const
void removeTime (const int msec)
void setCurveShape (CurveShape curveShape)
void setDuration (const int msec)
void setProgress (const double progress)
int time () const
 TimeLine (const TimeLine &other)
 TimeLine (int duration=0)
double value () const
double valueForTime (const int msec) const
 ~TimeLine ()

Detailed Description

Wrapper class for using timelines in KWin effects.

This class provides an easy and specialized interface for effects that want a non-linear timeline. Currently, most it does is wrapping QTimeLine. In the future, this class could help using physics animations in KWin.

KWin effects will usually use this feature by keeping one TimeLine per animation, for example per effect (when only one animation is done by the effect) or per windows (in the case that multiple animations can take place at the same time (such as minizing multiple windows with a short time offset. Increasing the internal time state of the TimeLine is done either by changing the 'current' time in the TimeLine, which is an int value between 0 and the duration set (defaulting to 250msec). The current time can also be changed by setting the 'progress' of the TimeLine, a double between 0.0 and 1.0. setProgress(), addProgress(), addTime(), removeTime() can all be used to manipulate the 'current' time (and at the same time progress) of the TimeLine.

The internal state of the TimeLine is determined by the duration of the TimeLine, int in milliseconds, defaulting. the 'current' time and the current 'progress' are interchangeable, both determine the x-axis of a graph of a TimeLine. The value() returned represents the y-axis in this graph.

m_TimeLine.setProgress(0.5) would change the 'current' time of a default TimeLine to 125 msec. m_TimeLine.value() would then return the progress value (a double between 0.0 and 1.0), which can be lower than 0.5 in case the animation should start slowly, such as for the EaseInCurve. In KWin effect, the prePaintWindow() or prePaintScreen() methods have int time as one of their arguments. This int can be used to increase the 'current' time in the TimeLine. The double the is subsequently returned by value() (usually in paintWindow() or paintScreen() methods can then be used to manipulate windows, or their positions.

Definition at line 1146 of file kwineffects.h.


Member Enumeration Documentation

enum KWin::TimeLine::CurveShape

The CurveShape describes the relationship between time and values.

We can pass some of them through to QTimeLine but also invent our own ones.

Enumerator:
EaseInCurve 
EaseOutCurve 
EaseInOutCurve 
LinearCurve 
SineCurve 

Definition at line 1157 of file kwineffects.h.


The documentation for this class was generated from the following files:
  • kwineffects.h
  • kwineffects.cpp

KWinLibraries

Skip menu "KWinLibraries"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal