Merge lp:~unity-team/compiz/plugins-main-trunk.fixes-2011-03-04 into lp:~unity-team/compiz/trunk
- plugins-main-trunk.fixes-2011-03-04
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~unity-team/compiz/plugins-main-trunk.fixes-2011-03-04 |
Merge into: | lp:~unity-team/compiz/trunk |
Diff against target: |
50179 lines (+49298/-0) (has conflicts) 161 files modified
AUTHORS (+51/-0) CMakeLists.txt (+29/-0) COPYING (+340/-0) NEWS (+17/-0) animation/CMakeLists.txt (+7/-0) animation/animation.xml.in (+757/-0) animation/compiz-animation.pc.in (+12/-0) animation/include/.directory (+3/-0) animation/include/animation/animation.h (+77/-0) animation/include/animation/animeffect.h (+209/-0) animation/include/animation/extensionplugin.h (+71/-0) animation/include/animation/fade.h (+19/-0) animation/include/animation/grid.h (+106/-0) animation/include/animation/gridtransform.h (+22/-0) animation/include/animation/multi.h (+397/-0) animation/include/animation/partialwindow.h (+25/-0) animation/include/animation/persistent.h (+18/-0) animation/include/animation/point3d.h (+105/-0) animation/include/animation/screen.h (+35/-0) animation/include/animation/transform.h (+34/-0) animation/include/animation/window.h (+67/-0) animation/include/animation/zoom.h (+70/-0) animation/src/animation.cpp (+2852/-0) animation/src/curvedfold.cpp (+254/-0) animation/src/dodge.cpp (+876/-0) animation/src/dream.cpp (+156/-0) animation/src/extensionplugin.cpp (+841/-0) animation/src/fade.cpp (+61/-0) animation/src/focusfade.cpp (+131/-0) animation/src/glide.cpp (+192/-0) animation/src/grid.cpp (+711/-0) animation/src/horizontalfold.cpp (+204/-0) animation/src/magiclamp.cpp (+509/-0) animation/src/options.cpp (+354/-0) animation/src/private.h (+806/-0) animation/src/restack.cpp (+405/-0) animation/src/rollup.cpp (+150/-0) animation/src/transform.cpp (+146/-0) animation/src/wave.cpp (+144/-0) animation/src/zoomside.cpp (+451/-0) colorfilter/AUTHORS (+5/-0) colorfilter/CMakeLists.txt (+5/-0) colorfilter/colorfilter.xml.in (+66/-0) colorfilter/compiz-core-print-fragment-program.patch (+79/-0) colorfilter/data/filters/blackandwhite (+11/-0) colorfilter/data/filters/blueish-filter (+10/-0) colorfilter/data/filters/contrast (+21/-0) colorfilter/data/filters/deuteranopia (+43/-0) colorfilter/data/filters/grayscale (+6/-0) colorfilter/data/filters/negative (+9/-0) colorfilter/data/filters/negative-green (+10/-0) colorfilter/data/filters/protanopia (+43/-0) colorfilter/data/filters/sepia (+9/-0) colorfilter/data/filters/swap-green-blue (+5/-0) colorfilter/data/filters/swap-red-blue (+5/-0) colorfilter/data/filters/swap-red-green (+5/-0) colorfilter/src/colorfilter.cpp (+507/-0) colorfilter/src/colorfilter.h (+181/-0) colorfilter/src/parser.cpp (+537/-0) colorfilter/src/parser.h (+105/-0) expo/CMakeLists.txt (+7/-0) expo/expo.xml.in (+271/-0) expo/src/expo.cpp (+1379/-0) expo/src/expo.h (+162/-0) ezoom/CMakeLists.txt (+5/-0) ezoom/ezoom.xml.in (+288/-0) ezoom/src/ezoom.cpp (+1949/-0) ezoom/src/ezoom.h (+401/-0) jpeg/CMakeLists.txt (+7/-0) jpeg/imgjpeg.xml.in (+26/-0) jpeg/src/imgjpeg.cpp (+313/-0) jpeg/src/imgjpeg.h (+75/-0) kdecompat/CMakeLists.txt (+5/-0) kdecompat/kdecompat.xml.in (+59/-0) kdecompat/src/kdecompat.cpp (+979/-0) kdecompat/src/kdecompat.h (+221/-0) mag/CMakeLists.txt (+5/-0) mag/images/Gnome/image.svg (+498/-0) mag/images/Oxygen/image.svg (+4523/-0) mag/mag.xml.in (+168/-0) mag/src/mag.cpp (+1040/-0) mag/src/mag.h (+192/-0) mousepoll/CMakeLists.txt (+5/-0) mousepoll/compiz-mousepoll.pc.in (+12/-0) mousepoll/include/mousepoll/mousepoll.h (+62/-0) mousepoll/mousepoll.xml.in (+25/-0) mousepoll/src/mousepoll.cpp (+253/-0) mousepoll/src/private.h (+81/-0) neg/CMakeLists.txt (+5/-0) neg/neg.xml.in (+46/-0) neg/src/neg.cpp (+581/-0) neg/src/neg.h (+114/-0) opacify/CMakeLists.txt (+5/-0) opacify/opacify.xml.in (+90/-0) opacify/src/opacify.cpp (+435/-0) opacify/src/opacify.h (+148/-0) put/CMakeLists.txt (+5/-0) put/put.xml.in (+364/-0) put/src/put.cpp (+1298/-0) put/src/put.h (+212/-0) resizeinfo/CMakeLists.txt (+5/-0) resizeinfo/resizeinfo.xml.in (+73/-0) resizeinfo/src/resizeinfo.cpp (+528/-0) resizeinfo/src/resizeinfo.h (+145/-0) ring/CMakeLists.txt (+5/-0) ring/ring.xml.in (+252/-0) ring/src/ring.cpp (+1370/-0) ring/src/ring.h (+266/-0) scaleaddon/CMakeLists.txt (+5/-0) scaleaddon/scaleaddon.xml.in (+187/-0) scaleaddon/src/scaleaddon.cpp (+1307/-0) scaleaddon/src/scaleaddon.h (+160/-0) session/.gitignore (+1/-0) session/CMakeLists.txt (+5/-0) session/session.xml.in (+27/-0) session/src/session.cpp (+790/-0) session/src/session.h (+126/-0) shift/CMakeLists.txt (+5/-0) shift/shift.xml.in (+393/-0) shift/src/shift.cpp (+2144/-0) shift/src/shift.h (+323/-0) snap/CMakeLists.txt (+5/-0) snap/snap.xml.in (+100/-0) snap/src/snap.cpp (+831/-0) snap/src/snap.h (+168/-0) staticswitcher/CMakeLists.txt (+5/-0) staticswitcher/src/staticswitcher.cpp (+1347/-0) staticswitcher/src/staticswitcher.h (+176/-0) staticswitcher/staticswitcher.xml.in (+298/-0) text/CMakeLists.txt (+5/-0) text/compiz-text.pc.in (+12/-0) text/include/text/text.h (+92/-0) text/src/private.h (+106/-0) text/src/text.cpp (+585/-0) text/text.xml.in (+18/-0) thumbnail/CMakeLists.txt (+5/-0) thumbnail/src/thumbnail.cpp (+1050/-0) thumbnail/src/thumbnail.h (+208/-0) thumbnail/src/thumbnail_tex.h (+313/-0) thumbnail/thumbnail.xml.in (+117/-0) titleinfo/CMakeLists.txt (+5/-0) titleinfo/src/titleinfo.cpp (+297/-0) titleinfo/src/titleinfo.h (+113/-0) titleinfo/titleinfo.xml.in (+27/-0) vpswitch/CMakeLists.txt (+5/-0) vpswitch/src/vpswitch.cpp (+367/-0) vpswitch/src/vpswitch.h (+136/-0) vpswitch/vpswitch.xml.in (+126/-0) wall/CMakeLists.txt (+5/-0) wall/src/wall.cpp (+1755/-0) wall/src/wall.h (+208/-0) wall/wall.xml.in (+361/-0) winrules/CMakeLists.txt (+5/-0) winrules/src/winrules.cpp (+554/-0) winrules/src/winrules.h (+125/-0) winrules/winrules.xml.in (+120/-0) workarounds/CMakeLists.txt (+5/-0) workarounds/LICENSE (+340/-0) workarounds/src/workarounds.cpp (+1177/-0) workarounds/src/workarounds.h (+213/-0) workarounds/workarounds.xml.in (+106/-0) Conflict adding file AUTHORS. Moved existing file to AUTHORS.moved. Conflict adding file CMakeLists.txt. Moved existing file to CMakeLists.txt.moved. Conflict adding file COPYING. Moved existing file to COPYING.moved. Conflict adding file NEWS. Moved existing file to NEWS.moved. |
To merge this branch: | bzr merge lp:~unity-team/compiz/plugins-main-trunk.fixes-2011-03-04 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Didier Roche-Tolomelli | Needs Fixing | ||
Review via email:
|
This proposal has been superseded by a proposal from 2011-04-08.
Commit message
Description of the change
Allows expo to match the visual design better
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sam Spilsbury (smspillaz) wrote : | # |
You're right, somehow it ended up on lp:compiz again :/
On Fri, Apr 8, 2011 at 4:22 PM, Didier Roche <email address hidden> wrote:
> Review: Needs Fixing
> The diff has conflicts, did you propose to the right branch?
>
> It seems an UI change, that will be nice that you do the paper work here: https:/
> --
> https:/
> Your team Unity Team is subscribed to branch lp:~unity-team/compiz/trunk.
>
--
Sam Spilsbury
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sam Spilsbury (smspillaz) wrote : | # |
You're right, somehow it ended up on lp:compiz again :/
On Fri, Apr 8, 2011 at 4:22 PM, Didier Roche <email address hidden> wrote:
> Review: Needs Fixing
> The diff has conflicts, did you propose to the right branch?
>
> It seems an UI change, that will be nice that you do the paper work here: https:/
> --
> https:/
> Your team Unity Team is subscribed to branch lp:~unity-team/compiz/trunk.
>
--
Sam Spilsbury
- 5. By Sam Spilsbury
-
Much better implementation. Default should be X Offset: 64, Y Offset: 24
Unmerged revisions
- 5. By Sam Spilsbury
-
Much better implementation. Default should be X Offset: 64, Y Offset: 24
- 4. By Sam Spilsbury
-
Allow distance to be pulled back a bit further, add X and Y offset options for expo
- 3. By David Barth
-
fix embarassing typo
- 2. By David Barth
-
merge lp:~unity-team/compiz/plugins-main-trunk.fix_wrong_window_move_expo
- 1. By David Barth
-
initial import from compiz-
plugins- main_0. 9.4git20110322. orig.tar. gz
Preview Diff
1 | === added file 'AUTHORS' |
2 | --- AUTHORS 1970-01-01 00:00:00 +0000 |
3 | +++ AUTHORS 2011-04-08 08:14:44 +0000 |
4 | @@ -0,0 +1,51 @@ |
5 | +Lead Developers: |
6 | +-------------------------------------------- |
7 | + Danny Baumann <dannybaumann@web.de> |
8 | + David Reveman <davidr@novell.com> |
9 | + Dennis Kasprzyk <onestone@opencompositing.org> |
10 | + Erkin Bahceci <erkinbah@gmail.com> |
11 | + Guillaume Seguin - iXce <guillaume@segu.in> |
12 | + Kristian Lyngstøl <kristian@bohemians.org> |
13 | + |
14 | +Contributors: |
15 | +-------------------------------------------- |
16 | + Andrew Wedderburn(artwork) <andrew.wedderburn@gmail.com> |
17 | + Treviño - 3v1n0 <trevi55@gmail.com> |
18 | + Travis Watkins <amaranth@ubuntu.com> |
19 | + Roland Baer |
20 | + Robert Carr |
21 | + Quinnstorm <livinglatexkali@gmail.com> |
22 | + Roi Cohen <roico.beryl@gmail.com> |
23 | + Andrew Riedi <andrewriedi@gmail.com> |
24 | + Darryll Truchan - moppsy <moppsy@comcast.net> |
25 | + |
26 | +Translators: |
27 | +-------------------------------------------- |
28 | + de Patrick Niklaus <patrick.niklaus@googlemail.com>, Danny Baumann <dannybaumann@web.de>, Nick Bauermeister <Forlong@gmx.de>, Thorsten Sperber <trex2003@gmx.de>, Markus Latarius <markus.latarius@gmail.com>, Johannes Engel <j-engel@gmx.de> |
29 | + el Δημήτρης (djdoo) <jimdusis@yahoo.gr>, Βασίλης (Aneurysm) <bill_rapman@yahoo.com>, Κώστας (diafanos) <kostasagn@hotmail.com>, Thodo Mitch (Teddy) <thodo_mitch@hotmail.com>, Dimman Ramone (dimmanramone) <ramone@online.ie> |
30 | + fr iXce - Guillaume Seguin <guillaume@segu.in>, Sylvain Debray (syldeb35) <sylvain.debray@wanadoo.fr>, xsnake - Carl Garand <carlgarand@hotmail.com> |
31 | + gu Ankit Patel <ankit@redhat.com> |
32 | + it Marco Trevisan (Treviño) <trevi55@gmail.com>, Fabio Fiorentini (Ahren / FaBBio) <fabio.fiorentini@gmail.com>, Andrea De Iacovo (Firstbit)<andrea.de.iacovo@gmail.com>, Emiliano Perulli <emiliano.perulli@alice.it> |
33 | + pl Karol Sikora (elektrrrus) <elektrrrus at gmail dot com>, Adam Kremienowski (kremien) <akremien at gmail dot com>, Jakub Chromiak (silverado)<silvervoxer@gmail.com>, Mariusz Fik (fisiu) <fisiu82@gmail.com> |
34 | + pt Nicolau Goncalves (Excentrik) <excentriko@gmail.com> |
35 | + sv Daniel Nylander <po@danielnylander.se>, Erik Eloff (Loffe) <erik@eloff.se> |
36 | + zh Thruth Wang <gubotruth@gmail.com> |
37 | + |
38 | +Note: |
39 | +------------------------------------------------------------------------------- |
40 | +If you have contributed something significant to compiz-plugins |
41 | +and your name is missing here, please email the lead developers |
42 | +with your Full name, email address, country and a brief |
43 | +reminder of what you have done. |
44 | + |
45 | +Format : |
46 | +------------------------------------------------------------------------------- |
47 | +In order to parse AUTHORS files some rules must be followed : |
48 | + |
49 | +1 - Each first chapter line must end by ':' |
50 | +The recognized chapter names are : |
51 | +"Developer:", "Developers:", "Contributors:", Note:", "Website:", "Documenters:" |
52 | +and "Translators:". |
53 | + |
54 | +2 - Each item of the "Translators" chapter must begin by the locale keyword. |
55 | +This keyword must be followed by a space. |
56 | |
57 | === renamed file 'AUTHORS' => 'AUTHORS.moved' |
58 | === added file 'CMakeLists.txt' |
59 | --- CMakeLists.txt 1970-01-01 00:00:00 +0000 |
60 | +++ CMakeLists.txt 2011-04-08 08:14:44 +0000 |
61 | @@ -0,0 +1,29 @@ |
62 | +project (compiz-plugins-main) |
63 | + |
64 | +cmake_minimum_required (VERSION 2.4) |
65 | + |
66 | +find_package (Compiz REQUIRED) |
67 | + |
68 | +include (CompizCommon) |
69 | +include (CompizPackage) |
70 | + |
71 | +set (COMPIZ_VERSION_MAJOR 0) |
72 | +set (COMPIZ_VERSION_MINOR 9) |
73 | +set (COMPIZ_VERSION_MICRO 2) |
74 | +set (COMPIZ_VERSION_MACRO 1) |
75 | +set (VERSION ${COMPIZ_VERSION_MAJOR}.${COMPIZ_VERSION_MINOR}.${COMPIZ_VERSION_MICRO}.${COMPIZ_VERSION_MICRO}) |
76 | + |
77 | +set (COMPIZ_PLUGIN_INSTALL_TYPE "package") |
78 | + |
79 | +set (ALL_LINGUAS af ar bg bn bn_IN bs ca cs cy da de el en_GB en_US es eu et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl or pa pl pt pt_BR ro ru sk sl sr sv ta tr uk vi xh zh_CN zh_TW zu) |
80 | +set (GETTEXT_PACKAGE compiz-plugins-main) |
81 | + |
82 | +compiz_add_plugins_in_folder ("${CMAKE_SOURCE_DIR}") |
83 | + |
84 | +compiz_print_configure_header ("Compiz Plugins Main") |
85 | +compiz_print_plugin_stats ("${CMAKE_SOURCE_DIR}") |
86 | +compiz_print_configure_footer () |
87 | + |
88 | +compiz_package_generation ("Compiz Plugins Main") |
89 | +compiz_add_git_dist () |
90 | +compiz_add_uninstall () |
91 | |
92 | === renamed file 'CMakeLists.txt' => 'CMakeLists.txt.moved' |
93 | === added file 'COPYING' |
94 | --- COPYING 1970-01-01 00:00:00 +0000 |
95 | +++ COPYING 2011-04-08 08:14:44 +0000 |
96 | @@ -0,0 +1,340 @@ |
97 | + GNU GENERAL PUBLIC LICENSE |
98 | + Version 2, June 1991 |
99 | + |
100 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
101 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
102 | + Everyone is permitted to copy and distribute verbatim copies |
103 | + of this license document, but changing it is not allowed. |
104 | + |
105 | + Preamble |
106 | + |
107 | + The licenses for most software are designed to take away your |
108 | +freedom to share and change it. By contrast, the GNU General Public |
109 | +License is intended to guarantee your freedom to share and change free |
110 | +software--to make sure the software is free for all its users. This |
111 | +General Public License applies to most of the Free Software |
112 | +Foundation's software and to any other program whose authors commit to |
113 | +using it. (Some other Free Software Foundation software is covered by |
114 | +the GNU Library General Public License instead.) You can apply it to |
115 | +your programs, too. |
116 | + |
117 | + When we speak of free software, we are referring to freedom, not |
118 | +price. Our General Public Licenses are designed to make sure that you |
119 | +have the freedom to distribute copies of free software (and charge for |
120 | +this service if you wish), that you receive source code or can get it |
121 | +if you want it, that you can change the software or use pieces of it |
122 | +in new free programs; and that you know you can do these things. |
123 | + |
124 | + To protect your rights, we need to make restrictions that forbid |
125 | +anyone to deny you these rights or to ask you to surrender the rights. |
126 | +These restrictions translate to certain responsibilities for you if you |
127 | +distribute copies of the software, or if you modify it. |
128 | + |
129 | + For example, if you distribute copies of such a program, whether |
130 | +gratis or for a fee, you must give the recipients all the rights that |
131 | +you have. You must make sure that they, too, receive or can get the |
132 | +source code. And you must show them these terms so they know their |
133 | +rights. |
134 | + |
135 | + We protect your rights with two steps: (1) copyright the software, and |
136 | +(2) offer you this license which gives you legal permission to copy, |
137 | +distribute and/or modify the software. |
138 | + |
139 | + Also, for each author's protection and ours, we want to make certain |
140 | +that everyone understands that there is no warranty for this free |
141 | +software. If the software is modified by someone else and passed on, we |
142 | +want its recipients to know that what they have is not the original, so |
143 | +that any problems introduced by others will not reflect on the original |
144 | +authors' reputations. |
145 | + |
146 | + Finally, any free program is threatened constantly by software |
147 | +patents. We wish to avoid the danger that redistributors of a free |
148 | +program will individually obtain patent licenses, in effect making the |
149 | +program proprietary. To prevent this, we have made it clear that any |
150 | +patent must be licensed for everyone's free use or not licensed at all. |
151 | + |
152 | + The precise terms and conditions for copying, distribution and |
153 | +modification follow. |
154 | + |
155 | |
156 | + GNU GENERAL PUBLIC LICENSE |
157 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
158 | + |
159 | + 0. This License applies to any program or other work which contains |
160 | +a notice placed by the copyright holder saying it may be distributed |
161 | +under the terms of this General Public License. The "Program", below, |
162 | +refers to any such program or work, and a "work based on the Program" |
163 | +means either the Program or any derivative work under copyright law: |
164 | +that is to say, a work containing the Program or a portion of it, |
165 | +either verbatim or with modifications and/or translated into another |
166 | +language. (Hereinafter, translation is included without limitation in |
167 | +the term "modification".) Each licensee is addressed as "you". |
168 | + |
169 | +Activities other than copying, distribution and modification are not |
170 | +covered by this License; they are outside its scope. The act of |
171 | +running the Program is not restricted, and the output from the Program |
172 | +is covered only if its contents constitute a work based on the |
173 | +Program (independent of having been made by running the Program). |
174 | +Whether that is true depends on what the Program does. |
175 | + |
176 | + 1. You may copy and distribute verbatim copies of the Program's |
177 | +source code as you receive it, in any medium, provided that you |
178 | +conspicuously and appropriately publish on each copy an appropriate |
179 | +copyright notice and disclaimer of warranty; keep intact all the |
180 | +notices that refer to this License and to the absence of any warranty; |
181 | +and give any other recipients of the Program a copy of this License |
182 | +along with the Program. |
183 | + |
184 | +You may charge a fee for the physical act of transferring a copy, and |
185 | +you may at your option offer warranty protection in exchange for a fee. |
186 | + |
187 | + 2. You may modify your copy or copies of the Program or any portion |
188 | +of it, thus forming a work based on the Program, and copy and |
189 | +distribute such modifications or work under the terms of Section 1 |
190 | +above, provided that you also meet all of these conditions: |
191 | + |
192 | + a) You must cause the modified files to carry prominent notices |
193 | + stating that you changed the files and the date of any change. |
194 | + |
195 | + b) You must cause any work that you distribute or publish, that in |
196 | + whole or in part contains or is derived from the Program or any |
197 | + part thereof, to be licensed as a whole at no charge to all third |
198 | + parties under the terms of this License. |
199 | + |
200 | + c) If the modified program normally reads commands interactively |
201 | + when run, you must cause it, when started running for such |
202 | + interactive use in the most ordinary way, to print or display an |
203 | + announcement including an appropriate copyright notice and a |
204 | + notice that there is no warranty (or else, saying that you provide |
205 | + a warranty) and that users may redistribute the program under |
206 | + these conditions, and telling the user how to view a copy of this |
207 | + License. (Exception: if the Program itself is interactive but |
208 | + does not normally print such an announcement, your work based on |
209 | + the Program is not required to print an announcement.) |
210 | + |
211 | |
212 | +These requirements apply to the modified work as a whole. If |
213 | +identifiable sections of that work are not derived from the Program, |
214 | +and can be reasonably considered independent and separate works in |
215 | +themselves, then this License, and its terms, do not apply to those |
216 | +sections when you distribute them as separate works. But when you |
217 | +distribute the same sections as part of a whole which is a work based |
218 | +on the Program, the distribution of the whole must be on the terms of |
219 | +this License, whose permissions for other licensees extend to the |
220 | +entire whole, and thus to each and every part regardless of who wrote it. |
221 | + |
222 | +Thus, it is not the intent of this section to claim rights or contest |
223 | +your rights to work written entirely by you; rather, the intent is to |
224 | +exercise the right to control the distribution of derivative or |
225 | +collective works based on the Program. |
226 | + |
227 | +In addition, mere aggregation of another work not based on the Program |
228 | +with the Program (or with a work based on the Program) on a volume of |
229 | +a storage or distribution medium does not bring the other work under |
230 | +the scope of this License. |
231 | + |
232 | + 3. You may copy and distribute the Program (or a work based on it, |
233 | +under Section 2) in object code or executable form under the terms of |
234 | +Sections 1 and 2 above provided that you also do one of the following: |
235 | + |
236 | + a) Accompany it with the complete corresponding machine-readable |
237 | + source code, which must be distributed under the terms of Sections |
238 | + 1 and 2 above on a medium customarily used for software interchange; or, |
239 | + |
240 | + b) Accompany it with a written offer, valid for at least three |
241 | + years, to give any third party, for a charge no more than your |
242 | + cost of physically performing source distribution, a complete |
243 | + machine-readable copy of the corresponding source code, to be |
244 | + distributed under the terms of Sections 1 and 2 above on a medium |
245 | + customarily used for software interchange; or, |
246 | + |
247 | + c) Accompany it with the information you received as to the offer |
248 | + to distribute corresponding source code. (This alternative is |
249 | + allowed only for noncommercial distribution and only if you |
250 | + received the program in object code or executable form with such |
251 | + an offer, in accord with Subsection b above.) |
252 | + |
253 | +The source code for a work means the preferred form of the work for |
254 | +making modifications to it. For an executable work, complete source |
255 | +code means all the source code for all modules it contains, plus any |
256 | +associated interface definition files, plus the scripts used to |
257 | +control compilation and installation of the executable. However, as a |
258 | +special exception, the source code distributed need not include |
259 | +anything that is normally distributed (in either source or binary |
260 | +form) with the major components (compiler, kernel, and so on) of the |
261 | +operating system on which the executable runs, unless that component |
262 | +itself accompanies the executable. |
263 | + |
264 | +If distribution of executable or object code is made by offering |
265 | +access to copy from a designated place, then offering equivalent |
266 | +access to copy the source code from the same place counts as |
267 | +distribution of the source code, even though third parties are not |
268 | +compelled to copy the source along with the object code. |
269 | + |
270 | |
271 | + 4. You may not copy, modify, sublicense, or distribute the Program |
272 | +except as expressly provided under this License. Any attempt |
273 | +otherwise to copy, modify, sublicense or distribute the Program is |
274 | +void, and will automatically terminate your rights under this License. |
275 | +However, parties who have received copies, or rights, from you under |
276 | +this License will not have their licenses terminated so long as such |
277 | +parties remain in full compliance. |
278 | + |
279 | + 5. You are not required to accept this License, since you have not |
280 | +signed it. However, nothing else grants you permission to modify or |
281 | +distribute the Program or its derivative works. These actions are |
282 | +prohibited by law if you do not accept this License. Therefore, by |
283 | +modifying or distributing the Program (or any work based on the |
284 | +Program), you indicate your acceptance of this License to do so, and |
285 | +all its terms and conditions for copying, distributing or modifying |
286 | +the Program or works based on it. |
287 | + |
288 | + 6. Each time you redistribute the Program (or any work based on the |
289 | +Program), the recipient automatically receives a license from the |
290 | +original licensor to copy, distribute or modify the Program subject to |
291 | +these terms and conditions. You may not impose any further |
292 | +restrictions on the recipients' exercise of the rights granted herein. |
293 | +You are not responsible for enforcing compliance by third parties to |
294 | +this License. |
295 | + |
296 | + 7. If, as a consequence of a court judgment or allegation of patent |
297 | +infringement or for any other reason (not limited to patent issues), |
298 | +conditions are imposed on you (whether by court order, agreement or |
299 | +otherwise) that contradict the conditions of this License, they do not |
300 | +excuse you from the conditions of this License. If you cannot |
301 | +distribute so as to satisfy simultaneously your obligations under this |
302 | +License and any other pertinent obligations, then as a consequence you |
303 | +may not distribute the Program at all. For example, if a patent |
304 | +license would not permit royalty-free redistribution of the Program by |
305 | +all those who receive copies directly or indirectly through you, then |
306 | +the only way you could satisfy both it and this License would be to |
307 | +refrain entirely from distribution of the Program. |
308 | + |
309 | +If any portion of this section is held invalid or unenforceable under |
310 | +any particular circumstance, the balance of the section is intended to |
311 | +apply and the section as a whole is intended to apply in other |
312 | +circumstances. |
313 | + |
314 | +It is not the purpose of this section to induce you to infringe any |
315 | +patents or other property right claims or to contest validity of any |
316 | +such claims; this section has the sole purpose of protecting the |
317 | +integrity of the free software distribution system, which is |
318 | +implemented by public license practices. Many people have made |
319 | +generous contributions to the wide range of software distributed |
320 | +through that system in reliance on consistent application of that |
321 | +system; it is up to the author/donor to decide if he or she is willing |
322 | +to distribute software through any other system and a licensee cannot |
323 | +impose that choice. |
324 | + |
325 | +This section is intended to make thoroughly clear what is believed to |
326 | +be a consequence of the rest of this License. |
327 | + |
328 | |
329 | + 8. If the distribution and/or use of the Program is restricted in |
330 | +certain countries either by patents or by copyrighted interfaces, the |
331 | +original copyright holder who places the Program under this License |
332 | +may add an explicit geographical distribution limitation excluding |
333 | +those countries, so that distribution is permitted only in or among |
334 | +countries not thus excluded. In such case, this License incorporates |
335 | +the limitation as if written in the body of this License. |
336 | + |
337 | + 9. The Free Software Foundation may publish revised and/or new versions |
338 | +of the General Public License from time to time. Such new versions will |
339 | +be similar in spirit to the present version, but may differ in detail to |
340 | +address new problems or concerns. |
341 | + |
342 | +Each version is given a distinguishing version number. If the Program |
343 | +specifies a version number of this License which applies to it and "any |
344 | +later version", you have the option of following the terms and conditions |
345 | +either of that version or of any later version published by the Free |
346 | +Software Foundation. If the Program does not specify a version number of |
347 | +this License, you may choose any version ever published by the Free Software |
348 | +Foundation. |
349 | + |
350 | + 10. If you wish to incorporate parts of the Program into other free |
351 | +programs whose distribution conditions are different, write to the author |
352 | +to ask for permission. For software which is copyrighted by the Free |
353 | +Software Foundation, write to the Free Software Foundation; we sometimes |
354 | +make exceptions for this. Our decision will be guided by the two goals |
355 | +of preserving the free status of all derivatives of our free software and |
356 | +of promoting the sharing and reuse of software generally. |
357 | + |
358 | + NO WARRANTY |
359 | + |
360 | + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
361 | +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
362 | +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
363 | +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
364 | +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
365 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
366 | +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
367 | +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
368 | +REPAIR OR CORRECTION. |
369 | + |
370 | + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
371 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
372 | +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
373 | +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
374 | +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
375 | +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
376 | +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
377 | +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
378 | +POSSIBILITY OF SUCH DAMAGES. |
379 | + |
380 | + END OF TERMS AND CONDITIONS |
381 | + |
382 | |
383 | + How to Apply These Terms to Your New Programs |
384 | + |
385 | + If you develop a new program, and you want it to be of the greatest |
386 | +possible use to the public, the best way to achieve this is to make it |
387 | +free software which everyone can redistribute and change under these terms. |
388 | + |
389 | + To do so, attach the following notices to the program. It is safest |
390 | +to attach them to the start of each source file to most effectively |
391 | +convey the exclusion of warranty; and each file should have at least |
392 | +the "copyright" line and a pointer to where the full notice is found. |
393 | + |
394 | + <one line to give the program's name and a brief idea of what it does.> |
395 | + Copyright (C) <year> <name of author> |
396 | + |
397 | + This program is free software; you can redistribute it and/or modify |
398 | + it under the terms of the GNU General Public License as published by |
399 | + the Free Software Foundation; either version 2 of the License, or |
400 | + (at your option) any later version. |
401 | + |
402 | + This program is distributed in the hope that it will be useful, |
403 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
404 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
405 | + GNU General Public License for more details. |
406 | + |
407 | + You should have received a copy of the GNU General Public License |
408 | + along with this program; if not, write to the Free Software |
409 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
410 | + |
411 | + |
412 | +Also add information on how to contact you by electronic and paper mail. |
413 | + |
414 | +If the program is interactive, make it output a short notice like this |
415 | +when it starts in an interactive mode: |
416 | + |
417 | + Gnomovision version 69, Copyright (C) year name of author |
418 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
419 | + This is free software, and you are welcome to redistribute it |
420 | + under certain conditions; type `show c' for details. |
421 | + |
422 | +The hypothetical commands `show w' and `show c' should show the appropriate |
423 | +parts of the General Public License. Of course, the commands you use may |
424 | +be called something other than `show w' and `show c'; they could even be |
425 | +mouse-clicks or menu items--whatever suits your program. |
426 | + |
427 | +You should also get your employer (if you work as a programmer) or your |
428 | +school, if any, to sign a "copyright disclaimer" for the program, if |
429 | +necessary. Here is a sample; alter the names: |
430 | + |
431 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
432 | + `Gnomovision' (which makes passes at compilers) written by James Hacker. |
433 | + |
434 | + <signature of Ty Coon>, 1 April 1989 |
435 | + Ty Coon, President of Vice |
436 | + |
437 | +This General Public License does not permit incorporating your program into |
438 | +proprietary programs. If your program is a subroutine library, you may |
439 | +consider it more useful to permit linking proprietary applications with the |
440 | +library. If this is what you want to do, use the GNU Library General |
441 | +Public License instead of this License. |
442 | |
443 | === renamed file 'COPYING' => 'COPYING.moved' |
444 | === added file 'NEWS' |
445 | --- NEWS 1970-01-01 00:00:00 +0000 |
446 | +++ NEWS 2011-04-08 08:14:44 +0000 |
447 | @@ -0,0 +1,17 @@ |
448 | +Release 0.9.2 (2010-10-24 Sam Spilsbury <smspillaz@gmail.com>) |
449 | +============================================================== |
450 | +Development release. |
451 | + |
452 | +Added MultiAnim class to Animation plugin |
453 | + |
454 | +Added support for KDE 4.5 blur hinting |
455 | + |
456 | +Added "natural" scale mode |
457 | + |
458 | +Added fake mninimization support |
459 | + |
460 | +Use libxml to write the session save file |
461 | + |
462 | +Release 0.9.2.1 (2010-11-06 Sam Spilsbury <sam.spilsbury@canonical.com>) |
463 | +======================================================================== |
464 | +Bugfix release. |
465 | |
466 | === renamed file 'NEWS' => 'NEWS.moved' |
467 | === added directory 'animation' |
468 | === added file 'animation/CMakeLists.txt' |
469 | --- animation/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
470 | +++ animation/CMakeLists.txt 2011-04-08 08:14:44 +0000 |
471 | @@ -0,0 +1,7 @@ |
472 | +find_package (Compiz REQUIRED) |
473 | +include (CompizPlugin) |
474 | +include (FindOpenGL) |
475 | + |
476 | +if (OPENGL_GLU_FOUND) |
477 | + compiz_plugin (animation PLUGINDEPS composite opengl LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR}) |
478 | +endif (OPENGL_GLU_FOUND) |
479 | |
480 | === added file 'animation/animation.xml.in' |
481 | --- animation/animation.xml.in 1970-01-01 00:00:00 +0000 |
482 | +++ animation/animation.xml.in 2011-04-08 08:14:44 +0000 |
483 | @@ -0,0 +1,757 @@ |
484 | +<compiz> |
485 | + <!-- animation metadata --> |
486 | + <plugin name="animation" useBcop="true"> |
487 | + <_short>Animations</_short> |
488 | + <_long>Use various animations as window effects</_long> |
489 | + <feature>windowanimations</feature> |
490 | + <category>Effects</category> |
491 | + <deps> |
492 | + <requirement> |
493 | + <plugin>opengl</plugin> |
494 | + <plugin>regex</plugin> |
495 | + </requirement> |
496 | + <relation type="after"> |
497 | + <plugin>decor</plugin> |
498 | + <plugin>composite</plugin> |
499 | + <plugin>opengl</plugin> |
500 | + <plugin>regex</plugin> |
501 | + </relation> |
502 | + <relation type="before"> |
503 | + <plugin>fade</plugin> |
504 | + </relation> |
505 | + </deps> |
506 | + |
507 | + <options> |
508 | + |
509 | + <group> |
510 | + <_short>Open Animation</_short> |
511 | + |
512 | + <subgroup> |
513 | + <_short>Animation Selection</_short> |
514 | + <option name="open_effects" type="list"> |
515 | + <_short>Open Effect</_short> |
516 | + <_long>The animation effect shown when creating a window.</_long> |
517 | + <type>string</type> |
518 | + <extensible/> |
519 | + <sort start="2"/> |
520 | + <default> |
521 | + <value>animation:Zoom</value> |
522 | + <value>animation:Fade</value> |
523 | + <value>animation:Fade</value> |
524 | + </default> |
525 | + </option> |
526 | + <option name="open_durations" type="list"> |
527 | + <_short>Duration</_short> |
528 | + <_long>Animation duration in milliseconds for open effect.</_long> |
529 | + <type>int</type> |
530 | + <min>50</min> |
531 | + <max>4000</max> |
532 | + <default> |
533 | + <value>200</value> |
534 | + <value>150</value> |
535 | + <value>150</value> |
536 | + </default> |
537 | + </option> |
538 | + <option name="open_matches" type="list"> |
539 | + <_short>Window Match</_short> |
540 | + <_long>The windows that will be animated.</_long> |
541 | + <type>match</type> |
542 | + <default> |
543 | + <value>(type=Normal | Dialog | ModalDialog | Unknown) & !(name=gnome-screensaver)</value> |
544 | + <value>(type=Menu | PopupMenu | DropdownMenu | Combo)</value> |
545 | + <value>(type=Tooltip | Notification | Utility) & !(name=compiz) & !(title=notify-osd)</value> |
546 | + </default> |
547 | + </option> |
548 | + <option name="open_options" type="list"> |
549 | + <_short>Options</_short> |
550 | + <_long>Comma separated list of option value assignments to override effect settings, e.g.: fire_color=#0080ffff, fire_particles=700, fire_smoke=1</_long> |
551 | + <type>string</type> |
552 | + <default> |
553 | + <value></value> |
554 | + <value></value> |
555 | + <value></value> |
556 | + </default> |
557 | + </option> |
558 | + </subgroup> |
559 | + |
560 | + <subgroup> |
561 | + <_short>Random Effects</_short> |
562 | + <option name="open_random_effects" type="list"> |
563 | + <_short>Pool</_short> |
564 | + <_long>Pool of effects to be chosen from if Random effect is selected. Click reset to use all effects.</_long> |
565 | + <type>string</type> |
566 | + <extensible/> |
567 | + <sort start="2"/> |
568 | + <default> |
569 | + </default> |
570 | + </option> |
571 | + </subgroup> |
572 | + |
573 | + </group> |
574 | + |
575 | + <group> |
576 | + <_short>Close Animation</_short> |
577 | + |
578 | + <subgroup> |
579 | + <_short>Animation Selection</_short> |
580 | + <option name="close_effects" type="list"> |
581 | + <_short>Close Effect</_short> |
582 | + <_long>The animation effect shown when closing a window.</_long> |
583 | + <type>string</type> |
584 | + <extensible/> |
585 | + <sort start="2"/> |
586 | + <default> |
587 | + <value>animation:Zoom</value> |
588 | + <value>animation:Fade</value> |
589 | + <value>animation:Fade</value> |
590 | + </default> |
591 | + </option> |
592 | + <option name="close_durations" type="list"> |
593 | + <_short>Duration</_short> |
594 | + <_long>Animation duration in milliseconds for close effect.</_long> |
595 | + <type>int</type> |
596 | + <min>50</min> |
597 | + <max>4000</max> |
598 | + <default> |
599 | + <value>200</value> |
600 | + <value>150</value> |
601 | + <value>150</value> |
602 | + </default> |
603 | + </option> |
604 | + <option name="close_matches" type="list"> |
605 | + <_short>Window Match</_short> |
606 | + <_long>The windows that will be animated.</_long> |
607 | + <type>match</type> |
608 | + <default> |
609 | + <value>(type=Normal | Dialog | ModalDialog | Unknown) & !(name=gnome-screensaver)</value> |
610 | + <value>(type=Menu | PopupMenu | DropdownMenu | Combo)</value> |
611 | + <value>(type=Tooltip | Notification | Utility) & !(name=compiz) & !(title=notify-osd)</value> |
612 | + </default> |
613 | + </option> |
614 | + <option name="close_options" type="list"> |
615 | + <_short>Options</_short> |
616 | + <_long>Comma separated list of option value assignments to override effect settings, e.g.: fire_color=#0080ffff, fire_particles=700, fire_smoke=1</_long> |
617 | + <type>string</type> |
618 | + <default> |
619 | + <value></value> |
620 | + <value></value> |
621 | + <value></value> |
622 | + </default> |
623 | + </option> |
624 | + </subgroup> |
625 | + |
626 | + <subgroup> |
627 | + <_short>Random Effects</_short> |
628 | + <option name="close_random_effects" type="list"> |
629 | + <_short>Pool</_short> |
630 | + <_long>Pool of effects to be chosen from if Random effect is selected. Click reset to use all effects.</_long> |
631 | + <type>string</type> |
632 | + <extensible/> |
633 | + <sort start="2"/> |
634 | + <default> |
635 | + </default> |
636 | + </option> |
637 | + </subgroup> |
638 | + |
639 | + </group> |
640 | + |
641 | + <group> |
642 | + <_short>Minimize Animation</_short> |
643 | + |
644 | + <subgroup> |
645 | + <_short>Animation Selection</_short> |
646 | + <option name="minimize_effects" type="list"> |
647 | + <_short>Minimize Effect</_short> |
648 | + <_long>The animation effect shown when minimizing a window.</_long> |
649 | + <type>string</type> |
650 | + <extensible/> |
651 | + <sort start="2"/> |
652 | + <default> |
653 | + <value>animation:Magic Lamp</value> |
654 | + </default> |
655 | + </option> |
656 | + <option name="minimize_durations" type="list"> |
657 | + <_short>Duration</_short> |
658 | + <_long>Animation duration in milliseconds for minimize effect.</_long> |
659 | + <type>int</type> |
660 | + <min>50</min> |
661 | + <max>4000</max> |
662 | + <default> |
663 | + <value>300</value> |
664 | + </default> |
665 | + </option> |
666 | + <option name="minimize_matches" type="list"> |
667 | + <_short>Window Match</_short> |
668 | + <_long>The windows that will be animated.</_long> |
669 | + <type>match</type> |
670 | + <default> |
671 | + <value>(type=Normal | Dialog | ModalDialog | Unknown)</value> |
672 | + </default> |
673 | + </option> |
674 | + <option name="minimize_options" type="list"> |
675 | + <_short>Options</_short> |
676 | + <_long>Comma separated list of option value assignments to override effect settings, e.g.: fire_color=#0080ffff, fire_particles=700, fire_smoke=1</_long> |
677 | + <type>string</type> |
678 | + <default> |
679 | + <value></value> |
680 | + </default> |
681 | + </option> |
682 | + </subgroup> |
683 | + |
684 | + <subgroup> |
685 | + <_short>Random Effects</_short> |
686 | + <option name="minimize_random_effects" type="list"> |
687 | + <_short>Pool</_short> |
688 | + <_long>Pool of effects to be chosen from if Random effect is selected. Click reset to use all effects.</_long> |
689 | + <type>string</type> |
690 | + <extensible/> |
691 | + <sort start="2"/> |
692 | + <default> |
693 | + </default> |
694 | + </option> |
695 | + </subgroup> |
696 | + |
697 | + </group> |
698 | + |
699 | + <group> |
700 | + <_short>Shade Animation</_short> |
701 | + |
702 | + <subgroup> |
703 | + <_short>Animation Selection</_short> |
704 | + <option name="shade_effects" type="list"> |
705 | + <_short>Shade Effect</_short> |
706 | + <_long>The animation effect shown when shading a window.</_long> |
707 | + <type>string</type> |
708 | + <extensible/> |
709 | + <sort start="2"/> |
710 | + <default> |
711 | + <value>animation:Roll Up</value> |
712 | + </default> |
713 | + </option> |
714 | + <option name="shade_durations" type="list"> |
715 | + <_short>Duration</_short> |
716 | + <_long>Animation duration in milliseconds for shade effect.</_long> |
717 | + <type>int</type> |
718 | + <min>50</min> |
719 | + <max>4000</max> |
720 | + <default> |
721 | + <value>300</value> |
722 | + </default> |
723 | + </option> |
724 | + <option name="shade_matches" type="list"> |
725 | + <_short>Window Match</_short> |
726 | + <_long>Window that should animate with this effect when shaded.</_long> |
727 | + <type>match</type> |
728 | + <default> |
729 | + <value>(type=Normal | Dialog | ModalDialog | Utility | Unknown)</value> |
730 | + </default> |
731 | + </option> |
732 | + <option name="shade_options" type="list"> |
733 | + <_short>Options</_short> |
734 | + <_long>Comma separated list of option value assignments to override effect settings, e.g.: fire_color=#0080ffff, fire_particles=700, fire_smoke=1</_long> |
735 | + <type>string</type> |
736 | + <default> |
737 | + <value></value> |
738 | + </default> |
739 | + </option> |
740 | + </subgroup> |
741 | + |
742 | + <subgroup> |
743 | + <_short>Random Effects</_short> |
744 | + <option name="shade_random_effects" type="list"> |
745 | + <_short>Pool</_short> |
746 | + <_long>Pool of effects to be chosen from if Random effect is selected. Click reset to use all effects.</_long> |
747 | + <type>string</type> |
748 | + <extensible/> |
749 | + <sort start="2"/> |
750 | + <default> |
751 | + </default> |
752 | + </option> |
753 | + </subgroup> |
754 | + |
755 | + </group> |
756 | + |
757 | + <group> |
758 | + <_short>Focus Animation</_short> |
759 | + <subgroup> |
760 | + <_short>Animation Selection</_short> |
761 | + <option name="focus_effects" type="list"> |
762 | + <_short>Focus Effect</_short> |
763 | + <_long>The animation effect shown when focusing a window.</_long> |
764 | + <type>string</type> |
765 | + <extensible/> |
766 | + <sort start="1"/> |
767 | + <default> |
768 | + <value>animation:None</value> |
769 | + </default> |
770 | + </option> |
771 | + <option name="focus_durations" type="list"> |
772 | + <_short>Duration</_short> |
773 | + <_long>Animation duration in milliseconds for focus effect.</_long> |
774 | + <type>int</type> |
775 | + <min>50</min> |
776 | + <max>4000</max> |
777 | + <default> |
778 | + <value>300</value> |
779 | + </default> |
780 | + </option> |
781 | + <option name="focus_matches" type="list"> |
782 | + <_short>Window Match</_short> |
783 | + <_long>Window that should animate with this effect when focused.</_long> |
784 | + <type>match</type> |
785 | + <default> |
786 | + <value>(type=Normal | Dialog | ModalDialog | Utility | Unknown) & !(name=compiz)</value> |
787 | + </default> |
788 | + </option> |
789 | + <option name="focus_options" type="list"> |
790 | + <_short>Options</_short> |
791 | + <_long>Comma separated list of option value assignments to override effect settings, e.g.: fire_color=#0080ffff, fire_particles=700, fire_smoke=1</_long> |
792 | + <type>string</type> |
793 | + <default> |
794 | + <value></value> |
795 | + </default> |
796 | + </option> |
797 | + </subgroup> |
798 | + </group> |
799 | + |
800 | + <group> |
801 | + <_short>Effect Settings</_short> |
802 | + <extensible/> |
803 | + |
804 | + <option name="all_random" type="bool"> |
805 | + <_short>Random Animations For All Events</_short> |
806 | + <_long>All effects are chosen randomly, ignoring the selected effect. If None is selected for an event, that event won't be animated.</_long> |
807 | + <default>false</default> |
808 | + </option> |
809 | + <option name="time_step" type="int"> |
810 | + <_short>Animation Time Step</_short> |
811 | + <_long>The amount of time in milliseconds between each render of the animation. The higher the number, the jerkier the movements become.</_long> |
812 | + <default>10</default> |
813 | + <min>1</min> |
814 | + <max>400</max> |
815 | + </option> |
816 | + |
817 | + <subgroup> |
818 | + <_short>Curved Fold</_short> |
819 | + <option name="curved_fold_amp_mult" type="float"> |
820 | + <_short>Amplitude Multiplier</_short> |
821 | + <_long>Fold amplitude (size) is multiplied by this number. Negative values fold outward.</_long> |
822 | + <default>1.0</default> |
823 | + <min>-1.5</min> |
824 | + <max>2</max> |
825 | + <precision>0.05</precision> |
826 | + </option> |
827 | + <option name="curved_fold_zoom_to_taskbar" type="bool"> |
828 | + <_short>Zoom to TaskBar on Minimize</_short> |
829 | + <_long>Whether the window should zoom to taskbar when minimized with Curved Fold effect.</_long> |
830 | + <default>true</default> |
831 | + </option> |
832 | + </subgroup> |
833 | + |
834 | + <subgroup> |
835 | + <_short>Dodge</_short> |
836 | + <option name="dodge_mode" type="int"> |
837 | + <_short>Mode</_short> |
838 | + <_long>Fixed Clicked Window: The window that is clicked on will stay fixed. All Moving: The clicked window will do a dodging action as well.</_long> |
839 | + <default>1</default> |
840 | + <min>0</min> |
841 | + <max>1</max> |
842 | + <desc> |
843 | + <value>0</value> |
844 | + <_name>Fixed Clicked Window</_name> |
845 | + </desc> |
846 | + <desc> |
847 | + <value>1</value> |
848 | + <_name>All Moving</_name> |
849 | + </desc> |
850 | + </option> |
851 | + <option name="dodge_gap_ratio" type="float"> |
852 | + <_short>Gap Ratio</_short> |
853 | + <_long>Ratio of gaps between dodge start times to focus duration.</_long> |
854 | + <default>0.5</default> |
855 | + <min>0</min> |
856 | + <max>1</max> |
857 | + <precision>0.01</precision> |
858 | + </option> |
859 | + </subgroup> |
860 | + |
861 | + <subgroup> |
862 | + <_short>Dream</_short> |
863 | + <option name="dream_zoom_to_taskbar" type="bool"> |
864 | + <_short>Zoom to TaskBar on Minimize</_short> |
865 | + <_long>Whether the window should zoom to taskbar when minimized with Dream effect.</_long> |
866 | + <default>true</default> |
867 | + </option> |
868 | + </subgroup> |
869 | + |
870 | + <subgroup> |
871 | + <_short>Glide 1</_short> |
872 | + <option name="glide1_away_position" type="float"> |
873 | + <_short>Away Position</_short> |
874 | + <_long>Closeness of window to camera at the end of the animation (1.0: Close to camera, -2.0: Away from camera).</_long> |
875 | + <default>1</default> |
876 | + <min>-2</min> |
877 | + <max>1</max> |
878 | + <precision>0.05</precision> |
879 | + </option> |
880 | + <option name="glide1_away_angle" type="float"> |
881 | + <_short>Away Angle</_short> |
882 | + <_long>Angle of window at the end of the animation.</_long> |
883 | + <default>0</default> |
884 | + <min>-540</min> |
885 | + <max>540</max> |
886 | + <precision>5</precision> |
887 | + </option> |
888 | + <option name="glide1_zoom_to_taskbar" type="bool"> |
889 | + <_short>Zoom to TaskBar on Minimize</_short> |
890 | + <_long>Whether the window should zoom to taskbar when minimized with Glide 1 effect.</_long> |
891 | + <default>false</default> |
892 | + </option> |
893 | + </subgroup> |
894 | + |
895 | + <subgroup> |
896 | + <_short>Glide 2</_short> |
897 | + <option name="glide2_away_position" type="float"> |
898 | + <_short>Away Position</_short> |
899 | + <_long>Closeness of window to camera at the end of the animation (1.0: Close to camera, -2.0: Away from camera).</_long> |
900 | + <default>-0.4</default> |
901 | + <min>-2</min> |
902 | + <max>1</max> |
903 | + <precision>0.05</precision> |
904 | + </option> |
905 | + <option name="glide2_away_angle" type="float"> |
906 | + <_short>Away Angle</_short> |
907 | + <_long>Angle of window at the end of the animation.</_long> |
908 | + <default>-45</default> |
909 | + <min>-540</min> |
910 | + <max>540</max> |
911 | + <precision>5</precision> |
912 | + </option> |
913 | + <option name="glide2_zoom_to_taskbar" type="bool"> |
914 | + <_short>Zoom to TaskBar on Minimize</_short> |
915 | + <_long>Whether the window should zoom to taskbar when minimized with Glide 2 effect.</_long> |
916 | + <default>true</default> |
917 | + </option> |
918 | + </subgroup> |
919 | + |
920 | + <subgroup> |
921 | + <_short>Horizontal Folds</_short> |
922 | + <option name="horizontal_folds_amp_mult" type="float"> |
923 | + <_short>Amplitude Multiplier</_short> |
924 | + <_long>Fold amplitude (size) is multiplied by this number. Negative values fold outward.</_long> |
925 | + <default>1.0</default> |
926 | + <min>-1</min> |
927 | + <max>3</max> |
928 | + <precision>0.05</precision> |
929 | + </option> |
930 | + <option name="horizontal_folds_num_folds" type="int"> |
931 | + <_short>Number of Horizontal Folds</_short> |
932 | + <_long>The number of horizontal folds that occur in the Horizontal Fold animation.</_long> |
933 | + <default>3</default> |
934 | + <min>1</min> |
935 | + <max>50</max> |
936 | + </option> |
937 | + <option name="horizontal_folds_zoom_to_taskbar" type="bool"> |
938 | + <_short>Zoom to TaskBar on Minimize</_short> |
939 | + <_long>Whether the window should zoom to taskbar when minimized with Horizontal Folds effect.</_long> |
940 | + <default>true</default> |
941 | + </option> |
942 | + </subgroup> |
943 | + |
944 | + <subgroup> |
945 | + <_short>Magic Lamp</_short> |
946 | + <option name="magic_lamp_moving_end" type="bool"> |
947 | + <_short>Open/Close Moving End</_short> |
948 | + <_long>On open/close, move magic lamp ending point with the mouse pointer.</_long> |
949 | + <default>true</default> |
950 | + </option> |
951 | + <option name="magic_lamp_grid_res" type="int"> |
952 | + <_short>Grid Y Resolution</_short> |
953 | + <_long>Vertex grid resolution for Magic Lamp (Y dimension only). This is the number of points used to define the curves. The higher the number, the smoother the curves. However there will be a loss of performance (CPU usage increases).</_long> |
954 | + <default>100</default> |
955 | + <min>2</min> |
956 | + <max>200</max> |
957 | + </option> |
958 | + <option name="magic_lamp_open_start_width" type="int"> |
959 | + <_short>Open Start Width</_short> |
960 | + <_long>Starting width of open effect and ending width of close effect for Magic Lamp.</_long> |
961 | + <default>30</default> |
962 | + <min>0</min> |
963 | + <max>500</max> |
964 | + </option> |
965 | + </subgroup> |
966 | + |
967 | + <subgroup> |
968 | + <_short>Magic Lamp Wavy</_short> |
969 | + <option name="magic_lamp_wavy_moving_end" type="bool"> |
970 | + <_short>Open/Close Moving End</_short> |
971 | + <_long>On open/close, move magic lamp ending point with the mouse pointer.</_long> |
972 | + <default>true</default> |
973 | + </option> |
974 | + <option name="magic_lamp_wavy_grid_res" type="int"> |
975 | + <_short>Grid Y Resolution</_short> |
976 | + <_long>Vertex grid resolution for Magic Lamp Wavy (Y dimension only). This is the number of points used to define the curves. The higher the number, the smoother the curves. However there will be a loss of performance (CPU usage increases).</_long> |
977 | + <default>100</default> |
978 | + <min>4</min> |
979 | + <max>200</max> |
980 | + </option> |
981 | + <option name="magic_lamp_wavy_max_waves" type="int"> |
982 | + <_short>Max Waves</_short> |
983 | + <_long>The maximum number of waves for Magic Lamp Wavy.</_long> |
984 | + <default>3</default> |
985 | + <min>1</min> |
986 | + <max>20</max> |
987 | + </option> |
988 | + <option name="magic_lamp_wavy_amp_min" type="float"> |
989 | + <_short>Min Wave Amplitude</_short> |
990 | + <_long>The minimum wave amplitude (size of the waves) Magic Lamp Wavy will have.</_long> |
991 | + <default>200</default> |
992 | + <min>200</min> |
993 | + <max>2000</max> |
994 | + <precision>5</precision> |
995 | + </option> |
996 | + <option name="magic_lamp_wavy_amp_max" type="float"> |
997 | + <_short>Max Wave Amplitude</_short> |
998 | + <_long>The maximum wave amplitude (size of the waves) Magic Lamp Wavy will have.</_long> |
999 | + <default>300</default> |
1000 | + <min>200</min> |
1001 | + <max>2000</max> |
1002 | + <precision>5</precision> |
1003 | + </option> |
1004 | + <option name="magic_lamp_wavy_open_start_width" type="int"> |
1005 | + <_short>Open Start Width</_short> |
1006 | + <_long>Starting width of open effect and ending width of close effect for Magic Lamp Wavy.</_long> |
1007 | + <default>30</default> |
1008 | + <min>0</min> |
1009 | + <max>500</max> |
1010 | + </option> |
1011 | + </subgroup> |
1012 | + |
1013 | + <subgroup> |
1014 | + <_short>Roll Up</_short> |
1015 | + <option name="rollup_fixed_interior" type="bool"> |
1016 | + <_short>Fixed Interior</_short> |
1017 | + <_long>Fixed window interior during the Rollup animation.</_long> |
1018 | + <default>false</default> |
1019 | + </option> |
1020 | + </subgroup> |
1021 | + |
1022 | + <subgroup> |
1023 | + <_short>Sidekick</_short> |
1024 | + <option name="sidekick_num_rotations" type="float"> |
1025 | + <_short>Number of Rotations</_short> |
1026 | + <_long>Number of rotations for Sidekick (plus or minus 10% for randomness).</_long> |
1027 | + <default>0.5</default> |
1028 | + <min>0</min> |
1029 | + <max>5</max> |
1030 | + <precision>0.01</precision> |
1031 | + </option> |
1032 | + <option name="sidekick_springiness" type="float"> |
1033 | + <_short>Springiness</_short> |
1034 | + <_long>How spring-like the Sidekick animation should be.</_long> |
1035 | + <default>0.0</default> |
1036 | + <min>0</min> |
1037 | + <max>1</max> |
1038 | + <precision>0.01</precision> |
1039 | + </option> |
1040 | + <option name="sidekick_zoom_from_center" type="int"> |
1041 | + <_short>Zoom from Center</_short> |
1042 | + <_long>Zoom from center when playing the Sidekick animation.</_long> |
1043 | + <default>0</default> |
1044 | + <min>0</min> |
1045 | + <max>3</max> |
1046 | + <desc> |
1047 | + <value>0</value> |
1048 | + <_name>Off</_name> |
1049 | + </desc> |
1050 | + <desc> |
1051 | + <value>1</value> |
1052 | + <_name>Minimize/Unminimize Only</_name> |
1053 | + </desc> |
1054 | + <desc> |
1055 | + <value>2</value> |
1056 | + <_name>Open/Close Only</_name> |
1057 | + </desc> |
1058 | + <desc> |
1059 | + <value>3</value> |
1060 | + <_name>On</_name> |
1061 | + </desc> |
1062 | + </option> |
1063 | + </subgroup> |
1064 | + |
1065 | + <subgroup> |
1066 | + <_short>Wave</_short> |
1067 | + <option name="wave_width" type="float"> |
1068 | + <_short>Wave Width</_short> |
1069 | + <_long>The width of the wave relative to the window height.</_long> |
1070 | + <default>0.7</default> |
1071 | + <min>0.02</min> |
1072 | + <max>3</max> |
1073 | + <precision>0.01</precision> |
1074 | + </option> |
1075 | + <option name="wave_amp_mult" type="float"> |
1076 | + <_short>Wave Amplitude Multiplier</_short> |
1077 | + <_long>Wave amplitude (size) is multiplied by this number. Negative values fold outward.</_long> |
1078 | + <default>1.0</default> |
1079 | + <min>-20</min> |
1080 | + <max>20</max> |
1081 | + <precision>0.1</precision> |
1082 | + </option> |
1083 | + </subgroup> |
1084 | + |
1085 | + <subgroup> |
1086 | + <_short>Zoom</_short> |
1087 | + <option name="zoom_from_center" type="int"> |
1088 | + <_short>Zoom from Center</_short> |
1089 | + <_long>Zoom from center when playing the Zoom animation.</_long> |
1090 | + <default>0</default> |
1091 | + <min>0</min> |
1092 | + <max>3</max> |
1093 | + <desc> |
1094 | + <value>0</value> |
1095 | + <_name>Off</_name> |
1096 | + </desc> |
1097 | + <desc> |
1098 | + <value>1</value> |
1099 | + <_name>Minimize/Unminimize Only</_name> |
1100 | + </desc> |
1101 | + <desc> |
1102 | + <value>2</value> |
1103 | + <_name>Open/Close Only</_name> |
1104 | + </desc> |
1105 | + <desc> |
1106 | + <value>3</value> |
1107 | + <_name>On</_name> |
1108 | + </desc> |
1109 | + </option> |
1110 | + <option name="zoom_springiness" type="float"> |
1111 | + <_short>Springiness</_short> |
1112 | + <_long>How spring-like the Zoom animation should be.</_long> |
1113 | + <default>0.0</default> |
1114 | + <min>0</min> |
1115 | + <max>1</max> |
1116 | + <precision>0.01</precision> |
1117 | + </option> |
1118 | + </subgroup> |
1119 | + </group> |
1120 | + |
1121 | + </options> |
1122 | + |
1123 | + <extension base_plugin="animation"> |
1124 | + <base_option>open_effects</base_option> |
1125 | + <base_option>close_effects</base_option> |
1126 | + <base_option>minimize_effects</base_option> |
1127 | + <base_option>shade_effects</base_option> |
1128 | + <restriction> |
1129 | + <value>animation:None</value> |
1130 | + <_name>None</_name> |
1131 | + </restriction> |
1132 | + <restriction> |
1133 | + <value>animation:Random</value> |
1134 | + <_name>Random</_name> |
1135 | + </restriction> |
1136 | + </extension> |
1137 | + |
1138 | + <extension base_plugin="animation"> |
1139 | + <base_option>open_effects</base_option> |
1140 | + <base_option>open_random_effects</base_option> |
1141 | + <base_option>close_effects</base_option> |
1142 | + <base_option>close_random_effects</base_option> |
1143 | + <base_option>minimize_effects</base_option> |
1144 | + <base_option>minimize_random_effects</base_option> |
1145 | + <base_option>shade_effects</base_option> |
1146 | + <base_option>shade_random_effects</base_option> |
1147 | + <restriction> |
1148 | + <value>animation:Curved Fold</value> |
1149 | + <_name>Curved Fold</_name> |
1150 | + </restriction> |
1151 | + <restriction> |
1152 | + <value>animation:Horizontal Folds</value> |
1153 | + <_name>Horizontal Folds</_name> |
1154 | + </restriction> |
1155 | + </extension> |
1156 | + |
1157 | + <extension base_plugin="animation"> |
1158 | + <base_option>shade_effects</base_option> |
1159 | + <base_option>shade_random_effects</base_option> |
1160 | + <restriction> |
1161 | + <value>animation:Roll Up</value> |
1162 | + <_name>Roll Up</_name> |
1163 | + </restriction> |
1164 | + </extension> |
1165 | + |
1166 | + <extension base_plugin="animation"> |
1167 | + <base_option>open_effects</base_option> |
1168 | + <base_option>open_random_effects</base_option> |
1169 | + <base_option>close_effects</base_option> |
1170 | + <base_option>close_random_effects</base_option> |
1171 | + <base_option>minimize_effects</base_option> |
1172 | + <base_option>minimize_random_effects</base_option> |
1173 | + <restriction> |
1174 | + <value>animation:Dream</value> |
1175 | + <_name>Dream</_name> |
1176 | + </restriction> |
1177 | + <restriction> |
1178 | + <value>animation:Fade</value> |
1179 | + <_name>Fade</_name> |
1180 | + </restriction> |
1181 | + <restriction> |
1182 | + <value>animation:Glide 1</value> |
1183 | + <_name>Glide 1</_name> |
1184 | + </restriction> |
1185 | + <restriction> |
1186 | + <value>animation:Glide 2</value> |
1187 | + <_name>Glide 2</_name> |
1188 | + </restriction> |
1189 | + <restriction> |
1190 | + <value>animation:Magic Lamp</value> |
1191 | + <_name>Magic Lamp</_name> |
1192 | + </restriction> |
1193 | + <restriction> |
1194 | + <value>animation:Magic Lamp Wavy</value> |
1195 | + <_name>Magic Lamp Wavy</_name> |
1196 | + </restriction> |
1197 | + <restriction> |
1198 | + <value>animation:Sidekick</value> |
1199 | + <_name>Sidekick</_name> |
1200 | + </restriction> |
1201 | + <restriction> |
1202 | + <value>animation:Zoom</value> |
1203 | + <_name>Zoom</_name> |
1204 | + </restriction> |
1205 | + </extension> |
1206 | + |
1207 | + <extension base_plugin="animation"> |
1208 | + <base_option>open_effects</base_option> |
1209 | + <base_option>open_random_effects</base_option> |
1210 | + <base_option>close_effects</base_option> |
1211 | + <base_option>close_random_effects</base_option> |
1212 | + <restriction> |
1213 | + <value>animation:Wave</value> |
1214 | + <_name>Wave</_name> |
1215 | + </restriction> |
1216 | + </extension> |
1217 | + |
1218 | + <extension base_plugin="animation"> |
1219 | + <base_option>focus_effects</base_option> |
1220 | + <restriction> |
1221 | + <value>animation:None</value> |
1222 | + <_name>None</_name> |
1223 | + </restriction> |
1224 | + <restriction> |
1225 | + <value>animation:Dodge</value> |
1226 | + <_name>Dodge</_name> |
1227 | + </restriction> |
1228 | + <restriction> |
1229 | + <value>animation:Focus Fade</value> |
1230 | + <_name>Fade</_name> |
1231 | + </restriction> |
1232 | + <restriction> |
1233 | + <value>animation:Wave</value> |
1234 | + <_name>Wave</_name> |
1235 | + </restriction> |
1236 | + </extension> |
1237 | + |
1238 | + </plugin> |
1239 | +</compiz> |
1240 | + |
1241 | |
1242 | === added file 'animation/compiz-animation.pc.in' |
1243 | --- animation/compiz-animation.pc.in 1970-01-01 00:00:00 +0000 |
1244 | +++ animation/compiz-animation.pc.in 2011-04-08 08:14:44 +0000 |
1245 | @@ -0,0 +1,12 @@ |
1246 | +prefix=@prefix@ |
1247 | +exec_prefix=@prefix@ |
1248 | +libdir=@libdir@ |
1249 | +includedir=@includedir@ |
1250 | + |
1251 | +Name: compiz-animation |
1252 | +Description: Animation plugin for compiz |
1253 | +Version: @VERSION@ |
1254 | + |
1255 | +Requires: compiz compiz-composite compiz-opengl |
1256 | +Libs: -L${libdir} -lanimation |
1257 | +Cflags: @COMPIZ_CFLAGS@ |
1258 | |
1259 | === added directory 'animation/docs' |
1260 | === added file 'animation/docs/animation-class-hierarchy.odg' |
1261 | Binary files animation/docs/animation-class-hierarchy.odg 1970-01-01 00:00:00 +0000 and animation/docs/animation-class-hierarchy.odg 2011-04-08 08:14:44 +0000 differ |
1262 | === added directory 'animation/include' |
1263 | === added file 'animation/include/.directory' |
1264 | --- animation/include/.directory 1970-01-01 00:00:00 +0000 |
1265 | +++ animation/include/.directory 2011-04-08 08:14:44 +0000 |
1266 | @@ -0,0 +1,3 @@ |
1267 | +[Dolphin] |
1268 | +ShowPreview=true |
1269 | +Timestamp=2010,8,12,5,55,57 |
1270 | |
1271 | === added directory 'animation/include/animation' |
1272 | === added file 'animation/include/animation/animation.h' |
1273 | --- animation/include/animation/animation.h 1970-01-01 00:00:00 +0000 |
1274 | +++ animation/include/animation/animation.h 2011-04-08 08:14:44 +0000 |
1275 | @@ -0,0 +1,77 @@ |
1276 | +#ifndef _ANIMATION_H |
1277 | +#define _ANIMATION_H |
1278 | + |
1279 | +#define ANIMATION_ABI 20091205 |
1280 | + |
1281 | +#include <core/pluginclasshandler.h> |
1282 | +#include <opengl/fragment.h> |
1283 | + |
1284 | +typedef enum |
1285 | +{ |
1286 | + WindowEventOpen = 0, |
1287 | + WindowEventClose, |
1288 | + WindowEventMinimize, |
1289 | + WindowEventUnminimize, |
1290 | + WindowEventShade, |
1291 | + WindowEventUnshade, |
1292 | + WindowEventFocus, |
1293 | + WindowEventNum, |
1294 | + WindowEventNone |
1295 | +} WindowEvent; |
1296 | + |
1297 | +typedef enum |
1298 | +{ |
1299 | + AnimEventOpen = 0, |
1300 | + AnimEventClose, |
1301 | + AnimEventMinimize, |
1302 | + AnimEventShade, |
1303 | + AnimEventFocus, |
1304 | + AnimEventNum |
1305 | +} AnimEvent; |
1306 | + |
1307 | +typedef enum |
1308 | +{ |
1309 | + AnimDirectionDown = 0, |
1310 | + AnimDirectionUp, |
1311 | + AnimDirectionLeft, |
1312 | + AnimDirectionRight, |
1313 | + AnimDirectionRandom, |
1314 | + AnimDirectionAuto |
1315 | +} AnimDirection; |
1316 | +#define LAST_ANIM_DIRECTION 5 |
1317 | + |
1318 | +class PrivateAnimScreen; |
1319 | +class PrivateAnimWindow; |
1320 | +class Animation; |
1321 | +class AnimWindow; |
1322 | +class AnimEffectInfo; |
1323 | + |
1324 | +typedef AnimEffectInfo * AnimEffect; |
1325 | + |
1326 | +#define RAND_FLOAT() ((float)rand() / RAND_MAX) |
1327 | + |
1328 | +#define sigmoid(fx) (1.0f/(1.0f+exp(-5.0f*2*((fx)-0.5)))) |
1329 | +#define sigmoid2(fx, s) (1.0f/(1.0f+exp(-(s)*2*((fx)-0.5)))) |
1330 | + |
1331 | +#define NUM_OPTIONS(s) (sizeof ((s)->opt) / sizeof (CompOption)) |
1332 | + |
1333 | +#include "extensionplugin.h" |
1334 | +#include "animeffect.h" |
1335 | +#include "point3d.h" |
1336 | +#include "persistent.h" |
1337 | +#include "grid.h" |
1338 | +#include "screen.h" |
1339 | +#include "window.h" |
1340 | +#include "transform.h" |
1341 | +#include "fade.h" |
1342 | +#include "partialwindow.h" |
1343 | +#include "gridtransform.h" |
1344 | +#include "zoom.h" |
1345 | +#include "multi.h" |
1346 | + |
1347 | + |
1348 | +// ratio of perceived length of animation compared to real duration |
1349 | +// to make it appear to have the same speed with other animation effects |
1350 | + |
1351 | +#endif |
1352 | + |
1353 | |
1354 | === added file 'animation/include/animation/animeffect.h' |
1355 | --- animation/include/animation/animeffect.h 1970-01-01 00:00:00 +0000 |
1356 | +++ animation/include/animation/animeffect.h 2011-04-08 08:14:44 +0000 |
1357 | @@ -0,0 +1,209 @@ |
1358 | +#ifndef ANIMATION_ANIMEFFECT_H |
1359 | +#define ANIMATION_ANIMEFFECT_H |
1360 | +#include "animation.h" |
1361 | + |
1362 | +typedef Animation *(*CreateAnimFunc) (CompWindow *w, |
1363 | + WindowEvent curWindowEvent, |
1364 | + float duration, |
1365 | + const AnimEffect info, |
1366 | + const CompRect &icon); |
1367 | + |
1368 | + /// Animation info class that holds the name, the list of supported events, and |
1369 | + /// the creator function for a subclass of Animation. |
1370 | + /// A pointer to this class is used as an identifier for each implemented |
1371 | + /// animation. |
1372 | +class AnimEffectInfo |
1373 | +{ |
1374 | +public: |
1375 | + AnimEffectInfo (const char *name, |
1376 | + bool usedO, bool usedC, bool usedM, bool usedS, bool usedF, |
1377 | + CreateAnimFunc create, bool isRestackAnim = false); |
1378 | + ~AnimEffectInfo () {} |
1379 | + |
1380 | + bool matchesEffectName (const CompString &animName); |
1381 | + |
1382 | + bool matchesPluginName (const CompString &pluginName); |
1383 | + |
1384 | + const char *name; ///< Name of the animation effect, e.g. "animationpack:Implode". |
1385 | + |
1386 | + /// To be set to true for the window event animation list(s) that |
1387 | + /// the new animation (value) should be added to |
1388 | + /// (0: open, 1: close, 2: minimize, 3: shade, 4: focus) |
1389 | + bool usedForEvents[AnimEventNum]; |
1390 | + |
1391 | + /// Creates an instance of the Animation subclass and returns it as an |
1392 | + /// Animation instance. |
1393 | + CreateAnimFunc create; |
1394 | + |
1395 | + /// Is it a complex focus animation? (i.e. restacking-related, |
1396 | + /// like FocusFade/Dodge) |
1397 | + bool isRestackAnim; |
1398 | +}; |
1399 | + |
1400 | +template<class T> |
1401 | +Animation *createAnimation (CompWindow *w, |
1402 | + WindowEvent curWindowEvent, |
1403 | + float duration, |
1404 | + const AnimEffect info, |
1405 | + const CompRect &icon) |
1406 | +{ |
1407 | + return new T (w, curWindowEvent, duration, info, icon); |
1408 | +} |
1409 | + |
1410 | + |
1411 | +/** The base class for all animations. |
1412 | + A n*imations should derive from the closest animation class |
1413 | + to override as few methods as possible. Also, an animation |
1414 | + method should call ancestors' methods instead of duplicating |
1415 | + their code. |
1416 | + */ |
1417 | +class Animation |
1418 | +{ |
1419 | +protected: |
1420 | + CompWindow *mWindow; |
1421 | + AnimWindow *mAWindow; |
1422 | + |
1423 | + float mTotalTime; |
1424 | + float mRemainingTime; |
1425 | + float mTimestep; ///< to store anim. timestep at anim. start |
1426 | + float mTimeElapsedWithinTimeStep; |
1427 | + |
1428 | + int mTimeSinceLastPaint; ///< in milliseconds |
1429 | + |
1430 | + int mOverrideProgressDir; ///< 0: default dir, 1: forward, 2: backward |
1431 | + |
1432 | + GLFragment::Attrib mCurPaintAttrib; |
1433 | + GLushort mStoredOpacity; |
1434 | + WindowEvent mCurWindowEvent; |
1435 | + bool mInitialized; ///< whether the animation is initialized (in preparePaint) |
1436 | + |
1437 | + AnimEffect mInfo; ///< information about the animation class |
1438 | + |
1439 | + CompRect mIcon; |
1440 | + |
1441 | + int mDecorTopHeight; |
1442 | + int mDecorBottomHeight; |
1443 | + |
1444 | + GLTexture::List *texturesCache; |
1445 | + |
1446 | + CompOption::Value &optVal (unsigned int optionId); |
1447 | + |
1448 | + inline bool optValB (unsigned int optionId) { return optVal (optionId).b (); } |
1449 | + inline int optValI (unsigned int optionId) { return optVal (optionId).i (); } |
1450 | + inline float optValF (unsigned int optionId) { return optVal (optionId).f (); } |
1451 | + inline CompString optValS (unsigned int optionId) { return optVal (optionId).s (); } |
1452 | + inline unsigned short *optValC (unsigned int optionId) { return optVal (optionId).c (); } |
1453 | + |
1454 | +public: |
1455 | + |
1456 | + Animation (CompWindow *w, |
1457 | + WindowEvent curWindowEvent, |
1458 | + float duration, |
1459 | + const AnimEffect info, |
1460 | + const CompRect &icon); |
1461 | + virtual ~Animation (); |
1462 | + |
1463 | + inline AnimEffect info () { return mInfo; } |
1464 | + |
1465 | + // Overridable animation methods. |
1466 | + |
1467 | + /// Needed since virtual method calls can't be done in the constructor. |
1468 | + virtual void init () {} |
1469 | + |
1470 | + /// To be called during post-animation clean up. |
1471 | + virtual void cleanUp (bool closing, |
1472 | + bool destructing) {} |
1473 | + |
1474 | + /// Returns true if frame should be skipped (e.g. due to |
1475 | + /// higher timestep values). In that case no drawing is |
1476 | + /// needed for that window in current frame. |
1477 | + virtual bool shouldSkipFrame (int msSinceLastPaintActual); |
1478 | + |
1479 | + /// Advances the animation time by the given time amount. |
1480 | + /// Returns true if more animation time is left. |
1481 | + virtual bool advanceTime (int msSinceLastPaint); |
1482 | + |
1483 | + /// Computes new animation state based on remaining time. |
1484 | + virtual void step () {} |
1485 | + virtual void updateAttrib (GLWindowPaintAttrib &) {} |
1486 | + virtual void updateTransform (GLMatrix &) {} |
1487 | + virtual void prePaintWindow () {} |
1488 | + virtual void postPaintWindow () {} |
1489 | + virtual bool postPaintWindowUsed () { return false; } |
1490 | + |
1491 | + /// Returns true if the animation is still in progress. |
1492 | + virtual bool prePreparePaint (int msSinceLastPaint) { return false; } |
1493 | + virtual void postPreparePaint () {} |
1494 | + |
1495 | + /// Updates the bounding box of damaged region. Should be implemented for |
1496 | + /// any animation that doesn't update the whole screen. |
1497 | + virtual void updateBB (CompOutput &) {} |
1498 | + virtual bool updateBBUsed () { return false; } |
1499 | + |
1500 | + /// Should return true for effects that make use of a region |
1501 | + /// instead of just a bounding box for damaged area. |
1502 | + virtual bool stepRegionUsed () { return false; } |
1503 | + |
1504 | + virtual bool shouldDamageWindowOnStart (); |
1505 | + virtual bool shouldDamageWindowOnEnd (); |
1506 | + |
1507 | + /// Should return false if the animation should be stopped on move |
1508 | + virtual bool moveUpdate (int dx, int dy) { return true; } |
1509 | + |
1510 | + /// Should return false if the animation should be stopped on resize |
1511 | + virtual bool resizeUpdate (int dx, int dy, |
1512 | + int dwidth, int dheight) { return true; } |
1513 | + |
1514 | + virtual void adjustPointerIconSize () {} |
1515 | + virtual void addGeometry (const GLTexture::MatrixList &matrix, |
1516 | + const CompRegion ®ion, |
1517 | + const CompRegion &clip, |
1518 | + unsigned int maxGridWidth, |
1519 | + unsigned int maxGridHeight); |
1520 | + virtual void drawGeometry (); |
1521 | + |
1522 | + virtual bool paintWindowUsed () { return false; } |
1523 | + virtual bool paintWindow (GLWindow *gWindow, |
1524 | + const GLWindowPaintAttrib &attrib, |
1525 | + const GLMatrix &transform, |
1526 | + const CompRegion ®ion, |
1527 | + unsigned int mask) |
1528 | + { |
1529 | + return gWindow->glPaint (attrib, transform, region, mask); |
1530 | + } |
1531 | + |
1532 | + /// Gets info about the (extension) plugin that implements this animation. |
1533 | + /// Should be overriden by a base animation class in every extension plugin. |
1534 | + virtual ExtensionPluginInfo *getExtensionPluginInfo (); |
1535 | + |
1536 | + void drawTexture (GLTexture *texture, |
1537 | + GLFragment::Attrib &attrib, |
1538 | + unsigned int mask); |
1539 | + |
1540 | + // Utility methods |
1541 | + |
1542 | + void reverse (); |
1543 | + inline bool inProgress () { return (mRemainingTime > 0); } |
1544 | + |
1545 | + inline WindowEvent curWindowEvent () { return mCurWindowEvent; } |
1546 | + inline float totalTime () { return mTotalTime; } |
1547 | + inline float remainingTime () { return mRemainingTime; } |
1548 | + |
1549 | + float progressLinear (); |
1550 | + float progressEaseInEaseOut (); |
1551 | + float progressDecelerateCustom (float progress, |
1552 | + float minx, float maxx); |
1553 | + float progressDecelerate (float progress); |
1554 | + AnimDirection getActualAnimDirection (AnimDirection dir, |
1555 | + bool openDir); |
1556 | + void perspectiveDistortAndResetZ (GLMatrix &transform); |
1557 | + |
1558 | + static void prepareTransform (CompOutput &output, |
1559 | + GLMatrix &resultTransform, |
1560 | + GLMatrix &transform); |
1561 | + void setInitialized () { mInitialized = true; } |
1562 | + inline bool initialized () { return mInitialized; } |
1563 | + inline void setCurPaintAttrib (GLFragment::Attrib &newAttrib) |
1564 | + { mCurPaintAttrib = newAttrib; } |
1565 | +}; |
1566 | +#endif |
1567 | |
1568 | === added file 'animation/include/animation/extensionplugin.h' |
1569 | --- animation/include/animation/extensionplugin.h 1970-01-01 00:00:00 +0000 |
1570 | +++ animation/include/animation/extensionplugin.h 2011-04-08 08:14:44 +0000 |
1571 | @@ -0,0 +1,71 @@ |
1572 | +#ifndef ANIMATION_EXTENSIONPLUGIN_H |
1573 | +#define ANIMATION_EXTENSIONPLUGIN_H |
1574 | +#include "animation.h" |
1575 | + |
1576 | +class ExtensionPluginInfo |
1577 | +{ |
1578 | +public: |
1579 | + ExtensionPluginInfo (const CompString &name, |
1580 | + unsigned int nEffects, |
1581 | + AnimEffect *effects, |
1582 | + CompOption::Vector *effectOptions, |
1583 | + unsigned int firstEffectOptionIndex); |
1584 | + |
1585 | + CompString name; |
1586 | + unsigned int nEffects; |
1587 | + AnimEffect *effects; |
1588 | + |
1589 | + /// Plugin options to be used in "effect options" strings. |
1590 | + CompOption::Vector *effectOptions; |
1591 | + |
1592 | + /// Index of first effect option. |
1593 | + unsigned int firstEffectOptionIndex; |
1594 | + |
1595 | + // More general and/or non-window functions (including functions that access |
1596 | + // persistent animation data) to be overriden |
1597 | + |
1598 | + /// To be run at the beginning of glPaintOutput. |
1599 | + virtual void prePaintOutput (CompOutput *output) {} |
1600 | + |
1601 | + /// To be run at the beginning of preparePaint. |
1602 | + virtual void prePreparePaintGeneral () {} |
1603 | + |
1604 | + /// To be run at the end of preparePaint. |
1605 | + virtual void postPreparePaintGeneral () {} |
1606 | + |
1607 | + /// To be run when a CompWindowNotifyRestack is handled. |
1608 | + virtual void handleRestackNotify (AnimWindow *aw) {} |
1609 | + |
1610 | + /// To be run at the beginning of initiateOpenAnim. |
1611 | + virtual void preInitiateOpenAnim (AnimWindow *aw) {} |
1612 | + |
1613 | + /// To be run at the beginning of initiateCloseAnim. |
1614 | + virtual void preInitiateCloseAnim (AnimWindow *aw) {} |
1615 | + |
1616 | + /// To be run at the beginning of initiateMinimizeAnim. |
1617 | + virtual void preInitiateMinimizeAnim (AnimWindow *aw) {} |
1618 | + |
1619 | + /// To be run at the beginning of initiateUnminimizeAnim. |
1620 | + virtual void preInitiateUnminimizeAnim (AnimWindow *aw) {} |
1621 | + |
1622 | + /// Initializes plugin's persistent animation data for a window (if any). |
1623 | + virtual void initPersistentData (AnimWindow *aw) {} |
1624 | + |
1625 | + /// Destroys plugin's persistent animation data for a window (if any). |
1626 | + virtual void destroyPersistentData (AnimWindow *aw) {} |
1627 | + |
1628 | + /// To be run at the end of updateEventEffects. |
1629 | + virtual void postUpdateEventEffects (AnimEvent e, |
1630 | + bool forRandom) {} |
1631 | + |
1632 | + /// To be run after the startup countdown ends. |
1633 | + virtual void postStartupCountdown () {} |
1634 | + |
1635 | + virtual bool paintShouldSkipWindow (CompWindow *w) { return false; } |
1636 | + |
1637 | + virtual void cleanUpAnimation (bool closing, |
1638 | + bool destructing) {} |
1639 | + |
1640 | + virtual void processAllRestacks () {} |
1641 | +}; |
1642 | +#endif |
1643 | |
1644 | === added file 'animation/include/animation/fade.h' |
1645 | --- animation/include/animation/fade.h 1970-01-01 00:00:00 +0000 |
1646 | +++ animation/include/animation/fade.h 2011-04-08 08:14:44 +0000 |
1647 | @@ -0,0 +1,19 @@ |
1648 | +#ifndef ANIMATION_FADE_H |
1649 | +#define ANIMATION_FADE_H |
1650 | +#include "animation.h" |
1651 | +class FadeAnim : |
1652 | +virtual public Animation |
1653 | +{ |
1654 | +public: |
1655 | + FadeAnim (CompWindow *w, |
1656 | + WindowEvent curWindowEvent, |
1657 | + float duration, |
1658 | + const AnimEffect info, |
1659 | + const CompRect &icon); |
1660 | +public: |
1661 | + void updateBB (CompOutput &output); |
1662 | + bool updateBBUsed () { return true; } |
1663 | + void updateAttrib (GLWindowPaintAttrib &wAttrib); |
1664 | + virtual float getFadeProgress () { return progressLinear (); } |
1665 | +}; |
1666 | +#endif |
1667 | |
1668 | === added file 'animation/include/animation/grid.h' |
1669 | --- animation/include/animation/grid.h 1970-01-01 00:00:00 +0000 |
1670 | +++ animation/include/animation/grid.h 2011-04-08 08:14:44 +0000 |
1671 | @@ -0,0 +1,106 @@ |
1672 | +#ifndef ANIMATION_GRID_H |
1673 | +#define ANIMATION_GRID_H |
1674 | +#include "animation.h" |
1675 | +class GridAnim : |
1676 | + virtual public Animation |
1677 | +{ |
1678 | + public: |
1679 | + class GridModel |
1680 | + { |
1681 | + friend class GridAnim; |
1682 | + |
1683 | + public: |
1684 | + GridModel (CompWindow *w, |
1685 | + WindowEvent curWindowEvent, |
1686 | + int height, |
1687 | + int gridWidth, |
1688 | + int gridHeight, |
1689 | + int decorTopHeight, |
1690 | + int decorBottomHeight); |
1691 | + ~GridModel (); |
1692 | + |
1693 | + void move (float tx, float ty); |
1694 | + |
1695 | + class GridObject |
1696 | + { |
1697 | + friend class GridAnim; |
1698 | + friend class GridZoomAnim; |
1699 | + friend class GridTransformAnim; |
1700 | + |
1701 | + public: |
1702 | + GridObject (); |
1703 | + void setGridPosition (Point &gridPosition); |
1704 | + inline Point3d &position () { return mPosition; } |
1705 | + inline Point &gridPosition () { return mGridPosition; } |
1706 | + |
1707 | + inline Point &offsetTexCoordForQuadBefore () |
1708 | + { return mOffsetTexCoordForQuadBefore; } |
1709 | + |
1710 | + inline Point &offsetTexCoordForQuadAfter () |
1711 | + { return mOffsetTexCoordForQuadAfter; } |
1712 | + |
1713 | + private: |
1714 | + Point3d mPosition; ///< Position on screen |
1715 | + Point mGridPosition; ///< Position on window in [0,1] range |
1716 | + |
1717 | + Point mOffsetTexCoordForQuadBefore; |
1718 | + Point mOffsetTexCoordForQuadAfter; |
1719 | + ///< Texture x, y coordinates will be offset by given amounts |
1720 | + ///< for quads that fall after and before this object in x and y directions. |
1721 | + ///< Currently only y offset can be used. |
1722 | + }; |
1723 | + |
1724 | + inline GridObject *objects () { return mObjects; } |
1725 | + inline unsigned int numObjects () { return mNumObjects; } |
1726 | + inline Point &scale () { return mScale; } |
1727 | + |
1728 | + private: |
1729 | + GridObject *mObjects; // TODO: convert to vector |
1730 | + unsigned int mNumObjects; |
1731 | + |
1732 | + Point mScale; |
1733 | + Point mScaleOrigin; |
1734 | + |
1735 | + void initObjects (WindowEvent curWindowEvent, |
1736 | + int height, |
1737 | + int gridWidth, int gridHeight, |
1738 | + int decorTopHeight, int decorBottomHeight); |
1739 | + }; |
1740 | + |
1741 | +protected: |
1742 | + GridModel *mModel; |
1743 | + |
1744 | + int mGridWidth; ///< Number of cells along grid width |
1745 | + int mGridHeight; ///< Number of cells along grid height |
1746 | + |
1747 | + /// true if effect needs Q texture coordinates. |
1748 | + /// Q texture coordinates are used to avoid jagged-looking quads |
1749 | + /// ( http://www.r3.nu/~cass/qcoord/ ) |
1750 | + bool mUseQTexCoord; |
1751 | + |
1752 | + GLWindow::Geometry mGeometry; ///< geometry for grid mesh |
1753 | + |
1754 | + virtual bool using3D () { return false; } |
1755 | + |
1756 | + virtual void initGrid (); ///< Initializes grid width/height. |
1757 | + ///< Default grid size is 2x2. |
1758 | + ///< Override for custom grid size. |
1759 | + |
1760 | +public: |
1761 | + GridAnim (CompWindow *w, |
1762 | + WindowEvent curWindowEvent, |
1763 | + float duration, |
1764 | + const AnimEffect info, |
1765 | + const CompRect &icon); |
1766 | + ~GridAnim (); |
1767 | + void init (); |
1768 | + void updateBB (CompOutput &output); |
1769 | + bool updateBBUsed () { return true; } |
1770 | + void addGeometry (const GLTexture::MatrixList &matrix, |
1771 | + const CompRegion ®ion, |
1772 | + const CompRegion &clip, |
1773 | + unsigned int maxGridWidth, |
1774 | + unsigned int maxGridHeight); |
1775 | + void drawGeometry (); |
1776 | +}; |
1777 | +#endif |
1778 | |
1779 | === added file 'animation/include/animation/gridtransform.h' |
1780 | --- animation/include/animation/gridtransform.h 1970-01-01 00:00:00 +0000 |
1781 | +++ animation/include/animation/gridtransform.h 2011-04-08 08:14:44 +0000 |
1782 | @@ -0,0 +1,22 @@ |
1783 | +#ifndef ANIMATION_GRIDTRANSFORM_H |
1784 | +#define ANIMATION_GRIDTRANSFORM_H |
1785 | +#include "animation.h" |
1786 | +class GridTransformAnim : |
1787 | +public GridAnim, |
1788 | +virtual public TransformAnim |
1789 | +{ |
1790 | +public: |
1791 | + GridTransformAnim (CompWindow *w, |
1792 | + WindowEvent curWindowEvent, |
1793 | + float duration, |
1794 | + const AnimEffect info, |
1795 | + const CompRect &icon); |
1796 | + void init (); |
1797 | + void updateTransform (GLMatrix &wTransform); |
1798 | + void updateBB (CompOutput &output); |
1799 | + bool updateBBUsed () { return true; } |
1800 | + |
1801 | +protected: |
1802 | + bool mUsingTransform; ///< whether transform matrix is used (default: true) |
1803 | +}; |
1804 | +#endif |
1805 | |
1806 | === added file 'animation/include/animation/multi.h' |
1807 | --- animation/include/animation/multi.h 1970-01-01 00:00:00 +0000 |
1808 | +++ animation/include/animation/multi.h 2011-04-08 08:14:44 +0000 |
1809 | @@ -0,0 +1,397 @@ |
1810 | +#ifndef ANIMATION_MULTI_H |
1811 | +#define ANIMATION_MULTI_H |
1812 | +#include "animation.h" |
1813 | +/// Special class, allows multiple copies of an animation to happen |
1814 | +/// at any one time. Create your "single copy" animation class first |
1815 | +/// and then create a new animation which derives from this template |
1816 | +/// class. Each function of your animation will be called since this |
1817 | +/// class overloads everything in Animation. You will have |
1818 | +/// access to which number effect is happening. (I think) |
1819 | + |
1820 | +template <class SingleAnim, int num> |
1821 | +class MultiAnim : |
1822 | +public Animation |
1823 | +{ |
1824 | +public: |
1825 | + static inline int getCurrAnimNumber (AnimWindow *aw) |
1826 | + { |
1827 | + MultiPersistentData *pd = static_cast <MultiPersistentData *> |
1828 | + (aw->persistentData["multi"]); |
1829 | + if (!pd) |
1830 | + { |
1831 | + pd = new MultiPersistentData (); |
1832 | + aw->persistentData["multi"] = pd; |
1833 | + } |
1834 | + if (!pd) |
1835 | + return 0; |
1836 | + return pd->num; |
1837 | + } |
1838 | + |
1839 | + static inline void setCurrAnimNumber (AnimWindow *aw, int what) |
1840 | + { |
1841 | + MultiPersistentData *pd = static_cast <MultiPersistentData *> |
1842 | + (aw->persistentData["multi"]); |
1843 | + if (!pd) |
1844 | + pd = new MultiPersistentData (); |
1845 | + if (!pd) |
1846 | + return; |
1847 | + pd->num = what; |
1848 | + } |
1849 | + |
1850 | + public: |
1851 | + MultiAnim (CompWindow *w, |
1852 | + WindowEvent curWindowEvent, |
1853 | + float duration, |
1854 | + const AnimEffect info, |
1855 | + const CompRect &icon) : |
1856 | + Animation (w, curWindowEvent, duration, info, icon), |
1857 | + currentAnim (0) |
1858 | + { |
1859 | + for (unsigned int i = 0; i < num; i++) |
1860 | + animList.push_back (new SingleAnim (w, |
1861 | + curWindowEvent, |
1862 | + duration, |
1863 | + info, icon)); |
1864 | + mGlPaintAttribs.resize (num); |
1865 | + mGlPaintTransforms.resize (num); |
1866 | + } |
1867 | + virtual ~MultiAnim () {} |
1868 | + |
1869 | + public: |
1870 | + |
1871 | + /// Overload everything |
1872 | + |
1873 | + /// Needed since virtual method calls can't be done in the constructor. |
1874 | + void init () |
1875 | + { |
1876 | + int count = 0; |
1877 | + foreach (SingleAnim *a, animList) |
1878 | + { |
1879 | + setCurrAnimNumber (mAWindow, count); |
1880 | + count++; |
1881 | + a->init (); |
1882 | + } |
1883 | + } |
1884 | + |
1885 | + /// To be called during post-animation clean up. |
1886 | + void cleanUp (bool closing, |
1887 | + bool destructing) |
1888 | + { |
1889 | + int count = 0; |
1890 | + foreach (SingleAnim *a, animList) |
1891 | + { |
1892 | + setCurrAnimNumber (mAWindow, count); |
1893 | + count++; |
1894 | + a->cleanUp (closing, |
1895 | + destructing); |
1896 | + delete a; |
1897 | + } |
1898 | + |
1899 | + animList.clear (); |
1900 | + } |
1901 | + |
1902 | + /// Returns true if frame should be skipped (e.g. due to |
1903 | + /// higher timestep values). In that case no drawing is |
1904 | + /// needed for that window in current frame. |
1905 | + bool shouldSkipFrame (int msSinceLastPaintActual) |
1906 | + { |
1907 | + int count = 0; |
1908 | + bool skip = false; |
1909 | + foreach (SingleAnim *a, animList) |
1910 | + { |
1911 | + setCurrAnimNumber (mAWindow, count); |
1912 | + count++; |
1913 | + skip |= a->shouldSkipFrame (msSinceLastPaintActual); |
1914 | + } |
1915 | + return skip; |
1916 | + } |
1917 | + |
1918 | + /// Advances the animation time by the given time amount. |
1919 | + /// Returns true if more animation time is left. |
1920 | + bool advanceTime (int msSinceLastPaint) |
1921 | + { |
1922 | + int count = 0; |
1923 | + bool advance = false; |
1924 | + advance |= Animation::advanceTime (msSinceLastPaint); |
1925 | + foreach (SingleAnim *a, animList) |
1926 | + { |
1927 | + setCurrAnimNumber (mAWindow, count); |
1928 | + count++; |
1929 | + advance |= a->advanceTime (msSinceLastPaint); |
1930 | + } |
1931 | + return advance; |
1932 | + } |
1933 | + |
1934 | + /// Computes new animation state based on remaining time. |
1935 | + void step () |
1936 | + { |
1937 | + int count = 0; |
1938 | + foreach (SingleAnim *a, animList) |
1939 | + { |
1940 | + setCurrAnimNumber (mAWindow, count); |
1941 | + count++; |
1942 | + a->step (); |
1943 | + } |
1944 | + } |
1945 | + |
1946 | + void updateAttrib (GLWindowPaintAttrib &attrib) |
1947 | + { |
1948 | + int count = 0; |
1949 | + foreach (SingleAnim *a, animList) |
1950 | + { |
1951 | + setCurrAnimNumber (mAWindow, count); |
1952 | + GLWindowPaintAttrib attr (attrib); |
1953 | + a->updateAttrib (attr); |
1954 | + mGlPaintAttribs.at (count) = attr; |
1955 | + count++; |
1956 | + } |
1957 | + } |
1958 | + |
1959 | + void updateTransform (GLMatrix &transform) |
1960 | + { |
1961 | + int count = 0; |
1962 | + |
1963 | + foreach (SingleAnim *a, animList) |
1964 | + { |
1965 | + setCurrAnimNumber (mAWindow, count); |
1966 | + GLMatrix mat (transform); |
1967 | + a->updateTransform (mat); |
1968 | + mGlPaintTransforms.at (count) = mat; |
1969 | + count++; |
1970 | + } |
1971 | + } |
1972 | + |
1973 | + void prePaintWindow () |
1974 | + { |
1975 | + int count = 0; |
1976 | + foreach (SingleAnim *a, animList) |
1977 | + { |
1978 | + setCurrAnimNumber (mAWindow, count); |
1979 | + count++; |
1980 | + a->prePaintWindow (); |
1981 | + } |
1982 | + } |
1983 | + |
1984 | + void postPaintWindow () |
1985 | + { |
1986 | + int count = 0; |
1987 | + foreach (SingleAnim *a, animList) |
1988 | + { |
1989 | + setCurrAnimNumber (mAWindow, count); |
1990 | + count++; |
1991 | + a->postPaintWindow (); |
1992 | + } |
1993 | + } |
1994 | + |
1995 | + bool postPaintWindowUsed () |
1996 | + { |
1997 | + int count = 0; |
1998 | + bool used = false; |
1999 | + foreach (SingleAnim *a, animList) |
2000 | + { |
2001 | + setCurrAnimNumber (mAWindow, count); |
2002 | + count++; |
2003 | + used |= a->postPaintWindowUsed (); |
2004 | + } |
2005 | + return used; |
2006 | + } |
2007 | + |
2008 | + /// Returns true if the animation is still in progress. |
2009 | + bool prePreparePaint (int msSinceLastPaint) |
2010 | + { |
2011 | + int count = 0; |
2012 | + bool inProgress = false; |
2013 | + foreach (SingleAnim *a, animList) |
2014 | + { |
2015 | + setCurrAnimNumber (mAWindow, count); |
2016 | + count++; |
2017 | + inProgress |= a->prePreparePaint (msSinceLastPaint); |
2018 | + } |
2019 | + return inProgress; |
2020 | + } |
2021 | + |
2022 | + void postPreparePaint () |
2023 | + { |
2024 | + int count = 0; |
2025 | + foreach (SingleAnim *a, animList) |
2026 | + { |
2027 | + setCurrAnimNumber (mAWindow, count); |
2028 | + count++; |
2029 | + a->postPreparePaint (); |
2030 | + } |
2031 | + } |
2032 | + |
2033 | + /// Updates the bounding box of damaged region. Should be implemented for |
2034 | + /// any animation that doesn't update the whole screen. |
2035 | + // NB!! |
2036 | + void updateBB (CompOutput &out) |
2037 | + { |
2038 | + int count = 0; |
2039 | + foreach (SingleAnim *a, animList) |
2040 | + { |
2041 | + setCurrAnimNumber (mAWindow, count); |
2042 | + count++; |
2043 | + a->updateBB (out); |
2044 | + } |
2045 | + } |
2046 | + |
2047 | + bool updateBBUsed () |
2048 | + { |
2049 | + int count = 0; |
2050 | + bool used = false; |
2051 | + foreach (SingleAnim *a, animList) |
2052 | + { |
2053 | + setCurrAnimNumber (mAWindow, count); |
2054 | + count++; |
2055 | + used |= a->updateBBUsed (); |
2056 | + } |
2057 | + return used; |
2058 | + } |
2059 | + |
2060 | + /// Should return true for effects that make use of a region |
2061 | + /// instead of just a bounding box for damaged area-> |
2062 | + bool stepRegionUsed () |
2063 | + { |
2064 | + int count = 0; |
2065 | + bool used = false; |
2066 | + foreach (SingleAnim *a, animList) |
2067 | + { |
2068 | + setCurrAnimNumber (mAWindow, count); |
2069 | + count++; |
2070 | + used |= a->stepRegionUsed (); |
2071 | + } |
2072 | + return used; |
2073 | + } |
2074 | + |
2075 | + bool shouldDamageWindowOnStart () |
2076 | + { |
2077 | + int count = 0; |
2078 | + bool should = false; |
2079 | + foreach (SingleAnim *a, animList) |
2080 | + { |
2081 | + setCurrAnimNumber (mAWindow, count); |
2082 | + count++; |
2083 | + should |= a->shouldDamageWindowOnStart (); |
2084 | + } |
2085 | + return should; |
2086 | + } |
2087 | + |
2088 | + bool shouldDamageWindowOnEnd () |
2089 | + { |
2090 | + int count = 0; |
2091 | + bool should = false; |
2092 | + foreach (SingleAnim *a, animList) |
2093 | + { |
2094 | + setCurrAnimNumber (mAWindow, count); |
2095 | + count++; |
2096 | + should |= a->shouldDamageWindowOnStart (); |
2097 | + } |
2098 | + return should; |
2099 | + } |
2100 | + |
2101 | + /// Should return false if the animation should be stopped on move |
2102 | + bool moveUpdate (int dx, int dy) |
2103 | + { |
2104 | + int count = 0; |
2105 | + bool update; |
2106 | + foreach (SingleAnim *a, animList) |
2107 | + { |
2108 | + setCurrAnimNumber (mAWindow, count); |
2109 | + count++; |
2110 | + update |= a->moveUpdate (dx, dy); |
2111 | + } |
2112 | + return update; |
2113 | + } |
2114 | + |
2115 | + /// Should return false if the animation should be stopped on resize |
2116 | + bool resizeUpdate (int dx, int dy, |
2117 | + int dwidth, int dheight) |
2118 | + { |
2119 | + int count = 0; |
2120 | + bool update; |
2121 | + foreach (SingleAnim *a, animList) |
2122 | + { |
2123 | + setCurrAnimNumber (mAWindow, count); |
2124 | + count++; |
2125 | + update |= a->resizeUpdate (dx, dy, dwidth, dheight); |
2126 | + } |
2127 | + return update; |
2128 | + } |
2129 | + |
2130 | + void adjustPointerIconSize () |
2131 | + { |
2132 | + int count = 0; |
2133 | + foreach (SingleAnim *a, animList) |
2134 | + { |
2135 | + setCurrAnimNumber (mAWindow, count); |
2136 | + count++; |
2137 | + a->adjustPointerIconSize (); |
2138 | + } |
2139 | + } |
2140 | + |
2141 | + void addGeometry (const GLTexture::MatrixList &matrix, |
2142 | + const CompRegion ®ion, |
2143 | + const CompRegion &clip, |
2144 | + unsigned int maxGridWidth, |
2145 | + unsigned int maxGridHeight) |
2146 | + { |
2147 | + setCurrAnimNumber (mAWindow, currentAnim); |
2148 | + animList.at (currentAnim)->addGeometry |
2149 | + (matrix, region, clip, maxGridWidth, maxGridHeight); |
2150 | + } |
2151 | + |
2152 | + void drawGeometry () |
2153 | + { |
2154 | + setCurrAnimNumber (mAWindow, currentAnim); |
2155 | + animList.at (currentAnim)->drawGeometry (); |
2156 | + } |
2157 | + |
2158 | + bool paintWindowUsed () |
2159 | + { |
2160 | + int count = 0; |
2161 | + foreach (SingleAnim *a, animList) |
2162 | + { |
2163 | + setCurrAnimNumber (mAWindow, count); |
2164 | + count++; |
2165 | + a->paintWindowUsed (); |
2166 | + } |
2167 | + /* Always return true because we need to take over painting */ |
2168 | + return true; |
2169 | + } |
2170 | + |
2171 | + bool paintWindow (GLWindow *gWindow, |
2172 | + const GLWindowPaintAttrib &attrib, |
2173 | + const GLMatrix &transform, |
2174 | + const CompRegion ®ion, |
2175 | + unsigned int mask) |
2176 | + { |
2177 | + int count = 0; |
2178 | + bool status = false; |
2179 | + |
2180 | + for (currentAnim = 0; currentAnim < animList.size (); currentAnim++) |
2181 | + { |
2182 | + GLWindowPaintAttrib wAttrib (mGlPaintAttribs.at (currentAnim)); |
2183 | + GLMatrix wTransform (mGlPaintTransforms.at (currentAnim)); |
2184 | + |
2185 | + setCurrAnimNumber (mAWindow, count); |
2186 | + count++; |
2187 | + |
2188 | + if (animList.at (currentAnim)->paintWindowUsed ()) |
2189 | + status |= animList.at (currentAnim)->paintWindow |
2190 | + (gWindow, wAttrib, wTransform, region, mask); |
2191 | + else |
2192 | + status |= gWindow->glPaint |
2193 | + (wAttrib, wTransform, region, mask); |
2194 | + } |
2195 | + |
2196 | + return status; |
2197 | + } |
2198 | + |
2199 | + private: |
2200 | + |
2201 | + std::vector <GLWindowPaintAttrib> mGlPaintAttribs; |
2202 | + std::vector <GLMatrix> mGlPaintTransforms; |
2203 | + std::vector <SingleAnim *> animList; |
2204 | + unsigned int currentAnim; |
2205 | +}; |
2206 | +#endif |
2207 | |
2208 | === added file 'animation/include/animation/partialwindow.h' |
2209 | --- animation/include/animation/partialwindow.h 1970-01-01 00:00:00 +0000 |
2210 | +++ animation/include/animation/partialwindow.h 2011-04-08 08:14:44 +0000 |
2211 | @@ -0,0 +1,25 @@ |
2212 | +#ifndef ANIMATION_PARTIALWINDOW_H |
2213 | +#define ANIMATION_PARTIALWINDOW_H |
2214 | +#include "animation.h" |
2215 | +class PartialWindowAnim : |
2216 | +virtual public Animation |
2217 | +{ |
2218 | +public: |
2219 | + PartialWindowAnim (CompWindow *w, |
2220 | + WindowEvent curWindowEvent, |
2221 | + float duration, |
2222 | + const AnimEffect info, |
2223 | + const CompRect &icon); |
2224 | + |
2225 | + void addGeometry (const GLTexture::MatrixList &matrix, |
2226 | + const CompRegion ®ion, |
2227 | + const CompRegion &clip, |
2228 | + unsigned int maxGridWidth, |
2229 | + unsigned int maxGridHeight); |
2230 | + |
2231 | +protected: |
2232 | + bool mUseDrawRegion; |
2233 | + CompRegion mDrawRegion; |
2234 | + |
2235 | +}; |
2236 | +#endif |
2237 | |
2238 | === added file 'animation/include/animation/persistent.h' |
2239 | --- animation/include/animation/persistent.h 1970-01-01 00:00:00 +0000 |
2240 | +++ animation/include/animation/persistent.h 2011-04-08 08:14:44 +0000 |
2241 | @@ -0,0 +1,18 @@ |
2242 | +#ifndef ANIMATION_PERSISTENT_H |
2243 | +#define ANIMATION_PERSISTENT_H |
2244 | + |
2245 | +#include "animation.h" |
2246 | +class PersistentData |
2247 | +{ |
2248 | +}; |
2249 | + |
2250 | +typedef std::map<std::string, PersistentData *> PersistentDataMap; |
2251 | + |
2252 | +class MultiPersistentData : |
2253 | +public PersistentData |
2254 | +{ |
2255 | +public: |
2256 | + MultiPersistentData () : num (0) {} |
2257 | + int num; |
2258 | +}; |
2259 | +#endif |
2260 | |
2261 | === added file 'animation/include/animation/point3d.h' |
2262 | --- animation/include/animation/point3d.h 1970-01-01 00:00:00 +0000 |
2263 | +++ animation/include/animation/point3d.h 2011-04-08 08:14:44 +0000 |
2264 | @@ -0,0 +1,105 @@ |
2265 | +#ifndef ANIMATION_POINT_H |
2266 | +#define ANIMATION_POINT_H |
2267 | +#include "animation.h" |
2268 | + |
2269 | +class Point |
2270 | +{ |
2271 | +public: |
2272 | + Point () : mX (0), mY (0) {} |
2273 | + Point (float x, float y) : mX (x), mY (y) {} |
2274 | + |
2275 | + inline float x () const { return mX; } |
2276 | + inline float y () const { return mY; } |
2277 | + |
2278 | + inline void setX (float x) { mX = x; } |
2279 | + inline void setY (float y) { mY = y; } |
2280 | + |
2281 | + void set (float x, float y) { mX = x; mY = y; } |
2282 | + |
2283 | + inline void add (const Point &p) { mX += p.x (); mY += p.y (); } |
2284 | + |
2285 | + Point &operator= (const Point &p); |
2286 | + bool operator== (const Point &p) const; |
2287 | + bool operator!= (const Point &p) const; |
2288 | + |
2289 | +private: |
2290 | + float mX, mY; |
2291 | +}; |
2292 | + |
2293 | +typedef Point Vector; |
2294 | + |
2295 | +class Point3d |
2296 | +{ |
2297 | + public: |
2298 | + Point3d () : mX (0), mY (0), mZ (0) {} |
2299 | + Point3d (float x, float y, float z) : mX (x), mY (y), mZ (z) {} |
2300 | + |
2301 | + inline float x () const { return mX; } |
2302 | + inline float y () const { return mY; } |
2303 | + inline float z () const { return mZ; } |
2304 | + |
2305 | + inline void setX (float x) { mX = x; } |
2306 | + inline void setY (float y) { mY = y; } |
2307 | + inline void setZ (float z) { mZ = z; } |
2308 | + |
2309 | + inline void set (float x, float y, float z) { mX = x; mY = y; mZ = z; } |
2310 | + |
2311 | + inline void add (const Point3d &p) |
2312 | + { mX += p.x (); mY += p.y (); mZ += p.z (); } |
2313 | + inline void add (float x, float y, float z) |
2314 | + { mX += x; mY += y; mZ += z; } |
2315 | + |
2316 | + Point3d &operator= (const Point3d &p); |
2317 | + bool operator== (const Point3d &p) const; |
2318 | + bool operator!= (const Point3d &p) const; |
2319 | + |
2320 | + private: |
2321 | + float mX, mY, mZ; |
2322 | +}; |
2323 | + |
2324 | +typedef Point3d Vector3d; |
2325 | + |
2326 | +/* XXX: change this to CompRect */ |
2327 | +typedef struct |
2328 | +{ |
2329 | + float x1, x2, y1, y2; |
2330 | +} Boxf; |
2331 | + |
2332 | +inline Point & |
2333 | +Point::operator= (const Point &p) |
2334 | +{ |
2335 | + mX = p.x (); mY = p.y (); |
2336 | + return *this; |
2337 | +} |
2338 | + |
2339 | +inline bool |
2340 | +Point::operator== (const Point &p) const |
2341 | +{ |
2342 | + return (mX == p.x () && mY == p.y ()); |
2343 | +} |
2344 | + |
2345 | +inline bool |
2346 | +Point::operator!= (const Point &p) const |
2347 | +{ |
2348 | + return !(*this == p); |
2349 | +} |
2350 | + |
2351 | +inline Point3d & |
2352 | +Point3d::operator= (const Point3d &p) |
2353 | +{ |
2354 | + mX = p.x (); mY = p.y (); mZ = p.z (); |
2355 | + return *this; |
2356 | +} |
2357 | + |
2358 | +inline bool |
2359 | +Point3d::operator== (const Point3d &p) const |
2360 | +{ |
2361 | + return (mX == p.x () && mY == p.y () && mZ == p.z ()); |
2362 | +} |
2363 | + |
2364 | +inline bool |
2365 | +Point3d::operator!= (const Point3d &p) const |
2366 | +{ |
2367 | + return !(*this == p); |
2368 | +} |
2369 | +#endif |
2370 | |
2371 | === added file 'animation/include/animation/screen.h' |
2372 | --- animation/include/animation/screen.h 1970-01-01 00:00:00 +0000 |
2373 | +++ animation/include/animation/screen.h 2011-04-08 08:14:44 +0000 |
2374 | @@ -0,0 +1,35 @@ |
2375 | +#ifndef ANIMATION_SCREEN_H |
2376 | +#define ANIMATION_SCREEN_H |
2377 | +#include "animation.h" |
2378 | +class AnimScreen : |
2379 | + public PluginClassHandler<AnimScreen, CompScreen, ANIMATION_ABI>, |
2380 | + public CompOption::Class |
2381 | +{ |
2382 | + friend class ExtensionPluginAnimation; |
2383 | + friend class PrivateAnimScreen; |
2384 | + friend class PrivateAnimWindow; |
2385 | + |
2386 | +public: |
2387 | + AnimScreen (CompScreen *); |
2388 | + ~AnimScreen (); |
2389 | + |
2390 | + void addExtension (ExtensionPluginInfo *extensionPluginInfo); |
2391 | + void removeExtension (ExtensionPluginInfo *extensionPluginInfo); |
2392 | + bool getMousePointerXY (short *x, short *y); |
2393 | + CompOption::Vector &getOptions (); |
2394 | + bool setOption (const CompString &name, CompOption::Value &value); |
2395 | + CompOutput &output (); |
2396 | + AnimEffect getMatchingAnimSelection (CompWindow *w, |
2397 | + AnimEvent e, |
2398 | + int *duration); |
2399 | + void enableCustomPaintList (bool enabled); |
2400 | + bool isRestackAnimPossible (); |
2401 | + bool isAnimEffectPossible (AnimEffect theEffect); |
2402 | + bool otherPluginsActive (); |
2403 | + bool initiateFocusAnim (AnimWindow *aw); |
2404 | + |
2405 | +private: |
2406 | + PrivateAnimScreen *priv; |
2407 | + |
2408 | +}; |
2409 | +#endif |
2410 | |
2411 | === added file 'animation/include/animation/transform.h' |
2412 | --- animation/include/animation/transform.h 1970-01-01 00:00:00 +0000 |
2413 | +++ animation/include/animation/transform.h 2011-04-08 08:14:44 +0000 |
2414 | @@ -0,0 +1,34 @@ |
2415 | +#ifndef ANIMATION_TRANSFORM_H |
2416 | +#define ANIMATION_TRANSFORM_H |
2417 | +#include "animation.h" |
2418 | +class TransformAnim : |
2419 | +virtual public Animation |
2420 | +{ |
2421 | +public: |
2422 | + TransformAnim (CompWindow *w, |
2423 | + WindowEvent curWindowEvent, |
2424 | + float duration, |
2425 | + const AnimEffect info, |
2426 | + const CompRect &icon); |
2427 | + void init (); |
2428 | + void step (); |
2429 | + void updateTransform (GLMatrix &wTransform); |
2430 | + void updateBB (CompOutput &output); |
2431 | + bool updateBBUsed () { return true; } |
2432 | + |
2433 | +protected: |
2434 | + GLMatrix mTransform; |
2435 | + |
2436 | + float mTransformStartProgress; |
2437 | + float mTransformProgress; |
2438 | + |
2439 | + void perspectiveDistortAndResetZ (GLMatrix &transform); |
2440 | + void applyPerspectiveSkew (CompOutput &output, |
2441 | + GLMatrix &transform, |
2442 | + Point ¢er); |
2443 | + virtual void adjustDuration () {} |
2444 | + virtual void applyTransform () {} |
2445 | + virtual Point getCenter (); |
2446 | + |
2447 | +}; |
2448 | +#endif |
2449 | |
2450 | === added file 'animation/include/animation/window.h' |
2451 | --- animation/include/animation/window.h 1970-01-01 00:00:00 +0000 |
2452 | +++ animation/include/animation/window.h 2011-04-08 08:14:44 +0000 |
2453 | @@ -0,0 +1,67 @@ |
2454 | +#ifndef ANIMATION_WINDOW_H |
2455 | +#define ANIMATION_WINDOW_H |
2456 | +#include "animation.h" |
2457 | +class AnimWindow : |
2458 | + public PluginClassHandler<AnimWindow, CompWindow, ANIMATION_ABI> |
2459 | +{ |
2460 | + friend class PrivateAnimScreen; |
2461 | + friend class PrivateAnimWindow; |
2462 | + friend class AnimScreen; |
2463 | + friend class Animation; |
2464 | + |
2465 | +public: |
2466 | + AnimWindow (CompWindow *); |
2467 | + ~AnimWindow (); |
2468 | + |
2469 | + BoxPtr BB (); |
2470 | + CompRegion &stepRegion (); |
2471 | + void resetStepRegionWithBB (); |
2472 | + |
2473 | + void expandBBWithWindow (); |
2474 | + void expandBBWithScreen (); |
2475 | + void expandBBWithBox (Box &source); |
2476 | + void expandBBWithPoint (float fx, float fy); |
2477 | + void expandBBWithPoint2DTransform (GLVector &coords, |
2478 | + GLMatrix &transformMat); |
2479 | + bool expandBBWithPoints3DTransform (CompOutput &output, |
2480 | + GLMatrix &transform, |
2481 | + const float *points, |
2482 | + GridAnim::GridModel::GridObject *objects, |
2483 | + unsigned int nPoints); |
2484 | + |
2485 | + inline bool savedRectsValid () { return mSavedRectsValid; } |
2486 | + inline CompRect & saveWinRect () { return mSavedWinRect; } |
2487 | + inline CompRect & savedInRect () { return mSavedInRect; } |
2488 | + inline CompRect & savedOutRect () { return mSavedOutRect; } |
2489 | + inline CompWindowExtents & savedOutExtents () { return mSavedOutExtents; } |
2490 | + |
2491 | + Animation *curAnimation (); |
2492 | + void createFocusAnimation (AnimEffect effect, int duration = 0); |
2493 | + |
2494 | + void postAnimationCleanUp (); |
2495 | + |
2496 | + // TODO: Group persistent data for a plugin and allow a plugin to only |
2497 | + // delete its own data. |
2498 | + void deletePersistentData (const char *name); |
2499 | + |
2500 | + /// A "string -> persistent data" map for animations that require such data, |
2501 | + /// like some focus animations. |
2502 | + PersistentDataMap persistentData; |
2503 | + |
2504 | + CompWindow *mWindow; ///< Window being animated. // TODO move to private: |
2505 | +private: |
2506 | + PrivateAnimWindow *priv; |
2507 | + |
2508 | + |
2509 | + bool mSavedRectsValid; |
2510 | + CompRect mSavedWinRect; ///< Saved window contents geometry |
2511 | + CompRect mSavedInRect; ///< Saved window input geometry |
2512 | + CompRect mSavedOutRect; ///< Saved window output geometry |
2513 | + CompWindowExtents mSavedOutExtents; ///< Saved window output extents |
2514 | + |
2515 | + CompOption::Value &pluginOptVal (ExtensionPluginInfo *pluginInfo, |
2516 | + unsigned int optionId, |
2517 | + Animation *anim); |
2518 | + |
2519 | +}; |
2520 | +#endif |
2521 | |
2522 | === added file 'animation/include/animation/zoom.h' |
2523 | --- animation/include/animation/zoom.h 1970-01-01 00:00:00 +0000 |
2524 | +++ animation/include/animation/zoom.h 2011-04-08 08:14:44 +0000 |
2525 | @@ -0,0 +1,70 @@ |
2526 | +#ifndef ANIMATION_ZOOM_H |
2527 | +#define ANIMATION_ZOOM_H |
2528 | +#include "animation.h" |
2529 | + |
2530 | +class ZoomAnim : |
2531 | + public FadeAnim, |
2532 | + virtual public TransformAnim |
2533 | +{ |
2534 | +public: |
2535 | + ZoomAnim (CompWindow *w, |
2536 | + WindowEvent curWindowEvent, |
2537 | + float duration, |
2538 | + const AnimEffect info, |
2539 | + const CompRect &icon); |
2540 | + |
2541 | +public: |
2542 | + void step () { TransformAnim::step (); } |
2543 | + void adjustDuration (); |
2544 | + float getFadeProgress (); |
2545 | + bool updateBBUsed () { return true; } |
2546 | + void updateBB (CompOutput &output) { TransformAnim::updateBB (output); } |
2547 | + void applyTransform (); |
2548 | +protected: |
2549 | + float getActualProgress (); |
2550 | + Point getCenter (); |
2551 | + virtual float getSpringiness (); |
2552 | + virtual bool isZoomFromCenter (); |
2553 | + virtual bool zoomToIcon () { return true; } |
2554 | + virtual bool hasExtraTransform () { return false; } |
2555 | + virtual void applyExtraTransform (float progress) {} |
2556 | + virtual bool shouldAvoidParallelogramLook () { return false; } |
2557 | + virtual bool scaleAroundIcon (); |
2558 | + virtual bool neverSpringy () { return false; } |
2559 | + void getZoomProgress (float *moveProgress, |
2560 | + float *scaleProgress, |
2561 | + bool neverSpringy); |
2562 | + |
2563 | + static const float kDurationFactor; |
2564 | + static const float kSpringyDurationFactor; |
2565 | + static const float kNonspringyDurationFactor; |
2566 | + |
2567 | +private: |
2568 | + void getCenterScaleFull (Point *pCurCenter, Point *pCurScale, |
2569 | + Point *pWinCenter, Point *pIconCenter, |
2570 | + float *pMoveProgress); |
2571 | + void getCenterScale (Point *pCurCenter, Point *pCurScale); |
2572 | +}; |
2573 | + |
2574 | +class GridZoomAnim : |
2575 | + public GridTransformAnim, |
2576 | + public ZoomAnim |
2577 | +{ |
2578 | +public: |
2579 | + GridZoomAnim (CompWindow *w, |
2580 | + WindowEvent curWindowEvent, |
2581 | + float duration, |
2582 | + const AnimEffect info, |
2583 | + const CompRect &icon); |
2584 | + void init () { GridTransformAnim::init (); } |
2585 | + void step () { ZoomAnim::step (); } |
2586 | + void updateTransform (GLMatrix &wTransform) |
2587 | + { GridTransformAnim::updateTransform (wTransform); } |
2588 | + void updateBB (CompOutput &output) { GridTransformAnim::updateBB (output); } |
2589 | + bool updateBBUsed () { return true; } |
2590 | + bool neverSpringy () { return true; } |
2591 | + float getSpringiness () { return 0; } |
2592 | + bool scaleAroundIcon () { return false; } |
2593 | + void adjustDuration (); |
2594 | +}; |
2595 | +#endif |
2596 | |
2597 | === added directory 'animation/src' |
2598 | === added file 'animation/src/animation.cpp' |
2599 | --- animation/src/animation.cpp 1970-01-01 00:00:00 +0000 |
2600 | +++ animation/src/animation.cpp 2011-04-08 08:14:44 +0000 |
2601 | @@ -0,0 +1,2852 @@ |
2602 | +/** |
2603 | + * Animation plugin for compiz/beryl |
2604 | + * |
2605 | + * animation.c |
2606 | + * |
2607 | + * Copyright : (C) 2006 Erkin Bahceci |
2608 | + * E-mail : erkinbah@gmail.com |
2609 | + * |
2610 | + * Based on Wobbly and Minimize plugins by |
2611 | + * : David Reveman |
2612 | + * E-mail : davidr@novell.com> |
2613 | + * |
2614 | + * Airplane added by : Carlo Palma |
2615 | + * E-mail : carlopalma@salug.it |
2616 | + * Based on code originally written by Mark J. Kilgard |
2617 | + * |
2618 | + * Beam-Up added by : Florencio Guimaraes |
2619 | + * E-mail : florencio@nexcorp.com.br |
2620 | + * |
2621 | + * Fold and Skewer added by : Tomasz Kolodziejski |
2622 | + * E-mail : tkolodziejski@gmail.com |
2623 | + * |
2624 | + * Hexagon tessellator added by : Mike Slegeir |
2625 | + * E-mail : mikeslegeir@mail.utexas.edu> |
2626 | + * |
2627 | + * Particle system added by : (C) 2006 Dennis Kasprzyk |
2628 | + * E-mail : onestone@beryl-project.org |
2629 | + * |
2630 | + * This program is free software; you can redistribute it and/or |
2631 | + * modify it under the terms of the GNU General Public License |
2632 | + * as published by the Free Software Foundation; either version 2 |
2633 | + * of the License, or (at your option) any later version. |
2634 | + * |
2635 | + * This program is distributed in the hope that it will be useful, |
2636 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2637 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2638 | + * GNU General Public License for more details. |
2639 | + * |
2640 | + * You should have received a copy of the GNU General Public License |
2641 | + * along with this program; if not, write to the Free Software |
2642 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
2643 | + **/ |
2644 | + |
2645 | +/* |
2646 | + * TODO: |
2647 | + * |
2648 | + * - Custom bounding box update function for Airplane |
2649 | + * |
2650 | + * - Auto direction option: Close in opposite direction of opening |
2651 | + * - Proper side surface normals for lighting |
2652 | + * - decoration shadows |
2653 | + * - shadow quad generation |
2654 | + * - shadow texture coords (from clip tex. matrices) |
2655 | + * - draw shadows |
2656 | + * - fade in shadows |
2657 | + * |
2658 | + * - Voronoi tessellation |
2659 | + * - Brick tessellation |
2660 | + * - Triangle tessellation |
2661 | + * - Hexagonal tessellation |
2662 | + * |
2663 | + * Effects: |
2664 | + * - Circular action for tornado type fx |
2665 | + * - Tornado 3D (especially for minimize) |
2666 | + * - Helix 3D (hor. strips descend while they rotate and fade in) |
2667 | + * - Glass breaking 3D |
2668 | + * - Gaussian distr. points (for gradually increasing polygon size |
2669 | + * starting from center or near mouse pointer) |
2670 | + * - Drawing cracks |
2671 | + * - Gradual cracking |
2672 | + * |
2673 | + * - fix slowness during transparent cube with <100 opacity |
2674 | + * - fix occasional wrong side color in some windows |
2675 | + * - fix on top windows and panels |
2676 | + * (These two only matter for viewing during Rotate Cube. |
2677 | + * All windows should be painted with depth test on |
2678 | + * like 3d-plugin does) |
2679 | + * - play better with rotate (fix cube face drawn on top of polygons |
2680 | + * after 45 deg. rotation) |
2681 | + * |
2682 | + */ |
2683 | + |
2684 | +#include <GL/glu.h> |
2685 | +#include <core/atoms.h> |
2686 | +#include <sys/time.h> |
2687 | +#include <assert.h> |
2688 | +#include "private.h" |
2689 | + |
2690 | +class AnimPluginVTable : |
2691 | + public CompPlugin::VTableForScreenAndWindow<AnimScreen, AnimWindow> |
2692 | +{ |
2693 | +public: |
2694 | + bool init (); |
2695 | + void fini (); |
2696 | +}; |
2697 | + |
2698 | +COMPIZ_PLUGIN_20090315 (animation, AnimPluginVTable); |
2699 | + |
2700 | +#define FAKE_ICON_SIZE 4 |
2701 | + |
2702 | +const char *eventNames[AnimEventNum] = |
2703 | +{"Open", "Close", "Minimize", "Shade", "Focus"}; |
2704 | + |
2705 | +int chosenEffectOptionIds[AnimEventNum] = |
2706 | +{ |
2707 | + AnimationOptions::OpenEffects, |
2708 | + AnimationOptions::CloseEffects, |
2709 | + AnimationOptions::MinimizeEffects, |
2710 | + AnimationOptions::ShadeEffects, |
2711 | + AnimationOptions::FocusEffects |
2712 | +}; |
2713 | + |
2714 | +int randomEffectOptionIds[AnimEventNum] = |
2715 | +{ |
2716 | + AnimationOptions::OpenRandomEffects, |
2717 | + AnimationOptions::CloseRandomEffects, |
2718 | + AnimationOptions::MinimizeRandomEffects, |
2719 | + AnimationOptions::ShadeRandomEffects, |
2720 | + -1 |
2721 | +}; |
2722 | + |
2723 | +int customOptionOptionIds[AnimEventNum] = |
2724 | +{ |
2725 | + AnimationOptions::OpenOptions, |
2726 | + AnimationOptions::CloseOptions, |
2727 | + AnimationOptions::MinimizeOptions, |
2728 | + AnimationOptions::ShadeOptions, |
2729 | + AnimationOptions::FocusOptions |
2730 | +}; |
2731 | + |
2732 | +int matchOptionIds[AnimEventNum] = |
2733 | +{ |
2734 | + AnimationOptions::OpenMatches, |
2735 | + AnimationOptions::CloseMatches, |
2736 | + AnimationOptions::MinimizeMatches, |
2737 | + AnimationOptions::ShadeMatches, |
2738 | + AnimationOptions::FocusMatches |
2739 | +}; |
2740 | + |
2741 | +int durationOptionIds[AnimEventNum] = |
2742 | +{ |
2743 | + AnimationOptions::OpenDurations, |
2744 | + AnimationOptions::CloseDurations, |
2745 | + AnimationOptions::MinimizeDurations, |
2746 | + AnimationOptions::ShadeDurations, |
2747 | + AnimationOptions::FocusDurations |
2748 | +}; |
2749 | + |
2750 | +// Bind each effect in the list of chosen effects for every event, to the |
2751 | +// corresponding animation effect (i.e. effect with that name) if it is |
2752 | +// provided by a plugin, otherwise set it to None. |
2753 | +void |
2754 | +PrivateAnimScreen::updateEventEffects (AnimEvent e, |
2755 | + bool forRandom, |
2756 | + bool callPost) |
2757 | +{ |
2758 | + CompOption::Value::Vector *listVal; |
2759 | + EffectSet *effectSet; |
2760 | + if (forRandom) |
2761 | + { |
2762 | + listVal = &getOptions ()[(unsigned)randomEffectOptionIds[e]].value (). |
2763 | + list (); |
2764 | + effectSet = &mRandomEffects[e]; |
2765 | + } |
2766 | + else |
2767 | + { |
2768 | + listVal = &getOptions ()[(unsigned)chosenEffectOptionIds[e]].value (). |
2769 | + list (); |
2770 | + effectSet = &mEventEffects[e]; |
2771 | + } |
2772 | + unsigned int n = listVal->size (); |
2773 | + |
2774 | + effectSet->effects.clear (); |
2775 | + effectSet->effects.reserve (n); |
2776 | + |
2777 | + AnimEffectVector &eventEffectsAllowed = mEventEffectsAllowed[e]; |
2778 | + |
2779 | + for (unsigned int r = 0; r < n; r++) // for each row |
2780 | + { |
2781 | + const CompString &animName = (*listVal)[r].s (); |
2782 | + |
2783 | + // Find the animation effect with matching name |
2784 | + AnimEffectVector::iterator it = |
2785 | + find_if (eventEffectsAllowed.begin (), |
2786 | + eventEffectsAllowed.end (), |
2787 | + boost::bind (&AnimEffectInfo::matchesEffectName, |
2788 | + _1, animName)); |
2789 | + |
2790 | + effectSet->effects.push_back (it == eventEffectsAllowed.end () ? |
2791 | + AnimEffectNone : *it); |
2792 | + } |
2793 | + |
2794 | + if (callPost) |
2795 | + { |
2796 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
2797 | + extPlugin->postUpdateEventEffects (e, forRandom); |
2798 | + } |
2799 | +} |
2800 | + |
2801 | +void |
2802 | +PrivateAnimScreen::updateAllEventEffects () |
2803 | +{ |
2804 | + // for each anim event |
2805 | + for (int e = 0; e < AnimEventNum; e++) |
2806 | + updateEventEffects ((AnimEvent)e, false); |
2807 | + |
2808 | + // for each anim event except focus |
2809 | + for (int e = 0; e < AnimEventNum - 1; e++) |
2810 | + updateEventEffects ((AnimEvent)e, true); |
2811 | +} |
2812 | + |
2813 | +bool |
2814 | +PrivateAnimScreen::isAnimEffectInList (AnimEffect theEffect, |
2815 | + EffectSet &effectList) |
2816 | +{ |
2817 | + for (unsigned int i = 0; i < effectList.effects.size (); i++) |
2818 | + if (effectList.effects[i] == theEffect) |
2819 | + return true; |
2820 | + return false; |
2821 | +} |
2822 | + |
2823 | +bool |
2824 | +PrivateAnimScreen::isAnimEffectPossibleForEvent (AnimEffect theEffect, |
2825 | + AnimEvent event) |
2826 | +{ |
2827 | + // Check all rows to see if the effect is chosen there |
2828 | + unsigned int nRows = mEventEffects[event].effects.size (); |
2829 | + for (unsigned int i = 0; i < nRows; i++) |
2830 | + { |
2831 | + AnimEffect chosenEffect = mEventEffects[event].effects[i]; |
2832 | + // if chosen directly |
2833 | + if (chosenEffect == theEffect) |
2834 | + return true; |
2835 | + // if chosen in random pool |
2836 | + if (mRandomEffects[event].effects.size () && |
2837 | + chosenEffect == AnimEffectRandom && |
2838 | + isAnimEffectInList (theEffect, mRandomEffects[event])) |
2839 | + return true; |
2840 | + } |
2841 | + return false; |
2842 | +} |
2843 | + |
2844 | +bool |
2845 | +PrivateAnimScreen::isAnimEffectPossible (AnimEffect theEffect) |
2846 | +{ |
2847 | + for (int e = 0; e < AnimEventNum; e++) |
2848 | + if (isAnimEffectPossibleForEvent (theEffect, (AnimEvent)e)) |
2849 | + return true; |
2850 | + return false; |
2851 | +} |
2852 | + |
2853 | +bool |
2854 | +PrivateAnimScreen::isRestackAnimPossible () |
2855 | +{ |
2856 | + // Check all rows to see if the chosen effect is a restack animation |
2857 | + unsigned int nRows = mEventEffects[AnimEventFocus].effects.size (); |
2858 | + |
2859 | + for (unsigned int i = 0; i < nRows; i++) |
2860 | + { |
2861 | + AnimEffect chosenEffect = mEventEffects[(unsigned)AnimEventFocus]. |
2862 | + effects[i]; |
2863 | + if (chosenEffect->isRestackAnim) |
2864 | + return true; |
2865 | + } |
2866 | + return false; |
2867 | +} |
2868 | + |
2869 | +bool |
2870 | +AnimScreen::isRestackAnimPossible () |
2871 | +{ |
2872 | + return priv->isRestackAnimPossible (); |
2873 | +} |
2874 | + |
2875 | +// Extension functions |
2876 | + |
2877 | +void |
2878 | +AnimScreen::addExtension (ExtensionPluginInfo *extensionPluginInfo) |
2879 | +{ |
2880 | + priv->addExtension (extensionPluginInfo, true); |
2881 | +} |
2882 | + |
2883 | +void |
2884 | +PrivateAnimScreen::addExtension (ExtensionPluginInfo *extensionPluginInfo, |
2885 | + bool shouldInitPersistentData) |
2886 | +{ |
2887 | + mExtensionPlugins.push_back (extensionPluginInfo); |
2888 | + |
2889 | + unsigned int nPluginEffects = extensionPluginInfo->nEffects; |
2890 | + |
2891 | + bool eventEffectsNeedUpdate[AnimEventNum] = |
2892 | + {false, false, false, false, false}; |
2893 | + |
2894 | + // Put this plugin's effects into mEventEffects and |
2895 | + // mEventEffectsAllowed |
2896 | + for (unsigned int j = 0; j < nPluginEffects; j++) |
2897 | + { |
2898 | + const AnimEffect effect = extensionPluginInfo->effects[j]; |
2899 | + |
2900 | + // Update allowed effects for each event |
2901 | + for (int e = 0; e < AnimEventNum; e++) |
2902 | + { |
2903 | + if (effect->usedForEvents[e]) |
2904 | + { |
2905 | + mEventEffectsAllowed[e].push_back (effect); |
2906 | + eventEffectsNeedUpdate[e] = true; |
2907 | + } |
2908 | + } |
2909 | + } |
2910 | + |
2911 | + for (int e = 0; e < AnimEventNum; e++) |
2912 | + if (eventEffectsNeedUpdate[e]) |
2913 | + { |
2914 | + updateEventEffects ((AnimEvent)e, false, false); |
2915 | + if (e != AnimEventFocus) |
2916 | + updateEventEffects ((AnimEvent)e, true, false); |
2917 | + } |
2918 | + |
2919 | + if (shouldInitPersistentData) |
2920 | + { |
2921 | + // Initialize persistent window data for the extension plugin |
2922 | + foreach (CompWindow *w, ::screen->windows ()) |
2923 | + { |
2924 | + AnimWindow *aw = AnimWindow::get (w); |
2925 | + extensionPluginInfo->initPersistentData (aw); |
2926 | + } |
2927 | + } |
2928 | +} |
2929 | + |
2930 | +void |
2931 | +AnimScreen::removeExtension (ExtensionPluginInfo *extensionPluginInfo) |
2932 | +{ |
2933 | + priv->removeExtension (extensionPluginInfo); |
2934 | +} |
2935 | + |
2936 | +void |
2937 | +PrivateAnimScreen::removeExtension (ExtensionPluginInfo *extensionPluginInfo) |
2938 | +{ |
2939 | + // Stop all ongoing animations |
2940 | + foreach (CompWindow *w, ::screen->windows ()) |
2941 | + { |
2942 | + PrivateAnimWindow *aw = AnimWindow::get (w)->priv; |
2943 | + if (aw->curAnimation ()) |
2944 | + aw->postAnimationCleanUp (); |
2945 | + } |
2946 | + |
2947 | + // Find the matching plugin and delete it |
2948 | + |
2949 | + ExtensionPluginVector::iterator it = find (mExtensionPlugins.begin (), |
2950 | + mExtensionPlugins.end (), |
2951 | + extensionPluginInfo); |
2952 | + |
2953 | + if (it == mExtensionPlugins.end ()) |
2954 | + return; // couldn't find that extension plugin |
2955 | + |
2956 | + mExtensionPlugins.erase (it); |
2957 | + |
2958 | + if (extensionPluginInfo->nEffects == 0) |
2959 | + return; // no animation effects -> we're done here |
2960 | + |
2961 | + |
2962 | + // Also delete the "allowed effect" entries for that plugin |
2963 | + |
2964 | + for (int e = 0; e < AnimEventNum; e++) |
2965 | + { |
2966 | + AnimEffectVector &eventEffectsAllowed = mEventEffectsAllowed[e]; |
2967 | + |
2968 | + // Find the first animation effect with matching name |
2969 | + AnimEffectVector::iterator itBeginEffect = |
2970 | + find_if (eventEffectsAllowed.begin (), |
2971 | + eventEffectsAllowed.end (), |
2972 | + boost::bind (&AnimEffectInfo::matchesPluginName, |
2973 | + _1, extensionPluginInfo->name)); |
2974 | + |
2975 | + if (itBeginEffect == eventEffectsAllowed.end ()) |
2976 | + continue; // plugin didn't provide any effects for this event |
2977 | + |
2978 | + // Find the first animation effect with non-matching name, |
2979 | + // starting with itBeginEffect |
2980 | + AnimEffectVector::iterator itEndEffect = |
2981 | + find_if (itBeginEffect, |
2982 | + eventEffectsAllowed.end (), |
2983 | + boost::bind (&AnimEffectInfo::matchesPluginName, |
2984 | + _1, extensionPluginInfo->name) == false); |
2985 | + |
2986 | + eventEffectsAllowed.erase (itBeginEffect, itEndEffect); |
2987 | + |
2988 | + // Update event effects to complete removal |
2989 | + updateEventEffects ((AnimEvent)e, false); |
2990 | + if (e != AnimEventFocus) |
2991 | + updateEventEffects ((AnimEvent)e, true); |
2992 | + } |
2993 | + |
2994 | + // Destroy persistent window data for the extension plugin |
2995 | + foreach (CompWindow *w, ::screen->windows ()) |
2996 | + { |
2997 | + AnimWindow *aw = AnimWindow::get (w); |
2998 | + extensionPluginInfo->destroyPersistentData (aw); |
2999 | + } |
3000 | +} |
3001 | + |
3002 | +ExtensionPluginInfo::ExtensionPluginInfo (const CompString &name, |
3003 | + unsigned int nEffects, |
3004 | + AnimEffect *effects, |
3005 | + CompOption::Vector *effectOptions, |
3006 | + unsigned int firstEffectOptionIndex) : |
3007 | + name (name), |
3008 | + nEffects (nEffects), |
3009 | + effects (effects), |
3010 | + effectOptions (effectOptions), |
3011 | + firstEffectOptionIndex (firstEffectOptionIndex) |
3012 | +{ |
3013 | +} |
3014 | + |
3015 | +// End of extension functions |
3016 | + |
3017 | +Animation::Animation (CompWindow *w, |
3018 | + WindowEvent curWindowEvent, |
3019 | + float duration, |
3020 | + const AnimEffect info, |
3021 | + const CompRect &icon) : |
3022 | + mWindow (w), |
3023 | + mAWindow (AnimWindow::get (w)), |
3024 | + mTotalTime (duration), |
3025 | + mRemainingTime (duration), |
3026 | + mTimeElapsedWithinTimeStep (0), |
3027 | + mOverrideProgressDir (0), |
3028 | + mCurPaintAttrib (GLWindow::defaultPaintAttrib), |
3029 | + mStoredOpacity (CompositeWindow::get (w)->opacity ()), |
3030 | + mCurWindowEvent (curWindowEvent), |
3031 | + mInitialized (false), // store window opacity |
3032 | + mInfo (info), |
3033 | + mIcon (icon) |
3034 | +{ |
3035 | + if (curWindowEvent == WindowEventShade || |
3036 | + curWindowEvent == WindowEventUnshade) |
3037 | + { |
3038 | + mDecorTopHeight = w->output ().top; |
3039 | + mDecorBottomHeight = w->output ().bottom; |
3040 | + } |
3041 | + |
3042 | + texturesCache = new GLTexture::List (GLWindow::get (w)->textures ()); |
3043 | + PrivateAnimScreen *as = mAWindow->priv->paScreen (); |
3044 | + |
3045 | + mTimestep = as->optionGetTimeStep (); |
3046 | +} |
3047 | + |
3048 | +Animation::~Animation () |
3049 | +{ |
3050 | + delete texturesCache; |
3051 | +} |
3052 | + |
3053 | +CompOption::Value & |
3054 | +Animation::optVal (unsigned int optionId) |
3055 | +{ |
3056 | + return mAWindow->pluginOptVal (getExtensionPluginInfo (), optionId, this); |
3057 | +} |
3058 | + |
3059 | +/// Play the animation effect backwards from where it left off. |
3060 | +void |
3061 | +Animation::reverse () |
3062 | +{ |
3063 | + mRemainingTime = mTotalTime - mRemainingTime; |
3064 | + |
3065 | + // avoid window remains |
3066 | + if (mRemainingTime <= 0) |
3067 | + mRemainingTime = 1; |
3068 | + |
3069 | + switch (mCurWindowEvent) // the old event |
3070 | + { |
3071 | + case WindowEventOpen: |
3072 | + mCurWindowEvent = WindowEventClose; |
3073 | + break; |
3074 | + case WindowEventClose: |
3075 | + mCurWindowEvent = WindowEventOpen; |
3076 | + break; |
3077 | + case WindowEventMinimize: |
3078 | + mCurWindowEvent = WindowEventUnminimize; |
3079 | + break; |
3080 | + case WindowEventUnminimize: |
3081 | + mCurWindowEvent = WindowEventMinimize; |
3082 | + break; |
3083 | + case WindowEventShade: |
3084 | + mCurWindowEvent = WindowEventUnshade; |
3085 | + break; |
3086 | + case WindowEventUnshade: |
3087 | + mCurWindowEvent = WindowEventShade; |
3088 | + break; |
3089 | + default: |
3090 | + break; |
3091 | + } |
3092 | + |
3093 | + // 1: forward, 2: backward (3 - progressDir is opposite direction) |
3094 | + int progressDir = 1; |
3095 | + |
3096 | + switch (mCurWindowEvent) // the new event |
3097 | + { |
3098 | + case WindowEventClose: |
3099 | + case WindowEventMinimize: |
3100 | + case WindowEventShade: |
3101 | + progressDir = 2; |
3102 | + break; |
3103 | + default: |
3104 | + break; |
3105 | + } |
3106 | + |
3107 | + if (mOverrideProgressDir == 0) |
3108 | + mOverrideProgressDir = progressDir; |
3109 | + else if (mOverrideProgressDir == 3 - progressDir) |
3110 | + mOverrideProgressDir = 0; // disable override |
3111 | +} |
3112 | + |
3113 | +PartialWindowAnim::PartialWindowAnim (CompWindow *w, |
3114 | + WindowEvent curWindowEvent, |
3115 | + float duration, |
3116 | + const AnimEffect info, |
3117 | + const CompRect &icon) : |
3118 | + Animation::Animation (w, curWindowEvent, duration, info, icon), |
3119 | + mUseDrawRegion (false), |
3120 | + mDrawRegion () |
3121 | +{ |
3122 | +} |
3123 | + |
3124 | +void |
3125 | +PrivateAnimWindow::updateSelectionRow (unsigned int r) |
3126 | +{ |
3127 | + mPrevAnimSelectionRow = mCurAnimSelectionRow; |
3128 | + mCurAnimSelectionRow = (int)r; |
3129 | +} |
3130 | + |
3131 | +// Assumes events in the metadata are in |
3132 | +// [Open, Close, Minimize, Focus, Shade] order |
3133 | +// and effects among those are in alphabetical order |
3134 | +// but with "(Event) None" first and "(Event) Random" last. |
3135 | +AnimEffect |
3136 | +PrivateAnimScreen::getMatchingAnimSelection (CompWindow *w, |
3137 | + AnimEvent e, |
3138 | + int *duration) |
3139 | +{ |
3140 | + PrivateAnimWindow *aw = AnimWindow::get (w)->priv; |
3141 | + |
3142 | + EffectSet *eventEffects = &mEventEffects[e]; |
3143 | + CompOption::Value &valMatch = |
3144 | + getOptions ()[(unsigned)matchOptionIds[e]].value (); |
3145 | + CompOption::Value &valDuration = |
3146 | + getOptions ()[(unsigned)durationOptionIds[e]].value (); |
3147 | + CompOption::Value &valCustomOptions = |
3148 | + getOptions ()[(unsigned)customOptionOptionIds[e]].value (); |
3149 | + |
3150 | + unsigned int nRows = valMatch.list ().size (); |
3151 | + if (nRows != eventEffects->effects.size () || |
3152 | + nRows != valDuration.list ().size () || |
3153 | + nRows != valCustomOptions.list ().size ()) |
3154 | + { |
3155 | + compLogMessage ("animation", CompLogLevelError, |
3156 | + "Animation settings mismatch in \"Animation " |
3157 | + "Selection\" list for %s event.", eventNames[e]); |
3158 | + return AnimEffectNone; |
3159 | + } |
3160 | + |
3161 | + // Find the first row that matches this window for this event |
3162 | + for (unsigned int i = 0; i < nRows; i++) |
3163 | + { |
3164 | + if (!valMatch.list ()[i].match ().evaluate (w)) |
3165 | + continue; |
3166 | + |
3167 | + aw->updateSelectionRow (i); |
3168 | + |
3169 | + if (duration) |
3170 | + *duration = valDuration.list ()[i].i (); |
3171 | + |
3172 | + AnimEffect effect = eventEffects->effects[i]; |
3173 | + |
3174 | + return (effect ? effect : AnimEffectNone); |
3175 | + } |
3176 | + |
3177 | + return AnimEffectNone; |
3178 | +} |
3179 | + |
3180 | +AnimEffect |
3181 | +PrivateAnimScreen::getActualEffect (AnimEffect effect, |
3182 | + AnimEvent animEvent) |
3183 | +{ |
3184 | + bool allRandom = optionGetAllRandom (); |
3185 | + AnimEffectVector *randomEffects = &mRandomEffects[animEvent].effects; |
3186 | + unsigned int nRandomEffects = randomEffects->size (); |
3187 | + unsigned int nFirstRandomEffect = 0; |
3188 | + |
3189 | + if ((effect == AnimEffectRandom) || allRandom) |
3190 | + { |
3191 | + if (nRandomEffects == 0) // no random animation selected, assume "all" |
3192 | + { |
3193 | + randomEffects = &mEventEffectsAllowed[animEvent]; |
3194 | + |
3195 | + // exclude None and Random |
3196 | + nFirstRandomEffect = 2; |
3197 | + nRandomEffects = randomEffects->size () - 2; |
3198 | + } |
3199 | + unsigned int index = nFirstRandomEffect + |
3200 | + (unsigned int)(nRandomEffects * (double)rand () / RAND_MAX); |
3201 | + return (*randomEffects)[index]; |
3202 | + } |
3203 | + else |
3204 | + return effect; |
3205 | +} |
3206 | + |
3207 | +/// Converts animation direction (up, down, left, right, random, auto) |
3208 | +/// to an actual direction (up, down, left, or right). |
3209 | +AnimDirection |
3210 | +Animation::getActualAnimDirection (AnimDirection dir, |
3211 | + bool openDir) |
3212 | +{ |
3213 | + if (dir == AnimDirectionRandom) |
3214 | + { |
3215 | + dir = (AnimDirection)(rand () % 4); |
3216 | + } |
3217 | + else if (dir == AnimDirectionAuto) |
3218 | + { |
3219 | + CompRect outRect (mAWindow->savedRectsValid () ? |
3220 | + mAWindow->savedOutRect () : |
3221 | + mWindow->outputRect ()); |
3222 | + |
3223 | + // away from icon |
3224 | + int centerX = outRect.x () + outRect.width () / 2 ; |
3225 | + int centerY = outRect.y () + outRect.height () / 2 ; |
3226 | + float relDiffX = ((float)centerX - mIcon.x ()) / outRect.width (); |
3227 | + float relDiffY = ((float)centerY - mIcon.y ()) / outRect.height (); |
3228 | + |
3229 | + if (openDir) |
3230 | + { |
3231 | + if (mCurWindowEvent == WindowEventMinimize || |
3232 | + mCurWindowEvent == WindowEventUnminimize) |
3233 | + // min/unmin. should always result in +/- y direction |
3234 | + dir = (mIcon.y () < (int)::screen->height () - mIcon.y ()) ? |
3235 | + AnimDirectionDown : AnimDirectionUp; |
3236 | + else if (fabs (relDiffY) > fabs (relDiffX)) |
3237 | + dir = relDiffY > 0 ? AnimDirectionDown : AnimDirectionUp; |
3238 | + else |
3239 | + dir = relDiffX > 0 ? AnimDirectionRight : AnimDirectionLeft; |
3240 | + } |
3241 | + else |
3242 | + { |
3243 | + if (mCurWindowEvent == WindowEventMinimize || |
3244 | + mCurWindowEvent == WindowEventUnminimize) |
3245 | + // min/unmin. should always result in +/- y direction |
3246 | + dir = (mIcon.y () < (int)::screen->height () - mIcon.y ()) ? |
3247 | + AnimDirectionUp : AnimDirectionDown; |
3248 | + else if (fabs (relDiffY) > fabs (relDiffX)) |
3249 | + dir = relDiffY > 0 ? AnimDirectionUp : AnimDirectionDown; |
3250 | + else |
3251 | + dir = relDiffX > 0 ? AnimDirectionLeft : AnimDirectionRight; |
3252 | + } |
3253 | + } |
3254 | + return dir; |
3255 | +} |
3256 | + |
3257 | +float |
3258 | +Animation::progressLinear () |
3259 | +{ |
3260 | + float forwardProgress = |
3261 | + 1 - mRemainingTime / (mTotalTime - mTimestep); |
3262 | + forwardProgress = MIN (forwardProgress, 1); |
3263 | + forwardProgress = MAX (forwardProgress, 0); |
3264 | + |
3265 | + if (mCurWindowEvent == WindowEventOpen || |
3266 | + mCurWindowEvent == WindowEventUnminimize || |
3267 | + mCurWindowEvent == WindowEventUnshade || |
3268 | + mCurWindowEvent == WindowEventFocus) |
3269 | + forwardProgress = 1 - forwardProgress; |
3270 | + |
3271 | + return forwardProgress; |
3272 | +} |
3273 | + |
3274 | +float |
3275 | +Animation::progressEaseInEaseOut () |
3276 | +{ |
3277 | + float forwardProgress = |
3278 | + 1 - mRemainingTime / (mTotalTime - mTimestep); |
3279 | + forwardProgress = MIN (forwardProgress, 1); |
3280 | + forwardProgress = MAX (forwardProgress, 0); |
3281 | + |
3282 | + // Apply sigmoid and normalize |
3283 | + forwardProgress = |
3284 | + (sigmoid (forwardProgress) - sigmoid (0)) / |
3285 | + (sigmoid (1) - sigmoid (0)); |
3286 | + |
3287 | + if (mCurWindowEvent == WindowEventOpen || |
3288 | + mCurWindowEvent == WindowEventUnminimize || |
3289 | + mCurWindowEvent == WindowEventUnshade || |
3290 | + mCurWindowEvent == WindowEventFocus) |
3291 | + forwardProgress = 1 - forwardProgress; |
3292 | + |
3293 | + return forwardProgress; |
3294 | +} |
3295 | + |
3296 | +/// Gives some acceleration (when closing a window) |
3297 | +/// or deceleration (when opening a window). |
3298 | +/// Applies a sigmoid with slope s, |
3299 | +/// where minx and maxx are the |
3300 | +/// starting and ending points on the sigmoid. |
3301 | +float |
3302 | +Animation::progressDecelerateCustom (float progress, float minx, float maxx) |
3303 | +{ |
3304 | + float x = 1 - progress; |
3305 | + float s = 8; |
3306 | + |
3307 | + return |
3308 | + 1 - ((sigmoid2 (minx + (x * (maxx - minx)), s) - sigmoid2 (minx, s)) / |
3309 | + (sigmoid2 (maxx, s) - sigmoid2 (minx, s))); |
3310 | +} |
3311 | + |
3312 | +float |
3313 | +Animation::progressDecelerate (float progress) |
3314 | +{ |
3315 | + return progressDecelerateCustom (progress, 0.5, 0.75); |
3316 | +} |
3317 | + |
3318 | +BoxPtr |
3319 | +AnimWindow::BB () |
3320 | +{ |
3321 | + return &priv->mBB; |
3322 | +} |
3323 | + |
3324 | +CompRegion & |
3325 | +AnimWindow::stepRegion () |
3326 | +{ |
3327 | + return priv->mStepRegion; |
3328 | +} |
3329 | + |
3330 | +void |
3331 | +PrivateAnimWindow::copyResetStepRegion () |
3332 | +{ |
3333 | + mLastStepRegion = mStepRegion; |
3334 | + |
3335 | + // Reset bounding box for current step |
3336 | + mBB.x1 = mBB.y1 = MAXSHORT; |
3337 | + mBB.x2 = mBB.y2 = MINSHORT; |
3338 | +} |
3339 | + |
3340 | +void |
3341 | +AnimWindow::expandBBWithBox (Box &source) |
3342 | +{ |
3343 | + Box &target = priv->BB (); |
3344 | + |
3345 | + if (source.x1 < target.x1) |
3346 | + target.x1 = source.x1; |
3347 | + if (source.x2 > target.x2) |
3348 | + target.x2 = source.x2; |
3349 | + if (source.y1 < target.y1) |
3350 | + target.y1 = source.y1; |
3351 | + if (source.y2 > target.y2) |
3352 | + target.y2 = source.y2; |
3353 | +} |
3354 | + |
3355 | +void |
3356 | +AnimWindow::expandBBWithPoint (float fx, float fy) |
3357 | +{ |
3358 | + Box &target = priv->BB (); |
3359 | + |
3360 | + short x = MAX (MIN (fx, MAXSHORT - 1), MINSHORT); |
3361 | + short y = MAX (MIN (fy, MAXSHORT - 1), MINSHORT); |
3362 | + |
3363 | + if (target.x1 == MAXSHORT) |
3364 | + { |
3365 | + target.x1 = x; |
3366 | + target.y1 = y; |
3367 | + target.x2 = x + 1; |
3368 | + target.y2 = y + 1; |
3369 | + return; |
3370 | + } |
3371 | + if (x < target.x1) |
3372 | + target.x1 = x; |
3373 | + else if (x > target.x2) |
3374 | + target.x2 = x; |
3375 | + |
3376 | + if (y < target.y1) |
3377 | + target.y1 = y; |
3378 | + else if (y > target.y2) |
3379 | + target.y2 = y; |
3380 | +} |
3381 | + |
3382 | +/// This will work for zoom-like 2D transforms, |
3383 | +/// but not for glide-like 3D transforms. |
3384 | +void |
3385 | +AnimWindow::expandBBWithPoint2DTransform (GLVector &coords, |
3386 | + GLMatrix &transformMat) |
3387 | +{ |
3388 | + GLVector coordsTransformed = transformMat * coords; |
3389 | + expandBBWithPoint (coordsTransformed[GLVector::x], |
3390 | + coordsTransformed[GLVector::y]); |
3391 | +} |
3392 | + |
3393 | +/// Either points or objects should be non-0. |
3394 | +bool |
3395 | +AnimWindow::expandBBWithPoints3DTransform (CompOutput &output, |
3396 | + GLMatrix &transform, |
3397 | + const float *points, |
3398 | + GridAnim::GridModel::GridObject *objects, |
3399 | + unsigned int nPoints) |
3400 | +{ |
3401 | + GLdouble dModel[16]; |
3402 | + GLdouble dProjection[16]; |
3403 | + GLdouble x, y, z; |
3404 | + for (unsigned int i = 0; i < 16; i++) |
3405 | + { |
3406 | + dModel[i] = transform[i]; |
3407 | + dProjection[i] = GLScreen::get (::screen)->projectionMatrix ()[i]; |
3408 | + } |
3409 | + GLint viewport[4] = |
3410 | + {output.region ()->extents.x1, |
3411 | + output.region ()->extents.y1, |
3412 | + output.width (), |
3413 | + output.height ()}; |
3414 | + |
3415 | + if (points) // use points |
3416 | + { |
3417 | + for (; nPoints; nPoints--, points += 3) |
3418 | + { |
3419 | + if (!gluProject (points[0], points[1], points[2], |
3420 | + dModel, dProjection, viewport, |
3421 | + &x, &y, &z)) |
3422 | + return false; |
3423 | + |
3424 | + expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5); |
3425 | + } |
3426 | + } |
3427 | + else // use grid model objects |
3428 | + { |
3429 | + GridAnim::GridModel::GridObject *object = objects; |
3430 | + for (; nPoints; nPoints--, object++) |
3431 | + { |
3432 | + if (!gluProject (object->position ().x (), |
3433 | + object->position ().y (), |
3434 | + object->position ().z (), |
3435 | + dModel, dProjection, viewport, |
3436 | + &x, &y, &z)) |
3437 | + return false; |
3438 | + |
3439 | + expandBBWithPoint (x + 0.5, (::screen->height () - y) + 0.5); |
3440 | + } |
3441 | + } |
3442 | + return true; |
3443 | +} |
3444 | + |
3445 | +void |
3446 | +AnimWindow::expandBBWithWindow () |
3447 | +{ |
3448 | + CompRect outRect (savedRectsValid () ? |
3449 | + savedOutRect () : |
3450 | + mWindow->outputRect ()); |
3451 | + Box windowBox = { |
3452 | + outRect.x (), outRect.x () + outRect.width (), |
3453 | + outRect.y (), outRect.y () + outRect.height () |
3454 | + }; |
3455 | + expandBBWithBox (windowBox); |
3456 | +} |
3457 | + |
3458 | +void |
3459 | +AnimWindow::expandBBWithScreen () |
3460 | +{ |
3461 | + Box screenBox = {0, ::screen->width (), |
3462 | + 0, ::screen->height ()}; |
3463 | + expandBBWithBox (screenBox); |
3464 | +} |
3465 | + |
3466 | +void |
3467 | +Animation::prepareTransform (CompOutput &output, |
3468 | + GLMatrix &resultTransform, |
3469 | + GLMatrix &transform) |
3470 | +{ |
3471 | + GLMatrix sTransform; |
3472 | + sTransform.toScreenSpace (&output, -DEFAULT_Z_CAMERA); |
3473 | + resultTransform = sTransform * transform; |
3474 | +} |
3475 | + |
3476 | +void |
3477 | +AnimWindow::resetStepRegionWithBB () |
3478 | +{ |
3479 | + // Have a 1 pixel margin to prevent occasional 1 pixel line artifact |
3480 | + CompRegion region (priv->mBB.x1 - 1, |
3481 | + priv->mBB.y1 - 1, |
3482 | + priv->mBB.x2 - priv->mBB.x1 + 2, |
3483 | + priv->mBB.y2 - priv->mBB.y1 + 2); |
3484 | + priv->mStepRegion = region; |
3485 | +} |
3486 | + |
3487 | +/// Damage the union of window's bounding box |
3488 | +/// before and after animStepFunc does its job. |
3489 | +void |
3490 | +PrivateAnimWindow::damageThisAndLastStepRegion () |
3491 | +{ |
3492 | + // Find union of the regions for this step and last step |
3493 | + CompRegion totalRegionToDamage (mStepRegion + mLastStepRegion); |
3494 | + |
3495 | + mPAScreen->cScreen->damageRegion (totalRegionToDamage); |
3496 | +} |
3497 | + |
3498 | +CompOutput & |
3499 | +AnimScreen::output () |
3500 | +{ |
3501 | + return priv->output (); |
3502 | +} |
3503 | + |
3504 | +bool |
3505 | +AnimScreen::getMousePointerXY (short *x, short *y) |
3506 | +{ |
3507 | + Window w1, w2; |
3508 | + int xp, yp, xj, yj; |
3509 | + unsigned int m; |
3510 | + |
3511 | + if (XQueryPointer |
3512 | + (::screen->dpy (), ::screen->root (), &w1, &w2, &xj, &yj, &xp, &yp, &m)) |
3513 | + { |
3514 | + *x = xp; |
3515 | + *y = yp; |
3516 | + return true; |
3517 | + } |
3518 | + return false; |
3519 | +} |
3520 | + |
3521 | +unsigned int |
3522 | +PrivateAnimWindow::getState () |
3523 | +{ |
3524 | + Atom actual; |
3525 | + int result, format; |
3526 | + unsigned long n, left; |
3527 | + unsigned char *data; |
3528 | + unsigned int retval = WithdrawnState; |
3529 | + |
3530 | + result = XGetWindowProperty (::screen->dpy (), mWindow->id (), |
3531 | + Atoms::wmState, 0L, |
3532 | + 1L, false, |
3533 | + Atoms::wmState, |
3534 | + &actual, &format, &n, &left, &data); |
3535 | + |
3536 | + if (result == Success && data) |
3537 | + { |
3538 | + if (n) |
3539 | + memcpy (&retval, data, sizeof (int)); |
3540 | + |
3541 | + XFree ((void *)data); |
3542 | + } |
3543 | + |
3544 | + return retval; |
3545 | +} |
3546 | + |
3547 | +CompOption::Vector & |
3548 | +AnimScreen::getOptions () |
3549 | +{ |
3550 | + return priv->getOptions (); |
3551 | +} |
3552 | + |
3553 | +bool |
3554 | +AnimScreen::setOption (const CompString &name, |
3555 | + CompOption::Value &value) |
3556 | +{ |
3557 | + return priv->setOption (name, value); |
3558 | +} |
3559 | + |
3560 | +void |
3561 | +PrivateAnimScreen::eventMatchesChanged (CompOption *opt, |
3562 | + AnimationOptions::Options num) |
3563 | +{ |
3564 | + if (mExtensionPlugins.size () == 0) |
3565 | + initAnimationList (); |
3566 | + foreach (CompOption::Value &val, opt->value ().list ()) |
3567 | + val.match ().update (); |
3568 | +} |
3569 | + |
3570 | +void |
3571 | +PrivateAnimScreen::eventOptionsChanged (CompOption *opt, |
3572 | + AnimationOptions::Options num) |
3573 | +{ |
3574 | + if (mExtensionPlugins.size () == 0) |
3575 | + initAnimationList (); |
3576 | + updateOptionSets (getCorrespondingAnimEvent (num)); |
3577 | +} |
3578 | + |
3579 | +void |
3580 | +PrivateAnimScreen::eventEffectsChanged (CompOption *opt, |
3581 | + AnimationOptions::Options num) |
3582 | +{ |
3583 | + if (mExtensionPlugins.size () == 0) |
3584 | + initAnimationList (); |
3585 | + updateEventEffects (getCorrespondingAnimEvent (num), false); |
3586 | +} |
3587 | + |
3588 | +void |
3589 | +PrivateAnimScreen::eventRandomEffectsChanged (CompOption *opt, |
3590 | + AnimationOptions::Options num) |
3591 | +{ |
3592 | + if (mExtensionPlugins.size () == 0) |
3593 | + initAnimationList (); |
3594 | + updateEventEffects (getCorrespondingAnimEvent (num), true); |
3595 | +} |
3596 | + |
3597 | +void |
3598 | +PrivateAnimWindow::postAnimationCleanUpCustom (bool closing, |
3599 | + bool destructing, |
3600 | + bool clearMatchingRow) |
3601 | +{ |
3602 | + bool shouldDamageWindow = false; |
3603 | + |
3604 | + notifyAnimation (false); |
3605 | + |
3606 | + if (mCurAnimation) |
3607 | + { |
3608 | + if (mCurAnimation->shouldDamageWindowOnEnd ()) |
3609 | + shouldDamageWindow = true; |
3610 | + } |
3611 | + enablePainting (false); |
3612 | + |
3613 | + if (shouldDamageWindow) |
3614 | + mAWindow->expandBBWithWindow (); |
3615 | + |
3616 | + if (shouldDamageWindow || |
3617 | + (mCurAnimation && |
3618 | + !mCurAnimation->stepRegionUsed () && |
3619 | + mAWindow->BB ()->x1 != MAXSHORT)) // BB intialized |
3620 | + mAWindow->resetStepRegionWithBB (); |
3621 | + |
3622 | + damageThisAndLastStepRegion (); |
3623 | + |
3624 | + if (mCurAnimation) |
3625 | + { |
3626 | + mCurAnimation->cleanUp (closing, destructing); |
3627 | + delete mCurAnimation; |
3628 | + mCurAnimation = 0; |
3629 | + } |
3630 | + |
3631 | + mBB.x1 = mBB.y1 = MAXSHORT; |
3632 | + mBB.x2 = mBB.y2 = MINSHORT; |
3633 | + |
3634 | + mState = mNewState; |
3635 | + |
3636 | + if (clearMatchingRow) |
3637 | + mCurAnimSelectionRow = -1; |
3638 | + |
3639 | + mFinishingAnim = true; |
3640 | + if (!destructing) |
3641 | + { |
3642 | + mIgnoreDamage = true; |
3643 | + while (mUnmapCnt > 0) |
3644 | + { |
3645 | + mWindow->unmap (); |
3646 | + mUnmapCnt--; |
3647 | + } |
3648 | + if (mUnmapCnt < 0) |
3649 | + mUnmapCnt = 0; |
3650 | + mIgnoreDamage = false; |
3651 | + } |
3652 | + |
3653 | + while (mDestroyCnt) |
3654 | + { |
3655 | + mWindow->destroy (); |
3656 | + mDestroyCnt--; |
3657 | + } |
3658 | + mFinishingAnim = false; |
3659 | + |
3660 | + foreach (ExtensionPluginInfo *extPlugin, mPAScreen->mExtensionPlugins) |
3661 | + extPlugin->cleanUpAnimation (closing, destructing); |
3662 | +} |
3663 | + |
3664 | +void |
3665 | +AnimWindow::postAnimationCleanUp () |
3666 | +{ |
3667 | + priv->postAnimationCleanUp (); |
3668 | +} |
3669 | + |
3670 | +void |
3671 | +PrivateAnimWindow::postAnimationCleanUp () |
3672 | +{ |
3673 | + if (mCurAnimation->curWindowEvent () == WindowEventClose) |
3674 | + postAnimationCleanUpCustom (true, false, true); |
3675 | + else |
3676 | + postAnimationCleanUpCustom (false, false, true); |
3677 | +} |
3678 | + |
3679 | +void |
3680 | +PrivateAnimWindow::postAnimationCleanUpPrev (bool closing, |
3681 | + bool clearMatchingRow) |
3682 | +{ |
3683 | + int curAnimSelectionRow = mCurAnimSelectionRow; |
3684 | + // Use previous event's anim selection row |
3685 | + mCurAnimSelectionRow = mPrevAnimSelectionRow; |
3686 | + |
3687 | + postAnimationCleanUpCustom (closing, false, clearMatchingRow); |
3688 | + |
3689 | + // Restore current event's anim selection row |
3690 | + mCurAnimSelectionRow = curAnimSelectionRow; |
3691 | +} |
3692 | + |
3693 | +void |
3694 | +PrivateAnimScreen::activateEvent (bool activating) |
3695 | +{ |
3696 | + if (activating) |
3697 | + { |
3698 | + if (mAnimInProgress) |
3699 | + return; |
3700 | + } |
3701 | + else |
3702 | + { |
3703 | + // Animations have finished for all windows |
3704 | + // (Keep preparePaint enabled) |
3705 | + |
3706 | + cScreen->getWindowPaintListSetEnabled (this, false); |
3707 | + enablePrePaintWindowsBackToFront (false); |
3708 | + } |
3709 | + cScreen->donePaintSetEnabled (this, activating); |
3710 | + gScreen->glPaintOutputSetEnabled (this, activating); |
3711 | + |
3712 | + mAnimInProgress = activating; |
3713 | + |
3714 | + CompOption::Vector o (0); |
3715 | + |
3716 | + o.push_back (CompOption ("root", CompOption::TypeInt)); |
3717 | + o.push_back (CompOption ("active", CompOption::TypeBool)); |
3718 | + |
3719 | + o[0].value ().set ((int) ::screen->root ()); |
3720 | + o[1].value ().set (activating); |
3721 | + |
3722 | + ::screen->handleCompizEvent ("animation", "activate", o); |
3723 | +} |
3724 | + |
3725 | +void |
3726 | +PrivateAnimWindow::notifyAnimation (bool activation) |
3727 | +{ |
3728 | + CompOption::Vector o (0); |
3729 | + |
3730 | + if (!mCurAnimation) |
3731 | + return; |
3732 | + |
3733 | + o.push_back (CompOption ("root", CompOption::TypeInt)); |
3734 | + o.push_back (CompOption ("window", CompOption::TypeInt)); |
3735 | + o.push_back (CompOption ("type", CompOption::TypeString)); |
3736 | + o.push_back (CompOption ("active", CompOption::TypeBool)); |
3737 | + |
3738 | + o[0].value ().set ((int) ::screen->root ()); |
3739 | + o[1].value ().set ((int) mWindow->id ()); |
3740 | + |
3741 | + switch (mCurAnimation->curWindowEvent ()) |
3742 | + { |
3743 | + case WindowEventOpen: |
3744 | + o[2].value ().set ("open"); |
3745 | + break; |
3746 | + case WindowEventClose: |
3747 | + o[2].value ().set ("close"); |
3748 | + break; |
3749 | + case WindowEventMinimize: |
3750 | + o[2].value ().set ("minimize"); |
3751 | + break; |
3752 | + case WindowEventUnminimize: |
3753 | + o[2].value ().set ("unminimize"); |
3754 | + break; |
3755 | + case WindowEventShade: |
3756 | + o[2].value ().set ("shade"); |
3757 | + break; |
3758 | + case WindowEventUnshade: |
3759 | + o[2].value ().set ("unshade"); |
3760 | + break; |
3761 | + case WindowEventFocus: |
3762 | + o[2].value ().set ("focus"); |
3763 | + break; |
3764 | + case WindowEventNum: |
3765 | + case WindowEventNone: |
3766 | + default: |
3767 | + o[2].value ().set ("none"); |
3768 | + break; |
3769 | + } |
3770 | + |
3771 | + o[3].value ().set (activation); |
3772 | + |
3773 | + screen->handleCompizEvent ("animation", "window_animation", o); |
3774 | +} |
3775 | + |
3776 | +bool |
3777 | +PrivateAnimScreen::otherPluginsActive () |
3778 | +{ |
3779 | + for (int i = 0; i < WatchedScreenPluginNum; i++) |
3780 | + if (mPluginActive[i]) |
3781 | + return true; |
3782 | + return false; |
3783 | +} |
3784 | + |
3785 | +bool |
3786 | +Animation::shouldSkipFrame (int msSinceLastPaintActual) |
3787 | +{ |
3788 | + mTimeElapsedWithinTimeStep += msSinceLastPaintActual; |
3789 | + if (mTimeElapsedWithinTimeStep < mTimestep) // if timestep not yet completed |
3790 | + return true; |
3791 | + |
3792 | + mTimeElapsedWithinTimeStep = fmod (mTimeElapsedWithinTimeStep, mTimestep); |
3793 | + return false; |
3794 | +} |
3795 | + |
3796 | +bool |
3797 | +Animation::advanceTime (int msSinceLastPaint) |
3798 | +{ |
3799 | + mRemainingTime -= msSinceLastPaint; |
3800 | + mRemainingTime = MAX (mRemainingTime, 0); // avoid sub-zero values |
3801 | + |
3802 | + mTimeSinceLastPaint = msSinceLastPaint; |
3803 | + |
3804 | + return (mRemainingTime > 0); |
3805 | +} |
3806 | + |
3807 | +void |
3808 | +PrivateAnimScreen::preparePaint (int msSinceLastPaint) |
3809 | +{ |
3810 | + // Check and update "switcher post wait" counter |
3811 | + if (mSwitcherPostWait > 0) |
3812 | + { |
3813 | + mSwitcherPostWait++; |
3814 | + if (mSwitcherPostWait > 5) // wait over |
3815 | + { |
3816 | + mSwitcherPostWait = 0; |
3817 | + |
3818 | + // Reset stacking related info since it will |
3819 | + // cause problems because of the restacking |
3820 | + // just done by Switcher. |
3821 | + ExtensionPluginAnimation *extPlugin = |
3822 | + static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]); |
3823 | + extPlugin->resetStackingInfo (); |
3824 | + } |
3825 | + } |
3826 | + |
3827 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
3828 | + extPlugin->prePreparePaintGeneral (); |
3829 | + |
3830 | + if (mAnimInProgress) |
3831 | + { |
3832 | + int msSinceLastPaintActual; |
3833 | + |
3834 | + struct timeval curTime; |
3835 | + gettimeofday (&curTime, 0); |
3836 | + |
3837 | + if (mLastRedrawTimeFresh) |
3838 | + { |
3839 | + msSinceLastPaintActual = TIMEVALDIFF (&curTime, &mLastRedrawTime); |
3840 | + // handle clock rollback |
3841 | + if (msSinceLastPaintActual < 0) |
3842 | + msSinceLastPaintActual = 0; |
3843 | + } |
3844 | + else |
3845 | + msSinceLastPaintActual = 20; // assume 20 ms passed |
3846 | + |
3847 | + mLastRedrawTime = curTime; // Store current time for next time |
3848 | + mLastRedrawTimeFresh = true; |
3849 | + |
3850 | + bool animStillInProgress = false; |
3851 | + |
3852 | + foreach (CompWindow *w, ::screen->windows ()) |
3853 | + { |
3854 | + AnimWindow *animWin = AnimWindow::get (w); |
3855 | + PrivateAnimWindow *aw = animWin->priv; |
3856 | + Animation *curAnim = aw->curAnimation (); |
3857 | + |
3858 | + if (curAnim) |
3859 | + { |
3860 | + if (!curAnim->initialized ()) |
3861 | + curAnim->init (); |
3862 | + |
3863 | + if (curAnim->prePreparePaint (msSinceLastPaint)) |
3864 | + animStillInProgress = true; |
3865 | + |
3866 | + /* TODO optimize grid model by reusing one GridModel |
3867 | + if (aw->com.mModel && |
3868 | + (aw->com.mModel->winWidth != outRect.width () || |
3869 | + aw->com.mModel->winHeight != outRect.height ())) |
3870 | + { |
3871 | + // mModel needs update |
3872 | + // re-create mModel |
3873 | + if (!animEnsureModel (w)) |
3874 | + { |
3875 | + // Abort this window's animation |
3876 | + postAnimationCleanUp (w); |
3877 | + continue; |
3878 | + } |
3879 | + }*/ |
3880 | + |
3881 | + bool animShouldSkipFrame = |
3882 | + (curAnim->shouldSkipFrame (msSinceLastPaintActual) && |
3883 | + // Skip only if we're not on the first animation frame |
3884 | + curAnim->initialized ()); |
3885 | + |
3886 | + // Skip only if we're not on the last animation frame |
3887 | + animShouldSkipFrame &= |
3888 | + curAnim->advanceTime (msSinceLastPaint); |
3889 | + |
3890 | + if (!animShouldSkipFrame) |
3891 | + { |
3892 | + if (curAnim->updateBBUsed ()) |
3893 | + { |
3894 | + aw->copyResetStepRegion (); |
3895 | + |
3896 | + if (!curAnim->initialized () && |
3897 | + curAnim->shouldDamageWindowOnStart ()) |
3898 | + aw->aWindow ()->expandBBWithWindow (); |
3899 | + } |
3900 | + |
3901 | + if (!curAnim->initialized ()) |
3902 | + curAnim->setInitialized (); |
3903 | + |
3904 | + curAnim->step (); |
3905 | + |
3906 | + if (curAnim->updateBBUsed ()) |
3907 | + { |
3908 | + foreach (CompOutput &output, ::screen->outputDevs ()) |
3909 | + curAnim->updateBB (output); |
3910 | + |
3911 | + if (!curAnim->stepRegionUsed () && |
3912 | + aw->BB ().x1 != MAXSHORT) // BB initialized |
3913 | + { |
3914 | + // BB is used instead of step region, |
3915 | + // so reset step region here with BB. |
3916 | + animWin->resetStepRegionWithBB (); |
3917 | + } |
3918 | + if (!(cScreen->damageMask () & |
3919 | + COMPOSITE_SCREEN_DAMAGE_ALL_MASK)) |
3920 | + aw->damageThisAndLastStepRegion (); |
3921 | + } |
3922 | + } |
3923 | + |
3924 | + bool finished = (curAnim->remainingTime () <= 0); |
3925 | + if (finished) // Animation is done |
3926 | + { |
3927 | + aw->notifyAnimation (false); |
3928 | + aw->postAnimationCleanUp (); |
3929 | + } |
3930 | + else |
3931 | + animStillInProgress = true; |
3932 | + } |
3933 | + } |
3934 | + |
3935 | + foreach (CompWindow *w, ::screen->windows ()) |
3936 | + { |
3937 | + PrivateAnimWindow *aw = AnimWindow::get (w)->priv; |
3938 | + if (aw->curAnimation ()) |
3939 | + aw->curAnimation ()->postPreparePaint (); |
3940 | + } |
3941 | + |
3942 | + if (!animStillInProgress) |
3943 | + { |
3944 | + activateEvent (false); |
3945 | + mLastRedrawTimeFresh = false; |
3946 | + |
3947 | + // Reset stacking related info after all animations are done. |
3948 | + ExtensionPluginAnimation *extPlugin = |
3949 | + static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]); |
3950 | + extPlugin->resetStackingInfo (); |
3951 | + } |
3952 | + } |
3953 | + |
3954 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
3955 | + extPlugin->postPreparePaintGeneral (); |
3956 | + |
3957 | + cScreen->preparePaint (msSinceLastPaint); |
3958 | + |
3959 | + if (mStartCountdown) |
3960 | + { |
3961 | + mStartCountdown--; |
3962 | + if (!mStartCountdown) |
3963 | + { |
3964 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
3965 | + extPlugin->postStartupCountdown (); |
3966 | + } |
3967 | + } |
3968 | +} |
3969 | + |
3970 | +void |
3971 | +PrivateAnimScreen::donePaint () |
3972 | +{ |
3973 | + assert (mAnimInProgress); |
3974 | + |
3975 | + cScreen->damagePending (); |
3976 | + |
3977 | + cScreen->donePaint (); |
3978 | +} |
3979 | + |
3980 | +void |
3981 | +PrivateAnimWindow::enablePainting (bool enabling) |
3982 | +{ |
3983 | + gWindow->glPaintSetEnabled (this, enabling); |
3984 | + gWindow->glAddGeometrySetEnabled (this, enabling); |
3985 | + gWindow->glDrawGeometrySetEnabled (this, enabling); |
3986 | + gWindow->glDrawTextureSetEnabled (this, enabling); |
3987 | +} |
3988 | + |
3989 | +void |
3990 | +PrivateAnimWindow::glAddGeometry (const GLTexture::MatrixList &matrix, |
3991 | + const CompRegion ®ion, |
3992 | + const CompRegion &clip, |
3993 | + unsigned int maxGridWidth, |
3994 | + unsigned int maxGridHeight) |
3995 | +{ |
3996 | + // if window is being animated |
3997 | + if (mCurAnimation) |
3998 | + { |
3999 | + if (mCurAnimation->initialized ()) |
4000 | + mCurAnimation->addGeometry (matrix, region, clip, |
4001 | + maxGridWidth, maxGridHeight); |
4002 | + } |
4003 | + else |
4004 | + { |
4005 | + gWindow->glAddGeometry (matrix, region, clip, |
4006 | + maxGridWidth, maxGridHeight); |
4007 | + } |
4008 | +} |
4009 | + |
4010 | +bool |
4011 | +Animation::shouldDamageWindowOnStart () |
4012 | +{ |
4013 | + return (mCurWindowEvent == WindowEventClose || |
4014 | + mCurWindowEvent == WindowEventMinimize || |
4015 | + mCurWindowEvent == WindowEventShade); |
4016 | +} |
4017 | + |
4018 | +bool |
4019 | +Animation::shouldDamageWindowOnEnd () |
4020 | +{ |
4021 | + return (mCurWindowEvent == WindowEventOpen || |
4022 | + mCurWindowEvent == WindowEventUnminimize || |
4023 | + mCurWindowEvent == WindowEventUnshade); |
4024 | +} |
4025 | + |
4026 | +void |
4027 | +Animation::addGeometry (const GLTexture::MatrixList &matrix, |
4028 | + const CompRegion ®ion, |
4029 | + const CompRegion &clip, |
4030 | + unsigned int maxGridWidth, |
4031 | + unsigned int maxGridHeight) |
4032 | +{ |
4033 | + mAWindow->priv->gWindow->glAddGeometry (matrix, region, clip, |
4034 | + maxGridWidth, maxGridHeight); |
4035 | +} |
4036 | + |
4037 | +void |
4038 | +PartialWindowAnim::addGeometry (const GLTexture::MatrixList &matrix, |
4039 | + const CompRegion ®ion, |
4040 | + const CompRegion &clip, |
4041 | + unsigned int maxGridWidth, |
4042 | + unsigned int maxGridHeight) |
4043 | +{ |
4044 | + if (mUseDrawRegion) |
4045 | + { |
4046 | + CompRegion awRegion (region.intersected (mDrawRegion)); |
4047 | + Animation::addGeometry (matrix, awRegion, clip, |
4048 | + maxGridWidth, maxGridHeight); |
4049 | + } |
4050 | + else |
4051 | + { |
4052 | + Animation::addGeometry (matrix, region, clip, |
4053 | + maxGridWidth, maxGridHeight); |
4054 | + } |
4055 | +} |
4056 | + |
4057 | +void |
4058 | +PrivateAnimWindow::glDrawTexture (GLTexture *texture, |
4059 | + GLFragment::Attrib &attrib, |
4060 | + unsigned int mask) |
4061 | +{ |
4062 | + if (mCurAnimation) |
4063 | + { |
4064 | + mCurAnimation->setCurPaintAttrib (attrib); |
4065 | + } |
4066 | + |
4067 | + gWindow->glDrawTexture (texture, attrib, mask); |
4068 | +} |
4069 | + |
4070 | +void |
4071 | +PrivateAnimWindow::glDrawGeometry () |
4072 | +{ |
4073 | + if (mCurAnimation) |
4074 | + { |
4075 | + if (mCurAnimation->initialized ()) |
4076 | + mCurAnimation->drawGeometry (); |
4077 | + } |
4078 | + else |
4079 | + { |
4080 | + gWindow->glDrawGeometry (); |
4081 | + } |
4082 | +} |
4083 | + |
4084 | +void |
4085 | +Animation::drawTexture (GLTexture *texture, |
4086 | + GLFragment::Attrib &attrib, |
4087 | + unsigned int mask) |
4088 | +{ |
4089 | + mCurPaintAttrib = attrib; |
4090 | +} |
4091 | + |
4092 | +void |
4093 | +Animation::drawGeometry () |
4094 | +{ |
4095 | + mAWindow->priv->gWindow->glDrawGeometry (); |
4096 | +} |
4097 | + |
4098 | +bool |
4099 | +PrivateAnimWindow::glPaint (const GLWindowPaintAttrib &attrib, |
4100 | + const GLMatrix &transform, |
4101 | + const CompRegion ®ion, unsigned int mask) |
4102 | +{ |
4103 | + bool status; |
4104 | + |
4105 | + // Is this the first glPaint call this round |
4106 | + // without the mask PAINT_WINDOW_OCCLUSION_DETECTION_MASK? |
4107 | + if (mPAScreen->mStartingNewPaintRound && |
4108 | + !(mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)) |
4109 | + { |
4110 | + mPAScreen->mStartingNewPaintRound = false; |
4111 | + |
4112 | + // Back-to-front painting of windows is starting now. |
4113 | + if (mPAScreen->mPrePaintWindowsBackToFrontEnabled) |
4114 | + mPAScreen->prePaintWindowsBackToFront (); |
4115 | + } |
4116 | + |
4117 | + assert (mCurAnimation); |
4118 | + |
4119 | + foreach (ExtensionPluginInfo *extPlugin, mPAScreen->mExtensionPlugins) |
4120 | + { |
4121 | + if (extPlugin->paintShouldSkipWindow (mWindow)) |
4122 | + return false; |
4123 | + } |
4124 | + |
4125 | + if (mCurAnimation->curWindowEvent () == WindowEventFocus && |
4126 | + mPAScreen->otherPluginsActive ()) |
4127 | + { |
4128 | + postAnimationCleanUp (); |
4129 | + return gWindow->glPaint (attrib, transform, region, mask); |
4130 | + } |
4131 | + |
4132 | + GLWindowPaintAttrib wAttrib = attrib; |
4133 | + GLMatrix wTransform (transform.getMatrix ()); |
4134 | + |
4135 | + /* TODO check if this is still necessary |
4136 | + if (mCurAnimation->addCustomGeometryFunc) |
4137 | + { |
4138 | + // Use slightly smaller brightness to force core |
4139 | + // to handle <max saturation case with <max brightness. |
4140 | + // Otherwise polygon effects show fully unsaturated colors |
4141 | + // in that case. |
4142 | + wAttrib.brightness = MAX (0, wAttrib.brightness - 1); |
4143 | + } */ |
4144 | + |
4145 | + //w->indexCount = 0; // TODO check if this is still necessary |
4146 | + |
4147 | + // TODO: should only happen for distorting effects |
4148 | + mask |= PAINT_WINDOW_TRANSFORMED_MASK; |
4149 | + |
4150 | + wAttrib.xScale = 1.0f; |
4151 | + wAttrib.yScale = 1.0f; |
4152 | + |
4153 | + mCurAnimation->updateAttrib (wAttrib); |
4154 | + mCurAnimation->updateTransform (wTransform); |
4155 | + mCurAnimation->prePaintWindow (); |
4156 | + |
4157 | + if (mCurAnimation->paintWindowUsed ()) |
4158 | + status = mCurAnimation->paintWindow (gWindow, wAttrib, wTransform, region, mask); |
4159 | + else |
4160 | + status = gWindow->glPaint (wAttrib, wTransform, region, mask); |
4161 | + |
4162 | + if (mCurAnimation->postPaintWindowUsed ()) |
4163 | + { |
4164 | + // Transform to make post-paint coincide with the window |
4165 | + glPushMatrix (); |
4166 | + glLoadMatrixf (wTransform.getMatrix ()); |
4167 | + |
4168 | + mCurAnimation->postPaintWindow (); |
4169 | + |
4170 | + glPopMatrix (); |
4171 | + } |
4172 | + |
4173 | + return status; |
4174 | +} |
4175 | + |
4176 | +/// This is enabled only during restack animations. |
4177 | +const CompWindowList & |
4178 | +PrivateAnimScreen::getWindowPaintList () |
4179 | +{ |
4180 | + ExtensionPluginAnimation *extPlugin = |
4181 | + static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]); |
4182 | + return extPlugin->getWindowPaintList (); |
4183 | +} |
4184 | + |
4185 | +/// This is enabled only during restack animations. |
4186 | +void |
4187 | +PrivateAnimScreen::prePaintWindowsBackToFront () |
4188 | +{ |
4189 | + assert (mAnimInProgress); |
4190 | + |
4191 | + ExtensionPluginAnimation *extPlugin = |
4192 | + static_cast<ExtensionPluginAnimation *> (mExtensionPlugins[0]); |
4193 | + extPlugin->prePaintWindowsBackToFront (); |
4194 | +} |
4195 | + |
4196 | +void |
4197 | +PrivateAnimScreen::enablePrePaintWindowsBackToFront (bool enabled) |
4198 | +{ |
4199 | + mPrePaintWindowsBackToFrontEnabled = enabled; |
4200 | +} |
4201 | + |
4202 | +void |
4203 | +AnimScreen::enableCustomPaintList (bool enabled) |
4204 | +{ |
4205 | + priv->cScreen->getWindowPaintListSetEnabled (priv, enabled); |
4206 | + priv->enablePrePaintWindowsBackToFront (enabled); |
4207 | +} |
4208 | + |
4209 | +static const PluginEventInfo watchedScreenPlugins[] = |
4210 | +{ |
4211 | + {"switcher", "activate"}, |
4212 | + {"ring", "activate"}, |
4213 | + {"shift", "activate"}, |
4214 | + {"scale", "activate"}, |
4215 | + {"group", "tabChangeActivate"}, |
4216 | + {"fadedesktop", "activate"} |
4217 | +}; |
4218 | + |
4219 | +static const PluginEventInfo watchedWindowPlugins[] = |
4220 | +{ |
4221 | + {"kdecompat", "slide"}, |
4222 | +}; |
4223 | + |
4224 | +void |
4225 | +PrivateAnimScreen::handleCompizEvent (const char *pluginName, |
4226 | + const char *eventName, |
4227 | + CompOption::Vector &options) |
4228 | +{ |
4229 | + ::screen->handleCompizEvent (pluginName, eventName, options); |
4230 | + |
4231 | + for (int i = 0; i < WatchedScreenPluginNum; i++) |
4232 | + if (strcmp (pluginName, watchedScreenPlugins[i].pluginName) == 0) |
4233 | + { |
4234 | + if (strcmp (eventName, |
4235 | + watchedScreenPlugins[i].activateEventName) == 0) |
4236 | + { |
4237 | + mPluginActive[i] = |
4238 | + CompOption::getBoolOptionNamed (options, "active", false); |
4239 | + |
4240 | + if (!mPluginActive[i] && |
4241 | + (i == WatchedPluginSwitcher || |
4242 | + i == WatchedPluginRing || |
4243 | + i == WatchedPluginShift || |
4244 | + i == WatchedPluginScale)) |
4245 | + { |
4246 | + mSwitcherPostWait = 1; |
4247 | + } |
4248 | + } |
4249 | + break; |
4250 | + } |
4251 | + |
4252 | + for (int i = 0; i < WatchedWindowPluginNum; i++) |
4253 | + if (strcmp (pluginName, |
4254 | + watchedWindowPlugins[i].pluginName) == 0) |
4255 | + { |
4256 | + if (strcmp (eventName, |
4257 | + watchedWindowPlugins[i].activateEventName) == 0) |
4258 | + { |
4259 | + Window xid = CompOption::getIntOptionNamed (options, |
4260 | + "window", |
4261 | + 0); |
4262 | + CompWindow *w = screen->findWindow (xid); |
4263 | + |
4264 | + if (w) |
4265 | + { |
4266 | + AnimWindow *aw = AnimWindow::get (w); |
4267 | + PrivateAnimWindow *pw = aw->priv; |
4268 | + pw->mPluginActive[i] = CompOption::getBoolOptionNamed ( |
4269 | + options, |
4270 | + "active", |
4271 | + false); |
4272 | + } |
4273 | + } |
4274 | + break; |
4275 | + } |
4276 | +} |
4277 | + |
4278 | +/// Returns true for windows that don't have a pixmap or certain properties, |
4279 | +/// like the dimming layer of gksudo and x-session-manager. |
4280 | +inline bool |
4281 | +PrivateAnimScreen::shouldIgnoreWindowForAnim (CompWindow *w, bool checkPixmap) |
4282 | +{ |
4283 | + AnimWindow *aw = AnimWindow::get (w); |
4284 | + |
4285 | + for (int i = 0; i < WatchedWindowPluginNum; i++) |
4286 | + if (aw->priv->mPluginActive[i]) |
4287 | + return true; |
4288 | + |
4289 | + return ((checkPixmap && !CompositeWindow::get (w)->pixmap ()) || |
4290 | + mNeverAnimateMatch.evaluate (w)); |
4291 | +} |
4292 | + |
4293 | +void |
4294 | +PrivateAnimWindow::reverseAnimation () |
4295 | +{ |
4296 | + mCurAnimation->reverse (); |
4297 | + |
4298 | + // Inflict the pending unmaps |
4299 | + while (mUnmapCnt > 0) |
4300 | + { |
4301 | + mWindow->unmap (); |
4302 | + mUnmapCnt--; |
4303 | + } |
4304 | + if (mUnmapCnt < 0) |
4305 | + mUnmapCnt = 0; |
4306 | +} |
4307 | + |
4308 | +void |
4309 | +PrivateAnimScreen::initiateCloseAnim (PrivateAnimWindow *aw) |
4310 | +{ |
4311 | + CompWindow *w = aw->mWindow; |
4312 | + |
4313 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
4314 | + extPlugin->preInitiateCloseAnim (aw->mAWindow); |
4315 | + |
4316 | + if (shouldIgnoreWindowForAnim (w, true)) |
4317 | + return; |
4318 | + int duration = 200; |
4319 | + AnimEffect chosenEffect = |
4320 | + getMatchingAnimSelection (w, AnimEventClose, &duration); |
4321 | + |
4322 | + aw->mState = NormalState; |
4323 | + aw->mNewState = WithdrawnState; |
4324 | + |
4325 | + if (chosenEffect != AnimEffectNone) |
4326 | + { |
4327 | + bool startingNew = true; |
4328 | + WindowEvent curWindowEvent = WindowEventNone; |
4329 | + |
4330 | + if (aw->curAnimation ()) |
4331 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4332 | + |
4333 | + if (curWindowEvent != WindowEventNone) |
4334 | + { |
4335 | + if (curWindowEvent == WindowEventOpen) |
4336 | + { |
4337 | + startingNew = false; |
4338 | + aw->reverseAnimation (); |
4339 | + } |
4340 | + /* TODO check if necessary |
4341 | + else if (aw->com.curWindowEvent == WindowEventClose) |
4342 | + { |
4343 | + if (aw->com.animOverrideProgressDir == 2) |
4344 | + { |
4345 | + aw->com.animRemainingTime = tmpSteps; |
4346 | + startingNew = false; |
4347 | + } |
4348 | + }*/ |
4349 | + else |
4350 | + { |
4351 | + aw->postAnimationCleanUpPrev (true, false); |
4352 | + } |
4353 | + } |
4354 | + |
4355 | + if (startingNew) |
4356 | + { |
4357 | + AnimEffect effectToBePlayed = |
4358 | + getActualEffect (chosenEffect, AnimEventClose); |
4359 | + |
4360 | + // handle empty random effect list |
4361 | + if (effectToBePlayed && effectToBePlayed == AnimEffectNone) |
4362 | + { |
4363 | + aw->mState = aw->mNewState; |
4364 | + return; |
4365 | + } |
4366 | + |
4367 | + aw->mCurAnimation = |
4368 | + effectToBePlayed->create (w, WindowEventClose, duration, |
4369 | + effectToBePlayed, getIcon (w, true)); |
4370 | + aw->mCurAnimation->adjustPointerIconSize (); |
4371 | + aw->enablePainting (true); |
4372 | + } |
4373 | + |
4374 | + activateEvent (true); |
4375 | + aw->notifyAnimation (true); |
4376 | + |
4377 | + // Increment 3 times to make sure close animation works |
4378 | + // (e.g. for popup menus). |
4379 | + for (int i = 0; i < 3; i++) |
4380 | + { |
4381 | + aw->mUnmapCnt++; |
4382 | + w->incrementUnmapReference (); |
4383 | + } |
4384 | + cScreen->damagePending (); |
4385 | + } |
4386 | + /* TODO check if necessary |
4387 | + else if (AnimEffectNone != |
4388 | + getMatchingAnimSelection (w, AnimEventOpen, &duration)) |
4389 | + { |
4390 | + // stop the current animation and prevent it from rewinding |
4391 | + |
4392 | + if (aw->com.animRemainingTime > 0 && |
4393 | + aw->com.curWindowEvent != WindowEventOpen) |
4394 | + { |
4395 | + aw->com.animRemainingTime = 0; |
4396 | + } |
4397 | + if ((aw->com.curWindowEvent != WindowEventNone) && |
4398 | + (aw->com.curWindowEvent != WindowEventClose)) |
4399 | + { |
4400 | + postAnimationCleanUp (w); |
4401 | + } |
4402 | + // set some properties to make sure this window will use the |
4403 | + // correct open effect the next time it's "opened" |
4404 | + |
4405 | + activateEvent (w->screen, true); |
4406 | + aw->com.curWindowEvent = WindowEventClose; |
4407 | + |
4408 | + aw->mUnmapCnt++; |
4409 | + w->incrementUnmapRefCnt (); |
4410 | + |
4411 | + damagePendingOnScreen (w->screen); |
4412 | + }*/ |
4413 | + else |
4414 | + aw->mState = aw->mNewState; |
4415 | + |
4416 | + // Make sure non-animated closing windows get a damage. |
4417 | + if (!aw->curAnimation ()) |
4418 | + { |
4419 | + aw->mAWindow->expandBBWithWindow (); |
4420 | + } |
4421 | +} |
4422 | + |
4423 | +CompRect |
4424 | +PrivateAnimScreen::getIcon (CompWindow *w, bool alwaysUseMouse) |
4425 | +{ |
4426 | + CompRect icon; |
4427 | + |
4428 | + if (!alwaysUseMouse) |
4429 | + { |
4430 | + icon = w->iconGeometry (); |
4431 | + } |
4432 | + if (alwaysUseMouse || |
4433 | + (icon.x () == 0 && |
4434 | + icon.y () == 0 && |
4435 | + icon.width () == 0 && |
4436 | + icon.height () == 0)) // that is, couldn't get icon from window |
4437 | + { |
4438 | + // Minimize to mouse pointer if there is no |
4439 | + // window list or if the window skips taskbar |
4440 | + short x, y; |
4441 | + if (!aScreen->getMousePointerXY (&x, &y)) |
4442 | + { |
4443 | + // Use screen center if can't get mouse coords |
4444 | + x = ::screen->width () / 2; |
4445 | + y = ::screen->height () / 2; |
4446 | + } |
4447 | + icon.setX (x); |
4448 | + icon.setY (y); |
4449 | + icon.setWidth (FAKE_ICON_SIZE); |
4450 | + icon.setHeight (FAKE_ICON_SIZE); |
4451 | + } |
4452 | + |
4453 | + return icon; |
4454 | +} |
4455 | + |
4456 | +void |
4457 | +PrivateAnimScreen::initiateMinimizeAnim (PrivateAnimWindow *aw) |
4458 | +{ |
4459 | + CompWindow *w = aw->mWindow; |
4460 | + |
4461 | + if (aw->mWindow->destroyed ()) |
4462 | + return; |
4463 | + |
4464 | + // Store window geometry for use during animation. |
4465 | + aw->mAWindow->mSavedInRect = w->inputRect (); |
4466 | + aw->mAWindow->mSavedOutRect = w->outputRect (); |
4467 | + aw->mAWindow->mSavedOutExtents = w->output (); |
4468 | + aw->mAWindow->mSavedWinRect = w->geometry (); |
4469 | + aw->mAWindow->mSavedRectsValid = true; |
4470 | + |
4471 | + aw->mNewState = IconicState; |
4472 | + |
4473 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
4474 | + extPlugin->preInitiateMinimizeAnim (aw->mAWindow); |
4475 | + |
4476 | + int duration = 200; |
4477 | + AnimEffect chosenEffect = |
4478 | + getMatchingAnimSelection (w, AnimEventMinimize, &duration); |
4479 | + |
4480 | + if (chosenEffect != AnimEffectNone) |
4481 | + { |
4482 | + bool startingNew = true; |
4483 | + WindowEvent curWindowEvent = WindowEventNone; |
4484 | + |
4485 | + if (aw->curAnimation ()) |
4486 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4487 | + |
4488 | + if (curWindowEvent != WindowEventNone) |
4489 | + { |
4490 | + if (curWindowEvent != WindowEventUnminimize) |
4491 | + { |
4492 | + aw->postAnimationCleanUpPrev (false, false); |
4493 | + } |
4494 | + else |
4495 | + { |
4496 | + startingNew = false; |
4497 | + aw->reverseAnimation (); |
4498 | + } |
4499 | + } |
4500 | + |
4501 | + if (startingNew) |
4502 | + { |
4503 | + AnimEffect effectToBePlayed = |
4504 | + getActualEffect (chosenEffect, AnimEventMinimize); |
4505 | + |
4506 | + // handle empty random effect list |
4507 | + if (effectToBePlayed == AnimEffectNone) |
4508 | + { |
4509 | + aw->mState = aw->mNewState; |
4510 | + return; |
4511 | + } |
4512 | + |
4513 | + aw->mCurAnimation = |
4514 | + effectToBePlayed->create (w, WindowEventMinimize, duration, |
4515 | + effectToBePlayed, getIcon (w, false)); |
4516 | + aw->enablePainting (true); |
4517 | + } |
4518 | + |
4519 | + activateEvent (true); |
4520 | + aw->notifyAnimation (true); |
4521 | + |
4522 | + aw->mUnmapCnt++; |
4523 | + w->incrementUnmapReference (); |
4524 | + |
4525 | + cScreen->damagePending (); |
4526 | + } |
4527 | + else |
4528 | + aw->mState = aw->mNewState; |
4529 | +} |
4530 | + |
4531 | +void |
4532 | +PrivateAnimScreen::initiateShadeAnim (PrivateAnimWindow *aw) |
4533 | +{ |
4534 | + CompWindow *w = aw->mWindow; |
4535 | + |
4536 | + int duration = 200; |
4537 | + AnimEffect chosenEffect = |
4538 | + getMatchingAnimSelection (w, AnimEventShade, &duration); |
4539 | + |
4540 | + aw->setShaded (true); |
4541 | + |
4542 | + if (chosenEffect != AnimEffectNone) |
4543 | + { |
4544 | + bool startingNew = true; |
4545 | + WindowEvent curWindowEvent = WindowEventNone; |
4546 | + if (aw->curAnimation ()) |
4547 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4548 | + |
4549 | + if (curWindowEvent != WindowEventNone) |
4550 | + { |
4551 | + if (curWindowEvent != WindowEventUnshade) |
4552 | + { |
4553 | + aw->postAnimationCleanUpPrev (false, false); |
4554 | + } |
4555 | + else |
4556 | + { |
4557 | + startingNew = false; |
4558 | + aw->reverseAnimation (); |
4559 | + } |
4560 | + } |
4561 | + |
4562 | + if (startingNew) |
4563 | + { |
4564 | + AnimEffect effectToBePlayed = |
4565 | + getActualEffect (chosenEffect, AnimEventShade); |
4566 | + |
4567 | + // handle empty random effect list |
4568 | + if (effectToBePlayed == AnimEffectNone) |
4569 | + return; |
4570 | + |
4571 | + aw->mCurAnimation = |
4572 | + effectToBePlayed->create (w, WindowEventShade, duration, |
4573 | + effectToBePlayed, getIcon (w, false)); |
4574 | + aw->enablePainting (true); |
4575 | + } |
4576 | + |
4577 | + activateEvent (true); |
4578 | + aw->notifyAnimation (true); |
4579 | + |
4580 | + aw->mUnmapCnt++; |
4581 | + w->incrementUnmapReference (); |
4582 | + |
4583 | + cScreen->damagePending (); |
4584 | + } |
4585 | +} |
4586 | + |
4587 | +void |
4588 | +PrivateAnimScreen::initiateOpenAnim (PrivateAnimWindow *aw) |
4589 | +{ |
4590 | + CompWindow *w = aw->mWindow; |
4591 | + |
4592 | + int duration = 200; |
4593 | + AnimEffect chosenEffect; |
4594 | + |
4595 | + aw->mNewState = NormalState; |
4596 | + |
4597 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
4598 | + extPlugin->preInitiateOpenAnim (aw->mAWindow); |
4599 | + |
4600 | + WindowEvent curWindowEvent = WindowEventNone; |
4601 | + if (aw->curAnimation ()) |
4602 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4603 | + |
4604 | + if (!shouldIgnoreWindowForAnim (w, false) && |
4605 | + (AnimEffectNone != |
4606 | + (chosenEffect = |
4607 | + getMatchingAnimSelection (w, AnimEventOpen, &duration)) || |
4608 | + // reversing case |
4609 | + curWindowEvent == WindowEventClose)) |
4610 | + { |
4611 | + bool startingNew = true; |
4612 | + bool playEffect = true; |
4613 | + |
4614 | + if (curWindowEvent != WindowEventNone) |
4615 | + { |
4616 | + if (curWindowEvent != WindowEventClose) |
4617 | + { |
4618 | + aw->postAnimationCleanUpPrev (false, false); |
4619 | + } |
4620 | + else |
4621 | + { |
4622 | + startingNew = false; |
4623 | + aw->reverseAnimation (); |
4624 | + } |
4625 | + } |
4626 | + |
4627 | + if (startingNew) |
4628 | + { |
4629 | + AnimEffect effectToBePlayed = |
4630 | + getActualEffect (chosenEffect, AnimEventOpen); |
4631 | + |
4632 | + // handle empty random effect list |
4633 | + if (effectToBePlayed == AnimEffectNone) |
4634 | + playEffect = false; |
4635 | + |
4636 | + if (playEffect) |
4637 | + { |
4638 | + aw->mCurAnimation = |
4639 | + effectToBePlayed->create (w, WindowEventOpen, duration, |
4640 | + effectToBePlayed, |
4641 | + getIcon (w, true)); |
4642 | + aw->mCurAnimation->adjustPointerIconSize (); |
4643 | + aw->enablePainting (true); |
4644 | + } |
4645 | + } |
4646 | + |
4647 | + if (playEffect) |
4648 | + { |
4649 | + activateEvent (true); |
4650 | + aw->notifyAnimation (true); |
4651 | + cScreen->damagePending (); |
4652 | + } |
4653 | + } |
4654 | +} |
4655 | + |
4656 | +void |
4657 | +PrivateAnimScreen::initiateUnminimizeAnim (PrivateAnimWindow *aw) |
4658 | +{ |
4659 | + CompWindow *w = aw->mWindow; |
4660 | + |
4661 | + if (aw->mWindow->destroyed ()) |
4662 | + return; |
4663 | + |
4664 | + aw->mAWindow->mSavedRectsValid = false; |
4665 | + |
4666 | + int duration = 200; |
4667 | + AnimEffect chosenEffect = |
4668 | + getMatchingAnimSelection (w, AnimEventMinimize, &duration); |
4669 | + |
4670 | + aw->mNewState = NormalState; |
4671 | + |
4672 | + if (chosenEffect != AnimEffectNone && |
4673 | + !mPluginActive[3]) // fadedesktop |
4674 | + { |
4675 | + bool startingNew = true; |
4676 | + bool playEffect = true; |
4677 | + |
4678 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
4679 | + extPlugin->preInitiateUnminimizeAnim (aw->mAWindow); |
4680 | + |
4681 | + // TODO Refactor the rest? (almost the same in other initiateX methods) |
4682 | + WindowEvent curWindowEvent = WindowEventNone; |
4683 | + if (aw->curAnimation ()) |
4684 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4685 | + |
4686 | + if (curWindowEvent != WindowEventNone) |
4687 | + { |
4688 | + if (curWindowEvent != WindowEventMinimize) |
4689 | + { |
4690 | + aw->postAnimationCleanUpPrev (false, false); |
4691 | + } |
4692 | + else |
4693 | + { |
4694 | + startingNew = false; |
4695 | + aw->reverseAnimation (); |
4696 | + } |
4697 | + } |
4698 | + |
4699 | + if (startingNew) |
4700 | + { |
4701 | + AnimEffect effectToBePlayed = |
4702 | + getActualEffect (chosenEffect, AnimEventMinimize); |
4703 | + |
4704 | + // handle empty random effect list |
4705 | + if (effectToBePlayed == AnimEffectNone) |
4706 | + playEffect = false; |
4707 | + |
4708 | + if (playEffect) |
4709 | + { |
4710 | + aw->mCurAnimation = |
4711 | + effectToBePlayed->create (w, WindowEventUnminimize, |
4712 | + duration, effectToBePlayed, |
4713 | + getIcon (w, false)); |
4714 | + aw->enablePainting (true); |
4715 | + } |
4716 | + } |
4717 | + |
4718 | + if (playEffect) |
4719 | + { |
4720 | + activateEvent (true); |
4721 | + aw->notifyAnimation (true); |
4722 | + cScreen->damagePending (); |
4723 | + } |
4724 | + } |
4725 | +} |
4726 | + |
4727 | +void |
4728 | +PrivateAnimScreen::initiateUnshadeAnim (PrivateAnimWindow *aw) |
4729 | +{ |
4730 | + CompWindow *w = aw->mWindow; |
4731 | + |
4732 | + aw->mAWindow->mSavedRectsValid = false; |
4733 | + |
4734 | + aw->setShaded (false); |
4735 | + |
4736 | + aw->mNewState = NormalState; |
4737 | + |
4738 | + int duration = 200; |
4739 | + AnimEffect chosenEffect = |
4740 | + getMatchingAnimSelection (w, AnimEventShade, &duration); |
4741 | + |
4742 | + if (chosenEffect != AnimEffectNone) |
4743 | + { |
4744 | + bool startingNew = true; |
4745 | + bool playEffect = true; |
4746 | + |
4747 | + WindowEvent curWindowEvent = WindowEventNone; |
4748 | + if (aw->curAnimation ()) |
4749 | + curWindowEvent = aw->curAnimation ()->curWindowEvent (); |
4750 | + |
4751 | + if (curWindowEvent != WindowEventNone) |
4752 | + { |
4753 | + if (curWindowEvent != WindowEventShade) |
4754 | + { |
4755 | + aw->postAnimationCleanUpPrev (false, false); |
4756 | + } |
4757 | + else |
4758 | + { |
4759 | + startingNew = false; |
4760 | + aw->reverseAnimation (); |
4761 | + } |
4762 | + } |
4763 | + |
4764 | + if (startingNew) |
4765 | + { |
4766 | + AnimEffect effectToBePlayed = |
4767 | + getActualEffect (chosenEffect, AnimEventShade); |
4768 | + |
4769 | + // handle empty random effect list |
4770 | + if (effectToBePlayed == AnimEffectNone) |
4771 | + playEffect = false; |
4772 | + |
4773 | + if (playEffect) |
4774 | + { |
4775 | + aw->mCurAnimation = |
4776 | + effectToBePlayed->create (w, WindowEventUnshade, |
4777 | + duration, effectToBePlayed, |
4778 | + getIcon (w, false)); |
4779 | + aw->enablePainting (true); |
4780 | + } |
4781 | + } |
4782 | + |
4783 | + if (playEffect) |
4784 | + { |
4785 | + activateEvent (true); |
4786 | + aw->notifyAnimation (true); |
4787 | + cScreen->damagePending (); |
4788 | + } |
4789 | + } |
4790 | +} |
4791 | + |
4792 | +bool |
4793 | +PrivateAnimScreen::initiateFocusAnim (PrivateAnimWindow *aw) |
4794 | +{ |
4795 | + CompWindow *w = aw->mWindow; |
4796 | + int duration = 200; |
4797 | + |
4798 | + if (aw->curAnimation () || otherPluginsActive () || |
4799 | + // Check the "switcher post-wait" counter that effectively prevents |
4800 | + // focus animation to be initiated when the zoom option value is low |
4801 | + // in Switcher. |
4802 | + mSwitcherPostWait) |
4803 | + return false; |
4804 | + |
4805 | + AnimEffect chosenEffect = |
4806 | + getMatchingAnimSelection (w, AnimEventFocus, &duration); |
4807 | + |
4808 | + if (chosenEffect != AnimEffectNone) |
4809 | + { |
4810 | + aw->createFocusAnimation (chosenEffect, duration); |
4811 | + |
4812 | + if (chosenEffect->isRestackAnim && |
4813 | + !(dynamic_cast<RestackAnim *> (aw->mCurAnimation)-> |
4814 | + initiateRestackAnim (duration))) |
4815 | + { |
4816 | + aw->postAnimationCleanUp (); |
4817 | + return false; |
4818 | + } |
4819 | + |
4820 | + activateEvent (true); |
4821 | + aw->notifyAnimation (true); |
4822 | + cScreen->damagePending (); |
4823 | + return true; |
4824 | + } |
4825 | + return false; |
4826 | +} |
4827 | + |
4828 | +void |
4829 | +PrivateAnimWindow::resizeNotify (int dx, |
4830 | + int dy, |
4831 | + int dwidth, |
4832 | + int dheight) |
4833 | +{ |
4834 | + if (mUnshadePending) |
4835 | + { |
4836 | + mUnshadePending = false; |
4837 | + mPAScreen->initiateUnshadeAnim (this); |
4838 | + } |
4839 | + else if (mCurAnimation && mCurAnimation->inProgress () && |
4840 | + // Don't let transient window open anim be interrupted with a resize notify |
4841 | + !(mCurAnimation->curWindowEvent () == WindowEventOpen && |
4842 | + (mWindow->wmType () & |
4843 | + (CompWindowTypeDropdownMenuMask | |
4844 | + CompWindowTypePopupMenuMask | |
4845 | + CompWindowTypeMenuMask | |
4846 | + CompWindowTypeTooltipMask | |
4847 | + CompWindowTypeNotificationMask | |
4848 | + CompWindowTypeComboMask | |
4849 | + CompWindowTypeDndMask))) && |
4850 | + // Ignore resize with dx=0, dy=0, dwidth=0, dheight=0 |
4851 | + !(dx == 0 && dy == 0 && dwidth == 0 && dheight == 0) && |
4852 | + !mCurAnimation->resizeUpdate (dx, dy, dwidth, dheight)) |
4853 | + { |
4854 | + postAnimationCleanUp (); |
4855 | + mPAScreen->updateAnimStillInProgress (); |
4856 | + } |
4857 | + |
4858 | + mWindow->resizeNotify (dx, dy, dwidth, dheight); |
4859 | +} |
4860 | + |
4861 | +void |
4862 | +PrivateAnimScreen::updateAnimStillInProgress () |
4863 | +{ |
4864 | + bool animStillInProgress = false; |
4865 | + foreach (CompWindow *w, ::screen->windows ()) |
4866 | + { |
4867 | + PrivateAnimWindow *aw = AnimWindow::get (w)->priv; |
4868 | + if (aw->curAnimation () && |
4869 | + aw->curAnimation ()->inProgress ()) |
4870 | + { |
4871 | + animStillInProgress = true; |
4872 | + break; |
4873 | + } |
4874 | + else |
4875 | + { |
4876 | + aw->notifyAnimation (false); |
4877 | + } |
4878 | + } |
4879 | + |
4880 | + if (!animStillInProgress) |
4881 | + activateEvent (false); |
4882 | +} |
4883 | + |
4884 | +void |
4885 | +PrivateAnimWindow::moveNotify (int dx, |
4886 | + int dy, |
4887 | + bool immediate) |
4888 | +{ |
4889 | + if (mCurAnimation && mCurAnimation->inProgress () && |
4890 | + (mGrabbed || !mCurAnimation->moveUpdate (dx, dy))) |
4891 | + { |
4892 | + // Stop the animation |
4893 | + postAnimationCleanUp (); |
4894 | + mPAScreen->updateAnimStillInProgress (); |
4895 | + } |
4896 | + |
4897 | + mWindow->moveNotify (dx, dy, immediate); |
4898 | +} |
4899 | + |
4900 | +void |
4901 | +PrivateAnimWindow::grabNotify (int x, |
4902 | + int y, |
4903 | + unsigned int state, |
4904 | + unsigned int mask) |
4905 | +{ |
4906 | + mGrabbed = true; |
4907 | + |
4908 | + mWindow->grabNotify (x, y, state, mask); |
4909 | +} |
4910 | + |
4911 | +void |
4912 | +PrivateAnimWindow::ungrabNotify () |
4913 | +{ |
4914 | + mGrabbed = false; |
4915 | + |
4916 | + mWindow->ungrabNotify (); |
4917 | +} |
4918 | + |
4919 | +bool |
4920 | +PrivateAnimScreen::glPaintOutput (const GLScreenPaintAttrib &attrib, |
4921 | + const GLMatrix &matrix, |
4922 | + const CompRegion ®ion, |
4923 | + CompOutput *output, |
4924 | + unsigned int mask) |
4925 | +{ |
4926 | + assert (mAnimInProgress); |
4927 | + |
4928 | + mStartingNewPaintRound = true; |
4929 | + |
4930 | + foreach (ExtensionPluginInfo *extPlugin, mExtensionPlugins) |
4931 | + extPlugin->prePaintOutput (output); |
4932 | + |
4933 | + mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK; |
4934 | + |
4935 | + mOutput = output; |
4936 | + |
4937 | + return gScreen->glPaintOutput (attrib, matrix, region, output, mask); |
4938 | +} |
4939 | + |
4940 | +AnimEffectInfo::AnimEffectInfo (const char *name, |
4941 | + bool usedO, bool usedC, bool usedM, |
4942 | + bool usedS, bool usedF, |
4943 | + CreateAnimFunc create, |
4944 | + bool isRestackAnim) : |
4945 | + name (name), |
4946 | + create (create), |
4947 | + isRestackAnim (isRestackAnim) |
4948 | +{ |
4949 | + usedForEvents[AnimEventOpen] = usedO; |
4950 | + usedForEvents[AnimEventClose] = usedC; |
4951 | + usedForEvents[AnimEventMinimize] = usedM; |
4952 | + usedForEvents[AnimEventShade] = usedS; |
4953 | + usedForEvents[AnimEventFocus] = usedF; |
4954 | +} |
4955 | + |
4956 | +bool |
4957 | +AnimEffectInfo::matchesEffectName (const CompString &animName) |
4958 | +{ |
4959 | + return (0 == strcasecmp (animName.c_str (), name)); |
4960 | +} |
4961 | + |
4962 | +bool |
4963 | +AnimEffectInfo::matchesPluginName (const CompString &pluginName) |
4964 | +{ |
4965 | + return (0 == strncmp (pluginName.c_str (), name, pluginName.length ())); |
4966 | +} |
4967 | + |
4968 | +AnimEffect animEffects[NUM_EFFECTS]; |
4969 | + |
4970 | +ExtensionPluginAnimation animExtensionPluginInfo (CompString ("animation"), |
4971 | + NUM_EFFECTS, animEffects, 0, |
4972 | + NUM_NONEFFECT_OPTIONS); |
4973 | +ExtensionPluginInfo * |
4974 | +Animation::getExtensionPluginInfo () |
4975 | +{ |
4976 | + return &animExtensionPluginInfo; |
4977 | +} |
4978 | + |
4979 | +AnimEffect AnimEffectNone; |
4980 | +AnimEffect AnimEffectRandom; |
4981 | +AnimEffect AnimEffectCurvedFold; |
4982 | +AnimEffect AnimEffectDodge; |
4983 | +AnimEffect AnimEffectDream; |
4984 | +AnimEffect AnimEffectFade; |
4985 | +AnimEffect AnimEffectFocusFade; |
4986 | +AnimEffect AnimEffectGlide1; |
4987 | +AnimEffect AnimEffectGlide2; |
4988 | +AnimEffect AnimEffectHorizontalFolds; |
4989 | +AnimEffect AnimEffectMagicLamp; |
4990 | +AnimEffect AnimEffectMagicLampWavy; |
4991 | +AnimEffect AnimEffectRollUp; |
4992 | +AnimEffect AnimEffectSidekick; |
4993 | +AnimEffect AnimEffectWave; |
4994 | +AnimEffect AnimEffectZoom; |
4995 | + |
4996 | +PrivateAnimScreen::PrivateAnimScreen (CompScreen *s, AnimScreen *as) : |
4997 | + cScreen (CompositeScreen::get (s)), |
4998 | + gScreen (GLScreen::get (s)), |
4999 | + aScreen (as), |
5000 | + mLastRedrawTimeFresh (false), |
The diff has conflicts, did you propose to the right branch?
It seems an UI change, that will be nice that you do the paper work here: https:/ /wiki.ubuntu. com/FreezeExcep tionProcess# UserInterfaceFr eeze%20Exceptio ns