2012-10-28 09:06:00 +00:00
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "compound.xsd" version= "1.7.6.1" >
<!-- Documentation for global KWin effect methods. In doxygen XML format as this can be converted to MediaWiki -->
<!-- Use script and XSLT from kde:scratch/graesslin/kwin - scripting - api - generator to generate the documentation -->
<!-- This xml is not meant to be doxygen complient -->
<compounddef >
<compoundname > Global</compoundname>
<briefdescription > Methods and properties added to the global JavaScript object.</briefdescription>
<sectiondef kind= "property" >
<memberdef kind= "property" writable= "no" >
<type > KWin::EffectsHandler</type>
<definition > </definition>
<argsstring > </argsstring>
<name > effects</name>
<read > </read>
<detaileddescription > Global property to the core wrapper of KWin Effects</detaileddescription>
</memberdef>
<memberdef kind= "property" writable= "no" >
<type > KWin::ScriptedEffect</type>
<definition > </definition>
<argsstring > </argsstring>
<name > effect</name>
<read > </read>
<detaileddescription > Global property to the actual Effect</detaileddescription>
</memberdef>
<memberdef kind= "property" writable= "no" >
<type > object</type>
<definition > </definition>
<argsstring > </argsstring>
<name > Effect</name>
<read > </read>
<detaileddescription > Provides access to enums defined in KWin::AnimationEffect and KWin::ScriptedEffect</detaileddescription>
</memberdef>
<memberdef kind= "property" writable= "no" >
<type > object</type>
<definition > </definition>
<argsstring > </argsstring>
<name > KWin</name>
<read > </read>
<detaileddescription > Provides access to enums defined in KWin::WorkspaceWrapper</detaileddescription>
</memberdef>
2012-11-09 14:36:44 +00:00
<memberdef kind= "property" writable= "no" >
<type > object</type>
<definition > </definition>
<argsstring > </argsstring>
<name > QEasingCurve</name>
<read > </read>
< detaileddescription>Provides access to enums defined in QEasingCurve</detaileddescription>
</memberdef>
2012-10-28 09:06:00 +00:00
</sectiondef>
<sectiondef kind= "public-func" >
<memberdef kind= "function" >
2013-02-28 18:52:16 +00:00
<type > Q_SCRIPTABLE QList< quint64> </type>
<definition > QList< quint64> KWin::ScriptedEffect::animate</definition>
Adding more declarative way to animate a window in JavaScript
The current API call to animate a window does not feel very JavaScripty.
Therefore a new method "animate" is added to the global scope, which
takes a JavaScript object of the following structure:
{
window: EffectWindow, /* the window to animate, required */
duration: int, /* duration in msec, required */
curve: QEasingCurve.Type, /* global easing curve, optional */
type: Effect.Attribute, /* for first animation, optional */
from: FPx2, /* for first animation, optional */
to: FPx2, /* for first animation, optional */
delay: int, /* for first animation, optional */
animations: [ /* additional animations, optional */
{
curve: QEasingCurve.Type, /* overrides global */
type: Effect.Attribute,
from: FPx2,
to: FPx2,
delay: int
}
]
}
At least one animation needs to be specified either on the root level
or in the array of animations. Curve is the only property on root level
which is used in the animations, if not provided.
REVIEW: 107079
2012-10-27 15:43:14 +00:00
<argsstring > (settings)</argsstring>
<name > animate</name>
<read > </read>
<detaileddescription >
Schedules one or many animations for one window. The animations are defined through the settings object providing
a more declarative way to specify the animations than the animate call on the effect object. The settings object
supports the following attributes:
< syntaxhighlight lang="javascript">
{
window: EffectWindow, /* the window to animate, required */
duration: int, /* duration in msec, required */
curve: QEasingCurve.Type, /* global easing curve, optional */
type: Effect.Attribute, /* for first animation, optional */
from: FPx2, /* for first animation, optional */
to: FPx2, /* for first animation, optional */
delay: int, /* for first animation, optional */
animations: [ /* additional animations, optional */
{
curve: QEasingCurve.Type, /* overrides global */
type: Effect.Attribute,
from: FPx2,
to: FPx2,
delay: int
}
]
}
< /syntaxhighlight>
2013-02-28 18:52:16 +00:00
At least one animation or attribute setter (see below) needs to be specified either with the top-level properties or in the animations list.
</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE QList< quint64> </type>
<definition > QList< quint64> KWin::ScriptedEffect::set</definition>
<argsstring > (settings)</argsstring>
<name > set</name>
<read > </read>
<detaileddescription >
Like animate, just that the manipulation does not implicitly end with the animation. You have to explicitly cancel it.
Until then, the manipulated attribute will remain at animation target value.
</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE bool</type>
<definition > bool KWin::ScriptedEffect::cancel</definition>
<argsstring > (QList< quint64> )</argsstring>
<name > cancel</name>
<read > </read>
<detaileddescription >
Cancel one or more present animations caused and returned by KWin::ScriptedEffect::animate or KWin::ScriptedEffect::set.
For convenience you can pass a single quint64 as well.
Adding more declarative way to animate a window in JavaScript
The current API call to animate a window does not feel very JavaScripty.
Therefore a new method "animate" is added to the global scope, which
takes a JavaScript object of the following structure:
{
window: EffectWindow, /* the window to animate, required */
duration: int, /* duration in msec, required */
curve: QEasingCurve.Type, /* global easing curve, optional */
type: Effect.Attribute, /* for first animation, optional */
from: FPx2, /* for first animation, optional */
to: FPx2, /* for first animation, optional */
delay: int, /* for first animation, optional */
animations: [ /* additional animations, optional */
{
curve: QEasingCurve.Type, /* overrides global */
type: Effect.Attribute,
from: FPx2,
to: FPx2,
delay: int
}
]
}
At least one animation needs to be specified either on the root level
or in the array of animations. Curve is the only property on root level
which is used in the animations, if not provided.
REVIEW: 107079
2012-10-27 15:43:14 +00:00
</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE void</type>
2012-10-28 09:06:00 +00:00
<definition > void KWin::ScriptedEffect::print</definition>
<argsstring > (QVariant ... values)</argsstring>
<name > print</name>
<read > </read>
<detaileddescription > Prints all provided values to kDebug and as a D-Bus signal</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE int</type>
<definition > int KWin::ScriptedEffect::animationTime</definition>
<argsstring > (int duration)</argsstring>
<name > animationTime</name>
<read > </read>
<detaileddescription > Adjusts the passed in duration to the global animation time facator.</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE int</type>
<definition > int KWin::ScriptedEffect::displayWidth</definition>
<argsstring > ()</argsstring>
<name > displayWidth</name>
<read > </read>
<detaileddescription > Width of the complete display (all screens).</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE int</type>
<definition > int KWin::ScriptedEffect::displayHeight</definition>
<argsstring > ()</argsstring>
<name > displayHeight</name>
<read > </read>
<detaileddescription > Height of the complete display (all screens).</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE bool</type>
<definition > bool KWin::ScriptedEffect::registerScreenEdge</definition>
<argsstring > (ElectricBorder border, QScriptValue callback)</argsstring>
<name > registerScreenEdge</name>
<read > </read>
<detaileddescription > Registers the callback for the screen edge. When the mouse gets pushed against the given edge the callback will be invoked.</detaileddescription>
</memberdef>
<memberdef kind= "function" >
<type > Q_SCRIPTABLE bool</type>
<definition > bool KWin::ScriptedEffect::registerShortcut</definition>
<argsstring > (QString title, QString text, QString keySequence, QScriptValue callback)</argsstring>
<name > registerShortcut</name>
<read > </read>
<detaileddescription > Registers keySequence as a global shortcut. When the shortcut is invoked the callback will be called. Title and text are used to name the shortcut and make it available to the global shortcut configuration module.</detaileddescription>
</memberdef>
</sectiondef>
</compounddef>
<compounddef >
<compoundname > KWin::FPx2</compoundname>
<briefdescription > This class is used to describe the animation end points, that is from which FPx2 values to which FPx2 values an animation goes. This class contains two properties to describe two animation components individually (e.g. width and height). But it's also possible to just have one value (e.g. opacity). In this case the definition of an FPx2 can be replaced by a single value.</briefdescription>
<sectiondef kind= "property" >
<memberdef kind= "property" writable= "yes" >
<type > qreal</type>
<definition > </definition>
<argsstring > </argsstring>
<name > value1</name>
<read > </read>
<detaileddescription > </detaileddescription>
</memberdef>
<memberdef kind= "property" writable= "yes" >
<type > qreal</type>
<definition > </definition>
<argsstring > </argsstring>
<name > value2</name>
<read > </read>
<detaileddescription > </detaileddescription>
</memberdef>
</sectiondef>
</compounddef>
</doxygen>