Merge lp:~agateau/unity-2d/maverick-libunity2d into lp:unity-2d/0.4
- maverick-libunity2d
- Merge into maverick
Status: | Merged |
---|---|
Merged at revision: | 381 |
Proposed branch: | lp:~agateau/unity-2d/maverick-libunity2d |
Merge into: | lp:unity-2d/0.4 |
Diff against target: |
2195 lines (+517/-1090) 53 files modified
.bzrignore (+13/-3) CMakeLists.txt (+6/-0) debian/control (+35/-22) debian/libunity-2d-dev.install (+2/-0) debian/libunity-2d0.install (+3/-0) debian/libunity-2d0.postinst (+7/-0) debian/libunity-2d0.postrm (+7/-0) debian/libuqpanel-dev.install (+0/-4) debian/libuqpanel0.install (+0/-2) debian/libuqpanel0.postinst (+0/-7) debian/libuqpanel0.postrm (+0/-7) debian/libuqpanel0.symbols (+0/-88) debian/unity-2d-places.install (+0/-5) launcher/tests/CMakeLists.txt (+1/-0) libunity-2d/CMakeLists.txt (+8/-0) libunity-2d/Unity2d/CMakeLists.txt (+8/-24) libunity-2d/Unity2d/plugin.cpp (+18/-23) libunity-2d/Unity2d/plugin.h (+4/-4) libunity-2d/Unity2d/qmldir (+1/-1) libunity-2d/src/CMakeLists.txt (+39/-0) libunity-2d/src/unity2dpanel.cpp (+164/-0) libunity-2d/src/unity2dpanel.h (+62/-0) libunity-2d/tests/CMakeLists.txt (+30/-0) libunity-2d/tests/paneltest.cpp (+82/-0) panel/CMakeLists.txt (+1/-5) panel/app/CMakeLists.txt (+6/-2) panel/app/main.cpp (+3/-3) panel/app/unity2dstyle.cpp (+1/-1) panel/applets/CMakeLists.txt (+2/-1) panel/applets/common/applet.cpp (+0/-10) panel/applets/legacytray/fdotask.cpp (+1/-1) panel/applets/legacytray/legacytrayapplet.cpp (+1/-1) panel/lib/CMakeLists.txt (+0/-48) panel/lib/libuqpanel.pc.in (+0/-10) panel/lib/panel.cpp (+0/-172) panel/lib/panel.h (+0/-67) panel/tests/CMakeLists.txt (+3/-5) panel/tests/paneltest.cpp (+0/-84) places/CMakeLists.txt (+0/-1) places/GnomeBackground.qml (+1/-1) places/Home.qml (+1/-1) places/PlaceEntryView.qml (+1/-1) places/RendererGrid.qml (+0/-1) places/UnityPlaces/qdbusconnectionqml.cpp (+0/-67) places/UnityPlaces/qdbusconnectionqml.h (+0/-56) places/UnityPlaces/unity_place.h (+0/-140) places/UnityPlaces/unity_place.xml (+0/-38) places/UnityPlaces/unity_place_entry.h (+0/-144) places/UnityPlaces/unity_place_entry.xml (+0/-35) places/app/places.cpp (+2/-0) spread/GnomeBackground.qml (+1/-1) spread/Spread.qml (+1/-1) spread/app/spread.cpp (+2/-3) |
To merge this branch: | bzr merge lp:~agateau/unity-2d/maverick-libunity2d |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Florian Boucault (community) | code | Approve | |
Olivier Tilloy (community) | functional | Approve | |
Review via email: mp+47669@code.launchpad.net |
This proposal supersedes a proposal from 2011-01-27.
Commit message
[backend] Introduce libunity-2d
- Introduce libunity-2d, which contains most of libuqpanel.
- Get rid of libuqpanel. Most of it is in libunity-2d, only a few classes went into unity-2d-panel
- Remove dead code from UnityPlaces.
- Introduce libunity-2d-qml, which contains a few C++ classes implementing QML objects. These classes comes from UnityPlaces.
Description of the change
This first merge request does the following things:
- Introduce libunity-2d, which contains most of libuqpanel.
- Get rid of libuqpanel. Most of it is in libunity-2d, only a few classes went into unity-2d-panel
- Remove dead code from UnityPlaces.
- Introduce libunity-2d-qml, which contains a few C++ classes implementing QML objects. These classes comes from UnityPlaces.
Next step is to move the C++ classes from UnityLauncher into libunity-2d-qml.
I hesitated a bit on the library names (libunity-2d vs libUnity2d and libunity-2d-qml vs libUnity2dQml) but went for the "hyphen" version to be consistent with the names of the other unity-2d components. I am happy to rename them if you think using capitalized letters is better (to be consistent with Qt{Dee,Bamf,GConf})
Florian Boucault (fboucault) wrote : | # |
Why adding X11 to the root CMakeLists.txt?
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2011-01-14 20:42:44 +0000
+++ CMakeLists.txt 2011-01-27 15:12:29 +0000
@@ -13,6 +13,7 @@
# Dependencies
include(
find_package(Qt4 REQUIRED)
+find_package(X11 REQUIRED)
include_
${
@@ -22,9 +23,11 @@
${
${
${
+ ${X11_INCLUDE_DIR}
)
Florian Boucault (fboucault) wrote : | # |
kaleo@tequila:
panel/applets/
panel/applets/
panel/app/
Florian Boucault (fboucault) wrote : | # |
kaleo@tequila:
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
./panel/
Aurélien Gâteau (agateau) wrote : | # |
> kaleo@tequila:
> spread/
> of the places
>
> UnityPlaces should not appear anymore, Unity2d replaces it.
Fixed.
> Why adding X11 to the root CMakeLists.txt?
Because we are using it in so many places I thought it would be smarter to test for it globally, like Qt4. We can remove the individual tests later.
- 386. By Aurélien Gâteau
-
Fix running in !isRunningInsta
lled() mode
Florian Boucault (fboucault) wrote : | # |
in debian/control
I think Package: libuqpanel0 and Package: libuqpanel-dev should be kept but become dummy transitional packages exactly like it was done for unity-qt-* packages.
Package: libuqpanel0
Architecture: any
Depends: ${misc:Depends}, libunity-2d0
Description: dummy transitional package for unity-2d-panel
This transitional package helps users transition to the
libunity-2d0 package. Once this package and its dependencies
are installed you can safely remove it.
Thoughts?
Florian Boucault (fboucault) wrote : | # |
The !isRunningInstalled mode for the dash/places is broken too.
Aurélien Gâteau (agateau) wrote : | # |
> kaleo@tequila:
>
> ./panel/
uqapplets still exists. It is a static library. Renaming it can be done in a separate MR.
Aurélien Gâteau (agateau) wrote : | # |
> kaleo@tequila:
>
> panel/applets/
> panel/applets/
> panel/app/
Fixed
- 387. By Aurélien Gâteau
-
uqpanel => libunity-2d, even in comments!
Aurélien Gâteau (agateau) wrote : | # |
> in debian/control
>
> I think Package: libuqpanel0 and Package: libuqpanel-dev should be kept but
> become dummy transitional packages exactly like it was done for unity-qt-*
> packages.
>
> Package: libuqpanel0
> Architecture: any
> Depends: ${misc:Depends}, libunity-2d0
> Description: dummy transitional package for unity-2d-panel
> This transitional package helps users transition to the
> libunity-2d0 package. Once this package and its dependencies
> are installed you can safely remove it.
>
> Thoughts?
Fixed
Aurélien Gâteau (agateau) wrote : | # |
> The !isRunningInstalled mode for the dash/places is broken too.
Screw !isRunningInsta
- 388. By Aurélien Gâteau
-
Use transitional packages to install libunity-2d
- 389. By Aurélien Gâteau
-
Fix !isRunningInstalled mode
Florian Boucault (fboucault) wrote : | # |
Is libunity-2d needing a .pc file (similar to what was done for panel/lib/
Florian Boucault (fboucault) wrote : | # |
debian/
Aurélien Gâteau (agateau) wrote : | # |
> Is libunity-2d needing a .pc file (similar to what was done for
> panel/lib/
I don't think we need one, unless we expect 3rd-party developers to use libunity-2d
Florian Boucault (fboucault) wrote : | # |
No .symbols is present for libunity-2d (similar to debian/
Florian Boucault (fboucault) wrote : | # |
kaleo@tequila:
panel/applets/
Aurélien Gâteau (agateau) wrote : | # |
> No .symbols is present for libunity-2d (similar to
> debian/
I don't know how to generate a .symbols. That is a packager job (why oh why don't we use separate packaging branches?)
Florian Boucault (fboucault) wrote : | # |
kaleo@tequila:
fails with
make[3]: *** No rule to make target `launcher_check', needed by `panel/
make[2]: *** [panel/
make[1]: *** [panel/
make: *** [check] Error 2
- 390. By Aurélien Gâteau
-
Added missing postrm file
- 391. By Aurélien Gâteau
-
Removed a bunch of unused includes
Aurélien Gâteau (agateau) wrote : | # |
> kaleo@tequila:
>
> panel/applets/
Wow, good catch. Don't you like including ncurses panel.h?
Fixed (and removed a bunch of other unused #include)
Aurélien Gâteau (agateau) wrote : | # |
> debian/
> created, is that intended?
Fixed
Olivier Tilloy (osomon) wrote : | # |
When running the places uninstalled:
$ ./places/
file://
^
file://
import Unity2d 1.0
^
Aurélien Gâteau (agateau) wrote : | # |
> When running the places uninstalled:
>
> $ ./places/
> file://
> Type GnomeBackground unavailable
> overlay_color: "black"
> ^
> file://
> libunity2d/
> import Unity2d 1.0
> ^
Isn't that fixed with r389?
Florian Boucault (fboucault) wrote : | # |
debian/control:
libunity-2d0 and libunity-2d-dev should have a versioned Conflicts and Replaces as well as aProvides on libuqpanel*
See Package: unity-2d-panel as an example
Aurélien Gâteau (agateau) wrote : | # |
> kaleo@tequila:
>
> fails with
>
>
> make[3]: *** No rule to make target `launcher_check', needed by
> `panel/
> make[2]: *** [panel/
> make[1]: *** [panel/
> make: *** [check] Error 2
Fixed
- 392. By Aurélien Gâteau
-
Unbreak "make check"
Florian Boucault (fboucault) wrote : | # |
> > No .symbols is present for libunity-2d (similar to
> > debian/
>
> I don't know how to generate a .symbols. That is a packager job (why oh why
> don't we use separate packaging branches?)
Because *we* maintain a daily PPA for our users/testers.
I will take care of the .symbols.
- 393. By Aurélien Gâteau
-
Updated ignore for debian dir
- 394. By Aurélien Gâteau
-
Ignore libunity-2d files
- 395. By Aurélien Gâteau
-
Renamed qml to Unity2d so that !isRunningInstalled works
Olivier Tilloy (osomon) wrote : | # |
At revision 395 of this branch, I successfully built packages in a chroot and installed them on my system. I did some quick functional testing of all the components, and I couldn’t observe any obvious regression.
This validates the upgrade path, but the system used isn’t exacly clean, it’s my development environment…
A really complete review should also test installation of those packages on a bare install of maverick.
Note that this is a functional review only, I didn’t look at the actual changeset, Florian is taking care of that.
Florian Boucault (fboucault) wrote : | # |
Last code bits to fix:
- generating .symbols files for libunity-2d
- reviewing commit 395
Florian Boucault (fboucault) wrote : | # |
Commit 395 is fine.
Symbols file has been added. See https:/
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2011-01-14 20:42:44 +0000 |
3 | +++ .bzrignore 2011-01-27 16:58:50 +0000 |
4 | @@ -17,9 +17,12 @@ |
5 | panel/app/unity-2d-panel |
6 | panel/applets/registraradaptor.* |
7 | panel/lib/libuqpanel.so* |
8 | -panel/tests/paneltest |
9 | panel/tests/homebuttonapplettest |
10 | |
11 | +libunity-2d/src/libunity-2d.so.* |
12 | +libunity-2d/tests/keyboardmodifiersmonitortest |
13 | +libunity-2d/tests/paneltest |
14 | + |
15 | # Cmake files and generated files |
16 | Makefile |
17 | .bzr-repo |
18 | @@ -42,9 +45,16 @@ |
19 | debian/*.substvars |
20 | debian/*.debhelper |
21 | debian/stamp-* |
22 | -debian/libuqpanel-dev |
23 | -debian/libuqpanel0 |
24 | debian/tmp |
25 | debian/unity-2d-launcher |
26 | debian/unity-2d-panel |
27 | debian/unity-2d-places |
28 | +debian/unity-2d-spread |
29 | +debian/libunity-2d-dev |
30 | +debian/libunity-2d0 |
31 | +debian/unity-qt-launcher |
32 | +debian/unity-qt-panel |
33 | +debian/unity-qt-places |
34 | +debian/unity-qt-spread |
35 | +debian/libuqpanel-dev |
36 | +debian/libuqpanel0 |
37 | |
38 | === modified file 'CMakeLists.txt' |
39 | --- CMakeLists.txt 2011-01-14 20:42:44 +0000 |
40 | +++ CMakeLists.txt 2011-01-27 16:58:50 +0000 |
41 | @@ -13,6 +13,7 @@ |
42 | # Dependencies |
43 | include(FindPkgConfig) |
44 | find_package(Qt4 REQUIRED) |
45 | +find_package(X11 REQUIRED) |
46 | |
47 | include_directories( |
48 | ${CMAKE_BINARY_DIR} |
49 | @@ -22,9 +23,14 @@ |
50 | ${QT_QTDECLARATIVE_INCLUDE_DIR} |
51 | ${QT_QTXML_INCLUDE_DIR} |
52 | ${QT_QTGUI_INCLUDE_DIR} |
53 | + ${X11_INCLUDE_DIR} |
54 | ) |
55 | |
56 | +# Tests |
57 | +add_custom_target(check) |
58 | + |
59 | # Source |
60 | +add_subdirectory(libunity-2d) |
61 | add_subdirectory(launcher) |
62 | add_subdirectory(panel) |
63 | add_subdirectory(places) |
64 | |
65 | === modified file 'debian/control' |
66 | --- debian/control 2011-01-19 20:36:35 +0000 |
67 | +++ debian/control 2011-01-27 16:58:50 +0000 |
68 | @@ -10,6 +10,22 @@ |
69 | libx11-dev, libindicator-dev, libgtk2.0-dev |
70 | Standards-Version: 3.9.1 |
71 | |
72 | +Package: libunity-2d0 |
73 | +Section: libs |
74 | +Architecture: any |
75 | +Depends: ${shlibs:Depends}, ${misc:Depends} |
76 | +Description: Unity 2D shared library |
77 | + This library is used to host common code used by several Unity 2D components |
78 | + |
79 | +Package: libunity-2d-dev |
80 | +Section: libdevel |
81 | +Architecture: any |
82 | +Depends: ${shlibs:Depends}, ${misc:Depends}, libunity-2d0 (= ${binary:Version}) |
83 | +Description: Unity 2D shared library - development files |
84 | + This library is used to host common code used by several Unity 2D components |
85 | + . |
86 | + This package contains the development header files. |
87 | + |
88 | Package: unity-2d-launcher |
89 | Architecture: any |
90 | Depends: ${shlibs:Depends}, ${misc:Depends}, unity-asset-pool |
91 | @@ -34,29 +50,9 @@ |
92 | various indicators. It part of Unity 2D and can not run as a standalone |
93 | application outside of the Unity 2D environment. |
94 | |
95 | -Package: libuqpanel0 |
96 | -Section: libs |
97 | -Architecture: any |
98 | -Depends: ${shlibs:Depends}, ${misc:Depends} |
99 | -Description: Unity 2D Panel - shared library |
100 | - This library is used to create panel applets for the Unity 2D panel and |
101 | - provides various support functions for Unity 2D. It is only needed as |
102 | - part of a Unity 2D installation |
103 | - |
104 | -Package: libuqpanel-dev |
105 | -Section: libdevel |
106 | -Architecture: any |
107 | -Depends: ${shlibs:Depends}, ${misc:Depends}, libuqpanel0 (= ${binary:Version}) |
108 | -Description: Unity 2D Panel - development files |
109 | - This library is used to create panel applets for the Unity 2D panel and |
110 | - provides various support functions for Unity 2D. It is only needed as part |
111 | - of a Unity 2D installation. |
112 | - . |
113 | - This package contains the development header files. |
114 | - |
115 | Package: unity-2d-places |
116 | Architecture: any |
117 | -Depends: ${shlibs:Depends}, ${misc:Depends}, unity-2d-launcher |
118 | +Depends: ${shlibs:Depends}, ${misc:Depends}, unity-2d-launcher, libunity-2d0 |
119 | Provides: unity-qt-places |
120 | Conflicts: unity-qt-places (<= 0.2) |
121 | Replaces: unity-qt-places (<= 0.2) |
122 | @@ -67,7 +63,7 @@ |
123 | |
124 | Package: unity-2d-spread |
125 | Architecture: any |
126 | -Depends: ${shlibs:Depends}, ${misc:Depends}, unity-2d-launcher, unity-2d-places |
127 | +Depends: ${shlibs:Depends}, ${misc:Depends}, unity-2d-launcher, libunity-2d0 |
128 | Provides: unity-qt-spread |
129 | Conflicts: unity-qt-spread (<= 0.2) |
130 | Replaces: unity-qt-spread (<= 0.2) |
131 | @@ -108,3 +104,20 @@ |
132 | This transitional package helps users transition to the |
133 | unity-2d-spread package. Once this package and its dependencies |
134 | are installed you can safely remove it. |
135 | + |
136 | +Package: libuqpanel0 |
137 | +Architecture: any |
138 | +Depends: ${misc:Depends}, libunity-2d0 |
139 | +Description: dummy transitional package for libuqpanel0 |
140 | + This transitional package helps users transition to the |
141 | + libunity-2d0 package. Once this package and its dependencies |
142 | + are installed you can safely remove it. |
143 | + |
144 | +Package: libuqpanel-dev |
145 | +Section: libdevel |
146 | +Architecture: any |
147 | +Depends: ${misc:Depends}, libunity-2d-dev |
148 | +Description: dummy transitional package for libuqpanel-dev |
149 | + This transitional package helps users transition to the |
150 | + libunity-2d-dev package. Once this package and its dependencies |
151 | + are installed you can safely remove it. |
152 | |
153 | === added file 'debian/libunity-2d-dev.install' |
154 | --- debian/libunity-2d-dev.install 1970-01-01 00:00:00 +0000 |
155 | +++ debian/libunity-2d-dev.install 2011-01-27 16:58:50 +0000 |
156 | @@ -0,0 +1,2 @@ |
157 | +usr/lib/libunity-2d.so |
158 | +usr/include/unity-2d |
159 | |
160 | === added file 'debian/libunity-2d0.install' |
161 | --- debian/libunity-2d0.install 1970-01-01 00:00:00 +0000 |
162 | +++ debian/libunity-2d0.install 2011-01-27 16:58:50 +0000 |
163 | @@ -0,0 +1,3 @@ |
164 | +usr/lib/libunity-2d.so.* |
165 | +usr/lib/qt4/imports/Unity2d/libunity-2d-qml.so |
166 | +usr/lib/qt4/imports/Unity2d/qmldir |
167 | |
168 | === added file 'debian/libunity-2d0.postinst' |
169 | --- debian/libunity-2d0.postinst 1970-01-01 00:00:00 +0000 |
170 | +++ debian/libunity-2d0.postinst 2011-01-27 16:58:50 +0000 |
171 | @@ -0,0 +1,7 @@ |
172 | +#!/bin/sh |
173 | +set -e |
174 | +if [ "$1" = "configure" ]; then |
175 | + ldconfig |
176 | +fi |
177 | + |
178 | +#DEBHELPER# |
179 | |
180 | === added file 'debian/libunity-2d0.postrm' |
181 | --- debian/libunity-2d0.postrm 1970-01-01 00:00:00 +0000 |
182 | +++ debian/libunity-2d0.postrm 2011-01-27 16:58:50 +0000 |
183 | @@ -0,0 +1,7 @@ |
184 | +#!/bin/sh |
185 | +set -e |
186 | +if [ "$1" = "remove" ]; then |
187 | + ldconfig |
188 | +fi |
189 | + |
190 | +#DEBHELPER# |
191 | |
192 | === removed file 'debian/libuqpanel-dev.install' |
193 | --- debian/libuqpanel-dev.install 2010-12-08 21:21:16 +0000 |
194 | +++ debian/libuqpanel-dev.install 1970-01-01 00:00:00 +0000 |
195 | @@ -1,4 +0,0 @@ |
196 | -usr/lib/libuqpanel.so |
197 | -usr/lib/pkgconfig/libuqpanel.pc |
198 | -usr/include/uqpanel |
199 | - |
200 | |
201 | === removed file 'debian/libuqpanel0.install' |
202 | --- debian/libuqpanel0.install 2010-12-08 21:21:16 +0000 |
203 | +++ debian/libuqpanel0.install 1970-01-01 00:00:00 +0000 |
204 | @@ -1,2 +0,0 @@ |
205 | -usr/lib/libuqpanel.so.* |
206 | - |
207 | |
208 | === removed file 'debian/libuqpanel0.postinst' |
209 | --- debian/libuqpanel0.postinst 2011-01-14 22:05:40 +0000 |
210 | +++ debian/libuqpanel0.postinst 1970-01-01 00:00:00 +0000 |
211 | @@ -1,7 +0,0 @@ |
212 | -#!/bin/sh |
213 | -set -e |
214 | -if [ "$1" = "configure" ]; then |
215 | - ldconfig |
216 | -fi |
217 | - |
218 | -#DEBHELPER# |
219 | |
220 | === removed file 'debian/libuqpanel0.postrm' |
221 | --- debian/libuqpanel0.postrm 2011-01-14 22:05:40 +0000 |
222 | +++ debian/libuqpanel0.postrm 1970-01-01 00:00:00 +0000 |
223 | @@ -1,7 +0,0 @@ |
224 | -#!/bin/sh |
225 | -set -e |
226 | -if [ "$1" = "remove" ]; then |
227 | - ldconfig |
228 | -fi |
229 | - |
230 | -#DEBHELPER# |
231 | |
232 | === removed file 'debian/libuqpanel0.symbols' |
233 | --- debian/libuqpanel0.symbols 2011-01-18 12:41:29 +0000 |
234 | +++ debian/libuqpanel0.symbols 1970-01-01 00:00:00 +0000 |
235 | @@ -1,88 +0,0 @@ |
236 | -# SymbolsHelper-Confirmed: 0.1 i386 |
237 | -libuqpanel.so.0 libuqpanel0 #MINVER# |
238 | - _ZN12Unity2dStyleC1Ev@Base 0.1 |
239 | - _ZN12Unity2dStyleC2Ev@Base 0.1 |
240 | - _ZN12Unity2dStyleD0Ev@Base 0.1 |
241 | - _ZN12Unity2dStyleD1Ev@Base 0.1 |
242 | - _ZN18Unity2dApplication11qt_metacallEN11QMetaObject4CallEiPPv@Base 0.1 |
243 | - _ZN18Unity2dApplication11qt_metacastEPKc@Base 0.1 |
244 | - _ZN18Unity2dApplication14x11EventFilterEP7_XEvent@Base 0.1 |
245 | - _ZN18Unity2dApplication16staticMetaObjectE@Base 0.1 |
246 | - _ZN18Unity2dApplication20removeX11EventFilterEP22AbstractX11EventFilter@Base 0.1 |
247 | - _ZN18Unity2dApplication21installX11EventFilterEP22AbstractX11EventFilter@Base 0.1 |
248 | - _ZN18Unity2dApplication8instanceEv@Base 0.1 |
249 | - _ZN18Unity2dApplicationC1ERiPPc@Base 0.1 |
250 | - _ZN18Unity2dApplicationC2ERiPPc@Base 0.1 |
251 | - _ZN18Unity2dApplicationD0Ev@Base 0.1 |
252 | - _ZN18Unity2dApplicationD1Ev@Base 0.1 |
253 | - _ZN22AbstractX11EventFilterD0Ev@Base 0.1 |
254 | - _ZN22AbstractX11EventFilterD1Ev@Base 0.1 |
255 | - _ZN22AbstractX11EventFilterD2Ev@Base 0.1 |
256 | - _ZN24KeyboardModifiersMonitor11qt_metacallEN11QMetaObject4CallEiPPv@Base 0.1 |
257 | - _ZN24KeyboardModifiersMonitor11qt_metacastEPKc@Base 0.1 |
258 | - _ZN24KeyboardModifiersMonitor14x11EventFilterEP7_XEvent@Base 0.1 |
259 | - _ZN24KeyboardModifiersMonitor16staticMetaObjectE@Base 0.1 |
260 | - _ZN24KeyboardModifiersMonitor24keyboardModifiersChangedE6QFlagsIN2Qt16KeyboardModifierEE@Base 0.1 |
261 | - _ZN24KeyboardModifiersMonitor8instanceEv@Base 0.1 |
262 | - _ZN24KeyboardModifiersMonitorC1EP7QObject@Base 0.1 |
263 | - _ZN24KeyboardModifiersMonitorC2EP7QObject@Base 0.1 |
264 | - _ZN24KeyboardModifiersMonitorD0Ev@Base 0.1 |
265 | - _ZN24KeyboardModifiersMonitorD1Ev@Base 0.1 |
266 | - _ZN24KeyboardModifiersMonitorD2Ev@Base 0.1 |
267 | - (optional=templinst)_ZN5QListIP22AbstractX11EventFilterE13detach_helperEi@Base 0.1 |
268 | - (optional=templinst)_ZN5QListIP22AbstractX11EventFilterE6appendERKS1_@Base 0.1 |
269 | - (optional=templinst)_ZN5QListIP22AbstractX11EventFilterED1Ev@Base 0.1 |
270 | - _ZN7Unity2d5Panel10paintEventEP11QPaintEvent@Base 0.1 |
271 | - _ZN7Unity2d5Panel11qt_metacallEN11QMetaObject4CallEiPPv@Base 0.1 |
272 | - _ZN7Unity2d5Panel11qt_metacastEPKc@Base 0.1 |
273 | - _ZN7Unity2d5Panel15workAreaResizedEi@Base 0.1 |
274 | - _ZN7Unity2d5Panel16staticMetaObjectE@Base 0.1 |
275 | - _ZN7Unity2d5Panel7setEdgeENS0_4EdgeE@Base 0.1 |
276 | - _ZN7Unity2d5Panel9addSpacerEv@Base 0.1 |
277 | - _ZN7Unity2d5Panel9addWidgetEP7QWidget@Base 0.1 |
278 | - _ZN7Unity2d5Panel9showEventEP10QShowEvent@Base 0.1 |
279 | - _ZN7Unity2d5PanelC1EP7QWidget@Base 0.1 |
280 | - _ZN7Unity2d5PanelC2EP7QWidget@Base 0.1 |
281 | - _ZN7Unity2d5PanelD0Ev@Base 0.1 |
282 | - _ZN7Unity2d5PanelD1Ev@Base 0.1 |
283 | - _ZN7Unity2d5PanelD2Ev@Base 0.1 |
284 | - _ZN7Unity2d6Applet11qt_metacallEN11QMetaObject4CallEiPPv@Base 0.1 |
285 | - _ZN7Unity2d6Applet11qt_metacastEPKc@Base 0.1 |
286 | - _ZN7Unity2d6Applet16staticMetaObjectE@Base 0.1 |
287 | - _ZN7Unity2d6AppletC1Ev@Base 0.1 |
288 | - _ZN7Unity2d6AppletC2Ev@Base 0.1 |
289 | - _ZN7Unity2d6AppletD0Ev@Base 0.1 |
290 | - _ZN7Unity2d6AppletD1Ev@Base 0.1 |
291 | - _ZN7Unity2d6AppletD2Ev@Base 0.1 |
292 | - _ZNK12Unity2dStyle11drawControlEN6QStyle14ControlElementEPK12QStyleOptionP8QPainterPK7QWidget@Base 0.1 |
293 | - _ZNK12Unity2dStyle11pixelMetricEN6QStyle11PixelMetricEPK12QStyleOptionPK7QWidget@Base 0.1 |
294 | - _ZNK12Unity2dStyle16sizeFromContentsEN6QStyle12ContentsTypeEPK12QStyleOptionRK5QSizePK7QWidget@Base 0.1 |
295 | - _ZNK12Unity2dStyle9styleHintEN6QStyle9StyleHintEPK12QStyleOptionPK7QWidgetP16QStyleHintReturn@Base 0.1 |
296 | - _ZNK18Unity2dApplication10metaObjectEv@Base 0.1 |
297 | - _ZNK24KeyboardModifiersMonitor10metaObjectEv@Base 0.1 |
298 | - _ZNK24KeyboardModifiersMonitor17keyboardModifiersEv@Base 0.1 |
299 | - _ZNK7Unity2d5Panel10metaObjectEv@Base 0.1 |
300 | - _ZNK7Unity2d5Panel4edgeEv@Base 0.1 |
301 | - _ZNK7Unity2d6Applet10metaObjectEv@Base 0.1 |
302 | - _ZTI12Unity2dStyle@Base 0.1 |
303 | - _ZTI18Unity2dApplication@Base 0.1 |
304 | - _ZTI22AbstractX11EventFilter@Base 0.1 |
305 | - _ZTI24KeyboardModifiersMonitor@Base 0.1 |
306 | - _ZTIN7Unity2d5PanelE@Base 0.1 |
307 | - _ZTIN7Unity2d6AppletE@Base 0.1 |
308 | - _ZTS12Unity2dStyle@Base 0.1 |
309 | - _ZTS18Unity2dApplication@Base 0.1 |
310 | - _ZTS22AbstractX11EventFilter@Base 0.1 |
311 | - _ZTS24KeyboardModifiersMonitor@Base 0.1 |
312 | - _ZTSN7Unity2d5PanelE@Base 0.1 |
313 | - _ZTSN7Unity2d6AppletE@Base 0.1 |
314 | - _ZTV12Unity2dStyle@Base 0.1 |
315 | - _ZTV18Unity2dApplication@Base 0.1 |
316 | - _ZTV22AbstractX11EventFilter@Base 0.1 |
317 | - _ZTV24KeyboardModifiersMonitor@Base 0.1 |
318 | - _ZTVN7Unity2d5PanelE@Base 0.1 |
319 | - _ZTVN7Unity2d6AppletE@Base 0.1 |
320 | - (c++)"non-virtual thunk to KeyboardModifiersMonitor::x11EventFilter(_XEvent*)@Base" 0.1 |
321 | - (c++)"non-virtual thunk to KeyboardModifiersMonitor::~KeyboardModifiersMonitor()@Base" 0.1 |
322 | - (c++)"non-virtual thunk to Unity2d::Applet::~Applet()@Base" 0.1 |
323 | - (c++)"non-virtual thunk to Unity2d::Panel::~Panel()@Base" 0.1 |
324 | |
325 | === modified file 'debian/unity-2d-places.install' |
326 | --- debian/unity-2d-places.install 2011-01-14 21:41:39 +0000 |
327 | +++ debian/unity-2d-places.install 2011-01-27 16:58:50 +0000 |
328 | @@ -4,8 +4,3 @@ |
329 | usr/share/unity-2d/places/*.qml |
330 | usr/share/unity-2d/places/utils.js |
331 | usr/share/unity-2d/places/artwork |
332 | -usr/lib/qt4/imports/UnityPlaces/libUnityPlaces.so.1.0.0 |
333 | -usr/lib/qt4/imports/UnityPlaces/libUnityPlaces.so.1 |
334 | -usr/lib/qt4/imports/UnityPlaces/libUnityPlaces.so |
335 | -usr/lib/qt4/imports/UnityPlaces/qmldir |
336 | - |
337 | |
338 | === modified file 'launcher/tests/CMakeLists.txt' |
339 | --- launcher/tests/CMakeLists.txt 2010-12-08 15:00:32 +0000 |
340 | +++ launcher/tests/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
341 | @@ -14,6 +14,7 @@ |
342 | |
343 | add_custom_target(launcher_check COMMAND ${CMAKE_CTEST_COMMAND} --verbose |
344 | DEPENDS ${_test_list}) |
345 | + add_dependencies(check launcher_check) |
346 | endmacro(launcher_tests) |
347 | |
348 | include_directories( |
349 | |
350 | === added directory 'libunity-2d' |
351 | === added file 'libunity-2d/CMakeLists.txt' |
352 | --- libunity-2d/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
353 | +++ libunity-2d/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
354 | @@ -0,0 +1,8 @@ |
355 | +project(libunity-2d) |
356 | + |
357 | +set(libunity-2d_SOVERSION 0) |
358 | +set(libunity-2d_VERSION ${libunity-2d_SOVERSION}.0.0) |
359 | + |
360 | +add_subdirectory(src) |
361 | +add_subdirectory(Unity2d) |
362 | +add_subdirectory(tests) |
363 | |
364 | === added directory 'libunity-2d/Unity2d' |
365 | === renamed file 'places/UnityPlaces/CMakeLists.txt' => 'libunity-2d/Unity2d/CMakeLists.txt' |
366 | --- places/UnityPlaces/CMakeLists.txt 2011-01-20 03:46:43 +0000 |
367 | +++ libunity-2d/Unity2d/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
368 | @@ -1,15 +1,10 @@ |
369 | -cmake_minimum_required(VERSION 2.8) |
370 | +# Dependencies |
371 | pkg_check_modules(WNCK REQUIRED libwnck-1.0) |
372 | pkg_check_modules(QTBAMF REQUIRED libqtbamf) |
373 | |
374 | -# Dependencies |
375 | -include(FindPkgConfig) |
376 | -find_package(Qt4 REQUIRED) |
377 | - |
378 | # Sources |
379 | -set(UnityPlaces_SRCS |
380 | +set(unity-2d-qml_SRCS |
381 | plugin.cpp |
382 | - qdbusconnectionqml.cpp |
383 | qsortfilterproxymodelqml.cpp |
384 | blendedimageprovider.cpp |
385 | windowimageprovider.cpp |
386 | @@ -18,37 +13,26 @@ |
387 | cacheeffect.cpp |
388 | ) |
389 | |
390 | -set(UnityPlaces_MOC_HDRS |
391 | - unity_place.h |
392 | - unity_place_entry.h |
393 | +set(unity-2d-qml_MOC_HDRS |
394 | plugin.h |
395 | - qdbusconnectionqml.h |
396 | qsortfilterproxymodelqml.h |
397 | - blendedimageprovider.h |
398 | - windowimageprovider.h |
399 | windowinfo.h |
400 | windowslist.h |
401 | - cacheeffect.h |
402 | ) |
403 | |
404 | -qt4_wrap_cpp(UnityPlaces_MOC_SRCS ${UnityPlaces_MOC_HDRS}) |
405 | +qt4_wrap_cpp(unity-2d-qml_MOC_SRCS ${unity-2d-qml_MOC_HDRS}) |
406 | |
407 | # Build |
408 | -add_library(UnityPlaces SHARED ${UnityPlaces_SRCS} ${UnityPlaces_MOC_SRCS}) |
409 | +add_library(unity-2d-qml SHARED ${unity-2d-qml_SRCS} ${unity-2d-qml_MOC_SRCS}) |
410 | add_definitions(-DWNCK_I_KNOW_THIS_IS_UNSTABLE) |
411 | |
412 | -set_target_properties(UnityPlaces PROPERTIES |
413 | - SOVERSION 1 |
414 | - VERSION 1.0.0 |
415 | - ) |
416 | - |
417 | include_directories( |
418 | ${CMAKE_CURRENT_BINARY_DIR} |
419 | ${WNCK_INCLUDE_DIRS} |
420 | ${QTBAMF_INCLUDE_DIRS} |
421 | ) |
422 | |
423 | -target_link_libraries(UnityPlaces |
424 | +target_link_libraries(unity-2d-qml |
425 | ${QT_QTCORE_LIBRARIES} |
426 | ${QT_QTDBUS_LIBRARIES} |
427 | ${QT_QTDECLARATIVE_LIBRARIES} |
428 | @@ -57,9 +41,9 @@ |
429 | ) |
430 | |
431 | # Install |
432 | -set(IMPORT_INSTALL_DIR lib/qt4/imports/UnityPlaces) |
433 | +set(IMPORT_INSTALL_DIR lib/qt4/imports/Unity2d) |
434 | |
435 | -install(TARGETS UnityPlaces |
436 | +install(TARGETS unity-2d-qml |
437 | LIBRARY DESTINATION ${IMPORT_INSTALL_DIR} |
438 | ) |
439 | |
440 | |
441 | === renamed file 'places/UnityPlaces/blendedimageprovider.cpp' => 'libunity-2d/Unity2d/blendedimageprovider.cpp' |
442 | === renamed file 'places/UnityPlaces/blendedimageprovider.h' => 'libunity-2d/Unity2d/blendedimageprovider.h' |
443 | === renamed file 'places/UnityPlaces/cacheeffect.cpp' => 'libunity-2d/Unity2d/cacheeffect.cpp' |
444 | === renamed file 'places/UnityPlaces/cacheeffect.h' => 'libunity-2d/Unity2d/cacheeffect.h' |
445 | === renamed file 'places/UnityPlaces/plugin.cpp' => 'libunity-2d/Unity2d/plugin.cpp' |
446 | --- places/UnityPlaces/plugin.cpp 2011-01-20 03:46:43 +0000 |
447 | +++ libunity-2d/Unity2d/plugin.cpp 2011-01-27 16:58:50 +0000 |
448 | @@ -20,33 +20,28 @@ |
449 | /* Required otherwise using wnck_set_client_type breaks linking with error: |
450 | undefined reference to `wnck_set_client_type(WnckClientType)' |
451 | */ |
452 | -extern "C" { |
453 | -#include <libwnck/util.h> |
454 | -} |
455 | +#include "plugin.h" |
456 | |
457 | -#include "unity_place.h" |
458 | -#include "unity_place_entry.h" |
459 | +#include "blendedimageprovider.h" |
460 | +#include "cacheeffect.h" |
461 | #include "qsortfilterproxymodelqml.h" |
462 | -#include "blendedimageprovider.h" |
463 | - |
464 | -#include <QtDeclarative/qdeclarative.h> |
465 | -#include <QDeclarativeEngine> |
466 | -#include <QDeclarativeContext> |
467 | -#include <QDesktopWidget> |
468 | -#include <QApplication> |
469 | - |
470 | #include "windowimageprovider.h" |
471 | #include "windowinfo.h" |
472 | #include "windowslist.h" |
473 | -#include "plugin.h" |
474 | -#include "cacheeffect.h" |
475 | - |
476 | - |
477 | - |
478 | -void UnityPlacesPlugin::registerTypes(const char *uri) |
479 | + |
480 | +#include <QApplication> |
481 | +#include <QDeclarativeContext> |
482 | +#include <QDeclarativeEngine> |
483 | +#include <QDesktopWidget> |
484 | +#include <QtDeclarative/qdeclarative.h> |
485 | + |
486 | +#undef signals |
487 | +extern "C" { |
488 | +#include <libwnck/util.h> |
489 | +} |
490 | + |
491 | +void Unity2dPlugin::registerTypes(const char *uri) |
492 | { |
493 | - qmlRegisterType<UnityPlace>(uri, 0, 1, "UnityPlace"); |
494 | - qmlRegisterType<UnityPlaceEntry>(uri, 0, 1, "UnityPlaceEntry"); |
495 | qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "QSortFilterProxyModelQML"); |
496 | |
497 | qmlRegisterType<WindowInfo>(uri, 0, 1, "WindowInfo"); |
498 | @@ -54,7 +49,7 @@ |
499 | qmlRegisterType<CacheEffect>(uri, 0, 1, "CacheEffect"); |
500 | } |
501 | |
502 | -void UnityPlacesPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) |
503 | +void Unity2dPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri) |
504 | { |
505 | Q_UNUSED(uri); |
506 | |
507 | @@ -80,4 +75,4 @@ |
508 | wnck_set_client_type(WNCK_CLIENT_TYPE_PAGER); |
509 | } |
510 | |
511 | -Q_EXPORT_PLUGIN2(UnityPlaces, UnityPlacesPlugin); |
512 | +Q_EXPORT_PLUGIN2(Unity2d, Unity2dPlugin); |
513 | |
514 | === renamed file 'places/UnityPlaces/plugin.h' => 'libunity-2d/Unity2d/plugin.h' |
515 | --- places/UnityPlaces/plugin.h 2010-10-14 01:57:24 +0000 |
516 | +++ libunity-2d/Unity2d/plugin.h 2011-01-27 16:58:50 +0000 |
517 | @@ -17,12 +17,12 @@ |
518 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
519 | */ |
520 | |
521 | -#ifndef UNITYPLACESPLUGIN_H |
522 | -#define UNITYPLACESPLUGIN_H |
523 | +#ifndef UNITY2DPLUGIN_H |
524 | +#define UNITY2DPLUGIN_H |
525 | |
526 | #include <QtDeclarative/QDeclarativeExtensionPlugin> |
527 | |
528 | -class UnityPlacesPlugin : public QDeclarativeExtensionPlugin |
529 | +class Unity2dPlugin : public QDeclarativeExtensionPlugin |
530 | { |
531 | Q_OBJECT |
532 | public: |
533 | @@ -31,4 +31,4 @@ |
534 | }; |
535 | |
536 | |
537 | -#endif // UNITYPLACESPLUGIN_H |
538 | +#endif // UNITY2DPLUGIN_H |
539 | |
540 | === renamed file 'places/UnityPlaces/qmldir' => 'libunity-2d/Unity2d/qmldir' |
541 | --- places/UnityPlaces/qmldir 2010-10-14 01:57:24 +0000 |
542 | +++ libunity-2d/Unity2d/qmldir 2011-01-27 16:58:50 +0000 |
543 | @@ -1,1 +1,1 @@ |
544 | -plugin UnityPlaces |
545 | +plugin unity-2d-qml |
546 | |
547 | === renamed file 'places/UnityPlaces/qsortfilterproxymodelqml.cpp' => 'libunity-2d/Unity2d/qsortfilterproxymodelqml.cpp' |
548 | === renamed file 'places/UnityPlaces/qsortfilterproxymodelqml.h' => 'libunity-2d/Unity2d/qsortfilterproxymodelqml.h' |
549 | === renamed file 'places/UnityPlaces/windowimageprovider.cpp' => 'libunity-2d/Unity2d/windowimageprovider.cpp' |
550 | === renamed file 'places/UnityPlaces/windowimageprovider.h' => 'libunity-2d/Unity2d/windowimageprovider.h' |
551 | === renamed file 'places/UnityPlaces/windowinfo.cpp' => 'libunity-2d/Unity2d/windowinfo.cpp' |
552 | === renamed file 'places/UnityPlaces/windowinfo.h' => 'libunity-2d/Unity2d/windowinfo.h' |
553 | === renamed file 'places/UnityPlaces/windowslist.cpp' => 'libunity-2d/Unity2d/windowslist.cpp' |
554 | === renamed file 'places/UnityPlaces/windowslist.h' => 'libunity-2d/Unity2d/windowslist.h' |
555 | === added directory 'libunity-2d/src' |
556 | === added file 'libunity-2d/src/CMakeLists.txt' |
557 | --- libunity-2d/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
558 | +++ libunity-2d/src/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
559 | @@ -0,0 +1,39 @@ |
560 | +# Sources |
561 | +set(libunity-2d_SRCS |
562 | + keyboardmodifiersmonitor.cpp |
563 | + unity2dapplication.cpp |
564 | + unity2dpanel.cpp |
565 | + ) |
566 | + |
567 | +# Build |
568 | +qt4_automoc(${libunity-2d_SRCS}) |
569 | + |
570 | +include_directories( |
571 | + ${CMAKE_CURRENT_BINARY_DIR} |
572 | + ${CMAKE_CURRENT_SOURCE_DIR} |
573 | + ) |
574 | + |
575 | +add_library(unity-2d SHARED ${libunity-2d_SRCS}) |
576 | +set_target_properties(unity-2d PROPERTIES |
577 | + VERSION ${libunity-2d_VERSION} |
578 | + SOVERSION ${libunity-2d_SOVERSION} |
579 | + ) |
580 | + |
581 | +target_link_libraries(unity-2d |
582 | + ${QT_QTGUI_LIBRARIES} |
583 | + ${QT_QTCORE_LIBRARIES} |
584 | + ${X11_LIBRARIES} |
585 | + ) |
586 | + |
587 | +# Install |
588 | +install(TARGETS unity-2d |
589 | + LIBRARY DESTINATION lib${LIB_SUFFIX} |
590 | + ARCHIVE DESTINATION lib |
591 | + RUNTIME DESTINATION bin |
592 | + ) |
593 | + |
594 | +install(DIRECTORY . |
595 | + DESTINATION include/unity-2d |
596 | + FILES_MATCHING PATTERN "*.h" |
597 | + PATTERN "*_p.h" EXCLUDE |
598 | + ) |
599 | |
600 | === renamed file 'panel/lib/debug_p.h' => 'libunity-2d/src/debug_p.h' |
601 | === renamed file 'panel/lib/keyboardmodifiersmonitor.cpp' => 'libunity-2d/src/keyboardmodifiersmonitor.cpp' |
602 | === renamed file 'panel/lib/keyboardmodifiersmonitor.h' => 'libunity-2d/src/keyboardmodifiersmonitor.h' |
603 | === renamed file 'panel/lib/unity2dapplication.cpp' => 'libunity-2d/src/unity2dapplication.cpp' |
604 | === renamed file 'panel/lib/unity2dapplication.h' => 'libunity-2d/src/unity2dapplication.h' |
605 | === added file 'libunity-2d/src/unity2dpanel.cpp' |
606 | --- libunity-2d/src/unity2dpanel.cpp 1970-01-01 00:00:00 +0000 |
607 | +++ libunity-2d/src/unity2dpanel.cpp 2011-01-27 16:58:50 +0000 |
608 | @@ -0,0 +1,164 @@ |
609 | +/* |
610 | + * This file is part of unity-2d |
611 | + * |
612 | + * Copyright 2010 Canonical Ltd. |
613 | + * |
614 | + * Authors: |
615 | + * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
616 | + * |
617 | + * This program is free software; you can redistribute it and/or modify |
618 | + * it under the terms of the GNU Lesser General Public License as published |
619 | + * by the Free Software Foundation; version 3. |
620 | + * |
621 | + * This program is distributed in the hope that it will be useful, |
622 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
623 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
624 | + * GNU Lesser General Public License for more details. |
625 | + * |
626 | + * You should have received a copy of the GNU Lesser General Public License |
627 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
628 | + */ |
629 | + |
630 | +// Self |
631 | +#include "unity2dpanel.h" |
632 | + |
633 | +// Qt |
634 | +#include <QApplication> |
635 | +#include <QDebug> |
636 | +#include <QDesktopWidget> |
637 | +#include <QPainter> |
638 | +#include <QHBoxLayout> |
639 | +#include <QX11Info> |
640 | + |
641 | +// X |
642 | +#include <X11/Xlib.h> |
643 | +#include <X11/Xatom.h> |
644 | + |
645 | +struct Unity2dPanelPrivate |
646 | +{ |
647 | + Unity2dPanel* q; |
648 | + Unity2dPanel::Edge m_edge; |
649 | + QHBoxLayout* m_layout; |
650 | + |
651 | + void updateStrut() |
652 | + { |
653 | + QDesktopWidget* desktop = QApplication::desktop(); |
654 | + const QRect screen = desktop->screenGeometry(q); |
655 | + const QRect available = desktop->availableGeometry(q); |
656 | + QRect rect; |
657 | + |
658 | + Atom atom = XInternAtom(QX11Info::display(), "_NET_WM_STRUT_PARTIAL", False); |
659 | + |
660 | + ulong struts[12]; |
661 | + switch (m_edge) { |
662 | + case Unity2dPanel::LeftEdge: |
663 | + rect = QRect(screen.left(), available.top(), q->width(), available.height()); |
664 | + struts = { |
665 | + q->width(), 0, 0, 0, |
666 | + available.top(), available.bottom(), 0, 0, |
667 | + 0, 0, 0, 0 |
668 | + }; |
669 | + break; |
670 | + case Unity2dPanel::TopEdge: |
671 | + rect = QRect(screen.left(), screen.top(), screen.width(), q->height()); |
672 | + struts = { |
673 | + 0, 0, q->height(), 0, |
674 | + 0, 0, 0, 0, |
675 | + screen.left(), screen.right(), 0, 0 |
676 | + }; |
677 | + break; |
678 | + } |
679 | + |
680 | + q->setGeometry(rect); |
681 | + |
682 | + XChangeProperty(QX11Info::display(), q->effectiveWinId(), atom, |
683 | + XA_CARDINAL, 32, PropModeReplace, |
684 | + (unsigned char *) &struts, 12); |
685 | + } |
686 | + |
687 | + void updateLayoutDirection() |
688 | + { |
689 | + QBoxLayout::Direction direction; |
690 | + switch(m_edge) { |
691 | + case Unity2dPanel::TopEdge: |
692 | + direction = QApplication::isRightToLeft() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight; |
693 | + break; |
694 | + case Unity2dPanel::LeftEdge: |
695 | + direction = QBoxLayout::TopToBottom; |
696 | + break; |
697 | + } |
698 | + m_layout->setDirection(direction); |
699 | + } |
700 | + |
701 | + void updateEdge() |
702 | + { |
703 | + updateStrut(); |
704 | + updateLayoutDirection(); |
705 | + } |
706 | +}; |
707 | + |
708 | +Unity2dPanel::Unity2dPanel(QWidget* parent) |
709 | +: QWidget(parent) |
710 | +, d(new Unity2dPanelPrivate) |
711 | +{ |
712 | + d->q = this; |
713 | + d->m_edge = Unity2dPanel::TopEdge; |
714 | + d->m_layout = new QHBoxLayout(this); |
715 | + d->m_layout->setMargin(0); |
716 | + d->m_layout->setSpacing(0); |
717 | + setAttribute(Qt::WA_X11NetWmWindowTypeDock); |
718 | + setAttribute(Qt::WA_Hover); |
719 | + setAutoFillBackground(true); |
720 | + connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(slotWorkAreaResized(int))); |
721 | +} |
722 | + |
723 | +Unity2dPanel::~Unity2dPanel() |
724 | +{ |
725 | + delete d; |
726 | +} |
727 | + |
728 | +void Unity2dPanel::setEdge(Unity2dPanel::Edge edge) |
729 | +{ |
730 | + d->m_edge = edge; |
731 | + if (isVisible()) { |
732 | + d->updateEdge(); |
733 | + } |
734 | +} |
735 | + |
736 | +Unity2dPanel::Edge Unity2dPanel::edge() const |
737 | +{ |
738 | + return d->m_edge; |
739 | +} |
740 | + |
741 | +void Unity2dPanel::showEvent(QShowEvent* event) |
742 | +{ |
743 | + QWidget::showEvent(event); |
744 | + d->updateEdge(); |
745 | +} |
746 | + |
747 | +void Unity2dPanel::slotWorkAreaResized(int screen) |
748 | +{ |
749 | + if (x11Info().screen() == screen) { |
750 | + d->updateEdge(); |
751 | + } |
752 | +} |
753 | + |
754 | +void Unity2dPanel::paintEvent(QPaintEvent* event) |
755 | +{ |
756 | + // Necessary because Oxygen thinks it knows better what to paint in the background |
757 | + QPainter painter(this); |
758 | + painter.setCompositionMode(QPainter::CompositionMode_Source); |
759 | + painter.fillRect(rect(), palette().brush(QPalette::Background)); |
760 | +} |
761 | + |
762 | +void Unity2dPanel::addWidget(QWidget* widget) |
763 | +{ |
764 | + d->m_layout->addWidget(widget); |
765 | +} |
766 | + |
767 | +void Unity2dPanel::addSpacer() |
768 | +{ |
769 | + d->m_layout->addStretch(); |
770 | +} |
771 | + |
772 | +#include "unity2dpanel.moc" |
773 | |
774 | === added file 'libunity-2d/src/unity2dpanel.h' |
775 | --- libunity-2d/src/unity2dpanel.h 1970-01-01 00:00:00 +0000 |
776 | +++ libunity-2d/src/unity2dpanel.h 2011-01-27 16:58:50 +0000 |
777 | @@ -0,0 +1,62 @@ |
778 | +/* |
779 | + * This file is part of unity-2d |
780 | + * |
781 | + * Copyright 2010 Canonical Ltd. |
782 | + * |
783 | + * Authors: |
784 | + * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
785 | + * |
786 | + * This program is free software; you can redistribute it and/or modify |
787 | + * it under the terms of the GNU Lesser General Public License as published |
788 | + * by the Free Software Foundation; version 3. |
789 | + * |
790 | + * This program is distributed in the hope that it will be useful, |
791 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
792 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
793 | + * GNU Lesser General Public License for more details. |
794 | + * |
795 | + * You should have received a copy of the GNU Lesser General Public License |
796 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
797 | + */ |
798 | + |
799 | +#ifndef UNITY2DPANEL_H |
800 | +#define UNITY2DPANEL_H |
801 | + |
802 | +// Local |
803 | + |
804 | +// Qt |
805 | +#include <QWidget> |
806 | + |
807 | +struct Unity2dPanelPrivate; |
808 | +class Unity2dPanel : public QWidget |
809 | +{ |
810 | +Q_OBJECT |
811 | +public: |
812 | + enum Edge { |
813 | + LeftEdge, |
814 | + TopEdge |
815 | + }; |
816 | + |
817 | + Unity2dPanel(QWidget* parent = 0); |
818 | + ~Unity2dPanel(); |
819 | + |
820 | + void setEdge(Edge); |
821 | + Edge edge() const; |
822 | + |
823 | + void addWidget(QWidget*); |
824 | + |
825 | + void addSpacer(); |
826 | + |
827 | +protected: |
828 | + virtual void showEvent(QShowEvent*); |
829 | + virtual void paintEvent(QPaintEvent*); |
830 | + |
831 | +private Q_SLOTS: |
832 | + void slotWorkAreaResized(int screen); |
833 | + |
834 | +private: |
835 | + Q_DISABLE_COPY(Unity2dPanel) |
836 | + Unity2dPanelPrivate* const d; |
837 | +}; |
838 | + |
839 | +#endif /* UNITY2DPANEL_H */ |
840 | |
841 | === added directory 'libunity-2d/tests' |
842 | === added file 'libunity-2d/tests/CMakeLists.txt' |
843 | --- libunity-2d/tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
844 | +++ libunity-2d/tests/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
845 | @@ -0,0 +1,30 @@ |
846 | +macro(libunity_2d_tests) |
847 | + set(_test_list "") |
848 | + foreach(_test ${ARGN}) |
849 | + add_test(${_test} ${_test}) |
850 | + add_executable(${_test} ${_test}.cpp ${_test}.moc) |
851 | + qt4_generate_moc(${_test}.cpp ${_test}.moc) |
852 | + target_link_libraries(${_test} |
853 | + ${QT_QTTEST_LIBRARIES} |
854 | + unity-2d |
855 | + ) |
856 | + set(_test_list "${_test_list};${_test}") |
857 | + endforeach(_test) |
858 | + |
859 | + add_custom_target(libunity-2d_check COMMAND ${CMAKE_CTEST_COMMAND} --verbose |
860 | + DEPENDS ${_test_list}) |
861 | + add_dependencies(check libunity-2d_check) |
862 | +endmacro(libunity_2d_tests) |
863 | + |
864 | +include_directories( |
865 | + ${libunity-2d_SOURCE_DIR}/src |
866 | + ${CMAKE_CURRENT_BINARY_DIR} |
867 | + ${QT_QTTEST_INCLUDE_DIR} |
868 | + ) |
869 | + |
870 | +enable_testing() |
871 | + |
872 | +libunity_2d_tests( |
873 | + keyboardmodifiersmonitortest |
874 | + paneltest |
875 | + ) |
876 | |
877 | === renamed file 'panel/tests/keyboardmodifiersmonitortest.cpp' => 'libunity-2d/tests/keyboardmodifiersmonitortest.cpp' |
878 | === added file 'libunity-2d/tests/paneltest.cpp' |
879 | --- libunity-2d/tests/paneltest.cpp 1970-01-01 00:00:00 +0000 |
880 | +++ libunity-2d/tests/paneltest.cpp 2011-01-27 16:58:50 +0000 |
881 | @@ -0,0 +1,82 @@ |
882 | +/* |
883 | + * This file is part of unity-2d |
884 | + * |
885 | + * Copyright 2010 Canonical Ltd. |
886 | + * |
887 | + * Authors: |
888 | + * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
889 | + * |
890 | + * This program is free software; you can redistribute it and/or modify |
891 | + * it under the terms of the GNU General Public License as published by |
892 | + * the Free Software Foundation; version 3. |
893 | + * |
894 | + * This program is distributed in the hope that it will be useful, |
895 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
896 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
897 | + * GNU General Public License for more details. |
898 | + * |
899 | + * You should have received a copy of the GNU General Public License |
900 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
901 | + */ |
902 | + |
903 | +// Local |
904 | +#include <unity2dpanel.h> |
905 | + |
906 | +// Qt |
907 | +#include <QApplication> |
908 | +#include <QDesktopWidget> |
909 | +#include <QtTestGui> |
910 | + |
911 | +class PanelTest : public QObject |
912 | +{ |
913 | + Q_OBJECT |
914 | +private Q_SLOTS: |
915 | + void testSetEdge() |
916 | + { |
917 | + QRect screen = QApplication::desktop()->screenGeometry(); |
918 | + QRect available = QApplication::desktop()->availableGeometry(); |
919 | + |
920 | + Unity2dPanel panel; |
921 | + panel.setFixedHeight(16); |
922 | + panel.setEdge(Unity2dPanel::TopEdge); |
923 | + panel.show(); |
924 | + QTest::qWait(500); |
925 | + |
926 | + QRect expectedGeometry = QRect(screen.left(), screen.top(), screen.width(), 16); |
927 | + QCOMPARE(panel.geometry(), expectedGeometry); |
928 | + QCOMPARE(QApplication::desktop()->availableGeometry(), available.adjusted(0, 16, 0, 0)); |
929 | + } |
930 | + |
931 | + void testAddQWidget() |
932 | + { |
933 | + Unity2dPanel panel; |
934 | + QWidget* widget1 = new QWidget; |
935 | + QWidget* widget2 = new QWidget; |
936 | + panel.addWidget(widget1); |
937 | + panel.addWidget(widget2); |
938 | + panel.show(); |
939 | + |
940 | + QCOMPARE(widget1->geometry(), QRect(0, 0, panel.width() / 2, panel.height())); |
941 | + QCOMPARE(widget2->geometry(), QRect(panel.width() / 2, 0, panel.width() / 2, panel.height())); |
942 | + } |
943 | + |
944 | + void testAddSpacer() |
945 | + { |
946 | + Unity2dPanel panel; |
947 | + QWidget* widget1 = new QWidget; |
948 | + widget1->setFixedWidth(100); |
949 | + QWidget* widget2 = new QWidget; |
950 | + widget2->setFixedWidth(200); |
951 | + panel.addWidget(widget1); |
952 | + panel.addSpacer(); |
953 | + panel.addWidget(widget2); |
954 | + panel.show(); |
955 | + |
956 | + QCOMPARE(widget1->geometry(), QRect(0, 0, 100, panel.height())); |
957 | + QCOMPARE(widget2->geometry(), QRect(panel.width() - 200, 0, 200, panel.height())); |
958 | + } |
959 | +}; |
960 | + |
961 | +QTEST_MAIN(PanelTest) |
962 | + |
963 | +#include "paneltest.moc" |
964 | |
965 | === modified file 'panel/CMakeLists.txt' |
966 | --- panel/CMakeLists.txt 2011-01-14 20:42:44 +0000 |
967 | +++ panel/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
968 | @@ -2,17 +2,13 @@ |
969 | |
970 | # Source |
971 | include_directories( |
972 | - ${CMAKE_CURRENT_SOURCE_DIR}/lib |
973 | + ${libunity-2d_SOURCE_DIR}/src |
974 | ) |
975 | |
976 | -add_subdirectory(lib) |
977 | add_subdirectory(applets) |
978 | add_subdirectory(app) |
979 | add_subdirectory(tests) |
980 | |
981 | -# Tests |
982 | -add_custom_target(check DEPENDS panel_check launcher_check) |
983 | - |
984 | # Install |
985 | install(DIRECTORY artwork |
986 | DESTINATION ${UNITY_2D_DIR}/panel |
987 | |
988 | === modified file 'panel/app/CMakeLists.txt' |
989 | --- panel/app/CMakeLists.txt 2011-01-14 20:42:44 +0000 |
990 | +++ panel/app/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
991 | @@ -1,5 +1,6 @@ |
992 | set(panel_SRCS |
993 | main.cpp |
994 | + unity2dstyle.cpp |
995 | ) |
996 | |
997 | qt4_automoc(${panel_SRCS}) |
998 | @@ -7,14 +8,17 @@ |
999 | |
1000 | include_directories( |
1001 | ${CMAKE_CURRENT_BINARY_DIR} |
1002 | - ${CMAKE_CURRENT_SOURCE_DIR}/../applets |
1003 | + ${CMAKE_CURRENT_SOURCE_DIR} |
1004 | + ${uqapplets_SOURCE_DIR} |
1005 | + ${uqapplets_SOURCE_DIR}/common |
1006 | + ${libunity-2d_SOURCE_DIR}/src |
1007 | ) |
1008 | |
1009 | target_link_libraries(unity-2d-panel |
1010 | ${QT_QTGUI_LIBRARIES} |
1011 | ${QT_QTCORE_LIBRARIES} |
1012 | uqapplets |
1013 | - uqpanel |
1014 | + unity-2d |
1015 | ) |
1016 | |
1017 | install(TARGETS unity-2d-panel |
1018 | |
1019 | === modified file 'panel/app/main.cpp' |
1020 | --- panel/app/main.cpp 2011-01-22 03:55:39 +0000 |
1021 | +++ panel/app/main.cpp 2011-01-27 16:58:50 +0000 |
1022 | @@ -30,7 +30,7 @@ |
1023 | #include <legacytray/legacytrayapplet.h> |
1024 | |
1025 | // Unity |
1026 | -#include <panel.h> |
1027 | +#include <unity2dpanel.h> |
1028 | #include <unity2dapplication.h> |
1029 | #include <unity2dstyle.h> |
1030 | |
1031 | @@ -100,8 +100,8 @@ |
1032 | QApplication::setColorSpec(QApplication::ManyColor); |
1033 | Unity2dApplication app(argc, argv); |
1034 | QApplication::setStyle(new Unity2dStyle); |
1035 | - Panel panel; |
1036 | - panel.setEdge(Panel::TopEdge); |
1037 | + Unity2dPanel panel; |
1038 | + panel.setEdge(Unity2dPanel::TopEdge); |
1039 | panel.setPalette(getPalette()); |
1040 | panel.setFixedHeight(24); |
1041 | |
1042 | |
1043 | === renamed file 'panel/lib/unity2dstyle.cpp' => 'panel/app/unity2dstyle.cpp' |
1044 | --- panel/lib/unity2dstyle.cpp 2011-01-15 01:41:03 +0000 |
1045 | +++ panel/app/unity2dstyle.cpp 2011-01-27 16:58:50 +0000 |
1046 | @@ -24,7 +24,7 @@ |
1047 | |
1048 | // Local |
1049 | |
1050 | -// uqpanel |
1051 | +// libunity-2d |
1052 | #include <debug_p.h> |
1053 | #include <keyboardmodifiersmonitor.h> |
1054 | |
1055 | |
1056 | === renamed file 'panel/lib/unity2dstyle.h' => 'panel/app/unity2dstyle.h' |
1057 | === modified file 'panel/applets/CMakeLists.txt' |
1058 | --- panel/applets/CMakeLists.txt 2011-01-18 11:35:24 +0000 |
1059 | +++ panel/applets/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
1060 | @@ -19,6 +19,7 @@ |
1061 | appname/menubarwidget.cpp |
1062 | appname/registrar.cpp |
1063 | appname/windowhelper.cpp |
1064 | + common/applet.cpp |
1065 | homebutton/homebuttonapplet.cpp |
1066 | indicator/abstractindicator.cpp |
1067 | indicator/datetimeindicator.cpp |
1068 | @@ -43,6 +44,7 @@ |
1069 | include_directories( |
1070 | ${CMAKE_CURRENT_SOURCE_DIR}/appindicator |
1071 | ${CMAKE_CURRENT_SOURCE_DIR}/appname |
1072 | + ${CMAKE_CURRENT_SOURCE_DIR}/common |
1073 | ${CMAKE_CURRENT_SOURCE_DIR}/homebutton |
1074 | ${CMAKE_CURRENT_SOURCE_DIR}/indicator |
1075 | ${QTBAMF_INCLUDE_DIRS} |
1076 | @@ -69,5 +71,4 @@ |
1077 | ${X11_Xcomposite_LIB} |
1078 | ${X11_Xdamage_LIB} |
1079 | ${X11_Xfixes_LIB} |
1080 | - uqpanel |
1081 | ) |
1082 | |
1083 | === added directory 'panel/applets/common' |
1084 | === renamed file 'panel/lib/applet.cpp' => 'panel/applets/common/applet.cpp' |
1085 | --- panel/lib/applet.cpp 2011-01-15 01:41:03 +0000 |
1086 | +++ panel/applets/common/applet.cpp 2011-01-27 16:58:50 +0000 |
1087 | @@ -22,16 +22,6 @@ |
1088 | // Self |
1089 | #include "applet.h" |
1090 | |
1091 | -// Local |
1092 | -#include <panel.h> |
1093 | - |
1094 | -// Qt |
1095 | -#include <QApplication> |
1096 | -#include <QPainter> |
1097 | - |
1098 | -// System |
1099 | -#include <iostream> |
1100 | - |
1101 | namespace Unity2d |
1102 | { |
1103 | |
1104 | |
1105 | === renamed file 'panel/lib/applet.h' => 'panel/applets/common/applet.h' |
1106 | === modified file 'panel/applets/legacytray/fdotask.cpp' |
1107 | --- panel/applets/legacytray/fdotask.cpp 2011-01-15 01:41:03 +0000 |
1108 | +++ panel/applets/legacytray/fdotask.cpp 2011-01-27 16:58:50 +0000 |
1109 | @@ -26,7 +26,7 @@ |
1110 | #include "x11embedcontainer.h" |
1111 | #include "x11embeddelegate.h" |
1112 | |
1113 | -// uqpanel |
1114 | +// libunity-2d |
1115 | #include <debug_p.h> |
1116 | |
1117 | // Qt |
1118 | |
1119 | === modified file 'panel/applets/legacytray/legacytrayapplet.cpp' |
1120 | --- panel/applets/legacytray/legacytrayapplet.cpp 2011-01-15 01:41:03 +0000 |
1121 | +++ panel/applets/legacytray/legacytrayapplet.cpp 2011-01-27 16:58:50 +0000 |
1122 | @@ -26,7 +26,7 @@ |
1123 | #include "fdoselectionmanager.h" |
1124 | #include "fdotask.h" |
1125 | |
1126 | -// uqpanel |
1127 | +// libunity-2d |
1128 | #include <debug_p.h> |
1129 | |
1130 | // Qt |
1131 | |
1132 | === removed directory 'panel/lib' |
1133 | === removed file 'panel/lib/CMakeLists.txt' |
1134 | --- panel/lib/CMakeLists.txt 2011-01-14 20:42:56 +0000 |
1135 | +++ panel/lib/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1136 | @@ -1,48 +0,0 @@ |
1137 | -# Sources |
1138 | -set(libuqpanel_SRCS |
1139 | - applet.cpp |
1140 | - keyboardmodifiersmonitor.cpp |
1141 | - panel.cpp |
1142 | - unity2dapplication.cpp |
1143 | - unity2dstyle.cpp |
1144 | - ) |
1145 | - |
1146 | -set(libuqpanel_VERSION 0.0.0) |
1147 | -set(libuqpanel_SOVERSION 0) |
1148 | - |
1149 | -# Build |
1150 | -qt4_automoc(${libuqpanel_SRCS}) |
1151 | - |
1152 | -include_directories( |
1153 | - ${CMAKE_CURRENT_BINARY_DIR} |
1154 | - ) |
1155 | - |
1156 | -configure_file(libuqpanel.pc.in ${CMAKE_BINARY_DIR}/libuqpanel.pc @ONLY) |
1157 | - |
1158 | -add_library(uqpanel SHARED ${libuqpanel_SRCS}) |
1159 | -set_target_properties(uqpanel PROPERTIES |
1160 | - VERSION ${libuqpanel_VERSION} |
1161 | - SOVERSION ${libuqpanel_SOVERSION} |
1162 | - ) |
1163 | - |
1164 | -target_link_libraries(uqpanel |
1165 | - ${QT_QTGUI_LIBRARIES} |
1166 | - ${QT_QTCORE_LIBRARIES} |
1167 | - ) |
1168 | - |
1169 | -# Install |
1170 | -install(TARGETS uqpanel |
1171 | - LIBRARY DESTINATION lib${LIB_SUFFIX} |
1172 | - ARCHIVE DESTINATION lib |
1173 | - RUNTIME DESTINATION bin |
1174 | - ) |
1175 | - |
1176 | -install(DIRECTORY . |
1177 | - DESTINATION include/uqpanel |
1178 | - FILES_MATCHING PATTERN "*.h" |
1179 | - PATTERN "*_p.h" EXCLUDE |
1180 | - ) |
1181 | - |
1182 | -install(FILES ${CMAKE_BINARY_DIR}/libuqpanel.pc |
1183 | - DESTINATION lib/pkgconfig |
1184 | - ) |
1185 | |
1186 | === removed file 'panel/lib/libuqpanel.pc.in' |
1187 | --- panel/lib/libuqpanel.pc.in 2011-01-14 20:42:06 +0000 |
1188 | +++ panel/lib/libuqpanel.pc.in 1970-01-01 00:00:00 +0000 |
1189 | @@ -1,10 +0,0 @@ |
1190 | -prefix=@CMAKE_INSTALL_PREFIX@ |
1191 | -exec_prefix=@CMAKE_INSTALL_PREFIX@ |
1192 | -libdir=@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@ |
1193 | -includedir=@CMAKE_INSTALL_PREFIX@/include/libuqpanel |
1194 | - |
1195 | -Name: libuqpanel |
1196 | -Description: Library to create Unity 2d panel applets |
1197 | -Version: @libgui_VERSION@ |
1198 | -Libs: -L${libdir} -luqpanel |
1199 | -Cflags: -I${includedir} |
1200 | |
1201 | === removed file 'panel/lib/panel.cpp' |
1202 | --- panel/lib/panel.cpp 2011-01-15 01:41:03 +0000 |
1203 | +++ panel/lib/panel.cpp 1970-01-01 00:00:00 +0000 |
1204 | @@ -1,172 +0,0 @@ |
1205 | -/* |
1206 | - * This file is part of unity-2d |
1207 | - * |
1208 | - * Copyright 2010 Canonical Ltd. |
1209 | - * |
1210 | - * Authors: |
1211 | - * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
1212 | - * |
1213 | - * This program is free software; you can redistribute it and/or modify |
1214 | - * it under the terms of the GNU Lesser General Public License as published |
1215 | - * by the Free Software Foundation; version 3. |
1216 | - * |
1217 | - * This program is distributed in the hope that it will be useful, |
1218 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1219 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1220 | - * GNU Lesser General Public License for more details. |
1221 | - * |
1222 | - * You should have received a copy of the GNU Lesser General Public License |
1223 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1224 | - */ |
1225 | - |
1226 | -// Self |
1227 | -#include "panel.h" |
1228 | - |
1229 | -// Local |
1230 | -#include "applet.h" |
1231 | - |
1232 | -// Qt |
1233 | -#include <QApplication> |
1234 | -#include <QDebug> |
1235 | -#include <QDesktopWidget> |
1236 | -#include <QPainter> |
1237 | -#include <QHBoxLayout> |
1238 | -#include <QX11Info> |
1239 | - |
1240 | -// X |
1241 | -#include <X11/Xlib.h> |
1242 | -#include <X11/Xatom.h> |
1243 | - |
1244 | -namespace Unity2d |
1245 | -{ |
1246 | - |
1247 | -struct PanelPrivate |
1248 | -{ |
1249 | - Panel* q; |
1250 | - Panel::Edge m_edge; |
1251 | - QHBoxLayout* m_layout; |
1252 | - |
1253 | - void updateStrut() |
1254 | - { |
1255 | - QDesktopWidget* desktop = QApplication::desktop(); |
1256 | - const QRect screen = desktop->screenGeometry(q); |
1257 | - const QRect available = desktop->availableGeometry(q); |
1258 | - QRect rect; |
1259 | - |
1260 | - Atom atom = XInternAtom(QX11Info::display(), "_NET_WM_STRUT_PARTIAL", False); |
1261 | - |
1262 | - ulong struts[12]; |
1263 | - switch (m_edge) { |
1264 | - case Panel::LeftEdge: |
1265 | - rect = QRect(screen.left(), available.top(), q->width(), available.height()); |
1266 | - struts = { |
1267 | - q->width(), 0, 0, 0, |
1268 | - available.top(), available.bottom(), 0, 0, |
1269 | - 0, 0, 0, 0 |
1270 | - }; |
1271 | - break; |
1272 | - case Panel::TopEdge: |
1273 | - rect = QRect(screen.left(), screen.top(), screen.width(), q->height()); |
1274 | - struts = { |
1275 | - 0, 0, q->height(), 0, |
1276 | - 0, 0, 0, 0, |
1277 | - screen.left(), screen.right(), 0, 0 |
1278 | - }; |
1279 | - break; |
1280 | - } |
1281 | - |
1282 | - q->setGeometry(rect); |
1283 | - |
1284 | - XChangeProperty(QX11Info::display(), q->effectiveWinId(), atom, |
1285 | - XA_CARDINAL, 32, PropModeReplace, |
1286 | - (unsigned char *) &struts, 12); |
1287 | - } |
1288 | - |
1289 | - void updateLayoutDirection() |
1290 | - { |
1291 | - QBoxLayout::Direction direction; |
1292 | - switch(m_edge) { |
1293 | - case Panel::TopEdge: |
1294 | - direction = QApplication::isRightToLeft() ? QBoxLayout::RightToLeft : QBoxLayout::LeftToRight; |
1295 | - break; |
1296 | - case Panel::LeftEdge: |
1297 | - direction = QBoxLayout::TopToBottom; |
1298 | - break; |
1299 | - } |
1300 | - m_layout->setDirection(direction); |
1301 | - } |
1302 | - |
1303 | - void updateEdge() |
1304 | - { |
1305 | - updateStrut(); |
1306 | - updateLayoutDirection(); |
1307 | - } |
1308 | -}; |
1309 | - |
1310 | -Panel::Panel(QWidget* parent) |
1311 | -: QWidget(parent) |
1312 | -, d(new PanelPrivate) |
1313 | -{ |
1314 | - d->q = this; |
1315 | - d->m_edge = Panel::TopEdge; |
1316 | - d->m_layout = new QHBoxLayout(this); |
1317 | - d->m_layout->setMargin(0); |
1318 | - d->m_layout->setSpacing(0); |
1319 | - setAttribute(Qt::WA_X11NetWmWindowTypeDock); |
1320 | - setAttribute(Qt::WA_Hover); |
1321 | - setAutoFillBackground(true); |
1322 | - connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(workAreaResized(int))); |
1323 | -} |
1324 | - |
1325 | -Panel::~Panel() |
1326 | -{ |
1327 | - delete d; |
1328 | -} |
1329 | - |
1330 | -void Panel::setEdge(Panel::Edge edge) |
1331 | -{ |
1332 | - d->m_edge = edge; |
1333 | - if (isVisible()) { |
1334 | - d->updateEdge(); |
1335 | - } |
1336 | -} |
1337 | - |
1338 | -Panel::Edge Panel::edge() const |
1339 | -{ |
1340 | - return d->m_edge; |
1341 | -} |
1342 | - |
1343 | -void Panel::showEvent(QShowEvent* event) |
1344 | -{ |
1345 | - QWidget::showEvent(event); |
1346 | - d->updateEdge(); |
1347 | -} |
1348 | - |
1349 | -void Panel::workAreaResized(int screen) |
1350 | -{ |
1351 | - if (this->x11Info().screen() == screen) { |
1352 | - d->updateEdge(); |
1353 | - } |
1354 | -} |
1355 | - |
1356 | -void Panel::paintEvent(QPaintEvent* event) |
1357 | -{ |
1358 | - // Necessary because Oxygen thinks it knows better what to paint in the background |
1359 | - QPainter painter(this); |
1360 | - painter.setCompositionMode(QPainter::CompositionMode_Source); |
1361 | - painter.fillRect(rect(), palette().brush(QPalette::Background)); |
1362 | -} |
1363 | - |
1364 | -void Panel::addWidget(QWidget* widget) |
1365 | -{ |
1366 | - d->m_layout->addWidget(widget); |
1367 | -} |
1368 | - |
1369 | -void Panel::addSpacer() |
1370 | -{ |
1371 | - d->m_layout->addStretch(); |
1372 | -} |
1373 | - |
1374 | -} // namespace |
1375 | - |
1376 | -#include "panel.moc" |
1377 | |
1378 | === removed file 'panel/lib/panel.h' |
1379 | --- panel/lib/panel.h 2011-01-15 01:41:03 +0000 |
1380 | +++ panel/lib/panel.h 1970-01-01 00:00:00 +0000 |
1381 | @@ -1,67 +0,0 @@ |
1382 | -/* |
1383 | - * This file is part of unity-2d |
1384 | - * |
1385 | - * Copyright 2010 Canonical Ltd. |
1386 | - * |
1387 | - * Authors: |
1388 | - * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
1389 | - * |
1390 | - * This program is free software; you can redistribute it and/or modify |
1391 | - * it under the terms of the GNU Lesser General Public License as published |
1392 | - * by the Free Software Foundation; version 3. |
1393 | - * |
1394 | - * This program is distributed in the hope that it will be useful, |
1395 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1396 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1397 | - * GNU Lesser General Public License for more details. |
1398 | - * |
1399 | - * You should have received a copy of the GNU Lesser General Public License |
1400 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1401 | - */ |
1402 | - |
1403 | -#ifndef PANEL_H |
1404 | -#define PANEL_H |
1405 | - |
1406 | -// Local |
1407 | - |
1408 | -// Qt |
1409 | -#include <QWidget> |
1410 | - |
1411 | -namespace Unity2d |
1412 | -{ |
1413 | - |
1414 | -struct PanelPrivate; |
1415 | -class Panel : public QWidget |
1416 | -{ |
1417 | -Q_OBJECT |
1418 | -public: |
1419 | - enum Edge { |
1420 | - LeftEdge, |
1421 | - TopEdge |
1422 | - }; |
1423 | - |
1424 | - Panel(QWidget* parent = 0); |
1425 | - ~Panel(); |
1426 | - |
1427 | - void setEdge(Edge); |
1428 | - Edge edge() const; |
1429 | - |
1430 | - void addWidget(QWidget*); |
1431 | - |
1432 | - void addSpacer(); |
1433 | - |
1434 | -protected: |
1435 | - virtual void showEvent(QShowEvent*); |
1436 | - virtual void paintEvent(QPaintEvent*); |
1437 | - |
1438 | -private: |
1439 | - Q_DISABLE_COPY(Panel) |
1440 | - PanelPrivate* const d; |
1441 | - |
1442 | -protected Q_SLOTS: |
1443 | - void workAreaResized(int screen); |
1444 | -}; |
1445 | - |
1446 | -} // namespace |
1447 | - |
1448 | -#endif /* PANEL_H */ |
1449 | |
1450 | === modified file 'panel/tests/CMakeLists.txt' |
1451 | --- panel/tests/CMakeLists.txt 2011-01-06 13:04:35 +0000 |
1452 | +++ panel/tests/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
1453 | @@ -7,18 +7,18 @@ |
1454 | target_link_libraries(${_test} |
1455 | ${QT_QTTEST_LIBRARIES} |
1456 | uqapplets |
1457 | - uqpanel |
1458 | ) |
1459 | set(_test_list "${_test_list};${_test}") |
1460 | endforeach(_test) |
1461 | |
1462 | add_custom_target(panel_check COMMAND ${CMAKE_CTEST_COMMAND} --verbose |
1463 | DEPENDS ${_test_list}) |
1464 | + add_dependencies(check panel_check) |
1465 | endmacro(panel_tests) |
1466 | |
1467 | include_directories( |
1468 | - ${CMAKE_CURRENT_SOURCE_DIR}/../lib |
1469 | - ${CMAKE_CURRENT_SOURCE_DIR}/../applets/homebutton |
1470 | + ${uqapplets_SOURCE_DIR}/homebutton |
1471 | + ${uqapplets_SOURCE_DIR}/common |
1472 | ${CMAKE_CURRENT_BINARY_DIR} |
1473 | ${QT_QTTEST_INCLUDE_DIR} |
1474 | ) |
1475 | @@ -26,7 +26,5 @@ |
1476 | enable_testing() |
1477 | |
1478 | panel_tests( |
1479 | - paneltest |
1480 | homebuttonapplettest |
1481 | - keyboardmodifiersmonitortest |
1482 | ) |
1483 | |
1484 | === removed file 'panel/tests/paneltest.cpp' |
1485 | --- panel/tests/paneltest.cpp 2011-01-15 01:41:03 +0000 |
1486 | +++ panel/tests/paneltest.cpp 1970-01-01 00:00:00 +0000 |
1487 | @@ -1,84 +0,0 @@ |
1488 | -/* |
1489 | - * This file is part of unity-2d |
1490 | - * |
1491 | - * Copyright 2010 Canonical Ltd. |
1492 | - * |
1493 | - * Authors: |
1494 | - * - Aurélien Gâteau <aurelien.gateau@canonical.com> |
1495 | - * |
1496 | - * This program is free software; you can redistribute it and/or modify |
1497 | - * it under the terms of the GNU General Public License as published by |
1498 | - * the Free Software Foundation; version 3. |
1499 | - * |
1500 | - * This program is distributed in the hope that it will be useful, |
1501 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1502 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1503 | - * GNU General Public License for more details. |
1504 | - * |
1505 | - * You should have received a copy of the GNU General Public License |
1506 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1507 | - */ |
1508 | - |
1509 | -// Local |
1510 | -#include <panel.h> |
1511 | - |
1512 | -// Qt |
1513 | -#include <QApplication> |
1514 | -#include <QDesktopWidget> |
1515 | -#include <QtTestGui> |
1516 | - |
1517 | -using namespace Unity2d; |
1518 | - |
1519 | -class PanelTest : public QObject |
1520 | -{ |
1521 | - Q_OBJECT |
1522 | -private Q_SLOTS: |
1523 | - void testSetEdge() |
1524 | - { |
1525 | - QRect screen = QApplication::desktop()->screenGeometry(); |
1526 | - QRect available = QApplication::desktop()->availableGeometry(); |
1527 | - |
1528 | - Panel panel; |
1529 | - panel.setFixedHeight(16); |
1530 | - panel.setEdge(Panel::TopEdge); |
1531 | - panel.show(); |
1532 | - QTest::qWait(500); |
1533 | - |
1534 | - QRect expectedGeometry = QRect(screen.left(), screen.top(), screen.width(), 16); |
1535 | - QCOMPARE(panel.geometry(), expectedGeometry); |
1536 | - QCOMPARE(QApplication::desktop()->availableGeometry(), available.adjusted(0, 16, 0, 0)); |
1537 | - } |
1538 | - |
1539 | - void testAddQWidget() |
1540 | - { |
1541 | - Panel panel; |
1542 | - QWidget* widget1 = new QWidget; |
1543 | - QWidget* widget2 = new QWidget; |
1544 | - panel.addWidget(widget1); |
1545 | - panel.addWidget(widget2); |
1546 | - panel.show(); |
1547 | - |
1548 | - QCOMPARE(widget1->geometry(), QRect(0, 0, panel.width() / 2, panel.height())); |
1549 | - QCOMPARE(widget2->geometry(), QRect(panel.width() / 2, 0, panel.width() / 2, panel.height())); |
1550 | - } |
1551 | - |
1552 | - void testAddSpacer() |
1553 | - { |
1554 | - Panel panel; |
1555 | - QWidget* widget1 = new QWidget; |
1556 | - widget1->setFixedWidth(100); |
1557 | - QWidget* widget2 = new QWidget; |
1558 | - widget2->setFixedWidth(200); |
1559 | - panel.addWidget(widget1); |
1560 | - panel.addSpacer(); |
1561 | - panel.addWidget(widget2); |
1562 | - panel.show(); |
1563 | - |
1564 | - QCOMPARE(widget1->geometry(), QRect(0, 0, 100, panel.height())); |
1565 | - QCOMPARE(widget2->geometry(), QRect(panel.width() - 200, 0, 200, panel.height())); |
1566 | - } |
1567 | -}; |
1568 | - |
1569 | -QTEST_MAIN(PanelTest) |
1570 | - |
1571 | -#include "paneltest.moc" |
1572 | |
1573 | === modified file 'places/CMakeLists.txt' |
1574 | --- places/CMakeLists.txt 2011-01-14 20:42:44 +0000 |
1575 | +++ places/CMakeLists.txt 2011-01-27 16:58:50 +0000 |
1576 | @@ -2,7 +2,6 @@ |
1577 | |
1578 | # Source |
1579 | add_subdirectory(app) |
1580 | -add_subdirectory(UnityPlaces) |
1581 | |
1582 | file(GLOB places_QML *.qml *.js) |
1583 | |
1584 | |
1585 | === modified file 'places/GnomeBackground.qml' |
1586 | --- places/GnomeBackground.qml 2011-01-20 04:29:08 +0000 |
1587 | +++ places/GnomeBackground.qml 2011-01-27 16:58:50 +0000 |
1588 | @@ -1,7 +1,7 @@ |
1589 | import Qt 4.7 |
1590 | import gconf 1.0 |
1591 | /* Necessary to access the blended image provider and CacheEffect */ |
1592 | -import UnityPlaces 1.0 |
1593 | +import Unity2d 1.0 |
1594 | |
1595 | Item { |
1596 | property string overlay_color |
1597 | |
1598 | === modified file 'places/Home.qml' |
1599 | --- places/Home.qml 2011-01-06 23:19:27 +0000 |
1600 | +++ places/Home.qml 2011-01-27 16:58:50 +0000 |
1601 | @@ -1,6 +1,6 @@ |
1602 | import Qt 4.7 |
1603 | import UnityApplications 1.0 /* Necessary for the ImageProvider serving image://icons/theme_name/icon_name */ |
1604 | -import UnityPlaces 1.0 /* Necessary for QSortFilterProxyModelQML */ |
1605 | +import Unity2d 1.0 /* Necessary for QSortFilterProxyModelQML */ |
1606 | import gconf 1.0 |
1607 | |
1608 | Item { |
1609 | |
1610 | === modified file 'places/PlaceEntryView.qml' |
1611 | --- places/PlaceEntryView.qml 2011-01-07 05:47:18 +0000 |
1612 | +++ places/PlaceEntryView.qml 2011-01-27 16:58:50 +0000 |
1613 | @@ -1,5 +1,5 @@ |
1614 | import Qt 4.7 |
1615 | -import UnityPlaces 1.0 /* Necessary for QSortFilterProxyModelQML */ |
1616 | +import Unity2d 1.0 /* Necessary for QSortFilterProxyModelQML */ |
1617 | |
1618 | Item { |
1619 | id: placeEntryView |
1620 | |
1621 | === modified file 'places/RendererGrid.qml' |
1622 | --- places/RendererGrid.qml 2011-01-07 05:47:50 +0000 |
1623 | +++ places/RendererGrid.qml 2011-01-27 16:58:50 +0000 |
1624 | @@ -1,6 +1,5 @@ |
1625 | import Qt 4.7 |
1626 | import UnityApplications 1.0 /* Necessary for the ImageProvider serving image://icons */ |
1627 | -import UnityPlaces 1.0 |
1628 | |
1629 | /* Renderers typically use a grid layout to render the model. The RendererGrid |
1630 | component provides a standard implementation of such a layout where the |
1631 | |
1632 | === removed directory 'places/UnityPlaces' |
1633 | === removed file 'places/UnityPlaces/qdbusconnectionqml.cpp' |
1634 | --- places/UnityPlaces/qdbusconnectionqml.cpp 2011-01-15 01:41:03 +0000 |
1635 | +++ places/UnityPlaces/qdbusconnectionqml.cpp 1970-01-01 00:00:00 +0000 |
1636 | @@ -1,67 +0,0 @@ |
1637 | -/* |
1638 | - * Copyright (C) 2010 Canonical, Ltd. |
1639 | - * |
1640 | - * This program is free software; you can redistribute it and/or modify |
1641 | - * it under the terms of the GNU General Public License as published by |
1642 | - * the Free Software Foundation; version 3. |
1643 | - * |
1644 | - * This program is distributed in the hope that it will be useful, |
1645 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1646 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1647 | - * GNU General Public License for more details. |
1648 | - * |
1649 | - * You should have received a copy of the GNU General Public License |
1650 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1651 | - */ |
1652 | - |
1653 | -#include "qdbusconnectionqml.h" |
1654 | - |
1655 | -QDBusConnectionQML::QDBusConnectionQML(QObject *parent) : QObject(parent), m_interface(NULL) |
1656 | -{ |
1657 | - QObject::connect(this, SIGNAL(objectPathChanged(QString)), this, SLOT(connectToDBus())); |
1658 | - QObject::connect(this, SIGNAL(serviceChanged(QString)), this, SLOT(connectToDBus())); |
1659 | -} |
1660 | - |
1661 | -QDBusConnectionQML::~QDBusConnectionQML() |
1662 | -{ |
1663 | - if (m_interface != NULL) |
1664 | - delete m_interface; |
1665 | -} |
1666 | - |
1667 | -QString |
1668 | -QDBusConnectionQML::objectPath() const |
1669 | -{ |
1670 | - return m_objectPath; |
1671 | -} |
1672 | - |
1673 | -QString |
1674 | -QDBusConnectionQML::service() const |
1675 | -{ |
1676 | - return m_service; |
1677 | -} |
1678 | - |
1679 | -void |
1680 | -QDBusConnectionQML::setObjectPath(QString objectPath) |
1681 | -{ |
1682 | - m_objectPath = objectPath; |
1683 | - emit objectPathChanged(m_objectPath); |
1684 | -} |
1685 | - |
1686 | -void |
1687 | -QDBusConnectionQML::setService(QString service) |
1688 | -{ |
1689 | - m_service = service; |
1690 | - emit serviceChanged(m_service); |
1691 | -} |
1692 | - |
1693 | -void |
1694 | -QDBusConnectionQML::connectToDBus() |
1695 | -{ |
1696 | - if (m_interface != NULL) |
1697 | - delete m_interface; |
1698 | - |
1699 | - if (m_service.isEmpty() || m_objectPath.isEmpty()) |
1700 | - return; |
1701 | - |
1702 | - m_interface = new QDBusInterface(m_service, m_objectPath); |
1703 | -} |
1704 | |
1705 | === removed file 'places/UnityPlaces/qdbusconnectionqml.h' |
1706 | --- places/UnityPlaces/qdbusconnectionqml.h 2011-01-15 01:41:03 +0000 |
1707 | +++ places/UnityPlaces/qdbusconnectionqml.h 1970-01-01 00:00:00 +0000 |
1708 | @@ -1,56 +0,0 @@ |
1709 | -/* |
1710 | - * Copyright (C) 2010 Canonical, Ltd. |
1711 | - * |
1712 | - * This program is free software; you can redistribute it and/or modify |
1713 | - * it under the terms of the GNU General Public License as published by |
1714 | - * the Free Software Foundation; version 3. |
1715 | - * |
1716 | - * This program is distributed in the hope that it will be useful, |
1717 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1718 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1719 | - * GNU General Public License for more details. |
1720 | - * |
1721 | - * You should have received a copy of the GNU General Public License |
1722 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1723 | - */ |
1724 | - |
1725 | -#ifndef QDBUSCONNECTIONQML_H |
1726 | -#define QDBUSCONNECTIONQML_H |
1727 | - |
1728 | -#include <QObject> |
1729 | -#include <QDBusInterface> |
1730 | - |
1731 | -class QDBusConnectionQML : public QObject |
1732 | -{ |
1733 | - Q_OBJECT |
1734 | - |
1735 | - Q_PROPERTY(QString objectPath READ objectPath WRITE setObjectPath NOTIFY objectPathChanged) |
1736 | - Q_PROPERTY(QString service READ service WRITE setService NOTIFY serviceChanged) |
1737 | - |
1738 | -public: |
1739 | - QDBusConnectionQML(QObject *parent = 0); |
1740 | - ~QDBusConnectionQML(); |
1741 | - |
1742 | - /* getters */ |
1743 | - QString objectPath() const; |
1744 | - QString service() const; |
1745 | - |
1746 | - /* setters */ |
1747 | - void setObjectPath(QString objectPath); |
1748 | - void setService(QString service); |
1749 | - |
1750 | -private slots: |
1751 | - void connectToDBus(); |
1752 | - |
1753 | -signals: |
1754 | - void objectPathChanged(QString); |
1755 | - void serviceChanged(QString); |
1756 | - |
1757 | -protected: |
1758 | - QString m_service; |
1759 | - QString m_objectPath; |
1760 | - QDBusInterface* m_interface; |
1761 | -}; |
1762 | - |
1763 | -#endif |
1764 | - |
1765 | |
1766 | === removed file 'places/UnityPlaces/unity_place.h' |
1767 | --- places/UnityPlaces/unity_place.h 2011-01-15 01:41:03 +0000 |
1768 | +++ places/UnityPlaces/unity_place.h 1970-01-01 00:00:00 +0000 |
1769 | @@ -1,140 +0,0 @@ |
1770 | -/* |
1771 | - * Copyright (C) 2010 Canonical, Ltd. |
1772 | - * |
1773 | - * This program is free software; you can redistribute it and/or modify |
1774 | - * it under the terms of the GNU General Public License as published by |
1775 | - * the Free Software Foundation; version 3. |
1776 | - * |
1777 | - * This program is distributed in the hope that it will be useful, |
1778 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1779 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1780 | - * GNU General Public License for more details. |
1781 | - * |
1782 | - * You should have received a copy of the GNU General Public License |
1783 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1784 | - */ |
1785 | - |
1786 | -#ifndef UNITY_PLACE_H |
1787 | -#define UNITY_PLACE_H |
1788 | - |
1789 | -#include <QDBusConnection> |
1790 | -#include <QDBusReply> |
1791 | -#include <QDebug> |
1792 | -#include <QDBusMetaType> |
1793 | - |
1794 | -#include "qdbusconnectionqml.h" |
1795 | - |
1796 | - |
1797 | -class UnityPlace : public QDBusConnectionQML |
1798 | -{ |
1799 | - Q_OBJECT |
1800 | - |
1801 | - |
1802 | - |
1803 | -public: |
1804 | - UnityPlace(QObject *parent = 0) : QDBusConnectionQML(parent) |
1805 | - { |
1806 | - |
1807 | - QObject::connect(this, SIGNAL(objectPathChanged(QString)), this, SLOT(connectSignals())); |
1808 | - QObject::connect(this, SIGNAL(serviceChanged(QString)), this, SLOT(connectSignals())); |
1809 | - } |
1810 | - |
1811 | - ~UnityPlace() |
1812 | - { |
1813 | - } |
1814 | - |
1815 | - Q_SLOT void connectSignals() |
1816 | - { |
1817 | - // FIXME: missing disconnection |
1818 | - if(m_service.isEmpty() || m_objectPath.isEmpty()) |
1819 | - return; |
1820 | - |
1821 | - QObject::connect(m_interface, SIGNAL(EntryRemoved(QString)), this, SIGNAL(entryRemoved(QString))); |
1822 | - } |
1823 | - |
1824 | - Q_INVOKABLE inline QString Introspect() |
1825 | - { |
1826 | - if (m_interface == NULL) |
1827 | - return QString(); |
1828 | - |
1829 | - QList<QVariant> argumentList; |
1830 | - |
1831 | - QDBusReply<QString> reply = m_interface->callWithArgumentList(QDBus::Block, "Introspect", argumentList); |
1832 | - if (!reply.isValid()) |
1833 | - { |
1834 | - qWarning() << reply.error(); |
1835 | - return QString(); |
1836 | - } |
1837 | - return reply.value(); |
1838 | - } |
1839 | - Q_INVOKABLE inline QVariant Get(QString interface, QString propname) |
1840 | - { |
1841 | - if (m_interface == NULL) |
1842 | - return QVariant(); |
1843 | - |
1844 | - QList<QVariant> argumentList; |
1845 | - argumentList << qVariantFromValue(interface); |
1846 | - argumentList << qVariantFromValue(propname); |
1847 | - |
1848 | - QDBusReply<QVariant> reply = m_interface->callWithArgumentList(QDBus::Block, "Get", argumentList); |
1849 | - if (!reply.isValid()) |
1850 | - { |
1851 | - qWarning() << reply.error(); |
1852 | - return QVariant(); |
1853 | - } |
1854 | - return reply.value(); |
1855 | - } |
1856 | - Q_INVOKABLE inline void Set(QString interface, QString propname, QVariant value) |
1857 | - { |
1858 | - if (m_interface == NULL) |
1859 | - return; |
1860 | - |
1861 | - QList<QVariant> argumentList; |
1862 | - argumentList << qVariantFromValue(interface); |
1863 | - argumentList << qVariantFromValue(propname); |
1864 | - argumentList << qVariantFromValue(value); |
1865 | - |
1866 | - QDBusReply<void> reply = m_interface->callWithArgumentList(QDBus::Block, "Set", argumentList); |
1867 | - if (!reply.isValid()) |
1868 | - { |
1869 | - qWarning() << reply.error(); |
1870 | - return; |
1871 | - } |
1872 | - } |
1873 | - Q_INVOKABLE inline QHash<QString, QVariant> GetAll(QString interface) |
1874 | - { |
1875 | - if (m_interface == NULL) |
1876 | - return QHash<QString, QVariant>(); |
1877 | - |
1878 | - QList<QVariant> argumentList; |
1879 | - argumentList << qVariantFromValue(interface); |
1880 | - |
1881 | - QDBusReply<QHash<QString, QVariant>> reply = m_interface->callWithArgumentList(QDBus::Block, "GetAll", argumentList); |
1882 | - if (!reply.isValid()) |
1883 | - { |
1884 | - qWarning() << reply.error(); |
1885 | - return QHash<QString, QVariant>(); |
1886 | - } |
1887 | - return reply.value(); |
1888 | - } |
1889 | - Q_INVOKABLE inline uint Activate(QString uri) |
1890 | - { |
1891 | - if (m_interface == NULL) |
1892 | - return uint(); |
1893 | - |
1894 | - QList<QVariant> argumentList; |
1895 | - argumentList << qVariantFromValue(uri); |
1896 | - |
1897 | - QDBusReply<uint> reply = m_interface->callWithArgumentList(QDBus::Block, "Activate", argumentList); |
1898 | - if (!reply.isValid()) |
1899 | - { |
1900 | - qWarning() << reply.error(); |
1901 | - return uint(); |
1902 | - } |
1903 | - return reply.value(); |
1904 | - } |
1905 | - |
1906 | -Q_SIGNALS: |
1907 | - void entryRemoved(QString); |
1908 | -}; |
1909 | -#endif |
1910 | |
1911 | === removed file 'places/UnityPlaces/unity_place.xml' |
1912 | --- places/UnityPlaces/unity_place.xml 2010-10-17 05:04:46 +0000 |
1913 | +++ places/UnityPlaces/unity_place.xml 1970-01-01 00:00:00 +0000 |
1914 | @@ -1,38 +0,0 @@ |
1915 | -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> |
1916 | -<node> |
1917 | -<interface name="org.freedesktop.DBus.Introspectable"> |
1918 | - <method name="Introspect"> |
1919 | - <arg name="data" direction="out" type="s"/> |
1920 | - </method> |
1921 | -</interface> |
1922 | -<interface name="org.freedesktop.DBus.Properties"> |
1923 | - <method name="Get"> |
1924 | - <arg name="interface" direction="in" type="s"/> |
1925 | - <arg name="propname" direction="in" type="s"/> |
1926 | - <arg name="value" direction="out" type="v"/> |
1927 | - </method> |
1928 | - <method name="Set"> |
1929 | - <arg name="interface" direction="in" type="s"/> |
1930 | - <arg name="propname" direction="in" type="s"/> |
1931 | - <arg name="value" direction="in" type="v"/> |
1932 | - </method> |
1933 | - <method name="GetAll"> |
1934 | - <arg name="interface" direction="in" type="s"/> |
1935 | - <arg name="props" direction="out" type="a{sv}"/> |
1936 | - </method> |
1937 | -</interface> |
1938 | -<interface name="com.canonical.Unity.Place"> |
1939 | - <signal name="EntryRemoved"> |
1940 | - <arg name="entry_dbus_path" type="s"/> |
1941 | - </signal> |
1942 | -</interface> |
1943 | -<interface name="com.canonical.Unity.Activation"> |
1944 | - <method name="Activate"> |
1945 | - <arg name="uri" type="s" direction="in"/> |
1946 | - <arg name="result" type="u" direction="out"/> |
1947 | - </method> |
1948 | -</interface> |
1949 | -<node name="browser"/> |
1950 | -<node name="files"/> |
1951 | -</node> |
1952 | - |
1953 | |
1954 | === removed file 'places/UnityPlaces/unity_place_entry.h' |
1955 | --- places/UnityPlaces/unity_place_entry.h 2011-01-15 01:41:03 +0000 |
1956 | +++ places/UnityPlaces/unity_place_entry.h 1970-01-01 00:00:00 +0000 |
1957 | @@ -1,144 +0,0 @@ |
1958 | -/* |
1959 | - * Copyright (C) 2010 Canonical, Ltd. |
1960 | - * |
1961 | - * This program is free software; you can redistribute it and/or modify |
1962 | - * it under the terms of the GNU General Public License as published by |
1963 | - * the Free Software Foundation; version 3. |
1964 | - * |
1965 | - * This program is distributed in the hope that it will be useful, |
1966 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1967 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1968 | - * GNU General Public License for more details. |
1969 | - * |
1970 | - * You should have received a copy of the GNU General Public License |
1971 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1972 | - */ |
1973 | - |
1974 | -#ifndef UNITY_PLACE_ENTRY_H |
1975 | -#define UNITY_PLACE_ENTRY_H |
1976 | - |
1977 | -#include <QDBusConnection> |
1978 | -#include <QDBusReply> |
1979 | -#include <QDebug> |
1980 | -#include <QDBusMetaType> |
1981 | - |
1982 | -#include "qdbusconnectionqml.h" |
1983 | - |
1984 | - |
1985 | -typedef QHash<QString, QString> QHashQStringQString; |
1986 | -Q_DECLARE_METATYPE(QHashQStringQString) |
1987 | - |
1988 | -class UnityPlaceEntry : public QDBusConnectionQML |
1989 | -{ |
1990 | - Q_OBJECT |
1991 | - |
1992 | - |
1993 | - |
1994 | -public: |
1995 | - UnityPlaceEntry(QObject *parent = 0) : QDBusConnectionQML(parent) |
1996 | - { |
1997 | - qDBusRegisterMetaType<QHashQStringQString>(); |
1998 | - |
1999 | - QObject::connect(this, SIGNAL(objectPathChanged(QString)), this, SLOT(connectSignals())); |
2000 | - QObject::connect(this, SIGNAL(serviceChanged(QString)), this, SLOT(connectSignals())); |
2001 | - } |
2002 | - |
2003 | - ~UnityPlaceEntry() |
2004 | - { |
2005 | - } |
2006 | - |
2007 | - Q_SLOT void connectSignals() |
2008 | - { |
2009 | - // FIXME: missing disconnection |
2010 | - if(m_service.isEmpty() || m_objectPath.isEmpty()) |
2011 | - return; |
2012 | - |
2013 | - QObject::connect(m_interface, SIGNAL(EntryRendererInfoChanged()), this, SIGNAL(entryRendererInfoChanged())); |
2014 | - QObject::connect(m_interface, SIGNAL(GlobalRendererInfoChanged()), this, SIGNAL(globalRendererInfoChanged())); |
2015 | - QObject::connect(m_interface, SIGNAL(PlaceEntryInfoChanged()), this, SIGNAL(placeEntryInfoChanged())); |
2016 | - } |
2017 | - |
2018 | - Q_INVOKABLE inline QString Introspect() |
2019 | - { |
2020 | - if (m_interface == NULL) |
2021 | - return QString(); |
2022 | - |
2023 | - QList<QVariant> argumentList; |
2024 | - |
2025 | - QDBusReply<QString> reply = m_interface->callWithArgumentList(QDBus::Block, "Introspect", argumentList); |
2026 | - if (!reply.isValid()) |
2027 | - { |
2028 | - qWarning() << reply.error(); |
2029 | - return QString(); |
2030 | - } |
2031 | - return reply.value(); |
2032 | - } |
2033 | - Q_INVOKABLE inline void SetGlobalSearch(QString search, QHashQStringQString hints) |
2034 | - { |
2035 | - if (m_interface == NULL) |
2036 | - return; |
2037 | - |
2038 | - QList<QVariant> argumentList; |
2039 | - argumentList << qVariantFromValue(search); |
2040 | - argumentList << qVariantFromValue(hints); |
2041 | - |
2042 | - QDBusReply<void> reply = m_interface->callWithArgumentList(QDBus::Block, "SetGlobalSearch", argumentList); |
2043 | - if (!reply.isValid()) |
2044 | - { |
2045 | - qWarning() << reply.error(); |
2046 | - return; |
2047 | - } |
2048 | - } |
2049 | - Q_INVOKABLE inline void SetSearch(QString search, QHashQStringQString hints) |
2050 | - { |
2051 | - if (m_interface == NULL) |
2052 | - return; |
2053 | - |
2054 | - QList<QVariant> argumentList; |
2055 | - argumentList << qVariantFromValue(search); |
2056 | - argumentList << qVariantFromValue(hints); |
2057 | - |
2058 | - QDBusReply<void> reply = m_interface->callWithArgumentList(QDBus::Block, "SetSearch", argumentList); |
2059 | - if (!reply.isValid()) |
2060 | - { |
2061 | - qWarning() << reply.error(); |
2062 | - return; |
2063 | - } |
2064 | - } |
2065 | - Q_INVOKABLE inline void SetActive(bool is_active) |
2066 | - { |
2067 | - if (m_interface == NULL) |
2068 | - return; |
2069 | - |
2070 | - QList<QVariant> argumentList; |
2071 | - argumentList << qVariantFromValue(is_active); |
2072 | - |
2073 | - QDBusReply<void> reply = m_interface->callWithArgumentList(QDBus::Block, "SetActive", argumentList); |
2074 | - if (!reply.isValid()) |
2075 | - { |
2076 | - qWarning() << reply.error(); |
2077 | - return; |
2078 | - } |
2079 | - } |
2080 | - Q_INVOKABLE inline void SetActiveSection(uint section_id) |
2081 | - { |
2082 | - if (m_interface == NULL) |
2083 | - return; |
2084 | - |
2085 | - QList<QVariant> argumentList; |
2086 | - argumentList << qVariantFromValue(section_id); |
2087 | - |
2088 | - QDBusReply<void> reply = m_interface->callWithArgumentList(QDBus::Block, "SetActiveSection", argumentList); |
2089 | - if (!reply.isValid()) |
2090 | - { |
2091 | - qWarning() << reply.error(); |
2092 | - return; |
2093 | - } |
2094 | - } |
2095 | - |
2096 | -Q_SIGNALS: |
2097 | - void entryRendererInfoChanged(); |
2098 | - void globalRendererInfoChanged(); |
2099 | - void placeEntryInfoChanged(); |
2100 | -}; |
2101 | -#endif |
2102 | |
2103 | === removed file 'places/UnityPlaces/unity_place_entry.xml' |
2104 | --- places/UnityPlaces/unity_place_entry.xml 2010-10-17 03:53:34 +0000 |
2105 | +++ places/UnityPlaces/unity_place_entry.xml 1970-01-01 00:00:00 +0000 |
2106 | @@ -1,35 +0,0 @@ |
2107 | -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> |
2108 | -<node> |
2109 | -<interface name="org.freedesktop.DBus.Introspectable"> |
2110 | - <method name="Introspect"> |
2111 | - <arg name="data" direction="out" type="s"/> |
2112 | - </method> |
2113 | -</interface> |
2114 | - |
2115 | -<interface name="com.canonical.Unity.PlaceEntry"> |
2116 | - <method name="SetGlobalSearch"> |
2117 | - <arg name="search" type="s" direction="in"/> |
2118 | - <arg name="hints" type="a{ss}" direction="in"/> |
2119 | - </method> |
2120 | - <method name="SetSearch"> |
2121 | - <arg name="search" type="s" direction="in"/> |
2122 | - <arg name="hints" type="a{ss}" direction="in"/> |
2123 | - </method> |
2124 | - <method name="SetActive"> |
2125 | - <arg name="is_active" type="b" direction="in"/> |
2126 | - </method> |
2127 | - <method name="SetActiveSection"> |
2128 | - <arg name="section_id" type="u" direction="in"/> |
2129 | - </method> |
2130 | - <signal name="EntryRendererInfoChanged"> |
2131 | - <arg name="renderer_info" type="(sssa{ss})"/> |
2132 | - </signal> |
2133 | - <signal name="GlobalRendererInfoChanged"> |
2134 | - <arg name="renderer_info" type="(sssa{ss})"/> |
2135 | - </signal> |
2136 | - <signal name="PlaceEntryInfoChanged"> |
2137 | - <arg name="entry_info_data" type="(sssuasbsa{ss})"/> |
2138 | - </signal> |
2139 | -</interface> |
2140 | -</node> |
2141 | - |
2142 | |
2143 | === modified file 'places/app/places.cpp' |
2144 | --- places/app/places.cpp 2011-01-22 03:55:39 +0000 |
2145 | +++ places/app/places.cpp 2011-01-27 16:58:50 +0000 |
2146 | @@ -127,6 +127,8 @@ |
2147 | /* Place.qml imports UnityApplications, which is part of the launcher |
2148 | component… */ |
2149 | view.engine()->addImportPath(unity2dDirectory() + "/launcher/"); |
2150 | + /* Place.qml imports Unity2d */ |
2151 | + view.engine()->addImportPath(unity2dDirectory() + "/libunity-2d/"); |
2152 | } |
2153 | |
2154 | /* Load the QML UI, focus and show the window */ |
2155 | |
2156 | === modified file 'spread/GnomeBackground.qml' |
2157 | --- spread/GnomeBackground.qml 2011-01-20 04:29:08 +0000 |
2158 | +++ spread/GnomeBackground.qml 2011-01-27 16:58:50 +0000 |
2159 | @@ -1,7 +1,7 @@ |
2160 | import Qt 4.7 |
2161 | import gconf 1.0 |
2162 | /* Necessary to access the blended image provider and CacheEffect */ |
2163 | -import UnityPlaces 1.0 |
2164 | +import Unity2d 1.0 |
2165 | |
2166 | Item { |
2167 | property string overlay_color |
2168 | |
2169 | === modified file 'spread/Spread.qml' |
2170 | --- spread/Spread.qml 2011-01-10 13:41:02 +0000 |
2171 | +++ spread/Spread.qml 2011-01-27 16:58:50 +0000 |
2172 | @@ -1,6 +1,6 @@ |
2173 | import Qt 4.7 |
2174 | import UnityApplications 1.0 |
2175 | -import UnityPlaces 1.0 |
2176 | +import Unity2d 1.0 |
2177 | |
2178 | /* The main component that manages the spread. |
2179 | This only acts as an outer shell, the actual logic is pretty much all in SpreadLayout.qml |
2180 | |
2181 | === modified file 'spread/app/spread.cpp' |
2182 | --- spread/app/spread.cpp 2011-01-22 03:55:39 +0000 |
2183 | +++ spread/app/spread.cpp 2011-01-27 16:58:50 +0000 |
2184 | @@ -68,9 +68,8 @@ |
2185 | /* Spread.qml imports UnityApplications, which is part of the launcher |
2186 | component */ |
2187 | view.engine()->addImportPath(unity2dDirectory() + "/launcher/"); |
2188 | - /* Spread.qml imports UnityPlaces, which is part of the places |
2189 | - component */ |
2190 | - view.engine()->addImportPath(unity2dDirectory() + "/places/"); |
2191 | + /* Spread.qml imports Unity2d */ |
2192 | + view.engine()->addImportPath(unity2dDirectory() + "/libunity-2d/"); |
2193 | } |
2194 | |
2195 | /* This is needed by GnomeBackground.qml (see explanation in there) |
kaleo@tequila: ~/Projects/ upicek/ unity-2d$ grep -r UnityPlaces * app/spread. cpp: /* Spread.qml imports UnityPlaces, which is part of the places
spread/
UnityPlaces should not appear anymore, Unity2d replaces it.