Merge lp:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0 into lp:~ubuntu-desktop/unity/precise
- lp806248-fix-int32-buffer-overflow-4.0
- Merge into precise
Status: | Rejected |
---|---|
Rejected by: | Sebastien Bacher |
Proposed branch: | lp:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0 |
Merge into: | lp:~ubuntu-desktop/unity/precise |
Diff against target: |
3906 lines (+2970/-5) (has conflicts) 37 files modified
AUTHORS (+8/-0) CMakeLists.txt (+15/-0) ChangeLog (+280/-0) manual-tests/QuicklistOnExpo.txt (+14/-0) manual-tests/ReadMe.txt (+47/-0) manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json (+22/-0) manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json (+44/-0) manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json (+23/-0) manual-tests/custom-dash-home/custom-dash-home.txt (+46/-0) manual-tests/launcher.txt (+14/-0) plugins/unityshell/src/DashView.cpp (+57/-0) plugins/unityshell/src/DashView.h (+11/-0) plugins/unityshell/src/ElapsedTimeMonitor.cpp (+1/-1) plugins/unityshell/src/GeisAdapter.cpp (+1/-1) plugins/unityshell/src/Launcher.cpp (+204/-0) plugins/unityshell/src/LauncherIcon.cpp (+61/-0) plugins/unityshell/src/LauncherIcon.h (+14/-0) plugins/unityshell/src/PanelMenuView.cpp (+46/-0) plugins/unityshell/src/PanelTray.cpp (+10/-0) plugins/unityshell/src/PanelView.cpp (+5/-0) plugins/unityshell/src/ScreenEffectFramebufferObject.cpp (+237/-0) plugins/unityshell/src/ScreenEffectFramebufferObject.h (+87/-0) plugins/unityshell/src/SwitcherController.cpp (+15/-0) plugins/unityshell/src/SwitcherController.h (+1/-0) plugins/unityshell/src/SwitcherModel.cpp (+7/-0) plugins/unityshell/src/SwitcherView.cpp (+6/-2) plugins/unityshell/src/TimeUtil.h (+17/-0) plugins/unityshell/src/unityshell.cpp (+363/-1) plugins/unityshell/src/unityshell.h (+75/-0) tests/CMakeLists.txt (+444/-0) tests/GLFuncLoader.cpp (+51/-0) tests/GLFuncLoader.h (+33/-0) tests/TestScreenEffectFramebufferObject.cpp (+671/-0) tests/test-get-transients/CMakeLists.txt (+1/-0) tests/test-input-remover/CMakeLists.txt (+1/-0) tests/test-minimize-window-handler/CMakeLists.txt (+1/-0) tests/test_time_util.cpp (+37/-0) Text conflict in AUTHORS Text conflict in CMakeLists.txt Text conflict in ChangeLog Path conflict: manual-tests/Launcher.txt / manual-tests/launcher.txt Text conflict in manual-tests/launcher.txt Text conflict in plugins/unityshell/src/DashView.cpp Text conflict in plugins/unityshell/src/DashView.h Text conflict in plugins/unityshell/src/Launcher.cpp Text conflict in plugins/unityshell/src/LauncherIcon.cpp Text conflict in plugins/unityshell/src/LauncherIcon.h Text conflict in plugins/unityshell/src/PanelMenuView.cpp Text conflict in plugins/unityshell/src/PanelTray.cpp Text conflict in plugins/unityshell/src/PanelView.cpp Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.cpp Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.h Text conflict in plugins/unityshell/src/SwitcherController.cpp Text conflict in plugins/unityshell/src/SwitcherModel.cpp Text conflict in plugins/unityshell/src/SwitcherView.cpp Text conflict in plugins/unityshell/src/TimeUtil.h Text conflict in plugins/unityshell/src/unityshell.cpp Text conflict in plugins/unityshell/src/unityshell.h Text conflict in tests/CMakeLists.txt |
To merge this branch: | bzr merge lp:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stephen M. Webb (community) | Disapprove | ||
Ubuntu Desktop | Pending | ||
Review via email: mp+143901@code.launchpad.net |
Commit message
Description of the change
Stephen M. Webb (bregma) wrote : | # |
Stephen M. Webb (bregma) wrote : | # |
Patch has already been merged into lp:unity/5.0 which will be SRUd to lp:ubuntu-desktop/unity/precise... merging a unity 4.0 into lp:ubuntu-desktop/unity/precise makes no sense.
Sebastien Bacher (seb128) wrote : | # |
setting as rejected, it got uploaded/merged through another merge request: http://
Unmerged revisions
- 1740. By Brandon Schaefer
-
* Fix header
- 1739. By Brandon Schaefer
-
* Fix int32 buffer overflow in TimeUtil, now uses int64
- 1738. By Łukasz Zemczak
-
Release\ 4.30.0
- 1737. By Francis Ginther
-
Updated dependency to the renamed libgeis
- 1736. By Sam Spilsbury
-
Merge lp:unity/4.0
- 1735. By Sam Spilsbury
-
Unrevert 1721 , as it did not cause any regressions (yet)
- 1734. By Sam Spilsbury
-
Revert 1721 for now
It enters some strange codepaths and caused regressions better handled by
https://code.launchpad .net/~smspillaz /unity/ unity.fix_ 881190_ 918360/ +merge/ 89181 - 1733. By Sam Spilsbury
- 1732. By David Barth
-
Bumping revision to 4.2.28 to prepare a new SRU
- 1731. By David Barth
-
Fix for "right-clicking launcher when choosing a workspace causes quicklists to freeze" (#791810)
Preview Diff
1 | === modified file 'AUTHORS' |
2 | --- AUTHORS 2012-11-12 12:20:38 +0000 |
3 | +++ AUTHORS 2013-01-18 15:43:30 +0000 |
4 | @@ -31,10 +31,14 @@ |
5 | David Gomes <davidrafagomes@gmail.com> |
6 | David Planella <david.planella@ubuntu.com> |
7 | Didier Roche <didier.roche@canonical.com> |
8 | +<<<<<<< TREE |
9 | foxoman <foxoman.u@gmail.com> |
10 | Francis Ginther <francis.ginther@canonical.com> |
11 | Gabor Kelemen <kelemeng@ubuntu.com> |
12 | Gary Lasker <gary.lasker@canonical.com> |
13 | +======= |
14 | + Francis Ginther <francis.ginther@canonical.com> |
15 | +>>>>>>> MERGE-SOURCE |
16 | Gordon Allott <gord.allott@canonical.com> |
17 | Henri De Veene <henri.deveene@gmail.com> |
18 | Jani Monoses <jani.monoses@canonical.com> |
19 | @@ -96,11 +100,15 @@ |
20 | Sam Spilsbury <sam.spilsbury@canonical.com> |
21 | Sam Spilsbury <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com> |
22 | Sebastien Bacher <seb128@ubuntu.com> |
23 | +<<<<<<< TREE |
24 | smspillaz <sam.spilsbury@canonical.com> |
25 | smspillaz <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com> |
26 | smspillaz <sam.spilsbury@canonical.com>, Sam Spilsbury <sam.spilsbury@canonical.com> |
27 | Sven Baars <svenb.linux@gmail.com> |
28 | Tarmac |
29 | +======= |
30 | + smspillaz <sam.spilsbury@canonical.com> |
31 | +>>>>>>> MERGE-SOURCE |
32 | Ted Gould <ted@gould.cx> |
33 | Thomas Voß <thomas.voss@rub.de> |
34 | Thomi Richards <thomir@gmail.com> |
35 | |
36 | === modified file 'CMakeLists.txt' |
37 | --- CMakeLists.txt 2012-11-12 12:20:38 +0000 |
38 | +++ CMakeLists.txt 2013-01-18 15:43:30 +0000 |
39 | @@ -7,8 +7,13 @@ |
40 | # Base bits |
41 | # |
42 | set (PROJECT_NAME "unity") |
43 | +<<<<<<< TREE |
44 | set (UNITY_MAJOR 5) |
45 | set (UNITY_MINOR 18) |
46 | +======= |
47 | +set (UNITY_MAJOR 4) |
48 | +set (UNITY_MINOR 30) |
49 | +>>>>>>> MERGE-SOURCE |
50 | set (UNITY_MICRO 0) |
51 | set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}") |
52 | set (UNITY_API_VERSION "5.0") |
53 | @@ -122,6 +127,7 @@ |
54 | # |
55 | # Compiz Plugins |
56 | # |
57 | +<<<<<<< TREE |
58 | set (UNITY_PLUGIN_DEPS "compiz;nux-2.0>=2.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;gconf-2.0;libgeis;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;gnome-desktop-3.0;gdu;xfixes") |
59 | |
60 | add_subdirectory(plugins/unityshell) |
61 | @@ -158,6 +164,15 @@ |
62 | add_subdirectory(guides) |
63 | add_subdirectory(standalone-clients EXCLUDE_FROM_ALL) |
64 | |
65 | +======= |
66 | +set (UNITY_PLUGIN_DEPS "compiz;nux-1.0 >= 1.2.2;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4;atk;unity-misc >= 0.4.0;gconf-2.0;libgeis;gtk+-3.0 >= 3.1;sigc++-2.0;json-glib-1.0;libnotify;gnome-desktop-3.0") |
67 | + |
68 | + |
69 | +find_package (Compiz REQUIRED) |
70 | +include (CompizPlugin) |
71 | + |
72 | +compiz_add_plugins_in_folder ("${CMAKE_SOURCE_DIR}/plugins/") |
73 | +>>>>>>> MERGE-SOURCE |
74 | |
75 | # |
76 | # GSettings Schema |
77 | |
78 | === modified file 'ChangeLog' |
79 | --- ChangeLog 2012-11-12 12:20:38 +0000 |
80 | +++ ChangeLog 2013-01-18 15:43:30 +0000 |
81 | @@ -1,3 +1,4 @@ |
82 | +<<<<<<< TREE |
83 | 2012-10-18 Andrea Azzarone <azzaronea@gmail.com> |
84 | |
85 | Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño). |
86 | @@ -18898,6 +18899,285 @@ |
87 | |
88 | fixes an issue with the panel service segfaulting on window change |
89 | |
90 | +======= |
91 | +2012-09-07 Francis Ginther <francis.ginther@canonical.com> |
92 | + |
93 | + Updated dependency to the renamed libgeis |
94 | + |
95 | +2012-01-19 smspillaz <sam.spilsbury@canonical.com> |
96 | + |
97 | + Merge lp:unity/4.0 |
98 | + |
99 | +2012-01-13 David Barth <david.barth@canonical.com> |
100 | + |
101 | + revert custom dash patch |
102 | + |
103 | +2012-01-11 David Barth <david.barth@canonical.com> |
104 | + |
105 | + Fixed bug #914251, local variables should be passed by value. |
106 | + |
107 | +2012-01-11 Marco Trevisan (Treviño) <mail@3v1n0.net> |
108 | + |
109 | + LauncherIcon: pass quicklist positions by value on expo-terminated lambda. |
110 | + |
111 | + This fixes bug #914251 |
112 | + |
113 | +2012-01-06 Didier Roche <didier.roche@canonical.com> |
114 | + |
115 | + merge sam's fix for building standalone application on clean environment |
116 | + |
117 | +2012-01-06 Sam Spilsbury <sam.spilsbury@canonical.com> |
118 | + |
119 | + Also add a dependency on libunity-core for the window handling tests and |
120 | + the glfuncloader dlopen loader since link_libraries forces those to be linked |
121 | + against libunity-core and since link_libraries doesn't care about target |
122 | + dependencies, there is a build race where libunity-core isn't built in time |
123 | + for those targets to be (erroneously) linked to. |
124 | + |
125 | + The real solution is to kill the call to link_libraries. |
126 | + |
127 | +2012-01-19 smspillaz <sam.spilsbury@canonical.com> |
128 | + |
129 | + Unrevert 1721 , as it did not cause any regressions (yet) |
130 | + |
131 | +2012-01-19 smspillaz <sam.spilsbury@canonical.com> |
132 | + |
133 | + Revert 1721 for now |
134 | + |
135 | + It enters some strange codepaths and caused regressions better handled by |
136 | + https://code.launchpad.net/~smspillaz/unity/unity.fix_881190_918360/+merge/89181 |
137 | + |
138 | +2012-01-19 smspillaz <sam.spilsbury@canonical.com> |
139 | + |
140 | + Merge lp:~smspillaz/unity/4.0_fix_912682 |
141 | + |
142 | +2012-01-19 smspillaz <sam.spilsbury@canonical.com> |
143 | + |
144 | + Fixes bug 912682 |
145 | + |
146 | +2012-01-05 David Barth <david.barth@canonical.com> |
147 | + |
148 | + Bumping revision to 4.2.28 to prepare a new SRU |
149 | + |
150 | +2012-01-05 David Barth <david.barth@canonical.com> |
151 | + |
152 | + Fix for "right-clicking launcher when choosing a workspace causes quicklists to freeze" (#791810) |
153 | + |
154 | +2011-12-08 Marco Trevisan (Treviño) <mail@3v1n0.net> |
155 | + |
156 | + LauncherIcon: don't use auto operator when the content is not explicit |
157 | + |
158 | +2011-12-05 Marco Trevisan (Treviño) <mail@3v1n0.net> |
159 | + |
160 | + LauncherIcon: If expo is active, wait it to be terminated before showing a quicklist |
161 | + |
162 | + Opening a quicklist when the expo is active, cause the quicklist to freeze, |
163 | + so if we're opening one when expo is runing, we need to wait it to be |
164 | + terminated before showing up the quicklist. |
165 | + |
166 | + Including a manual-test. |
167 | + |
168 | + This fixes bug #791810 |
169 | + |
170 | +2011-12-05 Marco Trevisan (Treviño) <mail@3v1n0.net> |
171 | + |
172 | + Added Manual Tests ReadMe |
173 | + |
174 | + Backported patch by Tim to Unity/4.0. |
175 | + |
176 | +2012-01-05 David Barth <david.barth@canonical.com> |
177 | + |
178 | + Fix SIGSEGV after SwitcherController desctruction (LP: #887465) |
179 | + |
180 | +2011-12-08 Daniel van Vugt <vanvugt@gmail.com> |
181 | + |
182 | + Safer destruction order. |
183 | + |
184 | +2011-12-08 Daniel van Vugt <vanvugt@gmail.com> |
185 | + |
186 | + Fix SIGSEGV after SwitcherController desctruction (LP: #887465) |
187 | + |
188 | +2012-01-05 David Barth <david.barth@canonical.com> |
189 | + |
190 | + reapplies 1713 |
191 | + |
192 | +2012-01-05 David Barth <david.barth@canonical.com> |
193 | + |
194 | + revert rev. 1721 which was causing a regression (#905417) |
195 | + |
196 | +2012-01-05 David Barth <david.barth@canonical.com> |
197 | + |
198 | + Merge custom dash patch (#785840) |
199 | + |
200 | +2011-12-15 Olivier Tilloy <olivier.tilloy@canonical.com> |
201 | + |
202 | + Add some manual tests for the dash custom home screen functionality. |
203 | + |
204 | +2011-12-15 Olivier Tilloy <olivier.tilloy@canonical.com> |
205 | + |
206 | + Allow customizing the dash’s home screen. |
207 | + |
208 | + The contents of the custom home screen are described in a JSON file called HomeShortcutsCustomized.json. |
209 | + |
210 | + The file is looked for in the following locations in decreasing order of priority: |
211 | + - $XDG_CONFIG_HOME/unity/ (defaults to $HOME/.config/unity/) |
212 | + - $DIR/unity/ for $DIR in $XDG_CONFIG_DIRS |
213 | + |
214 | + The syntax of the file is as follows: |
215 | + ========================================================================== |
216 | + { |
217 | + "shortcut1": { |
218 | + "source": $source, |
219 | + "name": $name, |
220 | + "name[fr]": $name_in_french, |
221 | + […] |
222 | + "icon": $icon |
223 | + }, |
224 | + "shortcut2": { |
225 | + […] |
226 | + }, |
227 | + […] |
228 | + } |
229 | + ========================================================================== |
230 | + |
231 | + The source attribute may either be a desktop file (full path or just its basename if it is located in a standard directory), or a lens file (basename only). This attribute is mandatory. |
232 | + The 'name' attribute is optional. If present, it will override the default display name as advertised by the desktop file or by the lens. The name can be localized in several languages using the square brackets suffix notation, in which case the locale matching the system’s will be used, defaulting to the untranslated 'name' attribute if necessary. |
233 | + The 'icon' attribute is optional. If present, it will override the default icon as advertised by the desktop file or by the lens. It should be a full path name. |
234 | + If the source is a lens, the optional 'filter' attribute allows specifying a filter in the form "$name:$value", e.g. "type:videos" for the files lens. |
235 | + If the source is a lens, the optional 'section' attribute allows specifying a section number (an integer starting at index 0). |
236 | + |
237 | +2012-01-05 David Barth <david.barth@canonical.com> |
238 | + |
239 | + Merging in Sam's fix for a multi-monitor crasher (#838128) |
240 | + |
241 | +2012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com> |
242 | + |
243 | + Check glGetError () |
244 | + |
245 | +2012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com> |
246 | + |
247 | + Minor style fix - use for loop |
248 | + |
249 | +2012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com> |
250 | + |
251 | + Don't disable the scissor test explicitly |
252 | + |
253 | +2012-01-04 Sam Spilsbury <sam.spilsbury@canonical.com> |
254 | + |
255 | + Added missing file |
256 | + |
257 | +2011-12-24 Sam Spilsbury <sam.spilsbury@canonical.com> |
258 | + |
259 | + Added framebuffer object fixes |
260 | + |
261 | +2011-12-15 David Barth <david.barth@canonical.com> |
262 | + |
263 | + changelog update, a patch was reverted earlier by gord, see rev. 1723 |
264 | + |
265 | +2011-12-15 David Barth <david.barth@canonical.com> |
266 | + |
267 | + merge lp:~macslow/unity/unity-sru1-4.26.0 in preparation of the 4.26 release candidate |
268 | + |
269 | +2011-12-15 Mirco Müller <mirco.mueller@ubuntu.com> |
270 | + |
271 | + Release 4.26.0 (SRU1) |
272 | + |
273 | +2011-12-15 Mirco Müller <mirco.mueller@ubuntu.com> |
274 | + |
275 | + Fixes #850623: don't segfault in geis_configuration_get_value() (backported from unity trunk r1728) |
276 | + |
277 | +2011-12-15 Mirco Müller <mirco.mueller@ubuntu.com> |
278 | + |
279 | + Fixes #860805: get focus on dash by pressing the super key first time after login (backported from unity trunk r1759) |
280 | + |
281 | +2011-12-15 Mirco Müller <mirco.mueller@ubuntu.com> |
282 | + |
283 | + Fixes #873100: clicking on panel when dash is open no longer causes maximized window to raise (backported from unity trunk r1751) |
284 | + |
285 | +2011-12-15 Gord Allott <gord.allott@canonical.com> |
286 | + |
287 | + Reverted out r1713 |
288 | + |
289 | +2011-12-16 Sam Spilsbury <sam.spilsbury@canonical.com> |
290 | + |
291 | + Merged lp:~smspillaz/unity/unity4.0_fix_881190 |
292 | + |
293 | +2011-12-15 Sam Spilsbury <sam.spilsbury@canonical.com> |
294 | + |
295 | + Don't read transients on windows which are not valid since all not valid |
296 | + transient windows will match with that window. |
297 | + |
298 | + Also don't bother to re-fake-unminimize windows that have been fake minimized |
299 | + if they were destroyed since the window isn't valid anyways and the operation |
300 | + will be a no-op (note that we should do it on ~UnityWindow in the case where |
301 | + the window has not been destroyed yet, as it probably means that the plugin |
302 | + is being unloaded) |
303 | + |
304 | +2011-12-15 Sam Spilsbury <sam.spilsbury@canonical.com> |
305 | + |
306 | + Inhibit other windows from leaving show desktop mode in the case that |
307 | + core tries to leave show desktop mode after a window was activated - in this |
308 | + case we should only allow the window that was activated to leave show desktop |
309 | + mode and keep the "show desktop" mode state on until the user explicitly leave |
310 | + s |
311 | + show desktop mode. |
312 | + |
313 | + Fixes LP #871801 and LP #899932 |
314 | + |
315 | +2011-12-06 Michal Hruby <michal.mhr@gmail.com> |
316 | + |
317 | + Backport fix for bug #856205 from trunk |
318 | + |
319 | +2011-11-29 Mirco Müller <mirco.mueller@ubuntu.com> |
320 | + |
321 | + Fixes LP: #834630 |
322 | + |
323 | +2011-10-26 Mirco Müller <mirco.mueller@canonical.com> |
324 | + |
325 | + Add an out-of-bounds check to the DetailXids vector. Fixes LP: #834630 |
326 | + |
327 | +2011-11-29 Mirco Müller <mirco.mueller@ubuntu.com> |
328 | + |
329 | + Fixes LP: #832151 |
330 | + |
331 | +2011-10-26 Mirco Müller <mirco.mueller@canonical.com> |
332 | + |
333 | + Be properly unref'ing _tray the FilterTrayCallback should be correctly unregistered and not called again. Fixes LP: 832151 |
334 | + |
335 | +2011-10-18 Jason Smith <jason.smith@canonical.com> |
336 | + |
337 | + merge automatic raising of input winodws |
338 | + |
339 | +2011-10-17 Jason Smith <jason.smith@canonical.com> |
340 | + |
341 | + Raise input windows from nux unconditionally on alt-tab and showing of the dash using compiz |
342 | + |
343 | +2011-10-14 Robert Carr <racarr@canonical.com> |
344 | + |
345 | + Back out a horizontal margin that breaks sizing in some cases |
346 | + |
347 | +2011-10-14 Sam Spilsbury <sam.spilsbury@canonical.com> |
348 | + |
349 | + Bug #863114: Cannot raise window from panel after minimize |
350 | + Bug #865890: compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId() (when onboard is used) |
351 | + |
352 | +2011-10-13 Neil Jagdish Patel <neil.patel@canonical.com> |
353 | + |
354 | + Revert out maximised window dash change |
355 | + |
356 | +2011-10-13 Gord Allott <gord.allott@canonical.com> |
357 | + |
358 | + fixes an issue with the panel segfaulting on window change |
359 | + |
360 | +2011-10-13 Gord Allott <gord.allott@canonical.com> |
361 | + |
362 | + fixes the panel service segfaulting in certain conditions |
363 | + |
364 | +2011-10-12 Neil Jagdish Patel <neil.patel@canonical.com> |
365 | + |
366 | + Release\ 4.24.0 |
367 | + |
368 | +>>>>>>> MERGE-SOURCE |
369 | 2011-10-12 Neil Jagdish Patel <neil.patel@canonical.com> |
370 | |
371 | Fix tests for FilerMultirangeWidget |
372 | |
373 | === modified file 'HACKING' |
374 | === added file 'manual-tests/QuicklistOnExpo.txt' |
375 | --- manual-tests/QuicklistOnExpo.txt 1970-01-01 00:00:00 +0000 |
376 | +++ manual-tests/QuicklistOnExpo.txt 2013-01-18 15:43:30 +0000 |
377 | @@ -0,0 +1,14 @@ |
378 | +Test Quicklist while on Expo |
379 | +============================ |
380 | + |
381 | +This test shows how the launcher quicklists work when the expo plugin is activated. |
382 | + |
383 | +#. Start with a clear screen |
384 | +#. Press Super+S or select the workspace switcher on the launcher |
385 | +#. When the workspace switcher is running, right-click over a launcher icon |
386 | + |
387 | +Outcome |
388 | + The expo should terminate, and the quicklist should be shown once the |
389 | + workspace switcher has been closed. |
390 | + Clicking over a quicklist item should work as expected and clicking outside |
391 | + that quicklist, should close it. |
392 | |
393 | === added file 'manual-tests/ReadMe.txt' |
394 | --- manual-tests/ReadMe.txt 1970-01-01 00:00:00 +0000 |
395 | +++ manual-tests/ReadMe.txt 2013-01-18 15:43:30 +0000 |
396 | @@ -0,0 +1,47 @@ |
397 | +============== |
398 | +Manual Testing |
399 | +============== |
400 | + |
401 | +Outline |
402 | +------- |
403 | +Sometimes it is not possible to easily make an automated test for some |
404 | +use-cases. However just because something isn't easily tested automatically |
405 | +doesn't mean that there isn't value in creating a test for it, just that the |
406 | +test needs to be executed by a person until it is converted into an automated |
407 | +test. |
408 | + |
409 | + |
410 | +Format |
411 | +------ |
412 | +Manual tests take the format of text files in this directory (the manual-test |
413 | +one). These files are formatted using `reStructured Text`_. A very |
414 | +comprehensive `quick reference`_ is available. |
415 | + |
416 | +.. _reStructured Text: http://en.wikipedia.org/wiki/ReStructuredText |
417 | +.. _quick reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html |
418 | + |
419 | +Tests have a header, steps to follow, and an expected outcome, as demonstrated |
420 | +by the following example: |
421 | + |
422 | +There can be multiple tests in a single file, but they should all be related, |
423 | +and the filename should indicate the tests it contains. |
424 | + |
425 | + |
426 | +Test Dash |
427 | +--------- |
428 | +This test shows that the dash appears when the super key is pushed. |
429 | + |
430 | +#. Start with a clear screen |
431 | +#. Press the <super> key |
432 | + |
433 | +Outcome |
434 | + The dash appears, and focus is in the search box. The icons on the laucher |
435 | + are desaturated except for the ubuntu button at the top. The icons in the |
436 | + panel go white. |
437 | + |
438 | + |
439 | +Directory Structure |
440 | +------------------- |
441 | +It is expected that as we grow a number of manual tests, we will use |
442 | +directories to organise them. |
443 | + |
444 | |
445 | === added directory 'manual-tests/custom-dash-home' |
446 | === added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json' |
447 | --- manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 1970-01-01 00:00:00 +0000 |
448 | +++ manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 2013-01-18 15:43:30 +0000 |
449 | @@ -0,0 +1,22 @@ |
450 | +{ |
451 | + "shortcut1": { |
452 | + "source": "/usr/share/applications/ubuntu-software-center.desktop", |
453 | + "name": "Software Center", |
454 | + "name[fr]": "Logithèque", |
455 | + "icon": "/usr/share/icons/Humanity/places/64/start-here.svg" |
456 | + }, |
457 | + "shortcut2": { |
458 | + "source": "music.lens", |
459 | + "filter": "genre:rock", |
460 | + "name": "Rock Music" |
461 | + }, |
462 | + "shortcut3": { |
463 | + "source": "files.lens", |
464 | + "filter": "type:videos", |
465 | + "name": "Vidéos", |
466 | + "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg" |
467 | + }, |
468 | + "shortcut4": { |
469 | + "source": "transmission-gtk.desktop" |
470 | + } |
471 | +} |
472 | |
473 | === added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json' |
474 | --- manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 1970-01-01 00:00:00 +0000 |
475 | +++ manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 2013-01-18 15:43:30 +0000 |
476 | @@ -0,0 +1,44 @@ |
477 | +{ |
478 | + "shortcut1": { |
479 | + "source": "/usr/share/applications/ubuntu-software-center.desktop", |
480 | + "name": "Software Center", |
481 | + "name[fr]": "Logithèque", |
482 | + "icon": "/usr/share/icons/Humanity/places/64/start-here.svg" |
483 | + }, |
484 | + "shortcut2": { |
485 | + "source": "music.lens", |
486 | + "filter": "genre:rock", |
487 | + "name": "Rock Music" |
488 | + }, |
489 | + "shortcut3": { |
490 | + "source": "files.lens", |
491 | + "filter": "type:videos", |
492 | + "name": "Vidéos", |
493 | + "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg" |
494 | + }, |
495 | + "shortcut4": { |
496 | + "source": "transmission-gtk.desktop" |
497 | + }, |
498 | + "shortcut5": { |
499 | + "source": "/usr/share/applications/eog.desktop", |
500 | + "name": "Eye Of Gnome", |
501 | + "name[de]": "Auge des Zwergs", |
502 | + "icon": "/usr/share/icons/hicolor/scalable/apps/eog.svg" |
503 | + }, |
504 | + "shortcut6": { |
505 | + "source": "/usr/share/applications/jockey-gtk.desktop", |
506 | + "name": "Jockey", |
507 | + "name[de]": "Jockey", |
508 | + "icon": "/usr/share/icons/hicolor/scalable/apps/jockey.svg" |
509 | + }, |
510 | + "shortcut7": { |
511 | + "source": "/usr/share/applications/gwibber.desktop", |
512 | + "name": "gwibber", |
513 | + "icon": "/usr/share/icons/hicolor/scalable/apps/gwibber.svg" |
514 | + }, |
515 | + "shortcut8": { |
516 | + "source": "/usr/share/applications/giggle.desktop", |
517 | + "name": "Giggle", |
518 | + "icon": "/usr/share/icons/hicolor/scalable/apps/giggle.svg" |
519 | + } |
520 | +} |
521 | |
522 | === added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json' |
523 | --- manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 1970-01-01 00:00:00 +0000 |
524 | +++ manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 2013-01-18 15:43:30 +0000 |
525 | @@ -0,0 +1,23 @@ |
526 | +this is some intentional garbage with lots of errors |
527 | +{ |
528 | + "shortcut1": { |
529 | + "source": "/usr/share/applications/ubuntu-software-center.desktop", |
530 | + "name": "Software Center", |
531 | + "name[fr]": "Logithèque", |
532 | + "icn": "/usr/share/icons/Humanity/places/64/start-here.svg" |
533 | + }, |
534 | + "shortcut2": { |
535 | + "sorce": "music.lens", |
536 | + "filter": "genre:rock", |
537 | + "name": "Rock Music" |
538 | + }, |
539 | + "shortcut3": { |
540 | + "source": "files.lens", |
541 | + "filter": "type:videos", |
542 | + "name": "Vidéos", |
543 | + "icon": "/usr/share/icons/Humanity/actions/64/hep-about.svg" |
544 | + }, |
545 | + "shortcut12": { |
546 | + "source": "transmission-gtk.destop" |
547 | + } |
548 | +} |
549 | |
550 | === added file 'manual-tests/custom-dash-home/custom-dash-home.txt' |
551 | --- manual-tests/custom-dash-home/custom-dash-home.txt 1970-01-01 00:00:00 +0000 |
552 | +++ manual-tests/custom-dash-home/custom-dash-home.txt 2013-01-18 15:43:30 +0000 |
553 | @@ -0,0 +1,46 @@ |
554 | +Manual tests for the 'dash custom home screen' functionality |
555 | +============================================================ |
556 | + |
557 | +How to test |
558 | +----------- |
559 | + |
560 | +To test the functionality, create the folder $HOME/.config/unity/, and copy the |
561 | +three files HomeShortcutsCustomized*.json there. |
562 | + |
563 | +Then for each of them repeat the following steps: |
564 | + |
565 | + cd $HOME/.config/unity/ |
566 | + rm HomeShortcutsCustomized.json |
567 | + ln -s $FILE HomeShortcutsCustomized.json # replace $FILE with the json file being considered |
568 | + # restart unity |
569 | + # open the dash |
570 | + # check the visual appearance against the expected results detailed below |
571 | + |
572 | + |
573 | +Expected results |
574 | +---------------- |
575 | + |
576 | +With 'HomeShortcutsCustomized-4-entries.json', the home screen of the dash |
577 | +contains 4 icons that fill the first row. The second row is empty. |
578 | +Those icons are: |
579 | + - "Software Center": launches the Ubuntu Software Center, the icon is the |
580 | + Ubuntu Circle Of Friends, and if you are running with a French locale the |
581 | + name is localized to "Logithèque". |
582 | + - "Rock Music": opens the music lens with the genre filter set to "Rock". |
583 | + - "Vidéos": opens the files lens with the type filter set to "videos", the icon |
584 | + is a yellow star. |
585 | + - "Transmission BitTorrent Client": launches transmission-gtk. |
586 | + |
587 | +With 'HomeShortcutsCustomized-8-entries.json', the home screen of the dash |
588 | +contains 8 icons that fill the two rows. The first row contains the exact same |
589 | +icons as 'HomeShortcutsCustomized-4-entries.json' (see details above). The icons |
590 | +on the second row are: |
591 | + - "Eye Of Gnome": launches eog, if you are running with a German locale the |
592 | + name is localized to "Auge des Zwergs". |
593 | + - "Jockey": launches jockey-gtk. |
594 | + - "gwibber": launches gwibber. |
595 | + - "Giggle": this icon appears only if giggle is installed, it launches giggle. |
596 | + |
597 | +With 'HomeShortcutsCustomized-broken.json', the home screen of the dash contains |
598 | +the default icons because the file fails to be parsed. |
599 | + |
600 | |
601 | === renamed file 'manual-tests/Launcher.txt' => 'manual-tests/launcher.txt' |
602 | --- manual-tests/Launcher.txt 2012-08-11 11:56:31 +0000 |
603 | +++ manual-tests/launcher.txt 2013-01-18 15:43:30 +0000 |
604 | @@ -1,3 +1,4 @@ |
605 | +<<<<<<< TREE |
606 | Test Launcher Icon with Windows in multiple workspaces |
607 | ------------------------------------------------------ |
608 | This test shows how the launcher should draw when there are application windows |
609 | @@ -644,3 +645,16 @@ |
610 | |
611 | Expected Results: |
612 | * The launcher should autoscroll so you can reach the trash icon. |
613 | +======= |
614 | +Test Dash Key Focus |
615 | +------------------- |
616 | +This test shows that the search bar in the dash gets key focus when using the super key to start the dash on start up. |
617 | + |
618 | +#. Start on a fresh login |
619 | +#. Press the <super> key |
620 | +#. Wait for dash to appear |
621 | +#. Type "hello" |
622 | + |
623 | +Outcome |
624 | + The dash will appear, and "hello" will be in the search box. |
625 | +>>>>>>> MERGE-SOURCE |
626 | |
627 | === modified file 'plugins/unityshell/src/BackgroundEffectHelper.cpp' |
628 | === modified file 'plugins/unityshell/src/BackgroundEffectHelper.h' |
629 | === modified file 'plugins/unityshell/src/DashView.cpp' |
630 | --- plugins/unityshell/src/DashView.cpp 2012-06-28 08:49:20 +0000 |
631 | +++ plugins/unityshell/src/DashView.cpp 2013-01-18 15:43:30 +0000 |
632 | @@ -80,10 +80,16 @@ |
633 | , home_lens_(new HomeLens(_("Home"), _("Home screen"), _("Search"))) |
634 | , active_lens_view_(0) |
635 | , last_activated_uri_("") |
636 | +<<<<<<< TREE |
637 | , searching_timeout_id_(0) |
638 | , search_in_progress_(false) |
639 | , activate_on_finish_(false) |
640 | , hide_message_delay_id_(0) |
641 | +======= |
642 | + , searching_timeout_id_(0) |
643 | + , search_in_progress_(false) |
644 | + , activate_on_finish_(false) |
645 | +>>>>>>> MERGE-SOURCE |
646 | , visible_(false) |
647 | { |
648 | renderer_.SetOwner(this); |
649 | @@ -107,6 +113,7 @@ |
650 | |
651 | DashView::~DashView() |
652 | { |
653 | +<<<<<<< TREE |
654 | if (searching_timeout_id_) |
655 | g_source_remove (searching_timeout_id_); |
656 | if (hide_message_delay_id_) |
657 | @@ -121,6 +128,12 @@ |
658 | { |
659 | renderer_.x_offset = x; |
660 | renderer_.y_offset = y; |
661 | +======= |
662 | + if (searching_timeout_id_) |
663 | + g_source_remove (searching_timeout_id_); |
664 | + delete bg_layer_; |
665 | + delete bg_darken_layer_; |
666 | +>>>>>>> MERGE-SOURCE |
667 | } |
668 | |
669 | void DashView::AboutToShow() |
670 | @@ -430,9 +443,21 @@ |
671 | return FALSE; |
672 | } |
673 | |
674 | +gboolean DashView::ResetSearchStateCb(gpointer data) |
675 | +{ |
676 | + DashView *self = static_cast<DashView*>(data); |
677 | + |
678 | + self->search_in_progress_ = false; |
679 | + self->activate_on_finish_ = false; |
680 | + self->searching_timeout_id_ = 0; |
681 | + |
682 | + return FALSE; |
683 | +} |
684 | + |
685 | void DashView::OnSearchChanged(std::string const& search_string) |
686 | { |
687 | LOG_DEBUG(logger) << "Search changed: " << search_string; |
688 | +<<<<<<< TREE |
689 | if (active_lens_view_) |
690 | { |
691 | search_in_progress_ = true; |
692 | @@ -457,6 +482,20 @@ |
693 | // 150ms to hide the no reults message if its take a while to return results |
694 | hide_message_delay_id_ = g_timeout_add (150, &DashView::HideResultMessageCb, this); |
695 | } |
696 | +======= |
697 | + if (active_lens_view_) |
698 | + { |
699 | + search_in_progress_ = true; |
700 | + // it isn't guaranteed that we get a SearchFinished signal, so we need |
701 | + // to make sure this isn't set even though we aren't doing any search |
702 | + if (searching_timeout_id_) |
703 | + { |
704 | + g_source_remove (searching_timeout_id_); |
705 | + } |
706 | + // 250ms for the Search method call, rest for the actual search |
707 | + searching_timeout_id_ = g_timeout_add (500, &DashView::ResetSearchStateCb, this); |
708 | + } |
709 | +>>>>>>> MERGE-SOURCE |
710 | } |
711 | |
712 | void DashView::OnLiveSearchReached(std::string const& search_string) |
713 | @@ -554,6 +593,7 @@ |
714 | |
715 | void DashView::OnSearchFinished(Lens::Hints const& hints) |
716 | { |
717 | +<<<<<<< TREE |
718 | if (hide_message_delay_id_) |
719 | { |
720 | g_source_remove(hide_message_delay_id_); |
721 | @@ -567,7 +607,12 @@ |
722 | |
723 | if (active_lens_view_->search_string == search_string) |
724 | { |
725 | +======= |
726 | + if (search_bar_->search_string == search_string) |
727 | + { |
728 | +>>>>>>> MERGE-SOURCE |
729 | search_bar_->SearchFinished(); |
730 | +<<<<<<< TREE |
731 | search_in_progress_ = false; |
732 | if (activate_on_finish_) |
733 | this->OnEntryActivated(); |
734 | @@ -594,6 +639,18 @@ |
735 | if (activate_on_finish_) |
736 | this->OnEntryActivated(); |
737 | } |
738 | +======= |
739 | + search_in_progress_ = false; |
740 | + if (activate_on_finish_) |
741 | + this->OnEntryActivated(); |
742 | + } |
743 | +} |
744 | + |
745 | +void DashView::OnGlobalSearchFinished(std::string const& search_string) |
746 | +{ |
747 | + if (active_lens_view_ == home_view_) |
748 | + OnSearchFinished(search_string); |
749 | +>>>>>>> MERGE-SOURCE |
750 | } |
751 | |
752 | void DashView::OnUriActivated(std::string const& uri) |
753 | |
754 | === modified file 'plugins/unityshell/src/DashView.h' |
755 | --- plugins/unityshell/src/DashView.h 2012-03-30 11:40:10 +0000 |
756 | +++ plugins/unityshell/src/DashView.h 2013-01-18 15:43:30 +0000 |
757 | @@ -108,9 +108,14 @@ |
758 | |
759 | nux::Area* KeyNavIteration(nux::KeyNavDirection direction); |
760 | |
761 | +<<<<<<< TREE |
762 | static gboolean ResetSearchStateCb(gpointer data); |
763 | static gboolean HideResultMessageCb(gpointer data); |
764 | |
765 | +======= |
766 | + static gboolean ResetSearchStateCb(gpointer data); |
767 | + |
768 | +>>>>>>> MERGE-SOURCE |
769 | private: |
770 | UBusManager ubus_manager_; |
771 | FilesystemLenses lenses_; |
772 | @@ -134,12 +139,18 @@ |
773 | OverlayRenderer renderer_; |
774 | |
775 | std::string last_activated_uri_; |
776 | +<<<<<<< TREE |
777 | // we're passing this back to g_* functions, so we'll keep the g* type |
778 | guint searching_timeout_id_; |
779 | bool search_in_progress_; |
780 | bool activate_on_finish_; |
781 | |
782 | guint hide_message_delay_id_; |
783 | +======= |
784 | + guint searching_timeout_id_; |
785 | + bool search_in_progress_; |
786 | + bool activate_on_finish_; |
787 | +>>>>>>> MERGE-SOURCE |
788 | |
789 | bool visible_; |
790 | }; |
791 | |
792 | === modified file 'plugins/unityshell/src/ElapsedTimeMonitor.cpp' |
793 | --- plugins/unityshell/src/ElapsedTimeMonitor.cpp 2012-03-14 06:24:18 +0000 |
794 | +++ plugins/unityshell/src/ElapsedTimeMonitor.cpp 2013-01-18 15:43:30 +0000 |
795 | @@ -39,7 +39,7 @@ |
796 | { |
797 | struct timespec current; |
798 | clock_gettime(CLOCK_MONOTONIC, ¤t); |
799 | - int diff = TimeUtil::TimeDelta(¤t, &_start); |
800 | + DeltaTime diff = TimeUtil::TimeDelta(¤t, &_start); |
801 | |
802 | variant::BuilderWrapper(builder) |
803 | .add("elapsed-time", diff); |
804 | |
805 | === modified file 'plugins/unityshell/src/GeisAdapter.cpp' |
806 | --- plugins/unityshell/src/GeisAdapter.cpp 2012-04-10 01:41:16 +0000 |
807 | +++ plugins/unityshell/src/GeisAdapter.cpp 2013-01-18 15:43:30 +0000 |
808 | @@ -488,7 +488,7 @@ |
809 | GEIS_XCB_FULL_WINDOW, |
810 | &xcb_win_info |
811 | }; |
812 | - GeisInstance instance; |
813 | + GeisInstance instance = nullptr; |
814 | |
815 | status = geis_init(&win_info, &instance); |
816 | if (status != GEIS_STATUS_SUCCESS) |
817 | |
818 | === modified file 'plugins/unityshell/src/Launcher.cpp' |
819 | --- plugins/unityshell/src/Launcher.cpp 2012-11-12 12:20:38 +0000 |
820 | +++ plugins/unityshell/src/Launcher.cpp 2013-01-18 15:43:30 +0000 |
821 | @@ -111,6 +111,22 @@ |
822 | |
823 | NUX_IMPLEMENT_OBJECT_TYPE(Launcher); |
824 | |
825 | +<<<<<<< TREE |
826 | +======= |
827 | +void SetTimeBack(struct timespec* timeref, DeltaTime remove) |
828 | +{ |
829 | + timeref->tv_sec -= remove / 1000; |
830 | + remove = remove % 1000; |
831 | + |
832 | + if (remove > timeref->tv_nsec / 1000000) |
833 | + { |
834 | + timeref->tv_sec--; |
835 | + timeref->tv_nsec += 1000000000; |
836 | + } |
837 | + timeref->tv_nsec -= remove * 1000000; |
838 | +} |
839 | + |
840 | +>>>>>>> MERGE-SOURCE |
841 | const gchar Launcher::introspection_xml[] = |
842 | "<node>" |
843 | " <interface name='com.canonical.Unity.Launcher'>" |
844 | @@ -615,6 +631,28 @@ |
845 | return false; |
846 | } |
847 | |
848 | +<<<<<<< TREE |
849 | +======= |
850 | +void Launcher::SetTimeStruct(struct timespec* timer, struct timespec* sister, DeltaTime sister_relation) |
851 | +{ |
852 | + struct timespec current; |
853 | + clock_gettime(CLOCK_MONOTONIC, ¤t); |
854 | + |
855 | + if (sister) |
856 | + { |
857 | + DeltaTime diff = unity::TimeUtil::TimeDelta(¤t, sister); |
858 | + |
859 | + if (diff < sister_relation) |
860 | + { |
861 | + DeltaTime remove = sister_relation - diff; |
862 | + SetTimeBack(¤t, remove); |
863 | + } |
864 | + } |
865 | + |
866 | + timer->tv_sec = current.tv_sec; |
867 | + timer->tv_nsec = current.tv_nsec; |
868 | +} |
869 | +>>>>>>> MERGE-SOURCE |
870 | /* Min is when you are on the trigger */ |
871 | float Launcher::GetAutohidePositionMin() const |
872 | { |
873 | @@ -635,6 +673,7 @@ |
874 | |
875 | float Launcher::IconVisibleProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
876 | { |
877 | +<<<<<<< TREE |
878 | if (!icon->IsVisibleOnMonitor(monitor)) |
879 | return 0.0f; |
880 | |
881 | @@ -647,12 +686,23 @@ |
882 | { |
883 | struct timespec icon_visible_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE); |
884 | int enter_ms = unity::TimeUtil::TimeDelta(¤t, &icon_visible_time); |
885 | +======= |
886 | + if (icon->GetQuirk(LauncherIcon::QUIRK_VISIBLE)) |
887 | + { |
888 | + struct timespec icon_visible_time = icon->GetQuirkTime(LauncherIcon::QUIRK_VISIBLE); |
889 | + DeltaTime enter_ms = unity::TimeUtil::TimeDelta(¤t, &icon_visible_time); |
890 | +>>>>>>> MERGE-SOURCE |
891 | return CLAMP((float) enter_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f); |
892 | } |
893 | else |
894 | { |
895 | +<<<<<<< TREE |
896 | struct timespec icon_hide_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE); |
897 | int hide_ms = unity::TimeUtil::TimeDelta(¤t, &icon_hide_time); |
898 | +======= |
899 | + struct timespec icon_hide_time = icon->GetQuirkTime(LauncherIcon::QUIRK_VISIBLE); |
900 | + DeltaTime hide_ms = unity::TimeUtil::TimeDelta(¤t, &icon_hide_time); |
901 | +>>>>>>> MERGE-SOURCE |
902 | return 1.0f - CLAMP((float) hide_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f); |
903 | } |
904 | } |
905 | @@ -684,8 +734,13 @@ |
906 | |
907 | float Launcher::IconPresentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
908 | { |
909 | +<<<<<<< TREE |
910 | struct timespec icon_present_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PRESENTED); |
911 | int ms = unity::TimeUtil::TimeDelta(¤t, &icon_present_time); |
912 | +======= |
913 | + struct timespec icon_present_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PRESENTED); |
914 | + DeltaTime ms = unity::TimeUtil::TimeDelta(¤t, &icon_present_time); |
915 | +>>>>>>> MERGE-SOURCE |
916 | float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f); |
917 | |
918 | if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED)) |
919 | @@ -696,8 +751,13 @@ |
920 | |
921 | float Launcher::IconUrgentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
922 | { |
923 | +<<<<<<< TREE |
924 | struct timespec urgent_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_URGENT); |
925 | int urgent_ms = unity::TimeUtil::TimeDelta(¤t, &urgent_time); |
926 | +======= |
927 | + struct timespec urgent_time = icon->GetQuirkTime(LauncherIcon::QUIRK_URGENT); |
928 | + DeltaTime urgent_ms = unity::TimeUtil::TimeDelta(¤t, &urgent_time); |
929 | +>>>>>>> MERGE-SOURCE |
930 | float result; |
931 | |
932 | if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE) |
933 | @@ -713,8 +773,13 @@ |
934 | |
935 | float Launcher::IconDropDimValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
936 | { |
937 | +<<<<<<< TREE |
938 | struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_DIM); |
939 | int dim_ms = unity::TimeUtil::TimeDelta(¤t, &dim_time); |
940 | +======= |
941 | + struct timespec dim_time = icon->GetQuirkTime(LauncherIcon::QUIRK_DROP_DIM); |
942 | + DeltaTime dim_ms = unity::TimeUtil::TimeDelta(¤t, &dim_time); |
943 | +>>>>>>> MERGE-SOURCE |
944 | float result = CLAMP((float) dim_ms / (float) ANIM_DURATION, 0.0f, 1.0f); |
945 | |
946 | if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM)) |
947 | @@ -725,11 +790,16 @@ |
948 | |
949 | float Launcher::IconDesatValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
950 | { |
951 | +<<<<<<< TREE |
952 | if (!IsOverlayOpen()) |
953 | return 1.0f; |
954 | |
955 | struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DESAT); |
956 | int ms = unity::TimeUtil::TimeDelta(¤t, &dim_time); |
957 | +======= |
958 | + struct timespec dim_time = icon->GetQuirkTime(LauncherIcon::QUIRK_DESAT); |
959 | + DeltaTime ms = unity::TimeUtil::TimeDelta(¤t, &dim_time); |
960 | +>>>>>>> MERGE-SOURCE |
961 | float result = CLAMP((float) ms / (float) ANIM_DURATION_SHORT_SHORT, 0.0f, 1.0f); |
962 | |
963 | if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DESAT)) |
964 | @@ -740,15 +810,25 @@ |
965 | |
966 | float Launcher::IconShimmerProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
967 | { |
968 | +<<<<<<< TREE |
969 | struct timespec shimmer_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_SHIMMER); |
970 | int shimmer_ms = unity::TimeUtil::TimeDelta(¤t, &shimmer_time); |
971 | +======= |
972 | + struct timespec shimmer_time = icon->GetQuirkTime(LauncherIcon::QUIRK_SHIMMER); |
973 | + DeltaTime shimmer_ms = unity::TimeUtil::TimeDelta(¤t, &shimmer_time); |
974 | +>>>>>>> MERGE-SOURCE |
975 | return CLAMP((float) shimmer_ms / (float) ANIM_DURATION_LONG, 0.0f, 1.0f); |
976 | } |
977 | |
978 | float Launcher::IconCenterTransitionProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
979 | { |
980 | +<<<<<<< TREE |
981 | struct timespec save_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_CENTER_SAVED); |
982 | int save_ms = unity::TimeUtil::TimeDelta(¤t, &save_time); |
983 | +======= |
984 | + struct timespec save_time = icon->GetQuirkTime(LauncherIcon::QUIRK_CENTER_SAVED); |
985 | + DeltaTime save_ms = unity::TimeUtil::TimeDelta(¤t, &save_time); |
986 | +>>>>>>> MERGE-SOURCE |
987 | return CLAMP((float) save_ms / (float) ANIM_DURATION, 0.0f, 1.0f); |
988 | } |
989 | |
990 | @@ -763,8 +843,13 @@ |
991 | |
992 | float Launcher::IconPulseOnceValue(AbstractLauncherIcon::Ptr icon, struct timespec const ¤t) const |
993 | { |
994 | +<<<<<<< TREE |
995 | struct timespec pulse_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PULSE_ONCE); |
996 | int pulse_ms = unity::TimeUtil::TimeDelta(¤t, &pulse_time); |
997 | +======= |
998 | + struct timespec pulse_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PULSE_ONCE); |
999 | + DeltaTime pulse_ms = unity::TimeUtil::TimeDelta(¤t, &pulse_time); |
1000 | +>>>>>>> MERGE-SOURCE |
1001 | double pulse_progress = (double) CLAMP((float) pulse_ms / (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), 0.0f, 1.0f); |
1002 | |
1003 | if (pulse_progress == 1.0f) |
1004 | @@ -784,8 +869,13 @@ |
1005 | |
1006 | float Launcher::IconStartingBlinkValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
1007 | { |
1008 | +<<<<<<< TREE |
1009 | struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING); |
1010 | int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time); |
1011 | +======= |
1012 | + struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING); |
1013 | + DeltaTime starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time); |
1014 | +>>>>>>> MERGE-SOURCE |
1015 | double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f); |
1016 | double val = IsBackLightModeToggles() ? 3.0f : 4.0f; |
1017 | return 0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f; |
1018 | @@ -793,8 +883,13 @@ |
1019 | |
1020 | float Launcher::IconStartingPulseValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
1021 | { |
1022 | +<<<<<<< TREE |
1023 | struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING); |
1024 | int starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time); |
1025 | +======= |
1026 | + struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING); |
1027 | + DeltaTime starting_ms = unity::TimeUtil::TimeDelta(¤t, &starting_time); |
1028 | +>>>>>>> MERGE-SOURCE |
1029 | double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f); |
1030 | |
1031 | if (starting_progress == 1.0f && !icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING)) |
1032 | @@ -810,8 +905,13 @@ |
1033 | { |
1034 | float result = 0.0f; |
1035 | |
1036 | +<<<<<<< TREE |
1037 | struct timespec running_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_RUNNING); |
1038 | int running_ms = unity::TimeUtil::TimeDelta(¤t, &running_time); |
1039 | +======= |
1040 | + struct timespec running_time = icon->GetQuirkTime(LauncherIcon::QUIRK_RUNNING); |
1041 | + DeltaTime running_ms = unity::TimeUtil::TimeDelta(¤t, &running_time); |
1042 | +>>>>>>> MERGE-SOURCE |
1043 | float running_progress = CLAMP((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f); |
1044 | |
1045 | if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING)) |
1046 | @@ -875,8 +975,13 @@ |
1047 | |
1048 | float Launcher::IconProgressBias(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const |
1049 | { |
1050 | +<<<<<<< TREE |
1051 | struct timespec icon_progress_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PROGRESS); |
1052 | int ms = unity::TimeUtil::TimeDelta(¤t, &icon_progress_time); |
1053 | +======= |
1054 | + struct timespec icon_progress_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PROGRESS); |
1055 | + DeltaTime ms = unity::TimeUtil::TimeDelta(¤t, &icon_progress_time); |
1056 | +>>>>>>> MERGE-SOURCE |
1057 | float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f); |
1058 | |
1059 | if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PROGRESS)) |
1060 | @@ -1286,6 +1391,7 @@ |
1061 | |
1062 | /* End Render Layout Logic */ |
1063 | |
1064 | +<<<<<<< TREE |
1065 | void Launcher::ForceReveal(bool force_reveal) |
1066 | { |
1067 | _hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, force_reveal); |
1068 | @@ -1300,6 +1406,104 @@ |
1069 | |
1070 | void Launcher::OnBGColorChanged(GVariant *data) |
1071 | { |
1072 | +======= |
1073 | +gboolean Launcher::TapOnSuper() |
1074 | +{ |
1075 | + struct timespec current; |
1076 | + clock_gettime(CLOCK_MONOTONIC, ¤t); |
1077 | + |
1078 | + return (unity::TimeUtil::TimeDelta(¤t, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION); |
1079 | +} |
1080 | + |
1081 | +/* Launcher Show/Hide logic */ |
1082 | + |
1083 | +void Launcher::StartKeyShowLauncher() |
1084 | +{ |
1085 | + _hide_machine->SetQuirk(LauncherHideMachine::LAST_ACTION_ACTIVATE, false); |
1086 | + |
1087 | + SetTimeStruct(&_times[TIME_TAP_SUPER]); |
1088 | + SetTimeStruct(&_times[TIME_SUPER_PRESSED]); |
1089 | + |
1090 | + if (_super_show_launcher_handle > 0) |
1091 | + g_source_remove(_super_show_launcher_handle); |
1092 | + _super_show_launcher_handle = g_timeout_add(SUPER_TAP_DURATION, &Launcher::SuperShowLauncherTimeout, this); |
1093 | + |
1094 | + if (_super_show_shortcuts_handle > 0) |
1095 | + g_source_remove(_super_show_shortcuts_handle); |
1096 | + _super_show_shortcuts_handle = g_timeout_add(SHORTCUTS_SHOWN_DELAY, &Launcher::SuperShowShortcutsTimeout, this); |
1097 | + |
1098 | + ubus_server_send_message(ubus_server_get_default(), UBUS_DASH_ABOUT_TO_SHOW, NULL); |
1099 | + ubus_server_force_message_pump(ubus_server_get_default()); |
1100 | +} |
1101 | + |
1102 | +void Launcher::EndKeyShowLauncher() |
1103 | +{ |
1104 | + int remaining_time_before_hide; |
1105 | + struct timespec current; |
1106 | + clock_gettime(CLOCK_MONOTONIC, ¤t); |
1107 | + |
1108 | + _hover_machine->SetQuirk(LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, false); |
1109 | + _shortcuts_shown = false; |
1110 | + QueueDraw(); |
1111 | + |
1112 | + // remove further show launcher (which can happen when we close the dash with super) |
1113 | + if (_super_show_launcher_handle > 0) |
1114 | + g_source_remove(_super_show_launcher_handle); |
1115 | + if (_super_show_shortcuts_handle > 0) |
1116 | + g_source_remove(_super_show_shortcuts_handle); |
1117 | + _super_show_launcher_handle = 0; |
1118 | + _super_show_shortcuts_handle = 0; |
1119 | + |
1120 | + // it's a tap on super and we didn't use any shortcuts |
1121 | + if (TapOnSuper() && !_latest_shortcut) |
1122 | + ubus_server_send_message(ubus_server_get_default(), |
1123 | + UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, |
1124 | + g_variant_new("(sus)", "home.lens", 0, "")); |
1125 | + |
1126 | + remaining_time_before_hide = BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION - CLAMP((DeltaTime)(unity::TimeUtil::TimeDelta(¤t, &_times[TIME_SUPER_PRESSED])), 0, BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION); |
1127 | + |
1128 | + if (_super_hide_launcher_handle > 0) |
1129 | + g_source_remove(_super_hide_launcher_handle); |
1130 | + _super_hide_launcher_handle = g_timeout_add(remaining_time_before_hide, &Launcher::SuperHideLauncherTimeout, this); |
1131 | +} |
1132 | + |
1133 | +gboolean Launcher::SuperHideLauncherTimeout(gpointer data) |
1134 | +{ |
1135 | + Launcher* self = (Launcher*) data; |
1136 | + |
1137 | + self->_hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, false); |
1138 | + |
1139 | + self->_super_hide_launcher_handle = 0; |
1140 | + return false; |
1141 | +} |
1142 | + |
1143 | +gboolean Launcher::SuperShowLauncherTimeout(gpointer data) |
1144 | +{ |
1145 | + Launcher* self = (Launcher*) data; |
1146 | + |
1147 | + self->_hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, true); |
1148 | + |
1149 | + self->_super_show_launcher_handle = 0; |
1150 | + return false; |
1151 | +} |
1152 | + |
1153 | +gboolean Launcher::SuperShowShortcutsTimeout(gpointer data) |
1154 | +{ |
1155 | + Launcher* self = (Launcher*) data; |
1156 | + |
1157 | + self->_shortcuts_shown = true; |
1158 | + self->_hover_machine->SetQuirk(LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, true); |
1159 | + |
1160 | + self->QueueDraw(); |
1161 | + |
1162 | + self->_super_show_shortcuts_handle = 0; |
1163 | + return false; |
1164 | +} |
1165 | + |
1166 | +void Launcher::OnBGColorChanged(GVariant *data, void *val) |
1167 | +{ |
1168 | + Launcher *self = (Launcher*)val; |
1169 | +>>>>>>> MERGE-SOURCE |
1170 | double red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f; |
1171 | |
1172 | g_variant_get(data, "(dddd)", &red, &green, &blue, &alpha); |
1173 | |
1174 | === modified file 'plugins/unityshell/src/LauncherIcon.cpp' |
1175 | --- plugins/unityshell/src/LauncherIcon.cpp 2012-09-11 10:38:44 +0000 |
1176 | +++ plugins/unityshell/src/LauncherIcon.cpp 2013-01-18 15:43:30 +0000 |
1177 | @@ -537,6 +537,7 @@ |
1178 | return; |
1179 | } |
1180 | |
1181 | +<<<<<<< TREE |
1182 | ShowTooltip(); |
1183 | } |
1184 | |
1185 | @@ -551,22 +552,60 @@ |
1186 | |
1187 | bool LauncherIcon::OpenQuicklist(bool select_first_item, int monitor) |
1188 | { |
1189 | +======= |
1190 | + if (!_skip_tooltip_delay) |
1191 | + _tooltip_delay_handle = g_timeout_add(500, &LauncherIcon::OnTooltipTimeout, this); |
1192 | + else |
1193 | + OnTooltipTimeout(this); |
1194 | +} |
1195 | + |
1196 | +void LauncherIcon::RecvMouseLeave() |
1197 | +{ |
1198 | + if (_tooltip_delay_handle) |
1199 | + g_source_remove(_tooltip_delay_handle); |
1200 | + _tooltip_delay_handle = 0; |
1201 | + |
1202 | + _tooltip->ShowWindow(false); |
1203 | +} |
1204 | + |
1205 | +bool LauncherIcon::OpenQuicklist(bool default_to_first_item) |
1206 | +{ |
1207 | +>>>>>>> MERGE-SOURCE |
1208 | std::list<DbusmenuMenuitem*> menus = Menus(); |
1209 | +<<<<<<< TREE |
1210 | |
1211 | if (!_quicklist) |
1212 | LoadQuicklist(); |
1213 | |
1214 | +======= |
1215 | + |
1216 | +>>>>>>> MERGE-SOURCE |
1217 | if (menus.empty()) |
1218 | return false; |
1219 | |
1220 | +<<<<<<< TREE |
1221 | if (_tooltip) |
1222 | _tooltip->ShowWindow(false); |
1223 | _quicklist->RemoveAllMenuItem(); |
1224 | |
1225 | for (auto menu_item : menus) |
1226 | +======= |
1227 | + if (_tooltip_delay_handle) |
1228 | + g_source_remove(_tooltip_delay_handle); |
1229 | + _tooltip_delay_handle = 0; |
1230 | + _skip_tooltip_delay = false; |
1231 | + |
1232 | + _tooltip->ShowWindow(false); |
1233 | + _quicklist->RemoveAllMenuItem(); |
1234 | + |
1235 | + for (auto menu_item : menus) |
1236 | +>>>>>>> MERGE-SOURCE |
1237 | { |
1238 | +<<<<<<< TREE |
1239 | QuicklistMenuItem* ql_item; |
1240 | |
1241 | +======= |
1242 | +>>>>>>> MERGE-SOURCE |
1243 | const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE); |
1244 | const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE); |
1245 | gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE); |
1246 | @@ -628,6 +667,28 @@ |
1247 | { |
1248 | QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y); |
1249 | } |
1250 | +<<<<<<< TREE |
1251 | +======= |
1252 | + |
1253 | + auto win_manager = WindowManager::Default(); |
1254 | + |
1255 | + if (win_manager->IsScaleActive()) |
1256 | + win_manager->TerminateScale(); |
1257 | + |
1258 | + /* If the expo plugin is active, we need to wait it to be termated, before |
1259 | + * shwing the icon quicklist. */ |
1260 | + if (win_manager->IsExpoActive()) |
1261 | + { |
1262 | + on_expo_terminated_connection = win_manager->terminate_expo.connect([&, tip_x, tip_y]() { |
1263 | + QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y); |
1264 | + on_expo_terminated_connection.disconnect(); |
1265 | + }); |
1266 | + } |
1267 | + else |
1268 | + { |
1269 | + QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y); |
1270 | + } |
1271 | +>>>>>>> MERGE-SOURCE |
1272 | |
1273 | return true; |
1274 | } |
1275 | |
1276 | === modified file 'plugins/unityshell/src/LauncherIcon.h' |
1277 | --- plugins/unityshell/src/LauncherIcon.h 2012-07-18 15:25:17 +0000 |
1278 | +++ plugins/unityshell/src/LauncherIcon.h 2013-01-18 15:43:30 +0000 |
1279 | @@ -194,6 +194,7 @@ |
1280 | |
1281 | void SetIconType(IconType type); |
1282 | |
1283 | +<<<<<<< TREE |
1284 | virtual std::string DesktopFile() { return std::string(""); } |
1285 | |
1286 | virtual bool IsSticky() const { return false; } |
1287 | @@ -209,6 +210,19 @@ |
1288 | virtual void Stick(bool save = true) {} |
1289 | |
1290 | virtual void UnStick() {} |
1291 | +======= |
1292 | + std::vector<nux::Vector4> & GetTransform(TransformIndex index); |
1293 | + |
1294 | + static void SetSkipTooltipDelay(gboolean skip_tooltip_delay); |
1295 | + |
1296 | + sigc::signal<void, LauncherIcon*> remove; |
1297 | + |
1298 | + sigc::connection needs_redraw_connection; |
1299 | + sigc::connection on_icon_added_connection; |
1300 | + sigc::connection on_icon_removed_connection; |
1301 | + sigc::connection on_order_changed_connection; |
1302 | + sigc::connection on_expo_terminated_connection; |
1303 | +>>>>>>> MERGE-SOURCE |
1304 | |
1305 | protected: |
1306 | std::vector<nux::Point3> GetCenters(); |
1307 | |
1308 | === modified file 'plugins/unityshell/src/PanelMenuView.cpp' |
1309 | --- plugins/unityshell/src/PanelMenuView.cpp 2012-04-27 11:42:56 +0000 |
1310 | +++ plugins/unityshell/src/PanelMenuView.cpp 2013-01-18 15:43:30 +0000 |
1311 | @@ -1531,6 +1531,52 @@ |
1312 | FullRedraw(); |
1313 | } |
1314 | |
1315 | +<<<<<<< TREE |
1316 | +======= |
1317 | +void |
1318 | +PanelMenuView::OnMouseDoubleClicked(int x, int y, unsigned long button_flags, unsigned long) |
1319 | +{ |
1320 | + if (nux::GetEventButton(button_flags) != 1 || _places_showing) |
1321 | + return; |
1322 | + |
1323 | + guint32 window_xid = GetMaximizedWindow(); |
1324 | + |
1325 | + if (window_xid != 0) |
1326 | + { |
1327 | + WindowManager::Default()->Restore(window_xid); |
1328 | + _is_inside = true; |
1329 | + } |
1330 | +} |
1331 | + |
1332 | +void |
1333 | +PanelMenuView::OnMouseClicked(int x, int y, unsigned long button_flags, unsigned long) |
1334 | +{ |
1335 | + if (nux::GetEventButton(button_flags) != 1 || _places_showing) |
1336 | + return; |
1337 | + |
1338 | + guint32 window_xid = GetMaximizedWindow(); |
1339 | + |
1340 | + if (window_xid != 0) |
1341 | + { |
1342 | + WindowManager::Default()->Raise(window_xid); |
1343 | + } |
1344 | +} |
1345 | + |
1346 | +void |
1347 | +PanelMenuView::OnMouseMiddleClicked(int x, int y, unsigned long button_flags, unsigned long) |
1348 | +{ |
1349 | + if (nux::GetEventButton(button_flags) != 2 || _places_showing) |
1350 | + return; |
1351 | + |
1352 | + guint32 window_xid = GetMaximizedWindow(); |
1353 | + |
1354 | + if (window_xid != 0) |
1355 | + { |
1356 | + WindowManager::Default()->Lower(window_xid); |
1357 | + } |
1358 | +} |
1359 | + |
1360 | +>>>>>>> MERGE-SOURCE |
1361 | // Introspectable |
1362 | std::string |
1363 | PanelMenuView::GetName() const |
1364 | |
1365 | === modified file 'plugins/unityshell/src/PanelTray.cpp' |
1366 | --- plugins/unityshell/src/PanelTray.cpp 2012-04-12 13:23:29 +0000 |
1367 | +++ plugins/unityshell/src/PanelTray.cpp 2013-01-18 15:43:30 +0000 |
1368 | @@ -81,6 +81,16 @@ |
1369 | |
1370 | PanelTray::~PanelTray() |
1371 | { |
1372 | +<<<<<<< TREE |
1373 | +======= |
1374 | + if (_tray) |
1375 | + { |
1376 | + g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id); |
1377 | + g_object_unref(_tray); |
1378 | + _tray = NULL; |
1379 | + } |
1380 | + |
1381 | +>>>>>>> MERGE-SOURCE |
1382 | g_idle_remove_by_data(this); |
1383 | g_strfreev(whitelist_); |
1384 | |
1385 | |
1386 | === modified file 'plugins/unityshell/src/PanelView.cpp' |
1387 | --- plugins/unityshell/src/PanelView.cpp 2012-04-27 11:42:56 +0000 |
1388 | +++ plugins/unityshell/src/PanelView.cpp 2013-01-18 15:43:30 +0000 |
1389 | @@ -638,7 +638,12 @@ |
1390 | return; |
1391 | |
1392 | _opacity = opacity; |
1393 | +<<<<<<< TREE |
1394 | _bg_effect_helper.enabled = (_opacity < 1.0f || _overlay_is_open); |
1395 | +======= |
1396 | + |
1397 | + bg_effect_helper_.enabled = (_opacity < 1.0f || _dash_is_open); |
1398 | +>>>>>>> MERGE-SOURCE |
1399 | |
1400 | ForceUpdateBackground(); |
1401 | } |
1402 | |
1403 | === modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp' |
1404 | --- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-07-18 15:25:17 +0000 |
1405 | +++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2013-01-18 15:43:30 +0000 |
1406 | @@ -1,3 +1,4 @@ |
1407 | +<<<<<<< TREE |
1408 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1409 | /* Compiz unity plugin |
1410 | * unity.h |
1411 | @@ -236,3 +237,239 @@ |
1412 | |
1413 | #endif // USE_GLES |
1414 | |
1415 | +======= |
1416 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1417 | +/* Compiz unity plugin |
1418 | + * unity.h |
1419 | + * |
1420 | + * Copyright (c) 2010-11 Canonical Ltd. |
1421 | + * |
1422 | + * This program is free software; you can redistribute it and/or |
1423 | + * modify it under the terms of the GNU General Public License |
1424 | + * as published by the Free Software Foundation; either version 3 |
1425 | + * of the License, or (at your option) any later version. |
1426 | + * |
1427 | + * This program is distributed in the hope that it will be useful, |
1428 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1429 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1430 | + * GNU General Public License for more details. |
1431 | + * |
1432 | + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
1433 | + */ |
1434 | + |
1435 | +#include "ScreenEffectFramebufferObject.h" |
1436 | +#include "BackgroundEffectHelper.h" |
1437 | +#include <NuxCore/Logger.h> |
1438 | +#include <dlfcn.h> |
1439 | + |
1440 | +namespace |
1441 | +{ |
1442 | + nux::logging::Logger logger ("unity.screeneffectframebufferobject"); |
1443 | +} |
1444 | + |
1445 | +void ScreenEffectFramebufferObject::paint (const nux::Geometry &output) |
1446 | +{ |
1447 | + /* Draw the bit of the relevant framebuffer for each output */ |
1448 | + |
1449 | + glPushAttrib (GL_VIEWPORT_BIT); |
1450 | + glViewport (0, mScreenSize.height - (output.y + output.height), mScreenSize.width, mScreenSize.height); |
1451 | + |
1452 | + if (mFBTexture) |
1453 | + { |
1454 | + glEnable (GL_TEXTURE_2D); |
1455 | + activeTexture (GL_TEXTURE0_ARB); |
1456 | + glBindTexture (GL_TEXTURE_2D, mFBTexture); |
1457 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1458 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1459 | + |
1460 | + glPushAttrib (GL_SCISSOR_BIT); |
1461 | + glEnable (GL_SCISSOR_TEST); |
1462 | + |
1463 | + glScissor (output.x, mScreenSize.height - (output.y + output.height), |
1464 | + output.width, output.height); |
1465 | + |
1466 | + /* FIXME: This needs to be GL_TRIANGLE_STRIP */ |
1467 | + glBegin (GL_QUADS); |
1468 | + glTexCoord2f (0, 1); |
1469 | + glVertex2i (mGeometry.x, mGeometry.y); |
1470 | + glTexCoord2f (0, 0); |
1471 | + glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height); |
1472 | + glTexCoord2f (1, 0); |
1473 | + glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height); |
1474 | + glTexCoord2f (1, 1); |
1475 | + glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y); |
1476 | + glEnd (); |
1477 | + |
1478 | + activeTexture (GL_TEXTURE0_ARB); |
1479 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1480 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1481 | + glBindTexture (GL_TEXTURE_2D, 0); |
1482 | + glDisable (GL_TEXTURE_2D); |
1483 | + glPopAttrib (); |
1484 | + } |
1485 | + glPopAttrib (); |
1486 | +} |
1487 | + |
1488 | +void ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize) |
1489 | +{ |
1490 | + mScreenSize = screenSize; |
1491 | +} |
1492 | + |
1493 | + |
1494 | +void ScreenEffectFramebufferObject::unbind () |
1495 | +{ |
1496 | + if (!mBoundCnt) |
1497 | + return; |
1498 | + |
1499 | + mBoundCnt--; |
1500 | + |
1501 | + (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0); |
1502 | + |
1503 | + glDrawBuffer (GL_BACK); |
1504 | + glReadBuffer (GL_BACK); |
1505 | + |
1506 | + /* Matches the viewport set we did in ::bind () */ |
1507 | + glPopAttrib (); |
1508 | + |
1509 | +} |
1510 | + |
1511 | +bool ScreenEffectFramebufferObject::status () |
1512 | +{ |
1513 | + return mFboStatus; |
1514 | +} |
1515 | + |
1516 | +void ScreenEffectFramebufferObject::bind (const nux::Geometry &output) |
1517 | +{ |
1518 | + if (!BackgroundEffectHelper::HasDirtyHelpers()) |
1519 | + return; |
1520 | + |
1521 | + /* Clear the error bit */ |
1522 | + glGetError (); |
1523 | + |
1524 | + if (!mFBTexture) |
1525 | + { |
1526 | + glGenTextures (1, &mFBTexture); |
1527 | + |
1528 | + glBindTexture (GL_TEXTURE_2D, mFBTexture); |
1529 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1530 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1531 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
1532 | + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
1533 | + glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA, |
1534 | +#if IMAGE_BYTE_ORDER == MSBFirst |
1535 | + GL_UNSIGNED_INT_8_8_8_8_REV, |
1536 | +#else |
1537 | + GL_UNSIGNED_BYTE, |
1538 | +#endif |
1539 | + NULL); |
1540 | + |
1541 | + glBindTexture (GL_TEXTURE_2D, 0); |
1542 | + |
1543 | + if (glGetError () != GL_NO_ERROR) |
1544 | + { |
1545 | + mFboHandle = 0; |
1546 | + mFboStatus = false; |
1547 | + return; |
1548 | + } |
1549 | + } |
1550 | + |
1551 | + (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle); |
1552 | + |
1553 | + (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, |
1554 | + GL_TEXTURE_2D, mFBTexture, 0); |
1555 | + |
1556 | + (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, |
1557 | + GL_TEXTURE_2D, 0, 0); |
1558 | + |
1559 | + /* Ensure that a framebuffer is actually available */ |
1560 | + if (!mFboStatus) |
1561 | + { |
1562 | + GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER); |
1563 | + |
1564 | + if (status != GL_FRAMEBUFFER_COMPLETE) |
1565 | + { |
1566 | + switch (status) |
1567 | + { |
1568 | + case GL_FRAMEBUFFER_UNDEFINED: |
1569 | + LOG_WARN (logger) << "no window"; |
1570 | + break; |
1571 | + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: |
1572 | + LOG_WARN (logger) << "attachment incomplete"; |
1573 | + break; |
1574 | + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: |
1575 | + LOG_WARN (logger) << "no buffers attached to fbo"; |
1576 | + break; |
1577 | + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: |
1578 | + LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO"; |
1579 | + break; |
1580 | + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: |
1581 | + LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO"; |
1582 | + break; |
1583 | + case GL_FRAMEBUFFER_UNSUPPORTED: |
1584 | + LOG_WARN (logger) << "unsupported internal format"; |
1585 | + break; |
1586 | + case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: |
1587 | + LOG_WARN (logger) << "different levels of sampling for each attachment"; |
1588 | + break; |
1589 | + case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: |
1590 | + LOG_WARN (logger) << "number of layers is different"; |
1591 | + break; |
1592 | + default: |
1593 | + LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason"; |
1594 | + break; |
1595 | + } |
1596 | + |
1597 | + bindFramebuffer (GL_FRAMEBUFFER_EXT, 0); |
1598 | + deleteFramebuffers (1, &mFboHandle); |
1599 | + |
1600 | + glDrawBuffer (GL_BACK); |
1601 | + glReadBuffer (GL_BACK); |
1602 | + |
1603 | + mFboHandle = 0; |
1604 | + |
1605 | + mFboStatus = false; |
1606 | + } |
1607 | + else |
1608 | + mFboStatus = true; |
1609 | + } |
1610 | + |
1611 | + if (mFboStatus) |
1612 | + { |
1613 | + glPushAttrib (GL_VIEWPORT_BIT); |
1614 | + |
1615 | + glViewport (output.x, |
1616 | + mScreenSize.height - (output.y + output.height), |
1617 | + output.width, |
1618 | + output.height); |
1619 | + } |
1620 | + |
1621 | + mBoundCnt++; |
1622 | +} |
1623 | + |
1624 | + |
1625 | +ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom) |
1626 | + : getProcAddressGLX (p) |
1627 | + , mFboStatus (false) |
1628 | + , mFBTexture (0) |
1629 | + , mGeometry (geom) |
1630 | + , mBoundCnt (0) |
1631 | + , mScreenSize (geom) |
1632 | +{ |
1633 | + activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture"); |
1634 | + genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT"); |
1635 | + deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT"); |
1636 | + bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT"); |
1637 | + checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT"); |
1638 | + framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT"); |
1639 | + |
1640 | + (*genFramebuffers) (1, &mFboHandle); |
1641 | +} |
1642 | + |
1643 | +ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject () |
1644 | +{ |
1645 | + (*deleteFramebuffers) (1, &mFboHandle); |
1646 | + |
1647 | + if (mFBTexture) |
1648 | + glDeleteTextures (1, &mFBTexture); |
1649 | +} |
1650 | +>>>>>>> MERGE-SOURCE |
1651 | |
1652 | === modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.h' |
1653 | --- plugins/unityshell/src/ScreenEffectFramebufferObject.h 2012-03-14 06:24:18 +0000 |
1654 | +++ plugins/unityshell/src/ScreenEffectFramebufferObject.h 2013-01-18 15:43:30 +0000 |
1655 | @@ -1,3 +1,4 @@ |
1656 | +<<<<<<< TREE |
1657 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1658 | /* Compiz unity plugin |
1659 | * unity.h |
1660 | @@ -87,3 +88,89 @@ |
1661 | |
1662 | #endif // USE_GLES |
1663 | #endif |
1664 | +======= |
1665 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
1666 | +/* Compiz unity plugin |
1667 | + * unity.h |
1668 | + * |
1669 | + * Copyright (c) 2010-11 Canonical Ltd. |
1670 | + * |
1671 | + * This program is free software; you can redistribute it and/or |
1672 | + * modify it under the terms of the GNU General Public License |
1673 | + * as published by the Free Software Foundation; either version 3 |
1674 | + * of the License, or (at your option) any later version. |
1675 | + * |
1676 | + * This program is distributed in the hope that it will be useful, |
1677 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1678 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1679 | + * GNU General Public License for more details. |
1680 | + * |
1681 | + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
1682 | + */ |
1683 | + |
1684 | +#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H |
1685 | +#define UNITY_SCREENEFFECT_FRAMEBUFFER_H |
1686 | + |
1687 | +#include <Nux/Nux.h> |
1688 | + |
1689 | +class ScreenEffectFramebufferObject |
1690 | +{ |
1691 | +public: |
1692 | + |
1693 | + typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr; |
1694 | + typedef void (*FuncPtr) (void); |
1695 | + typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName); |
1696 | + |
1697 | + ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom); |
1698 | + ~ScreenEffectFramebufferObject (); |
1699 | + |
1700 | +public: |
1701 | + |
1702 | + void bind (const nux::Geometry &geom); |
1703 | + void unbind (); |
1704 | + |
1705 | + bool status (); |
1706 | + void paint (const nux::Geometry &geom); |
1707 | + bool bound () { return mBoundCnt > 0; } |
1708 | + |
1709 | + GLuint texture () { return mFBTexture; } |
1710 | + |
1711 | + void onScreenSizeChanged (const nux::Geometry &screenSize); |
1712 | + |
1713 | +private: |
1714 | + |
1715 | + FuncPtr getProcAddr (const std::string &); |
1716 | + |
1717 | + typedef void (*GLActiveTextureProc) (GLenum texture); |
1718 | + typedef void (*GLGenFramebuffersProc) (GLsizei n, |
1719 | + GLuint *framebuffers); |
1720 | + typedef void (*GLDeleteFramebuffersProc) (GLsizei n, |
1721 | + GLuint *framebuffers); |
1722 | + typedef void (*GLBindFramebufferProc) (GLenum target, |
1723 | + GLuint framebuffer); |
1724 | + typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target); |
1725 | + typedef void (*GLFramebufferTexture2DProc) (GLenum target, |
1726 | + GLenum attachment, |
1727 | + GLenum textarget, |
1728 | + GLuint texture, |
1729 | + GLint level); |
1730 | + |
1731 | + GLXGetProcAddressProc getProcAddressGLX; |
1732 | + GLActiveTextureProc activeTexture; |
1733 | + GLGenFramebuffersProc genFramebuffers; |
1734 | + GLDeleteFramebuffersProc deleteFramebuffers; |
1735 | + GLBindFramebufferProc bindFramebuffer; |
1736 | + GLCheckFramebufferStatusProc checkFramebufferStatus; |
1737 | + GLFramebufferTexture2DProc framebufferTexture2D; |
1738 | + /* compiz fbo handle that goes through to nux */ |
1739 | + GLuint mFboHandle; // actual handle to the framebuffer_ext |
1740 | + bool mFboStatus; // did the framebuffer texture bind succeed |
1741 | + GLuint mFBTexture; |
1742 | + nux::Geometry mGeometry; |
1743 | + unsigned int mBoundCnt; |
1744 | + |
1745 | + nux::Geometry mScreenSize; |
1746 | +}; |
1747 | + |
1748 | +#endif |
1749 | +>>>>>>> MERGE-SOURCE |
1750 | |
1751 | === modified file 'plugins/unityshell/src/SwitcherController.cpp' |
1752 | --- plugins/unityshell/src/SwitcherController.cpp 2012-07-18 15:25:17 +0000 |
1753 | +++ plugins/unityshell/src/SwitcherController.cpp 2013-01-18 15:43:30 +0000 |
1754 | @@ -55,6 +55,7 @@ |
1755 | , view_idle_timer_(0) |
1756 | , bg_color_(0, 0, 0, 0.5) |
1757 | { |
1758 | +<<<<<<< TREE |
1759 | ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &Controller::OnBackgroundUpdate)); |
1760 | |
1761 | /* Construct the view after a prefixed timeout, to improve the startup time */ |
1762 | @@ -64,10 +65,24 @@ |
1763 | self->ConstructWindow(); |
1764 | return FALSE; |
1765 | }, this, nullptr); |
1766 | +======= |
1767 | + timeout_length = 150; |
1768 | + detail_on_timeout = true; |
1769 | + detail_timeout_length = 1500; |
1770 | + |
1771 | + bg_color_ = nux::Color(0.0, 0.0, 0.0, 0.5); |
1772 | + |
1773 | + UBusServer *ubus = ubus_server_get_default(); |
1774 | + bg_update_handle_ = |
1775 | + ubus_server_register_interest(ubus, UBUS_BACKGROUND_COLOR_CHANGED, |
1776 | + (UBusCallback)&SwitcherController::OnBackgroundUpdate, |
1777 | + this); |
1778 | +>>>>>>> MERGE-SOURCE |
1779 | } |
1780 | |
1781 | Controller::~Controller() |
1782 | { |
1783 | + ubus_server_unregister_interest(ubus_server_get_default(), bg_update_handle_); |
1784 | if (view_window_) |
1785 | view_window_->UnReference(); |
1786 | |
1787 | |
1788 | === modified file 'plugins/unityshell/src/SwitcherController.h' |
1789 | --- plugins/unityshell/src/SwitcherController.h 2012-06-25 23:18:15 +0000 |
1790 | +++ plugins/unityshell/src/SwitcherController.h 2013-01-18 15:43:30 +0000 |
1791 | @@ -137,6 +137,7 @@ |
1792 | guint view_idle_timer_; |
1793 | nux::Color bg_color_; |
1794 | DetailMode detail_mode_; |
1795 | + guint bg_update_handle_; |
1796 | |
1797 | static bool CompareSwitcherItemsPriority(launcher::AbstractLauncherIcon::Ptr first, launcher::AbstractLauncherIcon::Ptr second); |
1798 | }; |
1799 | |
1800 | === modified file 'plugins/unityshell/src/SwitcherModel.cpp' |
1801 | --- plugins/unityshell/src/SwitcherModel.cpp 2012-08-15 18:26:01 +0000 |
1802 | +++ plugins/unityshell/src/SwitcherModel.cpp 2013-01-18 15:43:30 +0000 |
1803 | @@ -169,10 +169,17 @@ |
1804 | { |
1805 | if (!detail_selection || DetailXids ().empty()) |
1806 | return 0; |
1807 | +<<<<<<< TREE |
1808 | |
1809 | if (detail_selection_index > DetailXids().size() - 1) |
1810 | return 0; |
1811 | |
1812 | +======= |
1813 | + |
1814 | + if (detail_selection_index >= DetailXids().size()) |
1815 | + return 0; |
1816 | + |
1817 | +>>>>>>> MERGE-SOURCE |
1818 | return DetailXids()[detail_selection_index]; |
1819 | } |
1820 | |
1821 | |
1822 | === modified file 'plugins/unityshell/src/SwitcherView.cpp' |
1823 | --- plugins/unityshell/src/SwitcherView.cpp 2012-03-23 12:26:38 +0000 |
1824 | +++ plugins/unityshell/src/SwitcherView.cpp 2013-01-18 15:43:30 +0000 |
1825 | @@ -251,7 +251,7 @@ |
1826 | { |
1827 | std::vector<Window> xids = model_->DetailXids (); |
1828 | |
1829 | - int ms_since_change = TimeUtil::TimeDelta(¤t, &save_time_); |
1830 | + DeltaTime ms_since_change = TimeUtil::TimeDelta(¤t, &save_time_); |
1831 | float progress = MIN (1.0f, (float) ms_since_change / (float) animation_length()); |
1832 | |
1833 | for (Window window : xids) |
1834 | @@ -508,7 +508,7 @@ |
1835 | ++i; |
1836 | } |
1837 | |
1838 | - int ms_since_change = TimeUtil::TimeDelta(¤t, &save_time_); |
1839 | + DeltaTime ms_since_change = TimeUtil::TimeDelta(¤t, &save_time_); |
1840 | if (saved_args_.size () == results.size () && ms_since_change < animation_length) |
1841 | { |
1842 | float progress = (float) ms_since_change / (float) animation_length(); |
1843 | @@ -630,7 +630,11 @@ |
1844 | text_view_->SetBaseY(last_background_.y + last_background_.height - 45); |
1845 | text_view_->Draw(GfxContext, force_draw); |
1846 | |
1847 | +<<<<<<< TREE |
1848 | int ms_since_change = TimeUtil::TimeDelta(¤t_, &save_time_); |
1849 | +======= |
1850 | + DeltaTime ms_since_change = TimeUtil::TimeDelta(¤t, &save_time_); |
1851 | +>>>>>>> MERGE-SOURCE |
1852 | |
1853 | if (ms_since_change < animation_length && redraw_handle_ == 0) |
1854 | redraw_handle_ = g_idle_add_full (G_PRIORITY_DEFAULT, &SwitcherView::OnDrawTimeout, this, NULL); |
1855 | |
1856 | === modified file 'plugins/unityshell/src/TimeUtil.h' |
1857 | --- plugins/unityshell/src/TimeUtil.h 2012-03-14 06:24:18 +0000 |
1858 | +++ plugins/unityshell/src/TimeUtil.h 2013-01-18 15:43:30 +0000 |
1859 | @@ -19,12 +19,16 @@ |
1860 | */ |
1861 | |
1862 | #include <time.h> |
1863 | +#include <cstdint> |
1864 | + |
1865 | +typedef int64_t DeltaTime |
1866 | |
1867 | namespace unity { |
1868 | |
1869 | class TimeUtil |
1870 | { |
1871 | public: |
1872 | +<<<<<<< TREE |
1873 | static int TimeDelta (struct timespec const* x, struct timespec const* y) |
1874 | { |
1875 | return ((x->tv_sec - y->tv_sec) * 1000) + ((x->tv_nsec - y->tv_nsec) / 1000000); |
1876 | @@ -62,7 +66,20 @@ |
1877 | } |
1878 | timeref->tv_nsec -= remove * 1000000; |
1879 | } |
1880 | +======= |
1881 | +static DeltaTime TimeDelta (struct timespec const* x, struct timespec const* y); |
1882 | +>>>>>>> MERGE-SOURCE |
1883 | }; |
1884 | |
1885 | +<<<<<<< TREE |
1886 | +======= |
1887 | +inline |
1888 | +DeltaTime TimeUtil::TimeDelta (struct timespec const* x, struct timespec const* y) |
1889 | +{ |
1890 | + DeltaTime d_sec = (x->tv_sec - y->tv_sec); |
1891 | + DeltaTime d_nsec = (x->tv_nsec - y->tv_nsec); |
1892 | + return (d_sec * 1000) + (d_nsec / 1000000); |
1893 | +} |
1894 | +>>>>>>> MERGE-SOURCE |
1895 | |
1896 | } |
1897 | |
1898 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
1899 | --- plugins/unityshell/src/unityshell.cpp 2012-11-12 12:20:38 +0000 |
1900 | +++ plugins/unityshell/src/unityshell.cpp 2013-01-18 15:43:30 +0000 |
1901 | @@ -119,9 +119,14 @@ |
1902 | , allowWindowPaint(false) |
1903 | , _key_nav_mode_requested(false) |
1904 | , _last_output(nullptr) |
1905 | +<<<<<<< TREE |
1906 | #ifndef USE_GLES |
1907 | , _active_fbo (0) |
1908 | #endif |
1909 | +======= |
1910 | + , _active_fbo (0) |
1911 | + , dash_is_open_ (false) |
1912 | +>>>>>>> MERGE-SOURCE |
1913 | , grab_index_ (0) |
1914 | , painting_tray_ (false) |
1915 | , last_scroll_event_(0) |
1916 | @@ -247,6 +252,7 @@ |
1917 | uScreen = this; |
1918 | _in_paint = false; |
1919 | |
1920 | +<<<<<<< TREE |
1921 | #ifndef USE_GLES |
1922 | void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY); |
1923 | |
1924 | @@ -258,6 +264,18 @@ |
1925 | glXGetProcAddressP = NULL; |
1926 | } |
1927 | |
1928 | +======= |
1929 | + void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY); |
1930 | + |
1931 | + if (dlhand) |
1932 | + { |
1933 | + dlerror (); |
1934 | + glXGetProcAddressP = (ScreenEffectFramebufferObject::GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress"); |
1935 | + if (dlerror () != NULL) |
1936 | + glXGetProcAddressP = NULL; |
1937 | + } |
1938 | + |
1939 | +>>>>>>> MERGE-SOURCE |
1940 | if (GL::fbo) |
1941 | { |
1942 | nux::Geometry geometry (0, 0, screen->width (), screen->height ()); |
1943 | @@ -370,6 +388,7 @@ |
1944 | |
1945 | BackgroundEffectHelper::updates_enabled = true; |
1946 | |
1947 | +<<<<<<< TREE |
1948 | ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&](GVariant * data) |
1949 | { |
1950 | unity::glib::String overlay_identity; |
1951 | @@ -386,6 +405,14 @@ |
1952 | Display* display = gdk_x11_display_get_xdisplay(gdk_display_get_default());; |
1953 | XSelectInput(display, GDK_ROOT_WINDOW(), PropertyChangeMask); |
1954 | LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; |
1955 | +======= |
1956 | + ubus_manager_.RegisterInterest(UBUS_PLACE_VIEW_SHOWN, [&](GVariant * args) { |
1957 | + dash_is_open_ = true; |
1958 | + RaiseInputWindows(); |
1959 | + }); |
1960 | + ubus_manager_.RegisterInterest(UBUS_PLACE_VIEW_HIDDEN, [&](GVariant * args) { dash_is_open_ = false; }); |
1961 | + LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s"; |
1962 | +>>>>>>> MERGE-SOURCE |
1963 | } |
1964 | |
1965 | panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged)); |
1966 | @@ -521,8 +548,12 @@ |
1967 | |
1968 | void UnityScreen::nuxEpilogue() |
1969 | { |
1970 | +<<<<<<< TREE |
1971 | #ifndef USE_GLES |
1972 | (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo); |
1973 | +======= |
1974 | + (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo); |
1975 | +>>>>>>> MERGE-SOURCE |
1976 | |
1977 | glMatrixMode(GL_PROJECTION); |
1978 | glLoadIdentity(); |
1979 | @@ -581,6 +612,9 @@ |
1980 | float y1 = output->y() + panel_h; |
1981 | float x2 = x1 + output->width(); |
1982 | float y2 = y1 + h; |
1983 | + GLMatrix sTransform = GLMatrix (); |
1984 | + |
1985 | + sTransform.toScreenSpace(output, -DEFAULT_Z_CAMERA); |
1986 | |
1987 | glPushMatrix (); |
1988 | glLoadMatrixf (panel_shadow_matrix_.getMatrix ()); |
1989 | @@ -640,6 +674,7 @@ |
1990 | glDisable(GL_BLEND); |
1991 | } |
1992 | } |
1993 | +<<<<<<< TREE |
1994 | glPopMatrix(); |
1995 | #else |
1996 | #warning Panel shadow not properly implemented for GLES2 |
1997 | @@ -737,6 +772,8 @@ |
1998 | } |
1999 | nuxEpilogue(); |
2000 | #endif |
2001 | +======= |
2002 | +>>>>>>> MERGE-SOURCE |
2003 | } |
2004 | |
2005 | void |
2006 | @@ -764,6 +801,7 @@ |
2007 | #endif |
2008 | { |
2009 | CompOutput *output = _last_output; |
2010 | +<<<<<<< TREE |
2011 | |
2012 | #ifndef USE_GLES |
2013 | bool was_bound = _fbo->bound (); |
2014 | @@ -820,10 +858,34 @@ |
2015 | nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(), |
2016 | screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8); |
2017 | #else |
2018 | +======= |
2019 | + Window tray_xid = panelController->GetTrayXid (); |
2020 | + |
2021 | + bool was_bound = _fbo->bound (); |
2022 | + _fbo->unbind (); |
2023 | + |
2024 | + /* Draw the bit of the relevant framebuffer for each output */ |
2025 | + |
2026 | + if (was_bound) |
2027 | + { |
2028 | + GLMatrix sTransform; |
2029 | + sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA); |
2030 | + glPushMatrix (); |
2031 | + glLoadMatrixf (sTransform.getMatrix ()); |
2032 | + _fbo->paint (nux::Geometry (output->x (), output->y (), output->width (), output->height ())); |
2033 | + glPopMatrix (); |
2034 | + } |
2035 | + |
2036 | +>>>>>>> MERGE-SOURCE |
2037 | nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture = |
2038 | +<<<<<<< TREE |
2039 | nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (), |
2040 | output->width(), output->height(), 1, nux::BITFMT_R8G8B8A8); |
2041 | #endif |
2042 | +======= |
2043 | + nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(), |
2044 | + screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8); |
2045 | +>>>>>>> MERGE-SOURCE |
2046 | |
2047 | nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture; |
2048 | |
2049 | @@ -831,6 +893,7 @@ |
2050 | nux::Geometry oGeo = nux::Geometry (output->x (), output->y (), output->width (), output->height ()); |
2051 | BackgroundEffectHelper::monitor_rect_ = geo; |
2052 | |
2053 | +<<<<<<< TREE |
2054 | #ifdef USE_GLES |
2055 | GLint fboID; |
2056 | // Nux renders to the referenceFramebuffer when it's embedded. |
2057 | @@ -839,6 +902,9 @@ |
2058 | #endif |
2059 | |
2060 | nuxPrologue(); |
2061 | +======= |
2062 | + nuxPrologue(); |
2063 | +>>>>>>> MERGE-SOURCE |
2064 | _in_paint = true; |
2065 | wt->RenderInterfaceFromForeignCmd (&oGeo); |
2066 | _in_paint = false; |
2067 | @@ -1020,6 +1086,7 @@ |
2068 | |
2069 | void UnityScreen::leaveShowDesktopMode (CompWindow *w) |
2070 | { |
2071 | +<<<<<<< TREE |
2072 | /* Where a window is inhibiting, only allow the window |
2073 | * that is inhibiting the leave show desktop to actually |
2074 | * fade in again - all other windows should remain faded out */ |
2075 | @@ -1051,6 +1118,39 @@ |
2076 | } |
2077 | } |
2078 | } |
2079 | +======= |
2080 | + /* Where a window is inhibiting, only allow the window |
2081 | + * that is inhibiting the leave show desktop to actually |
2082 | + * fade in again - all other windows should remain faded out */ |
2083 | + if (!UnityShowdesktopHandler::inhibitingXid ()) |
2084 | + { |
2085 | + for (CompWindow *cw : screen->windows ()) |
2086 | + { |
2087 | + if (cw->inShowDesktopMode ()) |
2088 | + { |
2089 | + UnityWindow::get (cw)->leaveShowDesktop (); |
2090 | + // the animation plugin does strange things here ... |
2091 | + // if this notification is sent |
2092 | + //cw->windowNotify (CompWindowNotifyLeaveShowDesktopMode); |
2093 | + } |
2094 | + } |
2095 | + |
2096 | + PluginAdapter::Default()->OnLeaveDesktop(); |
2097 | + |
2098 | + screen->leaveShowDesktopMode (w); |
2099 | + } |
2100 | + else |
2101 | + { |
2102 | + CompWindow *cw = screen->findWindow (UnityShowdesktopHandler::inhibitingXid ()); |
2103 | + if (cw) |
2104 | + { |
2105 | + if (cw->inShowDesktopMode ()) |
2106 | + { |
2107 | + UnityWindow::get (cw)->leaveShowDesktop (); |
2108 | + } |
2109 | + } |
2110 | + } |
2111 | +>>>>>>> MERGE-SOURCE |
2112 | } |
2113 | |
2114 | void UnityWindow::enterShowDesktop () |
2115 | @@ -1072,6 +1172,7 @@ |
2116 | } |
2117 | } |
2118 | |
2119 | +<<<<<<< TREE |
2120 | void UnityWindow::activate () |
2121 | { |
2122 | ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ()); |
2123 | @@ -1172,7 +1273,19 @@ |
2124 | { |
2125 | ShowdesktopHandlerWindowInterface::PostPaintAction action = ShowdesktopHandlerWindowInterface::PostPaintAction::Wait; |
2126 | |
2127 | +======= |
2128 | +void UnityWindow::activate () |
2129 | +{ |
2130 | + UnityShowdesktopHandler::inhibitLeaveShowdesktopMode (window->id ()); |
2131 | + window->activate (); |
2132 | + UnityShowdesktopHandler::allowLeaveShowdesktopMode (window->id ()); |
2133 | +} |
2134 | + |
2135 | +bool UnityWindow::handleAnimations (unsigned int ms) |
2136 | +{ |
2137 | +>>>>>>> MERGE-SOURCE |
2138 | if (mShowdesktopHandler) |
2139 | +<<<<<<< TREE |
2140 | action = mShowdesktopHandler->Animate (ms); |
2141 | |
2142 | return action; |
2143 | @@ -1212,6 +1325,168 @@ |
2144 | { |
2145 | if (screen->XShape () && |
2146 | event->type == screen->shapeEvent () + ShapeNotify && |
2147 | +======= |
2148 | + if (mShowdesktopHandler->animate (ms)) |
2149 | + { |
2150 | + delete mShowdesktopHandler; |
2151 | + mShowdesktopHandler = NULL; |
2152 | + return true; |
2153 | + } |
2154 | + |
2155 | + return false; |
2156 | +} |
2157 | + |
2158 | +/* 300 ms */ |
2159 | +const unsigned int UnityShowdesktopHandler::fade_time = 300; |
2160 | +CompWindowList UnityShowdesktopHandler::animating_windows (0); |
2161 | + |
2162 | +bool UnityShowdesktopHandler::shouldHide (CompWindow *w) |
2163 | +{ |
2164 | + if (w->overrideRedirect ()) |
2165 | + return false; |
2166 | + |
2167 | + if (!w->managed ()) |
2168 | + return false; |
2169 | + |
2170 | + if (w->grabbed ()) |
2171 | + return false; |
2172 | + |
2173 | + if (w->wmType () & (CompWindowTypeDesktopMask | |
2174 | + CompWindowTypeDockMask)) |
2175 | + return false; |
2176 | + |
2177 | + if (w->state () & (CompWindowStateSkipPagerMask | |
2178 | + CompWindowStateSkipTaskbarMask)) |
2179 | + return false; |
2180 | + |
2181 | + if ((w->state () & CompWindowStateHiddenMask)) |
2182 | + if (!(w->inShowDesktopMode () || w->shaded ())) |
2183 | + return false; |
2184 | + |
2185 | + return true; |
2186 | +} |
2187 | + |
2188 | +guint32 UnityShowdesktopHandler::mInhibitingXid = 0; |
2189 | + |
2190 | +void |
2191 | +UnityShowdesktopHandler::inhibitLeaveShowdesktopMode (guint32 xid) |
2192 | +{ |
2193 | + if (!mInhibitingXid) |
2194 | + mInhibitingXid = xid; |
2195 | +} |
2196 | + |
2197 | +void |
2198 | +UnityShowdesktopHandler::allowLeaveShowdesktopMode (guint32 xid) |
2199 | +{ |
2200 | + if (mInhibitingXid == xid) |
2201 | + mInhibitingXid = 0; |
2202 | +} |
2203 | + |
2204 | +guint32 |
2205 | +UnityShowdesktopHandler::inhibitingXid () |
2206 | +{ |
2207 | + return mInhibitingXid; |
2208 | +} |
2209 | + |
2210 | +UnityShowdesktopHandler::UnityShowdesktopHandler (CompWindow *w) : |
2211 | + mWindow (w), |
2212 | + mRemover (new compiz::WindowInputRemover (screen->dpy (), w->id ())), |
2213 | + mState (Visible), |
2214 | + mProgress (0.0f) |
2215 | +{ |
2216 | +} |
2217 | + |
2218 | +UnityShowdesktopHandler::~UnityShowdesktopHandler () |
2219 | +{ |
2220 | + if (mRemover) |
2221 | + delete mRemover; |
2222 | +} |
2223 | + |
2224 | +void UnityShowdesktopHandler::fadeOut () |
2225 | +{ |
2226 | + mState = UnityShowdesktopHandler::FadeOut; |
2227 | + mProgress = 1.0f; |
2228 | + |
2229 | + mWasHidden = mWindow->state () & CompWindowStateHiddenMask; |
2230 | + |
2231 | + if (!mWasHidden) |
2232 | + { |
2233 | + mWindow->changeState (mWindow->state () | CompWindowStateHiddenMask); |
2234 | + mWindow->windowNotify (CompWindowNotifyHide); |
2235 | + mRemover->save (); |
2236 | + mRemover->remove (); |
2237 | + } |
2238 | + |
2239 | + CompositeWindow::get (mWindow)->addDamage (); |
2240 | + |
2241 | + if (std::find (animating_windows.begin(), |
2242 | + animating_windows.end(), |
2243 | + mWindow) == animating_windows.end()) |
2244 | + animating_windows.push_back(mWindow); |
2245 | +} |
2246 | + |
2247 | +void UnityShowdesktopHandler::fadeIn () |
2248 | +{ |
2249 | + mState = UnityShowdesktopHandler::FadeIn; |
2250 | + |
2251 | + if (!mWasHidden) |
2252 | + { |
2253 | + mWindow->changeState (mWindow->state () & ~CompWindowStateHiddenMask); |
2254 | + mWindow->windowNotify (CompWindowNotifyShow); |
2255 | + mRemover->restore (); |
2256 | + } |
2257 | + |
2258 | + CompositeWindow::get (mWindow)->addDamage (); |
2259 | +} |
2260 | + |
2261 | +bool UnityShowdesktopHandler::animate (unsigned int ms) |
2262 | +{ |
2263 | + float inc = fade_time / (float) ms; |
2264 | + |
2265 | + if (mState == UnityShowdesktopHandler::FadeOut) |
2266 | + { |
2267 | + mProgress -= inc; |
2268 | + if (mProgress <= 0.0f) |
2269 | + { |
2270 | + mProgress = 0.0f; |
2271 | + mState = Invisible; |
2272 | + } |
2273 | + else |
2274 | + CompositeWindow::get (mWindow)->addDamage (); |
2275 | + } |
2276 | + else if (mState == FadeIn) |
2277 | + { |
2278 | + mProgress += inc; |
2279 | + if (mProgress >= 1.0f) |
2280 | + { |
2281 | + mProgress = 1.0f; |
2282 | + mState = Visible; |
2283 | + |
2284 | + return true; |
2285 | + } |
2286 | + else |
2287 | + CompositeWindow::get (mWindow)->addDamage (); |
2288 | + } |
2289 | + |
2290 | + return false; |
2291 | +} |
2292 | + |
2293 | +void UnityShowdesktopHandler::paintAttrib (GLWindowPaintAttrib &attrib) |
2294 | +{ |
2295 | + attrib.opacity = static_cast <int> (static_cast <float> (attrib.opacity) * mProgress); |
2296 | +} |
2297 | + |
2298 | +unsigned int UnityShowdesktopHandler::getPaintMask () |
2299 | +{ |
2300 | + return 0; |
2301 | +} |
2302 | + |
2303 | +void UnityShowdesktopHandler::handleEvent (XEvent *event) |
2304 | +{ |
2305 | + /* Ignore sent events from the InputRemover */ |
2306 | + if (screen->XShape () && event->type == |
2307 | + screen->shapeEvent () + ShapeNotify && |
2308 | +>>>>>>> MERGE-SOURCE |
2309 | !event->xany.send_event) |
2310 | { |
2311 | if (mShowdesktopHandler) |
2312 | @@ -1264,6 +1539,7 @@ |
2313 | { |
2314 | bool ret; |
2315 | |
2316 | +<<<<<<< TREE |
2317 | /* |
2318 | * Very important! |
2319 | * Don't waste GPU and CPU rendering the shell on every frame if you don't |
2320 | @@ -1283,6 +1559,12 @@ |
2321 | paint_panel_ = false; |
2322 | |
2323 | #ifndef USE_GLES |
2324 | +======= |
2325 | + doShellRepaint = true; |
2326 | + allowWindowPaint = true; |
2327 | + _last_output = output; |
2328 | + |
2329 | +>>>>>>> MERGE-SOURCE |
2330 | /* bind the framebuffer here |
2331 | * - it will be unbound and flushed |
2332 | * to the backbuffer when some |
2333 | @@ -1292,6 +1574,7 @@ |
2334 | * once an fbo is bound any further |
2335 | * attempts to bind it will only increment |
2336 | * its bind reference so make sure that |
2337 | +<<<<<<< TREE |
2338 | * you always unbind as much as you bind |
2339 | * |
2340 | * But NOTE: It is only safe to bind the FBO if !shellCouldBeHidden. |
2341 | @@ -1305,6 +1588,10 @@ |
2342 | // CompRegion has no clear() method. So this is the fastest alternative. |
2343 | fullscreenRegion = CompRegion(); |
2344 | nuxRegion = CompRegion(); |
2345 | +======= |
2346 | + * you always unbind as much as you bind */ |
2347 | + _fbo->bind (nux::Geometry (output->x (), output->y (), output->width (), output->height ())); |
2348 | +>>>>>>> MERGE-SOURCE |
2349 | |
2350 | /* glPaintOutput is part of the opengl plugin, so we need the GLScreen base class. */ |
2351 | ret = gScreen->glPaintOutput(attrib, transform, region, output, mask); |
2352 | @@ -1698,12 +1985,53 @@ |
2353 | { |
2354 | wt->ProcessForeignEvent(event, NULL); |
2355 | } |
2356 | +<<<<<<< TREE |
2357 | } |
2358 | |
2359 | void UnityScreen::damageRegion(const CompRegion ®ion) |
2360 | { |
2361 | compizDamageNux(region); |
2362 | cScreen->damageRegion(region); |
2363 | +======= |
2364 | + |
2365 | + if (event->type == cScreen->damageEvent() + XDamageNotify) |
2366 | + { |
2367 | + XDamageNotifyEvent *de = (XDamageNotifyEvent *) event; |
2368 | + CompWindow* w = screen->findWindow (de->drawable); |
2369 | + std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); |
2370 | + CompWindow* lastNWindow = screen->findWindow (xwns.back ()); |
2371 | + bool processDamage = true; |
2372 | + |
2373 | + if (w) |
2374 | + { |
2375 | + if (!w->overrideRedirect () && |
2376 | + w->isViewable () && |
2377 | + !w->invisible ()) |
2378 | + { |
2379 | + |
2380 | + for (; lastNWindow != NULL; lastNWindow = lastNWindow->next) |
2381 | + { |
2382 | + if (lastNWindow == w) |
2383 | + { |
2384 | + processDamage = false; |
2385 | + break; |
2386 | + } |
2387 | + } |
2388 | + |
2389 | + if (processDamage) |
2390 | + { |
2391 | + nux::Geometry damage (de->area.x, de->area.y, de->area.width, de->area.height); |
2392 | + |
2393 | + const CompWindow::Geometry &geom = w->geometry (); |
2394 | + damage.x += geom.x () + geom.border (); |
2395 | + damage.y += geom.y () + geom.border (); |
2396 | + |
2397 | + BackgroundEffectHelper::ProcessDamage(damage); |
2398 | + } |
2399 | + } |
2400 | + } |
2401 | + } |
2402 | +>>>>>>> MERGE-SOURCE |
2403 | } |
2404 | |
2405 | void UnityScreen::handleCompizEvent(const char* plugin, |
2406 | @@ -1908,6 +2236,7 @@ |
2407 | |
2408 | // maybe check launcher position/hide state? |
2409 | |
2410 | +<<<<<<< TREE |
2411 | WindowManager *wm = WindowManager::Default(); |
2412 | int monitor = wm->GetWindowMonitor(wm->GetActiveWindow()); |
2413 | nux::Geometry monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor); |
2414 | @@ -1932,6 +2261,15 @@ |
2415 | if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP)) |
2416 | switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results); |
2417 | |
2418 | +======= |
2419 | + int device = screen->outputDeviceForPoint (pointerX, pointerY); |
2420 | + switcherController->SetWorkspace(nux::Geometry(screen->outputDevs()[device].x1() + 100, |
2421 | + screen->outputDevs()[device].y1() + 100, |
2422 | + screen->outputDevs()[device].width() - 200, |
2423 | + screen->outputDevs()[device].height() - 200)); |
2424 | + switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results); |
2425 | + RaiseInputWindows(); |
2426 | +>>>>>>> MERGE-SOURCE |
2427 | return true; |
2428 | } |
2429 | |
2430 | @@ -2374,6 +2712,18 @@ |
2431 | } |
2432 | } |
2433 | |
2434 | +void UnityScreen::RaiseInputWindows() |
2435 | +{ |
2436 | + std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); |
2437 | + |
2438 | + for (auto window : xwns) |
2439 | + { |
2440 | + CompWindow* cwin = screen->findWindow(window); |
2441 | + if (cwin) |
2442 | + cwin->raise(); |
2443 | + } |
2444 | +} |
2445 | + |
2446 | /* detect occlusions |
2447 | * |
2448 | * core passes down the PAINT_WINDOW_OCCLUSION_DETECTION |
2449 | @@ -2958,7 +3308,14 @@ |
2450 | |
2451 | void UnityScreen::Relayout() |
2452 | { |
2453 | - nux::Geometry geometry (0, 0, screen->width (), screen->height ()); |
2454 | +<<<<<<< TREE |
2455 | + nux::Geometry geometry (0, 0, screen->width (), screen->height ()); |
2456 | +======= |
2457 | + GdkRectangle rect; |
2458 | + nux::Geometry lCurGeom; |
2459 | + int panel_height = 24; |
2460 | + nux::Geometry geometry (0, 0, screen->width (), screen->height ()); |
2461 | +>>>>>>> MERGE-SOURCE |
2462 | |
2463 | if (!needsRelayout) |
2464 | return; |
2465 | @@ -2966,8 +3323,13 @@ |
2466 | #ifndef USE_GLES |
2467 | if (GL::fbo) |
2468 | { |
2469 | +<<<<<<< TREE |
2470 | uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry)); |
2471 | uScreen->_fbo->onScreenSizeChanged (geometry); |
2472 | +======= |
2473 | + uScreen->_fbo.reset (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry)); |
2474 | + uScreen->_fbo->onScreenSizeChanged (geometry); |
2475 | +>>>>>>> MERGE-SOURCE |
2476 | } |
2477 | #endif |
2478 | |
2479 | |
2480 | === modified file 'plugins/unityshell/src/unityshell.h' |
2481 | --- plugins/unityshell/src/unityshell.h 2012-09-11 10:38:44 +0000 |
2482 | +++ plugins/unityshell/src/unityshell.h 2013-01-18 15:43:30 +0000 |
2483 | @@ -50,13 +50,71 @@ |
2484 | #include "DebugDBusInterface.h" |
2485 | #include "SwitcherController.h" |
2486 | #include "UBusWrapper.h" |
2487 | +<<<<<<< TREE |
2488 | #include "UnityshellPrivate.h" |
2489 | #include "UnityShowdesktopHandler.h" |
2490 | #ifndef USE_GLES |
2491 | #include "ScreenEffectFramebufferObject.h" |
2492 | #endif |
2493 | +======= |
2494 | +#include <Nux/WindowThread.h> |
2495 | +#include <sigc++/sigc++.h> |
2496 | +#include <boost/shared_ptr.hpp> |
2497 | +#include "ScreenEffectFramebufferObject.h" |
2498 | +>>>>>>> MERGE-SOURCE |
2499 | |
2500 | #include "compizminimizedwindowhandler.h" |
2501 | +<<<<<<< TREE |
2502 | +======= |
2503 | +#include <dlfcn.h> |
2504 | + |
2505 | +class UnityShowdesktopHandler |
2506 | +{ |
2507 | + public: |
2508 | + |
2509 | + UnityShowdesktopHandler (CompWindow *w); |
2510 | + ~UnityShowdesktopHandler (); |
2511 | + |
2512 | + typedef enum { |
2513 | + Visible = 0, |
2514 | + FadeOut = 1, |
2515 | + FadeIn = 2, |
2516 | + Invisible = 3 |
2517 | + } State; |
2518 | + |
2519 | +public: |
2520 | + |
2521 | + void fadeOut (); |
2522 | + void fadeIn (); |
2523 | + bool animate (unsigned int ms); |
2524 | + void paintAttrib (GLWindowPaintAttrib &attrib); |
2525 | + unsigned int getPaintMask (); |
2526 | + void handleEvent (XEvent *); |
2527 | + void windowNotify (CompWindowNotify n); |
2528 | + void updateFrameRegion (CompRegion &r); |
2529 | + |
2530 | + UnityShowdesktopHandler::State state (); |
2531 | + |
2532 | + static const unsigned int fade_time; |
2533 | + static CompWindowList animating_windows; |
2534 | + static bool shouldHide (CompWindow *); |
2535 | + static void inhibitLeaveShowdesktopMode (guint32 xid); |
2536 | + static void allowLeaveShowdesktopMode (guint32 xid); |
2537 | + static guint32 inhibitingXid (); |
2538 | + |
2539 | +private: |
2540 | + |
2541 | + CompWindow *mWindow; |
2542 | + compiz::WindowInputRemover *mRemover; |
2543 | + UnityShowdesktopHandler::State mState; |
2544 | + float mProgress; |
2545 | + bool mWasHidden; |
2546 | + static guint32 mInhibitingXid; |
2547 | +}; |
2548 | + |
2549 | + |
2550 | + |
2551 | +>>>>>>> MERGE-SOURCE |
2552 | #include "BGHash.h" |
2553 | #include <compiztoolbox/compiztoolbox.h> |
2554 | #include <dlfcn.h> |
2555 | @@ -106,6 +164,8 @@ |
2556 | |
2557 | void RaiseInputWindows(); |
2558 | |
2559 | + void RaiseInputWindows(); |
2560 | + |
2561 | void |
2562 | handleCompizEvent (const char *pluginName, |
2563 | const char *eventName, |
2564 | @@ -286,6 +346,7 @@ |
2565 | bool allowWindowPaint; |
2566 | bool _key_nav_mode_requested; |
2567 | CompOutput* _last_output; |
2568 | +<<<<<<< TREE |
2569 | |
2570 | CompRegion nuxRegion; |
2571 | CompRegion fullscreenRegion; |
2572 | @@ -301,6 +362,18 @@ |
2573 | ScreenEffectFramebufferObject::Ptr _fbo; |
2574 | GLuint _active_fbo; |
2575 | #endif |
2576 | +======= |
2577 | + CompWindowList _withRemovedNuxWindows; |
2578 | + |
2579 | + DesktopLauncherIcon* switcher_desktop_icon; |
2580 | + |
2581 | + GdkRectangle _primary_monitor; |
2582 | + |
2583 | + unity::BGHash _bghash; |
2584 | + |
2585 | + ScreenEffectFramebufferObject::Ptr _fbo; |
2586 | + GLuint _active_fbo; |
2587 | +>>>>>>> MERGE-SOURCE |
2588 | |
2589 | bool queryForShader (); |
2590 | |
2591 | @@ -326,6 +399,8 @@ |
2592 | ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP; |
2593 | #endif |
2594 | |
2595 | + ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP; |
2596 | + |
2597 | friend class UnityWindow; |
2598 | }; |
2599 | |
2600 | |
2601 | === modified file 'tests/CMakeLists.txt' |
2602 | --- tests/CMakeLists.txt 2012-11-12 12:20:38 +0000 |
2603 | +++ tests/CMakeLists.txt 2013-01-18 15:43:30 +0000 |
2604 | @@ -74,6 +74,445 @@ |
2605 | ) |
2606 | target_link_libraries (test-unit ${LIBS}) |
2607 | add_dependencies (test-unit unity-core-${UNITY_API_VERSION}) |
2608 | +<<<<<<< TREE |
2609 | +======= |
2610 | + |
2611 | +# |
2612 | +# Standalone tests |
2613 | +# |
2614 | +add_executable (standalone-dash |
2615 | + standalone_dash.cpp |
2616 | + ${UNITY_SRC}/BackgroundEffectHelper.cpp |
2617 | + ${UNITY_SRC}/BackgroundEffectHelper.h |
2618 | + ${UNITY_SRC}/BGHash.cpp |
2619 | + ${UNITY_SRC}/BGHash.h |
2620 | + ${UNITY_SRC}/DashSearchBar.cpp |
2621 | + ${UNITY_SRC}/DashSearchBar.h |
2622 | + ${UNITY_SRC}/DashSearchBarSpinner.cpp |
2623 | + ${UNITY_SRC}/DashSearchBarSpinner.h |
2624 | + ${UNITY_SRC}/FilterExpanderLabel.cpp |
2625 | + ${UNITY_SRC}/FilterFactory.cpp |
2626 | + ${UNITY_SRC}/FilterBasicButton.cpp |
2627 | + ${UNITY_SRC}/FilterRatingsButton.cpp |
2628 | + ${UNITY_SRC}/FilterRatingsWidget.cpp |
2629 | + ${UNITY_SRC}/FilterMultiRangeWidget.cpp |
2630 | + ${UNITY_SRC}/FilterMultiRangeButton.cpp |
2631 | + ${UNITY_SRC}/FilterGenreButton.cpp |
2632 | + ${UNITY_SRC}/FilterGenreWidget.cpp |
2633 | + ${UNITY_SRC}/FilterBar.cpp |
2634 | + ${UNITY_SRC}/FontSettings.cpp |
2635 | + ${UNITY_SRC}/FontSettings.h |
2636 | + ${UNITY_SRC}/IMTextEntry.cpp |
2637 | + ${UNITY_SRC}/IMTextEntry.h |
2638 | + ${UNITY_SRC}/PlacesHomeView.cpp |
2639 | + ${UNITY_SRC}/PlacesHomeView.h |
2640 | + ${UNITY_SRC}/PlacesGroup.cpp |
2641 | + ${UNITY_SRC}/PlacesGroup.h |
2642 | + ${UNITY_SRC}/DashSettings.cpp |
2643 | + ${UNITY_SRC}/DashSettings.h |
2644 | + ${UNITY_SRC}/PlacesStyle.cpp |
2645 | + ${UNITY_SRC}/PlacesStyle.h |
2646 | + ${UNITY_SRC}/PlacesTile.cpp |
2647 | + ${UNITY_SRC}/PlacesTile.h |
2648 | + ${UNITY_SRC}/PlacesSimpleTile.cpp |
2649 | + ${UNITY_SRC}/PlacesSimpleTile.h |
2650 | + ${UNITY_SRC}/PlacesVScrollBar.cpp |
2651 | + ${UNITY_SRC}/PlacesVScrollBar.h |
2652 | + ${UNITY_SRC}/DashView.cpp |
2653 | + ${UNITY_SRC}/DashView.h |
2654 | + ${UNITY_SRC}/HomeView.cpp |
2655 | + ${UNITY_SRC}/HomeView.h |
2656 | + ${UNITY_SRC}/DashStyle.cpp |
2657 | + ${UNITY_SRC}/IconLoader.cpp |
2658 | + ${UNITY_SRC}/IconLoader.h |
2659 | + ${UNITY_SRC}/IconTexture.cpp |
2660 | + ${UNITY_SRC}/IconTexture.h |
2661 | + ${UNITY_SRC}/Introspectable.cpp |
2662 | + ${UNITY_SRC}/Introspectable.h |
2663 | + ${UNITY_SRC}/JSONParser.cpp |
2664 | + ${UNITY_SRC}/LensBar.cpp |
2665 | + ${UNITY_SRC}/LensBar.h |
2666 | + ${UNITY_SRC}/LensBarIcon.cpp |
2667 | + ${UNITY_SRC}/LensBarIcon.h |
2668 | + ${UNITY_SRC}/LensView.cpp |
2669 | + ${UNITY_SRC}/LensView.h |
2670 | + ${UNITY_SRC}/PreviewApplications.cpp |
2671 | + ${UNITY_SRC}/PreviewBase.cpp |
2672 | + ${UNITY_SRC}/PreviewBasicButton.cpp |
2673 | + ${UNITY_SRC}/ResultView.cpp |
2674 | + ${UNITY_SRC}/ResultViewGrid.cpp |
2675 | + ${UNITY_SRC}/ResultRenderer.cpp |
2676 | + ${UNITY_SRC}/ResultRendererTile.cpp |
2677 | + ${UNITY_SRC}/ResultRendererHorizontalTile.cpp |
2678 | + ${UNITY_SRC}/TextureCache.h |
2679 | + ${UNITY_SRC}/TextureCache.cpp |
2680 | + ${UNITY_SRC}/Timer.cpp |
2681 | + ${UNITY_SRC}/Timer.h |
2682 | + ${UNITY_SRC}/StaticCairoText.cpp |
2683 | + ${UNITY_SRC}/StaticCairoText.h |
2684 | + ${UNITY_SRC}/UBusMessages.h |
2685 | + ${UNITY_SRC}/UBusWrapper.cpp |
2686 | + ${UNITY_SRC}/UBusWrapper.h |
2687 | + ${UNITY_SRC}/ubus-server.cpp |
2688 | + ${UNITY_SRC}/ubus-server.h |
2689 | + ${UNITY_SRC}/UScreen.cpp |
2690 | + ${UNITY_SRC}/UScreen.h |
2691 | + ) |
2692 | +add_dependencies (standalone-dash unity-core-${UNITY_API_VERSION}) |
2693 | + |
2694 | + |
2695 | +# |
2696 | +# Please use "standalone-$foo" naming convention for standalone tests |
2697 | +# |
2698 | +add_executable (test-panel |
2699 | + TestPanel.cpp |
2700 | + ${UNITY_SRC}/Animator.cpp |
2701 | + ${UNITY_SRC}/Animator.h |
2702 | + ${UNITY_SRC}/BackgroundEffectHelper.cpp |
2703 | + ${UNITY_SRC}/BackgroundEffectHelper.h |
2704 | + ${UNITY_SRC}/DashSettings.cpp |
2705 | + ${UNITY_SRC}/DashSettings.h |
2706 | + ${UNITY_SRC}/PanelStyle.cpp |
2707 | + ${UNITY_SRC}/PanelStyle.h |
2708 | + ${UNITY_SRC}/PanelView.cpp |
2709 | + ${UNITY_SRC}/PanelView.h |
2710 | + ${UNITY_SRC}/PanelIndicatorsView.cpp |
2711 | + ${UNITY_SRC}/PanelIndicatorsView.h |
2712 | + ${UNITY_SRC}/PanelIndicatorEntryView.cpp |
2713 | + ${UNITY_SRC}/PanelIndicatorEntryView.h |
2714 | + ${UNITY_SRC}/PanelTitlebarGrabAreaView.h |
2715 | + ${UNITY_SRC}/PanelTitlebarGrabAreaView.cpp |
2716 | + ${UNITY_SRC}/PanelTray.cpp |
2717 | + ${UNITY_SRC}/PanelTray.h |
2718 | + ${UNITY_SRC}/Introspectable.cpp |
2719 | + ${UNITY_SRC}/Introspectable.h |
2720 | + ${UNITY_SRC}/PanelMenuView.cpp |
2721 | + ${UNITY_SRC}/PanelMenuView.h |
2722 | + ${UNITY_SRC}/Timer.cpp |
2723 | + ${UNITY_SRC}/Timer.h |
2724 | + ${UNITY_SRC}/StaticCairoText.cpp |
2725 | + ${UNITY_SRC}/StaticCairoText.h |
2726 | + ${UNITY_SRC}/WindowButtons.cpp |
2727 | + ${UNITY_SRC}/WindowButtons.h |
2728 | + ${UNITY_SRC}/WindowManager.cpp |
2729 | + ${UNITY_SRC}/WindowManager.h |
2730 | + ${UNITY_SRC}/UScreen.cpp |
2731 | + ${UNITY_SRC}/UScreen.h |
2732 | + ${UNITY_SRC}/ubus-server.cpp |
2733 | + ${UNITY_SRC}/ubus-server.h |
2734 | + ) |
2735 | +add_dependencies (test-panel unity-core-${UNITY_API_VERSION}) |
2736 | + |
2737 | +add_executable (test-switcher |
2738 | + TestSwitcher.cpp |
2739 | + ${UNITY_SRC}/AbstractLauncherIcon.h |
2740 | + ${UNITY_SRC}/AbstractIconRenderer.h |
2741 | + ${UNITY_SRC}/SwitcherController.cpp |
2742 | + ${UNITY_SRC}/SwitcherController.h |
2743 | + ${UNITY_SRC}/SwitcherModel.cpp |
2744 | + ${UNITY_SRC}/SwitcherModel.h |
2745 | + ${UNITY_SRC}/SwitcherView.cpp |
2746 | + ${UNITY_SRC}/SwitcherView.h |
2747 | + ${UNITY_SRC}/LayoutSystem.h |
2748 | + ${UNITY_SRC}/LayoutSystem.cpp |
2749 | + ${UNITY_SRC}/WindowManager.h |
2750 | + ${UNITY_SRC}/WindowManager.cpp |
2751 | + ${UNITY_SRC}/IconRenderer.cpp |
2752 | + ${UNITY_SRC}/IconRenderer.h |
2753 | + ${UNITY_SRC}/MockLauncherIcon.h |
2754 | + ${UNITY_SRC}/BackgroundEffectHelper.h |
2755 | + ${UNITY_SRC}/BackgroundEffectHelper.cpp |
2756 | + ${UNITY_SRC}/StaticCairoText.cpp |
2757 | + ${UNITY_SRC}/StaticCairoText.h |
2758 | + ${UNITY_SRC}/UBusMessages.h |
2759 | + ${UNITY_SRC}/ubus-server.cpp |
2760 | + ${UNITY_SRC}/ubus-server.h |
2761 | + ) |
2762 | +add_dependencies (test-switcher unity-core-${UNITY_API_VERSION}) |
2763 | + |
2764 | +add_executable (test-launcher |
2765 | + TestLauncher.cpp |
2766 | + ${UNITY_SRC}/AbstractLauncherIcon.h |
2767 | + ${UNITY_SRC}/AbstractIconRenderer.h |
2768 | + ${UNITY_SRC}/LauncherIcon.cpp |
2769 | + ${UNITY_SRC}/LauncherIcon.h |
2770 | + ${UNITY_SRC}/SimpleLauncherIcon.cpp |
2771 | + ${UNITY_SRC}/SimpleLauncherIcon.h |
2772 | + ${UNITY_SRC}/BamfLauncherIcon.cpp |
2773 | + ${UNITY_SRC}/BamfLauncherIcon.h |
2774 | + ${UNITY_SRC}/BFBLauncherIcon.cpp |
2775 | + ${UNITY_SRC}/BFBLauncherIcon.h |
2776 | + ${UNITY_SRC}/SpacerLauncherIcon.cpp |
2777 | + ${UNITY_SRC}/SpacerLauncherIcon.h |
2778 | + ${UNITY_SRC}/DndData.cpp |
2779 | + ${UNITY_SRC}/DndData.h |
2780 | + ${UNITY_SRC}/TrashLauncherIcon.cpp |
2781 | + ${UNITY_SRC}/TrashLauncherIcon.h |
2782 | + ${UNITY_SRC}/DNDCollectionWindow.cpp |
2783 | + ${UNITY_SRC}/DNDCollectionWindow.h |
2784 | + ${UNITY_SRC}/DeviceLauncherIcon.cpp |
2785 | + ${UNITY_SRC}/DeviceLauncherIcon.h |
2786 | + ${UNITY_SRC}/DeviceLauncherSection.cpp |
2787 | + ${UNITY_SRC}/DeviceLauncherSection.h |
2788 | + ${UNITY_SRC}/DevicesSettings.cpp |
2789 | + ${UNITY_SRC}/DevicesSettings.h |
2790 | + ${UNITY_SRC}/FavoriteStore.cpp |
2791 | + ${UNITY_SRC}/FavoriteStore.h |
2792 | + ${UNITY_SRC}/FavoriteStoreGSettings.cpp |
2793 | + ${UNITY_SRC}/FavoriteStoreGSettings.h |
2794 | + ${UNITY_SRC}/LauncherEntryRemoteModel.cpp |
2795 | + ${UNITY_SRC}/LauncherEntryRemoteModel.h |
2796 | + ${UNITY_SRC}/LauncherEntryRemote.cpp |
2797 | + ${UNITY_SRC}/LauncherEntryRemote.h |
2798 | + ${UNITY_SRC}/LauncherController.cpp |
2799 | + ${UNITY_SRC}/LauncherController.h |
2800 | + ${UNITY_SRC}/LauncherModel.cpp |
2801 | + ${UNITY_SRC}/LauncherModel.h |
2802 | + ${UNITY_SRC}/Launcher.cpp |
2803 | + ${UNITY_SRC}/Launcher.h |
2804 | + ${UNITY_SRC}/LauncherHideMachine.cpp |
2805 | + ${UNITY_SRC}/LauncherHideMachine.h |
2806 | + ${UNITY_SRC}/LauncherHoverMachine.cpp |
2807 | + ${UNITY_SRC}/LauncherHoverMachine.h |
2808 | + ${UNITY_SRC}/LauncherDragWindow.cpp |
2809 | + ${UNITY_SRC}/LauncherDragWindow.h |
2810 | + ${UNITY_SRC}/GeisAdapter.cpp |
2811 | + ${UNITY_SRC}/GeisAdapter.h |
2812 | + ${UNITY_SRC}/WindowManager.h |
2813 | + ${UNITY_SRC}/WindowManager.cpp |
2814 | + ${UNITY_SRC}/IconRenderer.cpp |
2815 | + ${UNITY_SRC}/IconRenderer.h |
2816 | + ${UNITY_SRC}/Tooltip.cpp |
2817 | + ${UNITY_SRC}/Tooltip.h |
2818 | + ${UNITY_SRC}/BackgroundEffectHelper.h |
2819 | + ${UNITY_SRC}/BackgroundEffectHelper.cpp |
2820 | + ${UNITY_SRC}/StaticCairoText.cpp |
2821 | + ${UNITY_SRC}/StaticCairoText.h |
2822 | + ${UNITY_SRC}/Introspectable.cpp |
2823 | + ${UNITY_SRC}/Introspectable.h |
2824 | + ${UNITY_SRC}/QuicklistMenuItem.cpp |
2825 | + ${UNITY_SRC}/QuicklistMenuItem.h |
2826 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp |
2827 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.h |
2828 | + ${UNITY_SRC}/QuicklistMenuItemLabel.cpp |
2829 | + ${UNITY_SRC}/QuicklistMenuItemLabel.h |
2830 | + ${UNITY_SRC}/QuicklistMenuItemRadio.cpp |
2831 | + ${UNITY_SRC}/QuicklistMenuItemRadio.h |
2832 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp |
2833 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.h |
2834 | + ${UNITY_SRC}/QuicklistView.cpp |
2835 | + ${UNITY_SRC}/QuicklistView.h |
2836 | + ${UNITY_SRC}/QuicklistManager.cpp |
2837 | + ${UNITY_SRC}/QuicklistManager.h |
2838 | + ${UNITY_SRC}/UBusMessages.h |
2839 | + ${UNITY_SRC}/UBusWrapper.cpp |
2840 | + ${UNITY_SRC}/UBusWrapper.h |
2841 | + ${UNITY_SRC}/ubus-server.cpp |
2842 | + ${UNITY_SRC}/ubus-server.h |
2843 | + ) |
2844 | +add_dependencies (test-launcher unity-core-${UNITY_API_VERSION}) |
2845 | + |
2846 | +add_executable (test-keyutil |
2847 | + TestKeyboardUtil.cpp |
2848 | + ${UNITY_SRC}/KeyboardUtil.h |
2849 | + ${UNITY_SRC}/KeyboardUtil.cpp |
2850 | + ) |
2851 | +add_dependencies (test-keyutil unity-core-${UNITY_API_VERSION}) |
2852 | + |
2853 | +add_executable (test-quicklist |
2854 | + ui/TestQuicklist.cpp |
2855 | + ui/EventFaker.cpp |
2856 | + ui/EventFaker.h |
2857 | + ${UNITY_SRC}/Introspectable.cpp |
2858 | + ${UNITY_SRC}/Introspectable.h |
2859 | + ${UNITY_SRC}/QuicklistMenuItem.cpp |
2860 | + ${UNITY_SRC}/QuicklistMenuItem.h |
2861 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp |
2862 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.h |
2863 | + ${UNITY_SRC}/QuicklistMenuItemLabel.cpp |
2864 | + ${UNITY_SRC}/QuicklistMenuItemLabel.h |
2865 | + ${UNITY_SRC}/QuicklistMenuItemRadio.cpp |
2866 | + ${UNITY_SRC}/QuicklistMenuItemRadio.h |
2867 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp |
2868 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.h |
2869 | + ${UNITY_SRC}/QuicklistView.cpp |
2870 | + ${UNITY_SRC}/QuicklistView.h |
2871 | + ${UNITY_SRC}/ubus-server.cpp |
2872 | + ${UNITY_SRC}/ubus-server.h |
2873 | + ) |
2874 | +add_dependencies (test-quicklist unity-core-${UNITY_API_VERSION}) |
2875 | + |
2876 | +add_executable (test-quicklist-visuals |
2877 | + ui/TestQuicklistVisuals.cpp |
2878 | + ui/EventFaker.cpp |
2879 | + ui/EventFaker.h |
2880 | + ${UNITY_SRC}/Introspectable.cpp |
2881 | + ${UNITY_SRC}/Introspectable.h |
2882 | + ${UNITY_SRC}/QuicklistMenuItem.cpp |
2883 | + ${UNITY_SRC}/QuicklistMenuItem.h |
2884 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp |
2885 | + ${UNITY_SRC}/QuicklistMenuItemCheckmark.h |
2886 | + ${UNITY_SRC}/QuicklistMenuItemLabel.cpp |
2887 | + ${UNITY_SRC}/QuicklistMenuItemLabel.h |
2888 | + ${UNITY_SRC}/QuicklistMenuItemRadio.cpp |
2889 | + ${UNITY_SRC}/QuicklistMenuItemRadio.h |
2890 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp |
2891 | + ${UNITY_SRC}/QuicklistMenuItemSeparator.h |
2892 | + ${UNITY_SRC}/QuicklistView.cpp |
2893 | + ${UNITY_SRC}/QuicklistView.h |
2894 | + ${UNITY_SRC}/ubus-server.cpp |
2895 | + ${UNITY_SRC}/ubus-server.h |
2896 | + ) |
2897 | +add_dependencies (test-quicklist-visuals unity-core-${UNITY_API_VERSION}) |
2898 | + |
2899 | +add_executable (test-filters |
2900 | + TestFilters.cpp |
2901 | + ${UNITY_SRC}/FilterExpanderLabel.cpp |
2902 | + ${UNITY_SRC}/FilterBasicButton.cpp |
2903 | + ${UNITY_SRC}/FilterRatingsButton.cpp |
2904 | + ${UNITY_SRC}/FilterRatingsWidget.cpp |
2905 | + ${UNITY_SRC}/FilterGenreButton.cpp |
2906 | + ${UNITY_SRC}/FilterGenreWidget.cpp |
2907 | + ${UNITY_SRC}/FilterMultiRangeButton.cpp |
2908 | + ${UNITY_SRC}/FilterMultiRangeWidget.cpp |
2909 | + ${UNITY_SRC}/DashStyle.cpp |
2910 | + ${UNITY_SRC}/JSONParser.cpp |
2911 | + ${UNITY_SRC}/PlacesStyle.cpp |
2912 | + ${UNITY_SRC}/PlacesStyle.h |
2913 | + ) |
2914 | +add_dependencies(test-filters unity-core-${UNITY_API_VERSION}) |
2915 | + |
2916 | +add_executable (test-filter-bar |
2917 | + TestFilterBar.cpp |
2918 | + ${UNITY_SRC}/FilterExpanderLabel.cpp |
2919 | + ${UNITY_SRC}/FilterFactory.cpp |
2920 | + ${UNITY_SRC}/FilterBasicButton.cpp |
2921 | + ${UNITY_SRC}/FilterRatingsButton.cpp |
2922 | + ${UNITY_SRC}/FilterRatingsWidget.cpp |
2923 | + ${UNITY_SRC}/FilterMultiRangeWidget.cpp |
2924 | + ${UNITY_SRC}/FilterMultiRangeButton.cpp |
2925 | + ${UNITY_SRC}/FilterGenreButton.cpp |
2926 | + ${UNITY_SRC}/FilterGenreWidget.cpp |
2927 | + ${UNITY_SRC}/FilterBar.cpp |
2928 | + ${UNITY_SRC}/DashStyle.cpp |
2929 | + ${UNITY_SRC}/JSONParser.cpp |
2930 | + ${UNITY_SRC}/PlacesStyle.cpp |
2931 | + ${UNITY_SRC}/PlacesStyle.h |
2932 | + ) |
2933 | +add_dependencies(test-filter-bar unity-core-${UNITY_API_VERSION}) |
2934 | + |
2935 | +add_executable (test-preview-applicaiton |
2936 | + TestPreviewApplications.cpp |
2937 | + ${UNITY_SRC}/PreviewApplications.cpp |
2938 | + ${UNITY_SRC}/PreviewBase.cpp |
2939 | + ${UNITY_SRC}/PreviewBasicButton.cpp |
2940 | + ${UNITY_SRC}/IconTexture.cpp |
2941 | + ${UNITY_SRC}/IconLoader.cpp |
2942 | + ${UNITY_SRC}/Introspectable.cpp |
2943 | + ${UNITY_SRC}/StaticCairoText.cpp |
2944 | + ${UNITY_SRC}/TextureCache.cpp |
2945 | + ${UNITY_SRC}/DashStyle.cpp |
2946 | + ${UNITY_SRC}/JSONParser.cpp |
2947 | + ${UNITY_SRC}/Timer.cpp |
2948 | + ) |
2949 | +add_dependencies(test-preview-applicaiton unity-core-${UNITY_API_VERSION}) |
2950 | + |
2951 | +add_executable (test-preview-generic |
2952 | + TestPreviewGeneric.cpp |
2953 | + ${UNITY_SRC}/PreviewGeneric.cpp |
2954 | + ${UNITY_SRC}/PreviewBase.cpp |
2955 | + ${UNITY_SRC}/PreviewBasicButton.cpp |
2956 | + ${UNITY_SRC}/IconTexture.cpp |
2957 | + ${UNITY_SRC}/IconLoader.cpp |
2958 | + ${UNITY_SRC}/Introspectable.cpp |
2959 | + ${UNITY_SRC}/StaticCairoText.cpp |
2960 | + ${UNITY_SRC}/TextureCache.cpp |
2961 | + ${UNITY_SRC}/DashStyle.cpp |
2962 | + ${UNITY_SRC}/JSONParser.cpp |
2963 | + ${UNITY_SRC}/Timer.cpp |
2964 | + ) |
2965 | +add_dependencies(test-preview-generic unity-core-${UNITY_API_VERSION}) |
2966 | + |
2967 | +add_executable (test-preview-music |
2968 | + TestPreviewMusic.cpp |
2969 | + ${UNITY_SRC}/PreviewBase.cpp |
2970 | + ${UNITY_SRC}/PreviewBasicButton.cpp |
2971 | + ${UNITY_SRC}/PreviewMusic.cpp |
2972 | + ${UNITY_SRC}/PreviewMusicTrack.cpp |
2973 | + ${UNITY_SRC}/PreviewMusicTrackWidget.cpp |
2974 | + ${UNITY_SRC}/IconTexture.cpp |
2975 | + ${UNITY_SRC}/IconLoader.cpp |
2976 | + ${UNITY_SRC}/Introspectable.cpp |
2977 | + ${UNITY_SRC}/StaticCairoText.cpp |
2978 | + ${UNITY_SRC}/TextureCache.cpp |
2979 | + ${UNITY_SRC}/DashStyle.cpp |
2980 | + ${UNITY_SRC}/JSONParser.cpp |
2981 | + ${UNITY_SRC}/Timer.cpp |
2982 | + ) |
2983 | +add_dependencies(test-preview-music unity-core-${UNITY_API_VERSION}) |
2984 | + |
2985 | +add_executable (test-result-view |
2986 | + TestResultView.cpp |
2987 | + ${UNITY_SRC}/PlacesStyle.cpp |
2988 | + ${UNITY_SRC}/PlacesStyle.h |
2989 | + ${UNITY_SRC}/PreviewApplications.cpp |
2990 | + ${UNITY_SRC}/PreviewBase.cpp |
2991 | + ${UNITY_SRC}/PreviewBasicButton.cpp |
2992 | + ${UNITY_SRC}/ResultView.cpp |
2993 | + ${UNITY_SRC}/ResultViewGrid.cpp |
2994 | + ${UNITY_SRC}/ResultRenderer.cpp |
2995 | + ${UNITY_SRC}/ResultRendererTile.cpp |
2996 | + ${UNITY_SRC}/ResultRendererHorizontalTile.cpp |
2997 | + ${UNITY_SRC}/IconTexture.cpp |
2998 | + ${UNITY_SRC}/IconLoader.cpp |
2999 | + ${UNITY_SRC}/Introspectable.cpp |
3000 | + ${UNITY_SRC}/StaticCairoText.cpp |
3001 | + ${UNITY_SRC}/TextureCache.cpp |
3002 | + ${UNITY_SRC}/Timer.cpp |
3003 | + ${UNITY_SRC}/DashStyle.cpp |
3004 | + ${UNITY_SRC}/JSONParser.cpp |
3005 | + ${UNITY_SRC}/UBusMessages.h |
3006 | + ${UNITY_SRC}/UBusWrapper.cpp |
3007 | + ${UNITY_SRC}/UBusWrapper.h |
3008 | + ${UNITY_SRC}/ubus-server.cpp |
3009 | + ${UNITY_SRC}/ubus-server.h |
3010 | + ) |
3011 | +add_dependencies(test-result-view unity-core-${UNITY_API_VERSION}) |
3012 | + |
3013 | +add_executable (test-dash-style |
3014 | + TestDashStyle.cpp |
3015 | + ${UNITY_SRC}/DashStyle.cpp |
3016 | + ${UNITY_SRC}/DashStyle.h |
3017 | + ${UNITY_SRC}/JSONParser.cpp |
3018 | + ${PLACES_COMMON_SOURCE} |
3019 | + ) |
3020 | +add_dependencies (test-dash-style unity-core-${UNITY_API_VERSION}) |
3021 | + |
3022 | +add_executable (test-bg-hash |
3023 | + TestBGHash.cpp |
3024 | + ${UNITY_SRC}/BGHash.cpp |
3025 | + ${UNITY_SRC}/BGHash.h |
3026 | + ${UNITY_SRC}/ubus-server.cpp |
3027 | + ${UNITY_SRC}/ubus-server.h |
3028 | + ) |
3029 | +add_dependencies (test-bg-hash unity-core-${UNITY_API_VERSION}) |
3030 | + |
3031 | +find_package (OpenGL) |
3032 | + |
3033 | +include_directories (${OPENGL_gl_INCDIRS}) |
3034 | +add_library (glfuncloader SHARED |
3035 | + ${CMAKE_CURRENT_SOURCE_DIR}/GLFuncLoader.cpp) |
3036 | +add_dependencies (glfuncloader unity-core-${UNITY_API_VERSION}) |
3037 | +target_link_libraries (glfuncloader dl ${OPENGL_gl_LIBRARY}) |
3038 | +add_executable (screen-effect-fbo |
3039 | + TestScreenEffectFramebufferObject.cpp |
3040 | + ${UNITY_SRC}/ScreenEffectFramebufferObject.cpp |
3041 | + ${UNITY_SRC}/BackgroundEffectHelper.cpp) |
3042 | + |
3043 | +target_link_libraries (screen-effect-fbo glfuncloader ${OPENGL_gl_LIBRARY}) |
3044 | +add_dependencies (screen-effect-fbo unity-core-${UNITY_API_VERSION}) |
3045 | + |
3046 | +>>>>>>> MERGE-SOURCE |
3047 | add_subdirectory (test-input-remover) |
3048 | add_subdirectory (test-minimize-window-handler) |
3049 | add_subdirectory (test-get-transients) |
3050 | @@ -188,6 +627,11 @@ |
3051 | test_lens.cpp |
3052 | test_main_dbus.cpp |
3053 | test_model.cpp |
3054 | +<<<<<<< TREE |
3055 | +======= |
3056 | + test_texture_cache.cpp |
3057 | + test_time_util.cpp |
3058 | +>>>>>>> MERGE-SOURCE |
3059 | test_utils.h |
3060 | test_ratings_filter.cpp |
3061 | test_results.cpp |
3062 | |
3063 | === added file 'tests/GLFuncLoader.cpp' |
3064 | --- tests/GLFuncLoader.cpp 1970-01-01 00:00:00 +0000 |
3065 | +++ tests/GLFuncLoader.cpp 2013-01-18 15:43:30 +0000 |
3066 | @@ -0,0 +1,51 @@ |
3067 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
3068 | +/* Compiz unity plugin |
3069 | + * unity.h |
3070 | + * |
3071 | + * Copyright (c) 2010-11 Canonical Ltd. |
3072 | + * |
3073 | + * This program is free software; you can redistribute it and/or |
3074 | + * modify it under the terms of the GNU General Public License |
3075 | + * as published by the Free Software Foundation; either version 3 |
3076 | + * of the License, or (at your option) any later version. |
3077 | + * |
3078 | + * This program is distributed in the hope that it will be useful, |
3079 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3080 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3081 | + * GNU General Public License for more details. |
3082 | + * |
3083 | + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
3084 | + */ |
3085 | + |
3086 | +#include "GLFuncLoader.h" |
3087 | +#include <dlfcn.h> |
3088 | + |
3089 | +unity::GLLoader::FuncPtr unity::GLLoader::getProcAddr(const std::string &name) |
3090 | +{ |
3091 | + static void *dlhand = NULL; |
3092 | + FuncPtr funcPtr = NULL; |
3093 | + |
3094 | + glGetError (); |
3095 | + |
3096 | + if (!funcPtr) |
3097 | + { |
3098 | + if (!dlhand) |
3099 | + dlhand = dlopen ("libglfuncloader.so", RTLD_LAZY); |
3100 | + |
3101 | + char *error = dlerror (); |
3102 | + |
3103 | + if (dlhand) |
3104 | + { |
3105 | + dlerror (); |
3106 | + funcPtr = (FuncPtr) dlsym (dlhand, name.c_str ()); |
3107 | + |
3108 | + error = dlerror (); |
3109 | + if (error != NULL) |
3110 | + funcPtr = NULL; |
3111 | + } |
3112 | + } |
3113 | + |
3114 | + return funcPtr; |
3115 | +} |
3116 | + |
3117 | + |
3118 | |
3119 | === added file 'tests/GLFuncLoader.h' |
3120 | --- tests/GLFuncLoader.h 1970-01-01 00:00:00 +0000 |
3121 | +++ tests/GLFuncLoader.h 2013-01-18 15:43:30 +0000 |
3122 | @@ -0,0 +1,33 @@ |
3123 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
3124 | +/* Compiz unity plugin |
3125 | + * unity.h |
3126 | + * |
3127 | + * Copyright (c) 2010-11 Canonical Ltd. |
3128 | + * |
3129 | + * This program is free software; you can redistribute it and/or |
3130 | + * modify it under the terms of the GNU General Public License |
3131 | + * as published by the Free Software Foundation; either version 3 |
3132 | + * of the License, or (at your option) any later version. |
3133 | + * |
3134 | + * This program is distributed in the hope that it will be useful, |
3135 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3136 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3137 | + * GNU General Public License for more details. |
3138 | + * |
3139 | + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
3140 | + */ |
3141 | + |
3142 | +#include <string> |
3143 | +#include <GL/gl.h> |
3144 | +#include <GL/glx.h> |
3145 | + |
3146 | +namespace unity |
3147 | +{ |
3148 | +namespace GLLoader |
3149 | +{ |
3150 | +typedef void (*FuncPtr) (void); |
3151 | +typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName); |
3152 | + |
3153 | +FuncPtr getProcAddr(const std::string &name); |
3154 | +} |
3155 | +} |
3156 | |
3157 | === added file 'tests/TestScreenEffectFramebufferObject.cpp' |
3158 | --- tests/TestScreenEffectFramebufferObject.cpp 1970-01-01 00:00:00 +0000 |
3159 | +++ tests/TestScreenEffectFramebufferObject.cpp 2013-01-18 15:43:30 +0000 |
3160 | @@ -0,0 +1,671 @@ |
3161 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
3162 | +/* Compiz unity plugin |
3163 | + * unity.h |
3164 | + * |
3165 | + * Copyright (c) 2010-11 Canonical Ltd. |
3166 | + * |
3167 | + * This program is free software; you can redistribute it and/or |
3168 | + * modify it under the terms of the GNU General Public License |
3169 | + * as published by the Free Software Foundation; either version 3 |
3170 | + * of the License, or (at your option) any later version. |
3171 | + * |
3172 | + * This program is distributed in the hope that it will be useful, |
3173 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3174 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3175 | + * GNU General Public License for more details. |
3176 | + * |
3177 | + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com> |
3178 | + */ |
3179 | + |
3180 | +#include "ScreenEffectFramebufferObject.h" |
3181 | +#include "BackgroundEffectHelper.h" |
3182 | +#include "GLFuncLoader.h" |
3183 | +#include <Nux/Nux.h> |
3184 | +#include <Nux/VLayout.h> |
3185 | +#include <Nux/View.h> |
3186 | +#include <Nux/BaseWindow.h> |
3187 | +#include <Nux/WindowCompositor.h> |
3188 | +#include <NuxCore/Logger.h> |
3189 | +#include <NuxCore/Object.h> |
3190 | +#include <X11/Xlib.h> |
3191 | +#include <X11/Xutil.h> |
3192 | +#include <GL/glx.h> |
3193 | +#include <GL/gl.h> |
3194 | +#include <dlfcn.h> |
3195 | +#include <sys/poll.h> |
3196 | +#include <unistd.h> |
3197 | +#include <glib.h> |
3198 | +#include <gtk/gtk.h> |
3199 | +#include <cmath> |
3200 | + |
3201 | +using namespace unity::GLLoader; |
3202 | + |
3203 | +namespace |
3204 | +{ |
3205 | + nux::logging::Logger logger ("unity.test-screeneffectframebufferobject"); |
3206 | + |
3207 | + const static int attributes[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, |
3208 | + GLX_X_RENDERABLE, True, |
3209 | + GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, |
3210 | + GLX_DOUBLEBUFFER, True, |
3211 | + GLX_RED_SIZE, 8, |
3212 | + GLX_GREEN_SIZE, 8, |
3213 | + GLX_BLUE_SIZE, 8, 0}; |
3214 | +} |
3215 | + |
3216 | +namespace GLFuncs |
3217 | +{ |
3218 | + GLXGetProcAddressProc glXGetProcAddressP; |
3219 | + PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfigP; |
3220 | + PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfigP; |
3221 | + PFNGLXCREATEWINDOWPROC glXCreateWindowP; |
3222 | + PFNGLXDESTROYWINDOWPROC glXDestroyWindowP; |
3223 | + PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrentP; |
3224 | + |
3225 | + void init () |
3226 | + { |
3227 | + glXGetProcAddressP = (GLXGetProcAddressProc) getProcAddr ("glXGetProcAddress"); |
3228 | + glXChooseFBConfigP = (PFNGLXCHOOSEFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXChooseFBConfig"); |
3229 | + glXGetVisualFromFBConfigP = (PFNGLXGETVISUALFROMFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXGetVisualFromFBConfig"); |
3230 | + glXCreateWindowP = (PFNGLXCREATEWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXCreateWindow"); |
3231 | + glXMakeContextCurrentP = (PFNGLXMAKECONTEXTCURRENTPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXMakeContextCurrent"); |
3232 | + glXDestroyWindowP = (PFNGLXDESTROYWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXDestroyWindow"); |
3233 | + } |
3234 | +} |
3235 | + |
3236 | +class EffectView : |
3237 | + public nux::View |
3238 | +{ |
3239 | +public: |
3240 | + EffectView (NUX_FILE_LINE_PROTO); |
3241 | + virtual ~EffectView (); |
3242 | + |
3243 | + void Draw (nux::GraphicsEngine &context, bool force) { return; }; |
3244 | + void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw); |
3245 | +private: |
3246 | + BackgroundEffectHelper bg_effect_helper_; |
3247 | +}; |
3248 | + |
3249 | +class Shape |
3250 | +{ |
3251 | + public: |
3252 | + |
3253 | + typedef boost::shared_ptr <Shape> Ptr; |
3254 | + |
3255 | + Shape (); |
3256 | + virtual ~Shape (); |
3257 | + |
3258 | + float rotation () { return mRotation; } |
3259 | + |
3260 | + void draw (unsigned int width, unsigned int height) { glDraw (width, height); } |
3261 | + void rotate () { applyRotation (); } |
3262 | + |
3263 | + protected: |
3264 | + |
3265 | + float mRotation; |
3266 | + |
3267 | + virtual void glDraw (unsigned int width, unsigned int height) = 0; |
3268 | + virtual void applyRotation () = 0; |
3269 | + virtual void getRotationAxes (float &x, float &y, float &z) = 0; |
3270 | +}; |
3271 | + |
3272 | +Shape::Shape () : |
3273 | + mRotation (0.0f) |
3274 | +{ |
3275 | +} |
3276 | + |
3277 | +Shape::~Shape () |
3278 | +{ |
3279 | +} |
3280 | + |
3281 | +class Triangle : |
3282 | + public Shape |
3283 | +{ |
3284 | + public: |
3285 | + |
3286 | + typedef boost::shared_ptr <Triangle> Ptr; |
3287 | + |
3288 | + protected: |
3289 | + |
3290 | + void glDraw (unsigned int width, unsigned int height); |
3291 | + void applyRotation () { mRotation += 5.0f; } |
3292 | + void getRotationAxes (float &x, float &y, float &z) { x = 0.0f; y = 1.0f; z = 0.0f; } |
3293 | +}; |
3294 | + |
3295 | +void |
3296 | +Triangle::glDraw (unsigned int width, unsigned int height) |
3297 | +{ |
3298 | + glBegin(GL_TRIANGLES); |
3299 | + glColor3f(1.0f, 0.0f, 0.0f); |
3300 | + glVertex3f(width / 4, height, 0.0f); |
3301 | + glColor3f(0.0f, 1.0f, 0.0f); |
3302 | + glVertex3f(0.0f, 0.0f, 0.0f); |
3303 | + glColor3f(0.0f, 0.0f, 1.0f); |
3304 | + glVertex3f(width / 2, 0.0f, 0.0f); |
3305 | + glEnd(); |
3306 | +} |
3307 | + |
3308 | +class Square : |
3309 | + public Shape |
3310 | +{ |
3311 | + public: |
3312 | + |
3313 | + typedef boost::shared_ptr <Square> Ptr; |
3314 | + |
3315 | + protected: |
3316 | + |
3317 | + void glDraw (unsigned int width, unsigned int height); |
3318 | + void applyRotation () { mRotation -= 2.5f; } |
3319 | + void getRotationAxes (float &x, float &y, float &z) { x = 1.0f; y = 0.0f; z = 0.0f; } |
3320 | + |
3321 | +}; |
3322 | + |
3323 | +void |
3324 | +Square::glDraw (unsigned int width, unsigned int height) |
3325 | +{ |
3326 | + glBegin(GL_QUADS); |
3327 | + glColor3f(sin (rotation () / 100.0f), -sin (rotation () / 100.0f), cos (rotation () / 100.0f)); |
3328 | + glVertex3f(width / 2, height, 0.0f); |
3329 | + glColor3f(-sin (rotation () / 100.0f), sin (rotation () / 100.0f), cos (rotation () / 100.0f)); |
3330 | + glVertex3f(width, height, 0.0f); |
3331 | + glColor3f(sin (rotation () / 100.0f), sin (rotation () / 100.0f), sin (rotation () / 100.0f)); |
3332 | + glVertex3f(width, 0.0f, 0.0f); |
3333 | + glColor3f(-sin (rotation () / 100.0f), cos (rotation () / 100.0f), cos (rotation () / 100.0f)); |
3334 | + glVertex3f(width / 2, 0.0f, 0.0f); |
3335 | + glEnd(); |
3336 | +} |
3337 | + |
3338 | +class BaseContext |
3339 | +{ |
3340 | + public: |
3341 | + |
3342 | + BaseContext (Display *); |
3343 | + ~BaseContext (); |
3344 | + |
3345 | + void run (); |
3346 | + |
3347 | + protected: |
3348 | + |
3349 | + bool eventHandler (); |
3350 | + bool paintDispatch (); |
3351 | + |
3352 | + enum class ModifierApplication |
3353 | + { |
3354 | + Square, |
3355 | + Triangle, |
3356 | + Both |
3357 | + }; |
3358 | + |
3359 | + void nextWindowPosition (); |
3360 | + void nextShapeRotation (); |
3361 | + void setupContextForSize (unsigned int width, |
3362 | + unsigned int height); |
3363 | + void drawShape (const Shape::Ptr &) {}; |
3364 | + |
3365 | + private: |
3366 | + |
3367 | + static gboolean onNewEvents (GIOChannel *channel, |
3368 | + GIOCondition condition, |
3369 | + gpointer data); |
3370 | + |
3371 | + static gboolean onPaintTimeout (gpointer data); |
3372 | + |
3373 | + static void onWindowThreadCreation (nux::NThread *thread, void *d); |
3374 | + |
3375 | + Display *mDisplay; |
3376 | + Window mWindow; |
3377 | + Colormap mColormap; |
3378 | + nux::WindowThread *mWindowThread; |
3379 | + nux::View *mRootView; |
3380 | + ScreenEffectFramebufferObject::Ptr mFbo; |
3381 | + GLXWindow mGlxWindow; |
3382 | + GLXContext mContext; |
3383 | + ModifierApplication mRotating; |
3384 | + ModifierApplication mBlur; |
3385 | + unsigned int mWidth; |
3386 | + unsigned int mHeight; |
3387 | + bool mNuxReady; |
3388 | + Shape::Ptr mTriangle; |
3389 | + Shape::Ptr mSquare; |
3390 | +}; |
3391 | + |
3392 | +BaseContext::BaseContext (Display *display) : |
3393 | + mDisplay (display), |
3394 | + mWindowThread (NULL), |
3395 | + mRotating (ModifierApplication::Both), |
3396 | + mBlur (ModifierApplication::Both), |
3397 | + mWidth (640), |
3398 | + mHeight (480), |
3399 | + mNuxReady (false), |
3400 | + mTriangle (new Triangle ()), |
3401 | + mSquare (new Square ()) |
3402 | +{ |
3403 | + int numFBConfig = 0; |
3404 | + GLXFBConfig *fbConfigs = (*GLFuncs::glXChooseFBConfigP) (mDisplay, |
3405 | + DefaultScreen (mDisplay), |
3406 | + attributes, |
3407 | + &numFBConfig); |
3408 | + XVisualInfo *visinfo = (*GLFuncs::glXGetVisualFromFBConfigP) (mDisplay, |
3409 | + fbConfigs[0]); |
3410 | + |
3411 | + mContext = glXCreateContext (mDisplay, visinfo, 0, GL_TRUE); |
3412 | + mColormap = XCreateColormap (mDisplay, |
3413 | + DefaultRootWindow (mDisplay), |
3414 | + visinfo->visual, |
3415 | + AllocNone); |
3416 | + |
3417 | + XSetWindowAttributes wa; |
3418 | + |
3419 | + wa.colormap = mColormap; |
3420 | + wa.border_pixel = 0; |
3421 | + wa.event_mask = StructureNotifyMask | KeyPressMask | ExposureMask; |
3422 | + |
3423 | + mWindow = XCreateWindow (mDisplay, DefaultRootWindow (mDisplay), |
3424 | + 0, 0, mWidth, mHeight, 0, visinfo->depth, InputOutput, |
3425 | + visinfo->visual, CWColormap | CWEventMask | CWBorderPixel, |
3426 | + &wa); |
3427 | + |
3428 | + mGlxWindow = (*GLFuncs::glXCreateWindowP) (mDisplay, fbConfigs[0], mWindow, NULL); |
3429 | + |
3430 | + XStoreName (mDisplay, mWindow, "F1: Toggle Effect, F2: Rotation, F3: Effect"); |
3431 | + XMapWindow (mDisplay, mWindow); |
3432 | + |
3433 | + bool ready = false; |
3434 | + |
3435 | + do |
3436 | + { |
3437 | + XEvent ev; |
3438 | + XNextEvent (mDisplay, &ev); |
3439 | + switch (ev.type) |
3440 | + { |
3441 | + case MapNotify: |
3442 | + case ConfigureNotify: |
3443 | + case Expose: |
3444 | + ready = true; |
3445 | + break; |
3446 | + default: |
3447 | + break; |
3448 | + } |
3449 | + |
3450 | + } while (!ready); |
3451 | + |
3452 | + (*GLFuncs::glXMakeContextCurrentP) (mDisplay, mGlxWindow, mGlxWindow, mContext); |
3453 | + |
3454 | + setupContextForSize (mWidth, mHeight); |
3455 | +} |
3456 | + |
3457 | +void |
3458 | +BaseContext::run () |
3459 | +{ |
3460 | + GIOChannel *channel; |
3461 | + mWindowThread = nux::CreateFromForeignWindow (mWindow, |
3462 | + mContext, |
3463 | + &BaseContext::onWindowThreadCreation, |
3464 | + (void *) this); |
3465 | + |
3466 | + mWindowThread->Run(NULL); |
3467 | + |
3468 | + while (!mNuxReady); |
3469 | + g_timeout_add (128, &BaseContext::onPaintTimeout, (gpointer) this); |
3470 | + |
3471 | + channel = g_io_channel_unix_new (ConnectionNumber (mDisplay)); |
3472 | + |
3473 | + g_io_add_watch (channel, (GIOCondition) (G_IO_IN | G_IO_HUP | G_IO_ERR), |
3474 | + &BaseContext::onNewEvents, (gpointer) this); |
3475 | + gtk_main (); |
3476 | +} |
3477 | + |
3478 | +BaseContext::~BaseContext () |
3479 | +{ |
3480 | + delete mWindowThread; |
3481 | + |
3482 | + (*GLFuncs::glXMakeContextCurrentP) (mDisplay, None, None, mContext); |
3483 | + glXDestroyContext (mDisplay, mContext); |
3484 | + (*GLFuncs::glXDestroyWindowP) (mDisplay, mGlxWindow); |
3485 | + |
3486 | + XFreeColormap (mDisplay, mColormap); |
3487 | + XDestroyWindow (mDisplay, mWindow); |
3488 | +} |
3489 | + |
3490 | +void |
3491 | +BaseContext::setupContextForSize (unsigned int width, |
3492 | + unsigned int height) |
3493 | +{ |
3494 | + mWidth = width; |
3495 | + mHeight = height; |
3496 | + |
3497 | + glViewport(0, 0, width, height); |
3498 | + glDrawBuffer (GL_BACK); |
3499 | + glReadBuffer (GL_BACK); |
3500 | + glMatrixMode(GL_PROJECTION); |
3501 | + glLoadIdentity(); |
3502 | + gluPerspective(60.0f, 1.0f, 0.1f, 100.0f); |
3503 | + glMatrixMode(GL_MODELVIEW); |
3504 | + glLoadIdentity (); |
3505 | + glClearColor (1, 1, 1, 1); |
3506 | + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
3507 | + glXSwapBuffers (mDisplay, mGlxWindow); |
3508 | + |
3509 | + if (mFbo) |
3510 | + mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight))); |
3511 | + |
3512 | + if (mRootView && mNuxReady) |
3513 | + { |
3514 | + switch (mBlur) |
3515 | + { |
3516 | + case ModifierApplication::Both: |
3517 | + mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight)); |
3518 | + break; |
3519 | + case ModifierApplication::Triangle: |
3520 | + mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight)); |
3521 | + break; |
3522 | + case ModifierApplication::Square: |
3523 | + mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight)); |
3524 | + break; |
3525 | + default: |
3526 | + break; |
3527 | + } |
3528 | + } |
3529 | +} |
3530 | + |
3531 | +bool |
3532 | +BaseContext::eventHandler () |
3533 | +{ |
3534 | + XEvent event; |
3535 | + XEvent *ev = &event; |
3536 | + |
3537 | + XNextEvent (mDisplay, &event); |
3538 | + |
3539 | + switch (ev->type) |
3540 | + { |
3541 | + case KeyPress: |
3542 | + if (XLookupKeysym (&ev->xkey, 0) == XK_Escape) |
3543 | + return false; |
3544 | + else if (XLookupKeysym (&ev->xkey, 0) == XK_F1) |
3545 | + { |
3546 | + if (!mFbo) |
3547 | + { |
3548 | + BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE; |
3549 | + mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight))); |
3550 | + } |
3551 | + else |
3552 | + { |
3553 | + BackgroundEffectHelper::blur_type = unity::BLUR_NONE; |
3554 | + mFbo.reset (); |
3555 | + } |
3556 | + } |
3557 | + else if (XLookupKeysym (&ev->xkey, 0) == XK_F2) |
3558 | + nextShapeRotation (); |
3559 | + else if (XLookupKeysym (&ev->xkey, 0) == XK_F3) |
3560 | + nextWindowPosition (); |
3561 | + break; |
3562 | + case ConfigureNotify: |
3563 | + setupContextForSize (ev->xconfigure.width, ev->xconfigure.height); |
3564 | + default: |
3565 | + break; |
3566 | + } |
3567 | + |
3568 | + return true; |
3569 | +} |
3570 | + |
3571 | +gboolean |
3572 | +BaseContext::onNewEvents (GIOChannel *channel, |
3573 | + GIOCondition condition, |
3574 | + gpointer data) |
3575 | +{ |
3576 | + BaseContext *self = static_cast <BaseContext *> (data); |
3577 | + |
3578 | + if (condition & G_IO_IN) |
3579 | + { |
3580 | + if (self->eventHandler ()) |
3581 | + return TRUE; |
3582 | + else |
3583 | + return FALSE; |
3584 | + } |
3585 | + |
3586 | + return TRUE; |
3587 | +} |
3588 | + |
3589 | +gboolean |
3590 | +BaseContext::onPaintTimeout (gpointer data) |
3591 | +{ |
3592 | + BaseContext *self = static_cast <BaseContext *> (data); |
3593 | + |
3594 | + if (self->paintDispatch ()) |
3595 | + return TRUE; |
3596 | + |
3597 | + return FALSE; |
3598 | +} |
3599 | + |
3600 | +void |
3601 | +BaseContext::nextShapeRotation () |
3602 | +{ |
3603 | + switch (mRotating) |
3604 | + { |
3605 | + case ModifierApplication::Both: |
3606 | + mRotating = ModifierApplication::Triangle; |
3607 | + break; |
3608 | + case ModifierApplication::Triangle: |
3609 | + mRotating = ModifierApplication::Square; |
3610 | + break; |
3611 | + case ModifierApplication::Square: |
3612 | + mRotating = ModifierApplication::Both; |
3613 | + break; |
3614 | + default: |
3615 | + break; |
3616 | + } |
3617 | +} |
3618 | + |
3619 | +void |
3620 | +BaseContext::nextWindowPosition () |
3621 | +{ |
3622 | + switch (mBlur) |
3623 | + { |
3624 | + case ModifierApplication::Both: |
3625 | + mBlur = ModifierApplication::Triangle; |
3626 | + mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight)); |
3627 | + break; |
3628 | + case ModifierApplication::Triangle: |
3629 | + mBlur = ModifierApplication::Square; |
3630 | + mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight)); |
3631 | + break; |
3632 | + case ModifierApplication::Square: |
3633 | + mBlur = ModifierApplication::Both; |
3634 | + mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight)); |
3635 | + break; |
3636 | + default: |
3637 | + break; |
3638 | + } |
3639 | +} |
3640 | + |
3641 | +EffectView::EffectView (NUX_FILE_LINE_DECL) |
3642 | + : View (NUX_FILE_LINE_PARAM) |
3643 | +{ |
3644 | + bg_effect_helper_.owner = this; |
3645 | +} |
3646 | + |
3647 | +EffectView::~EffectView () |
3648 | +{ |
3649 | +} |
3650 | + |
3651 | +void EffectView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw) |
3652 | +{ |
3653 | + nux::Geometry base = GetGeometry(); |
3654 | + GfxContext.PushClippingRectangle(base); |
3655 | + nux::Geometry blur_geo (base.x, base.y, base.width, base.height); |
3656 | + |
3657 | + if (BackgroundEffectHelper::blur_type == unity::BLUR_ACTIVE) |
3658 | + { |
3659 | + bg_effect_helper_.enabled = true; |
3660 | + |
3661 | + auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo); |
3662 | + |
3663 | + if (blur_texture.IsValid ()) |
3664 | + { |
3665 | + nux::TexCoordXForm texxform_blur_bg; |
3666 | + texxform_blur_bg.flip_v_coord = true; |
3667 | + texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD); |
3668 | + texxform_blur_bg.uoffset = ((float) base.x) / (base.width); |
3669 | + texxform_blur_bg.voffset = ((float) base.y) / (base.height); |
3670 | + |
3671 | + nux::ROPConfig rop; |
3672 | + rop.Blend = false; |
3673 | + rop.SrcBlend = GL_ONE; |
3674 | + rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; |
3675 | + |
3676 | + gPainter.PushDrawTextureLayer(GfxContext, base, |
3677 | + blur_texture, |
3678 | + texxform_blur_bg, |
3679 | + nux::color::White, |
3680 | + true, |
3681 | + rop); |
3682 | + } |
3683 | + } |
3684 | + else |
3685 | + bg_effect_helper_.enabled = false; |
3686 | + GfxContext.PopClippingRectangle(); |
3687 | +} |
3688 | + |
3689 | +bool |
3690 | +BaseContext::paintDispatch () |
3691 | +{ |
3692 | + if (mFbo) |
3693 | + { |
3694 | + switch (mRotating) |
3695 | + { |
3696 | + case ModifierApplication::Both: |
3697 | + BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth, mHeight)); |
3698 | + break; |
3699 | + case ModifierApplication::Triangle: |
3700 | + BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth / 2, mHeight)); |
3701 | + break; |
3702 | + case ModifierApplication::Square: |
3703 | + BackgroundEffectHelper::ProcessDamage (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight)); |
3704 | + break; |
3705 | + } |
3706 | + |
3707 | + mFbo->bind (nux::Geometry (0, 0, mWidth, mHeight)); |
3708 | + |
3709 | + if (!mFbo->status ()) |
3710 | + { |
3711 | + LOG_INFO (logger) << "FBO not ok!"; |
3712 | + } |
3713 | + } |
3714 | + |
3715 | + glClearColor (1, 1, 1, 1); |
3716 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
3717 | + glPushMatrix (); |
3718 | + glLoadIdentity(); |
3719 | + glTranslatef(-0.5f, -0.5f, -0.866025404f); |
3720 | + glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f); |
3721 | + glTranslatef(mWidth * 0.25, 0, 0); |
3722 | + glRotatef(mTriangle->rotation (), 0.0f, 1.0f, 0.0f); |
3723 | + glTranslatef(-(mWidth * 0.25), 0, 0); |
3724 | + |
3725 | + mTriangle->draw (mWidth, mHeight); |
3726 | + |
3727 | + glLoadIdentity(); |
3728 | + glTranslatef(-0.5f, -0.5f, -0.866025404f); |
3729 | + glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f); |
3730 | + glTranslatef(mWidth * 0.75, 0, 0); |
3731 | + glRotatef(mSquare->rotation (), 0.0f, 1.0f, 0.0f); |
3732 | + glTranslatef(-(mWidth * 0.75), 0, 0); |
3733 | + |
3734 | + mSquare->draw (mWidth, mHeight); |
3735 | + |
3736 | + glColor4f (1.0f, 1.0f, 1.0f, 5.0f); |
3737 | + glPopMatrix (); |
3738 | + |
3739 | + if (mFbo) |
3740 | + mFbo->unbind (); |
3741 | + |
3742 | + if (mFbo && mFbo->status ()) |
3743 | + { |
3744 | + glClearColor (1, 1, 1, 1); |
3745 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
3746 | + glPushMatrix (); |
3747 | + glLoadIdentity(); |
3748 | + glTranslatef(-0.5f, 0.5f, -0.866025404f); |
3749 | + glScalef (1.0f / mWidth, -(1.0f / mHeight), 0.0f); |
3750 | + mFbo->paint (nux::Geometry (0, 0, mWidth, mHeight)); |
3751 | + glPopMatrix (); |
3752 | + |
3753 | + nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture = |
3754 | + nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID (mFbo->texture(), |
3755 | + mWidth, mHeight, 1, nux::BITFMT_R8G8B8A8); |
3756 | + |
3757 | + nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture; |
3758 | + |
3759 | + nux::Geometry geo = nux::Geometry (0, 0, mWidth, mHeight); |
3760 | + BackgroundEffectHelper::monitor_rect_ = geo; |
3761 | + } |
3762 | + |
3763 | + glMatrixMode(GL_PROJECTION); |
3764 | + glPushMatrix(); |
3765 | + |
3766 | + glMatrixMode(GL_MODELVIEW); |
3767 | + glPushMatrix(); |
3768 | + glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT | |
3769 | + GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT | GL_SCISSOR_BIT); |
3770 | + mRootView->ProcessDraw (mWindowThread->GetGraphicsEngine (), true); |
3771 | + glMatrixMode(GL_PROJECTION); |
3772 | + glPopMatrix(); |
3773 | + glMatrixMode(GL_MODELVIEW); |
3774 | + glPopMatrix(); |
3775 | + |
3776 | + glDrawBuffer(GL_BACK); |
3777 | + glReadBuffer(GL_BACK); |
3778 | + |
3779 | + glPopAttrib(); |
3780 | + |
3781 | + glXSwapBuffers (mDisplay, mGlxWindow); |
3782 | + |
3783 | + switch (mRotating) |
3784 | + { |
3785 | + case ModifierApplication::Both: |
3786 | + mTriangle->rotate (); |
3787 | + mSquare->rotate (); |
3788 | + break; |
3789 | + case ModifierApplication::Triangle: |
3790 | + mTriangle->rotate (); |
3791 | + break; |
3792 | + case ModifierApplication::Square: |
3793 | + mSquare->rotate (); |
3794 | + break; |
3795 | + } |
3796 | + |
3797 | + return true; |
3798 | +} |
3799 | + |
3800 | +void |
3801 | +BaseContext::onWindowThreadCreation (nux::NThread *thread, void *data) |
3802 | +{ |
3803 | + BaseContext *bc = static_cast <BaseContext *> (data); |
3804 | + |
3805 | + bc->mRootView = new EffectView (); |
3806 | + bc->mRootView->SetGeometry (nux::Geometry (0, 0, 640, 480)); |
3807 | + bc->mNuxReady = true; |
3808 | + BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE; |
3809 | +} |
3810 | + |
3811 | +int main (int argc, char **argv) |
3812 | +{ |
3813 | + Display *display = XOpenDisplay (NULL); |
3814 | + nux::NuxInitialize (0); |
3815 | + GLFuncs::init (); |
3816 | + g_type_init (); |
3817 | + g_thread_init (NULL); |
3818 | + gtk_init(&argc, &argv); |
3819 | + |
3820 | + BaseContext *bc = new BaseContext (display); |
3821 | + |
3822 | + bc->run (); |
3823 | + |
3824 | + delete bc; |
3825 | + |
3826 | + XCloseDisplay (display); |
3827 | + |
3828 | + return 0; |
3829 | +} |
3830 | + |
3831 | + |
3832 | |
3833 | === modified file 'tests/test-get-transients/CMakeLists.txt' |
3834 | --- tests/test-get-transients/CMakeLists.txt 2011-10-26 16:17:24 +0000 |
3835 | +++ tests/test-get-transients/CMakeLists.txt 2013-01-18 15:43:30 +0000 |
3836 | @@ -20,5 +20,6 @@ |
3837 | add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION}) |
3838 | target_link_libraries (test-get-transients |
3839 | ${COMPIZ_TEST_GET_TRANSIENTS_LIBRARIES}) |
3840 | + add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION}) |
3841 | |
3842 | endif (COMPIZ_TEST_GET_TRANSIENTS_FOUND) |
3843 | |
3844 | === modified file 'tests/test-input-remover/CMakeLists.txt' |
3845 | --- tests/test-input-remover/CMakeLists.txt 2011-10-26 16:17:24 +0000 |
3846 | +++ tests/test-input-remover/CMakeLists.txt 2013-01-18 15:43:30 +0000 |
3847 | @@ -16,5 +16,6 @@ |
3848 | add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION}) |
3849 | target_link_libraries (test-input-remover |
3850 | ${COMPIZ_TEST_INPUT_REMOVER_LIBRARIES}) |
3851 | + add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION}) |
3852 | |
3853 | endif (COMPIZ_TEST_INPUT_REMOVER_FOUND) |
3854 | |
3855 | === modified file 'tests/test-minimize-window-handler/CMakeLists.txt' |
3856 | --- tests/test-minimize-window-handler/CMakeLists.txt 2011-10-26 16:17:24 +0000 |
3857 | +++ tests/test-minimize-window-handler/CMakeLists.txt 2013-01-18 15:43:30 +0000 |
3858 | @@ -21,5 +21,6 @@ |
3859 | add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION}) |
3860 | target_link_libraries (test-minimize-handler |
3861 | ${COMPIZ_TEST_MINIMIZED_HANDER_LIBRARIES}) |
3862 | + add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION}) |
3863 | |
3864 | endif (COMPIZ_TEST_MINIMIZED_HANDER_FOUND) |
3865 | |
3866 | === added file 'tests/test_time_util.cpp' |
3867 | --- tests/test_time_util.cpp 1970-01-01 00:00:00 +0000 |
3868 | +++ tests/test_time_util.cpp 2013-01-18 15:43:30 +0000 |
3869 | @@ -0,0 +1,37 @@ |
3870 | +// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- |
3871 | +/* |
3872 | +* Copyright (C) 2012 Canonical Ltd |
3873 | +* |
3874 | +* This program is free software: you can redistribute it and/or modify |
3875 | +* it under the terms of the GNU General Public License version 3 as |
3876 | +* published by the Free Software Foundation. |
3877 | +* |
3878 | +* This program is distributed in the hope that it will be useful, |
3879 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
3880 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3881 | +* GNU General Public License for more details. |
3882 | +* |
3883 | +* You should have received a copy of the GNU General Public License |
3884 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
3885 | +* |
3886 | +* Authored by: Brandon Schaefer <brandon.schaefer@canonical.com> |
3887 | +* |
3888 | +*/ |
3889 | + |
3890 | + |
3891 | +#include <cinttypes> |
3892 | +#include <gtest/gtest.h> |
3893 | +#include "TimeUtil.h" |
3894 | + |
3895 | +using namespace testing; |
3896 | + |
3897 | +TEST(TestTimeUtil, Testin32BufferOverflow) |
3898 | +{ |
3899 | + struct timespec start, end; |
3900 | + unity::TimeUtil::SetTimeStruct(&start); |
3901 | + unity::TimeUtil::SetTimeStruct(&end); |
3902 | + |
3903 | + end.tv_sec = start.tv_sec + INT32_MAX; |
3904 | + |
3905 | + EXPECT_GT(unity::TimeUtil::TimeDelta(&end, &start), 0); |
3906 | +} |
I see an awful lot of merge conflicts.
I think it would be better to get https:/ /code.launchpad .net/~brandonts chaefer/ unity/lp806248- fix-int32- buffer- overflow- 4.0/+merge/ 137684 merged upstream and then do an upstream release into Ubuntu through the regular SRU process.