Merge lp:~smspillaz/unity/4.0-deps into lp:unity

Proposed by Sam Spilsbury on 2012-01-06
Status: Superseded
Proposed branch: lp:~smspillaz/unity/4.0-deps
Merge into: lp:unity
Diff against target: 3355 lines (+2619/-73) (has conflicts)
41 files modified
AUTHORS (+3/-0)
CMakeLists.txt (+5/-0)
ChangeLog (+390/-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/src/DashController.cpp (+5/-0)
plugins/unityshell/src/DashView.cpp (+5/-0)
plugins/unityshell/src/DashView.h (+6/-0)
plugins/unityshell/src/FilterBar.cpp (+6/-0)
plugins/unityshell/src/FilterExpanderLabel.cpp (+14/-1)
plugins/unityshell/src/FilterGenreWidget.cpp (+4/-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 (+3/-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)
tests/test-get-transients/CMakeLists.txt (+1/-0)
tests/test-input-remover/CMakeLists.txt (+1/-0)
tests/test-minimize-window-handler/CMakeLists.txt (+1/-0)
Text conflict in CMakeLists.txt
Conflict adding file manual-tests.  Moved existing file to manual-tests.moved.
Text conflict in plugins/unityshell/src/DashController.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/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-deps
Reviewer Review Type Date Requested Status
Unity Team 2012-01-06 Pending
Review via email: mp+87744@code.launchpad.net

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

Description of the change

  Also add a dependency on libunity-core for the window handling tests and
  the glfuncloader dlopen loader since link_libraries forces those to be linked
  against libunity-core and since link_libraries doesn't care about target
  dependencies, there is a build race where libunity-core isn't built in time
  for those targets to be (erroneously) linked to.

  The real solution is to kill the call to link_libraries.

To post a comment you must log in.

Unmerged revisions

1733. By Sam Spilsbury on 2012-01-06

Also add a dependency on libunity-core for the window handling tests and
the glfuncloader dlopen loader since link_libraries forces those to be linked
against libunity-core and since link_libraries doesn't care about target
dependencies, there is a build race where libunity-core isn't built in time
for those targets to be (erroneously) linked to.

The real solution is to kill the call to link_libraries.

1732. By David Barth on 2012-01-05

Bumping revision to 4.2.28 to prepare a new SRU

1731. By David Barth on 2012-01-05

Fix for "right-clicking launcher when choosing a workspace causes quicklists to freeze" (#791810)

1730. By David Barth on 2012-01-05

Fix SIGSEGV after SwitcherController desctruction (LP: #887465)

1729. By David Barth on 2012-01-05

reapplies 1713

1728. By David Barth on 2012-01-05

revert rev. 1721 which was causing a regression (#905417)

1727. By David Barth on 2012-01-05

Merge custom dash patch (#785840)

1726. By David Barth on 2012-01-05

Merging in Sam's fix for a multi-monitor crasher (#838128)

1725. By David Barth on 2011-12-15

changelog update, a patch was reverted earlier by gord, see rev. 1723

1724. By David Barth on 2011-12-15

merge lp:~macslow/unity/unity-sru1-4.26.0 in preparation of the 4.26 release candidate

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2011-09-29 16:08:42 +0000
3+++ AUTHORS 2012-01-06 13:12:27 +0000
4@@ -17,6 +17,7 @@
5 Jani Monoses <jani@ubuntu.com>
6 Jason Smith <jason.smith@canonical.com>
7 jassmith@gmail.com
8+ Jay Ó Broin <ismise@lavabit.com>
9 Jay Taoko <jay.taoko@canonical.com>
10 Loïc Molinari <loic.molinari@canonical.com>
11 Marco Biscaro <marcobiscaro2112@gmail.com>
12@@ -26,6 +27,7 @@
13 Marco Trevisan (Treviño) <mail@3v1n0.net>
14 Marius Gedminas <marius@gedmin.as>
15 Michael Terry <mike@mterry.name>
16+ Michal Hruby <michal.mhr@gmail.com>
17 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
18 Mirco Müller <mirco.mueller@ubuntu.com>
19 Mitsuya Shibata
20@@ -42,3 +44,4 @@
21 Ted Gould <ted@gould.cx>
22 Tim Penhey <tim.penhey@canonical.com>
23 Ubuntu <ubuntu@netbook>
24+ Zaid Yeganeh <zaid.yeganeh@gmail.com>
25
26=== modified file 'CMakeLists.txt'
27--- CMakeLists.txt 2011-12-14 17:17:34 +0000
28+++ CMakeLists.txt 2012-01-06 13:12:27 +0000
29@@ -7,8 +7,13 @@
30 # Base bits
31 #
32 set (PROJECT_NAME "unity")
33+<<<<<<< TREE
34 set (UNITY_MAJOR 5)
35 set (UNITY_MINOR 0)
36+=======
37+set (UNITY_MAJOR 4)
38+set (UNITY_MINOR 28)
39+>>>>>>> MERGE-SOURCE
40 set (UNITY_MICRO 0)
41 set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
42 set (UNITY_API_VERSION "5.0")
43
44=== modified file 'ChangeLog'
45--- ChangeLog 2011-10-04 12:16:15 +0000
46+++ ChangeLog 2012-01-06 13:12:27 +0000
47@@ -1,3 +1,393 @@
48+2011-12-15 Mirco Müller <mirco.mueller@canonical.com>
49+
50+ 4.26.0 release with backported fixes (from trunk), please consult "bzr log" for authors of individual patches
51+ * (LP #863114): cannot raise window from panel after minimize
52+ * (LP #865890): compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId()
53+ * back out a horizontal margin that breaks sizing in some cases
54+ * raise input windows from nux unconditionally on alt-tab and showing of the dash using compiz
55+ * (LP #832151): properly unref'ing tray the FilterTrayCallback should not be called again
56+ * (LP #834630): add an out-of-bounds check to the DetailXids vector
57+ * (LP #856205): backported from unity trunk
58+ * (LP #873100): clicking on panel when dash is open no longer causes maximized window to raise (backported r1751)
59+ * (LP #860805): get focus on dash by pressing the super key first time after login (backported r1759)
60+ * (LP #850623, LP #849611): don't segfault in geis_configuration_get_value() (backported r1728)
61+
62+2011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>
63+
64+ Fix tests for FilterMultirangeWidget
65+
66+2011-10-12 Zaid Yeganeh <zaid.yeganeh@gmail.com>
67+
68+ Lens range widgets do not function correctly
69+
70+2011-10-07 Zaid Yeganeh <zaid.yeganeh@gmail.com>
71+
72+ [UnityCore] Fixed the mouse interactions with the multi range filter
73+
74+ modified:
75+ UnityCore/MultiRangeFilter.cpp
76+
77+2011-10-12 Jay Ó Broin <ismise@lavabit.com>
78+
79+ Clicking blank space on top panel doesn't raise maximized window to front
80+
81+2011-10-10 Jay Ó Broin <ismise@lavabit.com>
82+
83+ Add handler to raise maximized window on left-click on panel (LP: #864708)
84+
85+2011-10-12 Brandon Schaefer <schbra02@evergreen.edu>
86+
87+ 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
88+
89+2011-10-11 Brandon Schaefer <brandontschaefer@gmail.com>
90+
91+ Now pressing the ddown key with ibus works
92+
93+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
94+
95+ Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
96+
97+2011-10-11 Robert Carr <robert.carr@canonical.com>
98+
99+ Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
100+
101+2011-10-11 Robert Carr <robert.carr@canonical.com>
102+
103+ Minimum height of multi range filter should be the same as for Genre buttons (32)
104+
105+2011-10-11 Robert Carr <robert.carr@canonical.com>
106+
107+ Merge lp:~robertcarr/unity/filtertweaks
108+
109+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
110+
111+ Merge lp:~smspillaz/unity/unity.fix_870430
112+
113+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
114+
115+ Use correct memory management and temporarily disable focus handlers when passing
116+ the showdesktop wrap chain to core.
117+
118+ Core checks for whether or not the window is allowed focus, for minimized windows
119+ we set this to true because plugins such as scale need to check this value
120+ to determine if a window should be added to their display lists. However, core
121+ will set the "in showdesktop mode" value to true if the window is allowed to have
122+ focus and wasn't already in showdesktop mode by the time the wrap chain is passed,
123+ but the window is already hidden, so it shouldn't be allowed to be included in the
124+ showdesktop list, so disable focus handlers such that CompWindow::focus will
125+ return false
126+
127+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
128+
129+ Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
130+
131+2011-10-12 Marco Trevisan (Treviño) <mail@3v1n0.net>
132+
133+ Leak fix
134+
135+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
136+
137+ PanelService: Code spacing fix
138+
139+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
140+
141+ PanelService: entry2geometry_hash free the keys as well.
142+
143+2011-10-12 Sam Spilsbury <sam.spilsbury@canonical.com>
144+
145+ Merge lp:~smspillaz/unity/unity.fix_843958 (lp:unity r1714)
146+
147+2011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
148+
149+ Merge lp:~smspillaz/unity/unity.fix_870430 (lp:unity r1709)
150+
151+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
152+
153+ Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
154+
155+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
156+
157+ PanelService: reset the use_event variable on menu-hidden
158+
159+ This fixes the bug which caused the menus to re-close when opening one
160+ after that the previous one has been closed using the "ESC" button.
161+
162+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
163+
164+ PanelView: Sync geometries on panel window destruction
165+
166+ This clears the indicators and menus entries geometries cached
167+ in unity panel service.
168+
169+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
170+
171+ PanelView: always sync geometries for indicators.
172+
173+ Don't sync menus only if they aren't available in the current panel window
174+ for the given monitor.
175+
176+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
177+
178+ PanelView: When syncing geometries send a different panel name for each panel window
179+
180+ Thanks to the new unity-panel-service code, this finally fixes bug #869196
181+ for unity.
182+
183+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
184+
185+ PanelService: Order the entries geometry per-panel to fix multi-monitor issues
186+
187+ The entries geometries now are related to their parent panel, so every panel window
188+ that is built now can define the geometries of his own entries.
189+ This allows to redefine the get_entry_at function to make the event_filter function
190+ to work correctly also when we're in a multi-screen environment not cause the indicator
191+ menus to close on non-primary monitors.
192+
193+ This is the needed base to fix bug #869196
194+
195+2011-10-11 Neil Jagdish Patel <neil.patel@canonical.com>
196+
197+ Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
198+
199+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
200+
201+ PanelMenuView: don't react to middle-click when the dash is opened.
202+
203+2011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
204+
205+ PanelMenuView: don't react to double-click when the dash is opened.
206+
207+ Fixes bug #870844
208+
209+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
210+
211+ Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
212+
213+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
214+
215+ Bug #814610: FFe: Since showing devices in Nautilus is removed, there is no way to format an usb stick
216+
217+2011-09-24 Andrea Azzarone <azzaronea@gmail.com>
218+
219+ Add a "Format..." quicklist item to device icons (LP bug# 814610).
220+
221+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
222+
223+ Bug #862849: F10 opens a random menu item when it should open the first one [regression]
224+
225+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
226+
227+ Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
228+
229+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
230+
231+ Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
232+
233+2011-10-10 Robert Carr <racarr@canonical.com>
234+
235+ Minimum height of multi range filter should be the same as for Genre buttons (32)
236+
237+2011-10-10 Robert Carr <racarr@canonical.com>
238+
239+ Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
240+
241+2011-10-10 Robert Carr <racarr@canonical.com>
242+
243+ Merge lp:~robertcarr/unity/filtertweaks
244+
245+2011-10-10 Robert Carr <racarr@canonical.com>
246+
247+ Fix button opacity
248+
249+2011-10-10 Robert Carr <racarr@canonical.com>
250+
251+ Fix all button positioning and right margin
252+
253+2011-10-10 Robert Carr <racarr@canonical.com>
254+
255+ Fix all button shape
256+
257+2011-10-10 Robert Carr <racarr@canonical.com>
258+
259+ Filter Genre widget buttons are too big, fix to match mockup
260+
261+2011-10-10 Robert Carr <racarr@canonical.com>
262+
263+ Fix some spacing in filter bar. work against 863246
264+
265+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
266+
267+ Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
268+
269+2011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
270+
271+ Fixed additional issues (opacity, margin) added to LP: #841750
272+
273+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
274+
275+ Bug #862849: F10 opens a random menu item when it should open the first one [regression]
276+
277+2011-10-07 Andrea Azzarone <azzaronea@gmail.com>
278+
279+ F10 should open the first menu.
280+
281+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
282+
283+ Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
284+
285+2011-10-07 Mirco Müller <mirco.mueller@ubuntu.com>
286+
287+ Don't replace top-bar when dash is opened and there's a maximized window. Fix LP: #839480
288+
289+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
290+
291+ Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
292+
293+2011-10-07 Gord Allott <gord.allott@canonical.com>
294+
295+ fixes issues with clicking when you don't actually move the mouse, but the UI moves underneith it
296+
297+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
298+
299+ [merge] trunk
300+
301+2011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
302+
303+ ibus character selection window not drawn
304+
305+2011-10-09 Brandon Schaefer <brandontschaefer@gmail.com>
306+
307+ Fixed the preedit_cursor_
308+
309+2011-10-07 Brandon Schaefer <brandontschaefer@gmail.com>
310+
311+ Fixed ibus window and text disappearing. Also the preedit text is now highlighted, like it usually is else where
312+
313+2011-10-10 Sam Spilsbury <sam.spilsbury@canonical.com>
314+
315+ Merge lp:~smspillaz/unity/unity.fix_864758
316+
317+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
318+
319+ Remove old minimized window handlers from the handler list and null check
320+ the transient for windows that we read, since compiz may have already removed
321+ them.
322+
323+ Fixes LP #864758
324+
325+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
326+
327+ Merge lp:~smspillaz/unity/unity.fix_868930
328+
329+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
330+
331+ Use a temporary
332+
333+2011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
334+
335+ Do automaximization on placement which only happens once when the window
336+ is mapped after it is created, rather than on reparenting which may happen
337+ if the window is withdrawn.
338+
339+ Fixes LP #868930
340+
341+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
342+
343+ Merge lp:~smspillaz/unity/unity.fix_867959
344+
345+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
346+
347+ Fix space
348+
349+2011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
350+
351+ Check for hidden windows rather than minimized ones to cover the
352+ show-desktop case
353+
354+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
355+
356+ Merge lp:~smspillaz/unity/unity.fix_854595
357+
358+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
359+
360+ Cast correctly
361+
362+2011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
363+
364+ Use an enum
365+
366+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
367+
368+ Only force unminimize windows for the launcher case
369+
370+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
371+
372+ Always unminimize initially minimized windows when a launcher icon is
373+ activated since they are inaccessible elsewhere
374+
375+ Fix LP #854595
376+
377+2011-10-06 Jay Taoko <jay.taoko@canonical.com>
378+
379+ Resize the _gradient_texture (in PanelMenuView::Draw) if needed
380+
381+ Fix: bug #863068
382+ Fix: bug #868293
383+ Fix: bug #869028
384+
385+2011-10-06 Alejandro Piñeiro <apinheiro@igalia.com>
386+
387+ Fix bug 843280
388+
389+2011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
390+
391+ Avoid a shadowed variable
392+
393+2011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
394+
395+ a11y: Solves bug 843280
396+
397+2011-10-05 Alex Launi <alex.launi@canonical.com>
398+
399+ merge fix for GetState crash
400+
401+2011-10-03 Alex Launi <alex.launi@canonical.com>
402+
403+ Remove introspection implementations on PanelMenuView to avoid crash
404+
405+2011-10-03 Alex Launi <alex.launi@canonical.com>
406+
407+ merge trunk
408+
409+2011-10-05 Michal Hruby <michal.mhr@gmail.com>
410+
411+ Merge lp:~mhr3/unity/bug-865482
412+
413+2011-10-05 Michal Hruby <michal.mhr@gmail.com>
414+
415+ Merge lp:~mhr3/unity/bug-865482
416+
417+2011-10-04 Michal Hruby <michal.mhr@gmail.com>
418+
419+ Fix bug #865482
420+
421+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
422+
423+ Merge lp:~smspillaz/unity/unity.fix_868185
424+
425+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
426+
427+ Merge lp:~smspillaz/untiy/unity.fix_868185
428+
429+2011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
430+
431+ Fix LP#868185 . Fall through the map case when determining whether or
432+ not to hook the minimize function in core
433+
434+2011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>
435+
436+ Release\ 4.22.0
437+
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-06 13:12:27 +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-06 13:12:27 +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-06 13:12:27 +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-06 13:12:27 +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-06 13:12:27 +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-06 13:12:27 +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-06 13:12:27 +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/src/BackgroundEffectHelper.h'
688=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
689=== modified file 'plugins/unityshell/src/DashController.cpp'
690--- plugins/unityshell/src/DashController.cpp 2011-12-08 01:23:11 +0000
691+++ plugins/unityshell/src/DashController.cpp 2012-01-06 13:12:27 +0000
692@@ -131,8 +131,13 @@
693 SetupDashView();
694 Relayout();
695 ensure_id_ = 0;
696+<<<<<<< TREE
697
698 on_realize.emit();
699+=======
700+
701+ on_realize.emit ();
702+>>>>>>> MERGE-SOURCE
703 }
704
705 nux::BaseWindow* Controller::window() const
706
707=== modified file 'plugins/unityshell/src/DashController.h'
708=== modified file 'plugins/unityshell/src/DashSearchBar.cpp'
709=== modified file 'plugins/unityshell/src/DashView.cpp'
710--- plugins/unityshell/src/DashView.cpp 2011-12-16 21:27:09 +0000
711+++ plugins/unityshell/src/DashView.cpp 2012-01-06 13:12:27 +0000
712@@ -705,9 +705,14 @@
713
714 void DashView::OnSearchFinished(Lens::Hints const& hints)
715 {
716+<<<<<<< TREE
717 std::string search_string = search_bar_->search_string;
718 if (active_lens_view_ && active_lens_view_->search_string == search_string)
719 {
720+=======
721+ if (search_bar_->search_string == search_string)
722+ {
723+>>>>>>> MERGE-SOURCE
724 search_bar_->SearchFinished();
725 search_in_progress_ = false;
726 if (activate_on_finish_)
727
728=== modified file 'plugins/unityshell/src/DashView.h'
729--- plugins/unityshell/src/DashView.h 2011-12-14 16:18:41 +0000
730+++ plugins/unityshell/src/DashView.h 2012-01-06 13:12:27 +0000
731@@ -132,10 +132,16 @@
732 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_;
733
734 std::string last_activated_uri_;
735+<<<<<<< TREE
736 // we're passing this back to g_* functions, so we'll keep the g* type
737 guint searching_timeout_id_;
738 bool search_in_progress_;
739 bool activate_on_finish_;
740+=======
741+ guint searching_timeout_id_;
742+ bool search_in_progress_;
743+ bool activate_on_finish_;
744+>>>>>>> MERGE-SOURCE
745
746 bool visible_;
747 };
748
749=== modified file 'plugins/unityshell/src/FilterBar.cpp'
750--- plugins/unityshell/src/FilterBar.cpp 2011-10-19 16:28:06 +0000
751+++ plugins/unityshell/src/FilterBar.cpp 2012-01-06 13:12:27 +0000
752@@ -44,8 +44,14 @@
753 }
754
755 void FilterBar::Init () {
756+<<<<<<< TREE
757 nux::LinearLayout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);
758 layout->SetSpaceBetweenChildren(12);
759+=======
760+ nux::Layout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);
761+ layout->SetVerticalInternalMargin(12);
762+ layout->SetVerticalExternalMargin(0);
763+>>>>>>> MERGE-SOURCE
764 SetLayout (layout);
765 }
766
767
768=== modified file 'plugins/unityshell/src/FilterExpanderLabel.cpp'
769--- plugins/unityshell/src/FilterExpanderLabel.cpp 2011-10-25 19:37:13 +0000
770+++ plugins/unityshell/src/FilterExpanderLabel.cpp 2012-01-06 13:12:27 +0000
771@@ -26,7 +26,11 @@
772
773 #include "FilterBasicButton.h"
774 #include "FilterExpanderLabel.h"
775+<<<<<<< TREE
776 #include "DashStyle.h"
777+=======
778+#include "PlacesStyle.h"
779+>>>>>>> MERGE-SOURCE
780
781 namespace unity {
782
783@@ -74,9 +78,11 @@
784
785 void FilterExpanderLabel::BuildLayout ()
786 {
787+ PlacesStyle *style = PlacesStyle::GetDefault();
788+
789 layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);
790 top_bar_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
791-
792+
793 cairo_label_ = new nux::StaticText(label_.c_str(), NUX_TRACKER_LOCATION);
794 cairo_label_->SetFontName("Ubuntu 10");
795 cairo_label_->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
796@@ -91,11 +97,18 @@
797
798 top_bar_layout_->AddView (cairo_label_, 1, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
799 top_bar_layout_->AddSpace(1, 1);
800+
801+ top_bar_layout_->SetMaximumWidth((style->GetTileWidth() -12)*2+10);
802
803+<<<<<<< TREE
804 top_bar_layout_->SetMaximumWidth((dash::Style::Instance().GetTileWidth() -12)*2+10);
805
806 layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);
807 layout_->SetVerticalInternalMargin(0);
808+=======
809+ layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);
810+ layout_->SetVerticalInternalMargin(0);
811+>>>>>>> MERGE-SOURCE
812
813 SetLayout(layout_);
814
815
816=== modified file 'plugins/unityshell/src/FilterGenreWidget.cpp'
817--- plugins/unityshell/src/FilterGenreWidget.cpp 2011-10-25 16:32:49 +0000
818+++ plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-06 13:12:27 +0000
819@@ -58,7 +58,11 @@
820 genre_layout_->SetSpaceBetweenChildren (10, 12);
821 genre_layout_->SetTopAndBottomPadding (12);
822 genre_layout_->EnablePartialVisibility (false);
823+<<<<<<< TREE
824 genre_layout_->SetChildrenSize (dash::Style::Instance().GetTileWidth() - 12, 32);
825+=======
826+ genre_layout_->SetChildrenSize (style->GetTileWidth() - 12, 32);
827+>>>>>>> MERGE-SOURCE
828
829 SetRightHandView(all_button_);
830 SetContents(genre_layout_);
831
832=== modified file 'plugins/unityshell/src/FilterMultiRangeButton.cpp'
833=== modified file 'plugins/unityshell/src/GeisAdapter.cpp'
834--- plugins/unityshell/src/GeisAdapter.cpp 2011-12-22 17:52:55 +0000
835+++ plugins/unityshell/src/GeisAdapter.cpp 2012-01-06 13:12:27 +0000
836@@ -469,7 +469,7 @@
837 GEIS_XCB_FULL_WINDOW,
838 &xcb_win_info
839 };
840- GeisInstance instance;
841+ GeisInstance instance = nullptr;
842
843 status = geis_init(&win_info, &instance);
844 if (status != GEIS_STATUS_SUCCESS)
845
846=== modified file 'plugins/unityshell/src/IMTextEntry.cpp'
847--- plugins/unityshell/src/IMTextEntry.cpp 2011-12-10 06:41:53 +0000
848+++ plugins/unityshell/src/IMTextEntry.cpp 2012-01-06 13:12:27 +0000
849@@ -263,12 +263,21 @@
850
851 LOG_DEBUG(logger) << "Preedit changed: " << preedit;
852
853+<<<<<<< TREE
854 preedit_ = preedit.Str();
855+=======
856+ _preedit = preedit.Str();
857+>>>>>>> MERGE-SOURCE
858
859 if (strlen(preedit.Str().c_str())) {
860 preedit_cursor_ = preedit.Str().length();
861+<<<<<<< TREE
862 QueueRefresh(true, true);
863 sigTextChanged.emit(this);
864+=======
865+ QueueRefresh(true, true);
866+ sigTextChanged.emit(this);
867+>>>>>>> MERGE-SOURCE
868 UpdateCursorLocation();
869 }
870 }
871@@ -286,9 +295,15 @@
872 ResetPreedit();
873 gtk_im_context_reset(im_context_);
874
875+<<<<<<< TREE
876 QueueRefresh(true, true);
877 sigTextChanged.emit(this);
878
879+=======
880+ QueueRefresh(true, true);
881+ sigTextChanged.emit(this);
882+
883+>>>>>>> MERGE-SOURCE
884 LOG_DEBUG(logger) << "Preedit ended";
885 }
886
887
888=== modified file 'plugins/unityshell/src/JSONParser.cpp'
889--- plugins/unityshell/src/JSONParser.cpp 2011-09-15 04:28:49 +0000
890+++ plugins/unityshell/src/JSONParser.cpp 2012-01-06 13:12:27 +0000
891@@ -145,6 +145,19 @@
892 values[i] = json_array_get_double_element(array, i);
893 }
894
895+void Parser::ReadString(std::string const& node_name,
896+ std::string const& member_name,
897+ std::string& value) const
898+{
899+ JsonObject* object = GetNodeObject(node_name);
900+
901+ if (!object)
902+ return;
903+
904+ if (json_object_has_member(object, member_name.c_str()))
905+ value = json_object_get_string_member(object, member_name.c_str());
906+}
907+
908 void Parser::ReadColor(std::string const& node_name,
909 std::string const& member_name,
910 std::string const& opacity_name,
911
912=== modified file 'plugins/unityshell/src/JSONParser.h'
913--- plugins/unityshell/src/JSONParser.h 2011-09-15 04:28:49 +0000
914+++ plugins/unityshell/src/JSONParser.h 2012-01-06 13:12:27 +0000
915@@ -58,6 +58,10 @@
916 std::string const& member_name,
917 std::vector<double>& values) const;
918
919+ void ReadString(std::string const& node_name,
920+ std::string const& member_name,
921+ std::string& value) const;
922+
923 void ReadColor(std::string const& node_name,
924 std::string const& member_name,
925 std::string const& opacity_name,
926
927=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
928--- plugins/unityshell/src/LauncherIcon.cpp 2012-01-03 15:41:37 +0000
929+++ plugins/unityshell/src/LauncherIcon.cpp 2012-01-06 13:12:27 +0000
930@@ -549,8 +549,11 @@
931
932 for (auto menu_item : menus)
933 {
934+<<<<<<< TREE
935 QuicklistMenuItem* ql_item;
936
937+=======
938+>>>>>>> MERGE-SOURCE
939 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
940 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
941 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);
942
943=== modified file 'plugins/unityshell/src/LauncherIcon.h'
944=== modified file 'plugins/unityshell/src/LensView.cpp'
945--- plugins/unityshell/src/LensView.cpp 2011-12-14 16:18:41 +0000
946+++ plugins/unityshell/src/LensView.cpp 2012-01-06 13:12:27 +0000
947@@ -144,8 +144,15 @@
948 void LensView::SetupViews()
949 {
950 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
951+<<<<<<< TREE
952
953 layout_->SetHorizontalExternalMargin(8);
954+=======
955+
956+ // Breaks the sizing of the whole dash causing some colums to be clipped from result view.
957+ // look in to this for P.
958+ // layout_->SetHorizontalExternalMargin(8);
959+>>>>>>> MERGE-SOURCE
960
961 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),
962 NUX_TRACKER_LOCATION);
963
964=== modified file 'plugins/unityshell/src/PanelIndicatorsView.cpp'
965=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
966=== modified file 'plugins/unityshell/src/PanelMenuView.h'
967=== modified file 'plugins/unityshell/src/PanelTray.cpp'
968--- plugins/unityshell/src/PanelTray.cpp 2011-12-14 20:04:23 +0000
969+++ plugins/unityshell/src/PanelTray.cpp 2012-01-06 13:12:27 +0000
970@@ -95,7 +95,11 @@
971 if (_tray)
972 {
973 g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id);
974+<<<<<<< TREE
975 g_object_unref (_tray);
976+=======
977+ g_object_unref(_tray);
978+>>>>>>> MERGE-SOURCE
979 _tray = NULL;
980 }
981
982
983=== modified file 'plugins/unityshell/src/PanelView.cpp'
984--- plugins/unityshell/src/PanelView.cpp 2012-01-06 04:53:09 +0000
985+++ plugins/unityshell/src/PanelView.cpp 2012-01-06 13:12:27 +0000
986@@ -138,6 +138,11 @@
987 {
988 if (_track_menu_pointer_id)
989 g_source_remove(_track_menu_pointer_id);
990+<<<<<<< TREE
991+=======
992+
993+ _style->UnReference();
994+>>>>>>> MERGE-SOURCE
995 UBusServer *ubus = ubus_server_get_default();
996 ubus_server_unregister_interest(ubus, _handle_bg_color_update);
997 ubus_server_unregister_interest(ubus, _handle_dash_hidden);
998@@ -152,6 +157,9 @@
999 indicator::EntryLocationMap locations;
1000 _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
1001
1002+ indicator::EntryLocationMap locations;
1003+ _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
1004+
1005 delete _bg_layer;
1006 }
1007
1008
1009=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
1010=== modified file 'plugins/unityshell/src/PlacesHomeView.cpp'
1011--- plugins/unityshell/src/PlacesHomeView.cpp 2011-12-14 20:04:23 +0000
1012+++ plugins/unityshell/src/PlacesHomeView.cpp 2012-01-06 13:12:27 +0000
1013@@ -38,17 +38,30 @@
1014 #include "UBusMessages.h"
1015
1016 #include "PlacesHomeView.h"
1017+<<<<<<< TREE
1018+=======
1019+
1020+#include "JSONParser.h"
1021+>>>>>>> MERGE-SOURCE
1022 #include "PlacesSimpleTile.h"
1023
1024 #include "DashStyle.h"
1025 #include <UnityCore/GLibWrapper.h>
1026 #include <UnityCore/Variant.h>
1027
1028+#include <sstream>
1029 #include <string>
1030 #include <vector>
1031
1032+#include <boost/algorithm/string.hpp>
1033+
1034 #define DELTA_DOUBLE_REQUEST 500000000
1035
1036+namespace
1037+{
1038+ const std::string custom_shortcuts_file = "/unity/HomeShortcutsCustomized.json";
1039+}
1040+
1041 namespace unity
1042 {
1043
1044@@ -135,7 +148,9 @@
1045
1046 expanded.connect(sigc::mem_fun(this, &PlacesHomeView::Refresh));
1047
1048- Refresh();
1049+ // Wait for the asynchronous loading of the lenses to complete
1050+ // before refreshing the view for the first time.
1051+ _lenses.lenses_loaded.connect(sigc::bind(sigc::mem_fun(this, &PlacesHomeView::Refresh), (PlacesGroup*) NULL));
1052 }
1053
1054 PlacesHomeView::~PlacesHomeView()
1055@@ -161,64 +176,227 @@
1056
1057 _layout->Clear();
1058
1059- // Media Apps
1060- markup = g_strdup_printf(temp, _("Media Apps"));
1061- shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",
1062- markup,
1063- icon_size);
1064- shortcut->_id = TYPE_PLACE;
1065- shortcut->_place_id = g_strdup("applications.lens?filter_type=media");
1066- shortcut->_place_section = 9;
1067- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1068- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1069- g_free(markup);
1070-
1071- // Internet Apps
1072- markup = g_strdup_printf(temp, _("Internet Apps"));
1073- shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",
1074- markup,
1075- icon_size);
1076- shortcut->_id = TYPE_PLACE;
1077- shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");
1078- shortcut->_place_section = 8;
1079- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1080- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1081- g_free(markup);
1082-
1083- // More Apps
1084- markup = g_strdup_printf(temp, _("More Apps"));
1085- shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",
1086- markup,
1087- icon_size);
1088- shortcut->_id = TYPE_PLACE;
1089- shortcut->_place_id = g_strdup("applications.lens");
1090- shortcut->_place_section = 0;
1091- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1092- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1093- g_free(markup);
1094-
1095- // Find Files
1096- markup = g_strdup_printf(temp, _("Find Files"));
1097- shortcut = new Shortcut(PKGDATADIR"/find_files.png",
1098- markup,
1099- icon_size);
1100- shortcut->_id = TYPE_PLACE;
1101- shortcut->_place_id = g_strdup("files.lens");
1102- shortcut->_place_section = 0;
1103- _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1104- shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1105- g_free(markup);
1106-
1107- // Browser
1108- CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);
1109-
1110- // Photos
1111- // FIXME: Need to figure out the default
1112- CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);
1113-
1114- CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);
1115-
1116- CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);
1117+ // The following code path allows one to replace the default dash home screen
1118+ // with a custom home screen, the contents of which are described in a JSON
1119+ // file. The file is looked for in the following locations in decreasing order
1120+ // of priority:
1121+ // - $XDG_CONFIG_HOME/unity/ (defaults to $HOME/.config/unity/)
1122+ // - $DIR/unity/ for $DIR in $XDG_CONFIG_DIRS
1123+ // The syntax of the file is as follows:
1124+ // ==========================================================================
1125+ // {
1126+ // "shortcut1": {
1127+ // "source": $source,
1128+ // "name": $name,
1129+ // "name[fr]": $name_in_french,
1130+ // […]
1131+ // "icon": $icon
1132+ // },
1133+ // "shortcut2": {
1134+ // […]
1135+ // },
1136+ // […]
1137+ // }
1138+ // ==========================================================================
1139+ // The source attribute may either be a desktop file (full path or just its
1140+ // basename if it is located in a standard directory), or a lens file
1141+ // (basename only). This attribute is mandatory.
1142+ // The 'name' attribute is optional. If present, it will override the default
1143+ // display name as advertised by the desktop file or by the lens. The name can
1144+ // be localized in several languages using the square brackets suffix
1145+ // notation, in which case the locale matching the system’s will be used,
1146+ // defaulting to the untranslated 'name' attribute if necessary.
1147+ // The 'icon' attribute is optional. If present, it will override the default
1148+ // icon as advertised by the desktop file or by the lens. It should be a full
1149+ // path name.
1150+ // If the source is a lens, the optional 'filter' attribute allows specifying
1151+ // a filter in the form "$name:$value", e.g. "type:videos" for the files lens.
1152+ // If the source is a lens, the optional 'section' attribute allows specifying
1153+ // a section number (an integer starting at index 0).
1154+
1155+ std::string customShortcuts;
1156+ std::ostringstream file;
1157+ // Look for a custom shortcuts file in the user’s home directory first.
1158+ file << g_get_user_config_dir() << custom_shortcuts_file;
1159+ if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
1160+ {
1161+ customShortcuts = file.str();
1162+ }
1163+ else
1164+ {
1165+ // Fall back on the standard XDG directories.
1166+ gchar** config = (gchar**) g_get_system_config_dirs();
1167+ for (gint i = 0; config[i]; ++i)
1168+ {
1169+ std::ostringstream file;
1170+ file << config[i] << custom_shortcuts_file;
1171+ if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
1172+ {
1173+ customShortcuts = file.str();
1174+ break;
1175+ }
1176+ }
1177+ }
1178+ json::Parser parser;
1179+ if ((customShortcuts == "") || !parser.Open(customShortcuts))
1180+ {
1181+ // Media Apps
1182+ markup = g_strdup_printf(temp, _("Media Apps"));
1183+ shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",
1184+ markup,
1185+ icon_size);
1186+ shortcut->_id = TYPE_PLACE;
1187+ shortcut->_place_id = g_strdup("applications.lens?filter_type=media");
1188+ shortcut->_place_section = 9;
1189+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1190+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1191+ g_free(markup);
1192+
1193+ // Internet Apps
1194+ markup = g_strdup_printf(temp, _("Internet Apps"));
1195+ shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",
1196+ markup,
1197+ icon_size);
1198+ shortcut->_id = TYPE_PLACE;
1199+ shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");
1200+ shortcut->_place_section = 8;
1201+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1202+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1203+ g_free(markup);
1204+
1205+ // More Apps
1206+ markup = g_strdup_printf(temp, _("More Apps"));
1207+ shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",
1208+ markup,
1209+ icon_size);
1210+ shortcut->_id = TYPE_PLACE;
1211+ shortcut->_place_id = g_strdup("applications.lens");
1212+ shortcut->_place_section = 0;
1213+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1214+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1215+ g_free(markup);
1216+
1217+ // Find Files
1218+ markup = g_strdup_printf(temp, _("Find Files"));
1219+ shortcut = new Shortcut(PKGDATADIR"/find_files.png",
1220+ markup,
1221+ icon_size);
1222+ shortcut->_id = TYPE_PLACE;
1223+ shortcut->_place_id = g_strdup("files.lens");
1224+ shortcut->_place_section = 0;
1225+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1226+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1227+ g_free(markup);
1228+
1229+ // Browser
1230+ CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);
1231+
1232+ // Photos
1233+ // FIXME: Need to figure out the default
1234+ CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);
1235+
1236+ CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);
1237+
1238+ CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);
1239+ }
1240+ else
1241+ {
1242+ // The custom shortcuts file can contain up to 8 shortcuts.
1243+ for (int i = 0; i < 8; ++i)
1244+ {
1245+ std::ostringstream oss;
1246+ oss << "shortcut" << (i + 1);
1247+ std::string slot = oss.str();
1248+ std::string source;
1249+ parser.ReadString(slot, "source", source);
1250+ if (source != "")
1251+ {
1252+ std::string icon;
1253+ parser.ReadString(slot, "icon", icon);
1254+
1255+ std::string name;
1256+ gchar** languages = (gchar**) g_get_language_names();
1257+ for (gint i = 0; languages[i]; ++i)
1258+ {
1259+ std::ostringstream key;
1260+ key << "name[" << languages[i] << "]";
1261+ parser.ReadString(slot, key.str(), name);
1262+ if (name != "")
1263+ break;
1264+ }
1265+ if (name == "")
1266+ {
1267+ parser.ReadString(slot, "name", name);
1268+ }
1269+
1270+ if (boost::iends_with(source, ".desktop"))
1271+ {
1272+ GDesktopAppInfo* info = NULL;
1273+ if (boost::istarts_with(source, "/"))
1274+ info = g_desktop_app_info_new_from_filename(source.c_str());
1275+ else
1276+ info = g_desktop_app_info_new(source.c_str());
1277+ if (G_IS_DESKTOP_APP_INFO(info))
1278+ {
1279+ if (name == "")
1280+ name = g_app_info_get_display_name(G_APP_INFO(info));
1281+ if (icon == "")
1282+ {
1283+ gchar* cicon = g_icon_to_string(g_app_info_get_icon(G_APP_INFO(info)));
1284+ icon = cicon;
1285+ g_free(cicon);
1286+ }
1287+ gchar* exec = g_strdup(g_app_info_get_executable(G_APP_INFO(info)));
1288+ markup = g_strdup_printf(temp, name.c_str());
1289+ shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
1290+ shortcut->_id = TYPE_EXEC;
1291+ shortcut->_exec = exec;
1292+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1293+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1294+ g_free(markup);
1295+ g_object_unref(info);
1296+ }
1297+ }
1298+ else if (boost::iends_with(source, ".lens"))
1299+ {
1300+ unity::dash::Lens::Ptr lens = _lenses.GetLens(source);
1301+ if (lens)
1302+ {
1303+ if (name == "")
1304+ name = lens->name;
1305+ if (icon == "")
1306+ icon = lens->icon_hint;
1307+ }
1308+ std::string filter;
1309+ parser.ReadString(slot, "filter", filter);
1310+ int section = -1;
1311+ parser.ReadInt(slot, "section", section);
1312+ markup = g_strdup_printf(temp, name.c_str());
1313+ shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
1314+ shortcut->_id = TYPE_PLACE;
1315+ if (filter != "")
1316+ {
1317+ std::vector<std::string> filter_key_value;
1318+ boost::split(filter_key_value, filter, boost::is_any_of(":"));
1319+ if (filter_key_value.size() == 2)
1320+ shortcut->_place_id = g_strdup_printf("%s?filter_%s=%s",
1321+ source.c_str(),
1322+ filter_key_value[0].c_str(),
1323+ filter_key_value[1].c_str());
1324+ else
1325+ shortcut->_place_id = g_strdup(source.c_str());
1326+ }
1327+ else
1328+ shortcut->_place_id = g_strdup(source.c_str());
1329+ if (section != -1)
1330+ shortcut->_place_section = section;
1331+ _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
1332+ shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
1333+ g_free(markup);
1334+ }
1335+ }
1336+ }
1337+ }
1338
1339 SetExpanded(true);
1340 SetCounts(8, 8);
1341
1342=== modified file 'plugins/unityshell/src/PlacesHomeView.h'
1343--- plugins/unityshell/src/PlacesHomeView.h 2011-12-14 20:04:23 +0000
1344+++ plugins/unityshell/src/PlacesHomeView.h 2012-01-06 13:12:27 +0000
1345@@ -29,6 +29,8 @@
1346
1347 #include <Nux/GridHLayout.h>
1348
1349+#include <UnityCore/FilesystemLenses.h>
1350+
1351 #include "PlacesTile.h"
1352 #include "PlacesGroup.h"
1353
1354@@ -66,6 +68,8 @@
1355 std::vector<std::string> _music_alternatives;
1356
1357 guint _ubus_handle;
1358+
1359+ unity::dash::FilesystemLenses _lenses;
1360 };
1361
1362 }
1363
1364=== modified file 'plugins/unityshell/src/ResultViewGrid.cpp'
1365--- plugins/unityshell/src/ResultViewGrid.cpp 2012-01-02 21:39:28 +0000
1366+++ plugins/unityshell/src/ResultViewGrid.cpp 2012-01-06 13:12:27 +0000
1367@@ -82,8 +82,20 @@
1368 {
1369 last_mouse_down_x_ = x;
1370 last_mouse_down_y_ = y;
1371- uint index = GetIndexAtPosition(x, y);
1372- mouse_over_index_ = index;
1373+<<<<<<< TREE
1374+ uint index = GetIndexAtPosition(x, y);
1375+ mouse_over_index_ = index;
1376+=======
1377+ uint index = GetIndexAtPosition(x, y);
1378+ mouse_over_index_ = index;
1379+ if (index >= 0 && index < results_.size())
1380+ {
1381+ // we got a click on a button so activate it
1382+ Result result = results_[index];
1383+ selected_index_ = index;
1384+ focused_uri_ = result.uri;
1385+ }
1386+>>>>>>> MERGE-SOURCE
1387 });
1388
1389 mouse_leave.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state)
1390@@ -495,9 +507,26 @@
1391 {
1392 if (selected_index_ < 0)
1393 {
1394+<<<<<<< TREE
1395+=======
1396+ if (mouse_over_index_ >= 0 && mouse_over_index_ < static_cast<int>(results_.size()))
1397+ {
1398+ // to hack around nux, nux sends the keynavfocuschange event before
1399+ // mouse clicks, so when mouse click happens we have already scrolled away
1400+ // because the keynav focus changed
1401+ focused_uri_ = results_[mouse_over_index_].uri;
1402+ selected_index_ = mouse_over_index_;
1403+ }
1404+ else
1405+ {
1406+>>>>>>> MERGE-SOURCE
1407 focused_uri_ = results_.front().uri;
1408 selected_index_ = 0;
1409 }
1410+<<<<<<< TREE
1411+=======
1412+
1413+>>>>>>> MERGE-SOURCE
1414
1415 int items_per_row = GetItemsPerRow();
1416 int focused_x = (renderer_->width + horizontal_spacing) * (selected_index_ % items_per_row);
1417
1418=== modified file 'plugins/unityshell/src/ResultViewGrid.h'
1419=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp'
1420--- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-05 02:47:09 +0000
1421+++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-06 13:12:27 +0000
1422@@ -1,3 +1,4 @@
1423+<<<<<<< TREE
1424 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
1425 /* Compiz unity plugin
1426 * unity.h
1427@@ -232,3 +233,239 @@
1428 if (mFBTexture)
1429 glDeleteTextures (1, &mFBTexture);
1430 }
1431+=======
1432+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
1433+/* Compiz unity plugin
1434+ * unity.h
1435+ *
1436+ * Copyright (c) 2010-11 Canonical Ltd.
1437+ *
1438+ * This program is free software; you can redistribute it and/or
1439+ * modify it under the terms of the GNU General Public License
1440+ * as published by the Free Software Foundation; either version 3
1441+ * of the License, or (at your option) any later version.
1442+ *
1443+ * This program is distributed in the hope that it will be useful,
1444+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1445+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1446+ * GNU General Public License for more details.
1447+ *
1448+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
1449+ */
1450+
1451+#include "ScreenEffectFramebufferObject.h"
1452+#include "BackgroundEffectHelper.h"
1453+#include <NuxCore/Logger.h>
1454+#include <dlfcn.h>
1455+
1456+namespace
1457+{
1458+ nux::logging::Logger logger ("unity.screeneffectframebufferobject");
1459+}
1460+
1461+void ScreenEffectFramebufferObject::paint (const nux::Geometry &output)
1462+{
1463+ /* Draw the bit of the relevant framebuffer for each output */
1464+
1465+ glPushAttrib (GL_VIEWPORT_BIT);
1466+ glViewport (0, mScreenSize.height - (output.y + output.height), mScreenSize.width, mScreenSize.height);
1467+
1468+ if (mFBTexture)
1469+ {
1470+ glEnable (GL_TEXTURE_2D);
1471+ activeTexture (GL_TEXTURE0_ARB);
1472+ glBindTexture (GL_TEXTURE_2D, mFBTexture);
1473+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1474+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1475+
1476+ glPushAttrib (GL_SCISSOR_BIT);
1477+ glEnable (GL_SCISSOR_TEST);
1478+
1479+ glScissor (output.x, mScreenSize.height - (output.y + output.height),
1480+ output.width, output.height);
1481+
1482+ /* FIXME: This needs to be GL_TRIANGLE_STRIP */
1483+ glBegin (GL_QUADS);
1484+ glTexCoord2f (0, 1);
1485+ glVertex2i (mGeometry.x, mGeometry.y);
1486+ glTexCoord2f (0, 0);
1487+ glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height);
1488+ glTexCoord2f (1, 0);
1489+ glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height);
1490+ glTexCoord2f (1, 1);
1491+ glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y);
1492+ glEnd ();
1493+
1494+ activeTexture (GL_TEXTURE0_ARB);
1495+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1496+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1497+ glBindTexture (GL_TEXTURE_2D, 0);
1498+ glDisable (GL_TEXTURE_2D);
1499+ glPopAttrib ();
1500+ }
1501+ glPopAttrib ();
1502+}
1503+
1504+void ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize)
1505+{
1506+ mScreenSize = screenSize;
1507+}
1508+
1509+
1510+void ScreenEffectFramebufferObject::unbind ()
1511+{
1512+ if (!mBoundCnt)
1513+ return;
1514+
1515+ mBoundCnt--;
1516+
1517+ (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0);
1518+
1519+ glDrawBuffer (GL_BACK);
1520+ glReadBuffer (GL_BACK);
1521+
1522+ /* Matches the viewport set we did in ::bind () */
1523+ glPopAttrib ();
1524+
1525+}
1526+
1527+bool ScreenEffectFramebufferObject::status ()
1528+{
1529+ return mFboStatus;
1530+}
1531+
1532+void ScreenEffectFramebufferObject::bind (const nux::Geometry &output)
1533+{
1534+ if (!BackgroundEffectHelper::HasDirtyHelpers())
1535+ return;
1536+
1537+ /* Clear the error bit */
1538+ glGetError ();
1539+
1540+ if (!mFBTexture)
1541+ {
1542+ glGenTextures (1, &mFBTexture);
1543+
1544+ glBindTexture (GL_TEXTURE_2D, mFBTexture);
1545+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1546+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1547+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1548+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
1549+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA,
1550+#if IMAGE_BYTE_ORDER == MSBFirst
1551+ GL_UNSIGNED_INT_8_8_8_8_REV,
1552+#else
1553+ GL_UNSIGNED_BYTE,
1554+#endif
1555+ NULL);
1556+
1557+ glBindTexture (GL_TEXTURE_2D, 0);
1558+
1559+ if (glGetError () != GL_NO_ERROR)
1560+ {
1561+ mFboHandle = 0;
1562+ mFboStatus = false;
1563+ return;
1564+ }
1565+ }
1566+
1567+ (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle);
1568+
1569+ (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
1570+ GL_TEXTURE_2D, mFBTexture, 0);
1571+
1572+ (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
1573+ GL_TEXTURE_2D, 0, 0);
1574+
1575+ /* Ensure that a framebuffer is actually available */
1576+ if (!mFboStatus)
1577+ {
1578+ GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER);
1579+
1580+ if (status != GL_FRAMEBUFFER_COMPLETE)
1581+ {
1582+ switch (status)
1583+ {
1584+ case GL_FRAMEBUFFER_UNDEFINED:
1585+ LOG_WARN (logger) << "no window";
1586+ break;
1587+ case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
1588+ LOG_WARN (logger) << "attachment incomplete";
1589+ break;
1590+ case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
1591+ LOG_WARN (logger) << "no buffers attached to fbo";
1592+ break;
1593+ case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
1594+ LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO";
1595+ break;
1596+ case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
1597+ LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO";
1598+ break;
1599+ case GL_FRAMEBUFFER_UNSUPPORTED:
1600+ LOG_WARN (logger) << "unsupported internal format";
1601+ break;
1602+ case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
1603+ LOG_WARN (logger) << "different levels of sampling for each attachment";
1604+ break;
1605+ case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
1606+ LOG_WARN (logger) << "number of layers is different";
1607+ break;
1608+ default:
1609+ LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason";
1610+ break;
1611+ }
1612+
1613+ bindFramebuffer (GL_FRAMEBUFFER_EXT, 0);
1614+ deleteFramebuffers (1, &mFboHandle);
1615+
1616+ glDrawBuffer (GL_BACK);
1617+ glReadBuffer (GL_BACK);
1618+
1619+ mFboHandle = 0;
1620+
1621+ mFboStatus = false;
1622+ }
1623+ else
1624+ mFboStatus = true;
1625+ }
1626+
1627+ if (mFboStatus)
1628+ {
1629+ glPushAttrib (GL_VIEWPORT_BIT);
1630+
1631+ glViewport (output.x,
1632+ mScreenSize.height - (output.y + output.height),
1633+ output.width,
1634+ output.height);
1635+ }
1636+
1637+ mBoundCnt++;
1638+}
1639+
1640+
1641+ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom)
1642+ : getProcAddressGLX (p)
1643+ , mFboStatus (false)
1644+ , mFBTexture (0)
1645+ , mGeometry (geom)
1646+ , mBoundCnt (0)
1647+ , mScreenSize (geom)
1648+{
1649+ activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture");
1650+ genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT");
1651+ deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT");
1652+ bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT");
1653+ checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT");
1654+ framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT");
1655+
1656+ (*genFramebuffers) (1, &mFboHandle);
1657+}
1658+
1659+ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
1660+{
1661+ (*deleteFramebuffers) (1, &mFboHandle);
1662+
1663+ if (mFBTexture)
1664+ glDeleteTextures (1, &mFBTexture);
1665+}
1666+>>>>>>> MERGE-SOURCE
1667
1668=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.h'
1669--- plugins/unityshell/src/ScreenEffectFramebufferObject.h 2011-12-16 09:46:35 +0000
1670+++ plugins/unityshell/src/ScreenEffectFramebufferObject.h 2012-01-06 13:12:27 +0000
1671@@ -1,3 +1,4 @@
1672+<<<<<<< TREE
1673 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
1674 /* Compiz unity plugin
1675 * unity.h
1676@@ -85,3 +86,89 @@
1677 } // namespace unity
1678
1679 #endif
1680+=======
1681+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
1682+/* Compiz unity plugin
1683+ * unity.h
1684+ *
1685+ * Copyright (c) 2010-11 Canonical Ltd.
1686+ *
1687+ * This program is free software; you can redistribute it and/or
1688+ * modify it under the terms of the GNU General Public License
1689+ * as published by the Free Software Foundation; either version 3
1690+ * of the License, or (at your option) any later version.
1691+ *
1692+ * This program is distributed in the hope that it will be useful,
1693+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1694+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1695+ * GNU General Public License for more details.
1696+ *
1697+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
1698+ */
1699+
1700+#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
1701+#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
1702+
1703+#include <Nux/Nux.h>
1704+
1705+class ScreenEffectFramebufferObject
1706+{
1707+public:
1708+
1709+ typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
1710+ typedef void (*FuncPtr) (void);
1711+ typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
1712+
1713+ ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
1714+ ~ScreenEffectFramebufferObject ();
1715+
1716+public:
1717+
1718+ void bind (const nux::Geometry &geom);
1719+ void unbind ();
1720+
1721+ bool status ();
1722+ void paint (const nux::Geometry &geom);
1723+ bool bound () { return mBoundCnt > 0; }
1724+
1725+ GLuint texture () { return mFBTexture; }
1726+
1727+ void onScreenSizeChanged (const nux::Geometry &screenSize);
1728+
1729+private:
1730+
1731+ FuncPtr getProcAddr (const std::string &);
1732+
1733+ typedef void (*GLActiveTextureProc) (GLenum texture);
1734+ typedef void (*GLGenFramebuffersProc) (GLsizei n,
1735+ GLuint *framebuffers);
1736+ typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
1737+ GLuint *framebuffers);
1738+ typedef void (*GLBindFramebufferProc) (GLenum target,
1739+ GLuint framebuffer);
1740+ typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
1741+ typedef void (*GLFramebufferTexture2DProc) (GLenum target,
1742+ GLenum attachment,
1743+ GLenum textarget,
1744+ GLuint texture,
1745+ GLint level);
1746+
1747+ GLXGetProcAddressProc getProcAddressGLX;
1748+ GLActiveTextureProc activeTexture;
1749+ GLGenFramebuffersProc genFramebuffers;
1750+ GLDeleteFramebuffersProc deleteFramebuffers;
1751+ GLBindFramebufferProc bindFramebuffer;
1752+ GLCheckFramebufferStatusProc checkFramebufferStatus;
1753+ GLFramebufferTexture2DProc framebufferTexture2D;
1754+ /* compiz fbo handle that goes through to nux */
1755+ GLuint mFboHandle; // actual handle to the framebuffer_ext
1756+ bool mFboStatus; // did the framebuffer texture bind succeed
1757+ GLuint mFBTexture;
1758+ nux::Geometry mGeometry;
1759+ unsigned int mBoundCnt;
1760+
1761+ nux::Geometry mScreenSize;
1762+};
1763+
1764+#endif
1765+>>>>>>> MERGE-SOURCE
1766
1767=== modified file 'plugins/unityshell/src/SwitcherController.cpp'
1768=== modified file 'plugins/unityshell/src/SwitcherController.h'
1769=== modified file 'plugins/unityshell/src/SwitcherModel.cpp'
1770--- plugins/unityshell/src/SwitcherModel.cpp 2011-12-08 01:23:11 +0000
1771+++ plugins/unityshell/src/SwitcherModel.cpp 2012-01-06 13:12:27 +0000
1772@@ -173,10 +173,17 @@
1773 {
1774 if (!detail_selection || DetailXids ().empty())
1775 return 0;
1776+<<<<<<< TREE
1777
1778 if (detail_selection_index > DetailXids().size() - 1)
1779 return 0;
1780
1781+=======
1782+
1783+ if (detail_selection_index >= DetailXids().size())
1784+ return 0;
1785+
1786+>>>>>>> MERGE-SOURCE
1787 return DetailXids()[detail_selection_index];
1788 }
1789
1790
1791=== modified file 'plugins/unityshell/src/WindowManager.cpp'
1792=== modified file 'plugins/unityshell/src/comptransientfor.cpp'
1793--- plugins/unityshell/src/comptransientfor.cpp 2011-08-23 14:47:38 +0000
1794+++ plugins/unityshell/src/comptransientfor.cpp 2012-01-06 13:12:27 +0000
1795@@ -55,13 +55,18 @@
1796 bool
1797 compiz::CompTransientForReader::isTransientFor (unsigned int ancestor)
1798 {
1799+ if (!ancestor ||
1800+ !priv->mWindow->id ())
1801+ return false;
1802+
1803 return priv->mWindow->transientFor () == ancestor;
1804 }
1805
1806 bool
1807 compiz::CompTransientForReader::isGroupTransientFor (unsigned int clientLeader)
1808 {
1809- if (!clientLeader)
1810+ if (!clientLeader ||
1811+ !priv->mWindow->id ())
1812 return false;
1813
1814 if (priv->mWindow->transientFor () == None || priv->mWindow->transientFor () == screen->root ())
1815
1816=== modified file 'plugins/unityshell/src/transientfor.cpp'
1817--- plugins/unityshell/src/transientfor.cpp 2011-08-26 10:37:35 +0000
1818+++ plugins/unityshell/src/transientfor.cpp 2012-01-06 13:12:27 +0000
1819@@ -51,9 +51,9 @@
1820 {
1821 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
1822 {
1823- Window *data = (Window *) prop;
1824+ Window *data = (Window *) prop;
1825
1826- serverAncestor = *data;
1827+ serverAncestor = *data;
1828 }
1829
1830 XFree (prop);
1831@@ -65,6 +65,10 @@
1832 bool
1833 compiz::X11TransientForReader::isTransientFor (unsigned int ancestor)
1834 {
1835+ if (!ancestor ||
1836+ !priv->mXid)
1837+ return false;
1838+
1839 return ancestor == getAncestor ();
1840 }
1841
1842@@ -80,14 +84,18 @@
1843 std::vector<std::string> strings;
1844 std::list<Atom> atoms;
1845
1846+ if (!clientLeader ||
1847+ !priv->mXid)
1848+ return false;
1849+
1850 if (XGetWindowProperty (priv->mDpy, priv->mXid, wmClientLeader, 0L, 2L, false,
1851 XA_WINDOW, &actualType, &actualFormat, &nItems, &nLeft, (unsigned char **)&prop) == Success)
1852 {
1853 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
1854 {
1855- Window *data = (Window *) prop;
1856+ Window *data = (Window *) prop;
1857
1858- serverClientLeader = *data;
1859+ serverClientLeader = *data;
1860 }
1861
1862 XFree (prop);
1863
1864=== modified file 'plugins/unityshell/src/unityshell.cpp'
1865--- plugins/unityshell/src/unityshell.cpp 2012-01-06 04:53:09 +0000
1866+++ plugins/unityshell/src/unityshell.cpp 2012-01-06 13:12:27 +0000
1867@@ -569,6 +569,7 @@
1868 void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)
1869 {
1870 CompOutput *output = _last_output;
1871+<<<<<<< TREE
1872 Window tray_xid = panel_controller_->GetTrayXid ();
1873
1874 bool was_bound = _fbo->bound ();
1875@@ -577,6 +578,16 @@
1876 /* Draw the bit of the relevant framebuffer for each output */
1877
1878 if (was_bound)
1879+=======
1880+ Window tray_xid = panelController->GetTrayXid ();
1881+
1882+ bool was_bound = _fbo->bound ();
1883+ _fbo->unbind ();
1884+
1885+ /* Draw the bit of the relevant framebuffer for each output */
1886+
1887+ if (was_bound)
1888+>>>>>>> MERGE-SOURCE
1889 {
1890 GLMatrix sTransform;
1891 sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);
1892@@ -730,6 +741,7 @@
1893
1894 void UnityScreen::leaveShowDesktopMode (CompWindow *w)
1895 {
1896+<<<<<<< TREE
1897 /* Where a window is inhibiting, only allow the window
1898 * that is inhibiting the leave show desktop to actually
1899 * fade in again - all other windows should remain faded out */
1900@@ -761,6 +773,22 @@
1901 }
1902 }
1903 }
1904+=======
1905+ for (CompWindow *cw : screen->windows ())
1906+ {
1907+ if (cw->inShowDesktopMode ())
1908+ {
1909+ UnityWindow::get (cw)->leaveShowDesktop ();
1910+ // the animation plugin does strange things here ...
1911+ // if this notification is sent
1912+ //cw->windowNotify (CompWindowNotifyLeaveShowDesktopMode);
1913+ }
1914+ }
1915+
1916+ PluginAdapter::Default()->OnLeaveDesktop();
1917+
1918+ screen->leaveShowDesktopMode (w);
1919+>>>>>>> MERGE-SOURCE
1920 }
1921
1922 void UnityWindow::enterShowDesktop ()
1923@@ -1409,11 +1437,16 @@
1924 screen->outputDevs()[device].y1() + 100,
1925 screen->outputDevs()[device].width() - 200,
1926 screen->outputDevs()[device].height() - 200));
1927+<<<<<<< TREE
1928
1929 switcher::ShowMode show_mode = optionGetAltTabBiasViewport() ? switcher::ShowMode::CURRENT_VIEWPORT : switcher::ShowMode::ALL;
1930
1931 RaiseInputWindows();
1932 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
1933+=======
1934+ switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results);
1935+ RaiseInputWindows();
1936+>>>>>>> MERGE-SOURCE
1937 return true;
1938 }
1939
1940@@ -2198,15 +2231,27 @@
1941
1942 void UnityScreen::Relayout()
1943 {
1944- nux::Geometry geometry (0, 0, screen->width (), screen->height ());
1945+<<<<<<< TREE
1946+ nux::Geometry geometry (0, 0, screen->width (), screen->height ());
1947+=======
1948+ GdkRectangle rect;
1949+ nux::Geometry lCurGeom;
1950+ int panel_height = 24;
1951+ nux::Geometry geometry (0, 0, screen->width (), screen->height ());
1952+>>>>>>> MERGE-SOURCE
1953
1954 if (!needsRelayout)
1955 return;
1956
1957 if (GL::fbo)
1958 {
1959+<<<<<<< TREE
1960 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
1961 uScreen->_fbo->onScreenSizeChanged (geometry);
1962+=======
1963+ uScreen->_fbo.reset (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
1964+ uScreen->_fbo->onScreenSizeChanged (geometry);
1965+>>>>>>> MERGE-SOURCE
1966 }
1967
1968 UScreen *uscreen = UScreen::GetDefault();
1969@@ -2268,9 +2313,15 @@
1970 {
1971 if (w->resName() == "onboard")
1972 {
1973+<<<<<<< TREE
1974 Window xid = dash_controller_->window()->GetInputWindowId();
1975 XSetTransientForHint (screen->dpy(), w->id(), xid);
1976 w->raise ();
1977+=======
1978+ Window xid = dashController->window()->GetInputWindowId();
1979+ XSetTransientForHint (screen->dpy(), w->id(), xid);
1980+ w->raise ();
1981+>>>>>>> MERGE-SOURCE
1982 }
1983 }
1984 }
1985@@ -2303,6 +2354,7 @@
1986 LOG_INFO(logger) << "initLauncher-Panel " << timer.ElapsedSeconds() << "s";
1987
1988 /* Setup Places */
1989+<<<<<<< TREE
1990 dash_controller_.reset(new dash::Controller());
1991 dash_controller_->on_realize.connect(sigc::mem_fun(this, &UnityScreen::OnDashRealized));
1992
1993@@ -2315,6 +2367,29 @@
1994 ScheduleRelayout(0);
1995
1996 OnLauncherHiddenChanged();
1997+=======
1998+ self->dashController = DashController::Ptr(new DashController());
1999+ self->dashController->on_realize.connect (sigc::mem_fun (self, &UnityScreen::OnDashRealized));
2000+
2001+ /* FIXME: this should not be manual, should be managed with a
2002+ show/hide callback like in GAIL
2003+ if (unity_a11y_initialized() == TRUE)
2004+ {
2005+ AtkObject* atk_obj = NULL;
2006+
2007+ atk_obj = unity_util_accessible_add_window(self->placesController->GetWindow());
2008+
2009+ atk_object_set_name(atk_obj, _("Places"));
2010+ }
2011+ */
2012+
2013+ self->launcher->SetHideMode(Launcher::LAUNCHER_HIDE_DODGE_WINDOWS);
2014+ self->launcher->SetLaunchAnimation(Launcher::LAUNCH_ANIMATION_PULSE);
2015+ self->launcher->SetUrgentAnimation(Launcher::URGENT_ANIMATION_WIGGLE);
2016+ self->ScheduleRelayout(0);
2017+
2018+ self->OnLauncherHiddenChanged();
2019+>>>>>>> MERGE-SOURCE
2020 }
2021
2022 /* Window init */
2023@@ -2351,6 +2426,7 @@
2024
2025 if (window->state () & CompWindowStateFullscreenMask)
2026 UnityScreen::get (screen)->fullscreen_windows_.push_back(window);
2027+<<<<<<< TREE
2028
2029 /* We might be starting up so make sure that
2030 * we don't deref the dashcontroller that doesnt
2031@@ -2358,6 +2434,15 @@
2032 dash::Controller::Ptr dp = UnityScreen::get(screen)->dash_controller_;
2033
2034 if (dp)
2035+=======
2036+
2037+ /* We might be starting up so make sure that
2038+ * we don't deref the dashcontroller that doesnt
2039+ * exist */
2040+ DashController::Ptr dp = UnityScreen::get (screen)->dashController;
2041+
2042+ if (dp)
2043+>>>>>>> MERGE-SOURCE
2044 {
2045 nux::BaseWindow* w = dp->window ();
2046
2047@@ -2380,7 +2465,7 @@
2048
2049 UnityShowdesktopHandler::animating_windows.remove (window);
2050
2051- if (mMinimizeHandler)
2052+ if (mMinimizeHandler && !window->destroyed ())
2053 {
2054 unminimize ();
2055 window->focusSetEnabled (this, false);
2056@@ -2388,9 +2473,10 @@
2057 window->unminimizeSetEnabled (this, false);
2058 window->minimizedSetEnabled (this, false);
2059 window->minimize ();
2060-
2061- mMinimizeHandler.reset ();
2062 }
2063+
2064+ mMinimizeHandler.reset ();
2065+
2066 if (mShowdesktopHandler)
2067 delete mShowdesktopHandler;
2068
2069
2070=== modified file 'plugins/unityshell/src/unityshell.h'
2071--- plugins/unityshell/src/unityshell.h 2012-01-06 04:53:09 +0000
2072+++ plugins/unityshell/src/unityshell.h 2012-01-06 13:12:27 +0000
2073@@ -47,15 +47,26 @@
2074 #include "DebugDBusInterface.h"
2075 #include "SwitcherController.h"
2076 #include "UBusWrapper.h"
2077-#include "ScreenEffectFramebufferObject.h"
2078+<<<<<<< TREE
2079+#include "ScreenEffectFramebufferObject.h"
2080+=======
2081+#include <Nux/WindowThread.h>
2082+#include <sigc++/sigc++.h>
2083+#include <boost/shared_ptr.hpp>
2084+#include "ScreenEffectFramebufferObject.h"
2085+>>>>>>> MERGE-SOURCE
2086
2087 #include "compizminimizedwindowhandler.h"
2088+<<<<<<< TREE
2089 #include "BGHash.h"
2090 #include <compiztoolbox/compiztoolbox.h>
2091 #include <dlfcn.h>
2092
2093 namespace unity
2094 {
2095+=======
2096+#include <dlfcn.h>
2097+>>>>>>> MERGE-SOURCE
2098
2099 class UnityShowdesktopHandler
2100 {
2101
2102=== modified file 'services/panel-service.c'
2103=== modified file 'tests/CMakeLists.txt'
2104--- tests/CMakeLists.txt 2011-12-22 06:27:26 +0000
2105+++ tests/CMakeLists.txt 2012-01-06 13:12:27 +0000
2106@@ -71,6 +71,444 @@
2107 )
2108 add_dependencies (test-unit unity-core-${UNITY_API_VERSION})
2109
2110+<<<<<<< TREE
2111+=======
2112+#
2113+# Standalone tests
2114+#
2115+add_executable (standalone-dash
2116+ standalone_dash.cpp
2117+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2118+ ${UNITY_SRC}/BackgroundEffectHelper.h
2119+ ${UNITY_SRC}/BGHash.cpp
2120+ ${UNITY_SRC}/BGHash.h
2121+ ${UNITY_SRC}/DashSearchBar.cpp
2122+ ${UNITY_SRC}/DashSearchBar.h
2123+ ${UNITY_SRC}/DashSearchBarSpinner.cpp
2124+ ${UNITY_SRC}/DashSearchBarSpinner.h
2125+ ${UNITY_SRC}/FilterExpanderLabel.cpp
2126+ ${UNITY_SRC}/FilterFactory.cpp
2127+ ${UNITY_SRC}/FilterBasicButton.cpp
2128+ ${UNITY_SRC}/FilterRatingsButton.cpp
2129+ ${UNITY_SRC}/FilterRatingsWidget.cpp
2130+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
2131+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
2132+ ${UNITY_SRC}/FilterGenreButton.cpp
2133+ ${UNITY_SRC}/FilterGenreWidget.cpp
2134+ ${UNITY_SRC}/FilterBar.cpp
2135+ ${UNITY_SRC}/FontSettings.cpp
2136+ ${UNITY_SRC}/FontSettings.h
2137+ ${UNITY_SRC}/IMTextEntry.cpp
2138+ ${UNITY_SRC}/IMTextEntry.h
2139+ ${UNITY_SRC}/PlacesHomeView.cpp
2140+ ${UNITY_SRC}/PlacesHomeView.h
2141+ ${UNITY_SRC}/PlacesGroup.cpp
2142+ ${UNITY_SRC}/PlacesGroup.h
2143+ ${UNITY_SRC}/DashSettings.cpp
2144+ ${UNITY_SRC}/DashSettings.h
2145+ ${UNITY_SRC}/PlacesStyle.cpp
2146+ ${UNITY_SRC}/PlacesStyle.h
2147+ ${UNITY_SRC}/PlacesTile.cpp
2148+ ${UNITY_SRC}/PlacesTile.h
2149+ ${UNITY_SRC}/PlacesSimpleTile.cpp
2150+ ${UNITY_SRC}/PlacesSimpleTile.h
2151+ ${UNITY_SRC}/PlacesVScrollBar.cpp
2152+ ${UNITY_SRC}/PlacesVScrollBar.h
2153+ ${UNITY_SRC}/DashView.cpp
2154+ ${UNITY_SRC}/DashView.h
2155+ ${UNITY_SRC}/HomeView.cpp
2156+ ${UNITY_SRC}/HomeView.h
2157+ ${UNITY_SRC}/DashStyle.cpp
2158+ ${UNITY_SRC}/IconLoader.cpp
2159+ ${UNITY_SRC}/IconLoader.h
2160+ ${UNITY_SRC}/IconTexture.cpp
2161+ ${UNITY_SRC}/IconTexture.h
2162+ ${UNITY_SRC}/Introspectable.cpp
2163+ ${UNITY_SRC}/Introspectable.h
2164+ ${UNITY_SRC}/JSONParser.cpp
2165+ ${UNITY_SRC}/LensBar.cpp
2166+ ${UNITY_SRC}/LensBar.h
2167+ ${UNITY_SRC}/LensBarIcon.cpp
2168+ ${UNITY_SRC}/LensBarIcon.h
2169+ ${UNITY_SRC}/LensView.cpp
2170+ ${UNITY_SRC}/LensView.h
2171+ ${UNITY_SRC}/PreviewApplications.cpp
2172+ ${UNITY_SRC}/PreviewBase.cpp
2173+ ${UNITY_SRC}/PreviewBasicButton.cpp
2174+ ${UNITY_SRC}/ResultView.cpp
2175+ ${UNITY_SRC}/ResultViewGrid.cpp
2176+ ${UNITY_SRC}/ResultRenderer.cpp
2177+ ${UNITY_SRC}/ResultRendererTile.cpp
2178+ ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
2179+ ${UNITY_SRC}/TextureCache.h
2180+ ${UNITY_SRC}/TextureCache.cpp
2181+ ${UNITY_SRC}/Timer.cpp
2182+ ${UNITY_SRC}/Timer.h
2183+ ${UNITY_SRC}/StaticCairoText.cpp
2184+ ${UNITY_SRC}/StaticCairoText.h
2185+ ${UNITY_SRC}/UBusMessages.h
2186+ ${UNITY_SRC}/UBusWrapper.cpp
2187+ ${UNITY_SRC}/UBusWrapper.h
2188+ ${UNITY_SRC}/ubus-server.cpp
2189+ ${UNITY_SRC}/ubus-server.h
2190+ ${UNITY_SRC}/UScreen.cpp
2191+ ${UNITY_SRC}/UScreen.h
2192+ )
2193+add_dependencies (standalone-dash unity-core-${UNITY_API_VERSION})
2194+
2195+
2196+#
2197+# Please use "standalone-$foo" naming convention for standalone tests
2198+#
2199+add_executable (test-panel
2200+ TestPanel.cpp
2201+ ${UNITY_SRC}/Animator.cpp
2202+ ${UNITY_SRC}/Animator.h
2203+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2204+ ${UNITY_SRC}/BackgroundEffectHelper.h
2205+ ${UNITY_SRC}/DashSettings.cpp
2206+ ${UNITY_SRC}/DashSettings.h
2207+ ${UNITY_SRC}/PanelStyle.cpp
2208+ ${UNITY_SRC}/PanelStyle.h
2209+ ${UNITY_SRC}/PanelView.cpp
2210+ ${UNITY_SRC}/PanelView.h
2211+ ${UNITY_SRC}/PanelIndicatorsView.cpp
2212+ ${UNITY_SRC}/PanelIndicatorsView.h
2213+ ${UNITY_SRC}/PanelIndicatorEntryView.cpp
2214+ ${UNITY_SRC}/PanelIndicatorEntryView.h
2215+ ${UNITY_SRC}/PanelTitlebarGrabAreaView.h
2216+ ${UNITY_SRC}/PanelTitlebarGrabAreaView.cpp
2217+ ${UNITY_SRC}/PanelTray.cpp
2218+ ${UNITY_SRC}/PanelTray.h
2219+ ${UNITY_SRC}/Introspectable.cpp
2220+ ${UNITY_SRC}/Introspectable.h
2221+ ${UNITY_SRC}/PanelMenuView.cpp
2222+ ${UNITY_SRC}/PanelMenuView.h
2223+ ${UNITY_SRC}/Timer.cpp
2224+ ${UNITY_SRC}/Timer.h
2225+ ${UNITY_SRC}/StaticCairoText.cpp
2226+ ${UNITY_SRC}/StaticCairoText.h
2227+ ${UNITY_SRC}/WindowButtons.cpp
2228+ ${UNITY_SRC}/WindowButtons.h
2229+ ${UNITY_SRC}/WindowManager.cpp
2230+ ${UNITY_SRC}/WindowManager.h
2231+ ${UNITY_SRC}/UScreen.cpp
2232+ ${UNITY_SRC}/UScreen.h
2233+ ${UNITY_SRC}/ubus-server.cpp
2234+ ${UNITY_SRC}/ubus-server.h
2235+ )
2236+add_dependencies (test-panel unity-core-${UNITY_API_VERSION})
2237+
2238+add_executable (test-switcher
2239+ TestSwitcher.cpp
2240+ ${UNITY_SRC}/AbstractLauncherIcon.h
2241+ ${UNITY_SRC}/AbstractIconRenderer.h
2242+ ${UNITY_SRC}/SwitcherController.cpp
2243+ ${UNITY_SRC}/SwitcherController.h
2244+ ${UNITY_SRC}/SwitcherModel.cpp
2245+ ${UNITY_SRC}/SwitcherModel.h
2246+ ${UNITY_SRC}/SwitcherView.cpp
2247+ ${UNITY_SRC}/SwitcherView.h
2248+ ${UNITY_SRC}/LayoutSystem.h
2249+ ${UNITY_SRC}/LayoutSystem.cpp
2250+ ${UNITY_SRC}/WindowManager.h
2251+ ${UNITY_SRC}/WindowManager.cpp
2252+ ${UNITY_SRC}/IconRenderer.cpp
2253+ ${UNITY_SRC}/IconRenderer.h
2254+ ${UNITY_SRC}/MockLauncherIcon.h
2255+ ${UNITY_SRC}/BackgroundEffectHelper.h
2256+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2257+ ${UNITY_SRC}/StaticCairoText.cpp
2258+ ${UNITY_SRC}/StaticCairoText.h
2259+ ${UNITY_SRC}/UBusMessages.h
2260+ ${UNITY_SRC}/ubus-server.cpp
2261+ ${UNITY_SRC}/ubus-server.h
2262+ )
2263+add_dependencies (test-switcher unity-core-${UNITY_API_VERSION})
2264+
2265+add_executable (test-launcher
2266+ TestLauncher.cpp
2267+ ${UNITY_SRC}/AbstractLauncherIcon.h
2268+ ${UNITY_SRC}/AbstractIconRenderer.h
2269+ ${UNITY_SRC}/LauncherIcon.cpp
2270+ ${UNITY_SRC}/LauncherIcon.h
2271+ ${UNITY_SRC}/SimpleLauncherIcon.cpp
2272+ ${UNITY_SRC}/SimpleLauncherIcon.h
2273+ ${UNITY_SRC}/BamfLauncherIcon.cpp
2274+ ${UNITY_SRC}/BamfLauncherIcon.h
2275+ ${UNITY_SRC}/BFBLauncherIcon.cpp
2276+ ${UNITY_SRC}/BFBLauncherIcon.h
2277+ ${UNITY_SRC}/SpacerLauncherIcon.cpp
2278+ ${UNITY_SRC}/SpacerLauncherIcon.h
2279+ ${UNITY_SRC}/DndData.cpp
2280+ ${UNITY_SRC}/DndData.h
2281+ ${UNITY_SRC}/TrashLauncherIcon.cpp
2282+ ${UNITY_SRC}/TrashLauncherIcon.h
2283+ ${UNITY_SRC}/DNDCollectionWindow.cpp
2284+ ${UNITY_SRC}/DNDCollectionWindow.h
2285+ ${UNITY_SRC}/DeviceLauncherIcon.cpp
2286+ ${UNITY_SRC}/DeviceLauncherIcon.h
2287+ ${UNITY_SRC}/DeviceLauncherSection.cpp
2288+ ${UNITY_SRC}/DeviceLauncherSection.h
2289+ ${UNITY_SRC}/DevicesSettings.cpp
2290+ ${UNITY_SRC}/DevicesSettings.h
2291+ ${UNITY_SRC}/FavoriteStore.cpp
2292+ ${UNITY_SRC}/FavoriteStore.h
2293+ ${UNITY_SRC}/FavoriteStoreGSettings.cpp
2294+ ${UNITY_SRC}/FavoriteStoreGSettings.h
2295+ ${UNITY_SRC}/LauncherEntryRemoteModel.cpp
2296+ ${UNITY_SRC}/LauncherEntryRemoteModel.h
2297+ ${UNITY_SRC}/LauncherEntryRemote.cpp
2298+ ${UNITY_SRC}/LauncherEntryRemote.h
2299+ ${UNITY_SRC}/LauncherController.cpp
2300+ ${UNITY_SRC}/LauncherController.h
2301+ ${UNITY_SRC}/LauncherModel.cpp
2302+ ${UNITY_SRC}/LauncherModel.h
2303+ ${UNITY_SRC}/Launcher.cpp
2304+ ${UNITY_SRC}/Launcher.h
2305+ ${UNITY_SRC}/LauncherHideMachine.cpp
2306+ ${UNITY_SRC}/LauncherHideMachine.h
2307+ ${UNITY_SRC}/LauncherHoverMachine.cpp
2308+ ${UNITY_SRC}/LauncherHoverMachine.h
2309+ ${UNITY_SRC}/LauncherDragWindow.cpp
2310+ ${UNITY_SRC}/LauncherDragWindow.h
2311+ ${UNITY_SRC}/GeisAdapter.cpp
2312+ ${UNITY_SRC}/GeisAdapter.h
2313+ ${UNITY_SRC}/WindowManager.h
2314+ ${UNITY_SRC}/WindowManager.cpp
2315+ ${UNITY_SRC}/IconRenderer.cpp
2316+ ${UNITY_SRC}/IconRenderer.h
2317+ ${UNITY_SRC}/Tooltip.cpp
2318+ ${UNITY_SRC}/Tooltip.h
2319+ ${UNITY_SRC}/BackgroundEffectHelper.h
2320+ ${UNITY_SRC}/BackgroundEffectHelper.cpp
2321+ ${UNITY_SRC}/StaticCairoText.cpp
2322+ ${UNITY_SRC}/StaticCairoText.h
2323+ ${UNITY_SRC}/Introspectable.cpp
2324+ ${UNITY_SRC}/Introspectable.h
2325+ ${UNITY_SRC}/QuicklistMenuItem.cpp
2326+ ${UNITY_SRC}/QuicklistMenuItem.h
2327+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
2328+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
2329+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
2330+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
2331+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
2332+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
2333+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
2334+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
2335+ ${UNITY_SRC}/QuicklistView.cpp
2336+ ${UNITY_SRC}/QuicklistView.h
2337+ ${UNITY_SRC}/QuicklistManager.cpp
2338+ ${UNITY_SRC}/QuicklistManager.h
2339+ ${UNITY_SRC}/UBusMessages.h
2340+ ${UNITY_SRC}/UBusWrapper.cpp
2341+ ${UNITY_SRC}/UBusWrapper.h
2342+ ${UNITY_SRC}/ubus-server.cpp
2343+ ${UNITY_SRC}/ubus-server.h
2344+ )
2345+add_dependencies (test-launcher unity-core-${UNITY_API_VERSION})
2346+
2347+add_executable (test-keyutil
2348+ TestKeyboardUtil.cpp
2349+ ${UNITY_SRC}/KeyboardUtil.h
2350+ ${UNITY_SRC}/KeyboardUtil.cpp
2351+ )
2352+add_dependencies (test-keyutil unity-core-${UNITY_API_VERSION})
2353+
2354+add_executable (test-quicklist
2355+ ui/TestQuicklist.cpp
2356+ ui/EventFaker.cpp
2357+ ui/EventFaker.h
2358+ ${UNITY_SRC}/Introspectable.cpp
2359+ ${UNITY_SRC}/Introspectable.h
2360+ ${UNITY_SRC}/QuicklistMenuItem.cpp
2361+ ${UNITY_SRC}/QuicklistMenuItem.h
2362+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
2363+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
2364+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
2365+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
2366+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
2367+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
2368+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
2369+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
2370+ ${UNITY_SRC}/QuicklistView.cpp
2371+ ${UNITY_SRC}/QuicklistView.h
2372+ ${UNITY_SRC}/ubus-server.cpp
2373+ ${UNITY_SRC}/ubus-server.h
2374+ )
2375+add_dependencies (test-quicklist unity-core-${UNITY_API_VERSION})
2376+
2377+add_executable (test-quicklist-visuals
2378+ ui/TestQuicklistVisuals.cpp
2379+ ui/EventFaker.cpp
2380+ ui/EventFaker.h
2381+ ${UNITY_SRC}/Introspectable.cpp
2382+ ${UNITY_SRC}/Introspectable.h
2383+ ${UNITY_SRC}/QuicklistMenuItem.cpp
2384+ ${UNITY_SRC}/QuicklistMenuItem.h
2385+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
2386+ ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
2387+ ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
2388+ ${UNITY_SRC}/QuicklistMenuItemLabel.h
2389+ ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
2390+ ${UNITY_SRC}/QuicklistMenuItemRadio.h
2391+ ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
2392+ ${UNITY_SRC}/QuicklistMenuItemSeparator.h
2393+ ${UNITY_SRC}/QuicklistView.cpp
2394+ ${UNITY_SRC}/QuicklistView.h
2395+ ${UNITY_SRC}/ubus-server.cpp
2396+ ${UNITY_SRC}/ubus-server.h
2397+ )
2398+add_dependencies (test-quicklist-visuals unity-core-${UNITY_API_VERSION})
2399+
2400+add_executable (test-filters
2401+ TestFilters.cpp
2402+ ${UNITY_SRC}/FilterExpanderLabel.cpp
2403+ ${UNITY_SRC}/FilterBasicButton.cpp
2404+ ${UNITY_SRC}/FilterRatingsButton.cpp
2405+ ${UNITY_SRC}/FilterRatingsWidget.cpp
2406+ ${UNITY_SRC}/FilterGenreButton.cpp
2407+ ${UNITY_SRC}/FilterGenreWidget.cpp
2408+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
2409+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
2410+ ${UNITY_SRC}/DashStyle.cpp
2411+ ${UNITY_SRC}/JSONParser.cpp
2412+ ${UNITY_SRC}/PlacesStyle.cpp
2413+ ${UNITY_SRC}/PlacesStyle.h
2414+ )
2415+add_dependencies(test-filters unity-core-${UNITY_API_VERSION})
2416+
2417+add_executable (test-filter-bar
2418+ TestFilterBar.cpp
2419+ ${UNITY_SRC}/FilterExpanderLabel.cpp
2420+ ${UNITY_SRC}/FilterFactory.cpp
2421+ ${UNITY_SRC}/FilterBasicButton.cpp
2422+ ${UNITY_SRC}/FilterRatingsButton.cpp
2423+ ${UNITY_SRC}/FilterRatingsWidget.cpp
2424+ ${UNITY_SRC}/FilterMultiRangeWidget.cpp
2425+ ${UNITY_SRC}/FilterMultiRangeButton.cpp
2426+ ${UNITY_SRC}/FilterGenreButton.cpp
2427+ ${UNITY_SRC}/FilterGenreWidget.cpp
2428+ ${UNITY_SRC}/FilterBar.cpp
2429+ ${UNITY_SRC}/DashStyle.cpp
2430+ ${UNITY_SRC}/JSONParser.cpp
2431+ ${UNITY_SRC}/PlacesStyle.cpp
2432+ ${UNITY_SRC}/PlacesStyle.h
2433+ )
2434+add_dependencies(test-filter-bar unity-core-${UNITY_API_VERSION})
2435+
2436+add_executable (test-preview-applicaiton
2437+ TestPreviewApplications.cpp
2438+ ${UNITY_SRC}/PreviewApplications.cpp
2439+ ${UNITY_SRC}/PreviewBase.cpp
2440+ ${UNITY_SRC}/PreviewBasicButton.cpp
2441+ ${UNITY_SRC}/IconTexture.cpp
2442+ ${UNITY_SRC}/IconLoader.cpp
2443+ ${UNITY_SRC}/Introspectable.cpp
2444+ ${UNITY_SRC}/StaticCairoText.cpp
2445+ ${UNITY_SRC}/TextureCache.cpp
2446+ ${UNITY_SRC}/DashStyle.cpp
2447+ ${UNITY_SRC}/JSONParser.cpp
2448+ ${UNITY_SRC}/Timer.cpp
2449+ )
2450+add_dependencies(test-preview-applicaiton unity-core-${UNITY_API_VERSION})
2451+
2452+add_executable (test-preview-generic
2453+ TestPreviewGeneric.cpp
2454+ ${UNITY_SRC}/PreviewGeneric.cpp
2455+ ${UNITY_SRC}/PreviewBase.cpp
2456+ ${UNITY_SRC}/PreviewBasicButton.cpp
2457+ ${UNITY_SRC}/IconTexture.cpp
2458+ ${UNITY_SRC}/IconLoader.cpp
2459+ ${UNITY_SRC}/Introspectable.cpp
2460+ ${UNITY_SRC}/StaticCairoText.cpp
2461+ ${UNITY_SRC}/TextureCache.cpp
2462+ ${UNITY_SRC}/DashStyle.cpp
2463+ ${UNITY_SRC}/JSONParser.cpp
2464+ ${UNITY_SRC}/Timer.cpp
2465+ )
2466+add_dependencies(test-preview-generic unity-core-${UNITY_API_VERSION})
2467+
2468+add_executable (test-preview-music
2469+ TestPreviewMusic.cpp
2470+ ${UNITY_SRC}/PreviewBase.cpp
2471+ ${UNITY_SRC}/PreviewBasicButton.cpp
2472+ ${UNITY_SRC}/PreviewMusic.cpp
2473+ ${UNITY_SRC}/PreviewMusicTrack.cpp
2474+ ${UNITY_SRC}/PreviewMusicTrackWidget.cpp
2475+ ${UNITY_SRC}/IconTexture.cpp
2476+ ${UNITY_SRC}/IconLoader.cpp
2477+ ${UNITY_SRC}/Introspectable.cpp
2478+ ${UNITY_SRC}/StaticCairoText.cpp
2479+ ${UNITY_SRC}/TextureCache.cpp
2480+ ${UNITY_SRC}/DashStyle.cpp
2481+ ${UNITY_SRC}/JSONParser.cpp
2482+ ${UNITY_SRC}/Timer.cpp
2483+ )
2484+add_dependencies(test-preview-music unity-core-${UNITY_API_VERSION})
2485+
2486+add_executable (test-result-view
2487+ TestResultView.cpp
2488+ ${UNITY_SRC}/PlacesStyle.cpp
2489+ ${UNITY_SRC}/PlacesStyle.h
2490+ ${UNITY_SRC}/PreviewApplications.cpp
2491+ ${UNITY_SRC}/PreviewBase.cpp
2492+ ${UNITY_SRC}/PreviewBasicButton.cpp
2493+ ${UNITY_SRC}/ResultView.cpp
2494+ ${UNITY_SRC}/ResultViewGrid.cpp
2495+ ${UNITY_SRC}/ResultRenderer.cpp
2496+ ${UNITY_SRC}/ResultRendererTile.cpp
2497+ ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
2498+ ${UNITY_SRC}/IconTexture.cpp
2499+ ${UNITY_SRC}/IconLoader.cpp
2500+ ${UNITY_SRC}/Introspectable.cpp
2501+ ${UNITY_SRC}/StaticCairoText.cpp
2502+ ${UNITY_SRC}/TextureCache.cpp
2503+ ${UNITY_SRC}/Timer.cpp
2504+ ${UNITY_SRC}/DashStyle.cpp
2505+ ${UNITY_SRC}/JSONParser.cpp
2506+ ${UNITY_SRC}/UBusMessages.h
2507+ ${UNITY_SRC}/UBusWrapper.cpp
2508+ ${UNITY_SRC}/UBusWrapper.h
2509+ ${UNITY_SRC}/ubus-server.cpp
2510+ ${UNITY_SRC}/ubus-server.h
2511+ )
2512+add_dependencies(test-result-view unity-core-${UNITY_API_VERSION})
2513+
2514+add_executable (test-dash-style
2515+ TestDashStyle.cpp
2516+ ${UNITY_SRC}/DashStyle.cpp
2517+ ${UNITY_SRC}/DashStyle.h
2518+ ${UNITY_SRC}/JSONParser.cpp
2519+ ${PLACES_COMMON_SOURCE}
2520+ )
2521+add_dependencies (test-dash-style unity-core-${UNITY_API_VERSION})
2522+
2523+add_executable (test-bg-hash
2524+ TestBGHash.cpp
2525+ ${UNITY_SRC}/BGHash.cpp
2526+ ${UNITY_SRC}/BGHash.h
2527+ ${UNITY_SRC}/ubus-server.cpp
2528+ ${UNITY_SRC}/ubus-server.h
2529+ )
2530+add_dependencies (test-bg-hash unity-core-${UNITY_API_VERSION})
2531+
2532+find_package (OpenGL)
2533+
2534+include_directories (${OPENGL_gl_INCDIRS})
2535+add_library (glfuncloader SHARED
2536+ ${CMAKE_CURRENT_SOURCE_DIR}/GLFuncLoader.cpp)
2537+add_dependencies (glfuncloader unity-core-${UNITY_API_VERSION})
2538+target_link_libraries (glfuncloader dl ${OPENGL_gl_LIBRARY})
2539+add_executable (screen-effect-fbo
2540+ TestScreenEffectFramebufferObject.cpp
2541+ ${UNITY_SRC}/ScreenEffectFramebufferObject.cpp
2542+ ${UNITY_SRC}/BackgroundEffectHelper.cpp)
2543+
2544+target_link_libraries (screen-effect-fbo glfuncloader ${OPENGL_gl_LIBRARY})
2545+add_dependencies (screen-effect-fbo unity-core-${UNITY_API_VERSION})
2546+
2547+>>>>>>> MERGE-SOURCE
2548 add_subdirectory (test-input-remover)
2549 add_subdirectory (test-minimize-window-handler)
2550 add_subdirectory (test-get-transients)
2551
2552=== added file 'tests/GLFuncLoader.cpp'
2553--- tests/GLFuncLoader.cpp 1970-01-01 00:00:00 +0000
2554+++ tests/GLFuncLoader.cpp 2012-01-06 13:12:27 +0000
2555@@ -0,0 +1,51 @@
2556+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2557+/* Compiz unity plugin
2558+ * unity.h
2559+ *
2560+ * Copyright (c) 2010-11 Canonical Ltd.
2561+ *
2562+ * This program is free software; you can redistribute it and/or
2563+ * modify it under the terms of the GNU General Public License
2564+ * as published by the Free Software Foundation; either version 3
2565+ * of the License, or (at your option) any later version.
2566+ *
2567+ * This program is distributed in the hope that it will be useful,
2568+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2569+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2570+ * GNU General Public License for more details.
2571+ *
2572+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
2573+ */
2574+
2575+#include "GLFuncLoader.h"
2576+#include <dlfcn.h>
2577+
2578+unity::GLLoader::FuncPtr unity::GLLoader::getProcAddr(const std::string &name)
2579+{
2580+ static void *dlhand = NULL;
2581+ FuncPtr funcPtr = NULL;
2582+
2583+ glGetError ();
2584+
2585+ if (!funcPtr)
2586+ {
2587+ if (!dlhand)
2588+ dlhand = dlopen ("libglfuncloader.so", RTLD_LAZY);
2589+
2590+ char *error = dlerror ();
2591+
2592+ if (dlhand)
2593+ {
2594+ dlerror ();
2595+ funcPtr = (FuncPtr) dlsym (dlhand, name.c_str ());
2596+
2597+ error = dlerror ();
2598+ if (error != NULL)
2599+ funcPtr = NULL;
2600+ }
2601+ }
2602+
2603+ return funcPtr;
2604+}
2605+
2606+
2607
2608=== added file 'tests/GLFuncLoader.h'
2609--- tests/GLFuncLoader.h 1970-01-01 00:00:00 +0000
2610+++ tests/GLFuncLoader.h 2012-01-06 13:12:27 +0000
2611@@ -0,0 +1,33 @@
2612+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2613+/* Compiz unity plugin
2614+ * unity.h
2615+ *
2616+ * Copyright (c) 2010-11 Canonical Ltd.
2617+ *
2618+ * This program is free software; you can redistribute it and/or
2619+ * modify it under the terms of the GNU General Public License
2620+ * as published by the Free Software Foundation; either version 3
2621+ * of the License, or (at your option) any later version.
2622+ *
2623+ * This program is distributed in the hope that it will be useful,
2624+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2625+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2626+ * GNU General Public License for more details.
2627+ *
2628+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
2629+ */
2630+
2631+#include <string>
2632+#include <GL/gl.h>
2633+#include <GL/glx.h>
2634+
2635+namespace unity
2636+{
2637+namespace GLLoader
2638+{
2639+typedef void (*FuncPtr) (void);
2640+typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
2641+
2642+FuncPtr getProcAddr(const std::string &name);
2643+}
2644+}
2645
2646=== added file 'tests/TestScreenEffectFramebufferObject.cpp'
2647--- tests/TestScreenEffectFramebufferObject.cpp 1970-01-01 00:00:00 +0000
2648+++ tests/TestScreenEffectFramebufferObject.cpp 2012-01-06 13:12:27 +0000
2649@@ -0,0 +1,671 @@
2650+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2651+/* Compiz unity plugin
2652+ * unity.h
2653+ *
2654+ * Copyright (c) 2010-11 Canonical Ltd.
2655+ *
2656+ * This program is free software; you can redistribute it and/or
2657+ * modify it under the terms of the GNU General Public License
2658+ * as published by the Free Software Foundation; either version 3
2659+ * of the License, or (at your option) any later version.
2660+ *
2661+ * This program is distributed in the hope that it will be useful,
2662+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2663+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2664+ * GNU General Public License for more details.
2665+ *
2666+ * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
2667+ */
2668+
2669+#include "ScreenEffectFramebufferObject.h"
2670+#include "BackgroundEffectHelper.h"
2671+#include "GLFuncLoader.h"
2672+#include <Nux/Nux.h>
2673+#include <Nux/VLayout.h>
2674+#include <Nux/View.h>
2675+#include <Nux/BaseWindow.h>
2676+#include <Nux/WindowCompositor.h>
2677+#include <NuxCore/Logger.h>
2678+#include <NuxCore/Object.h>
2679+#include <X11/Xlib.h>
2680+#include <X11/Xutil.h>
2681+#include <GL/glx.h>
2682+#include <GL/gl.h>
2683+#include <dlfcn.h>
2684+#include <sys/poll.h>
2685+#include <unistd.h>
2686+#include <glib.h>
2687+#include <gtk/gtk.h>
2688+#include <cmath>
2689+
2690+using namespace unity::GLLoader;
2691+
2692+namespace
2693+{
2694+ nux::logging::Logger logger ("unity.test-screeneffectframebufferobject");
2695+
2696+ const static int attributes[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT,
2697+ GLX_X_RENDERABLE, True,
2698+ GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
2699+ GLX_DOUBLEBUFFER, True,
2700+ GLX_RED_SIZE, 8,
2701+ GLX_GREEN_SIZE, 8,
2702+ GLX_BLUE_SIZE, 8, 0};
2703+}
2704+
2705+namespace GLFuncs
2706+{
2707+ GLXGetProcAddressProc glXGetProcAddressP;
2708+ PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfigP;
2709+ PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfigP;
2710+ PFNGLXCREATEWINDOWPROC glXCreateWindowP;
2711+ PFNGLXDESTROYWINDOWPROC glXDestroyWindowP;
2712+ PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrentP;
2713+
2714+ void init ()
2715+ {
2716+ glXGetProcAddressP = (GLXGetProcAddressProc) getProcAddr ("glXGetProcAddress");
2717+ glXChooseFBConfigP = (PFNGLXCHOOSEFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXChooseFBConfig");
2718+ glXGetVisualFromFBConfigP = (PFNGLXGETVISUALFROMFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXGetVisualFromFBConfig");
2719+ glXCreateWindowP = (PFNGLXCREATEWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXCreateWindow");
2720+ glXMakeContextCurrentP = (PFNGLXMAKECONTEXTCURRENTPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXMakeContextCurrent");
2721+ glXDestroyWindowP = (PFNGLXDESTROYWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXDestroyWindow");
2722+ }
2723+}
2724+
2725+class EffectView :
2726+ public nux::View
2727+{
2728+public:
2729+ EffectView (NUX_FILE_LINE_PROTO);
2730+ virtual ~EffectView ();
2731+
2732+ void Draw (nux::GraphicsEngine &context, bool force) { return; };
2733+ void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
2734+private:
2735+ BackgroundEffectHelper bg_effect_helper_;
2736+};
2737+
2738+class Shape
2739+{
2740+ public:
2741+
2742+ typedef boost::shared_ptr <Shape> Ptr;
2743+
2744+ Shape ();
2745+ virtual ~Shape ();
2746+
2747+ float rotation () { return mRotation; }
2748+
2749+ void draw (unsigned int width, unsigned int height) { glDraw (width, height); }
2750+ void rotate () { applyRotation (); }
2751+
2752+ protected:
2753+
2754+ float mRotation;
2755+
2756+ virtual void glDraw (unsigned int width, unsigned int height) = 0;
2757+ virtual void applyRotation () = 0;
2758+ virtual void getRotationAxes (float &x, float &y, float &z) = 0;
2759+};
2760+
2761+Shape::Shape () :
2762+ mRotation (0.0f)
2763+{
2764+}
2765+
2766+Shape::~Shape ()
2767+{
2768+}
2769+
2770+class Triangle :
2771+ public Shape
2772+{
2773+ public:
2774+
2775+ typedef boost::shared_ptr <Triangle> Ptr;
2776+
2777+ protected:
2778+
2779+ void glDraw (unsigned int width, unsigned int height);
2780+ void applyRotation () { mRotation += 5.0f; }
2781+ void getRotationAxes (float &x, float &y, float &z) { x = 0.0f; y = 1.0f; z = 0.0f; }
2782+};
2783+
2784+void
2785+Triangle::glDraw (unsigned int width, unsigned int height)
2786+{
2787+ glBegin(GL_TRIANGLES);
2788+ glColor3f(1.0f, 0.0f, 0.0f);
2789+ glVertex3f(width / 4, height, 0.0f);
2790+ glColor3f(0.0f, 1.0f, 0.0f);
2791+ glVertex3f(0.0f, 0.0f, 0.0f);
2792+ glColor3f(0.0f, 0.0f, 1.0f);
2793+ glVertex3f(width / 2, 0.0f, 0.0f);
2794+ glEnd();
2795+}
2796+
2797+class Square :
2798+ public Shape
2799+{
2800+ public:
2801+
2802+ typedef boost::shared_ptr <Square> Ptr;
2803+
2804+ protected:
2805+
2806+ void glDraw (unsigned int width, unsigned int height);
2807+ void applyRotation () { mRotation -= 2.5f; }
2808+ void getRotationAxes (float &x, float &y, float &z) { x = 1.0f; y = 0.0f; z = 0.0f; }
2809+
2810+};
2811+
2812+void
2813+Square::glDraw (unsigned int width, unsigned int height)
2814+{
2815+ glBegin(GL_QUADS);
2816+ glColor3f(sin (rotation () / 100.0f), -sin (rotation () / 100.0f), cos (rotation () / 100.0f));
2817+ glVertex3f(width / 2, height, 0.0f);
2818+ glColor3f(-sin (rotation () / 100.0f), sin (rotation () / 100.0f), cos (rotation () / 100.0f));
2819+ glVertex3f(width, height, 0.0f);
2820+ glColor3f(sin (rotation () / 100.0f), sin (rotation () / 100.0f), sin (rotation () / 100.0f));
2821+ glVertex3f(width, 0.0f, 0.0f);
2822+ glColor3f(-sin (rotation () / 100.0f), cos (rotation () / 100.0f), cos (rotation () / 100.0f));
2823+ glVertex3f(width / 2, 0.0f, 0.0f);
2824+ glEnd();
2825+}
2826+
2827+class BaseContext
2828+{
2829+ public:
2830+
2831+ BaseContext (Display *);
2832+ ~BaseContext ();
2833+
2834+ void run ();
2835+
2836+ protected:
2837+
2838+ bool eventHandler ();
2839+ bool paintDispatch ();
2840+
2841+ enum class ModifierApplication
2842+ {
2843+ Square,
2844+ Triangle,
2845+ Both
2846+ };
2847+
2848+ void nextWindowPosition ();
2849+ void nextShapeRotation ();
2850+ void setupContextForSize (unsigned int width,
2851+ unsigned int height);
2852+ void drawShape (const Shape::Ptr &) {};
2853+
2854+ private:
2855+
2856+ static gboolean onNewEvents (GIOChannel *channel,
2857+ GIOCondition condition,
2858+ gpointer data);
2859+
2860+ static gboolean onPaintTimeout (gpointer data);
2861+
2862+ static void onWindowThreadCreation (nux::NThread *thread, void *d);
2863+
2864+ Display *mDisplay;
2865+ Window mWindow;
2866+ Colormap mColormap;
2867+ nux::WindowThread *mWindowThread;
2868+ nux::View *mRootView;
2869+ ScreenEffectFramebufferObject::Ptr mFbo;
2870+ GLXWindow mGlxWindow;
2871+ GLXContext mContext;
2872+ ModifierApplication mRotating;
2873+ ModifierApplication mBlur;
2874+ unsigned int mWidth;
2875+ unsigned int mHeight;
2876+ bool mNuxReady;
2877+ Shape::Ptr mTriangle;
2878+ Shape::Ptr mSquare;
2879+};
2880+
2881+BaseContext::BaseContext (Display *display) :
2882+ mDisplay (display),
2883+ mWindowThread (NULL),
2884+ mRotating (ModifierApplication::Both),
2885+ mBlur (ModifierApplication::Both),
2886+ mWidth (640),
2887+ mHeight (480),
2888+ mNuxReady (false),
2889+ mTriangle (new Triangle ()),
2890+ mSquare (new Square ())
2891+{
2892+ int numFBConfig = 0;
2893+ GLXFBConfig *fbConfigs = (*GLFuncs::glXChooseFBConfigP) (mDisplay,
2894+ DefaultScreen (mDisplay),
2895+ attributes,
2896+ &numFBConfig);
2897+ XVisualInfo *visinfo = (*GLFuncs::glXGetVisualFromFBConfigP) (mDisplay,
2898+ fbConfigs[0]);
2899+
2900+ mContext = glXCreateContext (mDisplay, visinfo, 0, GL_TRUE);
2901+ mColormap = XCreateColormap (mDisplay,
2902+ DefaultRootWindow (mDisplay),
2903+ visinfo->visual,
2904+ AllocNone);
2905+
2906+ XSetWindowAttributes wa;
2907+
2908+ wa.colormap = mColormap;
2909+ wa.border_pixel = 0;
2910+ wa.event_mask = StructureNotifyMask | KeyPressMask | ExposureMask;
2911+
2912+ mWindow = XCreateWindow (mDisplay, DefaultRootWindow (mDisplay),
2913+ 0, 0, mWidth, mHeight, 0, visinfo->depth, InputOutput,
2914+ visinfo->visual, CWColormap | CWEventMask | CWBorderPixel,
2915+ &wa);
2916+
2917+ mGlxWindow = (*GLFuncs::glXCreateWindowP) (mDisplay, fbConfigs[0], mWindow, NULL);
2918+
2919+ XStoreName (mDisplay, mWindow, "F1: Toggle Effect, F2: Rotation, F3: Effect");
2920+ XMapWindow (mDisplay, mWindow);
2921+
2922+ bool ready = false;
2923+
2924+ do
2925+ {
2926+ XEvent ev;
2927+ XNextEvent (mDisplay, &ev);
2928+ switch (ev.type)
2929+ {
2930+ case MapNotify:
2931+ case ConfigureNotify:
2932+ case Expose:
2933+ ready = true;
2934+ break;
2935+ default:
2936+ break;
2937+ }
2938+
2939+ } while (!ready);
2940+
2941+ (*GLFuncs::glXMakeContextCurrentP) (mDisplay, mGlxWindow, mGlxWindow, mContext);
2942+
2943+ setupContextForSize (mWidth, mHeight);
2944+}
2945+
2946+void
2947+BaseContext::run ()
2948+{
2949+ GIOChannel *channel;
2950+ mWindowThread = nux::CreateFromForeignWindow (mWindow,
2951+ mContext,
2952+ &BaseContext::onWindowThreadCreation,
2953+ (void *) this);
2954+
2955+ mWindowThread->Run(NULL);
2956+
2957+ while (!mNuxReady);
2958+ g_timeout_add (128, &BaseContext::onPaintTimeout, (gpointer) this);
2959+
2960+ channel = g_io_channel_unix_new (ConnectionNumber (mDisplay));
2961+
2962+ g_io_add_watch (channel, (GIOCondition) (G_IO_IN | G_IO_HUP | G_IO_ERR),
2963+ &BaseContext::onNewEvents, (gpointer) this);
2964+ gtk_main ();
2965+}
2966+
2967+BaseContext::~BaseContext ()
2968+{
2969+ delete mWindowThread;
2970+
2971+ (*GLFuncs::glXMakeContextCurrentP) (mDisplay, None, None, mContext);
2972+ glXDestroyContext (mDisplay, mContext);
2973+ (*GLFuncs::glXDestroyWindowP) (mDisplay, mGlxWindow);
2974+
2975+ XFreeColormap (mDisplay, mColormap);
2976+ XDestroyWindow (mDisplay, mWindow);
2977+}
2978+
2979+void
2980+BaseContext::setupContextForSize (unsigned int width,
2981+ unsigned int height)
2982+{
2983+ mWidth = width;
2984+ mHeight = height;
2985+
2986+ glViewport(0, 0, width, height);
2987+ glDrawBuffer (GL_BACK);
2988+ glReadBuffer (GL_BACK);
2989+ glMatrixMode(GL_PROJECTION);
2990+ glLoadIdentity();
2991+ gluPerspective(60.0f, 1.0f, 0.1f, 100.0f);
2992+ glMatrixMode(GL_MODELVIEW);
2993+ glLoadIdentity ();
2994+ glClearColor (1, 1, 1, 1);
2995+ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
2996+ glXSwapBuffers (mDisplay, mGlxWindow);
2997+
2998+ if (mFbo)
2999+ mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
3000+
3001+ if (mRootView && mNuxReady)
3002+ {
3003+ switch (mBlur)
3004+ {
3005+ case ModifierApplication::Both:
3006+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
3007+ break;
3008+ case ModifierApplication::Triangle:
3009+ mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3010+ break;
3011+ case ModifierApplication::Square:
3012+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
3013+ break;
3014+ default:
3015+ break;
3016+ }
3017+ }
3018+}
3019+
3020+bool
3021+BaseContext::eventHandler ()
3022+{
3023+ XEvent event;
3024+ XEvent *ev = &event;
3025+
3026+ XNextEvent (mDisplay, &event);
3027+
3028+ switch (ev->type)
3029+ {
3030+ case KeyPress:
3031+ if (XLookupKeysym (&ev->xkey, 0) == XK_Escape)
3032+ return false;
3033+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F1)
3034+ {
3035+ if (!mFbo)
3036+ {
3037+ BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
3038+ mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
3039+ }
3040+ else
3041+ {
3042+ BackgroundEffectHelper::blur_type = unity::BLUR_NONE;
3043+ mFbo.reset ();
3044+ }
3045+ }
3046+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F2)
3047+ nextShapeRotation ();
3048+ else if (XLookupKeysym (&ev->xkey, 0) == XK_F3)
3049+ nextWindowPosition ();
3050+ break;
3051+ case ConfigureNotify:
3052+ setupContextForSize (ev->xconfigure.width, ev->xconfigure.height);
3053+ default:
3054+ break;
3055+ }
3056+
3057+ return true;
3058+}
3059+
3060+gboolean
3061+BaseContext::onNewEvents (GIOChannel *channel,
3062+ GIOCondition condition,
3063+ gpointer data)
3064+{
3065+ BaseContext *self = static_cast <BaseContext *> (data);
3066+
3067+ if (condition & G_IO_IN)
3068+ {
3069+ if (self->eventHandler ())
3070+ return TRUE;
3071+ else
3072+ return FALSE;
3073+ }
3074+
3075+ return TRUE;
3076+}
3077+
3078+gboolean
3079+BaseContext::onPaintTimeout (gpointer data)
3080+{
3081+ BaseContext *self = static_cast <BaseContext *> (data);
3082+
3083+ if (self->paintDispatch ())
3084+ return TRUE;
3085+
3086+ return FALSE;
3087+}
3088+
3089+void
3090+BaseContext::nextShapeRotation ()
3091+{
3092+ switch (mRotating)
3093+ {
3094+ case ModifierApplication::Both:
3095+ mRotating = ModifierApplication::Triangle;
3096+ break;
3097+ case ModifierApplication::Triangle:
3098+ mRotating = ModifierApplication::Square;
3099+ break;
3100+ case ModifierApplication::Square:
3101+ mRotating = ModifierApplication::Both;
3102+ break;
3103+ default:
3104+ break;
3105+ }
3106+}
3107+
3108+void
3109+BaseContext::nextWindowPosition ()
3110+{
3111+ switch (mBlur)
3112+ {
3113+ case ModifierApplication::Both:
3114+ mBlur = ModifierApplication::Triangle;
3115+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
3116+ break;
3117+ case ModifierApplication::Triangle:
3118+ mBlur = ModifierApplication::Square;
3119+ mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3120+ break;
3121+ case ModifierApplication::Square:
3122+ mBlur = ModifierApplication::Both;
3123+ mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
3124+ break;
3125+ default:
3126+ break;
3127+ }
3128+}
3129+
3130+EffectView::EffectView (NUX_FILE_LINE_DECL)
3131+ : View (NUX_FILE_LINE_PARAM)
3132+{
3133+ bg_effect_helper_.owner = this;
3134+}
3135+
3136+EffectView::~EffectView ()
3137+{
3138+}
3139+
3140+void EffectView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
3141+{
3142+ nux::Geometry base = GetGeometry();
3143+ GfxContext.PushClippingRectangle(base);
3144+ nux::Geometry blur_geo (base.x, base.y, base.width, base.height);
3145+
3146+ if (BackgroundEffectHelper::blur_type == unity::BLUR_ACTIVE)
3147+ {
3148+ bg_effect_helper_.enabled = true;
3149+
3150+ auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo);
3151+
3152+ if (blur_texture.IsValid ())
3153+ {
3154+ nux::TexCoordXForm texxform_blur_bg;
3155+ texxform_blur_bg.flip_v_coord = true;
3156+ texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
3157+ texxform_blur_bg.uoffset = ((float) base.x) / (base.width);
3158+ texxform_blur_bg.voffset = ((float) base.y) / (base.height);
3159+
3160+ nux::ROPConfig rop;
3161+ rop.Blend = false;
3162+ rop.SrcBlend = GL_ONE;
3163+ rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
3164+
3165+ gPainter.PushDrawTextureLayer(GfxContext, base,
3166+ blur_texture,
3167+ texxform_blur_bg,
3168+ nux::color::White,
3169+ true,
3170+ rop);
3171+ }
3172+ }
3173+ else
3174+ bg_effect_helper_.enabled = false;
3175+ GfxContext.PopClippingRectangle();
3176+}
3177+
3178+bool
3179+BaseContext::paintDispatch ()
3180+{
3181+ if (mFbo)
3182+ {
3183+ switch (mRotating)
3184+ {
3185+ case ModifierApplication::Both:
3186+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth, mHeight));
3187+ break;
3188+ case ModifierApplication::Triangle:
3189+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth / 2, mHeight));
3190+ break;
3191+ case ModifierApplication::Square:
3192+ BackgroundEffectHelper::ProcessDamage (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
3193+ break;
3194+ }
3195+
3196+ mFbo->bind (nux::Geometry (0, 0, mWidth, mHeight));
3197+
3198+ if (!mFbo->status ())
3199+ {
3200+ LOG_INFO (logger) << "FBO not ok!";
3201+ }
3202+ }
3203+
3204+ glClearColor (1, 1, 1, 1);
3205+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3206+ glPushMatrix ();
3207+ glLoadIdentity();
3208+ glTranslatef(-0.5f, -0.5f, -0.866025404f);
3209+ glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
3210+ glTranslatef(mWidth * 0.25, 0, 0);
3211+ glRotatef(mTriangle->rotation (), 0.0f, 1.0f, 0.0f);
3212+ glTranslatef(-(mWidth * 0.25), 0, 0);
3213+
3214+ mTriangle->draw (mWidth, mHeight);
3215+
3216+ glLoadIdentity();
3217+ glTranslatef(-0.5f, -0.5f, -0.866025404f);
3218+ glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
3219+ glTranslatef(mWidth * 0.75, 0, 0);
3220+ glRotatef(mSquare->rotation (), 0.0f, 1.0f, 0.0f);
3221+ glTranslatef(-(mWidth * 0.75), 0, 0);
3222+
3223+ mSquare->draw (mWidth, mHeight);
3224+
3225+ glColor4f (1.0f, 1.0f, 1.0f, 5.0f);
3226+ glPopMatrix ();
3227+
3228+ if (mFbo)
3229+ mFbo->unbind ();
3230+
3231+ if (mFbo && mFbo->status ())
3232+ {
3233+ glClearColor (1, 1, 1, 1);
3234+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3235+ glPushMatrix ();
3236+ glLoadIdentity();
3237+ glTranslatef(-0.5f, 0.5f, -0.866025404f);
3238+ glScalef (1.0f / mWidth, -(1.0f / mHeight), 0.0f);
3239+ mFbo->paint (nux::Geometry (0, 0, mWidth, mHeight));
3240+ glPopMatrix ();
3241+
3242+ nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
3243+ nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID (mFbo->texture(),
3244+ mWidth, mHeight, 1, nux::BITFMT_R8G8B8A8);
3245+
3246+ nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
3247+
3248+ nux::Geometry geo = nux::Geometry (0, 0, mWidth, mHeight);
3249+ BackgroundEffectHelper::monitor_rect_ = geo;
3250+ }
3251+
3252+ glMatrixMode(GL_PROJECTION);
3253+ glPushMatrix();
3254+
3255+ glMatrixMode(GL_MODELVIEW);
3256+ glPushMatrix();
3257+ glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT |
3258+ GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT | GL_SCISSOR_BIT);
3259+ mRootView->ProcessDraw (mWindowThread->GetGraphicsEngine (), true);
3260+ glMatrixMode(GL_PROJECTION);
3261+ glPopMatrix();
3262+ glMatrixMode(GL_MODELVIEW);
3263+ glPopMatrix();
3264+
3265+ glDrawBuffer(GL_BACK);
3266+ glReadBuffer(GL_BACK);
3267+
3268+ glPopAttrib();
3269+
3270+ glXSwapBuffers (mDisplay, mGlxWindow);
3271+
3272+ switch (mRotating)
3273+ {
3274+ case ModifierApplication::Both:
3275+ mTriangle->rotate ();
3276+ mSquare->rotate ();
3277+ break;
3278+ case ModifierApplication::Triangle:
3279+ mTriangle->rotate ();
3280+ break;
3281+ case ModifierApplication::Square:
3282+ mSquare->rotate ();
3283+ break;
3284+ }
3285+
3286+ return true;
3287+}
3288+
3289+void
3290+BaseContext::onWindowThreadCreation (nux::NThread *thread, void *data)
3291+{
3292+ BaseContext *bc = static_cast <BaseContext *> (data);
3293+
3294+ bc->mRootView = new EffectView ();
3295+ bc->mRootView->SetGeometry (nux::Geometry (0, 0, 640, 480));
3296+ bc->mNuxReady = true;
3297+ BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
3298+}
3299+
3300+int main (int argc, char **argv)
3301+{
3302+ Display *display = XOpenDisplay (NULL);
3303+ nux::NuxInitialize (0);
3304+ GLFuncs::init ();
3305+ g_type_init ();
3306+ g_thread_init (NULL);
3307+ gtk_init(&argc, &argv);
3308+
3309+ BaseContext *bc = new BaseContext (display);
3310+
3311+ bc->run ();
3312+
3313+ delete bc;
3314+
3315+ XCloseDisplay (display);
3316+
3317+ return 0;
3318+}
3319+
3320+
3321
3322=== modified file 'tests/test-get-transients/CMakeLists.txt'
3323--- tests/test-get-transients/CMakeLists.txt 2011-10-26 16:17:24 +0000
3324+++ tests/test-get-transients/CMakeLists.txt 2012-01-06 13:12:27 +0000
3325@@ -20,5 +20,6 @@
3326 add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION})
3327 target_link_libraries (test-get-transients
3328 ${COMPIZ_TEST_GET_TRANSIENTS_LIBRARIES})
3329+ add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION})
3330
3331 endif (COMPIZ_TEST_GET_TRANSIENTS_FOUND)
3332
3333=== modified file 'tests/test-input-remover/CMakeLists.txt'
3334--- tests/test-input-remover/CMakeLists.txt 2011-10-26 16:17:24 +0000
3335+++ tests/test-input-remover/CMakeLists.txt 2012-01-06 13:12:27 +0000
3336@@ -16,5 +16,6 @@
3337 add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION})
3338 target_link_libraries (test-input-remover
3339 ${COMPIZ_TEST_INPUT_REMOVER_LIBRARIES})
3340+ add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION})
3341
3342 endif (COMPIZ_TEST_INPUT_REMOVER_FOUND)
3343
3344=== modified file 'tests/test-minimize-window-handler/CMakeLists.txt'
3345--- tests/test-minimize-window-handler/CMakeLists.txt 2011-10-26 16:17:24 +0000
3346+++ tests/test-minimize-window-handler/CMakeLists.txt 2012-01-06 13:12:27 +0000
3347@@ -21,5 +21,6 @@
3348 add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION})
3349 target_link_libraries (test-minimize-handler
3350 ${COMPIZ_TEST_MINIMIZED_HANDER_LIBRARIES})
3351+ add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION})
3352
3353 endif (COMPIZ_TEST_MINIMIZED_HANDER_FOUND)
3354
3355=== modified file 'tests/test_lens.cpp'