Merge lp:~smspillaz/unity/4.0_fix_912682 into lp:unity

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~smspillaz/unity/4.0_fix_912682
Merge into: lp:unity
Diff against target: 3942 lines (+3100/-74) (has conflicts)
42 files modified
AUTHORS (+4/-0)
CMakeLists.txt (+5/-0)
ChangeLog (+393/-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 (+11/-0)
plugins/unityshell/resources/dash-widgets.json (+5/-0)
plugins/unityshell/src/BamfLauncherIcon.cpp (+31/-0)
plugins/unityshell/src/DashController.cpp (+5/-0)
plugins/unityshell/src/DashSearchBar.cpp (+5/-0)
plugins/unityshell/src/DashView.cpp (+25/-2)
plugins/unityshell/src/DashView.h (+6/-0)
plugins/unityshell/src/FilterBar.cpp (+41/-0)
plugins/unityshell/src/FilterExpanderLabel.cpp (+110/-0)
plugins/unityshell/src/FilterGenreWidget.cpp (+76/-0)
plugins/unityshell/src/FilterMultiRangeButton.cpp (+194/-0)
plugins/unityshell/src/GeisAdapter.cpp (+1/-1)
plugins/unityshell/src/IMTextEntry.cpp (+15/-0)
plugins/unityshell/src/JSONParser.cpp (+13/-0)
plugins/unityshell/src/JSONParser.h (+4/-0)
plugins/unityshell/src/LauncherIcon.cpp (+25/-0)
plugins/unityshell/src/LensView.cpp (+7/-0)
plugins/unityshell/src/PanelTray.cpp (+4/-0)
plugins/unityshell/src/PanelView.cpp (+8/-0)
plugins/unityshell/src/PlacesHomeView.cpp (+237/-59)
plugins/unityshell/src/PlacesHomeView.h (+4/-0)
plugins/unityshell/src/ResultViewGrid.cpp (+31/-2)
plugins/unityshell/src/ScreenEffectFramebufferObject.cpp (+237/-0)
plugins/unityshell/src/ScreenEffectFramebufferObject.h (+87/-0)
plugins/unityshell/src/SwitcherModel.cpp (+7/-0)
plugins/unityshell/src/comptransientfor.cpp (+6/-1)
plugins/unityshell/src/transientfor.cpp (+12/-4)
plugins/unityshell/src/unityshell.cpp (+90/-4)
plugins/unityshell/src/unityshell.h (+12/-1)
tests/CMakeLists.txt (+438/-0)
tests/GLFuncLoader.cpp (+51/-0)
tests/GLFuncLoader.h (+33/-0)
tests/TestScreenEffectFramebufferObject.cpp (+671/-0)
Text conflict in AUTHORS
Text conflict in CMakeLists.txt
Text conflict in ChangeLog
Conflict adding file manual-tests.  Moved existing file to manual-tests.moved.
Text conflict in plugins/unityshell/resources/dash-widgets.json
Text conflict in plugins/unityshell/src/BamfLauncherIcon.cpp
Text conflict in plugins/unityshell/src/DashController.cpp
Text conflict in plugins/unityshell/src/DashSearchBar.cpp
Text conflict in plugins/unityshell/src/DashView.cpp
Text conflict in plugins/unityshell/src/DashView.h
Text conflict in plugins/unityshell/src/FilterBar.cpp
Text conflict in plugins/unityshell/src/FilterExpanderLabel.cpp
Text conflict in plugins/unityshell/src/FilterGenreWidget.cpp
Text conflict in plugins/unityshell/src/FilterMultiRangeButton.cpp
Text conflict in plugins/unityshell/src/IMTextEntry.cpp
Text conflict in plugins/unityshell/src/LauncherIcon.cpp
Text conflict in plugins/unityshell/src/LensView.cpp
Text conflict in plugins/unityshell/src/PanelTray.cpp
Text conflict in plugins/unityshell/src/PanelView.cpp
Text conflict in plugins/unityshell/src/PlacesHomeView.cpp
Text conflict in plugins/unityshell/src/ResultViewGrid.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.h
Text conflict in plugins/unityshell/src/SwitcherModel.cpp
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:~smspillaz/unity/4.0_fix_912682
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+89114@code.launchpad.net

This proposal has been superseded by a proposal from 2012-01-19.

Description of the change

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2012-01-12 16:47:05 +0000
3+++ AUTHORS 2012-01-18 19:37:39 +0000
4@@ -57,6 +57,10 @@
5 Thomi Richards <thomir@gmail.com>, Alex Launi <alex.launi@canonical.com>
6 Tim Penhey <tim.penhey@canonical.com>
7 Ubuntu <ubuntu@netbook>
8+<<<<<<< TREE
9 Unity Merger <unity.merger@gmail.com>
10 Victor Eduardo <victormartinez79@gmail.com>
11 Zaid Yeganeh <zaid.yeganeh@gmail.com>
12+=======
13+ Zaid Yeganeh <zaid.yeganeh@gmail.com>
14+>>>>>>> MERGE-SOURCE
15
16=== modified file 'CMakeLists.txt'
17--- CMakeLists.txt 2011-12-19 22:18:53 +0000
18+++ CMakeLists.txt 2012-01-18 19:37:39 +0000
19@@ -7,8 +7,13 @@
20 # Base bits
21 #
22 set (PROJECT_NAME "unity")
23+<<<<<<< TREE
24 set (UNITY_MAJOR 5)
25 set (UNITY_MINOR 0)
26+=======
27+set (UNITY_MAJOR 4)
28+set (UNITY_MINOR 28)
29+>>>>>>> MERGE-SOURCE
30 set (UNITY_MICRO 0)
31 set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
32 set (UNITY_API_VERSION "5.0")
33
34=== modified file 'ChangeLog'
35--- ChangeLog 2012-01-12 16:47:05 +0000
36+++ ChangeLog 2012-01-18 19:37:39 +0000
37@@ -1,3 +1,4 @@
38+<<<<<<< TREE
39 2012-01-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
40
41 Fixed bug #914251, local variables should be passed by value.
42@@ -3369,6 +3370,398 @@
43
44 Release\ 4.22.0
45
46+=======
47+2011-12-15 Mirco Müller <mirco.mueller@canonical.com>
48+
49+ 4.26.0 release with backported fixes (from trunk), please consult "bzr log" for authors of individual patches
50+ * (LP #863114): cannot raise window from panel after minimize
51+ * (LP #865890): compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId()
52+ * back out a horizontal margin that breaks sizing in some cases
53+ * raise input windows from nux unconditionally on alt-tab and showing of the dash using compiz
54+ * (LP #832151): properly unref'ing tray the FilterTrayCallback should not be called again
55+ * (LP #834630): add an out-of-bounds check to the DetailXids vector
56+ * (LP #856205): backported from unity trunk
57+ * (LP #873100): clicking on panel when dash is open no longer causes maximized window to raise (backported r1751)
58+ * (LP #860805): get focus on dash by pressing the super key first time after login (backported r1759)
59+ * (LP #850623, LP #849611): don't segfault in geis_configuration_get_value() (backported r1728)
60+
61+2011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>
62+
63+ Fix tests for FilterMultirangeWidget
64+
65+2011-10-12 Zaid Yeganeh <zaid.yeganeh@gmail.com>
66+
67+ Lens range widgets do not function correctly
68+
69+2011-10-07 Zaid Yeganeh <zaid.yeganeh@gmail.com>
70+
71+ [UnityCore] Fixed the mouse interactions with the multi range filter
72+
73+ modified:
74+ UnityCore/MultiRangeFilter.cpp
75+
76+2011-10-12 Jay Ó Broin <ismise@lavabit.com>
77+
78+ Clicking blank space on top panel doesn't raise maximized window to front
79+
80+2011-10-10 Jay Ó Broin <ismise@lavabit.com>
81+
82+ Add handler to raise maximized window on left-click on panel (LP: #864708)
83+
84+2011-10-12 Brandon Schaefer <schbra02@evergreen.edu>
85+
86+ When the ibus was active and you pressed down it would move the focus to the result grid. Now when the ibus is active it keeps the focus when your press down/up
87+
88+2011-10-11 Brandon Schaefer <brandontschaefer@gmail.com>
89+
90+ Now pressing the ddown key with ibus works
91+
92+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
93+
94+ Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
95+
96+2011-10-11 Robert Carr <robert.carr@canonical.com>
97+
98+ Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
99+
100+2011-10-11 Robert Carr <robert.carr@canonical.com>
101+
102+ Minimum height of multi range filter should be the same as for Genre buttons (32)
103+
104+2011-10-11 Robert Carr <robert.carr@canonical.com>
105+
106+ Merge lp:~robertcarr/unity/filtertweaks
107+
108+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
109+
110+ Merge lp:~smspillaz/unity/unity.fix_870430
111+
112+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
113+
114+ Use correct memory management and temporarily disable focus handlers when passing
115+ the showdesktop wrap chain to core.
116+
117+ Core checks for whether or not the window is allowed focus, for minimized windows
118+ we set this to true because plugins such as scale need to check this value
119+ to determine if a window should be added to their display lists. However, core
120+ will set the "in showdesktop mode" value to true if the window is allowed to have
121+ focus and wasn't already in showdesktop mode by the time the wrap chain is passed,
122+ but the window is already hidden, so it shouldn't be allowed to be included in the
123+ showdesktop list, so disable focus handlers such that CompWindow::focus will
124+ return false
125+
126+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
127+
128+ Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
129+
130+2011-10-12 Marco Trevisan (Treviño) <mail@3v1n0.net>
131+
132+ Leak fix
133+
134+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
135+
136+ PanelService: Code spacing fix
137+
138+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
139+
140+ PanelService: entry2geometry_hash free the keys as well.
141+
142+2011-10-12 Sam Spilsbury <sam.spilsbury@canonical.com>
143+
144+ Merge lp:~smspillaz/unity/unity.fix_843958 (lp:unity r1714)
145+
146+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
147+
148+ Merge lp:~smspillaz/unity/unity.fix_870430 (lp:unity r1709)
149+
150+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
151+
152+ Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
153+
154+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
155+
156+ PanelService: reset the use_event variable on menu-hidden
157+
158+ This fixes the bug which caused the menus to re-close when opening one
159+ after that the previous one has been closed using the "ESC" button.
160+
161+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
162+
163+ PanelView: Sync geometries on panel window destruction
164+
165+ This clears the indicators and menus entries geometries cached
166+ in unity panel service.
167+
168+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
169+
170+ PanelView: always sync geometries for indicators.
171+
172+ Don't sync menus only if they aren't available in the current panel window
173+ for the given monitor.
174+
175+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
176+
177+ PanelView: When syncing geometries send a different panel name for each panel window
178+
179+ Thanks to the new unity-panel-service code, this finally fixes bug #869196
180+ for unity.
181+
182+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
183+
184+ PanelService: Order the entries geometry per-panel to fix multi-monitor issues
185+
186+ The entries geometries now are related to their parent panel, so every panel window
187+ that is built now can define the geometries of his own entries.
188+ This allows to redefine the get_entry_at function to make the event_filter function
189+ to work correctly also when we're in a multi-screen environment not cause the indicator
190+ menus to close on non-primary monitors.
191+
192+ This is the needed base to fix bug #869196
193+
194+2011-10-11 Neil Jagdish Patel <neil.patel@canonical.com>
195+
196+ Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
197+
198+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
199+
200+ PanelMenuView: don't react to middle-click when the dash is opened.
201+
202+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
203+
204+ PanelMenuView: don't react to double-click when the dash is opened.
205+
206+ Fixes bug #870844
207+
208+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
209+
210+ Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
211+
212+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
213+
214+ Bug #814610: FFe: Since showing devices in Nautilus is removed, there is no way to format an usb stick
215+
216+2011-09-24 Andrea Azzarone <azzaronea@gmail.com>
217+
218+ Add a "Format..." quicklist item to device icons (LP bug# 814610).
219+
220+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
221+
222+ Bug #862849: F10 opens a random menu item when it should open the first one [regression]
223+
224+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
225+
226+ Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
227+
228+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
229+
230+ Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
231+
232+2011-10-10 Robert Carr <racarr@canonical.com>
233+
234+ Minimum height of multi range filter should be the same as for Genre buttons (32)
235+
236+2011-10-10 Robert Carr <racarr@canonical.com>
237+
238+ Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
239+
240+2011-10-10 Robert Carr <racarr@canonical.com>
241+
242+ Merge lp:~robertcarr/unity/filtertweaks
243+
244+2011-10-10 Robert Carr <racarr@canonical.com>
245+
246+ Fix button opacity
247+
248+2011-10-10 Robert Carr <racarr@canonical.com>
249+
250+ Fix all button positioning and right margin
251+
252+2011-10-10 Robert Carr <racarr@canonical.com>
253+
254+ Fix all button shape
255+
256+2011-10-10 Robert Carr <racarr@canonical.com>
257+
258+ Filter Genre widget buttons are too big, fix to match mockup
259+
260+2011-10-10 Robert Carr <racarr@canonical.com>
261+
262+ Fix some spacing in filter bar. work against 863246
263+
264+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
265+
266+ Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
267+
268+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
269+
270+ Fixed additional issues (opacity, margin) added to LP: #841750
271+
272+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
273+
274+ Bug #862849: F10 opens a random menu item when it should open the first one [regression]
275+
276+2011-10-07 Andrea Azzarone <azzaronea@gmail.com>
277+
278+ F10 should open the first menu.
279+
280+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
281+
282+ Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
283+
284+2011-10-07 Mirco Müller <mirco.mueller@ubuntu.com>
285+
286+ Don't replace top-bar when dash is opened and there's a maximized window. Fix LP: #839480
287+
288+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
289+
290+ Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
291+
292+2011-10-07 Gord Allott <gord.allott@canonical.com>
293+
294+ fixes issues with clicking when you don't actually move the mouse, but the UI moves underneith it
295+
296+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
297+
298+ [merge] trunk
299+
300+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
301+
302+ ibus character selection window not drawn
303+
304+2011-10-09 Brandon Schaefer <brandontschaefer@gmail.com>
305+
306+ Fixed the preedit_cursor_
307+
308+2011-10-07 Brandon Schaefer <brandontschaefer@gmail.com>
309+
310+ Fixed ibus window and text disappearing. Also the preedit text is now highlighted, like it usually is else where
311+
312+2011-10-10 Sam Spilsbury <sam.spilsbury@canonical.com>
313+
314+ Merge lp:~smspillaz/unity/unity.fix_864758
315+
316+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
317+
318+ Remove old minimized window handlers from the handler list and null check
319+ the transient for windows that we read, since compiz may have already removed
320+ them.
321+
322+ Fixes LP #864758
323+
324+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
325+
326+ Merge lp:~smspillaz/unity/unity.fix_868930
327+
328+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
329+
330+ Use a temporary
331+
332+2011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
333+
334+ Do automaximization on placement which only happens once when the window
335+ is mapped after it is created, rather than on reparenting which may happen
336+ if the window is withdrawn.
337+
338+ Fixes LP #868930
339+
340+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
341+
342+ Merge lp:~smspillaz/unity/unity.fix_867959
343+
344+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
345+
346+ Fix space
347+
348+2011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
349+
350+ Check for hidden windows rather than minimized ones to cover the
351+ show-desktop case
352+
353+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
354+
355+ Merge lp:~smspillaz/unity/unity.fix_854595
356+
357+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
358+
359+ Cast correctly
360+
361+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
362+
363+ Use an enum
364+
365+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
366+
367+ Only force unminimize windows for the launcher case
368+
369+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
370+
371+ Always unminimize initially minimized windows when a launcher icon is
372+ activated since they are inaccessible elsewhere
373+
374+ Fix LP #854595
375+
376+2011-10-06 Jay Taoko <jay.taoko@canonical.com>
377+
378+ Resize the _gradient_texture (in PanelMenuView::Draw) if needed
379+
380+ Fix: bug #863068
381+ Fix: bug #868293
382+ Fix: bug #869028
383+
384+2011-10-06 Alejandro Piñeiro <apinheiro@igalia.com>
385+
386+ Fix bug 843280
387+
388+2011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
389+
390+ Avoid a shadowed variable
391+
392+2011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
393+
394+ a11y: Solves bug 843280
395+
396+2011-10-05 Alex Launi <alex.launi@canonical.com>
397+
398+ merge fix for GetState crash
399+
400+2011-10-03 Alex Launi <alex.launi@canonical.com>
401+
402+ Remove introspection implementations on PanelMenuView to avoid crash
403+
404+2011-10-03 Alex Launi <alex.launi@canonical.com>
405+
406+ merge trunk
407+
408+2011-10-05 Michal Hruby <michal.mhr@gmail.com>
409+
410+ Merge lp:~mhr3/unity/bug-865482
411+
412+2011-10-05 Michal Hruby <michal.mhr@gmail.com>
413+
414+ Merge lp:~mhr3/unity/bug-865482
415+
416+2011-10-04 Michal Hruby <michal.mhr@gmail.com>
417+
418+ Fix bug #865482
419+
420+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
421+
422+ Merge lp:~smspillaz/unity/unity.fix_868185
423+
424+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
425+
426+ Merge lp:~smspillaz/untiy/unity.fix_868185
427+
428+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
429+
430+ Fix LP#868185 . Fall through the map case when determining whether or
431+ not to hook the minimize function in core
432+
433+2011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>
434+
435+ Release\ 4.22.0
436+
437+>>>>>>> MERGE-SOURCE
438 2011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>
439
440 Add -lm
441
442=== added directory 'manual-tests'
443=== renamed directory 'manual-tests' => 'manual-tests.moved'
444=== added file 'manual-tests/QuicklistOnExpo.txt'
445--- manual-tests/QuicklistOnExpo.txt 1970-01-01 00:00:00 +0000
446+++ manual-tests/QuicklistOnExpo.txt 2012-01-18 19:37:39 +0000
447@@ -0,0 +1,14 @@
448+Test Quicklist while on Expo
449+============================
450+
451+This test shows how the launcher quicklists work when the expo plugin is activated.
452+
453+#. Start with a clear screen
454+#. Press Super+S or select the workspace switcher on the launcher
455+#. When the workspace switcher is running, right-click over a launcher icon
456+
457+Outcome
458+ The expo should terminate, and the quicklist should be shown once the
459+ workspace switcher has been closed.
460+ Clicking over a quicklist item should work as expected and clicking outside
461+ that quicklist, should close it.
462
463=== added file 'manual-tests/ReadMe.txt'
464--- manual-tests/ReadMe.txt 1970-01-01 00:00:00 +0000
465+++ manual-tests/ReadMe.txt 2012-01-18 19:37:39 +0000
466@@ -0,0 +1,47 @@
467+==============
468+Manual Testing
469+==============
470+
471+Outline
472+-------
473+Sometimes it is not possible to easily make an automated test for some
474+use-cases. However just because something isn't easily tested automatically
475+doesn't mean that there isn't value in creating a test for it, just that the
476+test needs to be executed by a person until it is converted into an automated
477+test.
478+
479+
480+Format
481+------
482+Manual tests take the format of text files in this directory (the manual-test
483+one). These files are formatted using `reStructured Text`_. A very
484+comprehensive `quick reference`_ is available.
485+
486+.. _reStructured Text: http://en.wikipedia.org/wiki/ReStructuredText
487+.. _quick reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
488+
489+Tests have a header, steps to follow, and an expected outcome, as demonstrated
490+by the following example:
491+
492+There can be multiple tests in a single file, but they should all be related,
493+and the filename should indicate the tests it contains.
494+
495+
496+Test Dash
497+---------
498+This test shows that the dash appears when the super key is pushed.
499+
500+#. Start with a clear screen
501+#. Press the <super> key
502+
503+Outcome
504+ The dash appears, and focus is in the search box. The icons on the laucher
505+ are desaturated except for the ubuntu button at the top. The icons in the
506+ panel go white.
507+
508+
509+Directory Structure
510+-------------------
511+It is expected that as we grow a number of manual tests, we will use
512+directories to organise them.
513+
514
515=== added directory 'manual-tests/custom-dash-home'
516=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json'
517--- manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 1970-01-01 00:00:00 +0000
518+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 2012-01-18 19:37:39 +0000
519@@ -0,0 +1,22 @@
520+{
521+ "shortcut1": {
522+ "source": "/usr/share/applications/ubuntu-software-center.desktop",
523+ "name": "Software Center",
524+ "name[fr]": "Logithèque",
525+ "icon": "/usr/share/icons/Humanity/places/64/start-here.svg"
526+ },
527+ "shortcut2": {
528+ "source": "music.lens",
529+ "filter": "genre:rock",
530+ "name": "Rock Music"
531+ },
532+ "shortcut3": {
533+ "source": "files.lens",
534+ "filter": "type:videos",
535+ "name": "Vidéos",
536+ "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg"
537+ },
538+ "shortcut4": {
539+ "source": "transmission-gtk.desktop"
540+ }
541+}
542
543=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json'
544--- manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 1970-01-01 00:00:00 +0000
545+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 2012-01-18 19:37:39 +0000
546@@ -0,0 +1,44 @@
547+{
548+ "shortcut1": {
549+ "source": "/usr/share/applications/ubuntu-software-center.desktop",
550+ "name": "Software Center",
551+ "name[fr]": "Logithèque",
552+ "icon": "/usr/share/icons/Humanity/places/64/start-here.svg"
553+ },
554+ "shortcut2": {
555+ "source": "music.lens",
556+ "filter": "genre:rock",
557+ "name": "Rock Music"
558+ },
559+ "shortcut3": {
560+ "source": "files.lens",
561+ "filter": "type:videos",
562+ "name": "Vidéos",
563+ "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg"
564+ },
565+ "shortcut4": {
566+ "source": "transmission-gtk.desktop"
567+ },
568+ "shortcut5": {
569+ "source": "/usr/share/applications/eog.desktop",
570+ "name": "Eye Of Gnome",
571+ "name[de]": "Auge des Zwergs",
572+ "icon": "/usr/share/icons/hicolor/scalable/apps/eog.svg"
573+ },
574+ "shortcut6": {
575+ "source": "/usr/share/applications/jockey-gtk.desktop",
576+ "name": "Jockey",
577+ "name[de]": "Jockey",
578+ "icon": "/usr/share/icons/hicolor/scalable/apps/jockey.svg"
579+ },
580+ "shortcut7": {
581+ "source": "/usr/share/applications/gwibber.desktop",
582+ "name": "gwibber",
583+ "icon": "/usr/share/icons/hicolor/scalable/apps/gwibber.svg"
584+ },
585+ "shortcut8": {
586+ "source": "/usr/share/applications/giggle.desktop",
587+ "name": "Giggle",
588+ "icon": "/usr/share/icons/hicolor/scalable/apps/giggle.svg"
589+ }
590+}
591
592=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json'
593--- manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 1970-01-01 00:00:00 +0000
594+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 2012-01-18 19:37:39 +0000
595@@ -0,0 +1,23 @@
596+this is some intentional garbage with lots of errors
597+{
598+ "shortcut1": {
599+ "source": "/usr/share/applications/ubuntu-software-center.desktop",
600+ "name": "Software Center",
601+ "name[fr]": "Logithèque",
602+ "icn": "/usr/share/icons/Humanity/places/64/start-here.svg"
603+ },
604+ "shortcut2": {
605+ "sorce": "music.lens",
606+ "filter": "genre:rock",
607+ "name": "Rock Music"
608+ },
609+ "shortcut3": {
610+ "source": "files.lens",
611+ "filter": "type:videos",
612+ "name": "Vidéos",
613+ "icon": "/usr/share/icons/Humanity/actions/64/hep-about.svg"
614+ },
615+ "shortcut12": {
616+ "source": "transmission-gtk.destop"
617+ }
618+}
619
620=== added file 'manual-tests/custom-dash-home/custom-dash-home.txt'
621--- manual-tests/custom-dash-home/custom-dash-home.txt 1970-01-01 00:00:00 +0000
622+++ manual-tests/custom-dash-home/custom-dash-home.txt 2012-01-18 19:37:39 +0000
623@@ -0,0 +1,46 @@
624+Manual tests for the 'dash custom home screen' functionality
625+============================================================
626+
627+How to test
628+-----------
629+
630+To test the functionality, create the folder $HOME/.config/unity/, and copy the
631+three files HomeShortcutsCustomized*.json there.
632+
633+Then for each of them repeat the following steps:
634+
635+ cd $HOME/.config/unity/
636+ rm HomeShortcutsCustomized.json
637+ ln -s $FILE HomeShortcutsCustomized.json # replace $FILE with the json file being considered
638+ # restart unity
639+ # open the dash
640+ # check the visual appearance against the expected results detailed below
641+
642+
643+Expected results
644+----------------
645+
646+With 'HomeShortcutsCustomized-4-entries.json', the home screen of the dash
647+contains 4 icons that fill the first row. The second row is empty.
648+Those icons are:
649+ - "Software Center": launches the Ubuntu Software Center, the icon is the
650+ Ubuntu Circle Of Friends, and if you are running with a French locale the
651+ name is localized to "Logithèque".
652+ - "Rock Music": opens the music lens with the genre filter set to "Rock".
653+ - "Vidéos": opens the files lens with the type filter set to "videos", the icon
654+ is a yellow star.
655+ - "Transmission BitTorrent Client": launches transmission-gtk.
656+
657+With 'HomeShortcutsCustomized-8-entries.json', the home screen of the dash
658+contains 8 icons that fill the two rows. The first row contains the exact same
659+icons as 'HomeShortcutsCustomized-4-entries.json' (see details above). The icons
660+on the second row are:
661+ - "Eye Of Gnome": launches eog, if you are running with a German locale the
662+ name is localized to "Auge des Zwergs".
663+ - "Jockey": launches jockey-gtk.
664+ - "gwibber": launches gwibber.
665+ - "Giggle": this icon appears only if giggle is installed, it launches giggle.
666+
667+With 'HomeShortcutsCustomized-broken.json', the home screen of the dash contains
668+the default icons because the file fails to be parsed.
669+
670
671=== added file 'manual-tests/launcher.txt'
672--- manual-tests/launcher.txt 1970-01-01 00:00:00 +0000
673+++ manual-tests/launcher.txt 2012-01-18 19:37:39 +0000
674@@ -0,0 +1,11 @@
675+Test Dash Key Focus
676+-------------------
677+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.
678+
679+#. Start on a fresh login
680+#. Press the <super> key
681+#. Wait for dash to appear
682+#. Type "hello"
683+
684+Outcome
685+ The dash will appear, and "hello" will be in the search box.
686
687=== modified file 'plugins/unityshell/resources/dash-widgets.json'
688--- plugins/unityshell/resources/dash-widgets.json 2012-01-13 15:13:30 +0000
689+++ plugins/unityshell/resources/dash-widgets.json 2012-01-18 19:37:39 +0000
690@@ -46,8 +46,13 @@
691 "text-size" : 1.0,
692 "text-color" : ["#ffffff", "#ffffff", "#ffffff", "#ffffff", "#ffffff"],
693 "text-opacity" : [ 1.0, 1.0, 1.0, 1.0, 1.0],
694+<<<<<<< TREE
695 "fill-color" : ["#FFFFFF", "#000000", "#000000", "#000000", "#000000"],
696 "fill-opacity" : [ 0.15, 0.0, 0.0, 0.0, 0.0],
697+=======
698+ "fill-color" : ["#FFFFFF", "#000000", "#ffffff", "#000000", "#000000"],
699+ "fill-opacity" : [ 0.25, 0.0, 0.25, 0.0, 0.0],
700+>>>>>>> MERGE-SOURCE
701 "overlay-opacity": [ 0.1, 0.1, 0.1, 0.0, 0.0],
702 "overlay-mode" : [ "normal", "normal", "normal", "normal", "normal"],
703 "blur-size" : [ 1, 1, 1, 0, 0]},
704
705=== modified file 'plugins/unityshell/src/BackgroundEffectHelper.cpp'
706=== modified file 'plugins/unityshell/src/BackgroundEffectHelper.h'
707=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
708--- plugins/unityshell/src/BamfLauncherIcon.cpp 2012-01-13 14:30:52 +0000
709+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2012-01-18 19:37:39 +0000
710@@ -82,9 +82,13 @@
711
712 if (arg.source != ActionArg::SWITCHER)
713 {
714+<<<<<<< TREE
715 user_visible = bamf_view_user_visible(BAMF_VIEW(m_App));
716
717 bool any_visible = false;
718+=======
719+ bool any_visible = false;
720+>>>>>>> MERGE-SOURCE
721 for (l = bamf_view_get_children(BAMF_VIEW(m_App)); l; l = l->next)
722 {
723 view = static_cast <BamfView*> (l->data);
724@@ -92,12 +96,19 @@
725 if (BAMF_IS_WINDOW(view))
726 {
727 Window xid = bamf_window_get_xid(BAMF_WINDOW(view));
728+<<<<<<< TREE
729
730 if (!any_visible && WindowManager::Default()->IsWindowOnCurrentDesktop(xid))
731 {
732 any_visible = true;
733 }
734 if (active && !WindowManager::Default()->IsWindowMapped(xid))
735+=======
736+
737+ if (WindowManager::Default ()->IsWindowOnCurrentDesktop(xid))
738+ any_visible = true;
739+ if (!WindowManager::Default ()->IsWindowMapped(xid))
740+>>>>>>> MERGE-SOURCE
741 {
742 active = false;
743 }
744@@ -582,8 +593,12 @@
745 GList* children, *l;
746 BamfView* view;
747 bool any_urgent = false;
748+<<<<<<< TREE
749 bool any_visible = false;
750 bool any_user_visible = false;
751+=======
752+ bool any_visible = false;
753+>>>>>>> MERGE-SOURCE
754
755 children = bamf_view_get_children(BAMF_VIEW(m_App));
756
757@@ -600,6 +615,10 @@
758 bool urgent = bamf_view_is_urgent(view);
759 bool user_visible = bamf_view_user_visible(view);
760
761+ if (WindowManager::Default ()->IsWindowOnCurrentDesktop (xid) &&
762+ WindowManager::Default ()->IsWindowVisible (xid))
763+ any_visible = true;
764+
765 if (any_urgent)
766 {
767 if (urgent)
768@@ -615,19 +634,31 @@
769 if (urgent || user_visible)
770 {
771 windows.clear();
772+<<<<<<< TREE
773 any_visible = false;
774 any_urgent = (any_urgent || urgent);
775 any_user_visible = (any_user_visible || user_visible);
776+=======
777+ any_visible = false;
778+ any_urgent = true;
779+>>>>>>> MERGE-SOURCE
780 }
781+<<<<<<< TREE
782
783 windows.push_back(xid);
784+=======
785+>>>>>>> MERGE-SOURCE
786 }
787+<<<<<<< TREE
788
789 if (WindowManager::Default()->IsWindowOnCurrentDesktop(xid) &&
790 WindowManager::Default()->IsWindowVisible(xid))
791 {
792 any_visible = true;
793 }
794+=======
795+ windows.push_back(xid);
796+>>>>>>> MERGE-SOURCE
797 }
798 }
799 g_list_free(children);
800
801=== modified file 'plugins/unityshell/src/DashController.cpp'
802--- plugins/unityshell/src/DashController.cpp 2011-12-08 01:23:11 +0000
803+++ plugins/unityshell/src/DashController.cpp 2012-01-18 19:37:39 +0000
804@@ -131,8 +131,13 @@
805 SetupDashView();
806 Relayout();
807 ensure_id_ = 0;
808+<<<<<<< TREE
809
810 on_realize.emit();
811+=======
812+
813+ on_realize.emit ();
814+>>>>>>> MERGE-SOURCE
815 }
816
817 nux::BaseWindow* Controller::window() const
818
819=== modified file 'plugins/unityshell/src/DashController.h'
820=== modified file 'plugins/unityshell/src/DashSearchBar.cpp'
821--- plugins/unityshell/src/DashSearchBar.cpp 2012-01-17 15:39:16 +0000
822+++ plugins/unityshell/src/DashSearchBar.cpp 2012-01-18 19:37:39 +0000
823@@ -218,6 +218,7 @@
824 (GSourceFunc)&OnLiveSearchTimeout,
825 this);
826
827+<<<<<<< TREE
828 // Don't animate the spinner immediately, the searches are fast and
829 // the spinner would just flicker
830 if (start_spinner_timeout_)
831@@ -228,6 +229,10 @@
832 this);
833
834 bool is_empty = pango_entry_->im_active() ? false : pango_entry_->GetText() == "";
835+=======
836+
837+ bool is_empty = pango_entry_->im_active() ? false : pango_entry_->GetText() == "";
838+>>>>>>> MERGE-SOURCE
839 hint_->SetVisible(is_empty);
840
841 pango_entry_->QueueDraw();
842
843=== modified file 'plugins/unityshell/src/DashView.cpp'
844--- plugins/unityshell/src/DashView.cpp 2012-01-17 13:31:52 +0000
845+++ plugins/unityshell/src/DashView.cpp 2012-01-18 19:37:39 +0000
846@@ -72,8 +72,15 @@
847
848 DashView::~DashView()
849 {
850- if (searching_timeout_id_)
851- g_source_remove (searching_timeout_id_);
852+<<<<<<< TREE
853+ if (searching_timeout_id_)
854+ g_source_remove (searching_timeout_id_);
855+=======
856+ if (searching_timeout_id_)
857+ g_source_remove (searching_timeout_id_);
858+ delete bg_layer_;
859+ delete bg_darken_layer_;
860+>>>>>>> MERGE-SOURCE
861 }
862
863 void DashView::AboutToShow()
864@@ -306,6 +313,17 @@
865 return FALSE;
866 }
867
868+gboolean DashView::ResetSearchStateCb(gpointer data)
869+{
870+ DashView *self = static_cast<DashView*>(data);
871+
872+ self->search_in_progress_ = false;
873+ self->activate_on_finish_ = false;
874+ self->searching_timeout_id_ = 0;
875+
876+ return FALSE;
877+}
878+
879 void DashView::OnSearchChanged(std::string const& search_string)
880 {
881 LOG_DEBUG(logger) << "Search changed: " << search_string;
882@@ -384,6 +402,7 @@
883
884 void DashView::OnSearchFinished(Lens::Hints const& hints)
885 {
886+<<<<<<< TREE
887 Lens::Hints::const_iterator it;
888 it = hints.find("no-results-hint");
889
890@@ -395,6 +414,10 @@
891 std::string search_string = search_bar_->search_string;
892 if (active_lens_view_ && active_lens_view_->search_string == search_string)
893 {
894+=======
895+ if (search_bar_->search_string == search_string)
896+ {
897+>>>>>>> MERGE-SOURCE
898 search_bar_->SearchFinished();
899 search_in_progress_ = false;
900 if (activate_on_finish_)
901
902=== modified file 'plugins/unityshell/src/DashView.h'
903--- plugins/unityshell/src/DashView.h 2012-01-16 15:31:59 +0000
904+++ plugins/unityshell/src/DashView.h 2012-01-18 19:37:39 +0000
905@@ -126,10 +126,16 @@
906 OverlayRenderer renderer_;
907
908 std::string last_activated_uri_;
909+<<<<<<< TREE
910 // we're passing this back to g_* functions, so we'll keep the g* type
911 guint searching_timeout_id_;
912 bool search_in_progress_;
913 bool activate_on_finish_;
914+=======
915+ guint searching_timeout_id_;
916+ bool search_in_progress_;
917+ bool activate_on_finish_;
918+>>>>>>> MERGE-SOURCE
919
920 bool visible_;
921 };
922
923=== modified file 'plugins/unityshell/src/FilterBar.cpp'
924--- plugins/unityshell/src/FilterBar.cpp 2011-12-20 14:25:28 +0000
925+++ plugins/unityshell/src/FilterBar.cpp 2012-01-18 19:37:39 +0000
926@@ -39,6 +39,7 @@
927
928 NUX_IMPLEMENT_OBJECT_TYPE(FilterBar);
929
930+<<<<<<< TREE
931 FilterBar::FilterBar(NUX_FILE_LINE_DECL)
932 : View(NUX_FILE_LINE_PARAM)
933 {
934@@ -83,6 +84,46 @@
935 for (auto iter: filter_map_)
936 {
937 if (iter.first->id == filter->id)
938+=======
939+ FilterBar::FilterBar(NUX_FILE_LINE_DECL)
940+ : View (NUX_FILE_LINE_PARAM) {
941+ // TODO - does the filterbar associate itself with a model of some sort?
942+ // does libunity provide a Lens.Filters model or something that we can update on?
943+ // don't want to associate a Filterbar with just a lens model, its a filter bar not a
944+ // lens parser
945+ Init ();
946+ }
947+
948+ FilterBar::~FilterBar()
949+ {
950+ }
951+
952+ void FilterBar::Init () {
953+ nux::Layout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);
954+ layout->SetVerticalInternalMargin(12);
955+ layout->SetVerticalExternalMargin(0);
956+ SetLayout (layout);
957+ }
958+
959+ void FilterBar::SetFilters (dash::Filters::Ptr filters)
960+ {
961+ filters_ = filters;
962+ }
963+
964+ void FilterBar::AddFilter (dash::Filter::Ptr filter) {
965+ if (filter_map_.count (filter) > 0) {
966+ g_warning ("Attempting to add a filter that has already been added");
967+ return;
968+ }
969+
970+ nux::View *filter_view = factory_.WidgetForFilter (filter);
971+ filter_map_[filter] = filter_view;
972+ GetLayout()->AddView(filter_view, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
973+ }
974+
975+ void FilterBar::RemoveFilter (dash::Filter::Ptr filter) {
976+ for (auto iter: filter_map_)
977+>>>>>>> MERGE-SOURCE
978 {
979 nux::View* filter_view = iter.second;
980 filter_map_.erase(filter_map_.find(iter.first));
981
982=== modified file 'plugins/unityshell/src/FilterExpanderLabel.cpp'
983--- plugins/unityshell/src/FilterExpanderLabel.cpp 2012-01-10 14:09:12 +0000
984+++ plugins/unityshell/src/FilterExpanderLabel.cpp 2012-01-18 19:37:39 +0000
985@@ -23,6 +23,7 @@
986 #include "DashStyle.h"
987 #include "FilterBasicButton.h"
988 #include "FilterExpanderLabel.h"
989+#include "PlacesStyle.h"
990
991 namespace unity
992 {
993@@ -31,6 +32,7 @@
994
995 NUX_IMPLEMENT_OBJECT_TYPE(FilterExpanderLabel);
996
997+<<<<<<< TREE
998 FilterExpanderLabel::FilterExpanderLabel(std::string const& label, NUX_FILE_LINE_DECL)
999 : FilterWidget(NUX_FILE_LINE_PARAM)
1000 , expanded(true)
1001@@ -150,3 +152,111 @@
1002
1003 } // namespace dash
1004 } // namespace unity
1005+=======
1006+ FilterExpanderLabel::FilterExpanderLabel (std::string label, NUX_FILE_LINE_DECL)
1007+ : nux::View (NUX_FILE_LINE_PARAM)
1008+ , expanded (true)
1009+ , top_bar_layout_ (NULL)
1010+ , contents_ (NULL)
1011+ , right_hand_contents_ (NULL)
1012+ , expander_graphic_ (NULL)
1013+ , label_("<span size='larger' weight='bold'>" + label + "</span>")
1014+ {
1015+ expanded.changed.connect (sigc::mem_fun(this, &FilterExpanderLabel::DoExpandChange));
1016+ BuildLayout ();
1017+ }
1018+
1019+ FilterExpanderLabel::~FilterExpanderLabel() {
1020+
1021+ }
1022+
1023+ void FilterExpanderLabel::SetLabel (std::string label)
1024+ {
1025+ label_ = "<span size='larger' weight='bold'>" + label + "</span>";
1026+ cairo_label_->SetText(label_.c_str());
1027+ }
1028+
1029+ void FilterExpanderLabel::SetRightHandView (nux::View *view)
1030+ {
1031+ view->SetMaximumHeight(30);
1032+
1033+ right_hand_contents_ = view;
1034+ top_bar_layout_->AddView(right_hand_contents_, 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
1035+ }
1036+
1037+ void FilterExpanderLabel::SetContents (nux::Layout *contents)
1038+ {
1039+ contents_ = contents;
1040+ contents_->SetVisible(expanded);
1041+ layout_->AddLayout (contents_, 1, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
1042+
1043+ QueueDraw();
1044+ }
1045+
1046+ void FilterExpanderLabel::BuildLayout ()
1047+ {
1048+ PlacesStyle *style = PlacesStyle::GetDefault();
1049+
1050+ layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);
1051+ top_bar_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
1052+
1053+ cairo_label_ = new nux::StaticText(label_.c_str(), NUX_TRACKER_LOCATION);
1054+ cairo_label_->SetFontName("Ubuntu 10");
1055+ cairo_label_->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
1056+ cairo_label_->mouse_down.connect(
1057+ [&](int x, int y, unsigned long button_flags, unsigned long key_flag)
1058+ {
1059+ expanded = !expanded;
1060+ if (contents_)
1061+ contents_->SetVisible(expanded);
1062+ QueueDraw();
1063+ });
1064+
1065+ top_bar_layout_->AddView (cairo_label_, 1, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
1066+ top_bar_layout_->AddSpace(1, 1);
1067+
1068+ top_bar_layout_->SetMaximumWidth((style->GetTileWidth() -12)*2+10);
1069+
1070+ layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);
1071+ layout_->SetVerticalInternalMargin(0);
1072+
1073+ SetLayout(layout_);
1074+
1075+ QueueRelayout();
1076+ NeedRedraw();
1077+ }
1078+
1079+ void FilterExpanderLabel::DoExpandChange (bool change)
1080+ {
1081+ if (contents_)
1082+ contents_->SetVisible(change);
1083+
1084+ QueueRelayout();
1085+ }
1086+
1087+ long int FilterExpanderLabel::ProcessEvent(nux::IEvent& ievent, long int TraverseInfo, long int ProcessEventInfo) {
1088+ return GetLayout()->ProcessEvent(ievent, TraverseInfo, ProcessEventInfo);
1089+ }
1090+
1091+ void FilterExpanderLabel::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {
1092+ nux::Geometry geo = GetGeometry();
1093+
1094+ GfxContext.PushClippingRectangle(geo);
1095+ nux::GetPainter().PaintBackground(GfxContext, geo);
1096+ GfxContext.PopClippingRectangle();
1097+ }
1098+
1099+ void FilterExpanderLabel::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) {
1100+ GfxContext.PushClippingRectangle(GetGeometry());
1101+
1102+ GetLayout()->ProcessDraw(GfxContext, force_draw);
1103+
1104+ GfxContext.PopClippingRectangle();
1105+ }
1106+
1107+ void FilterExpanderLabel::PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw) {
1108+ nux::View::PostDraw(GfxContext, force_draw);
1109+ }
1110+
1111+};
1112+>>>>>>> MERGE-SOURCE
1113
1114=== modified file 'plugins/unityshell/src/FilterGenreWidget.cpp'
1115--- plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-18 10:28:45 +0000
1116+++ plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-18 19:37:39 +0000
1117@@ -36,6 +36,7 @@
1118
1119 NUX_IMPLEMENT_OBJECT_TYPE(FilterGenre);
1120
1121+<<<<<<< TREE
1122 FilterGenre::FilterGenre(int columns, NUX_FILE_LINE_DECL)
1123 : FilterExpanderLabel(_("Categories"), NUX_FILE_LINE_PARAM)
1124 {
1125@@ -101,6 +102,81 @@
1126 for (auto it=buttons_.begin() ; it != buttons_.end(); ++it)
1127 {
1128 if ((*it)->GetFilter() == removed_filter)
1129+=======
1130+ FilterGenre::FilterGenre (NUX_FILE_LINE_DECL)
1131+ : FilterExpanderLabel (_("Categories"), NUX_FILE_LINE_PARAM)
1132+ , all_selected (false)
1133+ {
1134+ InitTheme();
1135+
1136+ all_button_ = new FilterBasicButton(_("All"), NUX_TRACKER_LOCATION);
1137+ all_button_->activated.connect(sigc::mem_fun(this, &FilterGenre::OnAllActivated));
1138+ all_button_->label = _("All");
1139+
1140+ PlacesStyle* style = PlacesStyle::GetDefault();
1141+
1142+ genre_layout_ = new nux::GridHLayout(NUX_TRACKER_LOCATION);
1143+ genre_layout_->ForceChildrenSize(true);
1144+ genre_layout_->SetHeightMatchContent(true);
1145+ genre_layout_->SetVerticalInternalMargin (12);
1146+ genre_layout_->SetVerticalExternalMargin (12);
1147+ genre_layout_->SetHorizontalInternalMargin (10);
1148+ genre_layout_->EnablePartialVisibility (false);
1149+ genre_layout_->SetChildrenSize (style->GetTileWidth() - 12, 32);
1150+
1151+ SetRightHandView(all_button_);
1152+ SetContents(genre_layout_);
1153+ }
1154+
1155+ FilterGenre::~FilterGenre()
1156+ {
1157+ }
1158+
1159+ void FilterGenre::SetFilter(dash::Filter::Ptr filter)
1160+ {
1161+ filter_ = std::static_pointer_cast<dash::CheckOptionFilter>(filter);
1162+
1163+ filter_->option_added.connect (sigc::mem_fun (this, &FilterGenre::OnOptionAdded));
1164+ filter_->option_removed.connect(sigc::mem_fun (this, &FilterGenre::OnOptionRemoved));
1165+
1166+ // finally - make sure we are up-todate with our filter list
1167+ dash::CheckOptionFilter::CheckOptions::iterator it;
1168+ dash::CheckOptionFilter::CheckOptions options = filter_->options;
1169+ for (it = options.begin(); it < options.end(); it++)
1170+ OnOptionAdded(*it);
1171+
1172+ SetLabel(filter_->name);
1173+ }
1174+
1175+ void FilterGenre::OnOptionAdded(dash::FilterOption::Ptr new_filter)
1176+ {
1177+ std::string tmp_label = new_filter->name;
1178+
1179+ char* escape = g_markup_escape_text(tmp_label.c_str(), -1);
1180+ std::string label = escape;
1181+ g_free(escape);
1182+
1183+ FilterGenreButton* button = new FilterGenreButton (label, NUX_TRACKER_LOCATION);
1184+ button->SetFilter (new_filter);
1185+ genre_layout_->AddView (button, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
1186+ buttons_.push_back (button);
1187+ }
1188+
1189+ void FilterGenre::OnOptionRemoved(dash::FilterOption::Ptr removed_filter)
1190+ {
1191+ std::vector<FilterGenreButton*>::iterator it;
1192+ FilterGenreButton* found_filter = NULL;
1193+ for ( it=buttons_.begin() ; it < buttons_.end(); it++ )
1194+ {
1195+ if ((*it)->GetFilter() == removed_filter)
1196+ {
1197+ found_filter = *it;
1198+ break;
1199+ }
1200+ }
1201+
1202+ if (found_filter)
1203+>>>>>>> MERGE-SOURCE
1204 {
1205 genre_layout_->RemoveChildObject(*it);
1206 buttons_.erase(it);
1207
1208=== modified file 'plugins/unityshell/src/FilterMultiRangeButton.cpp'
1209--- plugins/unityshell/src/FilterMultiRangeButton.cpp 2012-01-10 14:09:12 +0000
1210+++ plugins/unityshell/src/FilterMultiRangeButton.cpp 2012-01-18 19:37:39 +0000
1211@@ -25,6 +25,7 @@
1212 #include "DashStyle.h"
1213 #include "FilterMultiRangeButton.h"
1214
1215+<<<<<<< TREE
1216 namespace unity
1217 {
1218 namespace dash
1219@@ -203,3 +204,196 @@
1220
1221 } // namespace dash
1222 } // namespace unity
1223+=======
1224+namespace unity {
1225+ FilterMultiRangeButton::FilterMultiRangeButton (const std::string label, NUX_FILE_LINE_DECL)
1226+ : nux::ToggleButton(label, NUX_FILE_LINE_PARAM)
1227+ , prelight_ (NULL)
1228+ , active_ (NULL)
1229+ , normal_ (NULL)
1230+ , has_arrow_ (MULTI_RANGE_ARROW_NONE)
1231+ , side_ (MULTI_RANGE_CENTER)
1232+ {
1233+ InitTheme();
1234+ activated.connect (sigc::mem_fun(this, &FilterMultiRangeButton::OnActivated));
1235+ active.changed.connect (sigc::mem_fun(this, &FilterMultiRangeButton::OnActiveChanged));
1236+ }
1237+
1238+ FilterMultiRangeButton::FilterMultiRangeButton (NUX_FILE_LINE_DECL)
1239+ : nux::ToggleButton(NUX_FILE_LINE_PARAM)
1240+ , prelight_ (NULL)
1241+ , active_ (NULL)
1242+ , normal_ (NULL)
1243+ , has_arrow_ (MULTI_RANGE_ARROW_NONE)
1244+ , side_ (MULTI_RANGE_CENTER)
1245+ {
1246+ InitTheme();
1247+ activated.connect (sigc::mem_fun(this, &FilterMultiRangeButton::OnActivated));
1248+ active.changed.connect (sigc::mem_fun(this, &FilterMultiRangeButton::OnActiveChanged));
1249+ }
1250+
1251+ FilterMultiRangeButton::~FilterMultiRangeButton()
1252+ {
1253+ delete prelight_;
1254+ delete normal_;
1255+ delete active_;
1256+ }
1257+
1258+ void FilterMultiRangeButton::OnActivated (nux::Area *area)
1259+ {
1260+ bool tmp_active = active;
1261+ if (filter_ != NULL)
1262+ filter_->active = tmp_active;
1263+ }
1264+
1265+ void FilterMultiRangeButton::OnActiveChanged(bool value)
1266+ {
1267+ NeedRedraw();
1268+ }
1269+
1270+ void FilterMultiRangeButton::SetFilter (dash::FilterOption::Ptr filter)
1271+ {
1272+ filter_ = filter;
1273+ bool tmp_active = filter_->active;
1274+ active = tmp_active;
1275+ }
1276+
1277+ dash::FilterOption::Ptr FilterMultiRangeButton::GetFilter()
1278+ {
1279+ return filter_;
1280+ }
1281+
1282+ void FilterMultiRangeButton::SetVisualSide (MultiRangeSide side)
1283+ {
1284+ side_ = side;
1285+ prelight_->Invalidate(GetGeometry());
1286+ active_->Invalidate(GetGeometry());
1287+ normal_->Invalidate(GetGeometry());
1288+ }
1289+
1290+ void FilterMultiRangeButton::SetHasArrow (MultiRangeArrow value)
1291+ {
1292+ has_arrow_ = value;
1293+ active_->Invalidate(GetGeometry());
1294+ NeedRedraw();
1295+ }
1296+
1297+ long FilterMultiRangeButton::ComputeLayout2()
1298+ {
1299+ if (prelight_ == NULL)
1300+ {
1301+ InitTheme();
1302+ }
1303+ long ret = nux::ToggleButton::ComputeLayout2();
1304+ if (cached_geometry_ != GetGeometry())
1305+ {
1306+ prelight_->Invalidate(GetGeometry());
1307+ active_->Invalidate(GetGeometry());
1308+ normal_->Invalidate(GetGeometry());
1309+ }
1310+
1311+ cached_geometry_ = GetGeometry();
1312+ return ret;
1313+ }
1314+
1315+ void FilterMultiRangeButton::InitTheme()
1316+ {
1317+ if (prelight_ == NULL)
1318+ {
1319+ prelight_ = new nux::CairoWrapper(GetGeometry(), sigc::bind(sigc::mem_fun(this, &FilterMultiRangeButton::RedrawTheme), nux::State::NUX_STATE_PRELIGHT));
1320+ active_ = new nux::CairoWrapper(GetGeometry(), sigc::bind(sigc::mem_fun(this, &FilterMultiRangeButton::RedrawTheme), nux::State::NUX_STATE_ACTIVE));
1321+ normal_ = new nux::CairoWrapper(GetGeometry(), sigc::bind(sigc::mem_fun(this, &FilterMultiRangeButton::RedrawTheme), nux::State::NUX_STATE_NORMAL));
1322+ }
1323+
1324+ SetMinimumHeight(32);
1325+ }
1326+
1327+ void FilterMultiRangeButton::RedrawTheme (nux::Geometry const& geom, cairo_t *cr, nux::State faked_state)
1328+ {
1329+ std::string name = "10";
1330+ std::stringstream final;
1331+
1332+ if (filter_)
1333+ {
1334+ name = filter_->name;
1335+ final << "<small>" << name << "</small>";
1336+ }
1337+
1338+ DashStyle::Arrow arrow;
1339+ if (has_arrow_ == MULTI_RANGE_ARROW_NONE)
1340+ arrow = DashStyle::Arrow::NONE;
1341+ else if (has_arrow_ == MULTI_RANGE_ARROW_LEFT)
1342+ arrow = DashStyle::Arrow::LEFT;
1343+ else if (has_arrow_ == MULTI_RANGE_ARROW_BOTH)
1344+ arrow = DashStyle::Arrow::BOTH;
1345+ else
1346+ arrow = DashStyle::Arrow::RIGHT;
1347+
1348+ DashStyle::Segment segment;
1349+ if (side_ == MULTI_RANGE_SIDE_LEFT)
1350+ segment = DashStyle::Segment::LEFT;
1351+ else if (side_ == MULTI_RANGE_CENTER)
1352+ segment = DashStyle::Segment::MIDDLE;
1353+ else
1354+ segment = DashStyle::Segment::RIGHT;
1355+
1356+ DashStyle::Instance().MultiRangeSegment(cr, faked_state, final.str(), arrow, segment);
1357+ NeedRedraw();
1358+ }
1359+
1360+
1361+ long int FilterMultiRangeButton::ProcessEvent(nux::IEvent& ievent, long int TraverseInfo, long int ProcessEventInfo) {
1362+ return nux::ToggleButton::ProcessEvent(ievent, TraverseInfo, ProcessEventInfo);
1363+ }
1364+
1365+ void FilterMultiRangeButton::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {
1366+ gPainter.PaintBackground(GfxContext, GetGeometry());
1367+ // set up our texture mode
1368+ nux::TexCoordXForm texxform;
1369+ texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_REPEAT);
1370+ texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
1371+
1372+ // clear what is behind us
1373+ nux::t_u32 alpha = 0, src = 0, dest = 0;
1374+ GfxContext.GetRenderStates().GetBlend(alpha, src, dest);
1375+ GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1376+
1377+ nux::Color col = nux::color::Black;
1378+ col.alpha = 0;
1379+ GfxContext.QRP_Color(GetGeometry().x,
1380+ GetGeometry().y,
1381+ GetGeometry().width,
1382+ GetGeometry().height,
1383+ col);
1384+
1385+ nux::BaseTexture *texture = normal_->GetTexture();
1386+ //FIXME - dashstyle does not give us a focused state yet, so ignore
1387+ //~ if (state == nux::State::NUX_STATE_PRELIGHT)
1388+ //~ {
1389+ //~ texture = prelight_->GetTexture();
1390+ //~ }
1391+ if (active)
1392+ {
1393+ texture = active_->GetTexture();
1394+ }
1395+
1396+ GfxContext.QRP_1Tex(GetGeometry().x,
1397+ GetGeometry().y,
1398+ GetGeometry().width,
1399+ GetGeometry().height,
1400+ texture->GetDeviceTexture(),
1401+ texxform,
1402+ nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
1403+ GfxContext.GetRenderStates().SetBlend(alpha, src, dest);
1404+ }
1405+
1406+ void FilterMultiRangeButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) {
1407+ //nux::ToggleButton::DrawContent(GfxContext, force_draw);
1408+ }
1409+
1410+ void FilterMultiRangeButton::PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw) {
1411+ nux::ToggleButton::PostDraw(GfxContext, force_draw);
1412+ }
1413+
1414+}
1415+>>>>>>> MERGE-SOURCE
1416
1417=== modified file 'plugins/unityshell/src/GeisAdapter.cpp'
1418--- plugins/unityshell/src/GeisAdapter.cpp 2011-12-22 17:52:55 +0000
1419+++ plugins/unityshell/src/GeisAdapter.cpp 2012-01-18 19:37:39 +0000
1420@@ -469,7 +469,7 @@
1421 GEIS_XCB_FULL_WINDOW,
1422 &xcb_win_info
1423 };
1424- GeisInstance instance;
1425+ GeisInstance instance = nullptr;
1426
1427 status = geis_init(&win_info, &instance);
1428 if (status != GEIS_STATUS_SUCCESS)
1429
1430=== modified file 'plugins/unityshell/src/IMTextEntry.cpp'
1431--- plugins/unityshell/src/IMTextEntry.cpp 2012-01-04 00:13:27 +0000
1432+++ plugins/unityshell/src/IMTextEntry.cpp 2012-01-18 19:37:39 +0000
1433@@ -263,12 +263,21 @@
1434
1435 LOG_DEBUG(logger) << "Preedit changed: " << preedit;
1436
1437+<<<<<<< TREE
1438 preedit_ = preedit.Str();
1439+=======
1440+ _preedit = preedit.Str();
1441+>>>>>>> MERGE-SOURCE
1442
1443 if (strlen(preedit.Str().c_str())) {
1444 preedit_cursor_ = preedit.Str().length();
1445+<<<<<<< TREE
1446 QueueRefresh(true, true);
1447 sigTextChanged.emit(this);
1448+=======
1449+ QueueRefresh(true, true);
1450+ sigTextChanged.emit(this);
1451+>>>>>>> MERGE-SOURCE
1452 UpdateCursorLocation();
1453 }
1454 }
1455@@ -286,9 +295,15 @@
1456 ResetPreedit();
1457 gtk_im_context_reset(im_context_);
1458
1459+<<<<<<< TREE
1460 QueueRefresh(true, true);
1461 sigTextChanged.emit(this);
1462
1463+=======
1464+ QueueRefresh(true, true);
1465+ sigTextChanged.emit(this);
1466+
1467+>>>>>>> MERGE-SOURCE
1468 LOG_DEBUG(logger) << "Preedit ended";
1469 }
1470
1471
1472=== modified file 'plugins/unityshell/src/JSONParser.cpp'
1473--- plugins/unityshell/src/JSONParser.cpp 2011-09-15 04:28:49 +0000
1474+++ plugins/unityshell/src/JSONParser.cpp 2012-01-18 19:37:39 +0000
1475@@ -145,6 +145,19 @@
1476 values[i] = json_array_get_double_element(array, i);
1477 }
1478
1479+void Parser::ReadString(std::string const& node_name,
1480+ std::string const& member_name,
1481+ std::string& value) const
1482+{
1483+ JsonObject* object = GetNodeObject(node_name);
1484+
1485+ if (!object)
1486+ return;
1487+
1488+ if (json_object_has_member(object, member_name.c_str()))
1489+ value = json_object_get_string_member(object, member_name.c_str());
1490+}
1491+
1492 void Parser::ReadColor(std::string const& node_name,
1493 std::string const& member_name,
1494 std::string const& opacity_name,
1495
1496=== modified file 'plugins/unityshell/src/JSONParser.h'
1497--- plugins/unityshell/src/JSONParser.h 2011-09-15 04:28:49 +0000
1498+++ plugins/unityshell/src/JSONParser.h 2012-01-18 19:37:39 +0000
1499@@ -58,6 +58,10 @@
1500 std::string const& member_name,
1501 std::vector<double>& values) const;
1502
1503+ void ReadString(std::string const& node_name,
1504+ std::string const& member_name,
1505+ std::string& value) const;
1506+
1507 void ReadColor(std::string const& node_name,
1508 std::string const& member_name,
1509 std::string const& opacity_name,
1510
1511=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
1512--- plugins/unityshell/src/LauncherIcon.cpp 2012-01-11 12:05:06 +0000
1513+++ plugins/unityshell/src/LauncherIcon.cpp 2012-01-18 19:37:39 +0000
1514@@ -549,8 +549,11 @@
1515
1516 for (auto menu_item : menus)
1517 {
1518+<<<<<<< TREE
1519 QuicklistMenuItem* ql_item;
1520
1521+=======
1522+>>>>>>> MERGE-SOURCE
1523 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
1524 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
1525 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);
1526@@ -594,6 +597,7 @@
1527 tip_x = 0;
1528 tip_y = _center.y;
1529 }
1530+<<<<<<< TREE
1531
1532 auto win_manager = WindowManager::Default();
1533
1534@@ -613,6 +617,27 @@
1535 {
1536 QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
1537 }
1538+=======
1539+
1540+ auto win_manager = WindowManager::Default();
1541+
1542+ if (win_manager->IsScaleActive())
1543+ win_manager->TerminateScale();
1544+
1545+ /* If the expo plugin is active, we need to wait it to be termated, before
1546+ * shwing the icon quicklist. */
1547+ if (win_manager->IsExpoActive())
1548+ {
1549+ on_expo_terminated_connection = win_manager->terminate_expo.connect([&]() {
1550+ QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
1551+ on_expo_terminated_connection.disconnect();
1552+ });
1553+ }
1554+ else
1555+ {
1556+ QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
1557+ }
1558+>>>>>>> MERGE-SOURCE
1559
1560 return true;
1561 }
1562
1563=== modified file 'plugins/unityshell/src/LauncherIcon.h'
1564=== modified file 'plugins/unityshell/src/LensView.cpp'
1565--- plugins/unityshell/src/LensView.cpp 2011-12-14 16:18:41 +0000
1566+++ plugins/unityshell/src/LensView.cpp 2012-01-18 19:37:39 +0000
1567@@ -144,8 +144,15 @@
1568 void LensView::SetupViews()
1569 {
1570 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
1571+<<<<<<< TREE
1572
1573 layout_->SetHorizontalExternalMargin(8);
1574+=======
1575+
1576+ // Breaks the sizing of the whole dash causing some colums to be clipped from result view.
1577+ // look in to this for P.
1578+ // layout_->SetHorizontalExternalMargin(8);
1579+>>>>>>> MERGE-SOURCE
1580
1581 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),
1582 NUX_TRACKER_LOCATION);
1583
1584=== modified file 'plugins/unityshell/src/PanelIndicatorsView.cpp'
1585=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
1586=== modified file 'plugins/unityshell/src/PanelMenuView.h'
1587=== modified file 'plugins/unityshell/src/PanelTray.cpp'
1588--- plugins/unityshell/src/PanelTray.cpp 2011-12-14 20:04:23 +0000
1589+++ plugins/unityshell/src/PanelTray.cpp 2012-01-18 19:37:39 +0000
1590@@ -95,7 +95,11 @@
1591 if (_tray)
1592 {
1593 g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id);
1594+<<<<<<< TREE
1595 g_object_unref (_tray);
1596+=======
1597+ g_object_unref(_tray);
1598+>>>>>>> MERGE-SOURCE
1599 _tray = NULL;
1600 }
1601
1602
1603=== modified file 'plugins/unityshell/src/PanelView.cpp'
1604--- plugins/unityshell/src/PanelView.cpp 2012-01-16 07:34:25 +0000
1605+++ plugins/unityshell/src/PanelView.cpp 2012-01-18 19:37:39 +0000
1606@@ -138,6 +138,11 @@
1607 {
1608 if (_track_menu_pointer_id)
1609 g_source_remove(_track_menu_pointer_id);
1610+<<<<<<< TREE
1611+=======
1612+
1613+ _style->UnReference();
1614+>>>>>>> MERGE-SOURCE
1615 UBusServer *ubus = ubus_server_get_default();
1616 ubus_server_unregister_interest(ubus, _handle_bg_color_update);
1617 ubus_server_unregister_interest(ubus, _handle_dash_hidden);
1618@@ -152,6 +157,9 @@
1619 indicator::EntryLocationMap locations;
1620 _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
1621
1622+ indicator::EntryLocationMap locations;
1623+ _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
1624+
1625 delete _bg_layer;
1626 }
1627
1628
1629=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
1630=== modified file 'plugins/unityshell/src/PlacesHomeView.cpp'
1631--- plugins/unityshell/src/PlacesHomeView.cpp 2011-12-14 20:04:23 +0000
1632+++ plugins/unityshell/src/PlacesHomeView.cpp 2012-01-18 19:37:39 +0000
1633@@ -38,17 +38,30 @@
1634 #include "UBusMessages.h"
1635
1636 #include "PlacesHomeView.h"
1637+<<<<<<< TREE
1638+=======
1639+
1640+#include "JSONParser.h"
1641+>>>>>>> MERGE-SOURCE
1642 #include "PlacesSimpleTile.h"
1643
1644 #include "DashStyle.h"
1645 #include <UnityCore/GLibWrapper.h>
1646 #include <UnityCore/Variant.h>
1647
1648+#include <sstream>
1649 #include <string>
1650 #include <vector>
1651
1652+#include <boost/algorithm/string.hpp>
1653+
1654 #define DELTA_DOUBLE_REQUEST 500000000
1655
1656+namespace
1657+{
1658+ const std::string custom_shortcuts_file = "/unity/HomeShortcutsCustomized.json";
1659+}
1660+
1661 namespace unity
1662 {
1663
1664@@ -135,7 +148,9 @@
1665
1666 expanded.connect(sigc::mem_fun(this, &PlacesHomeView::Refresh));
1667
1668- Refresh();
1669+ // Wait for the asynchronous loading of the lenses to complete
1670+ // before refreshing the view for the first time.
1671+ _lenses.lenses_loaded.connect(sigc::bind(sigc::mem_fun(this, &PlacesHomeView::Refresh), (PlacesGroup*) NULL));
1672 }
1673
1674 PlacesHomeView::~PlacesHomeView()
1675@@ -161,64 +176,227 @@
1676
1677 _layout->Clear();
1678
1679- // Media Apps
1680- markup = g_strdup_printf(temp, _("Media Apps"));
1681- shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",
1682- markup,
1683- icon_size);
1684- shortcut->_id = TYPE_PLACE;
1685- shortcut->_place_id = g_strdup("applications.lens?filter_type=media");
1686- shortcut->_place_section = 9;
1687- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1688- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1689- g_free(markup);
1690-
1691- // Internet Apps
1692- markup = g_strdup_printf(temp, _("Internet Apps"));
1693- shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",
1694- markup,
1695- icon_size);
1696- shortcut->_id = TYPE_PLACE;
1697- shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");
1698- shortcut->_place_section = 8;
1699- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1700- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1701- g_free(markup);
1702-
1703- // More Apps
1704- markup = g_strdup_printf(temp, _("More Apps"));
1705- shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",
1706- markup,
1707- icon_size);
1708- shortcut->_id = TYPE_PLACE;
1709- shortcut->_place_id = g_strdup("applications.lens");
1710- shortcut->_place_section = 0;
1711- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1712- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1713- g_free(markup);
1714-
1715- // Find Files
1716- markup = g_strdup_printf(temp, _("Find Files"));
1717- shortcut = new Shortcut(PKGDATADIR"/find_files.png",
1718- markup,
1719- icon_size);
1720- shortcut->_id = TYPE_PLACE;
1721- shortcut->_place_id = g_strdup("files.lens");
1722- shortcut->_place_section = 0;
1723- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1724- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1725- g_free(markup);
1726-
1727- // Browser
1728- CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);
1729-
1730- // Photos
1731- // FIXME: Need to figure out the default
1732- CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);
1733-
1734- CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);
1735-
1736- CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);
1737+ // The following code path allows one to replace the default dash home screen
1738+ // with a custom home screen, the contents of which are described in a JSON
1739+ // file. The file is looked for in the following locations in decreasing order
1740+ // of priority:
1741+ // - $XDG_CONFIG_HOME/unity/ (defaults to $HOME/.config/unity/)
1742+ // - $DIR/unity/ for $DIR in $XDG_CONFIG_DIRS
1743+ // The syntax of the file is as follows:
1744+ // ==========================================================================
1745+ // {
1746+ // "shortcut1": {
1747+ // "source": $source,
1748+ // "name": $name,
1749+ // "name[fr]": $name_in_french,
1750+ // […]
1751+ // "icon": $icon
1752+ // },
1753+ // "shortcut2": {
1754+ // […]
1755+ // },
1756+ // […]
1757+ // }
1758+ // ==========================================================================
1759+ // The source attribute may either be a desktop file (full path or just its
1760+ // basename if it is located in a standard directory), or a lens file
1761+ // (basename only). This attribute is mandatory.
1762+ // The 'name' attribute is optional. If present, it will override the default
1763+ // display name as advertised by the desktop file or by the lens. The name can
1764+ // be localized in several languages using the square brackets suffix
1765+ // notation, in which case the locale matching the system’s will be used,
1766+ // defaulting to the untranslated 'name' attribute if necessary.
1767+ // The 'icon' attribute is optional. If present, it will override the default
1768+ // icon as advertised by the desktop file or by the lens. It should be a full
1769+ // path name.
1770+ // If the source is a lens, the optional 'filter' attribute allows specifying
1771+ // a filter in the form "$name:$value", e.g. "type:videos" for the files lens.
1772+ // If the source is a lens, the optional 'section' attribute allows specifying
1773+ // a section number (an integer starting at index 0).
1774+
1775+ std::string customShortcuts;
1776+ std::ostringstream file;
1777+ // Look for a custom shortcuts file in the user’s home directory first.
1778+ file << g_get_user_config_dir() << custom_shortcuts_file;
1779+ if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
1780+ {
1781+ customShortcuts = file.str();
1782+ }
1783+ else
1784+ {
1785+ // Fall back on the standard XDG directories.
1786+ gchar** config = (gchar**) g_get_system_config_dirs();
1787+ for (gint i = 0; config[i]; ++i)
1788+ {
1789+ std::ostringstream file;
1790+ file << config[i] << custom_shortcuts_file;
1791+ if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
1792+ {
1793+ customShortcuts = file.str();
1794+ break;
1795+ }
1796+ }
1797+ }
1798+ json::Parser parser;
1799+ if ((customShortcuts == "") || !parser.Open(customShortcuts))
1800+ {
1801+ // Media Apps
1802+ markup = g_strdup_printf(temp, _("Media Apps"));
1803+ shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",
1804+ markup,
1805+ icon_size);
1806+ shortcut->_id = TYPE_PLACE;
1807+ shortcut->_place_id = g_strdup("applications.lens?filter_type=media");
1808+ shortcut->_place_section = 9;
1809+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1810+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1811+ g_free(markup);
1812+
1813+ // Internet Apps
1814+ markup = g_strdup_printf(temp, _("Internet Apps"));
1815+ shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",
1816+ markup,
1817+ icon_size);
1818+ shortcut->_id = TYPE_PLACE;
1819+ shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");
1820+ shortcut->_place_section = 8;
1821+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1822+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1823+ g_free(markup);
1824+
1825+ // More Apps
1826+ markup = g_strdup_printf(temp, _("More Apps"));
1827+ shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",
1828+ markup,
1829+ icon_size);
1830+ shortcut->_id = TYPE_PLACE;
1831+ shortcut->_place_id = g_strdup("applications.lens");
1832+ shortcut->_place_section = 0;
1833+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1834+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1835+ g_free(markup);
1836+
1837+ // Find Files
1838+ markup = g_strdup_printf(temp, _("Find Files"));
1839+ shortcut = new Shortcut(PKGDATADIR"/find_files.png",
1840+ markup,
1841+ icon_size);
1842+ shortcut->_id = TYPE_PLACE;
1843+ shortcut->_place_id = g_strdup("files.lens");
1844+ shortcut->_place_section = 0;
1845+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1846+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1847+ g_free(markup);
1848+
1849+ // Browser
1850+ CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);
1851+
1852+ // Photos
1853+ // FIXME: Need to figure out the default
1854+ CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);
1855+
1856+ CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);
1857+
1858+ CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);
1859+ }
1860+ else
1861+ {
1862+ // The custom shortcuts file can contain up to 8 shortcuts.
1863+ for (int i = 0; i < 8; ++i)
1864+ {
1865+ std::ostringstream oss;
1866+ oss << "shortcut" << (i + 1);
1867+ std::string slot = oss.str();
1868+ std::string source;
1869+ parser.ReadString(slot, "source", source);
1870+ if (source != "")
1871+ {
1872+ std::string icon;
1873+ parser.ReadString(slot, "icon", icon);
1874+
1875+ std::string name;
1876+ gchar** languages = (gchar**) g_get_language_names();
1877+ for (gint i = 0; languages[i]; ++i)
1878+ {
1879+ std::ostringstream key;
1880+ key << "name[" << languages[i] << "]";
1881+ parser.ReadString(slot, key.str(), name);
1882+ if (name != "")
1883+ break;
1884+ }
1885+ if (name == "")
1886+ {
1887+ parser.ReadString(slot, "name", name);
1888+ }
1889+
1890+ if (boost::iends_with(source, ".desktop"))
1891+ {
1892+ GDesktopAppInfo* info = NULL;
1893+ if (boost::istarts_with(source, "/"))
1894+ info = g_desktop_app_info_new_from_filename(source.c_str());
1895+ else
1896+ info = g_desktop_app_info_new(source.c_str());
1897+ if (G_IS_DESKTOP_APP_INFO(info))
1898+ {
1899+ if (name == "")
1900+ name = g_app_info_get_display_name(G_APP_INFO(info));
1901+ if (icon == "")
1902+ {
1903+ gchar* cicon = g_icon_to_string(g_app_info_get_icon(G_APP_INFO(info)));
1904+ icon = cicon;
1905+ g_free(cicon);
1906+ }
1907+ gchar* exec = g_strdup(g_app_info_get_executable(G_APP_INFO(info)));
1908+ markup = g_strdup_printf(temp, name.c_str());
1909+ shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
1910+ shortcut->_id = TYPE_EXEC;
1911+ shortcut->_exec = exec;
1912+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1913+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1914+ g_free(markup);
1915+ g_object_unref(info);
1916+ }
1917+ }
1918+ else if (boost::iends_with(source, ".lens"))
1919+ {
1920+ unity::dash::Lens::Ptr lens = _lenses.GetLens(source);
1921+ if (lens)
1922+ {
1923+ if (name == "")
1924+ name = lens->name;
1925+ if (icon == "")
1926+ icon = lens->icon_hint;
1927+ }
1928+ std::string filter;
1929+ parser.ReadString(slot, "filter", filter);
1930+ int section = -1;
1931+ parser.ReadInt(slot, "section", section);
1932+ markup = g_strdup_printf(temp, name.c_str());
1933+ shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
1934+ shortcut->_id = TYPE_PLACE;
1935+ if (filter != "")
1936+ {
1937+ std::vector<std::string> filter_key_value;
1938+ boost::split(filter_key_value, filter, boost::is_any_of(":"));
1939+ if (filter_key_value.size() == 2)
1940+ shortcut->_place_id = g_strdup_printf("%s?filter_%s=%s",
1941+ source.c_str(),
1942+ filter_key_value[0].c_str(),
1943+ filter_key_value[1].c_str());
1944+ else
1945+ shortcut->_place_id = g_strdup(source.c_str());
1946+ }
1947+ else
1948+ shortcut->_place_id = g_strdup(source.c_str());
1949+ if (section != -1)
1950+ shortcut->_place_section = section;
1951+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1952+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1953+ g_free(markup);
1954+ }
1955+ }
1956+ }
1957+ }
1958
1959 SetExpanded(true);
1960 SetCounts(8, 8);
1961
1962=== modified file 'plugins/unityshell/src/PlacesHomeView.h'
1963--- plugins/unityshell/src/PlacesHomeView.h 2011-12-14 20:04:23 +0000
1964+++ plugins/unityshell/src/PlacesHomeView.h 2012-01-18 19:37:39 +0000
1965@@ -29,6 +29,8 @@
1966
1967 #include <Nux/GridHLayout.h>
1968
1969+#include <UnityCore/FilesystemLenses.h>
1970+
1971 #include "PlacesTile.h"
1972 #include "PlacesGroup.h"
1973
1974@@ -66,6 +68,8 @@
1975 std::vector<std::string> _music_alternatives;
1976
1977 guint _ubus_handle;
1978+
1979+ unity::dash::FilesystemLenses _lenses;
1980 };
1981
1982 }
1983
1984=== modified file 'plugins/unityshell/src/ResultViewGrid.cpp'
1985--- plugins/unityshell/src/ResultViewGrid.cpp 2012-01-02 21:39:28 +0000
1986+++ plugins/unityshell/src/ResultViewGrid.cpp 2012-01-18 19:37:39 +0000
1987@@ -82,8 +82,20 @@
1988 {
1989 last_mouse_down_x_ = x;
1990 last_mouse_down_y_ = y;
1991- uint index = GetIndexAtPosition(x, y);
1992- mouse_over_index_ = index;
1993+<<<<<<< TREE
1994+ uint index = GetIndexAtPosition(x, y);
1995+ mouse_over_index_ = index;
1996+=======
1997+ uint index = GetIndexAtPosition(x, y);
1998+ mouse_over_index_ = index;
1999+ if (index >= 0 && index < results_.size())
2000+ {
2001+ // we got a click on a button so activate it
2002+ Result result = results_[index];
2003+ selected_index_ = index;
2004+ focused_uri_ = result.uri;
2005+ }
2006+>>>>>>> MERGE-SOURCE
2007 });
2008
2009 mouse_leave.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state)
2010@@ -495,9 +507,26 @@
2011 {
2012 if (selected_index_ < 0)
2013 {
2014+<<<<<<< TREE
2015+=======
2016+ if (mouse_over_index_ >= 0 && mouse_over_index_ < static_cast<int>(results_.size()))
2017+ {
2018+ // to hack around nux, nux sends the keynavfocuschange event before
2019+ // mouse clicks, so when mouse click happens we have already scrolled away
2020+ // because the keynav focus changed
2021+ focused_uri_ = results_[mouse_over_index_].uri;
2022+ selected_index_ = mouse_over_index_;
2023+ }
2024+ else
2025+ {
2026+>>>>>>> MERGE-SOURCE
2027 focused_uri_ = results_.front().uri;
2028 selected_index_ = 0;
2029 }
2030+<<<<<<< TREE
2031+=======
2032+
2033+>>>>>>> MERGE-SOURCE
2034
2035 int items_per_row = GetItemsPerRow();
2036 int focused_x = (renderer_->width + horizontal_spacing) * (selected_index_ % items_per_row);
2037
2038=== modified file 'plugins/unityshell/src/ResultViewGrid.h'
2039=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp'
2040--- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-05 02:47:09 +0000
2041+++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-18 19:37:39 +0000
2042@@ -1,3 +1,4 @@
2043+<<<<<<< TREE
2044 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2045 /* Compiz unity plugin
2046 * unity.h
2047@@ -232,3 +233,239 @@
2048 if (mFBTexture)
2049 glDeleteTextures (1, &mFBTexture);
2050 }
2051+=======
2052+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2053+/* Compiz unity plugin
2054+ * unity.h
2055+ *
2056+ * Copyright (c) 2010-11 Canonical Ltd.
2057+ *
2058+ * This program is free software; you can redistribute it and/or
2059+ * modify it under the terms of the GNU General Public License
2060+ * as published by the Free Software Foundation; either version 3
2061+ * of the License, or (at your option) any later version.
2062+ *
2063+ * This program is distributed in the hope that it will be useful,
2064+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2065+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2066+ * GNU General Public License for more details.
2067+ *
2068+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
2069+ */
2070+
2071+#include "ScreenEffectFramebufferObject.h"
2072+#include "BackgroundEffectHelper.h"
2073+#include <NuxCore/Logger.h>
2074+#include <dlfcn.h>
2075+
2076+namespace
2077+{
2078+ nux::logging::Logger logger ("unity.screeneffectframebufferobject");
2079+}
2080+
2081+void ScreenEffectFramebufferObject::paint (const nux::Geometry &output)
2082+{
2083+ /* Draw the bit of the relevant framebuffer for each output */
2084+
2085+ glPushAttrib (GL_VIEWPORT_BIT);
2086+ glViewport (0, mScreenSize.height - (output.y + output.height), mScreenSize.width, mScreenSize.height);
2087+
2088+ if (mFBTexture)
2089+ {
2090+ glEnable (GL_TEXTURE_2D);
2091+ activeTexture (GL_TEXTURE0_ARB);
2092+ glBindTexture (GL_TEXTURE_2D, mFBTexture);
2093+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
2094+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
2095+
2096+ glPushAttrib (GL_SCISSOR_BIT);
2097+ glEnable (GL_SCISSOR_TEST);
2098+
2099+ glScissor (output.x, mScreenSize.height - (output.y + output.height),
2100+ output.width, output.height);
2101+
2102+ /* FIXME: This needs to be GL_TRIANGLE_STRIP */
2103+ glBegin (GL_QUADS);
2104+ glTexCoord2f (0, 1);
2105+ glVertex2i (mGeometry.x, mGeometry.y);
2106+ glTexCoord2f (0, 0);
2107+ glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height);
2108+ glTexCoord2f (1, 0);
2109+ glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height);
2110+ glTexCoord2f (1, 1);
2111+ glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y);
2112+ glEnd ();
2113+
2114+ activeTexture (GL_TEXTURE0_ARB);
2115+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
2116+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
2117+ glBindTexture (GL_TEXTURE_2D, 0);
2118+ glDisable (GL_TEXTURE_2D);
2119+ glPopAttrib ();
2120+ }
2121+ glPopAttrib ();
2122+}
2123+
2124+void ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize)
2125+{
2126+ mScreenSize = screenSize;
2127+}
2128+
2129+
2130+void ScreenEffectFramebufferObject::unbind ()
2131+{
2132+ if (!mBoundCnt)
2133+ return;
2134+
2135+ mBoundCnt--;
2136+
2137+ (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0);
2138+
2139+ glDrawBuffer (GL_BACK);
2140+ glReadBuffer (GL_BACK);
2141+
2142+ /* Matches the viewport set we did in ::bind () */
2143+ glPopAttrib ();
2144+
2145+}
2146+
2147+bool ScreenEffectFramebufferObject::status ()
2148+{
2149+ return mFboStatus;
2150+}
2151+
2152+void ScreenEffectFramebufferObject::bind (const nux::Geometry &output)
2153+{
2154+ if (!BackgroundEffectHelper::HasDirtyHelpers())
2155+ return;
2156+
2157+ /* Clear the error bit */
2158+ glGetError ();
2159+
2160+ if (!mFBTexture)
2161+ {
2162+ glGenTextures (1, &mFBTexture);
2163+
2164+ glBindTexture (GL_TEXTURE_2D, mFBTexture);
2165+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
2166+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
2167+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
2168+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
2169+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA,
2170+#if IMAGE_BYTE_ORDER == MSBFirst
2171+ GL_UNSIGNED_INT_8_8_8_8_REV,
2172+#else
2173+ GL_UNSIGNED_BYTE,
2174+#endif
2175+ NULL);
2176+
2177+ glBindTexture (GL_TEXTURE_2D, 0);
2178+
2179+ if (glGetError () != GL_NO_ERROR)
2180+ {
2181+ mFboHandle = 0;
2182+ mFboStatus = false;
2183+ return;
2184+ }
2185+ }
2186+
2187+ (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle);
2188+
2189+ (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
2190+ GL_TEXTURE_2D, mFBTexture, 0);
2191+
2192+ (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
2193+ GL_TEXTURE_2D, 0, 0);
2194+
2195+ /* Ensure that a framebuffer is actually available */
2196+ if (!mFboStatus)
2197+ {
2198+ GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER);
2199+
2200+ if (status != GL_FRAMEBUFFER_COMPLETE)
2201+ {
2202+ switch (status)
2203+ {
2204+ case GL_FRAMEBUFFER_UNDEFINED:
2205+ LOG_WARN (logger) << "no window";
2206+ break;
2207+ case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
2208+ LOG_WARN (logger) << "attachment incomplete";
2209+ break;
2210+ case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
2211+ LOG_WARN (logger) << "no buffers attached to fbo";
2212+ break;
2213+ case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
2214+ LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO";
2215+ break;
2216+ case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
2217+ LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO";
2218+ break;
2219+ case GL_FRAMEBUFFER_UNSUPPORTED:
2220+ LOG_WARN (logger) << "unsupported internal format";
2221+ break;
2222+ case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
2223+ LOG_WARN (logger) << "different levels of sampling for each attachment";
2224+ break;
2225+ case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
2226+ LOG_WARN (logger) << "number of layers is different";
2227+ break;
2228+ default:
2229+ LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason";
2230+ break;
2231+ }
2232+
2233+ bindFramebuffer (GL_FRAMEBUFFER_EXT, 0);
2234+ deleteFramebuffers (1, &mFboHandle);
2235+
2236+ glDrawBuffer (GL_BACK);
2237+ glReadBuffer (GL_BACK);
2238+
2239+ mFboHandle = 0;
2240+
2241+ mFboStatus = false;
2242+ }
2243+ else
2244+ mFboStatus = true;
2245+ }
2246+
2247+ if (mFboStatus)
2248+ {
2249+ glPushAttrib (GL_VIEWPORT_BIT);
2250+
2251+ glViewport (output.x,
2252+ mScreenSize.height - (output.y + output.height),
2253+ output.width,
2254+ output.height);
2255+ }
2256+
2257+ mBoundCnt++;
2258+}
2259+
2260+
2261+ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom)
2262+ : getProcAddressGLX (p)
2263+ , mFboStatus (false)
2264+ , mFBTexture (0)
2265+ , mGeometry (geom)
2266+ , mBoundCnt (0)
2267+ , mScreenSize (geom)
2268+{
2269+ activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture");
2270+ genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT");
2271+ deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT");
2272+ bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT");
2273+ checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT");
2274+ framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT");
2275+
2276+ (*genFramebuffers) (1, &mFboHandle);
2277+}
2278+
2279+ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
2280+{
2281+ (*deleteFramebuffers) (1, &mFboHandle);
2282+
2283+ if (mFBTexture)
2284+ glDeleteTextures (1, &mFBTexture);
2285+}
2286+>>>>>>> MERGE-SOURCE
2287
2288=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.h'
2289--- plugins/unityshell/src/ScreenEffectFramebufferObject.h 2011-12-16 09:46:35 +0000
2290+++ plugins/unityshell/src/ScreenEffectFramebufferObject.h 2012-01-18 19:37:39 +0000
2291@@ -1,3 +1,4 @@
2292+<<<<<<< TREE
2293 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2294 /* Compiz unity plugin
2295 * unity.h
2296@@ -85,3 +86,89 @@
2297 } // namespace unity
2298
2299 #endif
2300+=======
2301+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2302+/* Compiz unity plugin
2303+ * unity.h
2304+ *
2305+ * Copyright (c) 2010-11 Canonical Ltd.
2306+ *
2307+ * This program is free software; you can redistribute it and/or
2308+ * modify it under the terms of the GNU General Public License
2309+ * as published by the Free Software Foundation; either version 3
2310+ * of the License, or (at your option) any later version.
2311+ *
2312+ * This program is distributed in the hope that it will be useful,
2313+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2314+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2315+ * GNU General Public License for more details.
2316+ *
2317+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
2318+ */
2319+
2320+#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
2321+#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
2322+
2323+#include <Nux/Nux.h>
2324+
2325+class ScreenEffectFramebufferObject
2326+{
2327+public:
2328+
2329+ typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
2330+ typedef void (*FuncPtr) (void);
2331+ typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
2332+
2333+ ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
2334+ ~ScreenEffectFramebufferObject ();
2335+
2336+public:
2337+
2338+ void bind (const nux::Geometry &geom);
2339+ void unbind ();
2340+
2341+ bool status ();
2342+ void paint (const nux::Geometry &geom);
2343+ bool bound () { return mBoundCnt > 0; }
2344+
2345+ GLuint texture () { return mFBTexture; }
2346+
2347+ void onScreenSizeChanged (const nux::Geometry &screenSize);
2348+
2349+private:
2350+
2351+ FuncPtr getProcAddr (const std::string &);
2352+
2353+ typedef void (*GLActiveTextureProc) (GLenum texture);
2354+ typedef void (*GLGenFramebuffersProc) (GLsizei n,
2355+ GLuint *framebuffers);
2356+ typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
2357+ GLuint *framebuffers);
2358+ typedef void (*GLBindFramebufferProc) (GLenum target,
2359+ GLuint framebuffer);
2360+ typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
2361+ typedef void (*GLFramebufferTexture2DProc) (GLenum target,
2362+ GLenum attachment,
2363+ GLenum textarget,
2364+ GLuint texture,
2365+ GLint level);
2366+
2367+ GLXGetProcAddressProc getProcAddressGLX;
2368+ GLActiveTextureProc activeTexture;
2369+ GLGenFramebuffersProc genFramebuffers;
2370+ GLDeleteFramebuffersProc deleteFramebuffers;
2371+ GLBindFramebufferProc bindFramebuffer;
2372+ GLCheckFramebufferStatusProc checkFramebufferStatus;
2373+ GLFramebufferTexture2DProc framebufferTexture2D;
2374+ /* compiz fbo handle that goes through to nux */
2375+ GLuint mFboHandle; // actual handle to the framebuffer_ext
2376+ bool mFboStatus; // did the framebuffer texture bind succeed
2377+ GLuint mFBTexture;
2378+ nux::Geometry mGeometry;
2379+ unsigned int mBoundCnt;
2380+
2381+ nux::Geometry mScreenSize;
2382+};
2383+
2384+#endif
2385+>>>>>>> MERGE-SOURCE
2386
2387=== modified file 'plugins/unityshell/src/SwitcherController.cpp'
2388=== modified file 'plugins/unityshell/src/SwitcherController.h'
2389=== modified file 'plugins/unityshell/src/SwitcherModel.cpp'
2390--- plugins/unityshell/src/SwitcherModel.cpp 2011-12-08 01:23:11 +0000
2391+++ plugins/unityshell/src/SwitcherModel.cpp 2012-01-18 19:37:39 +0000
2392@@ -173,10 +173,17 @@
2393 {
2394 if (!detail_selection || DetailXids ().empty())
2395 return 0;
2396+<<<<<<< TREE
2397
2398 if (detail_selection_index > DetailXids().size() - 1)
2399 return 0;
2400
2401+=======
2402+
2403+ if (detail_selection_index >= DetailXids().size())
2404+ return 0;
2405+
2406+>>>>>>> MERGE-SOURCE
2407 return DetailXids()[detail_selection_index];
2408 }
2409
2410
2411=== modified file 'plugins/unityshell/src/WindowManager.cpp'
2412=== modified file 'plugins/unityshell/src/comptransientfor.cpp'
2413--- plugins/unityshell/src/comptransientfor.cpp 2011-08-23 14:47:38 +0000
2414+++ plugins/unityshell/src/comptransientfor.cpp 2012-01-18 19:37:39 +0000
2415@@ -55,13 +55,18 @@
2416 bool
2417 compiz::CompTransientForReader::isTransientFor (unsigned int ancestor)
2418 {
2419+ if (!ancestor ||
2420+ !priv->mWindow->id ())
2421+ return false;
2422+
2423 return priv->mWindow->transientFor () == ancestor;
2424 }
2425
2426 bool
2427 compiz::CompTransientForReader::isGroupTransientFor (unsigned int clientLeader)
2428 {
2429- if (!clientLeader)
2430+ if (!clientLeader ||
2431+ !priv->mWindow->id ())
2432 return false;
2433
2434 if (priv->mWindow->transientFor () == None || priv->mWindow->transientFor () == screen->root ())
2435
2436=== modified file 'plugins/unityshell/src/transientfor.cpp'
2437--- plugins/unityshell/src/transientfor.cpp 2011-08-26 10:37:35 +0000
2438+++ plugins/unityshell/src/transientfor.cpp 2012-01-18 19:37:39 +0000
2439@@ -51,9 +51,9 @@
2440 {
2441 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
2442 {
2443- Window *data = (Window *) prop;
2444+ Window *data = (Window *) prop;
2445
2446- serverAncestor = *data;
2447+ serverAncestor = *data;
2448 }
2449
2450 XFree (prop);
2451@@ -65,6 +65,10 @@
2452 bool
2453 compiz::X11TransientForReader::isTransientFor (unsigned int ancestor)
2454 {
2455+ if (!ancestor ||
2456+ !priv->mXid)
2457+ return false;
2458+
2459 return ancestor == getAncestor ();
2460 }
2461
2462@@ -80,14 +84,18 @@
2463 std::vector<std::string> strings;
2464 std::list<Atom> atoms;
2465
2466+ if (!clientLeader ||
2467+ !priv->mXid)
2468+ return false;
2469+
2470 if (XGetWindowProperty (priv->mDpy, priv->mXid, wmClientLeader, 0L, 2L, false,
2471 XA_WINDOW, &actualType, &actualFormat, &nItems, &nLeft, (unsigned char **)&prop) == Success)
2472 {
2473 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
2474 {
2475- Window *data = (Window *) prop;
2476+ Window *data = (Window *) prop;
2477
2478- serverClientLeader = *data;
2479+ serverClientLeader = *data;
2480 }
2481
2482 XFree (prop);
2483
2484=== modified file 'plugins/unityshell/src/unityshell.cpp'
2485--- plugins/unityshell/src/unityshell.cpp 2012-01-18 18:47:55 +0000
2486+++ plugins/unityshell/src/unityshell.cpp 2012-01-18 19:37:39 +0000
2487@@ -576,6 +576,7 @@
2488 void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)
2489 {
2490 CompOutput *output = _last_output;
2491+<<<<<<< TREE
2492 Window tray_xid = panel_controller_->GetTrayXid ();
2493
2494 bool was_bound = _fbo->bound ();
2495@@ -584,6 +585,16 @@
2496 /* Draw the bit of the relevant framebuffer for each output */
2497
2498 if (was_bound)
2499+=======
2500+ Window tray_xid = panelController->GetTrayXid ();
2501+
2502+ bool was_bound = _fbo->bound ();
2503+ _fbo->unbind ();
2504+
2505+ /* Draw the bit of the relevant framebuffer for each output */
2506+
2507+ if (was_bound)
2508+>>>>>>> MERGE-SOURCE
2509 {
2510 GLMatrix sTransform;
2511 sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);
2512@@ -737,6 +748,7 @@
2513
2514 void UnityScreen::leaveShowDesktopMode (CompWindow *w)
2515 {
2516+<<<<<<< TREE
2517 /* Where a window is inhibiting, only allow the window
2518 * that is inhibiting the leave show desktop to actually
2519 * fade in again - all other windows should remain faded out */
2520@@ -768,6 +780,22 @@
2521 }
2522 }
2523 }
2524+=======
2525+ for (CompWindow *cw : screen->windows ())
2526+ {
2527+ if (cw->inShowDesktopMode ())
2528+ {
2529+ UnityWindow::get (cw)->leaveShowDesktop ();
2530+ // the animation plugin does strange things here ...
2531+ // if this notification is sent
2532+ //cw->windowNotify (CompWindowNotifyLeaveShowDesktopMode);
2533+ }
2534+ }
2535+
2536+ PluginAdapter::Default()->OnLeaveDesktop();
2537+
2538+ screen->leaveShowDesktopMode (w);
2539+>>>>>>> MERGE-SOURCE
2540 }
2541
2542 void UnityWindow::enterShowDesktop ()
2543@@ -1448,11 +1476,16 @@
2544 screen->outputDevs()[device].y1() + 100,
2545 screen->outputDevs()[device].width() - 200,
2546 screen->outputDevs()[device].height() - 200));
2547+<<<<<<< TREE
2548
2549 switcher::ShowMode show_mode = optionGetAltTabBiasViewport() ? switcher::ShowMode::CURRENT_VIEWPORT : switcher::ShowMode::ALL;
2550
2551 RaiseInputWindows();
2552 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
2553+=======
2554+ switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results);
2555+ RaiseInputWindows();
2556+>>>>>>> MERGE-SOURCE
2557 return true;
2558 }
2559
2560@@ -2264,15 +2297,27 @@
2561
2562 void UnityScreen::Relayout()
2563 {
2564- nux::Geometry geometry (0, 0, screen->width (), screen->height ());
2565+<<<<<<< TREE
2566+ nux::Geometry geometry (0, 0, screen->width (), screen->height ());
2567+=======
2568+ GdkRectangle rect;
2569+ nux::Geometry lCurGeom;
2570+ int panel_height = 24;
2571+ nux::Geometry geometry (0, 0, screen->width (), screen->height ());
2572+>>>>>>> MERGE-SOURCE
2573
2574 if (!needsRelayout)
2575 return;
2576
2577 if (GL::fbo)
2578 {
2579+<<<<<<< TREE
2580 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
2581 uScreen->_fbo->onScreenSizeChanged (geometry);
2582+=======
2583+ uScreen->_fbo.reset (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
2584+ uScreen->_fbo->onScreenSizeChanged (geometry);
2585+>>>>>>> MERGE-SOURCE
2586 }
2587
2588 UScreen *uscreen = UScreen::GetDefault();
2589@@ -2334,9 +2379,15 @@
2590 {
2591 if (w->resName() == "onboard")
2592 {
2593+<<<<<<< TREE
2594 Window xid = dash_controller_->window()->GetInputWindowId();
2595 XSetTransientForHint (screen->dpy(), w->id(), xid);
2596 w->raise ();
2597+=======
2598+ Window xid = dashController->window()->GetInputWindowId();
2599+ XSetTransientForHint (screen->dpy(), w->id(), xid);
2600+ w->raise ();
2601+>>>>>>> MERGE-SOURCE
2602 }
2603 }
2604 }
2605@@ -2369,6 +2420,7 @@
2606 LOG_INFO(logger) << "initLauncher-Panel " << timer.ElapsedSeconds() << "s";
2607
2608 /* Setup Places */
2609+<<<<<<< TREE
2610 dash_controller_.reset(new dash::Controller());
2611 dash_controller_->on_realize.connect(sigc::mem_fun(this, &UnityScreen::OnDashRealized));
2612
2613@@ -2445,6 +2497,29 @@
2614 hints_.push_back(new shortcut::Hint(windows, "", "", _("Places window in corresponding positions."), shortcut::HARDCODED_OPTION, "Ctrl + Alt + Num"));
2615 hints_.push_back(new shortcut::Hint(windows, "", " Drag", _("Move window."), shortcut::COMPIZ_MOUSE_OPTION, "move", "initiate_button"));
2616 hints_.push_back(new shortcut::Hint(windows, "", " Drag", _("Resize window."), shortcut::COMPIZ_MOUSE_OPTION, "resize", "initiate_button"));
2617+=======
2618+ self->dashController = DashController::Ptr(new DashController());
2619+ self->dashController->on_realize.connect (sigc::mem_fun (self, &UnityScreen::OnDashRealized));
2620+
2621+ /* FIXME: this should not be manual, should be managed with a
2622+ show/hide callback like in GAIL
2623+ if (unity_a11y_initialized() == TRUE)
2624+ {
2625+ AtkObject* atk_obj = NULL;
2626+
2627+ atk_obj = unity_util_accessible_add_window(self->placesController->GetWindow());
2628+
2629+ atk_object_set_name(atk_obj, _("Places"));
2630+ }
2631+ */
2632+
2633+ self->launcher->SetHideMode(Launcher::LAUNCHER_HIDE_DODGE_WINDOWS);
2634+ self->launcher->SetLaunchAnimation(Launcher::LAUNCH_ANIMATION_PULSE);
2635+ self->launcher->SetUrgentAnimation(Launcher::URGENT_ANIMATION_WIGGLE);
2636+ self->ScheduleRelayout(0);
2637+
2638+ self->OnLauncherHiddenChanged();
2639+>>>>>>> MERGE-SOURCE
2640 }
2641
2642 /* Window init */
2643@@ -2481,6 +2556,7 @@
2644
2645 if (window->state () & CompWindowStateFullscreenMask)
2646 UnityScreen::get (screen)->fullscreen_windows_.push_back(window);
2647+<<<<<<< TREE
2648
2649 /* We might be starting up so make sure that
2650 * we don't deref the dashcontroller that doesnt
2651@@ -2488,6 +2564,15 @@
2652 dash::Controller::Ptr dp = UnityScreen::get(screen)->dash_controller_;
2653
2654 if (dp)
2655+=======
2656+
2657+ /* We might be starting up so make sure that
2658+ * we don't deref the dashcontroller that doesnt
2659+ * exist */
2660+ DashController::Ptr dp = UnityScreen::get (screen)->dashController;
2661+
2662+ if (dp)
2663+>>>>>>> MERGE-SOURCE
2664 {
2665 nux::BaseWindow* w = dp->window ();
2666
2667@@ -2510,7 +2595,7 @@
2668
2669 UnityShowdesktopHandler::animating_windows.remove (window);
2670
2671- if (mMinimizeHandler)
2672+ if (mMinimizeHandler && !window->destroyed ())
2673 {
2674 unminimize ();
2675 window->focusSetEnabled (this, false);
2676@@ -2518,9 +2603,10 @@
2677 window->unminimizeSetEnabled (this, false);
2678 window->minimizedSetEnabled (this, false);
2679 window->minimize ();
2680-
2681- mMinimizeHandler.reset ();
2682 }
2683+
2684+ mMinimizeHandler.reset ();
2685+
2686 if (mShowdesktopHandler)
2687 delete mShowdesktopHandler;
2688
2689
2690=== modified file 'plugins/unityshell/src/unityshell.h'
2691--- plugins/unityshell/src/unityshell.h 2012-01-14 13:05:16 +0000
2692+++ plugins/unityshell/src/unityshell.h 2012-01-18 19:37:39 +0000
2693@@ -49,15 +49,26 @@
2694 #include "DebugDBusInterface.h"
2695 #include "SwitcherController.h"
2696 #include "UBusWrapper.h"
2697-#include "ScreenEffectFramebufferObject.h"
2698+<<<<<<< TREE
2699+#include "ScreenEffectFramebufferObject.h"
2700+=======
2701+#include <Nux/WindowThread.h>
2702+#include <sigc++/sigc++.h>
2703+#include <boost/shared_ptr.hpp>
2704+#include "ScreenEffectFramebufferObject.h"
2705+>>>>>>> MERGE-SOURCE
2706
2707 #include "compizminimizedwindowhandler.h"
2708+<<<<<<< TREE
2709 #include "BGHash.h"
2710 #include <compiztoolbox/compiztoolbox.h>
2711 #include <dlfcn.h>
2712
2713 namespace unity
2714 {
2715+=======
2716+#include <dlfcn.h>
2717+>>>>>>> MERGE-SOURCE
2718
2719 class UnityShowdesktopHandler
2720 {
2721
2722=== modified file 'services/panel-service.c'
2723=== modified file 'tests/CMakeLists.txt'
2724--- tests/CMakeLists.txt 2012-01-17 13:31:52 +0000
2725+++ tests/CMakeLists.txt 2012-01-18 19:37:39 +0000
2726@@ -70,6 +70,444 @@
2727 ${UNITY_SRC}/
2728 )
2729 add_dependencies (test-unit unity-core-${UNITY_API_VERSION})
2730+<<<<<<< TREE
2731+=======
2732+
2733+#
2734+# Standalone tests
2735+#
2736+add_executable (standalone-dash
2737+ standalone_dash.cpp
2738+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2739+ ${UNITY_SRC}/BackgroundEffectHelper.h
2740+ ${UNITY_SRC}/BGHash.cpp
2741+ ${UNITY_SRC}/BGHash.h
2742+ ${UNITY_SRC}/DashSearchBar.cpp
2743+ ${UNITY_SRC}/DashSearchBar.h
2744+ ${UNITY_SRC}/DashSearchBarSpinner.cpp
2745+ ${UNITY_SRC}/DashSearchBarSpinner.h
2746+ ${UNITY_SRC}/FilterExpanderLabel.cpp
2747+ ${UNITY_SRC}/FilterFactory.cpp
2748+ ${UNITY_SRC}/FilterBasicButton.cpp
2749+ ${UNITY_SRC}/FilterRatingsButton.cpp
2750+ ${UNITY_SRC}/FilterRatingsWidget.cpp
2751+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
2752+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
2753+ ${UNITY_SRC}/FilterGenreButton.cpp
2754+ ${UNITY_SRC}/FilterGenreWidget.cpp
2755+ ${UNITY_SRC}/FilterBar.cpp
2756+ ${UNITY_SRC}/FontSettings.cpp
2757+ ${UNITY_SRC}/FontSettings.h
2758+ ${UNITY_SRC}/IMTextEntry.cpp
2759+ ${UNITY_SRC}/IMTextEntry.h
2760+ ${UNITY_SRC}/PlacesHomeView.cpp
2761+ ${UNITY_SRC}/PlacesHomeView.h
2762+ ${UNITY_SRC}/PlacesGroup.cpp
2763+ ${UNITY_SRC}/PlacesGroup.h
2764+ ${UNITY_SRC}/DashSettings.cpp
2765+ ${UNITY_SRC}/DashSettings.h
2766+ ${UNITY_SRC}/PlacesStyle.cpp
2767+ ${UNITY_SRC}/PlacesStyle.h
2768+ ${UNITY_SRC}/PlacesTile.cpp
2769+ ${UNITY_SRC}/PlacesTile.h
2770+ ${UNITY_SRC}/PlacesSimpleTile.cpp
2771+ ${UNITY_SRC}/PlacesSimpleTile.h
2772+ ${UNITY_SRC}/PlacesVScrollBar.cpp
2773+ ${UNITY_SRC}/PlacesVScrollBar.h
2774+ ${UNITY_SRC}/DashView.cpp
2775+ ${UNITY_SRC}/DashView.h
2776+ ${UNITY_SRC}/HomeView.cpp
2777+ ${UNITY_SRC}/HomeView.h
2778+ ${UNITY_SRC}/DashStyle.cpp
2779+ ${UNITY_SRC}/IconLoader.cpp
2780+ ${UNITY_SRC}/IconLoader.h
2781+ ${UNITY_SRC}/IconTexture.cpp
2782+ ${UNITY_SRC}/IconTexture.h
2783+ ${UNITY_SRC}/Introspectable.cpp
2784+ ${UNITY_SRC}/Introspectable.h
2785+ ${UNITY_SRC}/JSONParser.cpp
2786+ ${UNITY_SRC}/LensBar.cpp
2787+ ${UNITY_SRC}/LensBar.h
2788+ ${UNITY_SRC}/LensBarIcon.cpp
2789+ ${UNITY_SRC}/LensBarIcon.h
2790+ ${UNITY_SRC}/LensView.cpp
2791+ ${UNITY_SRC}/LensView.h
2792+ ${UNITY_SRC}/PreviewApplications.cpp
2793+ ${UNITY_SRC}/PreviewBase.cpp
2794+ ${UNITY_SRC}/PreviewBasicButton.cpp
2795+ ${UNITY_SRC}/ResultView.cpp
2796+ ${UNITY_SRC}/ResultViewGrid.cpp
2797+ ${UNITY_SRC}/ResultRenderer.cpp
2798+ ${UNITY_SRC}/ResultRendererTile.cpp
2799+ ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
2800+ ${UNITY_SRC}/TextureCache.h
2801+ ${UNITY_SRC}/TextureCache.cpp
2802+ ${UNITY_SRC}/Timer.cpp
2803+ ${UNITY_SRC}/Timer.h
2804+ ${UNITY_SRC}/StaticCairoText.cpp
2805+ ${UNITY_SRC}/StaticCairoText.h
2806+ ${UNITY_SRC}/UBusMessages.h
2807+ ${UNITY_SRC}/UBusWrapper.cpp
2808+ ${UNITY_SRC}/UBusWrapper.h
2809+ ${UNITY_SRC}/ubus-server.cpp
2810+ ${UNITY_SRC}/ubus-server.h
2811+ ${UNITY_SRC}/UScreen.cpp
2812+ ${UNITY_SRC}/UScreen.h
2813+ )
2814+add_dependencies (standalone-dash unity-core-${UNITY_API_VERSION})
2815+
2816+
2817+#
2818+# Please use "standalone-$foo" naming convention for standalone tests
2819+#
2820+add_executable (test-panel
2821+ TestPanel.cpp
2822+ ${UNITY_SRC}/Animator.cpp
2823+ ${UNITY_SRC}/Animator.h
2824+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2825+ ${UNITY_SRC}/BackgroundEffectHelper.h
2826+ ${UNITY_SRC}/DashSettings.cpp
2827+ ${UNITY_SRC}/DashSettings.h
2828+ ${UNITY_SRC}/PanelStyle.cpp
2829+ ${UNITY_SRC}/PanelStyle.h
2830+ ${UNITY_SRC}/PanelView.cpp
2831+ ${UNITY_SRC}/PanelView.h
2832+ ${UNITY_SRC}/PanelIndicatorsView.cpp
2833+ ${UNITY_SRC}/PanelIndicatorsView.h
2834+ ${UNITY_SRC}/PanelIndicatorEntryView.cpp
2835+ ${UNITY_SRC}/PanelIndicatorEntryView.h
2836+ ${UNITY_SRC}/PanelTitlebarGrabAreaView.h
2837+ ${UNITY_SRC}/PanelTitlebarGrabAreaView.cpp
2838+ ${UNITY_SRC}/PanelTray.cpp
2839+ ${UNITY_SRC}/PanelTray.h
2840+ ${UNITY_SRC}/Introspectable.cpp
2841+ ${UNITY_SRC}/Introspectable.h
2842+ ${UNITY_SRC}/PanelMenuView.cpp
2843+ ${UNITY_SRC}/PanelMenuView.h
2844+ ${UNITY_SRC}/Timer.cpp
2845+ ${UNITY_SRC}/Timer.h
2846+ ${UNITY_SRC}/StaticCairoText.cpp
2847+ ${UNITY_SRC}/StaticCairoText.h
2848+ ${UNITY_SRC}/WindowButtons.cpp
2849+ ${UNITY_SRC}/WindowButtons.h
2850+ ${UNITY_SRC}/WindowManager.cpp
2851+ ${UNITY_SRC}/WindowManager.h
2852+ ${UNITY_SRC}/UScreen.cpp
2853+ ${UNITY_SRC}/UScreen.h
2854+ ${UNITY_SRC}/ubus-server.cpp
2855+ ${UNITY_SRC}/ubus-server.h
2856+ )
2857+add_dependencies (test-panel unity-core-${UNITY_API_VERSION})
2858+
2859+add_executable (test-switcher
2860+ TestSwitcher.cpp
2861+ ${UNITY_SRC}/AbstractLauncherIcon.h
2862+ ${UNITY_SRC}/AbstractIconRenderer.h
2863+ ${UNITY_SRC}/SwitcherController.cpp
2864+ ${UNITY_SRC}/SwitcherController.h
2865+ ${UNITY_SRC}/SwitcherModel.cpp
2866+ ${UNITY_SRC}/SwitcherModel.h
2867+ ${UNITY_SRC}/SwitcherView.cpp
2868+ ${UNITY_SRC}/SwitcherView.h
2869+ ${UNITY_SRC}/LayoutSystem.h
2870+ ${UNITY_SRC}/LayoutSystem.cpp
2871+ ${UNITY_SRC}/WindowManager.h
2872+ ${UNITY_SRC}/WindowManager.cpp
2873+ ${UNITY_SRC}/IconRenderer.cpp
2874+ ${UNITY_SRC}/IconRenderer.h
2875+ ${UNITY_SRC}/MockLauncherIcon.h
2876+ ${UNITY_SRC}/BackgroundEffectHelper.h
2877+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2878+ ${UNITY_SRC}/StaticCairoText.cpp
2879+ ${UNITY_SRC}/StaticCairoText.h
2880+ ${UNITY_SRC}/UBusMessages.h
2881+ ${UNITY_SRC}/ubus-server.cpp
2882+ ${UNITY_SRC}/ubus-server.h
2883+ )
2884+add_dependencies (test-switcher unity-core-${UNITY_API_VERSION})
2885+
2886+add_executable (test-launcher
2887+ TestLauncher.cpp
2888+ ${UNITY_SRC}/AbstractLauncherIcon.h
2889+ ${UNITY_SRC}/AbstractIconRenderer.h
2890+ ${UNITY_SRC}/LauncherIcon.cpp
2891+ ${UNITY_SRC}/LauncherIcon.h
2892+ ${UNITY_SRC}/SimpleLauncherIcon.cpp
2893+ ${UNITY_SRC}/SimpleLauncherIcon.h
2894+ ${UNITY_SRC}/BamfLauncherIcon.cpp
2895+ ${UNITY_SRC}/BamfLauncherIcon.h
2896+ ${UNITY_SRC}/BFBLauncherIcon.cpp
2897+ ${UNITY_SRC}/BFBLauncherIcon.h
2898+ ${UNITY_SRC}/SpacerLauncherIcon.cpp
2899+ ${UNITY_SRC}/SpacerLauncherIcon.h
2900+ ${UNITY_SRC}/DndData.cpp
2901+ ${UNITY_SRC}/DndData.h
2902+ ${UNITY_SRC}/TrashLauncherIcon.cpp
2903+ ${UNITY_SRC}/TrashLauncherIcon.h
2904+ ${UNITY_SRC}/DNDCollectionWindow.cpp
2905+ ${UNITY_SRC}/DNDCollectionWindow.h
2906+ ${UNITY_SRC}/DeviceLauncherIcon.cpp
2907+ ${UNITY_SRC}/DeviceLauncherIcon.h
2908+ ${UNITY_SRC}/DeviceLauncherSection.cpp
2909+ ${UNITY_SRC}/DeviceLauncherSection.h
2910+ ${UNITY_SRC}/DevicesSettings.cpp
2911+ ${UNITY_SRC}/DevicesSettings.h
2912+ ${UNITY_SRC}/FavoriteStore.cpp
2913+ ${UNITY_SRC}/FavoriteStore.h
2914+ ${UNITY_SRC}/FavoriteStoreGSettings.cpp
2915+ ${UNITY_SRC}/FavoriteStoreGSettings.h
2916+ ${UNITY_SRC}/LauncherEntryRemoteModel.cpp
2917+ ${UNITY_SRC}/LauncherEntryRemoteModel.h
2918+ ${UNITY_SRC}/LauncherEntryRemote.cpp
2919+ ${UNITY_SRC}/LauncherEntryRemote.h
2920+ ${UNITY_SRC}/LauncherController.cpp
2921+ ${UNITY_SRC}/LauncherController.h
2922+ ${UNITY_SRC}/LauncherModel.cpp
2923+ ${UNITY_SRC}/LauncherModel.h
2924+ ${UNITY_SRC}/Launcher.cpp
2925+ ${UNITY_SRC}/Launcher.h
2926+ ${UNITY_SRC}/LauncherHideMachine.cpp
2927+ ${UNITY_SRC}/LauncherHideMachine.h
2928+ ${UNITY_SRC}/LauncherHoverMachine.cpp
2929+ ${UNITY_SRC}/LauncherHoverMachine.h
2930+ ${UNITY_SRC}/LauncherDragWindow.cpp
2931+ ${UNITY_SRC}/LauncherDragWindow.h
2932+ ${UNITY_SRC}/GeisAdapter.cpp
2933+ ${UNITY_SRC}/GeisAdapter.h
2934+ ${UNITY_SRC}/WindowManager.h
2935+ ${UNITY_SRC}/WindowManager.cpp
2936+ ${UNITY_SRC}/IconRenderer.cpp
2937+ ${UNITY_SRC}/IconRenderer.h
2938+ ${UNITY_SRC}/Tooltip.cpp
2939+ ${UNITY_SRC}/Tooltip.h
2940+ ${UNITY_SRC}/BackgroundEffectHelper.h
2941+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2942+ ${UNITY_SRC}/StaticCairoText.cpp
2943+ ${UNITY_SRC}/StaticCairoText.h
2944+ ${UNITY_SRC}/Introspectable.cpp
2945+ ${UNITY_SRC}/Introspectable.h
2946+ ${UNITY_SRC}/QuicklistMenuItem.cpp
2947+ ${UNITY_SRC}/QuicklistMenuItem.h
2948+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
2949+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
2950+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
2951+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
2952+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
2953+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
2954+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
2955+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
2956+ ${UNITY_SRC}/QuicklistView.cpp
2957+ ${UNITY_SRC}/QuicklistView.h
2958+ ${UNITY_SRC}/QuicklistManager.cpp
2959+ ${UNITY_SRC}/QuicklistManager.h
2960+ ${UNITY_SRC}/UBusMessages.h
2961+ ${UNITY_SRC}/UBusWrapper.cpp
2962+ ${UNITY_SRC}/UBusWrapper.h
2963+ ${UNITY_SRC}/ubus-server.cpp
2964+ ${UNITY_SRC}/ubus-server.h
2965+ )
2966+add_dependencies (test-launcher unity-core-${UNITY_API_VERSION})
2967+
2968+add_executable (test-keyutil
2969+ TestKeyboardUtil.cpp
2970+ ${UNITY_SRC}/KeyboardUtil.h
2971+ ${UNITY_SRC}/KeyboardUtil.cpp
2972+ )
2973+add_dependencies (test-keyutil unity-core-${UNITY_API_VERSION})
2974+
2975+add_executable (test-quicklist
2976+ ui/TestQuicklist.cpp
2977+ ui/EventFaker.cpp
2978+ ui/EventFaker.h
2979+ ${UNITY_SRC}/Introspectable.cpp
2980+ ${UNITY_SRC}/Introspectable.h
2981+ ${UNITY_SRC}/QuicklistMenuItem.cpp
2982+ ${UNITY_SRC}/QuicklistMenuItem.h
2983+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
2984+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
2985+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
2986+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
2987+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
2988+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
2989+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
2990+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
2991+ ${UNITY_SRC}/QuicklistView.cpp
2992+ ${UNITY_SRC}/QuicklistView.h
2993+ ${UNITY_SRC}/ubus-server.cpp
2994+ ${UNITY_SRC}/ubus-server.h
2995+ )
2996+add_dependencies (test-quicklist unity-core-${UNITY_API_VERSION})
2997+
2998+add_executable (test-quicklist-visuals
2999+ ui/TestQuicklistVisuals.cpp
3000+ ui/EventFaker.cpp
3001+ ui/EventFaker.h
3002+ ${UNITY_SRC}/Introspectable.cpp
3003+ ${UNITY_SRC}/Introspectable.h
3004+ ${UNITY_SRC}/QuicklistMenuItem.cpp
3005+ ${UNITY_SRC}/QuicklistMenuItem.h
3006+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
3007+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
3008+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
3009+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
3010+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
3011+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
3012+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
3013+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
3014+ ${UNITY_SRC}/QuicklistView.cpp
3015+ ${UNITY_SRC}/QuicklistView.h
3016+ ${UNITY_SRC}/ubus-server.cpp
3017+ ${UNITY_SRC}/ubus-server.h
3018+ )
3019+add_dependencies (test-quicklist-visuals unity-core-${UNITY_API_VERSION})
3020+
3021+add_executable (test-filters
3022+ TestFilters.cpp
3023+ ${UNITY_SRC}/FilterExpanderLabel.cpp
3024+ ${UNITY_SRC}/FilterBasicButton.cpp
3025+ ${UNITY_SRC}/FilterRatingsButton.cpp
3026+ ${UNITY_SRC}/FilterRatingsWidget.cpp
3027+ ${UNITY_SRC}/FilterGenreButton.cpp
3028+ ${UNITY_SRC}/FilterGenreWidget.cpp
3029+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
3030+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
3031+ ${UNITY_SRC}/DashStyle.cpp
3032+ ${UNITY_SRC}/JSONParser.cpp
3033+ ${UNITY_SRC}/PlacesStyle.cpp
3034+ ${UNITY_SRC}/PlacesStyle.h
3035+ )
3036+add_dependencies(test-filters unity-core-${UNITY_API_VERSION})
3037+
3038+add_executable (test-filter-bar
3039+ TestFilterBar.cpp
3040+ ${UNITY_SRC}/FilterExpanderLabel.cpp
3041+ ${UNITY_SRC}/FilterFactory.cpp
3042+ ${UNITY_SRC}/FilterBasicButton.cpp
3043+ ${UNITY_SRC}/FilterRatingsButton.cpp
3044+ ${UNITY_SRC}/FilterRatingsWidget.cpp
3045+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
3046+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
3047+ ${UNITY_SRC}/FilterGenreButton.cpp
3048+ ${UNITY_SRC}/FilterGenreWidget.cpp
3049+ ${UNITY_SRC}/FilterBar.cpp
3050+ ${UNITY_SRC}/DashStyle.cpp
3051+ ${UNITY_SRC}/JSONParser.cpp
3052+ ${UNITY_SRC}/PlacesStyle.cpp
3053+ ${UNITY_SRC}/PlacesStyle.h
3054+ )
3055+add_dependencies(test-filter-bar unity-core-${UNITY_API_VERSION})
3056+
3057+add_executable (test-preview-applicaiton
3058+ TestPreviewApplications.cpp
3059+ ${UNITY_SRC}/PreviewApplications.cpp
3060+ ${UNITY_SRC}/PreviewBase.cpp
3061+ ${UNITY_SRC}/PreviewBasicButton.cpp
3062+ ${UNITY_SRC}/IconTexture.cpp
3063+ ${UNITY_SRC}/IconLoader.cpp
3064+ ${UNITY_SRC}/Introspectable.cpp
3065+ ${UNITY_SRC}/StaticCairoText.cpp
3066+ ${UNITY_SRC}/TextureCache.cpp
3067+ ${UNITY_SRC}/DashStyle.cpp
3068+ ${UNITY_SRC}/JSONParser.cpp
3069+ ${UNITY_SRC}/Timer.cpp
3070+ )
3071+add_dependencies(test-preview-applicaiton unity-core-${UNITY_API_VERSION})
3072+
3073+add_executable (test-preview-generic
3074+ TestPreviewGeneric.cpp
3075+ ${UNITY_SRC}/PreviewGeneric.cpp
3076+ ${UNITY_SRC}/PreviewBase.cpp
3077+ ${UNITY_SRC}/PreviewBasicButton.cpp
3078+ ${UNITY_SRC}/IconTexture.cpp
3079+ ${UNITY_SRC}/IconLoader.cpp
3080+ ${UNITY_SRC}/Introspectable.cpp
3081+ ${UNITY_SRC}/StaticCairoText.cpp
3082+ ${UNITY_SRC}/TextureCache.cpp
3083+ ${UNITY_SRC}/DashStyle.cpp
3084+ ${UNITY_SRC}/JSONParser.cpp
3085+ ${UNITY_SRC}/Timer.cpp
3086+ )
3087+add_dependencies(test-preview-generic unity-core-${UNITY_API_VERSION})
3088+
3089+add_executable (test-preview-music
3090+ TestPreviewMusic.cpp
3091+ ${UNITY_SRC}/PreviewBase.cpp
3092+ ${UNITY_SRC}/PreviewBasicButton.cpp
3093+ ${UNITY_SRC}/PreviewMusic.cpp
3094+ ${UNITY_SRC}/PreviewMusicTrack.cpp
3095+ ${UNITY_SRC}/PreviewMusicTrackWidget.cpp
3096+ ${UNITY_SRC}/IconTexture.cpp
3097+ ${UNITY_SRC}/IconLoader.cpp
3098+ ${UNITY_SRC}/Introspectable.cpp
3099+ ${UNITY_SRC}/StaticCairoText.cpp
3100+ ${UNITY_SRC}/TextureCache.cpp
3101+ ${UNITY_SRC}/DashStyle.cpp
3102+ ${UNITY_SRC}/JSONParser.cpp
3103+ ${UNITY_SRC}/Timer.cpp
3104+ )
3105+add_dependencies(test-preview-music unity-core-${UNITY_API_VERSION})
3106+
3107+add_executable (test-result-view
3108+ TestResultView.cpp
3109+ ${UNITY_SRC}/PlacesStyle.cpp
3110+ ${UNITY_SRC}/PlacesStyle.h
3111+ ${UNITY_SRC}/PreviewApplications.cpp
3112+ ${UNITY_SRC}/PreviewBase.cpp
3113+ ${UNITY_SRC}/PreviewBasicButton.cpp
3114+ ${UNITY_SRC}/ResultView.cpp
3115+ ${UNITY_SRC}/ResultViewGrid.cpp
3116+ ${UNITY_SRC}/ResultRenderer.cpp
3117+ ${UNITY_SRC}/ResultRendererTile.cpp
3118+ ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
3119+ ${UNITY_SRC}/IconTexture.cpp
3120+ ${UNITY_SRC}/IconLoader.cpp
3121+ ${UNITY_SRC}/Introspectable.cpp
3122+ ${UNITY_SRC}/StaticCairoText.cpp
3123+ ${UNITY_SRC}/TextureCache.cpp
3124+ ${UNITY_SRC}/Timer.cpp
3125+ ${UNITY_SRC}/DashStyle.cpp
3126+ ${UNITY_SRC}/JSONParser.cpp
3127+ ${UNITY_SRC}/UBusMessages.h
3128+ ${UNITY_SRC}/UBusWrapper.cpp
3129+ ${UNITY_SRC}/UBusWrapper.h
3130+ ${UNITY_SRC}/ubus-server.cpp
3131+ ${UNITY_SRC}/ubus-server.h
3132+ )
3133+add_dependencies(test-result-view unity-core-${UNITY_API_VERSION})
3134+
3135+add_executable (test-dash-style
3136+ TestDashStyle.cpp
3137+ ${UNITY_SRC}/DashStyle.cpp
3138+ ${UNITY_SRC}/DashStyle.h
3139+ ${UNITY_SRC}/JSONParser.cpp
3140+ ${PLACES_COMMON_SOURCE}
3141+ )
3142+add_dependencies (test-dash-style unity-core-${UNITY_API_VERSION})
3143+
3144+add_executable (test-bg-hash
3145+ TestBGHash.cpp
3146+ ${UNITY_SRC}/BGHash.cpp
3147+ ${UNITY_SRC}/BGHash.h
3148+ ${UNITY_SRC}/ubus-server.cpp
3149+ ${UNITY_SRC}/ubus-server.h
3150+ )
3151+add_dependencies (test-bg-hash unity-core-${UNITY_API_VERSION})
3152+
3153+find_package (OpenGL)
3154+
3155+include_directories (${OPENGL_gl_INCDIRS})
3156+add_library (glfuncloader SHARED
3157+ ${CMAKE_CURRENT_SOURCE_DIR}/GLFuncLoader.cpp)
3158+target_link_libraries (glfuncloader dl ${OPENGL_gl_LIBRARY})
3159+add_executable (screen-effect-fbo
3160+ TestScreenEffectFramebufferObject.cpp
3161+ ${UNITY_SRC}/ScreenEffectFramebufferObject.cpp
3162+ ${UNITY_SRC}/BackgroundEffectHelper.cpp)
3163+
3164+target_link_libraries (screen-effect-fbo glfuncloader ${OPENGL_gl_LIBRARY})
3165+add_dependencies (screen-effect-fbo unity-core-${UNITY_API_VERSION})
3166+
3167+>>>>>>> MERGE-SOURCE
3168 add_subdirectory (test-input-remover)
3169 add_subdirectory (test-minimize-window-handler)
3170 add_subdirectory (test-get-transients)
3171
3172=== added file 'tests/GLFuncLoader.cpp'
3173--- tests/GLFuncLoader.cpp 1970-01-01 00:00:00 +0000
3174+++ tests/GLFuncLoader.cpp 2012-01-18 19:37:39 +0000
3175@@ -0,0 +1,51 @@
3176+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3177+/* Compiz unity plugin
3178+ * unity.h
3179+ *
3180+ * Copyright (c) 2010-11 Canonical Ltd.
3181+ *
3182+ * This program is free software; you can redistribute it and/or
3183+ * modify it under the terms of the GNU General Public License
3184+ * as published by the Free Software Foundation; either version 3
3185+ * of the License, or (at your option) any later version.
3186+ *
3187+ * This program is distributed in the hope that it will be useful,
3188+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3189+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3190+ * GNU General Public License for more details.
3191+ *
3192+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
3193+ */
3194+
3195+#include "GLFuncLoader.h"
3196+#include <dlfcn.h>
3197+
3198+unity::GLLoader::FuncPtr unity::GLLoader::getProcAddr(const std::string &name)
3199+{
3200+ static void *dlhand = NULL;
3201+ FuncPtr funcPtr = NULL;
3202+
3203+ glGetError ();
3204+
3205+ if (!funcPtr)
3206+ {
3207+ if (!dlhand)
3208+ dlhand = dlopen ("libglfuncloader.so", RTLD_LAZY);
3209+
3210+ char *error = dlerror ();
3211+
3212+ if (dlhand)
3213+ {
3214+ dlerror ();
3215+ funcPtr = (FuncPtr) dlsym (dlhand, name.c_str ());
3216+
3217+ error = dlerror ();
3218+ if (error != NULL)
3219+ funcPtr = NULL;
3220+ }
3221+ }
3222+
3223+ return funcPtr;
3224+}
3225+
3226+
3227
3228=== added file 'tests/GLFuncLoader.h'
3229--- tests/GLFuncLoader.h 1970-01-01 00:00:00 +0000
3230+++ tests/GLFuncLoader.h 2012-01-18 19:37:39 +0000
3231@@ -0,0 +1,33 @@
3232+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3233+/* Compiz unity plugin
3234+ * unity.h
3235+ *
3236+ * Copyright (c) 2010-11 Canonical Ltd.
3237+ *
3238+ * This program is free software; you can redistribute it and/or
3239+ * modify it under the terms of the GNU General Public License
3240+ * as published by the Free Software Foundation; either version 3
3241+ * of the License, or (at your option) any later version.
3242+ *
3243+ * This program is distributed in the hope that it will be useful,
3244+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3245+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3246+ * GNU General Public License for more details.
3247+ *
3248+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
3249+ */
3250+
3251+#include <string>
3252+#include <GL/gl.h>
3253+#include <GL/glx.h>
3254+
3255+namespace unity
3256+{
3257+namespace GLLoader
3258+{
3259+typedef void (*FuncPtr) (void);
3260+typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
3261+
3262+FuncPtr getProcAddr(const std::string &name);
3263+}
3264+}
3265
3266=== added file 'tests/TestScreenEffectFramebufferObject.cpp'
3267--- tests/TestScreenEffectFramebufferObject.cpp 1970-01-01 00:00:00 +0000
3268+++ tests/TestScreenEffectFramebufferObject.cpp 2012-01-18 19:37:39 +0000
3269@@ -0,0 +1,671 @@
3270+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3271+/* Compiz unity plugin
3272+ * unity.h
3273+ *
3274+ * Copyright (c) 2010-11 Canonical Ltd.
3275+ *
3276+ * This program is free software; you can redistribute it and/or
3277+ * modify it under the terms of the GNU General Public License
3278+ * as published by the Free Software Foundation; either version 3
3279+ * of the License, or (at your option) any later version.
3280+ *
3281+ * This program is distributed in the hope that it will be useful,
3282+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3283+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3284+ * GNU General Public License for more details.
3285+ *
3286+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
3287+ */
3288+
3289+#include "ScreenEffectFramebufferObject.h"
3290+#include "BackgroundEffectHelper.h"
3291+#include "GLFuncLoader.h"
3292+#include <Nux/Nux.h>
3293+#include <Nux/VLayout.h>
3294+#include <Nux/View.h>
3295+#include <Nux/BaseWindow.h>
3296+#include <Nux/WindowCompositor.h>
3297+#include <NuxCore/Logger.h>
3298+#include <NuxCore/Object.h>
3299+#include <X11/Xlib.h>
3300+#include <X11/Xutil.h>
3301+#include <GL/glx.h>
3302+#include <GL/gl.h>
3303+#include <dlfcn.h>
3304+#include <sys/poll.h>
3305+#include <unistd.h>
3306+#include <glib.h>
3307+#include <gtk/gtk.h>
3308+#include <cmath>
3309+
3310+using namespace unity::GLLoader;
3311+
3312+namespace
3313+{
3314+ nux::logging::Logger logger ("unity.test-screeneffectframebufferobject");
3315+
3316+ const static int attributes[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT,
3317+ GLX_X_RENDERABLE, True,
3318+ GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
3319+ GLX_DOUBLEBUFFER, True,
3320+ GLX_RED_SIZE, 8,
3321+ GLX_GREEN_SIZE, 8,
3322+ GLX_BLUE_SIZE, 8, 0};
3323+}
3324+
3325+namespace GLFuncs
3326+{
3327+ GLXGetProcAddressProc glXGetProcAddressP;
3328+ PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfigP;
3329+ PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfigP;
3330+ PFNGLXCREATEWINDOWPROC glXCreateWindowP;
3331+ PFNGLXDESTROYWINDOWPROC glXDestroyWindowP;
3332+ PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrentP;
3333+
3334+ void init ()
3335+ {
3336+ glXGetProcAddressP = (GLXGetProcAddressProc) getProcAddr ("glXGetProcAddress");
3337+ glXChooseFBConfigP = (PFNGLXCHOOSEFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXChooseFBConfig");
3338+ glXGetVisualFromFBConfigP = (PFNGLXGETVISUALFROMFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXGetVisualFromFBConfig");
3339+ glXCreateWindowP = (PFNGLXCREATEWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXCreateWindow");
3340+ glXMakeContextCurrentP = (PFNGLXMAKECONTEXTCURRENTPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXMakeContextCurrent");
3341+ glXDestroyWindowP = (PFNGLXDESTROYWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXDestroyWindow");
3342+ }
3343+}
3344+
3345+class EffectView :
3346+ public nux::View
3347+{
3348+public:
3349+ EffectView (NUX_FILE_LINE_PROTO);
3350+ virtual ~EffectView ();
3351+
3352+ void Draw (nux::GraphicsEngine &context, bool force) { return; };
3353+ void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
3354+private:
3355+ BackgroundEffectHelper bg_effect_helper_;
3356+};
3357+
3358+class Shape
3359+{
3360+ public:
3361+
3362+ typedef boost::shared_ptr <Shape> Ptr;
3363+
3364+ Shape ();
3365+ virtual ~Shape ();
3366+
3367+ float rotation () { return mRotation; }
3368+
3369+ void draw (unsigned int width, unsigned int height) { glDraw (width, height); }
3370+ void rotate () { applyRotation (); }
3371+
3372+ protected:
3373+
3374+ float mRotation;
3375+
3376+ virtual void glDraw (unsigned int width, unsigned int height) = 0;
3377+ virtual void applyRotation () = 0;
3378+ virtual void getRotationAxes (float &x, float &y, float &z) = 0;
3379+};
3380+
3381+Shape::Shape () :
3382+ mRotation (0.0f)
3383+{
3384+}
3385+
3386+Shape::~Shape ()
3387+{
3388+}
3389+
3390+class Triangle :
3391+ public Shape
3392+{
3393+ public:
3394+
3395+ typedef boost::shared_ptr <Triangle> Ptr;
3396+
3397+ protected:
3398+
3399+ void glDraw (unsigned int width, unsigned int height);
3400+ void applyRotation () { mRotation += 5.0f; }
3401+ void getRotationAxes (float &x, float &y, float &z) { x = 0.0f; y = 1.0f; z = 0.0f; }
3402+};
3403+
3404+void
3405+Triangle::glDraw (unsigned int width, unsigned int height)
3406+{
3407+ glBegin(GL_TRIANGLES);
3408+ glColor3f(1.0f, 0.0f, 0.0f);
3409+ glVertex3f(width / 4, height, 0.0f);
3410+ glColor3f(0.0f, 1.0f, 0.0f);
3411+ glVertex3f(0.0f, 0.0f, 0.0f);
3412+ glColor3f(0.0f, 0.0f, 1.0f);
3413+ glVertex3f(width / 2, 0.0f, 0.0f);
3414+ glEnd();
3415+}
3416+
3417+class Square :
3418+ public Shape
3419+{
3420+ public:
3421+
3422+ typedef boost::shared_ptr <Square> Ptr;
3423+
3424+ protected:
3425+
3426+ void glDraw (unsigned int width, unsigned int height);
3427+ void applyRotation () { mRotation -= 2.5f; }
3428+ void getRotationAxes (float &x, float &y, float &z) { x = 1.0f; y = 0.0f; z = 0.0f; }
3429+
3430+};
3431+
3432+void
3433+Square::glDraw (unsigned int width, unsigned int height)
3434+{
3435+ glBegin(GL_QUADS);
3436+ glColor3f(sin (rotation () / 100.0f), -sin (rotation () / 100.0f), cos (rotation () / 100.0f));
3437+ glVertex3f(width / 2, height, 0.0f);
3438+ glColor3f(-sin (rotation () / 100.0f), sin (rotation () / 100.0f), cos (rotation () / 100.0f));
3439+ glVertex3f(width, height, 0.0f);
3440+ glColor3f(sin (rotation () / 100.0f), sin (rotation () / 100.0f), sin (rotation () / 100.0f));
3441+ glVertex3f(width, 0.0f, 0.0f);
3442+ glColor3f(-sin (rotation () / 100.0f), cos (rotation () / 100.0f), cos (rotation () / 100.0f));
3443+ glVertex3f(width / 2, 0.0f, 0.0f);
3444+ glEnd();
3445+}
3446+
3447+class BaseContext
3448+{
3449+ public:
3450+
3451+ BaseContext (Display *);
3452+ ~BaseContext ();
3453+
3454+ void run ();
3455+
3456+ protected:
3457+
3458+ bool eventHandler ();
3459+ bool paintDispatch ();
3460+
3461+ enum class ModifierApplication
3462+ {
3463+ Square,
3464+ Triangle,
3465+ Both
3466+ };
3467+
3468+ void nextWindowPosition ();
3469+ void nextShapeRotation ();
3470+ void setupContextForSize (unsigned int width,
3471+ unsigned int height);
3472+ void drawShape (const Shape::Ptr &) {};
3473+
3474+ private:
3475+
3476+ static gboolean onNewEvents (GIOChannel *channel,
3477+ GIOCondition condition,
3478+ gpointer data);
3479+
3480+ static gboolean onPaintTimeout (gpointer data);
3481+
3482+ static void onWindowThreadCreation (nux::NThread *thread, void *d);
3483+
3484+ Display *mDisplay;
3485+ Window mWindow;
3486+ Colormap mColormap;
3487+ nux::WindowThread *mWindowThread;
3488+ nux::View *mRootView;
3489+ ScreenEffectFramebufferObject::Ptr mFbo;
3490+ GLXWindow mGlxWindow;
3491+ GLXContext mContext;
3492+ ModifierApplication mRotating;
3493+ ModifierApplication mBlur;
3494+ unsigned int mWidth;
3495+ unsigned int mHeight;
3496+ bool mNuxReady;
3497+ Shape::Ptr mTriangle;
3498+ Shape::Ptr mSquare;
3499+};
3500+
3501+BaseContext::BaseContext (Display *display) :
3502+ mDisplay (display),
3503+ mWindowThread (NULL),
3504+ mRotating (ModifierApplication::Both),
3505+ mBlur (ModifierApplication::Both),
3506+ mWidth (640),
3507+ mHeight (480),
3508+ mNuxReady (false),
3509+ mTriangle (new Triangle ()),
3510+ mSquare (new Square ())
3511+{
3512+ int numFBConfig = 0;
3513+ GLXFBConfig *fbConfigs = (*GLFuncs::glXChooseFBConfigP) (mDisplay,
3514+ DefaultScreen (mDisplay),
3515+ attributes,
3516+ &numFBConfig);
3517+ XVisualInfo *visinfo = (*GLFuncs::glXGetVisualFromFBConfigP) (mDisplay,
3518+ fbConfigs[0]);
3519+
3520+ mContext = glXCreateContext (mDisplay, visinfo, 0, GL_TRUE);
3521+ mColormap = XCreateColormap (mDisplay,
3522+ DefaultRootWindow (mDisplay),
3523+ visinfo->visual,
3524+ AllocNone);
3525+
3526+ XSetWindowAttributes wa;
3527+
3528+ wa.colormap = mColormap;
3529+ wa.border_pixel = 0;
3530+ wa.event_mask = StructureNotifyMask | KeyPressMask | ExposureMask;
3531+
3532+ mWindow = XCreateWindow (mDisplay, DefaultRootWindow (mDisplay),
3533+ 0, 0, mWidth, mHeight, 0, visinfo->depth, InputOutput,
3534+ visinfo->visual, CWColormap | CWEventMask | CWBorderPixel,
3535+ &wa);
3536+
3537+ mGlxWindow = (*GLFuncs::glXCreateWindowP) (mDisplay, fbConfigs[0], mWindow, NULL);
3538+
3539+ XStoreName (mDisplay, mWindow, "F1: Toggle Effect, F2: Rotation, F3: Effect");
3540+ XMapWindow (mDisplay, mWindow);
3541+
3542+ bool ready = false;
3543+
3544+ do
3545+ {
3546+ XEvent ev;
3547+ XNextEvent (mDisplay, &ev);
3548+ switch (ev.type)
3549+ {
3550+ case MapNotify:
3551+ case ConfigureNotify:
3552+ case Expose:
3553+ ready = true;
3554+ break;
3555+ default:
3556+ break;
3557+ }
3558+
3559+ } while (!ready);
3560+
3561+ (*GLFuncs::glXMakeContextCurrentP) (mDisplay, mGlxWindow, mGlxWindow, mContext);
3562+
3563+ setupContextForSize (mWidth, mHeight);
3564+}
3565+
3566+void
3567+BaseContext::run ()
3568+{
3569+ GIOChannel *channel;
3570+ mWindowThread = nux::CreateFromForeignWindow (mWindow,
3571+ mContext,
3572+ &BaseContext::onWindowThreadCreation,
3573+ (void *) this);
3574+
3575+ mWindowThread->Run(NULL);
3576+
3577+ while (!mNuxReady);
3578+ g_timeout_add (128, &BaseContext::onPaintTimeout, (gpointer) this);
3579+
3580+ channel = g_io_channel_unix_new (ConnectionNumber (mDisplay));
3581+
3582+ g_io_add_watch (channel, (GIOCondition) (G_IO_IN | G_IO_HUP | G_IO_ERR),
3583+ &BaseContext::onNewEvents, (gpointer) this);
3584+ gtk_main ();
3585+}
3586+
3587+BaseContext::~BaseContext ()
3588+{
3589+ delete mWindowThread;
3590+
3591+ (*GLFuncs::glXMakeContextCurrentP) (mDisplay, None, None, mContext);
3592+ glXDestroyContext (mDisplay, mContext);
3593+ (*GLFuncs::glXDestroyWindowP) (mDisplay, mGlxWindow);
3594+
3595+ XFreeColormap (mDisplay, mColormap);
3596+ XDestroyWindow (mDisplay, mWindow);
3597+}
3598+
3599+void
3600+BaseContext::setupContextForSize (unsigned int width,
3601+ unsigned int height)
3602+{
3603+ mWidth = width;
3604+ mHeight = height;
3605+
3606+ glViewport(0, 0, width, height);
3607+ glDrawBuffer (GL_BACK);
3608+ glReadBuffer (GL_BACK);
3609+ glMatrixMode(GL_PROJECTION);
3610+ glLoadIdentity();
3611+ gluPerspective(60.0f, 1.0f, 0.1f, 100.0f);
3612+ glMatrixMode(GL_MODELVIEW);
3613+ glLoadIdentity ();
3614+ glClearColor (1, 1, 1, 1);
3615+ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3616+ glXSwapBuffers (mDisplay, mGlxWindow);
3617+
3618+ if (mFbo)
3619+ mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
3620+
3621+ if (mRootView && mNuxReady)
3622+ {
3623+ switch (mBlur)
3624+ {
3625+ case ModifierApplication::Both:
3626+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
3627+ break;
3628+ case ModifierApplication::Triangle:
3629+ mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3630+ break;
3631+ case ModifierApplication::Square:
3632+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
3633+ break;
3634+ default:
3635+ break;
3636+ }
3637+ }
3638+}
3639+
3640+bool
3641+BaseContext::eventHandler ()
3642+{
3643+ XEvent event;
3644+ XEvent *ev = &event;
3645+
3646+ XNextEvent (mDisplay, &event);
3647+
3648+ switch (ev->type)
3649+ {
3650+ case KeyPress:
3651+ if (XLookupKeysym (&ev->xkey, 0) == XK_Escape)
3652+ return false;
3653+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F1)
3654+ {
3655+ if (!mFbo)
3656+ {
3657+ BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
3658+ mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
3659+ }
3660+ else
3661+ {
3662+ BackgroundEffectHelper::blur_type = unity::BLUR_NONE;
3663+ mFbo.reset ();
3664+ }
3665+ }
3666+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F2)
3667+ nextShapeRotation ();
3668+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F3)
3669+ nextWindowPosition ();
3670+ break;
3671+ case ConfigureNotify:
3672+ setupContextForSize (ev->xconfigure.width, ev->xconfigure.height);
3673+ default:
3674+ break;
3675+ }
3676+
3677+ return true;
3678+}
3679+
3680+gboolean
3681+BaseContext::onNewEvents (GIOChannel *channel,
3682+ GIOCondition condition,
3683+ gpointer data)
3684+{
3685+ BaseContext *self = static_cast <BaseContext *> (data);
3686+
3687+ if (condition & G_IO_IN)
3688+ {
3689+ if (self->eventHandler ())
3690+ return TRUE;
3691+ else
3692+ return FALSE;
3693+ }
3694+
3695+ return TRUE;
3696+}
3697+
3698+gboolean
3699+BaseContext::onPaintTimeout (gpointer data)
3700+{
3701+ BaseContext *self = static_cast <BaseContext *> (data);
3702+
3703+ if (self->paintDispatch ())
3704+ return TRUE;
3705+
3706+ return FALSE;
3707+}
3708+
3709+void
3710+BaseContext::nextShapeRotation ()
3711+{
3712+ switch (mRotating)
3713+ {
3714+ case ModifierApplication::Both:
3715+ mRotating = ModifierApplication::Triangle;
3716+ break;
3717+ case ModifierApplication::Triangle:
3718+ mRotating = ModifierApplication::Square;
3719+ break;
3720+ case ModifierApplication::Square:
3721+ mRotating = ModifierApplication::Both;
3722+ break;
3723+ default:
3724+ break;
3725+ }
3726+}
3727+
3728+void
3729+BaseContext::nextWindowPosition ()
3730+{
3731+ switch (mBlur)
3732+ {
3733+ case ModifierApplication::Both:
3734+ mBlur = ModifierApplication::Triangle;
3735+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
3736+ break;
3737+ case ModifierApplication::Triangle:
3738+ mBlur = ModifierApplication::Square;
3739+ mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3740+ break;
3741+ case ModifierApplication::Square:
3742+ mBlur = ModifierApplication::Both;
3743+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
3744+ break;
3745+ default:
3746+ break;
3747+ }
3748+}
3749+
3750+EffectView::EffectView (NUX_FILE_LINE_DECL)
3751+ : View (NUX_FILE_LINE_PARAM)
3752+{
3753+ bg_effect_helper_.owner = this;
3754+}
3755+
3756+EffectView::~EffectView ()
3757+{
3758+}
3759+
3760+void EffectView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
3761+{
3762+ nux::Geometry base = GetGeometry();
3763+ GfxContext.PushClippingRectangle(base);
3764+ nux::Geometry blur_geo (base.x, base.y, base.width, base.height);
3765+
3766+ if (BackgroundEffectHelper::blur_type == unity::BLUR_ACTIVE)
3767+ {
3768+ bg_effect_helper_.enabled = true;
3769+
3770+ auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo);
3771+
3772+ if (blur_texture.IsValid ())
3773+ {
3774+ nux::TexCoordXForm texxform_blur_bg;
3775+ texxform_blur_bg.flip_v_coord = true;
3776+ texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
3777+ texxform_blur_bg.uoffset = ((float) base.x) / (base.width);
3778+ texxform_blur_bg.voffset = ((float) base.y) / (base.height);
3779+
3780+ nux::ROPConfig rop;
3781+ rop.Blend = false;
3782+ rop.SrcBlend = GL_ONE;
3783+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
3784+
3785+ gPainter.PushDrawTextureLayer(GfxContext, base,
3786+ blur_texture,
3787+ texxform_blur_bg,
3788+ nux::color::White,
3789+ true,
3790+ rop);
3791+ }
3792+ }
3793+ else
3794+ bg_effect_helper_.enabled = false;
3795+ GfxContext.PopClippingRectangle();
3796+}
3797+
3798+bool
3799+BaseContext::paintDispatch ()
3800+{
3801+ if (mFbo)
3802+ {
3803+ switch (mRotating)
3804+ {
3805+ case ModifierApplication::Both:
3806+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth, mHeight));
3807+ break;
3808+ case ModifierApplication::Triangle:
3809+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth / 2, mHeight));
3810+ break;
3811+ case ModifierApplication::Square:
3812+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3813+ break;
3814+ }
3815+
3816+ mFbo->bind (nux::Geometry (0, 0, mWidth, mHeight));
3817+
3818+ if (!mFbo->status ())
3819+ {
3820+ LOG_INFO (logger) << "FBO not ok!";
3821+ }
3822+ }
3823+
3824+ glClearColor (1, 1, 1, 1);
3825+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3826+ glPushMatrix ();
3827+ glLoadIdentity();
3828+ glTranslatef(-0.5f, -0.5f, -0.866025404f);
3829+ glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
3830+ glTranslatef(mWidth * 0.25, 0, 0);
3831+ glRotatef(mTriangle->rotation (), 0.0f, 1.0f, 0.0f);
3832+ glTranslatef(-(mWidth * 0.25), 0, 0);
3833+
3834+ mTriangle->draw (mWidth, mHeight);
3835+
3836+ glLoadIdentity();
3837+ glTranslatef(-0.5f, -0.5f, -0.866025404f);
3838+ glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
3839+ glTranslatef(mWidth * 0.75, 0, 0);
3840+ glRotatef(mSquare->rotation (), 0.0f, 1.0f, 0.0f);
3841+ glTranslatef(-(mWidth * 0.75), 0, 0);
3842+
3843+ mSquare->draw (mWidth, mHeight);
3844+
3845+ glColor4f (1.0f, 1.0f, 1.0f, 5.0f);
3846+ glPopMatrix ();
3847+
3848+ if (mFbo)
3849+ mFbo->unbind ();
3850+
3851+ if (mFbo && mFbo->status ())
3852+ {
3853+ glClearColor (1, 1, 1, 1);
3854+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3855+ glPushMatrix ();
3856+ glLoadIdentity();
3857+ glTranslatef(-0.5f, 0.5f, -0.866025404f);
3858+ glScalef (1.0f / mWidth, -(1.0f / mHeight), 0.0f);
3859+ mFbo->paint (nux::Geometry (0, 0, mWidth, mHeight));
3860+ glPopMatrix ();
3861+
3862+ nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
3863+ nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID (mFbo->texture(),
3864+ mWidth, mHeight, 1, nux::BITFMT_R8G8B8A8);
3865+
3866+ nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
3867+
3868+ nux::Geometry geo = nux::Geometry (0, 0, mWidth, mHeight);
3869+ BackgroundEffectHelper::monitor_rect_ = geo;
3870+ }
3871+
3872+ glMatrixMode(GL_PROJECTION);
3873+ glPushMatrix();
3874+
3875+ glMatrixMode(GL_MODELVIEW);
3876+ glPushMatrix();
3877+ glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT |
3878+ GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT | GL_SCISSOR_BIT);
3879+ mRootView->ProcessDraw (mWindowThread->GetGraphicsEngine (), true);
3880+ glMatrixMode(GL_PROJECTION);
3881+ glPopMatrix();
3882+ glMatrixMode(GL_MODELVIEW);
3883+ glPopMatrix();
3884+
3885+ glDrawBuffer(GL_BACK);
3886+ glReadBuffer(GL_BACK);
3887+
3888+ glPopAttrib();
3889+
3890+ glXSwapBuffers (mDisplay, mGlxWindow);
3891+
3892+ switch (mRotating)
3893+ {
3894+ case ModifierApplication::Both:
3895+ mTriangle->rotate ();
3896+ mSquare->rotate ();
3897+ break;
3898+ case ModifierApplication::Triangle:
3899+ mTriangle->rotate ();
3900+ break;
3901+ case ModifierApplication::Square:
3902+ mSquare->rotate ();
3903+ break;
3904+ }
3905+
3906+ return true;
3907+}
3908+
3909+void
3910+BaseContext::onWindowThreadCreation (nux::NThread *thread, void *data)
3911+{
3912+ BaseContext *bc = static_cast <BaseContext *> (data);
3913+
3914+ bc->mRootView = new EffectView ();
3915+ bc->mRootView->SetGeometry (nux::Geometry (0, 0, 640, 480));
3916+ bc->mNuxReady = true;
3917+ BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
3918+}
3919+
3920+int main (int argc, char **argv)
3921+{
3922+ Display *display = XOpenDisplay (NULL);
3923+ nux::NuxInitialize (0);
3924+ GLFuncs::init ();
3925+ g_type_init ();
3926+ g_thread_init (NULL);
3927+ gtk_init(&argc, &argv);
3928+
3929+ BaseContext *bc = new BaseContext (display);
3930+
3931+ bc->run ();
3932+
3933+ delete bc;
3934+
3935+ XCloseDisplay (display);
3936+
3937+ return 0;
3938+}
3939+
3940+
3941
3942=== modified file 'tests/test_lens.cpp'