Status: | Merged |
---|---|
Approved by: | Tom Beckmann |
Approved revision: | 389 |
Merged at revision: | 372 |
Proposed branch: | lp:~gala-dev/gala/plugins |
Merge into: | lp:gala |
Diff against target: |
5717 lines (+2964/-1489) 51 files modified
.bzrignore (+40/-0) AUTHORS (+8/-0) CMakeLists.txt (+0/-130) COPYING (+674/-0) INSTALL (+370/-18) Makefile.am (+47/-0) Makefile.common (+15/-0) autogen.sh (+40/-0) build-aux/bzr-version-gen (+62/-0) cmake/FindVala.cmake (+0/-65) cmake/GSettings.cmake (+0/-42) cmake/ParseArguments.cmake (+0/-36) cmake/README (+0/-10) cmake/README.Vala.rst (+0/-173) cmake/Tests.cmake (+0/-5) cmake/Translations.cmake (+0/-41) cmake/ValaPrecompile.cmake (+0/-187) cmake/ValaVersion.cmake (+0/-96) configure.ac (+206/-0) data/Makefile.am (+36/-0) data/org.pantheon.desktop.gala.gschema.xml.in.in (+1/-1) lib/Makefile.am (+66/-0) lib/Plugin.vala (+210/-0) lib/Utils.vala (+268/-0) lib/WindowManager.vala (+53/-0) plugins/Makefile.am (+3/-0) plugins/template/Main.vala (+118/-0) plugins/template/Makefile.am (+58/-0) plugins/template/README (+73/-0) plugins/zoom/Main.vala (+50/-23) plugins/zoom/Makefile.am (+58/-0) po/CMakeLists.txt (+0/-5) src/Background/Background.vala (+0/-2) src/Background/BackgroundCache.vala (+0/-2) src/Background/BackgroundManager.vala (+0/-2) src/Background/SlideShow.vala (+0/-2) src/Background/SystemBackground.vala (+0/-2) src/Config.vala.cmake (+0/-27) src/DBus.vala (+7/-11) src/InternalUtils.vala (+8/-199) src/Main.vala (+1/-5) src/Makefile.am (+77/-0) src/PluginManager.vala (+220/-0) src/Widgets/WindowOverview.vala (+7/-22) src/Widgets/WindowSwitcher.vala (+12/-21) src/Widgets/WorkspaceThumb.vala (+0/-19) src/Widgets/WorkspaceView.vala (+17/-85) src/WindowManager.vala (+110/-113) vapi/Makefile.am (+20/-0) vapi/config.vapi (+28/-0) vapi/libmutter.vapi (+1/-145) |
To merge this branch: | bzr merge lp:~gala-dev/gala/plugins |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rico Tzschichholz | Approve | ||
Review via email: mp+199323@code.launchpad.net |
Commit message
Add plugin support, move zoom functionality into a plugin
Description of the change
This adds plugin support to gala.
First change is a split of the current code to a libgala, which basically is just an interface to the WindowManager class with those functions we want publicly available, and the actual gala, which implements this interface.
Next we have a Plugin class, which can be implemented by plugins. Any plugin that is found at $PKGDATADIR/
The plugin class will receive an instance of the wm when it is initialized, from which it can then access the entire libmutter Plugin/
I also moved the Zooming.vala class out as a plugin to "prove" that it works. One sidenote on that, the Clutter.
- 365. By Rico Tzschichholz
-
vapi: Update mutter bindings to 3.11.4
- 366. By Rico Tzschichholz
-
build: Bump mutter requirements to their latest releases
Rico Tzschichholz (ricotz) wrote : | # |
It is probably better to split things using a private library to discourage a wider use until the API is settled to get this merged sooner?
- 367. By Rico Tzschichholz
-
vapi: Update mutter bindings to 3.11.5
- 368. By Rico Tzschichholz
-
Adjustments for mutter 3.11.5 API changes
- 369. By Tom Beckmann
-
split gala into a wm part and a library, add plugin system, move zooming out to a plugin, add a template plugin
- 370. By Cody Garver
-
Minor alignment fix in CMakeLists.txt
- 371. By Cody Garver
-
Remove using statements
- 372. By Tom Beckmann
-
Ported plugins branch to autotools based on the setup of lp:~docky-core/docky/plank-docky
Default plugins are not compiled and installed yet - 373. By Tom Beckmann
-
add build setup for default plugin
- 374. By Tom Beckmann
-
add gsettings setup based on lp:~ricotz/plank/gsettings
- 375. By Tom Beckmann
-
apply various fixes by ricotz
- 376. By Tom Beckmann
-
move -avoid-version to central variable for plugins
- 377. By Tom Beckmann
-
correct valac version, add min version requirement for libmutter, fix whitespaces
- 378. By Rico Tzschichholz
-
Fix determining the available mutter version
- 379. By Rico Tzschichholz
-
Minor clean ups
- 380. By Rico Tzschichholz
-
Merge trunk
- 381. By Rico Tzschichholz
-
Drop support for Mutter < 3.8.4
- 382. By Rico Tzschichholz
-
lib: Add missing copyright headers
- 383. By Rico Tzschichholz
-
lib: Drop obsolete cmake file
- 384. By Rico Tzschichholz
-
src: Add missing copyright headers
Rico Tzschichholz (ricotz) wrote : | # |
My concerns are gone while using a private library for now.
- 385. By Tom Beckmann
-
Fix various little problems, add track_actor functionality, add extended
plugin info allowing plugins to replace built-in componenets, allow them
to delay their load. - 386. By Tom Beckmann
-
various little fixes
- 387. By Rico Tzschichholz
-
Merge trunk r371
- 388. By Tom Beckmann
-
make region gathering code nicer
- 389. By Tom Beckmann
-
fix ordering of class members, make recalculate_regions private
Rico Tzschichholz (ricotz) : | # |
Preview Diff
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2012-09-22 21:09:25 +0000 |
3 | +++ .bzrignore 2014-04-06 18:03:36 +0000 |
4 | @@ -1,1 +1,41 @@ |
5 | +aclocal.m4 |
6 | +autom4te.cache |
7 | +/build-aux/* |
8 | +ChangeLog |
9 | +config.h |
10 | +config.h.in |
11 | +config.log |
12 | +config.status |
13 | +configure |
14 | +intltool-extract.in |
15 | +intltool-merge.in |
16 | +intltool-update.in |
17 | +libtool |
18 | +m4 |
19 | +mkinstalldirs |
20 | +stamp-h1 |
21 | +Makefile |
22 | +Makefile.in |
23 | +.version |
24 | +.deps |
25 | +.dirstamp |
26 | +.libs |
27 | +*.c |
28 | +*.h |
29 | +*.lo |
30 | +*.la |
31 | +*.pc |
32 | +*.stamp |
33 | +data/gala.desktop |
34 | +data/gschemas.compiled |
35 | +data/org.pantheon.desktop.gala.gschema.valid |
36 | +data/org.pantheon.desktop.gala.gschema.xml |
37 | +data/org.pantheon.desktop.gala.gschema.xml.in |
38 | +lib/gala.vapi |
39 | +po/*.gmo |
40 | +po/.intltool-merge-cache |
41 | +po/Makefile.in.in |
42 | +po/POTFILES |
43 | +po/stamp-it |
44 | +src/gala |
45 | build |
46 | |
47 | === added file 'AUTHORS' |
48 | --- AUTHORS 1970-01-01 00:00:00 +0000 |
49 | +++ AUTHORS 2014-04-06 18:03:36 +0000 |
50 | @@ -0,0 +1,8 @@ |
51 | +Cody Garver <cody@elementaryos.org> |
52 | +Daniel Fore <daniel@elementaryos.org> |
53 | +Garden Gnome <gardengnome85@gmail.com> |
54 | +Niels Avonds <niels.avonds@gmail.com> |
55 | +Rico Tzschichholz <ricotz@ubuntu.com> |
56 | +Sergey "Shnatsel" Davidoff <sergey@elementaryos.org> |
57 | +Timo Reimerdes <sedremier@gmail.com> |
58 | +Tom Beckmann <tomjonabc@gmail.com> |
59 | |
60 | === removed file 'CMakeLists.txt' |
61 | --- CMakeLists.txt 2014-03-18 04:30:24 +0000 |
62 | +++ CMakeLists.txt 1970-01-01 00:00:00 +0000 |
63 | @@ -1,130 +0,0 @@ |
64 | -# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation |
65 | - |
66 | -project (gala) |
67 | -cmake_minimum_required (VERSION 2.8) |
68 | -cmake_policy (VERSION 2.6) |
69 | - |
70 | -list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala) |
71 | - |
72 | -# |
73 | -# Base bits |
74 | -# |
75 | - |
76 | -enable_testing () |
77 | - |
78 | -set (DATADIR "${CMAKE_INSTALL_PREFIX}/share") |
79 | -set (PKGDATADIR "${DATADIR}/gala") |
80 | -set (GETTEXT_PACKAGE "gala") |
81 | -set (RELEASE_NAME "") |
82 | -set (VERSION "0.1.0") |
83 | -set (VERSION_INFO "Release") |
84 | -set (CMAKE_C_FLAGS "-ggdb") |
85 | -set (PREFIX ${CMAKE_INSTALL_PREFIX}) |
86 | -set (DOLLAR "$") |
87 | - |
88 | -set(CPACK_SOURCE_GENERATOR "TBZ2") |
89 | -set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}") |
90 | -set(CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;~$;.bzrignore;${CPACK_SOURCE_IGNORE_FILES}") |
91 | -include(CPack) |
92 | -add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
93 | - |
94 | -list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
95 | - |
96 | -configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
97 | -add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DGNOME_DESKTOP_USE_UNSTABLE_API -w) |
98 | - |
99 | -find_package(PkgConfig) |
100 | -pkg_check_modules(DEPS REQUIRED libmutter>=3.4 granite clutter-1.0>=1.9.16 clutter-gtk-1.0 libbamf3 xfixes gee-0.8 plank gnome-desktop-3.0) |
101 | - |
102 | -set (MUTTER36_FLAGS "") |
103 | -pkg_check_modules(MUTTER36 QUIET libmutter>=3.5) |
104 | -if (MUTTER36_FOUND) |
105 | - pkg_check_modules(MUTTER36 REQUIRED libmutter>=3.6.3) |
106 | - set (MUTTER36_FLAGS "--define=HAS_MUTTER36") |
107 | -endif (MUTTER36_FOUND) |
108 | - |
109 | -set (MUTTER38_FLAGS "") |
110 | -pkg_check_modules(MUTTER38 QUIET libmutter>=3.7) |
111 | -if (MUTTER38_FOUND) |
112 | - pkg_check_modules(MUTTER38 REQUIRED libmutter>=3.8.4) |
113 | - set (MUTTER38_FLAGS "--define=HAS_MUTTER38") |
114 | -endif (MUTTER38_FOUND) |
115 | - |
116 | -set (MUTTER310_FLAGS "") |
117 | -pkg_check_modules(MUTTER310 QUIET libmutter>=3.9) |
118 | -if (MUTTER310_FOUND) |
119 | - pkg_check_modules(MUTTER310 REQUIRED libmutter>=3.10.3) |
120 | - set (MUTTER310_FLAGS "--define=HAS_MUTTER310") |
121 | -endif (MUTTER310_FOUND) |
122 | - |
123 | -set (MUTTER312_FLAGS "") |
124 | -pkg_check_modules(MUTTER312 QUIET libmutter>=3.11) |
125 | -if (MUTTER312_FOUND) |
126 | - pkg_check_modules(MUTTER310 REQUIRED libmutter>=3.11.91) |
127 | - set (MUTTER312_FLAGS "--define=HAS_MUTTER312") |
128 | -endif (MUTTER312_FOUND) |
129 | - |
130 | -add_definitions(${DEPS_CFLAGS}) |
131 | - |
132 | -link_libraries(${DEPS_LIBRARIES}) |
133 | -link_directories(${DEPS_LIBRARY_DIRS}) |
134 | - |
135 | -find_package(Vala REQUIRED) |
136 | -include(ValaVersion) |
137 | -ensure_vala_version("0.22.0" MINIMUM) |
138 | - |
139 | -include(ValaPrecompile) |
140 | -vala_precompile(VALA_C |
141 | - src/DBus.vala |
142 | - src/DragDropAction.vala |
143 | - src/Main.vala |
144 | - src/Plugin.vala |
145 | - src/ScreenSaver.vala |
146 | - src/Settings.vala |
147 | - src/TextShadowEffect.vala |
148 | - src/Utils.vala |
149 | - src/Zooming.vala |
150 | - src/Background/Background.vala |
151 | - src/Background/BackgroundCache.vala |
152 | - src/Background/BackgroundManager.vala |
153 | - src/Background/SlideShow.vala |
154 | - src/Background/SystemBackground.vala |
155 | - src/Widgets/AppIcon.vala |
156 | - src/Widgets/WindowOverview.vala |
157 | - src/Widgets/WindowSwitcher.vala |
158 | - src/Widgets/WindowThumb.vala |
159 | - src/Widgets/WorkspaceThumb.vala |
160 | - src/Widgets/WorkspaceView.vala |
161 | - ${CMAKE_BINARY_DIR}/src/Config.vala |
162 | -PACKAGES |
163 | - granite |
164 | - libbamf3 |
165 | - libmutter |
166 | - plank |
167 | - clutter-gtk-1.0 |
168 | - gdk-x11-3.0 |
169 | - gdesktopenums-3.0 |
170 | - gnome-desktop-3.0 |
171 | - xfixes-4.0 |
172 | - cogl-fixes |
173 | -OPTIONS |
174 | - -g |
175 | - --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ |
176 | - ${MUTTER36_FLAGS} |
177 | - ${MUTTER38_FLAGS} |
178 | - ${MUTTER310_FLAGS} |
179 | - ${MUTTER312_FLAGS} |
180 | - ) |
181 | - |
182 | -#add_subdirectory (po) |
183 | - |
184 | -include(GSettings) |
185 | -add_schema ("data/org.pantheon.desktop.gala.gschema.xml") |
186 | - |
187 | -add_executable(gala ${VALA_C})#src/main.c) |
188 | -target_link_libraries(gala m) |
189 | - |
190 | -install(TARGETS gala RUNTIME DESTINATION bin) |
191 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/gala.desktop DESTINATION share/applications) |
192 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/gala.css DESTINATION ${PKGDATADIR}) |
193 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/texture.png DESTINATION ${PKGDATADIR}) |
194 | |
195 | === added file 'COPYING' |
196 | --- COPYING 1970-01-01 00:00:00 +0000 |
197 | +++ COPYING 2014-04-06 18:03:36 +0000 |
198 | @@ -0,0 +1,674 @@ |
199 | + GNU GENERAL PUBLIC LICENSE |
200 | + Version 3, 29 June 2007 |
201 | + |
202 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
203 | + Everyone is permitted to copy and distribute verbatim copies |
204 | + of this license document, but changing it is not allowed. |
205 | + |
206 | + Preamble |
207 | + |
208 | + The GNU General Public License is a free, copyleft license for |
209 | +software and other kinds of works. |
210 | + |
211 | + The licenses for most software and other practical works are designed |
212 | +to take away your freedom to share and change the works. By contrast, |
213 | +the GNU General Public License is intended to guarantee your freedom to |
214 | +share and change all versions of a program--to make sure it remains free |
215 | +software for all its users. We, the Free Software Foundation, use the |
216 | +GNU General Public License for most of our software; it applies also to |
217 | +any other work released this way by its authors. You can apply it to |
218 | +your programs, too. |
219 | + |
220 | + When we speak of free software, we are referring to freedom, not |
221 | +price. Our General Public Licenses are designed to make sure that you |
222 | +have the freedom to distribute copies of free software (and charge for |
223 | +them if you wish), that you receive source code or can get it if you |
224 | +want it, that you can change the software or use pieces of it in new |
225 | +free programs, and that you know you can do these things. |
226 | + |
227 | + To protect your rights, we need to prevent others from denying you |
228 | +these rights or asking you to surrender the rights. Therefore, you have |
229 | +certain responsibilities if you distribute copies of the software, or if |
230 | +you modify it: responsibilities to respect the freedom of others. |
231 | + |
232 | + For example, if you distribute copies of such a program, whether |
233 | +gratis or for a fee, you must pass on to the recipients the same |
234 | +freedoms that you received. You must make sure that they, too, receive |
235 | +or can get the source code. And you must show them these terms so they |
236 | +know their rights. |
237 | + |
238 | + Developers that use the GNU GPL protect your rights with two steps: |
239 | +(1) assert copyright on the software, and (2) offer you this License |
240 | +giving you legal permission to copy, distribute and/or modify it. |
241 | + |
242 | + For the developers' and authors' protection, the GPL clearly explains |
243 | +that there is no warranty for this free software. For both users' and |
244 | +authors' sake, the GPL requires that modified versions be marked as |
245 | +changed, so that their problems will not be attributed erroneously to |
246 | +authors of previous versions. |
247 | + |
248 | + Some devices are designed to deny users access to install or run |
249 | +modified versions of the software inside them, although the manufacturer |
250 | +can do so. This is fundamentally incompatible with the aim of |
251 | +protecting users' freedom to change the software. The systematic |
252 | +pattern of such abuse occurs in the area of products for individuals to |
253 | +use, which is precisely where it is most unacceptable. Therefore, we |
254 | +have designed this version of the GPL to prohibit the practice for those |
255 | +products. If such problems arise substantially in other domains, we |
256 | +stand ready to extend this provision to those domains in future versions |
257 | +of the GPL, as needed to protect the freedom of users. |
258 | + |
259 | + Finally, every program is threatened constantly by software patents. |
260 | +States should not allow patents to restrict development and use of |
261 | +software on general-purpose computers, but in those that do, we wish to |
262 | +avoid the special danger that patents applied to a free program could |
263 | +make it effectively proprietary. To prevent this, the GPL assures that |
264 | +patents cannot be used to render the program non-free. |
265 | + |
266 | + The precise terms and conditions for copying, distribution and |
267 | +modification follow. |
268 | + |
269 | + TERMS AND CONDITIONS |
270 | + |
271 | + 0. Definitions. |
272 | + |
273 | + "This License" refers to version 3 of the GNU General Public License. |
274 | + |
275 | + "Copyright" also means copyright-like laws that apply to other kinds of |
276 | +works, such as semiconductor masks. |
277 | + |
278 | + "The Program" refers to any copyrightable work licensed under this |
279 | +License. Each licensee is addressed as "you". "Licensees" and |
280 | +"recipients" may be individuals or organizations. |
281 | + |
282 | + To "modify" a work means to copy from or adapt all or part of the work |
283 | +in a fashion requiring copyright permission, other than the making of an |
284 | +exact copy. The resulting work is called a "modified version" of the |
285 | +earlier work or a work "based on" the earlier work. |
286 | + |
287 | + A "covered work" means either the unmodified Program or a work based |
288 | +on the Program. |
289 | + |
290 | + To "propagate" a work means to do anything with it that, without |
291 | +permission, would make you directly or secondarily liable for |
292 | +infringement under applicable copyright law, except executing it on a |
293 | +computer or modifying a private copy. Propagation includes copying, |
294 | +distribution (with or without modification), making available to the |
295 | +public, and in some countries other activities as well. |
296 | + |
297 | + To "convey" a work means any kind of propagation that enables other |
298 | +parties to make or receive copies. Mere interaction with a user through |
299 | +a computer network, with no transfer of a copy, is not conveying. |
300 | + |
301 | + An interactive user interface displays "Appropriate Legal Notices" |
302 | +to the extent that it includes a convenient and prominently visible |
303 | +feature that (1) displays an appropriate copyright notice, and (2) |
304 | +tells the user that there is no warranty for the work (except to the |
305 | +extent that warranties are provided), that licensees may convey the |
306 | +work under this License, and how to view a copy of this License. If |
307 | +the interface presents a list of user commands or options, such as a |
308 | +menu, a prominent item in the list meets this criterion. |
309 | + |
310 | + 1. Source Code. |
311 | + |
312 | + The "source code" for a work means the preferred form of the work |
313 | +for making modifications to it. "Object code" means any non-source |
314 | +form of a work. |
315 | + |
316 | + A "Standard Interface" means an interface that either is an official |
317 | +standard defined by a recognized standards body, or, in the case of |
318 | +interfaces specified for a particular programming language, one that |
319 | +is widely used among developers working in that language. |
320 | + |
321 | + The "System Libraries" of an executable work include anything, other |
322 | +than the work as a whole, that (a) is included in the normal form of |
323 | +packaging a Major Component, but which is not part of that Major |
324 | +Component, and (b) serves only to enable use of the work with that |
325 | +Major Component, or to implement a Standard Interface for which an |
326 | +implementation is available to the public in source code form. A |
327 | +"Major Component", in this context, means a major essential component |
328 | +(kernel, window system, and so on) of the specific operating system |
329 | +(if any) on which the executable work runs, or a compiler used to |
330 | +produce the work, or an object code interpreter used to run it. |
331 | + |
332 | + The "Corresponding Source" for a work in object code form means all |
333 | +the source code needed to generate, install, and (for an executable |
334 | +work) run the object code and to modify the work, including scripts to |
335 | +control those activities. However, it does not include the work's |
336 | +System Libraries, or general-purpose tools or generally available free |
337 | +programs which are used unmodified in performing those activities but |
338 | +which are not part of the work. For example, Corresponding Source |
339 | +includes interface definition files associated with source files for |
340 | +the work, and the source code for shared libraries and dynamically |
341 | +linked subprograms that the work is specifically designed to require, |
342 | +such as by intimate data communication or control flow between those |
343 | +subprograms and other parts of the work. |
344 | + |
345 | + The Corresponding Source need not include anything that users |
346 | +can regenerate automatically from other parts of the Corresponding |
347 | +Source. |
348 | + |
349 | + The Corresponding Source for a work in source code form is that |
350 | +same work. |
351 | + |
352 | + 2. Basic Permissions. |
353 | + |
354 | + All rights granted under this License are granted for the term of |
355 | +copyright on the Program, and are irrevocable provided the stated |
356 | +conditions are met. This License explicitly affirms your unlimited |
357 | +permission to run the unmodified Program. The output from running a |
358 | +covered work is covered by this License only if the output, given its |
359 | +content, constitutes a covered work. This License acknowledges your |
360 | +rights of fair use or other equivalent, as provided by copyright law. |
361 | + |
362 | + You may make, run and propagate covered works that you do not |
363 | +convey, without conditions so long as your license otherwise remains |
364 | +in force. You may convey covered works to others for the sole purpose |
365 | +of having them make modifications exclusively for you, or provide you |
366 | +with facilities for running those works, provided that you comply with |
367 | +the terms of this License in conveying all material for which you do |
368 | +not control copyright. Those thus making or running the covered works |
369 | +for you must do so exclusively on your behalf, under your direction |
370 | +and control, on terms that prohibit them from making any copies of |
371 | +your copyrighted material outside their relationship with you. |
372 | + |
373 | + Conveying under any other circumstances is permitted solely under |
374 | +the conditions stated below. Sublicensing is not allowed; section 10 |
375 | +makes it unnecessary. |
376 | + |
377 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
378 | + |
379 | + No covered work shall be deemed part of an effective technological |
380 | +measure under any applicable law fulfilling obligations under article |
381 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or |
382 | +similar laws prohibiting or restricting circumvention of such |
383 | +measures. |
384 | + |
385 | + When you convey a covered work, you waive any legal power to forbid |
386 | +circumvention of technological measures to the extent such circumvention |
387 | +is effected by exercising rights under this License with respect to |
388 | +the covered work, and you disclaim any intention to limit operation or |
389 | +modification of the work as a means of enforcing, against the work's |
390 | +users, your or third parties' legal rights to forbid circumvention of |
391 | +technological measures. |
392 | + |
393 | + 4. Conveying Verbatim Copies. |
394 | + |
395 | + You may convey verbatim copies of the Program's source code as you |
396 | +receive it, in any medium, provided that you conspicuously and |
397 | +appropriately publish on each copy an appropriate copyright notice; |
398 | +keep intact all notices stating that this License and any |
399 | +non-permissive terms added in accord with section 7 apply to the code; |
400 | +keep intact all notices of the absence of any warranty; and give all |
401 | +recipients a copy of this License along with the Program. |
402 | + |
403 | + You may charge any price or no price for each copy that you convey, |
404 | +and you may offer support or warranty protection for a fee. |
405 | + |
406 | + 5. Conveying Modified Source Versions. |
407 | + |
408 | + You may convey a work based on the Program, or the modifications to |
409 | +produce it from the Program, in the form of source code under the |
410 | +terms of section 4, provided that you also meet all of these conditions: |
411 | + |
412 | + a) The work must carry prominent notices stating that you modified |
413 | + it, and giving a relevant date. |
414 | + |
415 | + b) The work must carry prominent notices stating that it is |
416 | + released under this License and any conditions added under section |
417 | + 7. This requirement modifies the requirement in section 4 to |
418 | + "keep intact all notices". |
419 | + |
420 | + c) You must license the entire work, as a whole, under this |
421 | + License to anyone who comes into possession of a copy. This |
422 | + License will therefore apply, along with any applicable section 7 |
423 | + additional terms, to the whole of the work, and all its parts, |
424 | + regardless of how they are packaged. This License gives no |
425 | + permission to license the work in any other way, but it does not |
426 | + invalidate such permission if you have separately received it. |
427 | + |
428 | + d) If the work has interactive user interfaces, each must display |
429 | + Appropriate Legal Notices; however, if the Program has interactive |
430 | + interfaces that do not display Appropriate Legal Notices, your |
431 | + work need not make them do so. |
432 | + |
433 | + A compilation of a covered work with other separate and independent |
434 | +works, which are not by their nature extensions of the covered work, |
435 | +and which are not combined with it such as to form a larger program, |
436 | +in or on a volume of a storage or distribution medium, is called an |
437 | +"aggregate" if the compilation and its resulting copyright are not |
438 | +used to limit the access or legal rights of the compilation's users |
439 | +beyond what the individual works permit. Inclusion of a covered work |
440 | +in an aggregate does not cause this License to apply to the other |
441 | +parts of the aggregate. |
442 | + |
443 | + 6. Conveying Non-Source Forms. |
444 | + |
445 | + You may convey a covered work in object code form under the terms |
446 | +of sections 4 and 5, provided that you also convey the |
447 | +machine-readable Corresponding Source under the terms of this License, |
448 | +in one of these ways: |
449 | + |
450 | + a) Convey the object code in, or embodied in, a physical product |
451 | + (including a physical distribution medium), accompanied by the |
452 | + Corresponding Source fixed on a durable physical medium |
453 | + customarily used for software interchange. |
454 | + |
455 | + b) Convey the object code in, or embodied in, a physical product |
456 | + (including a physical distribution medium), accompanied by a |
457 | + written offer, valid for at least three years and valid for as |
458 | + long as you offer spare parts or customer support for that product |
459 | + model, to give anyone who possesses the object code either (1) a |
460 | + copy of the Corresponding Source for all the software in the |
461 | + product that is covered by this License, on a durable physical |
462 | + medium customarily used for software interchange, for a price no |
463 | + more than your reasonable cost of physically performing this |
464 | + conveying of source, or (2) access to copy the |
465 | + Corresponding Source from a network server at no charge. |
466 | + |
467 | + c) Convey individual copies of the object code with a copy of the |
468 | + written offer to provide the Corresponding Source. This |
469 | + alternative is allowed only occasionally and noncommercially, and |
470 | + only if you received the object code with such an offer, in accord |
471 | + with subsection 6b. |
472 | + |
473 | + d) Convey the object code by offering access from a designated |
474 | + place (gratis or for a charge), and offer equivalent access to the |
475 | + Corresponding Source in the same way through the same place at no |
476 | + further charge. You need not require recipients to copy the |
477 | + Corresponding Source along with the object code. If the place to |
478 | + copy the object code is a network server, the Corresponding Source |
479 | + may be on a different server (operated by you or a third party) |
480 | + that supports equivalent copying facilities, provided you maintain |
481 | + clear directions next to the object code saying where to find the |
482 | + Corresponding Source. Regardless of what server hosts the |
483 | + Corresponding Source, you remain obligated to ensure that it is |
484 | + available for as long as needed to satisfy these requirements. |
485 | + |
486 | + e) Convey the object code using peer-to-peer transmission, provided |
487 | + you inform other peers where the object code and Corresponding |
488 | + Source of the work are being offered to the general public at no |
489 | + charge under subsection 6d. |
490 | + |
491 | + A separable portion of the object code, whose source code is excluded |
492 | +from the Corresponding Source as a System Library, need not be |
493 | +included in conveying the object code work. |
494 | + |
495 | + A "User Product" is either (1) a "consumer product", which means any |
496 | +tangible personal property which is normally used for personal, family, |
497 | +or household purposes, or (2) anything designed or sold for incorporation |
498 | +into a dwelling. In determining whether a product is a consumer product, |
499 | +doubtful cases shall be resolved in favor of coverage. For a particular |
500 | +product received by a particular user, "normally used" refers to a |
501 | +typical or common use of that class of product, regardless of the status |
502 | +of the particular user or of the way in which the particular user |
503 | +actually uses, or expects or is expected to use, the product. A product |
504 | +is a consumer product regardless of whether the product has substantial |
505 | +commercial, industrial or non-consumer uses, unless such uses represent |
506 | +the only significant mode of use of the product. |
507 | + |
508 | + "Installation Information" for a User Product means any methods, |
509 | +procedures, authorization keys, or other information required to install |
510 | +and execute modified versions of a covered work in that User Product from |
511 | +a modified version of its Corresponding Source. The information must |
512 | +suffice to ensure that the continued functioning of the modified object |
513 | +code is in no case prevented or interfered with solely because |
514 | +modification has been made. |
515 | + |
516 | + If you convey an object code work under this section in, or with, or |
517 | +specifically for use in, a User Product, and the conveying occurs as |
518 | +part of a transaction in which the right of possession and use of the |
519 | +User Product is transferred to the recipient in perpetuity or for a |
520 | +fixed term (regardless of how the transaction is characterized), the |
521 | +Corresponding Source conveyed under this section must be accompanied |
522 | +by the Installation Information. But this requirement does not apply |
523 | +if neither you nor any third party retains the ability to install |
524 | +modified object code on the User Product (for example, the work has |
525 | +been installed in ROM). |
526 | + |
527 | + The requirement to provide Installation Information does not include a |
528 | +requirement to continue to provide support service, warranty, or updates |
529 | +for a work that has been modified or installed by the recipient, or for |
530 | +the User Product in which it has been modified or installed. Access to a |
531 | +network may be denied when the modification itself materially and |
532 | +adversely affects the operation of the network or violates the rules and |
533 | +protocols for communication across the network. |
534 | + |
535 | + Corresponding Source conveyed, and Installation Information provided, |
536 | +in accord with this section must be in a format that is publicly |
537 | +documented (and with an implementation available to the public in |
538 | +source code form), and must require no special password or key for |
539 | +unpacking, reading or copying. |
540 | + |
541 | + 7. Additional Terms. |
542 | + |
543 | + "Additional permissions" are terms that supplement the terms of this |
544 | +License by making exceptions from one or more of its conditions. |
545 | +Additional permissions that are applicable to the entire Program shall |
546 | +be treated as though they were included in this License, to the extent |
547 | +that they are valid under applicable law. If additional permissions |
548 | +apply only to part of the Program, that part may be used separately |
549 | +under those permissions, but the entire Program remains governed by |
550 | +this License without regard to the additional permissions. |
551 | + |
552 | + When you convey a copy of a covered work, you may at your option |
553 | +remove any additional permissions from that copy, or from any part of |
554 | +it. (Additional permissions may be written to require their own |
555 | +removal in certain cases when you modify the work.) You may place |
556 | +additional permissions on material, added by you to a covered work, |
557 | +for which you have or can give appropriate copyright permission. |
558 | + |
559 | + Notwithstanding any other provision of this License, for material you |
560 | +add to a covered work, you may (if authorized by the copyright holders of |
561 | +that material) supplement the terms of this License with terms: |
562 | + |
563 | + a) Disclaiming warranty or limiting liability differently from the |
564 | + terms of sections 15 and 16 of this License; or |
565 | + |
566 | + b) Requiring preservation of specified reasonable legal notices or |
567 | + author attributions in that material or in the Appropriate Legal |
568 | + Notices displayed by works containing it; or |
569 | + |
570 | + c) Prohibiting misrepresentation of the origin of that material, or |
571 | + requiring that modified versions of such material be marked in |
572 | + reasonable ways as different from the original version; or |
573 | + |
574 | + d) Limiting the use for publicity purposes of names of licensors or |
575 | + authors of the material; or |
576 | + |
577 | + e) Declining to grant rights under trademark law for use of some |
578 | + trade names, trademarks, or service marks; or |
579 | + |
580 | + f) Requiring indemnification of licensors and authors of that |
581 | + material by anyone who conveys the material (or modified versions of |
582 | + it) with contractual assumptions of liability to the recipient, for |
583 | + any liability that these contractual assumptions directly impose on |
584 | + those licensors and authors. |
585 | + |
586 | + All other non-permissive additional terms are considered "further |
587 | +restrictions" within the meaning of section 10. If the Program as you |
588 | +received it, or any part of it, contains a notice stating that it is |
589 | +governed by this License along with a term that is a further |
590 | +restriction, you may remove that term. If a license document contains |
591 | +a further restriction but permits relicensing or conveying under this |
592 | +License, you may add to a covered work material governed by the terms |
593 | +of that license document, provided that the further restriction does |
594 | +not survive such relicensing or conveying. |
595 | + |
596 | + If you add terms to a covered work in accord with this section, you |
597 | +must place, in the relevant source files, a statement of the |
598 | +additional terms that apply to those files, or a notice indicating |
599 | +where to find the applicable terms. |
600 | + |
601 | + Additional terms, permissive or non-permissive, may be stated in the |
602 | +form of a separately written license, or stated as exceptions; |
603 | +the above requirements apply either way. |
604 | + |
605 | + 8. Termination. |
606 | + |
607 | + You may not propagate or modify a covered work except as expressly |
608 | +provided under this License. Any attempt otherwise to propagate or |
609 | +modify it is void, and will automatically terminate your rights under |
610 | +this License (including any patent licenses granted under the third |
611 | +paragraph of section 11). |
612 | + |
613 | + However, if you cease all violation of this License, then your |
614 | +license from a particular copyright holder is reinstated (a) |
615 | +provisionally, unless and until the copyright holder explicitly and |
616 | +finally terminates your license, and (b) permanently, if the copyright |
617 | +holder fails to notify you of the violation by some reasonable means |
618 | +prior to 60 days after the cessation. |
619 | + |
620 | + Moreover, your license from a particular copyright holder is |
621 | +reinstated permanently if the copyright holder notifies you of the |
622 | +violation by some reasonable means, this is the first time you have |
623 | +received notice of violation of this License (for any work) from that |
624 | +copyright holder, and you cure the violation prior to 30 days after |
625 | +your receipt of the notice. |
626 | + |
627 | + Termination of your rights under this section does not terminate the |
628 | +licenses of parties who have received copies or rights from you under |
629 | +this License. If your rights have been terminated and not permanently |
630 | +reinstated, you do not qualify to receive new licenses for the same |
631 | +material under section 10. |
632 | + |
633 | + 9. Acceptance Not Required for Having Copies. |
634 | + |
635 | + You are not required to accept this License in order to receive or |
636 | +run a copy of the Program. Ancillary propagation of a covered work |
637 | +occurring solely as a consequence of using peer-to-peer transmission |
638 | +to receive a copy likewise does not require acceptance. However, |
639 | +nothing other than this License grants you permission to propagate or |
640 | +modify any covered work. These actions infringe copyright if you do |
641 | +not accept this License. Therefore, by modifying or propagating a |
642 | +covered work, you indicate your acceptance of this License to do so. |
643 | + |
644 | + 10. Automatic Licensing of Downstream Recipients. |
645 | + |
646 | + Each time you convey a covered work, the recipient automatically |
647 | +receives a license from the original licensors, to run, modify and |
648 | +propagate that work, subject to this License. You are not responsible |
649 | +for enforcing compliance by third parties with this License. |
650 | + |
651 | + An "entity transaction" is a transaction transferring control of an |
652 | +organization, or substantially all assets of one, or subdividing an |
653 | +organization, or merging organizations. If propagation of a covered |
654 | +work results from an entity transaction, each party to that |
655 | +transaction who receives a copy of the work also receives whatever |
656 | +licenses to the work the party's predecessor in interest had or could |
657 | +give under the previous paragraph, plus a right to possession of the |
658 | +Corresponding Source of the work from the predecessor in interest, if |
659 | +the predecessor has it or can get it with reasonable efforts. |
660 | + |
661 | + You may not impose any further restrictions on the exercise of the |
662 | +rights granted or affirmed under this License. For example, you may |
663 | +not impose a license fee, royalty, or other charge for exercise of |
664 | +rights granted under this License, and you may not initiate litigation |
665 | +(including a cross-claim or counterclaim in a lawsuit) alleging that |
666 | +any patent claim is infringed by making, using, selling, offering for |
667 | +sale, or importing the Program or any portion of it. |
668 | + |
669 | + 11. Patents. |
670 | + |
671 | + A "contributor" is a copyright holder who authorizes use under this |
672 | +License of the Program or a work on which the Program is based. The |
673 | +work thus licensed is called the contributor's "contributor version". |
674 | + |
675 | + A contributor's "essential patent claims" are all patent claims |
676 | +owned or controlled by the contributor, whether already acquired or |
677 | +hereafter acquired, that would be infringed by some manner, permitted |
678 | +by this License, of making, using, or selling its contributor version, |
679 | +but do not include claims that would be infringed only as a |
680 | +consequence of further modification of the contributor version. For |
681 | +purposes of this definition, "control" includes the right to grant |
682 | +patent sublicenses in a manner consistent with the requirements of |
683 | +this License. |
684 | + |
685 | + Each contributor grants you a non-exclusive, worldwide, royalty-free |
686 | +patent license under the contributor's essential patent claims, to |
687 | +make, use, sell, offer for sale, import and otherwise run, modify and |
688 | +propagate the contents of its contributor version. |
689 | + |
690 | + In the following three paragraphs, a "patent license" is any express |
691 | +agreement or commitment, however denominated, not to enforce a patent |
692 | +(such as an express permission to practice a patent or covenant not to |
693 | +sue for patent infringement). To "grant" such a patent license to a |
694 | +party means to make such an agreement or commitment not to enforce a |
695 | +patent against the party. |
696 | + |
697 | + If you convey a covered work, knowingly relying on a patent license, |
698 | +and the Corresponding Source of the work is not available for anyone |
699 | +to copy, free of charge and under the terms of this License, through a |
700 | +publicly available network server or other readily accessible means, |
701 | +then you must either (1) cause the Corresponding Source to be so |
702 | +available, or (2) arrange to deprive yourself of the benefit of the |
703 | +patent license for this particular work, or (3) arrange, in a manner |
704 | +consistent with the requirements of this License, to extend the patent |
705 | +license to downstream recipients. "Knowingly relying" means you have |
706 | +actual knowledge that, but for the patent license, your conveying the |
707 | +covered work in a country, or your recipient's use of the covered work |
708 | +in a country, would infringe one or more identifiable patents in that |
709 | +country that you have reason to believe are valid. |
710 | + |
711 | + If, pursuant to or in connection with a single transaction or |
712 | +arrangement, you convey, or propagate by procuring conveyance of, a |
713 | +covered work, and grant a patent license to some of the parties |
714 | +receiving the covered work authorizing them to use, propagate, modify |
715 | +or convey a specific copy of the covered work, then the patent license |
716 | +you grant is automatically extended to all recipients of the covered |
717 | +work and works based on it. |
718 | + |
719 | + A patent license is "discriminatory" if it does not include within |
720 | +the scope of its coverage, prohibits the exercise of, or is |
721 | +conditioned on the non-exercise of one or more of the rights that are |
722 | +specifically granted under this License. You may not convey a covered |
723 | +work if you are a party to an arrangement with a third party that is |
724 | +in the business of distributing software, under which you make payment |
725 | +to the third party based on the extent of your activity of conveying |
726 | +the work, and under which the third party grants, to any of the |
727 | +parties who would receive the covered work from you, a discriminatory |
728 | +patent license (a) in connection with copies of the covered work |
729 | +conveyed by you (or copies made from those copies), or (b) primarily |
730 | +for and in connection with specific products or compilations that |
731 | +contain the covered work, unless you entered into that arrangement, |
732 | +or that patent license was granted, prior to 28 March 2007. |
733 | + |
734 | + Nothing in this License shall be construed as excluding or limiting |
735 | +any implied license or other defenses to infringement that may |
736 | +otherwise be available to you under applicable patent law. |
737 | + |
738 | + 12. No Surrender of Others' Freedom. |
739 | + |
740 | + If conditions are imposed on you (whether by court order, agreement or |
741 | +otherwise) that contradict the conditions of this License, they do not |
742 | +excuse you from the conditions of this License. If you cannot convey a |
743 | +covered work so as to satisfy simultaneously your obligations under this |
744 | +License and any other pertinent obligations, then as a consequence you may |
745 | +not convey it at all. For example, if you agree to terms that obligate you |
746 | +to collect a royalty for further conveying from those to whom you convey |
747 | +the Program, the only way you could satisfy both those terms and this |
748 | +License would be to refrain entirely from conveying the Program. |
749 | + |
750 | + 13. Use with the GNU Affero General Public License. |
751 | + |
752 | + Notwithstanding any other provision of this License, you have |
753 | +permission to link or combine any covered work with a work licensed |
754 | +under version 3 of the GNU Affero General Public License into a single |
755 | +combined work, and to convey the resulting work. The terms of this |
756 | +License will continue to apply to the part which is the covered work, |
757 | +but the special requirements of the GNU Affero General Public License, |
758 | +section 13, concerning interaction through a network will apply to the |
759 | +combination as such. |
760 | + |
761 | + 14. Revised Versions of this License. |
762 | + |
763 | + The Free Software Foundation may publish revised and/or new versions of |
764 | +the GNU General Public License from time to time. Such new versions will |
765 | +be similar in spirit to the present version, but may differ in detail to |
766 | +address new problems or concerns. |
767 | + |
768 | + Each version is given a distinguishing version number. If the |
769 | +Program specifies that a certain numbered version of the GNU General |
770 | +Public License "or any later version" applies to it, you have the |
771 | +option of following the terms and conditions either of that numbered |
772 | +version or of any later version published by the Free Software |
773 | +Foundation. If the Program does not specify a version number of the |
774 | +GNU General Public License, you may choose any version ever published |
775 | +by the Free Software Foundation. |
776 | + |
777 | + If the Program specifies that a proxy can decide which future |
778 | +versions of the GNU General Public License can be used, that proxy's |
779 | +public statement of acceptance of a version permanently authorizes you |
780 | +to choose that version for the Program. |
781 | + |
782 | + Later license versions may give you additional or different |
783 | +permissions. However, no additional obligations are imposed on any |
784 | +author or copyright holder as a result of your choosing to follow a |
785 | +later version. |
786 | + |
787 | + 15. Disclaimer of Warranty. |
788 | + |
789 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
790 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
791 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
792 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
793 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
794 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
795 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
796 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
797 | + |
798 | + 16. Limitation of Liability. |
799 | + |
800 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
801 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
802 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
803 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
804 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
805 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
806 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
807 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
808 | +SUCH DAMAGES. |
809 | + |
810 | + 17. Interpretation of Sections 15 and 16. |
811 | + |
812 | + If the disclaimer of warranty and limitation of liability provided |
813 | +above cannot be given local legal effect according to their terms, |
814 | +reviewing courts shall apply local law that most closely approximates |
815 | +an absolute waiver of all civil liability in connection with the |
816 | +Program, unless a warranty or assumption of liability accompanies a |
817 | +copy of the Program in return for a fee. |
818 | + |
819 | + END OF TERMS AND CONDITIONS |
820 | + |
821 | + How to Apply These Terms to Your New Programs |
822 | + |
823 | + If you develop a new program, and you want it to be of the greatest |
824 | +possible use to the public, the best way to achieve this is to make it |
825 | +free software which everyone can redistribute and change under these terms. |
826 | + |
827 | + To do so, attach the following notices to the program. It is safest |
828 | +to attach them to the start of each source file to most effectively |
829 | +state the exclusion of warranty; and each file should have at least |
830 | +the "copyright" line and a pointer to where the full notice is found. |
831 | + |
832 | + <one line to give the program's name and a brief idea of what it does.> |
833 | + Copyright (C) <year> <name of author> |
834 | + |
835 | + This program is free software: you can redistribute it and/or modify |
836 | + it under the terms of the GNU General Public License as published by |
837 | + the Free Software Foundation, either version 3 of the License, or |
838 | + (at your option) any later version. |
839 | + |
840 | + This program is distributed in the hope that it will be useful, |
841 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
842 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
843 | + GNU General Public License for more details. |
844 | + |
845 | + You should have received a copy of the GNU General Public License |
846 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
847 | + |
848 | +Also add information on how to contact you by electronic and paper mail. |
849 | + |
850 | + If the program does terminal interaction, make it output a short |
851 | +notice like this when it starts in an interactive mode: |
852 | + |
853 | + <program> Copyright (C) <year> <name of author> |
854 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
855 | + This is free software, and you are welcome to redistribute it |
856 | + under certain conditions; type `show c' for details. |
857 | + |
858 | +The hypothetical commands `show w' and `show c' should show the appropriate |
859 | +parts of the General Public License. Of course, your program's commands |
860 | +might be different; for a GUI interface, you would use an "about box". |
861 | + |
862 | + You should also get your employer (if you work as a programmer) or school, |
863 | +if any, to sign a "copyright disclaimer" for the program, if necessary. |
864 | +For more information on this, and how to apply and follow the GNU GPL, see |
865 | +<http://www.gnu.org/licenses/>. |
866 | + |
867 | + The GNU General Public License does not permit incorporating your program |
868 | +into proprietary programs. If your program is a subroutine library, you |
869 | +may consider it more useful to permit linking proprietary applications with |
870 | +the library. If this is what you want to do, use the GNU Lesser General |
871 | +Public License instead of this License. But first, please read |
872 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
873 | |
874 | === modified file 'INSTALL' |
875 | --- INSTALL 2012-06-04 20:35:08 +0000 |
876 | +++ INSTALL 2014-04-06 18:03:36 +0000 |
877 | @@ -1,18 +1,370 @@ |
878 | -Dependencies: |
879 | - cmake |
880 | - libgranite-dev |
881 | - libmutter-dev |
882 | - libclutter-gtk-1.0-dev |
883 | - libgtk-3-dev |
884 | - gsettings-desktop-schemas-dev |
885 | - libxfixes-dev |
886 | - libbamf3-dev |
887 | - valac-0.16 |
888 | - |
889 | -Installation: |
890 | - bzr branch lp:gala |
891 | - cd gala |
892 | - mkdir build |
893 | - cd build |
894 | - cmake .. -DCMAKE_INSTALL_PREFIX=/usr |
895 | - sudo make install |
896 | +Installation Instructions |
897 | +************************* |
898 | + |
899 | +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, |
900 | +Inc. |
901 | + |
902 | + Copying and distribution of this file, with or without modification, |
903 | +are permitted in any medium without royalty provided the copyright |
904 | +notice and this notice are preserved. This file is offered as-is, |
905 | +without warranty of any kind. |
906 | + |
907 | +Basic Installation |
908 | +================== |
909 | + |
910 | + Briefly, the shell command `./configure && make && make install' |
911 | +should configure, build, and install this package. The following |
912 | +more-detailed instructions are generic; see the `README' file for |
913 | +instructions specific to this package. Some packages provide this |
914 | +`INSTALL' file but do not implement all of the features documented |
915 | +below. The lack of an optional feature in a given package is not |
916 | +necessarily a bug. More recommendations for GNU packages can be found |
917 | +in *note Makefile Conventions: (standards)Makefile Conventions. |
918 | + |
919 | + The `configure' shell script attempts to guess correct values for |
920 | +various system-dependent variables used during compilation. It uses |
921 | +those values to create a `Makefile' in each directory of the package. |
922 | +It may also create one or more `.h' files containing system-dependent |
923 | +definitions. Finally, it creates a shell script `config.status' that |
924 | +you can run in the future to recreate the current configuration, and a |
925 | +file `config.log' containing compiler output (useful mainly for |
926 | +debugging `configure'). |
927 | + |
928 | + It can also use an optional file (typically called `config.cache' |
929 | +and enabled with `--cache-file=config.cache' or simply `-C') that saves |
930 | +the results of its tests to speed up reconfiguring. Caching is |
931 | +disabled by default to prevent problems with accidental use of stale |
932 | +cache files. |
933 | + |
934 | + If you need to do unusual things to compile the package, please try |
935 | +to figure out how `configure' could check whether to do them, and mail |
936 | +diffs or instructions to the address given in the `README' so they can |
937 | +be considered for the next release. If you are using the cache, and at |
938 | +some point `config.cache' contains results you don't want to keep, you |
939 | +may remove or edit it. |
940 | + |
941 | + The file `configure.ac' (or `configure.in') is used to create |
942 | +`configure' by a program called `autoconf'. You need `configure.ac' if |
943 | +you want to change it or regenerate `configure' using a newer version |
944 | +of `autoconf'. |
945 | + |
946 | + The simplest way to compile this package is: |
947 | + |
948 | + 1. `cd' to the directory containing the package's source code and type |
949 | + `./configure' to configure the package for your system. |
950 | + |
951 | + Running `configure' might take a while. While running, it prints |
952 | + some messages telling which features it is checking for. |
953 | + |
954 | + 2. Type `make' to compile the package. |
955 | + |
956 | + 3. Optionally, type `make check' to run any self-tests that come with |
957 | + the package, generally using the just-built uninstalled binaries. |
958 | + |
959 | + 4. Type `make install' to install the programs and any data files and |
960 | + documentation. When installing into a prefix owned by root, it is |
961 | + recommended that the package be configured and built as a regular |
962 | + user, and only the `make install' phase executed with root |
963 | + privileges. |
964 | + |
965 | + 5. Optionally, type `make installcheck' to repeat any self-tests, but |
966 | + this time using the binaries in their final installed location. |
967 | + This target does not install anything. Running this target as a |
968 | + regular user, particularly if the prior `make install' required |
969 | + root privileges, verifies that the installation completed |
970 | + correctly. |
971 | + |
972 | + 6. You can remove the program binaries and object files from the |
973 | + source code directory by typing `make clean'. To also remove the |
974 | + files that `configure' created (so you can compile the package for |
975 | + a different kind of computer), type `make distclean'. There is |
976 | + also a `make maintainer-clean' target, but that is intended mainly |
977 | + for the package's developers. If you use it, you may have to get |
978 | + all sorts of other programs in order to regenerate files that came |
979 | + with the distribution. |
980 | + |
981 | + 7. Often, you can also type `make uninstall' to remove the installed |
982 | + files again. In practice, not all packages have tested that |
983 | + uninstallation works correctly, even though it is required by the |
984 | + GNU Coding Standards. |
985 | + |
986 | + 8. Some packages, particularly those that use Automake, provide `make |
987 | + distcheck', which can by used by developers to test that all other |
988 | + targets like `make install' and `make uninstall' work correctly. |
989 | + This target is generally not run by end users. |
990 | + |
991 | +Compilers and Options |
992 | +===================== |
993 | + |
994 | + Some systems require unusual options for compilation or linking that |
995 | +the `configure' script does not know about. Run `./configure --help' |
996 | +for details on some of the pertinent environment variables. |
997 | + |
998 | + You can give `configure' initial values for configuration parameters |
999 | +by setting variables in the command line or in the environment. Here |
1000 | +is an example: |
1001 | + |
1002 | + ./configure CC=c99 CFLAGS=-g LIBS=-lposix |
1003 | + |
1004 | + *Note Defining Variables::, for more details. |
1005 | + |
1006 | +Compiling For Multiple Architectures |
1007 | +==================================== |
1008 | + |
1009 | + You can compile the package for more than one kind of computer at the |
1010 | +same time, by placing the object files for each architecture in their |
1011 | +own directory. To do this, you can use GNU `make'. `cd' to the |
1012 | +directory where you want the object files and executables to go and run |
1013 | +the `configure' script. `configure' automatically checks for the |
1014 | +source code in the directory that `configure' is in and in `..'. This |
1015 | +is known as a "VPATH" build. |
1016 | + |
1017 | + With a non-GNU `make', it is safer to compile the package for one |
1018 | +architecture at a time in the source code directory. After you have |
1019 | +installed the package for one architecture, use `make distclean' before |
1020 | +reconfiguring for another architecture. |
1021 | + |
1022 | + On MacOS X 10.5 and later systems, you can create libraries and |
1023 | +executables that work on multiple system types--known as "fat" or |
1024 | +"universal" binaries--by specifying multiple `-arch' options to the |
1025 | +compiler but only a single `-arch' option to the preprocessor. Like |
1026 | +this: |
1027 | + |
1028 | + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ |
1029 | + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ |
1030 | + CPP="gcc -E" CXXCPP="g++ -E" |
1031 | + |
1032 | + This is not guaranteed to produce working output in all cases, you |
1033 | +may have to build one architecture at a time and combine the results |
1034 | +using the `lipo' tool if you have problems. |
1035 | + |
1036 | +Installation Names |
1037 | +================== |
1038 | + |
1039 | + By default, `make install' installs the package's commands under |
1040 | +`/usr/local/bin', include files under `/usr/local/include', etc. You |
1041 | +can specify an installation prefix other than `/usr/local' by giving |
1042 | +`configure' the option `--prefix=PREFIX', where PREFIX must be an |
1043 | +absolute file name. |
1044 | + |
1045 | + You can specify separate installation prefixes for |
1046 | +architecture-specific files and architecture-independent files. If you |
1047 | +pass the option `--exec-prefix=PREFIX' to `configure', the package uses |
1048 | +PREFIX as the prefix for installing programs and libraries. |
1049 | +Documentation and other data files still use the regular prefix. |
1050 | + |
1051 | + In addition, if you use an unusual directory layout you can give |
1052 | +options like `--bindir=DIR' to specify different values for particular |
1053 | +kinds of files. Run `configure --help' for a list of the directories |
1054 | +you can set and what kinds of files go in them. In general, the |
1055 | +default for these options is expressed in terms of `${prefix}', so that |
1056 | +specifying just `--prefix' will affect all of the other directory |
1057 | +specifications that were not explicitly provided. |
1058 | + |
1059 | + The most portable way to affect installation locations is to pass the |
1060 | +correct locations to `configure'; however, many packages provide one or |
1061 | +both of the following shortcuts of passing variable assignments to the |
1062 | +`make install' command line to change installation locations without |
1063 | +having to reconfigure or recompile. |
1064 | + |
1065 | + The first method involves providing an override variable for each |
1066 | +affected directory. For example, `make install |
1067 | +prefix=/alternate/directory' will choose an alternate location for all |
1068 | +directory configuration variables that were expressed in terms of |
1069 | +`${prefix}'. Any directories that were specified during `configure', |
1070 | +but not in terms of `${prefix}', must each be overridden at install |
1071 | +time for the entire installation to be relocated. The approach of |
1072 | +makefile variable overrides for each directory variable is required by |
1073 | +the GNU Coding Standards, and ideally causes no recompilation. |
1074 | +However, some platforms have known limitations with the semantics of |
1075 | +shared libraries that end up requiring recompilation when using this |
1076 | +method, particularly noticeable in packages that use GNU Libtool. |
1077 | + |
1078 | + The second method involves providing the `DESTDIR' variable. For |
1079 | +example, `make install DESTDIR=/alternate/directory' will prepend |
1080 | +`/alternate/directory' before all installation names. The approach of |
1081 | +`DESTDIR' overrides is not required by the GNU Coding Standards, and |
1082 | +does not work on platforms that have drive letters. On the other hand, |
1083 | +it does better at avoiding recompilation issues, and works well even |
1084 | +when some directory options were not specified in terms of `${prefix}' |
1085 | +at `configure' time. |
1086 | + |
1087 | +Optional Features |
1088 | +================= |
1089 | + |
1090 | + If the package supports it, you can cause programs to be installed |
1091 | +with an extra prefix or suffix on their names by giving `configure' the |
1092 | +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. |
1093 | + |
1094 | + Some packages pay attention to `--enable-FEATURE' options to |
1095 | +`configure', where FEATURE indicates an optional part of the package. |
1096 | +They may also pay attention to `--with-PACKAGE' options, where PACKAGE |
1097 | +is something like `gnu-as' or `x' (for the X Window System). The |
1098 | +`README' should mention any `--enable-' and `--with-' options that the |
1099 | +package recognizes. |
1100 | + |
1101 | + For packages that use the X Window System, `configure' can usually |
1102 | +find the X include and library files automatically, but if it doesn't, |
1103 | +you can use the `configure' options `--x-includes=DIR' and |
1104 | +`--x-libraries=DIR' to specify their locations. |
1105 | + |
1106 | + Some packages offer the ability to configure how verbose the |
1107 | +execution of `make' will be. For these packages, running `./configure |
1108 | +--enable-silent-rules' sets the default to minimal output, which can be |
1109 | +overridden with `make V=1'; while running `./configure |
1110 | +--disable-silent-rules' sets the default to verbose, which can be |
1111 | +overridden with `make V=0'. |
1112 | + |
1113 | +Particular systems |
1114 | +================== |
1115 | + |
1116 | + On HP-UX, the default C compiler is not ANSI C compatible. If GNU |
1117 | +CC is not installed, it is recommended to use the following options in |
1118 | +order to use an ANSI C compiler: |
1119 | + |
1120 | + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" |
1121 | + |
1122 | +and if that doesn't work, install pre-built binaries of GCC for HP-UX. |
1123 | + |
1124 | + HP-UX `make' updates targets which have the same time stamps as |
1125 | +their prerequisites, which makes it generally unusable when shipped |
1126 | +generated files such as `configure' are involved. Use GNU `make' |
1127 | +instead. |
1128 | + |
1129 | + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot |
1130 | +parse its `<wchar.h>' header file. The option `-nodtk' can be used as |
1131 | +a workaround. If GNU CC is not installed, it is therefore recommended |
1132 | +to try |
1133 | + |
1134 | + ./configure CC="cc" |
1135 | + |
1136 | +and if that doesn't work, try |
1137 | + |
1138 | + ./configure CC="cc -nodtk" |
1139 | + |
1140 | + On Solaris, don't put `/usr/ucb' early in your `PATH'. This |
1141 | +directory contains several dysfunctional programs; working variants of |
1142 | +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' |
1143 | +in your `PATH', put it _after_ `/usr/bin'. |
1144 | + |
1145 | + On Haiku, software installed for all users goes in `/boot/common', |
1146 | +not `/usr/local'. It is recommended to use the following options: |
1147 | + |
1148 | + ./configure --prefix=/boot/common |
1149 | + |
1150 | +Specifying the System Type |
1151 | +========================== |
1152 | + |
1153 | + There may be some features `configure' cannot figure out |
1154 | +automatically, but needs to determine by the type of machine the package |
1155 | +will run on. Usually, assuming the package is built to be run on the |
1156 | +_same_ architectures, `configure' can figure that out, but if it prints |
1157 | +a message saying it cannot guess the machine type, give it the |
1158 | +`--build=TYPE' option. TYPE can either be a short name for the system |
1159 | +type, such as `sun4', or a canonical name which has the form: |
1160 | + |
1161 | + CPU-COMPANY-SYSTEM |
1162 | + |
1163 | +where SYSTEM can have one of these forms: |
1164 | + |
1165 | + OS |
1166 | + KERNEL-OS |
1167 | + |
1168 | + See the file `config.sub' for the possible values of each field. If |
1169 | +`config.sub' isn't included in this package, then this package doesn't |
1170 | +need to know the machine type. |
1171 | + |
1172 | + If you are _building_ compiler tools for cross-compiling, you should |
1173 | +use the option `--target=TYPE' to select the type of system they will |
1174 | +produce code for. |
1175 | + |
1176 | + If you want to _use_ a cross compiler, that generates code for a |
1177 | +platform different from the build platform, you should specify the |
1178 | +"host" platform (i.e., that on which the generated programs will |
1179 | +eventually be run) with `--host=TYPE'. |
1180 | + |
1181 | +Sharing Defaults |
1182 | +================ |
1183 | + |
1184 | + If you want to set default values for `configure' scripts to share, |
1185 | +you can create a site shell script called `config.site' that gives |
1186 | +default values for variables like `CC', `cache_file', and `prefix'. |
1187 | +`configure' looks for `PREFIX/share/config.site' if it exists, then |
1188 | +`PREFIX/etc/config.site' if it exists. Or, you can set the |
1189 | +`CONFIG_SITE' environment variable to the location of the site script. |
1190 | +A warning: not all `configure' scripts look for a site script. |
1191 | + |
1192 | +Defining Variables |
1193 | +================== |
1194 | + |
1195 | + Variables not defined in a site shell script can be set in the |
1196 | +environment passed to `configure'. However, some packages may run |
1197 | +configure again during the build, and the customized values of these |
1198 | +variables may be lost. In order to avoid this problem, you should set |
1199 | +them in the `configure' command line, using `VAR=value'. For example: |
1200 | + |
1201 | + ./configure CC=/usr/local2/bin/gcc |
1202 | + |
1203 | +causes the specified `gcc' to be used as the C compiler (unless it is |
1204 | +overridden in the site shell script). |
1205 | + |
1206 | +Unfortunately, this technique does not work for `CONFIG_SHELL' due to |
1207 | +an Autoconf limitation. Until the limitation is lifted, you can use |
1208 | +this workaround: |
1209 | + |
1210 | + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash |
1211 | + |
1212 | +`configure' Invocation |
1213 | +====================== |
1214 | + |
1215 | + `configure' recognizes the following options to control how it |
1216 | +operates. |
1217 | + |
1218 | +`--help' |
1219 | +`-h' |
1220 | + Print a summary of all of the options to `configure', and exit. |
1221 | + |
1222 | +`--help=short' |
1223 | +`--help=recursive' |
1224 | + Print a summary of the options unique to this package's |
1225 | + `configure', and exit. The `short' variant lists options used |
1226 | + only in the top level, while the `recursive' variant lists options |
1227 | + also present in any nested packages. |
1228 | + |
1229 | +`--version' |
1230 | +`-V' |
1231 | + Print the version of Autoconf used to generate the `configure' |
1232 | + script, and exit. |
1233 | + |
1234 | +`--cache-file=FILE' |
1235 | + Enable the cache: use and save the results of the tests in FILE, |
1236 | + traditionally `config.cache'. FILE defaults to `/dev/null' to |
1237 | + disable caching. |
1238 | + |
1239 | +`--config-cache' |
1240 | +`-C' |
1241 | + Alias for `--cache-file=config.cache'. |
1242 | + |
1243 | +`--quiet' |
1244 | +`--silent' |
1245 | +`-q' |
1246 | + Do not print messages saying which checks are being made. To |
1247 | + suppress all normal output, redirect it to `/dev/null' (any error |
1248 | + messages will still be shown). |
1249 | + |
1250 | +`--srcdir=DIR' |
1251 | + Look for the package's source code in directory DIR. Usually |
1252 | + `configure' can determine that directory automatically. |
1253 | + |
1254 | +`--prefix=DIR' |
1255 | + Use DIR as the installation prefix. *note Installation Names:: |
1256 | + for more details, including other options available for fine-tuning |
1257 | + the installation locations. |
1258 | + |
1259 | +`--no-create' |
1260 | +`-n' |
1261 | + Run the configure checks, but stop before creating any output |
1262 | + files. |
1263 | + |
1264 | +`configure' also accepts some other, not widely useful, options. Run |
1265 | +`configure --help' for more details. |
1266 | |
1267 | === added file 'Makefile.am' |
1268 | --- Makefile.am 1970-01-01 00:00:00 +0000 |
1269 | +++ Makefile.am 2014-04-06 18:03:36 +0000 |
1270 | @@ -0,0 +1,47 @@ |
1271 | +include $(top_srcdir)/Makefile.common |
1272 | + |
1273 | +SUBDIRS = \ |
1274 | + data \ |
1275 | + lib \ |
1276 | + plugins \ |
1277 | + src \ |
1278 | + po \ |
1279 | + vapi \ |
1280 | + $(NULL) |
1281 | + |
1282 | +EXTRA_DIST = \ |
1283 | + .version \ |
1284 | + build-aux/bzr-version-gen \ |
1285 | + $(NULL) |
1286 | + |
1287 | +BUILT_SOURCES = \ |
1288 | + $(top_srcdir)/.version \ |
1289 | + $(NULL) |
1290 | + |
1291 | +$(top_srcdir)/.version: |
1292 | + echo $(VERSION) > $@-t && mv $@-t $@ |
1293 | + |
1294 | +dist-hook: |
1295 | + echo $(VERSION) > $(distdir)/.tarball-version |
1296 | + |
1297 | +distclean-local: |
1298 | + if test "x$(srcdir)" = "x."; then :; else \ |
1299 | + rm -f ChangeLog; \ |
1300 | + fi |
1301 | + |
1302 | +ChangeLog: |
1303 | + @echo Creating $@ |
1304 | + @if test -d "$(srcdir)/.bzr"; then \ |
1305 | + (bzr log --gnu -n1) | fmt --split-only --width=80 > $@.tmp \ |
1306 | + && mv -f $@.tmp $@ \ |
1307 | + || ($(RM) $@.tmp; \ |
1308 | + echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ |
1309 | + (test -f $@ || echo git-log is required to generate this file >> $@)); \ |
1310 | + else \ |
1311 | + test -f $@ || \ |
1312 | + (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ |
1313 | + echo A git checkout and git-log is required to generate this file >> $@); \ |
1314 | + fi |
1315 | + |
1316 | +.PHONY: ChangeLog |
1317 | + |
1318 | |
1319 | === added file 'Makefile.common' |
1320 | --- Makefile.common 1970-01-01 00:00:00 +0000 |
1321 | +++ Makefile.common 2014-04-06 18:03:36 +0000 |
1322 | @@ -0,0 +1,15 @@ |
1323 | +NULL = |
1324 | + |
1325 | +AM_V_VALA = $(am__v_VALA_$(V)) |
1326 | +am__v_VALA_ = $(am__v_VALA_$(AM_DEFAULT_VERBOSITY)) |
1327 | +am__v_VALA_0 = @echo " VALAC " $?; |
1328 | + |
1329 | +AM_CPPFLAGS = \ |
1330 | + -include $(CONFIG_HEADER) \ |
1331 | + -DDATADIR=\"$(datadir)\" \ |
1332 | + -DPKGDATADIR=\"$(pkgdatadir)\" \ |
1333 | + -DLIBDIR=\"$(libdir)\" \ |
1334 | + -DPKGLIBDIR=\"$(pkglibdir)\" \ |
1335 | + -DPLUGINDIR=\"$(pkglibdir)/plugins\" \ |
1336 | + -DSCHEMA=\"org.pantheon.desktop.gala\" \ |
1337 | + $(NULL) |
1338 | |
1339 | === added file 'NEWS' |
1340 | === added file 'README' |
1341 | === added file 'autogen.sh' |
1342 | --- autogen.sh 1970-01-01 00:00:00 +0000 |
1343 | +++ autogen.sh 2014-04-06 18:03:36 +0000 |
1344 | @@ -0,0 +1,40 @@ |
1345 | +#!/bin/sh |
1346 | +# Run this to generate all the initial makefiles, etc. |
1347 | + |
1348 | +srcdir=`dirname $0` |
1349 | +test -z "$srcdir" && srcdir=. |
1350 | + |
1351 | +PKG_NAME="gala" |
1352 | + |
1353 | +(test -f $srcdir/configure.ac \ |
1354 | + && test -f $srcdir/autogen.sh) || { |
1355 | + echo -n "**Error**: Directory \`$srcdir' does not look like the" |
1356 | + echo " top-level $PKG_NAME directory" |
1357 | + exit 1 |
1358 | +} |
1359 | + |
1360 | +if which gnome-autogen.sh ; then |
1361 | + REQUIRED_AUTOMAKE_VERSION=1.11 . gnome-autogen.sh |
1362 | +else |
1363 | + if which intltoolize && which autoreconf ; then |
1364 | + intltoolize --copy --force --automake || \ |
1365 | + (echo "There was an error in running intltoolize." > /dev/stderr; |
1366 | + exit 1) |
1367 | + autoreconf --force --install || \ |
1368 | + (echo "There was an error in running autoreconf." > /dev/stderr; |
1369 | + exit 1) |
1370 | + else |
1371 | + echo "No build script available. You have two choices:" |
1372 | + echo "1. You need to install the gnome-common module and make" |
1373 | + echo " sure the gnome-autogen.sh script is in your \$PATH." |
1374 | + echo "2. You need to install the following scripts:" |
1375 | + echo " * intltool" |
1376 | + echo " * libtool" |
1377 | + echo " * automake" |
1378 | + echo " * autoconf" |
1379 | + echo " Additionally, you need to make" |
1380 | + echo " sure that they are in your \$PATH." |
1381 | + exit 1 |
1382 | + fi |
1383 | +fi |
1384 | + |
1385 | |
1386 | === added directory 'build-aux' |
1387 | === added file 'build-aux/bzr-version-gen' |
1388 | --- build-aux/bzr-version-gen 1970-01-01 00:00:00 +0000 |
1389 | +++ build-aux/bzr-version-gen 2014-04-06 18:03:36 +0000 |
1390 | @@ -0,0 +1,62 @@ |
1391 | +#!/bin/sh |
1392 | + |
1393 | +scriptversion=2010-05-09.22; # UTC |
1394 | + |
1395 | +# Copyright (C) 2010, 2011 Free Software Foundation, Inc. |
1396 | + |
1397 | +# This program is free software; you can redistribute it and/or modify |
1398 | +# it under the terms of the GNU General Public License as published by |
1399 | +# the Free Software Foundation; either version 3 of the License, or |
1400 | +# (at your option) any later version. |
1401 | + |
1402 | +# This program is distributed in the hope that it will be useful, |
1403 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1404 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1405 | +# GNU General Public License for more details. |
1406 | + |
1407 | +# You should have received a copy of the GNU General Public License |
1408 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1409 | + |
1410 | +# Additional permission under GNU GPL version 3 section 7 |
1411 | + |
1412 | + |
1413 | +# Written by Giuseppe Scrivano. |
1414 | + |
1415 | +if test -f .tarball-version |
1416 | +then |
1417 | + cat .tarball-version | tr -d '\n' |
1418 | + exit 0 |
1419 | +fi |
1420 | + |
1421 | +DIRTY="" |
1422 | + |
1423 | +test -n "$(bzr diff | tr -d '\n')" && DIRTY="-dirty" |
1424 | + |
1425 | +REVNO=$(bzr revno) |
1426 | + |
1427 | +TAG=$(bzr tags -r $REVNO | cut -d' ' -f1) |
1428 | +if test -z "$TAG" |
1429 | +then |
1430 | + TAG=$(bzr tags -r ..$REVNO | cut -d' ' -f1) |
1431 | + |
1432 | + # No tags yet |
1433 | + if test -z "$1" |
1434 | + then |
1435 | + test -z "$TAG" && TAG="unknown" |
1436 | + else |
1437 | + TAG=$1 |
1438 | + fi |
1439 | + |
1440 | + TAG=$TAG.$REVNO |
1441 | +fi |
1442 | + |
1443 | + |
1444 | +printf "%s%s" "$TAG" "$DIRTY" |
1445 | + |
1446 | +# Local variables: |
1447 | +# eval: (add-hook 'write-file-hooks 'time-stamp) |
1448 | +# time-stamp-start: "scriptversion=" |
1449 | +# time-stamp-format: "%:y-%02m-%02d.%02H" |
1450 | +# time-stamp-time-zone: "UTC" |
1451 | +# time-stamp-end: "; # UTC" |
1452 | +# End: |
1453 | |
1454 | === removed directory 'cmake' |
1455 | === removed file 'cmake/FindVala.cmake' |
1456 | --- cmake/FindVala.cmake 2012-05-20 13:20:38 +0000 |
1457 | +++ cmake/FindVala.cmake 1970-01-01 00:00:00 +0000 |
1458 | @@ -1,65 +0,0 @@ |
1459 | -## |
1460 | -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
1461 | -# |
1462 | -# Redistribution and use in source and binary forms, with or without |
1463 | -# modification, are permitted provided that the following conditions are met: |
1464 | -# |
1465 | -# 1. Redistributions of source code must retain the above copyright notice, |
1466 | -# this list of conditions and the following disclaimer. |
1467 | -# |
1468 | -# 2. Redistributions in binary form must reproduce the above copyright notice, |
1469 | -# this list of conditions and the following disclaimer in the documentation |
1470 | -# and/or other materials provided with the distribution. |
1471 | -# |
1472 | -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
1473 | -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
1474 | -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
1475 | -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
1476 | -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
1477 | -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
1478 | -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
1479 | -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
1480 | -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
1481 | -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1482 | -# |
1483 | -# The views and conclusions contained in the software and documentation are those |
1484 | -# of the authors and should not be interpreted as representing official policies, |
1485 | -# either expressed or implied, of Jakob Westhoff |
1486 | -## |
1487 | - |
1488 | -## |
1489 | -# Find module for the Vala compiler (valac) |
1490 | -# |
1491 | -# This module determines wheter a Vala compiler is installed on the current |
1492 | -# system and where its executable is. |
1493 | -# |
1494 | -# Call the module using "find_package(Vala) from within your CMakeLists.txt. |
1495 | -# |
1496 | -# The following variables will be set after an invocation: |
1497 | -# |
1498 | -# VALA_FOUND Whether the vala compiler has been found or not |
1499 | -# VALA_EXECUTABLE Full path to the valac executable if it has been found |
1500 | -# VALA_VERSION Version number of the available valac |
1501 | -## |
1502 | - |
1503 | - |
1504 | -# Search for the valac executable in the usual system paths. |
1505 | -find_program(VALA_EXECUTABLE |
1506 | - NAMES valac) |
1507 | - |
1508 | -# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. |
1509 | -# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. |
1510 | -# VALA_EXECUTABLE is set) |
1511 | - |
1512 | -include(FindPackageHandleStandardArgs) |
1513 | -find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) |
1514 | - |
1515 | -mark_as_advanced(VALA_EXECUTABLE) |
1516 | - |
1517 | -# Determine the valac version |
1518 | -if(VALA_FOUND) |
1519 | - execute_process(COMMAND ${VALA_EXECUTABLE} "--version" |
1520 | - OUTPUT_VARIABLE "VALA_VERSION") |
1521 | - string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) |
1522 | - string(STRIP ${VALA_VERSION} "VALA_VERSION") |
1523 | -endif(VALA_FOUND) |
1524 | |
1525 | === removed file 'cmake/GSettings.cmake' |
1526 | --- cmake/GSettings.cmake 2012-05-20 13:20:38 +0000 |
1527 | +++ cmake/GSettings.cmake 1970-01-01 00:00:00 +0000 |
1528 | @@ -1,42 +0,0 @@ |
1529 | -# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. |
1530 | - |
1531 | -option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) |
1532 | - |
1533 | -option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) |
1534 | - |
1535 | -if(GSETTINGS_LOCALINSTALL) |
1536 | - message(STATUS "GSettings schemas will be installed locally.") |
1537 | -endif() |
1538 | - |
1539 | -if(GSETTINGS_COMPILE) |
1540 | - message(STATUS "GSettings shemas will be compiled.") |
1541 | -endif() |
1542 | - |
1543 | -macro(add_schema SCHEMA_NAME) |
1544 | - |
1545 | - set(PKG_CONFIG_EXECUTABLE pkg-config) |
1546 | - # Have an option to not install the schema into where GLib is |
1547 | - if (GSETTINGS_LOCALINSTALL) |
1548 | - SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") |
1549 | - else (GSETTINGS_LOCALINSTALL) |
1550 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) |
1551 | - SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") |
1552 | - endif (GSETTINGS_LOCALINSTALL) |
1553 | - |
1554 | - # Run the validator and error if it fails |
1555 | - execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) |
1556 | - execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) |
1557 | - |
1558 | - if (_schemas_invalid) |
1559 | - message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") |
1560 | - endif (_schemas_invalid) |
1561 | - |
1562 | - # Actually install and recomple schemas |
1563 | - message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") |
1564 | - install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) |
1565 | - |
1566 | - if (GSETTINGS_COMPILE) |
1567 | - install (CODE "message (STATUS \"Compiling GSettings schemas\")") |
1568 | - install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") |
1569 | - endif () |
1570 | -endmacro() |
1571 | |
1572 | === removed file 'cmake/ParseArguments.cmake' |
1573 | --- cmake/ParseArguments.cmake 2012-05-20 13:20:38 +0000 |
1574 | +++ cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000 |
1575 | @@ -1,36 +0,0 @@ |
1576 | -## |
1577 | -# This is a helper Macro to parse optional arguments in Macros/Functions |
1578 | -# It has been taken from the public CMake wiki. |
1579 | -# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and |
1580 | -# licensing. |
1581 | -## |
1582 | -macro(parse_arguments prefix arg_names option_names) |
1583 | - set(DEFAULT_ARGS) |
1584 | - foreach(arg_name ${arg_names}) |
1585 | - set(${prefix}_${arg_name}) |
1586 | - endforeach(arg_name) |
1587 | - foreach(option ${option_names}) |
1588 | - set(${prefix}_${option} FALSE) |
1589 | - endforeach(option) |
1590 | - |
1591 | - set(current_arg_name DEFAULT_ARGS) |
1592 | - set(current_arg_list) |
1593 | - foreach(arg ${ARGN}) |
1594 | - set(larg_names ${arg_names}) |
1595 | - list(FIND larg_names "${arg}" is_arg_name) |
1596 | - if(is_arg_name GREATER -1) |
1597 | - set(${prefix}_${current_arg_name} ${current_arg_list}) |
1598 | - set(current_arg_name ${arg}) |
1599 | - set(current_arg_list) |
1600 | - else(is_arg_name GREATER -1) |
1601 | - set(loption_names ${option_names}) |
1602 | - list(FIND loption_names "${arg}" is_option) |
1603 | - if(is_option GREATER -1) |
1604 | - set(${prefix}_${arg} TRUE) |
1605 | - else(is_option GREATER -1) |
1606 | - set(current_arg_list ${current_arg_list} ${arg}) |
1607 | - endif(is_option GREATER -1) |
1608 | - endif(is_arg_name GREATER -1) |
1609 | - endforeach(arg) |
1610 | - set(${prefix}_${current_arg_name} ${current_arg_list}) |
1611 | -endmacro(parse_arguments) |
1612 | |
1613 | === removed file 'cmake/README' |
1614 | --- cmake/README 2012-05-20 13:20:38 +0000 |
1615 | +++ cmake/README 1970-01-01 00:00:00 +0000 |
1616 | @@ -1,10 +0,0 @@ |
1617 | - Elementary CMake modules |
1618 | - |
1619 | -This is a set of CMake modules: Translations, GSettings, and Vala modules. |
1620 | - |
1621 | -For all the Vala related modules see README.Vala.rst: |
1622 | - - ParseArguments.cmake |
1623 | - - ValaPrecompile.cmake |
1624 | - - ValaVersion.cmake |
1625 | - - FindVala.cmake |
1626 | - |
1627 | |
1628 | === removed file 'cmake/README.Vala.rst' |
1629 | --- cmake/README.Vala.rst 2012-05-20 13:20:38 +0000 |
1630 | +++ cmake/README.Vala.rst 1970-01-01 00:00:00 +0000 |
1631 | @@ -1,173 +0,0 @@ |
1632 | -========== |
1633 | -Vala CMake |
1634 | -========== |
1635 | -:Author: |
1636 | - Jakob Westhoff |
1637 | -:Version: |
1638 | - Draft |
1639 | - |
1640 | - |
1641 | -Overview |
1642 | -======== |
1643 | - |
1644 | -Vala CMake is a collection of macros for the CMake_ build system to allow the |
1645 | -creation and management of projects developed using the Vala_ programming |
1646 | -language or its "Genie" flavor (less tested). |
1647 | - |
1648 | - |
1649 | -Installation |
1650 | -============ |
1651 | - |
1652 | -To use the Vala macros in your own project you need to copy the macro files to |
1653 | -an arbitrary folder in your projects directory and reference them in your |
1654 | -``CMakeLists.txt`` file. |
1655 | - |
1656 | -Assuming the macros are stored under ``cmake/vala`` in your projects folder you |
1657 | -need to add the following information to your base ``CMakeLists.txt``:: |
1658 | - |
1659 | - list(APPEND CMAKE_MODULE_PATH |
1660 | - ${CMAKE_SOURCE_DIR}/cmake/vala |
1661 | - ) |
1662 | - |
1663 | -After the new module path as been added you can simply include the provided |
1664 | -modules or use the provided find routines. |
1665 | - |
1666 | - |
1667 | -Finding Vala |
1668 | -============ |
1669 | - |
1670 | -The find module for vala works like any other Find module in CMake. |
1671 | -You can use it by simply calling the usual ``find_package`` function. Default |
1672 | -parameters like ``REQUIRED`` and ``QUIETLY`` are supported. |
1673 | - |
1674 | -:: |
1675 | - |
1676 | - find_package(Vala REQUIRED) |
1677 | - |
1678 | -After a successful call to the find_package function the following variables |
1679 | -will be set: |
1680 | - |
1681 | -VALA_FOUND |
1682 | - Whether the vala compiler has been found or not |
1683 | - |
1684 | -VALA_EXECUTABLE |
1685 | - Full path to the valac executable if it has been found |
1686 | - |
1687 | -VALA_VERSION |
1688 | - Version number of the available valac |
1689 | - |
1690 | - |
1691 | -Precompiling Vala sources |
1692 | -========================= |
1693 | - |
1694 | -CMake is mainly supposed to handle c or c++ based projects. Luckily every vala |
1695 | -program is translated into plain c code using the vala compiler, followed by |
1696 | -normal compilation of the generated c program using gcc. |
1697 | - |
1698 | -The macro ``vala_precompile`` uses that fact to create c files from your .vala |
1699 | -sources for further CMake processing. |
1700 | - |
1701 | -The first parameter provided is a variable, which will be filled with a list of |
1702 | -c files outputted by the vala compiler. This list can than be used in |
1703 | -conjunction with functions like ``add_executable`` or others to create the |
1704 | -necessary compile rules with CMake. |
1705 | - |
1706 | -The initial variable is followed by a list of .vala files to be compiled. |
1707 | -Please take care to add every vala file belonging to the currently compiled |
1708 | -project or library as Vala will otherwise not be able to resolve all |
1709 | -dependencies. |
1710 | - |
1711 | -The following sections may be specified afterwards to provide certain options |
1712 | -to the vala compiler: |
1713 | - |
1714 | -PACKAGES |
1715 | - A list of vala packages/libraries to be used during the compile cycle. The |
1716 | - package names are exactly the same, as they would be passed to the valac |
1717 | - "--pkg=" option. |
1718 | - |
1719 | -OPTIONS |
1720 | - A list of optional options to be passed to the valac executable. This can be |
1721 | - used to pass "--thread" for example to enable multi-threading support. |
1722 | - |
1723 | -DIRECTORY |
1724 | - Specify the directory where the output source files will be stored. If |
1725 | - ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. |
1726 | - |
1727 | -CUSTOM_VAPIS |
1728 | - A list of custom vapi files to be included for compilation. This can be |
1729 | - useful to include freshly created vala libraries without having to install |
1730 | - them in the system. |
1731 | - |
1732 | -GENERATE_VAPI |
1733 | - Pass all the needed flags to the compiler to create an internal vapi for |
1734 | - the compiled library. The provided name will be used for this and a |
1735 | - <provided_name>.vapi file will be created. |
1736 | - |
1737 | -GENERATE_HEADER |
1738 | - Let the compiler generate a header file for the compiled code. There will |
1739 | - be a header file as well as an internal header file being generated called |
1740 | - <provided_name>.h and <provided_name>_internal.h |
1741 | - |
1742 | -The following call is a simple example to the vala_precompile macro showing an |
1743 | -example to every of the optional sections:: |
1744 | - |
1745 | - vala_precompile(VALA_C |
1746 | - source1.vala |
1747 | - source2.vala |
1748 | - source3.vala |
1749 | - PACKAGES |
1750 | - gtk+-2.0 |
1751 | - gio-1.0 |
1752 | - posix |
1753 | - OPTIONS |
1754 | - --thread |
1755 | - CUSTOM_VAPIS |
1756 | - some_vapi.vapi |
1757 | - GENERATE_VAPI |
1758 | - myvapi |
1759 | - GENERATE_HEADER |
1760 | - myheader |
1761 | - ) |
1762 | - |
1763 | -Most important is the variable VALA_C which will contain all the generated c |
1764 | -file names after the call. The easiest way to use this information is to tell |
1765 | -CMake to create an executable out of it. |
1766 | - |
1767 | -:: |
1768 | - |
1769 | - add_executable(myexecutable ${VALA_C}) |
1770 | - |
1771 | - |
1772 | -Further reading |
1773 | -=============== |
1774 | - |
1775 | -The `Pdf Presenter Console`__ , which is a vala based project of mine, makes |
1776 | -heavy usage of the here described macros. To look at a real world example of |
1777 | -these macros the mentioned project is the right place to take a look. The svn |
1778 | -trunk of it can be found at:: |
1779 | - |
1780 | - svn://pureenergy.cc/pdf_presenter_console/trunk |
1781 | - |
1782 | - |
1783 | -__ http://westhoffswelt.de/projects/pdf_presenter_console.html |
1784 | - |
1785 | - |
1786 | -Acknowledgments |
1787 | -=============== |
1788 | - |
1789 | -Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me |
1790 | -a lot with the initial version of this macros and always answered my mostly |
1791 | -dumb CMake questions. |
1792 | - |
1793 | -.. _CMake: http://cmake.org |
1794 | -.. _Vala: http://live.gnome.org/Vala |
1795 | -.. _Genie: http://live.gnome.org/Genie |
1796 | - |
1797 | - |
1798 | - |
1799 | |
1800 | -.. |
1801 | - Local Variables: |
1802 | - mode: rst |
1803 | - fill-column: 79 |
1804 | - End: |
1805 | - vim: et syn=rst tw=79 |
1806 | |
1807 | === removed file 'cmake/Tests.cmake' |
1808 | --- cmake/Tests.cmake 2012-05-20 13:20:38 +0000 |
1809 | +++ cmake/Tests.cmake 1970-01-01 00:00:00 +0000 |
1810 | @@ -1,5 +0,0 @@ |
1811 | -# Test macros for Marlin, feel free to re-use them. |
1812 | - |
1813 | -macro(add_test_executable EXE_NAME) |
1814 | - add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}) |
1815 | -endmacro() |
1816 | |
1817 | === removed file 'cmake/Translations.cmake' |
1818 | --- cmake/Translations.cmake 2012-05-20 13:20:38 +0000 |
1819 | +++ cmake/Translations.cmake 1970-01-01 00:00:00 +0000 |
1820 | @@ -1,41 +0,0 @@ |
1821 | -# Translations.cmake, CMake macros written for Marlin, feel free to re-use them |
1822 | - |
1823 | -macro(add_translations_directory NLS_PACKAGE) |
1824 | - add_custom_target (i18n ALL COMMENT “Building i18n messages.”) |
1825 | - find_program (MSGFMT_EXECUTABLE msgfmt) |
1826 | - file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) |
1827 | - foreach (PO_INPUT ${PO_FILES}) |
1828 | - get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) |
1829 | - set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) |
1830 | - add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) |
1831 | - |
1832 | - install (FILES ${MO_OUTPUT} DESTINATION |
1833 | - share/locale/${PO_INPUT_BASE}/LC_MESSAGES |
1834 | - RENAME ${NLS_PACKAGE}.mo) |
1835 | - endforeach (PO_INPUT ${PO_FILES}) |
1836 | -endmacro(add_translations_directory) |
1837 | - |
1838 | - |
1839 | -macro(add_translations_catalog NLS_PACKAGE) |
1840 | - add_custom_target (pot COMMENT “Building translation catalog.”) |
1841 | - find_program (XGETTEXT_EXECUTABLE xgettext) |
1842 | - |
1843 | - |
1844 | - set(C_SOURCE "") |
1845 | - |
1846 | - foreach(FILES_INPUT ${ARGN}) |
1847 | - file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) |
1848 | - foreach(C_FILE ${SOURCE_FILES}) |
1849 | - set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
1850 | - endforeach() |
1851 | - file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) |
1852 | - foreach(C_FILE ${SOURCE_FILES}) |
1853 | - set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
1854 | - endforeach() |
1855 | - endforeach() |
1856 | - |
1857 | - add_custom_command (TARGET pot COMMAND |
1858 | - ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot |
1859 | - ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8 |
1860 | - ) |
1861 | -endmacro() |
1862 | |
1863 | === removed file 'cmake/ValaPrecompile.cmake' |
1864 | --- cmake/ValaPrecompile.cmake 2012-05-20 13:20:38 +0000 |
1865 | +++ cmake/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000 |
1866 | @@ -1,187 +0,0 @@ |
1867 | -## |
1868 | -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
1869 | -# |
1870 | -# Redistribution and use in source and binary forms, with or without |
1871 | -# modification, are permitted provided that the following conditions are met: |
1872 | -# |
1873 | -# 1. Redistributions of source code must retain the above copyright notice, |
1874 | -# this list of conditions and the following disclaimer. |
1875 | -# |
1876 | -# 2. Redistributions in binary form must reproduce the above copyright notice, |
1877 | -# this list of conditions and the following disclaimer in the documentation |
1878 | -# and/or other materials provided with the distribution. |
1879 | -# |
1880 | -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
1881 | -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
1882 | -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
1883 | -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
1884 | -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
1885 | -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
1886 | -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
1887 | -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
1888 | -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
1889 | -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
1890 | -# |
1891 | -# The views and conclusions contained in the software and documentation are those |
1892 | -# of the authors and should not be interpreted as representing official policies, |
1893 | -# either expressed or implied, of Jakob Westhoff |
1894 | -## |
1895 | - |
1896 | -include(ParseArguments) |
1897 | -find_package(Vala REQUIRED) |
1898 | - |
1899 | -## |
1900 | -# Compile vala files to their c equivalents for further processing. |
1901 | -# |
1902 | -# The "vala_precompile" macro takes care of calling the valac executable on the |
1903 | -# given source to produce c files which can then be processed further using |
1904 | -# default cmake functions. |
1905 | -# |
1906 | -# The first parameter provided is a variable, which will be filled with a list |
1907 | -# of c files outputted by the vala compiler. This list can than be used in |
1908 | -# conjuction with functions like "add_executable" or others to create the |
1909 | -# neccessary compile rules with CMake. |
1910 | -# |
1911 | -# The initial variable is followed by a list of .vala files to be compiled. |
1912 | -# Please take care to add every vala file belonging to the currently compiled |
1913 | -# project or library as Vala will otherwise not be able to resolve all |
1914 | -# dependencies. |
1915 | -# |
1916 | -# The following sections may be specified afterwards to provide certain options |
1917 | -# to the vala compiler: |
1918 | -# |
1919 | -# PACKAGES |
1920 | -# A list of vala packages/libraries to be used during the compile cycle. The |
1921 | -# package names are exactly the same, as they would be passed to the valac |
1922 | -# "--pkg=" option. |
1923 | -# |
1924 | -# OPTIONS |
1925 | -# A list of optional options to be passed to the valac executable. This can be |
1926 | -# used to pass "--thread" for example to enable multi-threading support. |
1927 | -# |
1928 | -# CUSTOM_VAPIS |
1929 | -# A list of custom vapi files to be included for compilation. This can be |
1930 | -# useful to include freshly created vala libraries without having to install |
1931 | -# them in the system. |
1932 | -# |
1933 | -# GENERATE_VAPI |
1934 | -# Pass all the needed flags to the compiler to create an internal vapi for |
1935 | -# the compiled library. The provided name will be used for this and a |
1936 | -# <provided_name>.vapi file will be created. |
1937 | -# |
1938 | -# GENERATE_HEADER |
1939 | -# Let the compiler generate a header file for the compiled code. There will |
1940 | -# be a header file as well as an internal header file being generated called |
1941 | -# <provided_name>.h and <provided_name>_internal.h |
1942 | -# |
1943 | -# The following call is a simple example to the vala_precompile macro showing |
1944 | -# an example to every of the optional sections: |
1945 | -# |
1946 | -# vala_precompile(VALA_C |
1947 | -# source1.vala |
1948 | -# source2.vala |
1949 | -# source3.vala |
1950 | -# PACKAGES |
1951 | -# gtk+-2.0 |
1952 | -# gio-1.0 |
1953 | -# posix |
1954 | -# DIRECTORY |
1955 | -# gen |
1956 | -# OPTIONS |
1957 | -# --thread |
1958 | -# CUSTOM_VAPIS |
1959 | -# some_vapi.vapi |
1960 | -# GENERATE_VAPI |
1961 | -# myvapi |
1962 | -# GENERATE_HEADER |
1963 | -# myheader |
1964 | -# ) |
1965 | -# |
1966 | -# Most important is the variable VALA_C which will contain all the generated c |
1967 | -# file names after the call. |
1968 | -## |
1969 | - |
1970 | -macro(vala_precompile output) |
1971 | - parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) |
1972 | - if(ARGS_DIRECTORY) |
1973 | - set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) |
1974 | - else(ARGS_DIRECTORY) |
1975 | - set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) |
1976 | - endif(ARGS_DIRECTORY) |
1977 | - include_directories(${DIRECTORY}) |
1978 | - set(vala_pkg_opts "") |
1979 | - foreach(pkg ${ARGS_PACKAGES}) |
1980 | - list(APPEND vala_pkg_opts "--pkg=${pkg}") |
1981 | - endforeach(pkg ${ARGS_PACKAGES}) |
1982 | - set(in_files "") |
1983 | - set(out_files "") |
1984 | - set(${output} "") |
1985 | - foreach(src ${ARGS_DEFAULT_ARGS}) |
1986 | - string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" src ${src}) |
1987 | - string(REGEX MATCH "^/" IS_MATCHED ${src}) |
1988 | - if(${IS_MATCHED} MATCHES "/") |
1989 | - list(APPEND in_files "${src}") |
1990 | - else() |
1991 | - list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") |
1992 | - endif() |
1993 | - string(REPLACE ".vala" ".c" src ${src}) |
1994 | - string(REPLACE ".gs" ".c" src ${src}) |
1995 | - if(${IS_MATCHED} MATCHES "/") |
1996 | - get_filename_component(VALA_FILE_NAME ${src} NAME) |
1997 | - set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}") |
1998 | - list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}") |
1999 | - else() |
2000 | - set(out_file "${DIRECTORY}/${src}") |
2001 | - list(APPEND out_files "${DIRECTORY}/${src}") |
2002 | - endif() |
2003 | - list(APPEND ${output} ${out_file}) |
2004 | - endforeach(src ${ARGS_DEFAULT_ARGS}) |
2005 | - |
2006 | - set(custom_vapi_arguments "") |
2007 | - if(ARGS_CUSTOM_VAPIS) |
2008 | - foreach(vapi ${ARGS_CUSTOM_VAPIS}) |
2009 | - if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
2010 | - list(APPEND custom_vapi_arguments ${vapi}) |
2011 | - else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
2012 | - list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) |
2013 | - endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
2014 | - endforeach(vapi ${ARGS_CUSTOM_VAPIS}) |
2015 | - endif(ARGS_CUSTOM_VAPIS) |
2016 | - |
2017 | - set(vapi_arguments "") |
2018 | - if(ARGS_GENERATE_VAPI) |
2019 | - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") |
2020 | - set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi") |
2021 | - |
2022 | - # Header and internal header is needed to generate internal vapi |
2023 | - if (NOT ARGS_GENERATE_HEADER) |
2024 | - set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) |
2025 | - endif(NOT ARGS_GENERATE_HEADER) |
2026 | - endif(ARGS_GENERATE_VAPI) |
2027 | - |
2028 | - set(header_arguments "") |
2029 | - if(ARGS_GENERATE_HEADER) |
2030 | - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") |
2031 | - list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") |
2032 | - list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") |
2033 | - list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") |
2034 | - endif(ARGS_GENERATE_HEADER) |
2035 | - |
2036 | - add_custom_command(OUTPUT ${out_files} |
2037 | - COMMAND |
2038 | - ${VALA_EXECUTABLE} |
2039 | - ARGS |
2040 | - "-C" |
2041 | - ${header_arguments} |
2042 | - ${vapi_arguments} |
2043 | - "-b" ${CMAKE_CURRENT_SOURCE_DIR} |
2044 | - "-d" ${DIRECTORY} |
2045 | - ${vala_pkg_opts} |
2046 | - ${ARGS_OPTIONS} |
2047 | - ${in_files} |
2048 | - ${custom_vapi_arguments} |
2049 | - DEPENDS |
2050 | - ${in_files} |
2051 | - ${ARGS_CUSTOM_VAPIS} |
2052 | - ) |
2053 | -endmacro(vala_precompile) |
2054 | |
2055 | === removed file 'cmake/ValaVersion.cmake' |
2056 | --- cmake/ValaVersion.cmake 2012-05-20 13:20:38 +0000 |
2057 | +++ cmake/ValaVersion.cmake 1970-01-01 00:00:00 +0000 |
2058 | @@ -1,96 +0,0 @@ |
2059 | -## |
2060 | -# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
2061 | -# |
2062 | -# Redistribution and use in source and binary forms, with or without |
2063 | -# modification, are permitted provided that the following conditions are met: |
2064 | -# |
2065 | -# 1. Redistributions of source code must retain the above copyright notice, |
2066 | -# this list of conditions and the following disclaimer. |
2067 | -# |
2068 | -# 2. Redistributions in binary form must reproduce the above copyright notice, |
2069 | -# this list of conditions and the following disclaimer in the documentation |
2070 | -# and/or other materials provided with the distribution. |
2071 | -# |
2072 | -# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
2073 | -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
2074 | -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
2075 | -# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
2076 | -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
2077 | -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
2078 | -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
2079 | -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
2080 | -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
2081 | -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2082 | -# |
2083 | -# The views and conclusions contained in the software and documentation are those |
2084 | -# of the authors and should not be interpreted as representing official policies, |
2085 | -# either expressed or implied, of Jakob Westhoff |
2086 | -## |
2087 | - |
2088 | -include(ParseArguments) |
2089 | -find_package(Vala REQUIRED) |
2090 | - |
2091 | -## |
2092 | -# Ensure a certain valac version is available |
2093 | -# |
2094 | -# The initial argument is the version to check for |
2095 | -# |
2096 | -# It may be followed by a optional parameter to specifiy a version range. The |
2097 | -# following options are valid: |
2098 | -# |
2099 | -# EXACT |
2100 | -# Vala needs to be available in the exact version given |
2101 | -# |
2102 | -# MINIMUM |
2103 | -# The provided version is the minimum version. Therefore Vala needs to be |
2104 | -# available in the given version or any higher version |
2105 | -# |
2106 | -# MAXIMUM |
2107 | -# The provided version is the maximum. Therefore Vala needs to be available |
2108 | -# in the given version or any version older than this |
2109 | -# |
2110 | -# If no option is specified the version will be treated as a minimal version. |
2111 | -## |
2112 | -macro(ensure_vala_version version) |
2113 | - parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) |
2114 | - set(compare_message "") |
2115 | - set(error_message "") |
2116 | - if(ARGS_MINIMUM) |
2117 | - set(compare_message "a minimum ") |
2118 | - set(error_message "or greater ") |
2119 | - elseif(ARGS_MAXIMUM) |
2120 | - set(compare_message "a maximum ") |
2121 | - set(error_message "or less ") |
2122 | - endif(ARGS_MINIMUM) |
2123 | - |
2124 | - message(STATUS |
2125 | - "checking for ${compare_message}Vala version of ${version}" |
2126 | - ) |
2127 | - |
2128 | - unset(version_accepted) |
2129 | - |
2130 | - # MINIMUM is the default if no option is specified |
2131 | - if(ARGS_EXACT) |
2132 | - if(${VALA_VERSION} VERSION_EQUAL ${version} ) |
2133 | - set(version_accepted TRUE) |
2134 | - endif(${VALA_VERSION} VERSION_EQUAL ${version}) |
2135 | - elseif(ARGS_MAXIMUM) |
2136 | - if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
2137 | - set(version_accepted TRUE) |
2138 | - endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
2139 | - else(ARGS_MAXIMUM) |
2140 | - if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
2141 | - set(version_accepted TRUE) |
2142 | - endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
2143 | - endif(ARGS_EXACT) |
2144 | - |
2145 | - if (NOT version_accepted) |
2146 | - message(FATAL_ERROR |
2147 | - "Vala version ${version} ${error_message}is required." |
2148 | - ) |
2149 | - endif(NOT version_accepted) |
2150 | - |
2151 | - message(STATUS |
2152 | - " found Vala, version ${VALA_VERSION}" |
2153 | - ) |
2154 | -endmacro(ensure_vala_version) |
2155 | |
2156 | === added file 'configure.ac' |
2157 | --- configure.ac 1970-01-01 00:00:00 +0000 |
2158 | +++ configure.ac 2014-04-06 18:03:36 +0000 |
2159 | @@ -0,0 +1,206 @@ |
2160 | +# If not 1, append revision to the version number and enable other development stuff |
2161 | +m4_define([gala_released], [0]) |
2162 | + |
2163 | +m4_define([gala_major_version], [0]) |
2164 | +m4_define([gala_minor_version], [1]) |
2165 | +m4_define([gala_micro_version], [0]) |
2166 | +m4_define([gala_nano_version], [0]) |
2167 | + |
2168 | +# If library source has changed since last release, increment revision |
2169 | +# If interfaces have been removed or changed since last release, |
2170 | +# increment current and set revision to 0 |
2171 | +# If interfaces have been added since last release, increment age |
2172 | +# If interfaces have been removed since last release, set age to 0 |
2173 | +m4_define([gala_lt_current], [0]) |
2174 | +m4_define([gala_lt_revision], [0]) |
2175 | +m4_define([gala_lt_age], [0]) |
2176 | + |
2177 | +# Display the nano_version only if it's not '0' |
2178 | +m4_define([gala_base_version], |
2179 | + gala_major_version.gala_minor_version.gala_micro_version) |
2180 | +m4_define([gala_full_version], |
2181 | + [m4_if(gala_nano_version, [0], |
2182 | + gala_base_version, gala_base_version.gala_nano_version)]) |
2183 | + |
2184 | +# Extend version with bzr revision for non-release builds |
2185 | +m4_define([gala_version], m4_if(gala_released, [1], |
2186 | + [gala_full_version], [m4_esyscmd([build-aux/bzr-version-gen gala_full_version])])) |
2187 | +m4_define([gala_major_minor_version], gala_major_version.gala_minor_version) |
2188 | +m4_define([gala_module_version], gala_lt_current) |
2189 | + |
2190 | +AC_INIT([gala], gala_version, |
2191 | + [https://bugs.launchpad.net/gala], [gala], |
2192 | + [https://launchpad.net/gala]) |
2193 | +AC_DEFINE(RELEASE_NAME, "Window Manager.", Codename of this release) |
2194 | +AC_DEFINE(VERSION_INFO, m4_if(gala_released, [1], "Release", "Development"), Version info for package) |
2195 | + |
2196 | +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
2197 | + |
2198 | +AC_PREREQ([2.65]) |
2199 | + |
2200 | +AC_CONFIG_MACRO_DIR([m4]) |
2201 | +AC_CONFIG_AUX_DIR([build-aux]) |
2202 | +AC_CONFIG_SRCDIR([Makefile.am]) |
2203 | +AC_CONFIG_HEADERS(config.h) |
2204 | +AC_CONFIG_SRCDIR([configure.ac]) |
2205 | +AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip -Wno-portability subdir-objects]) |
2206 | +AM_MAINTAINER_MODE |
2207 | + |
2208 | +AC_PROG_CC |
2209 | +AM_PROG_CC_C_O |
2210 | +AC_DISABLE_STATIC |
2211 | +LT_INIT |
2212 | +PKG_PROG_PKG_CONFIG([0.21]) |
2213 | + |
2214 | +GLIB_GSETTINGS |
2215 | + |
2216 | +AC_SUBST([CFLAGS]) |
2217 | +AC_SUBST([CPPFLAGS]) |
2218 | +AC_SUBST([LDFLAGS]) |
2219 | + |
2220 | +LT_CURRENT=gala_lt_current |
2221 | +LT_REVISION=gala_lt_revision |
2222 | +LT_AGE=gala_lt_age |
2223 | +AC_SUBST([LT_CURRENT]) |
2224 | +AC_SUBST([LT_REVISION]) |
2225 | +AC_SUBST([LT_AGE]) |
2226 | + |
2227 | +GALA_MAJOR_MINOR_VERSION=gala_major_minor_version |
2228 | +AC_SUBST([GALA_MAJOR_MINOR_VERSION]) |
2229 | + |
2230 | +API_VERSION=0.2 |
2231 | +AC_SUBST([API_VERSION]) |
2232 | + |
2233 | + |
2234 | +# ----------------------------------------------------------- |
2235 | +# Vala |
2236 | +# ----------------------------------------------------------- |
2237 | +VALA_MIN_VERSION=0.22.0 |
2238 | + |
2239 | +AM_PROG_VALAC([$VALA_MIN_VERSION]) |
2240 | +if test "x$VALAC" = "x"; then |
2241 | + AC_MSG_ERROR([Vala requested but valac >= $VALA_MIN_VERSION is not installed]) |
2242 | +fi |
2243 | + |
2244 | +AC_PATH_PROG([VAPIGEN], [vapigen], []) |
2245 | +if test "x$VAPIGEN" = "x"; then |
2246 | + AC_MSG_ERROR([Vala must be built with --enable-vapigen]) |
2247 | +fi |
2248 | + |
2249 | +# ----------------------------------------------------------- |
2250 | +# Dependencies |
2251 | +# ----------------------------------------------------------- |
2252 | +GTK_MIN_VERSION=3.4.0 |
2253 | +GLIB_MIN_VERSION=2.32.0 |
2254 | +PLANK_MIN_VERSION=0.3.0 |
2255 | +MUTTER_MIN_VERSION=3.8.4 |
2256 | +MUTTER_API="3.8" |
2257 | + |
2258 | +GALA_CORE_PKGS="gobject-2.0 >= $GLIB_MIN_VERSION \ |
2259 | + glib-2.0 >= $GLIB_MIN_VERSION \ |
2260 | + gio-2.0 >= $GLIB_MIN_VERSION \ |
2261 | + gio-unix-2.0 >= $GLIB_MIN_VERSION \ |
2262 | + gmodule-2.0 \ |
2263 | + gtk+-3.0 >= $GTK_MIN_VERSION \ |
2264 | + gdk-x11-3.0 >= $GTK_MIN_VERSION \ |
2265 | + libbamf3 \ |
2266 | + clutter-gtk-1.0 \ |
2267 | + granite \ |
2268 | + libmutter >= $MUTTER_MIN_VERSION \ |
2269 | + gee-0.8 \ |
2270 | + gnome-desktop-3.0 \ |
2271 | + plank >= $PLANK_MIN_VERSION" |
2272 | + |
2273 | +GALA_CORE_VALA_PKGS="--pkg gio-unix-2.0 \ |
2274 | + --pkg gmodule-2.0 \ |
2275 | + --pkg gtk+-3.0 \ |
2276 | + --pkg gdk-x11-3.0 \ |
2277 | + --pkg libbamf3 \ |
2278 | + --pkg libmutter \ |
2279 | + --pkg clutter-gtk-1.0 \ |
2280 | + --pkg granite \ |
2281 | + --pkg gee-0.8 \ |
2282 | + --pkg gdesktopenums-3.0 \ |
2283 | + --pkg gnome-desktop-3.0 \ |
2284 | + --pkg xfixes-4.0 \ |
2285 | + --pkg plank" |
2286 | + |
2287 | +VALAFLAGS="$VALAFLAGS --thread --target-glib=2.32" |
2288 | + |
2289 | + |
2290 | +PKG_CHECK_MODULES(GALA_CORE, $GALA_CORE_PKGS) |
2291 | + |
2292 | +# Plugins |
2293 | +PLUGIN_LDFLAGS="-module -avoid-version" |
2294 | +AC_SUBST([PLUGIN_LDFLAGS]) |
2295 | + |
2296 | +# ----------------------------------------------------------- |
2297 | +# Optional Dependencies |
2298 | +# ----------------------------------------------------------- |
2299 | + |
2300 | +# 3.10 |
2301 | +PKG_CHECK_MODULES(MUTTER, [libmutter >= 3.9], [have_mutter310=yes], [have_mutter310=no]) |
2302 | +if test "x$have_mutter310" = "xyes" ; then |
2303 | + PKG_CHECK_MODULES(MUTTER, "libmutter >= 3.10.4") |
2304 | + VALAFLAGS="$VALAFLAGS --define HAS_MUTTER310" |
2305 | + MUTTER_API="3.10" |
2306 | +fi |
2307 | + |
2308 | +# 3.12 |
2309 | +PKG_CHECK_MODULES(MUTTER, [libmutter >= 3.11], [have_mutter312=yes], [have_mutter312=no]) |
2310 | +if test "x$have_mutter312" = "xyes" ; then |
2311 | + PKG_CHECK_MODULES(MUTTER, [libmutter >= 3.11.91]) |
2312 | + VALAFLAGS="$VALAFLAGS --define HAS_MUTTER312" |
2313 | + MUTTER_API="3.12" |
2314 | +fi |
2315 | + |
2316 | +# ----------------------------------------------------------- |
2317 | +# Addional configure flags |
2318 | +# ----------------------------------------------------------- |
2319 | + |
2320 | +# Enable Vala debug-flag by default for non-release builds |
2321 | +AC_ARG_ENABLE([debug], |
2322 | + AS_HELP_STRING([--disable-debug],[compile without debug code]), |
2323 | + [enable_debug=$enableval], [m4_if(gala_released, [1], [enable_debug=no], [enable_debug=yes])]) |
2324 | +if test "x$enable_debug" = "xyes" ; then |
2325 | + VALAFLAGS="$VALAFLAGS -g" |
2326 | +fi |
2327 | + |
2328 | +GALA_CORE_VALAFLAGS="$VALAFLAGS $GALA_CORE_VALA_PKGS" |
2329 | +AC_SUBST(GALA_CORE_VALAFLAGS) |
2330 | + |
2331 | +# ----------------------------------------------------------- |
2332 | +# Gettext |
2333 | +# ----------------------------------------------------------- |
2334 | +GETTEXT_PACKAGE=AC_PACKAGE_NAME |
2335 | +AC_SUBST(GETTEXT_PACKAGE) |
2336 | +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used]) |
2337 | +IT_PROG_INTLTOOL([0.35.0]) |
2338 | + |
2339 | + |
2340 | +# ----------------------------------------------------------- |
2341 | +# Final output |
2342 | +# ----------------------------------------------------------- |
2343 | +AC_CONFIG_FILES([ |
2344 | +Makefile |
2345 | +src/Makefile |
2346 | +lib/Makefile |
2347 | +data/Makefile |
2348 | +vapi/Makefile |
2349 | +plugins/Makefile |
2350 | +plugins/zoom/Makefile |
2351 | +po/Makefile.in |
2352 | +]) |
2353 | + |
2354 | +AC_OUTPUT |
2355 | + |
2356 | +echo " |
2357 | +${PACKAGE} ${VERSION} |
2358 | + |
2359 | + Prefix......................: ${prefix} |
2360 | + Vala Compiler...............: ${VALAC} |
2361 | + Vala Flags..................: ${VALAFLAGS} |
2362 | + C Compiler Flags............: ${CFLAGS} |
2363 | + |
2364 | + Using Mutter................: ${MUTTER_API} |
2365 | +" |
2366 | |
2367 | === added file 'data/Makefile.am' |
2368 | --- data/Makefile.am 1970-01-01 00:00:00 +0000 |
2369 | +++ data/Makefile.am 2014-04-06 18:03:36 +0000 |
2370 | @@ -0,0 +1,36 @@ |
2371 | +stylesdir = $(pkgdatadir) |
2372 | +styles_DATA = gala.css texture.png |
2373 | + |
2374 | +applicationsdir = $(datadir)/applications |
2375 | +applications_DATA = gala.desktop |
2376 | + |
2377 | +gsettings_SCHEMAS = org.pantheon.desktop.gala.gschema.xml |
2378 | + |
2379 | +%.gschema.xml.in: %.gschema.xml.in.in Makefile |
2380 | + $(AM_V_GEN) sed -e 's|@GETTEXT_PACKAGE[@]|$(GETTEXT_PACKAGE)|g' $< > $@ || rm $@ |
2381 | + |
2382 | +@INTLTOOL_XML_RULE@ |
2383 | + |
2384 | +@GSETTINGS_RULES@ |
2385 | + |
2386 | +gschemas.compiled: Makefile $(gsettings_SCHEMAS:.xml=.valid) |
2387 | + $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --targetdir=$(builddir) $(builddir) |
2388 | + |
2389 | +all-local: gschemas.compiled |
2390 | + |
2391 | +EXTRA_DIST = \ |
2392 | + gala.css \ |
2393 | + gala.desktop \ |
2394 | + texture.png \ |
2395 | + org.pantheon.desktop.gala.gschema.xml.in.in \ |
2396 | + $(NULL) |
2397 | + |
2398 | +CLEANFILES = \ |
2399 | + $(applications_DATA) \ |
2400 | + $(styles_DATA) \ |
2401 | + $(gsettings_SCHEMAS) \ |
2402 | + gschemas.compiled \ |
2403 | + data/org.pantheon.desktop.gala.gschema.xml \ |
2404 | + data/org.pantheon.desktop.gala.gschema.xml.in \ |
2405 | + $(NULL) |
2406 | + |
2407 | |
2408 | === renamed file 'data/org.pantheon.desktop.gala.gschema.xml' => 'data/org.pantheon.desktop.gala.gschema.xml.in.in' |
2409 | --- data/org.pantheon.desktop.gala.gschema.xml 2013-09-28 22:35:41 +0000 |
2410 | +++ data/org.pantheon.desktop.gala.gschema.xml.in.in 2014-04-06 18:03:36 +0000 |
2411 | @@ -83,7 +83,7 @@ |
2412 | </key> |
2413 | </schema> |
2414 | |
2415 | - <schema path="/org/pantheon/desktop/gala/keybindings/" id="org.pantheon.desktop.gala.keybindings" gettext-domain="gala"> |
2416 | + <schema path="/org/pantheon/desktop/gala/keybindings/" id="org.pantheon.desktop.gala.keybindings" gettext-domain="@GETTEXT_PACKAGE@"> |
2417 | <key type="as" name="switch-to-workspace-first"> |
2418 | <default><![CDATA[['<Super>Home']]]></default> |
2419 | <summary>Shortcut to move to first workspace</summary> |
2420 | |
2421 | === added directory 'lib' |
2422 | === added file 'lib/Makefile.am' |
2423 | --- lib/Makefile.am 1970-01-01 00:00:00 +0000 |
2424 | +++ lib/Makefile.am 2014-04-06 18:03:36 +0000 |
2425 | @@ -0,0 +1,66 @@ |
2426 | +include $(top_srcdir)/Makefile.common |
2427 | + |
2428 | +VAPIDIR = $(top_srcdir)/vapi |
2429 | + |
2430 | +BUILT_SOURCES = \ |
2431 | + libgala_la_vala.stamp \ |
2432 | + $(NULL) |
2433 | + |
2434 | +libgala_la_LTLIBRARIES = libgala.la |
2435 | + |
2436 | +libgala_ladir = $(pkglibdir) |
2437 | + |
2438 | +libgala_la_CFLAGS = \ |
2439 | + $(GALA_CORE_CFLAGS) \ |
2440 | + -include config.h \ |
2441 | + -w \ |
2442 | + $(NULL) |
2443 | + |
2444 | +libgala_la_LDFLAGS = \ |
2445 | + -avoid-version \ |
2446 | + $(GALA_CORE_LDFLAGS) \ |
2447 | + $(NULL) |
2448 | + |
2449 | +libgala_la_VALAFLAGS = \ |
2450 | + $(GALA_CORE_VALAFLAGS) \ |
2451 | + --vapidir $(VAPIDIR) \ |
2452 | + $(VAPIDIR)/config.vapi \ |
2453 | + $(NULL) |
2454 | + |
2455 | +libgala_la_LIBADD = \ |
2456 | + $(GALA_CORE_LIBS) \ |
2457 | + $(NULL) |
2458 | + |
2459 | +libgala_la_VALASOURCES = \ |
2460 | + Plugin.vala \ |
2461 | + Utils.vala \ |
2462 | + WindowManager.vala \ |
2463 | + $(NULL) |
2464 | + |
2465 | +nodist_libgala_la_SOURCES = \ |
2466 | + $(BUILT_SOURCES) \ |
2467 | + $(libgala_la_VALASOURCES:.vala=.c) \ |
2468 | + $(NULL) |
2469 | + |
2470 | +libgala_la_vala.stamp: $(libgala_la_VALASOURCES) |
2471 | + $(AM_V_VALA)$(VALAC) \ |
2472 | + $(libgala_la_VALAFLAGS) \ |
2473 | + --basedir $(srcdir) \ |
2474 | + --directory $(builddir) \ |
2475 | + -C \ |
2476 | + -H gala.h \ |
2477 | + --vapi gala.vapi \ |
2478 | + --library gala \ |
2479 | + $(filter %.vala %.c,$^) |
2480 | + $(AM_V_at)touch $@ |
2481 | + |
2482 | +CLEANFILES = \ |
2483 | + $(nodist_libgala_la_SOURCES) \ |
2484 | + gala.vapi \ |
2485 | + gala.h \ |
2486 | + $(NULL) |
2487 | + |
2488 | +EXTRA_DIST = \ |
2489 | + $(libgala_la_VALASOURCES) \ |
2490 | + $(NULL) |
2491 | + |
2492 | |
2493 | === added file 'lib/Plugin.vala' |
2494 | --- lib/Plugin.vala 1970-01-01 00:00:00 +0000 |
2495 | +++ lib/Plugin.vala 2014-04-06 18:03:36 +0000 |
2496 | @@ -0,0 +1,210 @@ |
2497 | +// |
2498 | +// Copyright (C) 2014 Tom Beckmann |
2499 | +// |
2500 | +// This program is free software: you can redistribute it and/or modify |
2501 | +// it under the terms of the GNU General Public License as published by |
2502 | +// the Free Software Foundation, either version 3 of the License, or |
2503 | +// (at your option) any later version. |
2504 | +// |
2505 | +// This program is distributed in the hope that it will be useful, |
2506 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2507 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2508 | +// GNU General Public License for more details. |
2509 | +// |
2510 | +// You should have received a copy of the GNU General Public License |
2511 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
2512 | +// |
2513 | + |
2514 | +namespace Gala |
2515 | +{ |
2516 | + public enum PluginFunction |
2517 | + { |
2518 | + ADDITION, |
2519 | + WINDOW_SWITCHER, |
2520 | + DESKTOP, |
2521 | + WORKSPACE_VIEW, |
2522 | + WINDOW_OVERVIEW |
2523 | + } |
2524 | + |
2525 | + public enum LoadPriority |
2526 | + { |
2527 | + /** |
2528 | + * Have your plugin loaded immediately once gala has started |
2529 | + */ |
2530 | + IMMEDIATE, |
2531 | + /** |
2532 | + * Allow gala to defer loading your plugin once it got the |
2533 | + * major part of the initialization done |
2534 | + */ |
2535 | + DEFERRED |
2536 | + } |
2537 | + |
2538 | + public struct PluginInfo |
2539 | + { |
2540 | + string name; |
2541 | + string author; |
2542 | + |
2543 | + /** |
2544 | + * Type of your plugin class, has to be derived from the Plugin class. |
2545 | + */ |
2546 | + Type plugin_type; |
2547 | + |
2548 | + /** |
2549 | + * This property allows you to override default functionality of gala |
2550 | + * so systems won't be instantiated next to each other. Use |
2551 | + * PluginFunction.ADDITION if no special component is overridden. |
2552 | + */ |
2553 | + PluginFunction provides; |
2554 | + |
2555 | + /** |
2556 | + * Give gala a hint for when to load your plugin. Especially use DEFERRED |
2557 | + * if you're adding a completely new ui component that's not directly |
2558 | + * related to the wm. |
2559 | + */ |
2560 | + LoadPriority load_priority; |
2561 | + |
2562 | + /** |
2563 | + * You don't have to fill this field, it will be filled by gala with |
2564 | + * the filename in which your module was found. |
2565 | + */ |
2566 | + string module_name; |
2567 | + } |
2568 | + |
2569 | + /** |
2570 | + * This class has to be implemented by every plugin. |
2571 | + * Additionally, the plugin module is required to have a register_plugin |
2572 | + * function which returns a PluginInfo struct. |
2573 | + * The plugin_type field has to be the type of your plugin class derived |
2574 | + * from this class. |
2575 | + */ |
2576 | + public abstract class Plugin : Object |
2577 | + { |
2578 | + /** |
2579 | + * Emitted when update_region is called. Mainly for internal purposes. |
2580 | + */ |
2581 | + public signal void region_changed (); |
2582 | + |
2583 | + /** |
2584 | + * The region indicates an area where mouse events should be sent to |
2585 | + * the stage, which means your actors, instead of the windows. |
2586 | + * |
2587 | + * It is calculated by the system whenever update_region is called. |
2588 | + * You can influce it with the custom_region and the track_actor function. |
2589 | + */ |
2590 | + public X.Xrectangle[] region { get; set; } |
2591 | + |
2592 | + /** |
2593 | + * This list will be merged with the region property. See region for |
2594 | + * more details. Changing this property will cause update_region to be |
2595 | + * called. Default to null. |
2596 | + */ |
2597 | + protected X.Xrectangle[]? custom_region { |
2598 | + get { |
2599 | + return _custom_region; |
2600 | + } |
2601 | + protected set { |
2602 | + _custom_region = value; |
2603 | + update_region (); |
2604 | + } |
2605 | + } |
2606 | + |
2607 | + /** |
2608 | + * Set this property to true while animating an actor if you have tracked |
2609 | + * actors to prevent constant recalculations of the regions during an |
2610 | + * animation. |
2611 | + */ |
2612 | + protected bool freeze_track { get; protected set; default = false; } |
2613 | + |
2614 | + private X.Xrectangle[]? _custom_region = null; |
2615 | + private Gee.LinkedList<Clutter.Actor> tracked_actors = new Gee.LinkedList<Clutter.Actor> (); |
2616 | + |
2617 | + /** |
2618 | + * Once this method is called you can start adding actors to the stage |
2619 | + * using via the windowmanager instance that is given to you. |
2620 | + * |
2621 | + * @param wm The window manager. |
2622 | + */ |
2623 | + public abstract void initialize (WindowManager wm); |
2624 | + |
2625 | + /** |
2626 | + * This method is currently not called in the code, however you should |
2627 | + * still implement it to be compatible whenever we decide to use it. |
2628 | + * It should make sure that everything your plugin added to the stage |
2629 | + * is cleaned up. |
2630 | + */ |
2631 | + public abstract void destroy (); |
2632 | + |
2633 | + /** |
2634 | + * Listen to changes to the allocation of actor and update the region |
2635 | + * accordingly. You may add multiple actors, their shapes will be |
2636 | + * combined when one of them changes. |
2637 | + * |
2638 | + * @param actor The actor to be tracked |
2639 | + */ |
2640 | + public void track_actor (Clutter.Actor actor) |
2641 | + { |
2642 | + tracked_actors.add (actor); |
2643 | + actor.allocation_changed.connect (actor_allocation_changed); |
2644 | + |
2645 | + update_region (); |
2646 | + } |
2647 | + |
2648 | + /** |
2649 | + * Stop listening to allocation changes and remove the actor's |
2650 | + * allocation from the region array. |
2651 | + * |
2652 | + * @param actor The actor to stop listening the changes on |
2653 | + */ |
2654 | + public void untrack_actor (Clutter.Actor actor) |
2655 | + { |
2656 | + if (tracked_actors.remove (actor)) { |
2657 | + actor.allocation_changed.disconnect (actor_allocation_changed); |
2658 | + } |
2659 | + } |
2660 | + |
2661 | + /** |
2662 | + * You can call this method to force the system to update the region that |
2663 | + * is used by the window manager. It will automatically upon changes to |
2664 | + * the custom_region property and when a tracked actor's allocation changes |
2665 | + * unless freeze_track is set to true. You may need to call this function |
2666 | + * after setting freeze_track back to false after an animation to make the |
2667 | + * wm aware of the new position of the actor in question. |
2668 | + */ |
2669 | + public void update_region () |
2670 | + { |
2671 | + var has_custom = custom_region != null; |
2672 | + var len = tracked_actors.size + (has_custom ? custom_region.length : 0); |
2673 | + |
2674 | + X.Xrectangle[] regions = new X.Xrectangle[len]; |
2675 | + var i = 0; |
2676 | + |
2677 | + if (has_custom) { |
2678 | + for (var j = 0; j < custom_region.length; j++) { |
2679 | + regions[i++] = custom_region[j]; |
2680 | + } |
2681 | + } |
2682 | + |
2683 | + foreach (var actor in tracked_actors) { |
2684 | + float x, y, w, h; |
2685 | + actor.get_transformed_position (out x, out y); |
2686 | + actor.get_transformed_size (out w, out h); |
2687 | + |
2688 | + if (w == 0 || h == 0) |
2689 | + continue; |
2690 | + |
2691 | + regions[i++] = { (short)x, (short)y, (short)w, (short)h }; |
2692 | + } |
2693 | + |
2694 | + region = regions; |
2695 | + |
2696 | + region_changed (); |
2697 | + } |
2698 | + |
2699 | + private void actor_allocation_changed (Clutter.ActorBox box, Clutter.AllocationFlags f) |
2700 | + { |
2701 | + if (!freeze_track) |
2702 | + update_region (); |
2703 | + } |
2704 | + } |
2705 | +} |
2706 | + |
2707 | |
2708 | === added file 'lib/Utils.vala' |
2709 | --- lib/Utils.vala 1970-01-01 00:00:00 +0000 |
2710 | +++ lib/Utils.vala 2014-04-06 18:03:36 +0000 |
2711 | @@ -0,0 +1,268 @@ |
2712 | +// |
2713 | +// Copyright (C) 2012 Tom Beckmann, Rico Tzschichholz |
2714 | +// |
2715 | +// This program is free software: you can redistribute it and/or modify |
2716 | +// it under the terms of the GNU General Public License as published by |
2717 | +// the Free Software Foundation, either version 3 of the License, or |
2718 | +// (at your option) any later version. |
2719 | +// |
2720 | +// This program is distributed in the hope that it will be useful, |
2721 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2722 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2723 | +// GNU General Public License for more details. |
2724 | +// |
2725 | +// You should have received a copy of the GNU General Public License |
2726 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
2727 | +// |
2728 | + |
2729 | +namespace Gala |
2730 | +{ |
2731 | + public class Utils |
2732 | + { |
2733 | + // Cache xid:pixbuf and icon:pixbuf pairs to provide a faster way aquiring icons |
2734 | + static Gee.HashMap<string, Gdk.Pixbuf> xid_pixbuf_cache; |
2735 | + static Gee.HashMap<string, Gdk.Pixbuf> icon_pixbuf_cache; |
2736 | + static uint cache_clear_timeout = 0; |
2737 | + |
2738 | + static construct |
2739 | + { |
2740 | + xid_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> (); |
2741 | + icon_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> (); |
2742 | + } |
2743 | + |
2744 | + /** |
2745 | + * Clean icon caches |
2746 | + */ |
2747 | + static void clean_icon_cache (uint32[] xids) |
2748 | + { |
2749 | + var list = xid_pixbuf_cache.keys.to_array (); |
2750 | + var pixbuf_list = icon_pixbuf_cache.values.to_array (); |
2751 | + var icon_list = icon_pixbuf_cache.keys.to_array (); |
2752 | + |
2753 | + foreach (var xid_key in list) { |
2754 | + var xid = (uint32)uint64.parse (xid_key.split ("::")[0]); |
2755 | + if (!(xid in xids)) { |
2756 | + var pixbuf = xid_pixbuf_cache.get (xid_key); |
2757 | + for (var j = 0; j < pixbuf_list.length; j++) { |
2758 | + if (pixbuf_list[j] == pixbuf) { |
2759 | + xid_pixbuf_cache.unset (icon_list[j]); |
2760 | + } |
2761 | + } |
2762 | + |
2763 | + xid_pixbuf_cache.unset (xid_key); |
2764 | + } |
2765 | + } |
2766 | + } |
2767 | + |
2768 | + public static void request_clean_icon_cache (uint32[] xids) |
2769 | + { |
2770 | + if (cache_clear_timeout > 0) |
2771 | + GLib.Source.remove (cache_clear_timeout); |
2772 | + |
2773 | + cache_clear_timeout = Timeout.add_seconds (30, () => { |
2774 | + cache_clear_timeout = 0; |
2775 | + Idle.add (() => { |
2776 | + clean_icon_cache (xids); |
2777 | + return false; |
2778 | + }); |
2779 | + return false; |
2780 | + }); |
2781 | + } |
2782 | + |
2783 | + /** |
2784 | + * returns a pixbuf for the application of this window or a default icon |
2785 | + **/ |
2786 | + public static Gdk.Pixbuf get_icon_for_window (Meta.Window window, int size) |
2787 | + { |
2788 | + Gdk.Pixbuf? result = null; |
2789 | + |
2790 | + var xid = (uint32)window.get_xwindow (); |
2791 | + var xid_key = "%u::%i".printf (xid, size); |
2792 | + |
2793 | + if ((result = xid_pixbuf_cache.get (xid_key)) != null) |
2794 | + return result; |
2795 | + |
2796 | + var app = Bamf.Matcher.get_default ().get_application_for_xid (xid); |
2797 | + result = get_icon_for_application (app, size); |
2798 | + |
2799 | + xid_pixbuf_cache.set (xid_key, result); |
2800 | + |
2801 | + return result; |
2802 | + } |
2803 | + |
2804 | + /** |
2805 | + * returns a pixbuf for this application or a default icon |
2806 | + **/ |
2807 | + public static Gdk.Pixbuf get_icon_for_application (Bamf.Application app, int size) |
2808 | + { |
2809 | + Gdk.Pixbuf? image = null; |
2810 | + bool not_cached = false; |
2811 | + |
2812 | + string? icon = null; |
2813 | + string? icon_key = null; |
2814 | + |
2815 | + if (app != null && app.get_desktop_file () != null) { |
2816 | + try { |
2817 | + var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ()); |
2818 | + if (appinfo != null) { |
2819 | + icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ()); |
2820 | + icon_key = "%s::%i".printf (icon, size); |
2821 | + if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
2822 | + image = Plank.Drawing.DrawingService.load_icon (icon, size, size); |
2823 | + not_cached = true; |
2824 | + } |
2825 | + } |
2826 | + } catch (Error e) { |
2827 | + warning (e.message); |
2828 | + } |
2829 | + } |
2830 | + |
2831 | + if (image == null) { |
2832 | + try { |
2833 | + unowned Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default (); |
2834 | + icon = "application-default-icon"; |
2835 | + icon_key = "%s::%i".printf (icon, size); |
2836 | + if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
2837 | + image = icon_theme.load_icon (icon, size, 0); |
2838 | + not_cached = true; |
2839 | + } |
2840 | + } catch (Error e) { |
2841 | + warning (e.message); |
2842 | + } |
2843 | + } |
2844 | + |
2845 | + if (image == null) { |
2846 | + icon = ""; |
2847 | + icon_key = "::%i".printf (size); |
2848 | + if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
2849 | + image = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, size, size); |
2850 | + image.fill (0x00000000); |
2851 | + not_cached = true; |
2852 | + } |
2853 | + } |
2854 | + |
2855 | + if (size != image.width || size != image.height) |
2856 | + image = Plank.Drawing.DrawingService.ar_scale (image, size, size); |
2857 | + |
2858 | + if (not_cached) |
2859 | + icon_pixbuf_cache.set (icon_key, image); |
2860 | + |
2861 | + return image; |
2862 | + } |
2863 | + |
2864 | + /** |
2865 | + * get the next window that should be active on a workspace right now |
2866 | + **/ |
2867 | + public static Meta.Window get_next_window (Meta.Workspace workspace, bool backward=false) |
2868 | + { |
2869 | + var screen = workspace.get_screen (); |
2870 | + var display = screen.get_display (); |
2871 | + |
2872 | + var window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
2873 | + screen.get_active_workspace (), null, backward); |
2874 | + |
2875 | + if (window == null) |
2876 | + window = display.get_tab_current (Meta.TabList.NORMAL, screen, workspace); |
2877 | + |
2878 | + return window; |
2879 | + } |
2880 | + |
2881 | + /** |
2882 | + * get the number of toplevel windows on a workspace |
2883 | + **/ |
2884 | + public static uint get_n_windows (Meta.Workspace workspace) |
2885 | + { |
2886 | + var n = 0; |
2887 | + foreach (var window in workspace.list_windows ()) { |
2888 | + if (window.is_on_all_workspaces ()) |
2889 | + continue; |
2890 | + if (window.window_type == Meta.WindowType.NORMAL || |
2891 | + window.window_type == Meta.WindowType.DIALOG || |
2892 | + window.window_type == Meta.WindowType.MODAL_DIALOG) |
2893 | + n ++; |
2894 | + } |
2895 | + |
2896 | + return n; |
2897 | + } |
2898 | + |
2899 | + static Gtk.CssProvider fallback_style = null; |
2900 | + |
2901 | + public static Gtk.CssProvider get_default_style () |
2902 | + { |
2903 | + if (fallback_style == null) { |
2904 | + fallback_style = new Gtk.CssProvider (); |
2905 | + try { |
2906 | + fallback_style.load_from_path (Config.PKGDATADIR + "/gala.css"); |
2907 | + } catch (Error e) { warning (e.message); } |
2908 | + } |
2909 | + |
2910 | + return fallback_style; |
2911 | + } |
2912 | + |
2913 | + public static void get_window_frame_offset (Meta.Window window, out float x, out float y, out float width, out float height) |
2914 | + { |
2915 | + var actor = window.get_compositor_private () as Clutter.Actor; |
2916 | + var frame = window.get_outer_rect (); |
2917 | + x = actor.x - frame.x; |
2918 | + y = actor.y - frame.y; |
2919 | + width = actor.width - frame.width; |
2920 | + height = actor.height - frame.height; |
2921 | + } |
2922 | + |
2923 | + public static void bell (Meta.Screen screen) |
2924 | + { |
2925 | + if (Meta.Prefs.bell_is_audible ()) |
2926 | + Gdk.beep (); |
2927 | + else |
2928 | + screen.get_display ().get_compositor ().flash_screen (screen); |
2929 | + } |
2930 | + |
2931 | + /** |
2932 | + * Plank DockTheme |
2933 | + */ |
2934 | + public class DockThemeManager : Object |
2935 | + { |
2936 | + Plank.DockPreferences? dock_settings = null; |
2937 | + Plank.Drawing.DockTheme? dock_theme = null; |
2938 | + |
2939 | + public signal void dock_theme_changed (Plank.Drawing.DockTheme? old_theme, |
2940 | + Plank.Drawing.DockTheme new_theme); |
2941 | + |
2942 | + DockThemeManager () |
2943 | + { |
2944 | + dock_settings = new Plank.DockPreferences.with_filename (Environment.get_user_config_dir () + "/plank/dock1/settings"); |
2945 | + dock_settings.notify["Theme"].connect (load_dock_theme); |
2946 | + } |
2947 | + |
2948 | + public Plank.Drawing.DockTheme get_dock_theme () |
2949 | + { |
2950 | + if (dock_theme == null) |
2951 | + load_dock_theme (); |
2952 | + |
2953 | + return dock_theme; |
2954 | + } |
2955 | + |
2956 | + public Plank.DockPreferences get_dock_settings () |
2957 | + { |
2958 | + return dock_settings; |
2959 | + } |
2960 | + |
2961 | + void load_dock_theme () |
2962 | + { |
2963 | + var new_theme = new Plank.Drawing.DockTheme (dock_settings.Theme); |
2964 | + new_theme.load ("dock"); |
2965 | + dock_theme_changed (dock_theme, new_theme); |
2966 | + dock_theme = new_theme; |
2967 | + } |
2968 | + |
2969 | + static DockThemeManager? instance = null; |
2970 | + public static DockThemeManager get_default () |
2971 | + { |
2972 | + if (instance == null) |
2973 | + instance = new DockThemeManager (); |
2974 | + |
2975 | + return instance; |
2976 | + } |
2977 | + } |
2978 | + } |
2979 | +} |
2980 | |
2981 | === added file 'lib/WindowManager.vala' |
2982 | --- lib/WindowManager.vala 1970-01-01 00:00:00 +0000 |
2983 | +++ lib/WindowManager.vala 2014-04-06 18:03:36 +0000 |
2984 | @@ -0,0 +1,53 @@ |
2985 | +// |
2986 | +// Copyright (C) 2014 Tom Beckmann |
2987 | +// |
2988 | +// This program is free software: you can redistribute it and/or modify |
2989 | +// it under the terms of the GNU General Public License as published by |
2990 | +// the Free Software Foundation, either version 3 of the License, or |
2991 | +// (at your option) any later version. |
2992 | +// |
2993 | +// This program is distributed in the hope that it will be useful, |
2994 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
2995 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2996 | +// GNU General Public License for more details. |
2997 | +// |
2998 | +// You should have received a copy of the GNU General Public License |
2999 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
3000 | +// |
3001 | + |
3002 | +namespace Gala |
3003 | +{ |
3004 | + public enum ActionType |
3005 | + { |
3006 | + NONE = 0, |
3007 | + SHOW_WORKSPACE_VIEW, |
3008 | + MAXIMIZE_CURRENT, |
3009 | + MINIMIZE_CURRENT, |
3010 | + OPEN_LAUNCHER, |
3011 | + CUSTOM_COMMAND, |
3012 | + WINDOW_OVERVIEW, |
3013 | + WINDOW_OVERVIEW_ALL |
3014 | + } |
3015 | + |
3016 | + public enum InputArea |
3017 | + { |
3018 | + NONE, |
3019 | + FULLSCREEN, |
3020 | + HOT_CORNER |
3021 | + } |
3022 | + |
3023 | + public interface WindowManager : Meta.Plugin |
3024 | + { |
3025 | + public abstract Clutter.Actor ui_group { get; protected set; } |
3026 | + public abstract Meta.BackgroundGroup background_group { get; protected set; } |
3027 | + public abstract Clutter.Stage stage { get; protected set; } |
3028 | + |
3029 | + public abstract void begin_modal (); |
3030 | + public abstract void end_modal (); |
3031 | + public abstract void perform_action (ActionType type); |
3032 | + public abstract void update_input_area (); |
3033 | + public abstract void move_window (Meta.Window? window, Meta.MotionDirection direction); |
3034 | + public abstract void switch_to_next_workspace (Meta.MotionDirection direction); |
3035 | + } |
3036 | +} |
3037 | + |
3038 | |
3039 | === added directory 'plugins' |
3040 | === added file 'plugins/Makefile.am' |
3041 | --- plugins/Makefile.am 1970-01-01 00:00:00 +0000 |
3042 | +++ plugins/Makefile.am 2014-04-06 18:03:36 +0000 |
3043 | @@ -0,0 +1,3 @@ |
3044 | +SUBDIRS = \ |
3045 | + zoom \ |
3046 | + $(NULL) |
3047 | |
3048 | === added directory 'plugins/template' |
3049 | === added file 'plugins/template/Main.vala' |
3050 | --- plugins/template/Main.vala 1970-01-01 00:00:00 +0000 |
3051 | +++ plugins/template/Main.vala 2014-04-06 18:03:36 +0000 |
3052 | @@ -0,0 +1,118 @@ |
3053 | +// |
3054 | +// Copyright (C) 2014 Tom Beckmann |
3055 | +// |
3056 | +// This program is free software: you can redistribute it and/or modify |
3057 | +// it under the terms of the GNU General Public License as published by |
3058 | +// the Free Software Foundation, either version 3 of the License, or |
3059 | +// (at your option) any later version. |
3060 | +// |
3061 | +// This program is distributed in the hope that it will be useful, |
3062 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3063 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3064 | +// GNU General Public License for more details. |
3065 | +// |
3066 | +// You should have received a copy of the GNU General Public License |
3067 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
3068 | +// |
3069 | + |
3070 | +/* |
3071 | + This is a template class showing some of the things that can be done |
3072 | + with a gala plugin and how to do them. |
3073 | +*/ |
3074 | + |
3075 | +namespace Gala.Plugins.Template |
3076 | +{ |
3077 | + public class Main : Gala.Plugin |
3078 | + { |
3079 | + const int PADDING = 50; |
3080 | + |
3081 | + Gala.WindowManager? wm = null; |
3082 | + Clutter.Actor red_box; |
3083 | + |
3084 | + // This function is called as soon as Gala has started and gives you |
3085 | + // an instance of the GalaWindowManager class. |
3086 | + public override void initialize (Gala.WindowManager wm) |
3087 | + { |
3088 | + // we will save the instance to our wm property so we can use it later again |
3089 | + // especially helpful when you have larger plugins with more functions, |
3090 | + // we won't need it here |
3091 | + this.wm = wm; |
3092 | + |
3093 | + // for demonstration purposes we'll add a red quad to the stage which will |
3094 | + // turn green when clicked |
3095 | + red_box = new Clutter.Actor (); |
3096 | + red_box.set_size (100, 100); |
3097 | + red_box.background_color = { 255, 0, 0, 255 }; |
3098 | + red_box.reactive = true; |
3099 | + red_box.button_press_event.connect (turn_green); |
3100 | + |
3101 | + // we want to place it in the lower right of the primary monitor with a bit |
3102 | + // of padding. refer to vapi/libmutter.vapi in gala's source for something |
3103 | + // remotely similar to a documentation |
3104 | + var screen = wm.get_screen (); |
3105 | + var rect = screen.get_monitor_geometry (screen.get_primary_monitor ()); |
3106 | + |
3107 | + red_box.x = rect.x + rect.width - red_box.width - PADDING; |
3108 | + red_box.y = rect.y + rect.height - red_box.height - PADDING; |
3109 | + |
3110 | + // to order Gala to deliver mouse events to our box instead of the underlying |
3111 | + // windows, we need to mark the region where the quad is located. |
3112 | + // The plugin class offers an utility function for this purpose, the track_actor |
3113 | + // function. It will update the region with the allocation of the actor |
3114 | + // whenever its allocation changes. Make sure to set freeze_track to |
3115 | + // true while animating the actor to not make gala update the region |
3116 | + // every single frame. |
3117 | + // You can also handle the region manually by setting the custom_region |
3118 | + // property. The tracked actors and custom regions will be merged by |
3119 | + // the plugin. |
3120 | + track_actor (red_box); |
3121 | + |
3122 | + // now we'll add our box into the ui_group. This is where all the shell |
3123 | + // elements and also the windows and backgrouds are located. |
3124 | + wm.ui_group.add_child (red_box); |
3125 | + } |
3126 | + |
3127 | + bool turn_green (Clutter.ButtonEvent event) |
3128 | + { |
3129 | + red_box.background_color = { 0, 255, 0, 255 }; |
3130 | + return true; |
3131 | + } |
3132 | + |
3133 | + // This function is actually not even called by Gala at the moment, |
3134 | + // still it might be a good idea to implement it anyway to make sure |
3135 | + // your plugin is compatible in case we'd add disabling specific plugins |
3136 | + // in the future |
3137 | + public override void destroy () |
3138 | + { |
3139 | + // here you would destroy actors you added to the stage or remove |
3140 | + // keybindings |
3141 | + |
3142 | + red_box.destroy (); |
3143 | + } |
3144 | + } |
3145 | +} |
3146 | + |
3147 | +// this little function just tells Gala which class of those you may have in |
3148 | +// your plugin is the one you want to start with and delivers some additional |
3149 | +// details about your plugin. It also gives you the option to choose a specific |
3150 | +// function which your plugin fulfils. Gala will then make sure that there is |
3151 | +// no duplicate functionality. |
3152 | +public Gala.PluginInfo register_plugin () |
3153 | +{ |
3154 | + return { |
3155 | + "template-plugin", // the plugin's name |
3156 | + "Tom Beckmann <tomjonabc@gmail.com>", // you, the author |
3157 | + typeof (Gala.Plugins.Template.Main), // the type of your plugin class |
3158 | + |
3159 | + Gala.PluginFunction.ADDITION, // the function which your plugin |
3160 | + // fulfils, ADDITION means nothing |
3161 | + // specific |
3162 | + |
3163 | + Gala.LoadPriority.IMMEDIATE // indicates whether your plugin's |
3164 | + // start can be delayed until gala |
3165 | + // has loaded the important stuff or |
3166 | + // if you want your plugin to start |
3167 | + // right away. False means wait. |
3168 | + }; |
3169 | +} |
3170 | + |
3171 | |
3172 | === added file 'plugins/template/Makefile.am' |
3173 | --- plugins/template/Makefile.am 1970-01-01 00:00:00 +0000 |
3174 | +++ plugins/template/Makefile.am 2014-04-06 18:03:36 +0000 |
3175 | @@ -0,0 +1,58 @@ |
3176 | +include $(top_srcdir)/Makefile.common |
3177 | + |
3178 | +VAPIDIR = $(top_srcdir)/vapi |
3179 | + |
3180 | +BUILT_SOURCES = libgala_template_la_vala.stamp |
3181 | + |
3182 | +libgala_template_la_LTLIBRARIES = libgala-template.la |
3183 | + |
3184 | +libgala_template_ladir = $(pkglibdir)/plugins |
3185 | + |
3186 | +libgala_template_la_LDFLAGS = \ |
3187 | + $(PLUGIN_LDFLAGS) \ |
3188 | + $(GALA_CORE_LDFLAGS) \ |
3189 | + $(top_builddir)/lib/libgala.la \ |
3190 | + $(NULL) |
3191 | + |
3192 | +libgala_template_la_CFLAGS = \ |
3193 | + $(GALA_CORE_CFLAGS) \ |
3194 | + -include config.h \ |
3195 | + -w \ |
3196 | + -I$(top_builddir)/lib \ |
3197 | + $(NULL) |
3198 | + |
3199 | +libgala_template_la_VALAFLAGS = \ |
3200 | + $(GALA_CORE_VALAFLAGS) \ |
3201 | + $(top_builddir)/lib/gala.vapi \ |
3202 | + --vapidir $(VAPIDIR) \ |
3203 | + $(VAPIDIR)/config.vapi \ |
3204 | + $(NULL) |
3205 | + |
3206 | +libgala_template_la_LIBADD = \ |
3207 | + $(GALA_CORE_LIBS) \ |
3208 | + $(NULL) |
3209 | + |
3210 | +libgala_template_la_VALASOURCES = \ |
3211 | + Main.vala \ |
3212 | + $(NULL) |
3213 | + |
3214 | +nodist_libgala_template_la_SOURCES = \ |
3215 | + $(BUILT_SOURCES) \ |
3216 | + $(libgala_template_la_VALASOURCES:.vala=.c) \ |
3217 | + $(NULL) |
3218 | + |
3219 | +libgala_template_la_vala.stamp: $(libgala_template_la_VALASOURCES) |
3220 | + $(AM_V_VALA)$(VALAC) \ |
3221 | + $(libgala_template_la_VALAFLAGS) \ |
3222 | + -C \ |
3223 | + $(filter %.vala %.c,$^) |
3224 | + $(AM_V_at)touch $@ |
3225 | + |
3226 | +CLEANFILES = \ |
3227 | + $(nodist_libgala_template_la_SOURCES) \ |
3228 | + $(NULL) |
3229 | + |
3230 | +EXTRA_DIST = \ |
3231 | + $(libgala_template_la_VALASOURCES) \ |
3232 | + $(NULL) |
3233 | + |
3234 | |
3235 | === added file 'plugins/template/README' |
3236 | --- plugins/template/README 1970-01-01 00:00:00 +0000 |
3237 | +++ plugins/template/README 2014-04-06 18:03:36 +0000 |
3238 | @@ -0,0 +1,73 @@ |
3239 | + |
3240 | +Note for compilition |
3241 | +-------------------- |
3242 | +If you want your own plugin within this source tree |
3243 | +don't forget to add the new subdirectory to the plugins' Makefile.am |
3244 | +SUBDIRS list and add your Makefile to the list of Makefiles found at |
3245 | +about the end of the configure.ac file AC_CONFIG_FILES. |
3246 | +The API is currently internal until the API is finalized, so you have |
3247 | +to build it in this source tree. |
3248 | + |
3249 | +Some more useful notes on developing plugins: |
3250 | + |
3251 | +Modal Mode |
3252 | +---------- |
3253 | +If you want to display large elements that can be toggled instead of small overlays, |
3254 | +you can use wm.begin_modal() to make Gala enter modal mode. In this mode, you'll be |
3255 | +able to receive key events and all mouse events will be delivered regardless of the |
3256 | +region you have set. Don't forget to call wm.end_modal() and provide an obvious way |
3257 | +to exit modal mode for the user, otherwise he will be stuck and can only restart |
3258 | +Gala. |
3259 | + |
3260 | +Keybindings |
3261 | +----------- |
3262 | +To add keybindings, you'll need a gsettings schema. You can take a look at Gala's |
3263 | +schema in data/org.pantheon.desktop.gschema.xml for an example. You'll also find |
3264 | +how to correctly declare shortcut keys in that file. Once you got this file ready |
3265 | +it's pretty easy. Just enable its installation in cmake, the relevant is commented |
3266 | +out in this template, and call wm.get_screen().get_display().add_keybinding(). |
3267 | +The keybinding function takes the name of the shortcut key in your |
3268 | +schema, then a GSettings instance for that schema, which can be obtained with |
3269 | +'new GLib.Settings("org.pantheon.gala.plugins.my-plugin")', then some flags, for |
3270 | +which you can almost always use 0, refer to the vapi for more details, and finally |
3271 | +your function as arguments. Its delegate is: |
3272 | + |
3273 | +public delegate void KeyHandlerFunc (Meta.Display display, Meta.Screen screen, |
3274 | + Meta.Window? window, X.Event event, Meta.KeyBinding binding); |
3275 | + |
3276 | +So it'd be something like |
3277 | + |
3278 | +void initialize (Gala.WindowManager wm) |
3279 | +{ |
3280 | + [...] |
3281 | + var display = wm.get_screen ().get_display (); |
3282 | + var schema = new GLib.Settings ("org.pantheon.desktop.gala.plugins"); |
3283 | + display.add_keybinding ("my-shortcut", schema, 0, my_handler); |
3284 | + [...] |
3285 | +} |
3286 | +void my_handler (Meta.Display display, Meta.Screen screen, Meta.Window? window, |
3287 | + X.Event event, Meta.KeyBinding binding) |
3288 | +{ |
3289 | + print ("Shortcut hit! D:"); |
3290 | +} |
3291 | +void destroy () |
3292 | +{ |
3293 | + wm.get_screen ().get_display ().remove_keybinding ("my-shortcut"); |
3294 | +} |
3295 | + |
3296 | +Overriding default keybindings |
3297 | +------------------------------ |
3298 | +Libmutter allows you to override exisiting shortcuts, which is a lot easier than |
3299 | +adding new ones. All you have to do is: |
3300 | + |
3301 | +Keybinding.set_custom_handler ("shortcut-name", my_handler); |
3302 | + |
3303 | +The signature for my_handler is the same as above. |
3304 | + |
3305 | +More info |
3306 | +--------- |
3307 | +A great source for exploring the possibilities of mutter's API is scrolling through |
3308 | +the mentioned mutter vapi. In some cases you can find documentation on particular |
3309 | +functions in the mutter source code. Just grep for their C names. |
3310 | + |
3311 | +*/ |
3312 | |
3313 | === added directory 'plugins/zoom' |
3314 | === renamed file 'src/Zooming.vala' => 'plugins/zoom/Main.vala' |
3315 | --- src/Zooming.vala 2013-11-27 18:50:56 +0000 |
3316 | +++ plugins/zoom/Main.vala 2014-04-06 18:03:36 +0000 |
3317 | @@ -1,5 +1,5 @@ |
3318 | // |
3319 | -// Copyright (C) 2012 Tom Beckmann, Rico Tzschichholz |
3320 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
3321 | // |
3322 | // This program is free software: you can redistribute it and/or modify |
3323 | // it under the terms of the GNU General Public License as published by |
3324 | @@ -15,39 +15,54 @@ |
3325 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
3326 | // |
3327 | |
3328 | -using Clutter; |
3329 | -using Meta; |
3330 | - |
3331 | -namespace Gala |
3332 | +namespace Gala.Plugins.Zoom |
3333 | { |
3334 | - public class Zooming : Object |
3335 | + public class Main : Gala.Plugin |
3336 | { |
3337 | - Plugin plugin; |
3338 | - |
3339 | const uint MOUSE_POLL_TIME = 50; |
3340 | + |
3341 | + Gala.WindowManager? wm = null; |
3342 | + |
3343 | uint mouse_poll_timer = 0; |
3344 | float current_zoom = 1.0f; |
3345 | - |
3346 | - public Zooming (Plugin _plugin) |
3347 | + |
3348 | + public override void initialize (Gala.WindowManager wm) |
3349 | { |
3350 | - plugin = _plugin; |
3351 | + this.wm = wm; |
3352 | + var display = wm.get_screen ().get_display (); |
3353 | + var schema = new GLib.Settings (Config.SCHEMA + ".keybindings"); |
3354 | + |
3355 | + display.add_keybinding ("zoom-in", schema, 0, zoom_in); |
3356 | + display.add_keybinding ("zoom-out", schema, 0, zoom_out); |
3357 | } |
3358 | - |
3359 | - ~Zooming () |
3360 | + |
3361 | + public override void destroy () |
3362 | { |
3363 | + if (wm == null) |
3364 | + return; |
3365 | + |
3366 | + var display = wm.get_screen ().get_display (); |
3367 | + |
3368 | + display.remove_keybinding ("zoom-in"); |
3369 | + display.remove_keybinding ("zoom-out"); |
3370 | + |
3371 | if (mouse_poll_timer > 0) |
3372 | Source.remove (mouse_poll_timer); |
3373 | mouse_poll_timer = 0; |
3374 | } |
3375 | - |
3376 | - public void zoom_in () { |
3377 | + |
3378 | + void zoom_in (Meta.Display display, Meta.Screen screen, |
3379 | + Meta.Window? window, X.Event event, Meta.KeyBinding binding) |
3380 | + { |
3381 | zoom (true); |
3382 | } |
3383 | - |
3384 | - public void zoom_out () { |
3385 | + |
3386 | + void zoom_out (Meta.Display display, Meta.Screen screen, |
3387 | + Meta.Window? window, X.Event event, Meta.KeyBinding binding) |
3388 | + { |
3389 | zoom (false); |
3390 | } |
3391 | - |
3392 | + |
3393 | void zoom (bool @in) |
3394 | { |
3395 | // Nothing to do if zooming out of our bounds is requested |
3396 | @@ -56,7 +71,7 @@ |
3397 | else if (current_zoom >= 2.5f && @in) |
3398 | return; |
3399 | |
3400 | - var wins = Compositor.get_window_group_for_screen (plugin.get_screen ()); |
3401 | + var wins = wm.ui_group; |
3402 | |
3403 | // Add timer to poll current mouse position to reposition window-group |
3404 | // to show requested zoomed area |
3405 | @@ -67,12 +82,12 @@ |
3406 | wins.scale_center_x = mx; |
3407 | wins.scale_center_y = my; |
3408 | |
3409 | - mouse_poll_timer = Clutter.Threads.Timeout.add (MOUSE_POLL_TIME, () => { |
3410 | + mouse_poll_timer = Timeout.add (MOUSE_POLL_TIME, () => { |
3411 | client_pointer.get_position (null, out mx, out my); |
3412 | if (wins.scale_center_x == mx && wins.scale_center_y == my) |
3413 | return true; |
3414 | |
3415 | - wins.animate (AnimationMode.LINEAR, MOUSE_POLL_TIME, scale_center_x : mx, scale_center_y : my); |
3416 | + wins.animate (Clutter.AnimationMode.LINEAR, MOUSE_POLL_TIME, scale_center_x : mx, scale_center_y : my); |
3417 | |
3418 | return true; |
3419 | }); |
3420 | @@ -87,7 +102,7 @@ |
3421 | Source.remove (mouse_poll_timer); |
3422 | mouse_poll_timer = 0; |
3423 | |
3424 | - wins.animate (AnimationMode.EASE_OUT_CUBIC, 300, scale_x : 1.0f, scale_y : 1.0f).completed.connect (() => { |
3425 | + wins.animate (Clutter.AnimationMode.EASE_OUT_CUBIC, 300, scale_x : 1.0f, scale_y : 1.0f).completed.connect (() => { |
3426 | wins.scale_center_x = 0.0f; |
3427 | wins.scale_center_y = 0.0f; |
3428 | }); |
3429 | @@ -95,7 +110,19 @@ |
3430 | return; |
3431 | } |
3432 | |
3433 | - wins.animate (AnimationMode.EASE_OUT_CUBIC, 300, scale_x : current_zoom, scale_y : current_zoom); |
3434 | + wins.animate (Clutter.AnimationMode.EASE_OUT_CUBIC, 300, scale_x : current_zoom, scale_y : current_zoom); |
3435 | } |
3436 | } |
3437 | } |
3438 | + |
3439 | +public Gala.PluginInfo register_plugin () |
3440 | +{ |
3441 | + return Gala.PluginInfo () { |
3442 | + name = "Zoom", |
3443 | + author = "Gala Developers", |
3444 | + plugin_type = typeof (Gala.Plugins.Zoom.Main), |
3445 | + provides = Gala.PluginFunction.ADDITION, |
3446 | + load_priority = Gala.LoadPriority.IMMEDIATE |
3447 | + }; |
3448 | +} |
3449 | + |
3450 | |
3451 | === added file 'plugins/zoom/Makefile.am' |
3452 | --- plugins/zoom/Makefile.am 1970-01-01 00:00:00 +0000 |
3453 | +++ plugins/zoom/Makefile.am 2014-04-06 18:03:36 +0000 |
3454 | @@ -0,0 +1,58 @@ |
3455 | +include $(top_srcdir)/Makefile.common |
3456 | + |
3457 | +VAPIDIR = $(top_srcdir)/vapi |
3458 | + |
3459 | +BUILT_SOURCES = libgala_zoom_la_vala.stamp |
3460 | + |
3461 | +libgala_zoom_la_LTLIBRARIES = libgala-zoom.la |
3462 | + |
3463 | +libgala_zoom_ladir = $(pkglibdir)/plugins |
3464 | + |
3465 | +libgala_zoom_la_LDFLAGS = \ |
3466 | + $(PLUGIN_LDFLAGS) \ |
3467 | + $(GALA_CORE_LDFLAGS) \ |
3468 | + $(top_builddir)/lib/libgala.la \ |
3469 | + $(NULL) |
3470 | + |
3471 | +libgala_zoom_la_CFLAGS = \ |
3472 | + $(GALA_CORE_CFLAGS) \ |
3473 | + -include config.h \ |
3474 | + -w \ |
3475 | + -I$(top_builddir)/lib \ |
3476 | + $(NULL) |
3477 | + |
3478 | +libgala_zoom_la_VALAFLAGS = \ |
3479 | + $(GALA_CORE_VALAFLAGS) \ |
3480 | + $(top_builddir)/lib/gala.vapi \ |
3481 | + --vapidir $(VAPIDIR) \ |
3482 | + $(VAPIDIR)/config.vapi \ |
3483 | + $(NULL) |
3484 | + |
3485 | +libgala_zoom_la_LIBADD = \ |
3486 | + $(GALA_CORE_LIBS) \ |
3487 | + $(NULL) |
3488 | + |
3489 | +libgala_zoom_la_VALASOURCES = \ |
3490 | + Main.vala \ |
3491 | + $(NULL) |
3492 | + |
3493 | +nodist_libgala_zoom_la_SOURCES = \ |
3494 | + $(BUILT_SOURCES) \ |
3495 | + $(libgala_zoom_la_VALASOURCES:.vala=.c) \ |
3496 | + $(NULL) |
3497 | + |
3498 | +libgala_zoom_la_vala.stamp: $(libgala_zoom_la_VALASOURCES) |
3499 | + $(AM_V_VALA)$(VALAC) \ |
3500 | + $(libgala_zoom_la_VALAFLAGS) \ |
3501 | + -C \ |
3502 | + $(filter %.vala %.c,$^) |
3503 | + $(AM_V_at)touch $@ |
3504 | + |
3505 | +CLEANFILES = \ |
3506 | + $(nodist_libgala_zoom_la_SOURCES) \ |
3507 | + $(NULL) |
3508 | + |
3509 | +EXTRA_DIST = \ |
3510 | + $(libgala_zoom_la_VALASOURCES) \ |
3511 | + $(NULL) |
3512 | + |
3513 | |
3514 | === added directory 'po' |
3515 | === removed directory 'po' |
3516 | === removed file 'po/CMakeLists.txt' |
3517 | --- po/CMakeLists.txt 2012-05-20 13:20:38 +0000 |
3518 | +++ po/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
3519 | @@ -1,5 +0,0 @@ |
3520 | -include (Translations) |
3521 | -add_translations_directory ("agenda") |
3522 | -add_translations_catalog ("agenda" |
3523 | - ../src |
3524 | -) |
3525 | |
3526 | === added file 'po/POTFILES.in' |
3527 | === modified file 'src/Background/Background.vala' |
3528 | --- src/Background/Background.vala 2014-03-06 21:21:43 +0000 |
3529 | +++ src/Background/Background.vala 2014-04-06 18:03:36 +0000 |
3530 | @@ -17,7 +17,6 @@ |
3531 | |
3532 | namespace Gala |
3533 | { |
3534 | -#if HAS_MUTTER38 |
3535 | /** |
3536 | * Group that holds a pattern at the very bottom and then an image showing the |
3537 | * current wallpaper above (and one more additional image for transitions). |
3538 | @@ -199,6 +198,5 @@ |
3539 | return GDesktop.BackgroundStyle.NONE; |
3540 | } |
3541 | } |
3542 | -#endif |
3543 | } |
3544 | |
3545 | |
3546 | === modified file 'src/Background/BackgroundCache.vala' |
3547 | --- src/Background/BackgroundCache.vala 2013-11-22 20:14:24 +0000 |
3548 | +++ src/Background/BackgroundCache.vala 2014-04-06 18:03:36 +0000 |
3549 | @@ -17,7 +17,6 @@ |
3550 | |
3551 | namespace Gala |
3552 | { |
3553 | -#if HAS_MUTTER38 |
3554 | public class BackgroundCache : Object |
3555 | { |
3556 | struct WaitingCallback |
3557 | @@ -114,6 +113,5 @@ |
3558 | return content; |
3559 | } |
3560 | } |
3561 | -#endif |
3562 | } |
3563 | |
3564 | |
3565 | === modified file 'src/Background/BackgroundManager.vala' |
3566 | --- src/Background/BackgroundManager.vala 2014-03-05 22:21:28 +0000 |
3567 | +++ src/Background/BackgroundManager.vala 2014-04-06 18:03:36 +0000 |
3568 | @@ -17,7 +17,6 @@ |
3569 | |
3570 | namespace Gala |
3571 | { |
3572 | -#if HAS_MUTTER38 |
3573 | public class BackgroundManager : Meta.BackgroundGroup |
3574 | { |
3575 | public Meta.Screen screen { get; construct; } |
3576 | @@ -69,6 +68,5 @@ |
3577 | changed (); |
3578 | } |
3579 | } |
3580 | -#endif |
3581 | } |
3582 | |
3583 | |
3584 | === modified file 'src/Background/SlideShow.vala' |
3585 | --- src/Background/SlideShow.vala 2013-11-27 18:50:56 +0000 |
3586 | +++ src/Background/SlideShow.vala 2014-04-06 18:03:36 +0000 |
3587 | @@ -17,7 +17,6 @@ |
3588 | |
3589 | namespace Gala |
3590 | { |
3591 | -#if HAS_MUTTER38 |
3592 | public class SlideShow : Meta.BackgroundGroup |
3593 | { |
3594 | const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0; |
3595 | @@ -158,6 +157,5 @@ |
3596 | queue_update_animation (); |
3597 | } |
3598 | } |
3599 | -#endif |
3600 | } |
3601 | |
3602 | |
3603 | === modified file 'src/Background/SystemBackground.vala' |
3604 | --- src/Background/SystemBackground.vala 2013-11-22 20:14:24 +0000 |
3605 | +++ src/Background/SystemBackground.vala 2014-04-06 18:03:36 +0000 |
3606 | @@ -17,7 +17,6 @@ |
3607 | |
3608 | namespace Gala |
3609 | { |
3610 | -#if HAS_MUTTER38 |
3611 | public class SystemBackground : Meta.BackgroundActor |
3612 | { |
3613 | public SystemBackground () |
3614 | @@ -34,6 +33,5 @@ |
3615 | }); |
3616 | } |
3617 | } |
3618 | -#endif |
3619 | } |
3620 | |
3621 | |
3622 | === removed file 'src/Config.vala.cmake' |
3623 | --- src/Config.vala.cmake 2012-07-23 15:51:59 +0000 |
3624 | +++ src/Config.vala.cmake 1970-01-01 00:00:00 +0000 |
3625 | @@ -1,27 +0,0 @@ |
3626 | -// |
3627 | -// Copyright (C) 2011 Tom Beckmann |
3628 | -// |
3629 | -// This program is free software: you can redistribute it and/or modify |
3630 | -// it under the terms of the GNU General Public License as published by |
3631 | -// the Free Software Foundation, either version 3 of the License, or |
3632 | -// (at your option) any later version. |
3633 | -// |
3634 | -// This program is distributed in the hope that it will be useful, |
3635 | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
3636 | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3637 | -// GNU General Public License for more details. |
3638 | -// |
3639 | -// You should have received a copy of the GNU General Public License |
3640 | -// along with this program. If not, see <http://www.gnu.org/licenses/>. |
3641 | -// |
3642 | - |
3643 | -namespace Config { |
3644 | - public const string DATADIR = "@DATADIR@"; |
3645 | - public const string PKGDATADIR = "@PKGDATADIR@"; |
3646 | - public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; |
3647 | - public const string RELEASE_NAME = "@RELEASE_NAME@"; |
3648 | - public const string VERSION = "@VERSION@"; |
3649 | - public const string VERSION_INFO = "@VERSION_INFO@"; |
3650 | - public const string PLUGINDIR = "@PLUGINDIR@"; |
3651 | - public const string SCHEMA = "org.pantheon.desktop.gala"; |
3652 | -} |
3653 | |
3654 | === modified file 'src/DBus.vala' |
3655 | --- src/DBus.vala 2014-03-17 22:44:47 +0000 |
3656 | +++ src/DBus.vala 2014-04-06 18:03:36 +0000 |
3657 | @@ -21,12 +21,12 @@ |
3658 | public class DBus |
3659 | { |
3660 | static DBus? instance; |
3661 | - static Plugin plugin; |
3662 | + static WindowManager wm; |
3663 | |
3664 | [DBus (visibile = false)] |
3665 | - public static void init (Plugin _plugin) |
3666 | + public static void init (WindowManager _wm) |
3667 | { |
3668 | - plugin = _plugin; |
3669 | + wm = _wm; |
3670 | |
3671 | Bus.own_name (BusType.SESSION, "org.pantheon.gala", BusNameOwnerFlags.NONE, |
3672 | (connection) => { |
3673 | @@ -43,20 +43,17 @@ |
3674 | |
3675 | private DBus () |
3676 | { |
3677 | -#if HAS_MUTTER38 |
3678 | - if (plugin.background_group != null) |
3679 | - (plugin.background_group as BackgroundManager).changed.connect (() => background_changed ()); |
3680 | + if (wm.background_group != null) |
3681 | + (wm.background_group as BackgroundManager).changed.connect (() => background_changed ()); |
3682 | else |
3683 | assert_not_reached (); |
3684 | -#endif |
3685 | } |
3686 | |
3687 | public void perform_action (ActionType type) |
3688 | { |
3689 | - plugin.perform_action (type); |
3690 | + wm.perform_action (type); |
3691 | } |
3692 | |
3693 | -#if HAS_MUTTER38 |
3694 | const double SATURATION_WEIGHT = 1.5; |
3695 | const double WEIGHT_THRESHOLD = 1.0; |
3696 | |
3697 | @@ -104,7 +101,7 @@ |
3698 | int reference_x, int reference_y, int reference_width, int reference_height) |
3699 | throws DBusError |
3700 | { |
3701 | - var background = plugin.background_group.get_child_at_index (monitor); |
3702 | + var background = wm.background_group.get_child_at_index (monitor); |
3703 | if (background == null) |
3704 | throw new DBusError.INVALID_ARGS ("Invalid monitor requested"); |
3705 | |
3706 | @@ -224,6 +221,5 @@ |
3707 | |
3708 | return { rTotal, gTotal, bTotal, mean, variance }; |
3709 | } |
3710 | -#endif |
3711 | } |
3712 | } |
3713 | |
3714 | === renamed file 'src/Utils.vala' => 'src/InternalUtils.vala' |
3715 | --- src/Utils.vala 2013-07-14 17:20:53 +0000 |
3716 | +++ src/InternalUtils.vala 2014-04-06 18:03:36 +0000 |
3717 | @@ -21,7 +21,7 @@ |
3718 | |
3719 | namespace Gala |
3720 | { |
3721 | - public class Utils |
3722 | + public class InternalUtils |
3723 | { |
3724 | /* |
3725 | * Reload shadow settings |
3726 | @@ -57,154 +57,6 @@ |
3727 | factory.set_params ("modal_dialog", false, shadow); |
3728 | } |
3729 | |
3730 | - // Cache xid:pixbuf and icon:pixbuf pairs to provide a faster way aquiring icons |
3731 | - static Gee.HashMap<string, Gdk.Pixbuf> xid_pixbuf_cache; |
3732 | - static Gee.HashMap<string, Gdk.Pixbuf> icon_pixbuf_cache; |
3733 | - static uint cache_clear_timeout = 0; |
3734 | - |
3735 | - static construct |
3736 | - { |
3737 | - xid_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> (); |
3738 | - icon_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> (); |
3739 | - } |
3740 | - |
3741 | - /** |
3742 | - * Clean icon caches |
3743 | - */ |
3744 | - static void clean_icon_cache (uint32[] xids) |
3745 | - { |
3746 | - var list = xid_pixbuf_cache.keys.to_array (); |
3747 | - var pixbuf_list = icon_pixbuf_cache.values.to_array (); |
3748 | - var icon_list = icon_pixbuf_cache.keys.to_array (); |
3749 | - |
3750 | - foreach (var xid_key in list) { |
3751 | - var xid = (uint32)uint64.parse (xid_key.split ("::")[0]); |
3752 | - if (!(xid in xids)) { |
3753 | - var pixbuf = xid_pixbuf_cache.get (xid_key); |
3754 | - for (var j = 0; j < pixbuf_list.length; j++) { |
3755 | - if (pixbuf_list[j] == pixbuf) { |
3756 | - xid_pixbuf_cache.unset (icon_list[j]); |
3757 | - } |
3758 | - } |
3759 | - |
3760 | - xid_pixbuf_cache.unset (xid_key); |
3761 | - } |
3762 | - } |
3763 | - } |
3764 | - |
3765 | - public static void request_clean_icon_cache (uint32[] xids) |
3766 | - { |
3767 | - if (cache_clear_timeout > 0) |
3768 | - GLib.Source.remove (cache_clear_timeout); |
3769 | - |
3770 | - cache_clear_timeout = Timeout.add_seconds (30, () => { |
3771 | - cache_clear_timeout = 0; |
3772 | - Idle.add (() => { |
3773 | - clean_icon_cache (xids); |
3774 | - return false; |
3775 | - }); |
3776 | - return false; |
3777 | - }); |
3778 | - } |
3779 | - |
3780 | - /** |
3781 | - * returns a pixbuf for the application of this window or a default icon |
3782 | - **/ |
3783 | - public static Gdk.Pixbuf get_icon_for_window (Window window, int size) |
3784 | - { |
3785 | - Gdk.Pixbuf? result = null; |
3786 | - |
3787 | - var xid = (uint32)window.get_xwindow (); |
3788 | - var xid_key = "%u::%i".printf (xid, size); |
3789 | - |
3790 | - if ((result = xid_pixbuf_cache.get (xid_key)) != null) |
3791 | - return result; |
3792 | - |
3793 | - var app = Bamf.Matcher.get_default ().get_application_for_xid (xid); |
3794 | - result = get_icon_for_application (app, size); |
3795 | - |
3796 | - xid_pixbuf_cache.set (xid_key, result); |
3797 | - |
3798 | - return result; |
3799 | - } |
3800 | - |
3801 | - /** |
3802 | - * returns a pixbuf for this application or a default icon |
3803 | - **/ |
3804 | - public static Gdk.Pixbuf get_icon_for_application (Bamf.Application app, int size) |
3805 | - { |
3806 | - Gdk.Pixbuf? image = null; |
3807 | - bool not_cached = false; |
3808 | - |
3809 | - string? icon = null; |
3810 | - string? icon_key = null; |
3811 | - |
3812 | - if (app != null && app.get_desktop_file () != null) { |
3813 | - try { |
3814 | - var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ()); |
3815 | - if (appinfo != null) { |
3816 | - icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ()); |
3817 | - icon_key = "%s::%i".printf (icon, size); |
3818 | - if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
3819 | - image = Plank.Drawing.DrawingService.load_icon (icon, size, size); |
3820 | - not_cached = true; |
3821 | - } |
3822 | - } |
3823 | - } catch (Error e) { |
3824 | - warning (e.message); |
3825 | - } |
3826 | - } |
3827 | - |
3828 | - if (image == null) { |
3829 | - try { |
3830 | - unowned Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default (); |
3831 | - icon = "application-default-icon"; |
3832 | - icon_key = "%s::%i".printf (icon, size); |
3833 | - if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
3834 | - image = icon_theme.load_icon (icon, size, 0); |
3835 | - not_cached = true; |
3836 | - } |
3837 | - } catch (Error e) { |
3838 | - warning (e.message); |
3839 | - } |
3840 | - } |
3841 | - |
3842 | - if (image == null) { |
3843 | - icon = ""; |
3844 | - icon_key = "::%i".printf (size); |
3845 | - if ((image = icon_pixbuf_cache.get (icon_key)) == null) { |
3846 | - image = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, size, size); |
3847 | - image.fill (0x00000000); |
3848 | - not_cached = true; |
3849 | - } |
3850 | - } |
3851 | - |
3852 | - if (size != image.width || size != image.height) |
3853 | - image = Plank.Drawing.DrawingService.ar_scale (image, size, size); |
3854 | - |
3855 | - if (not_cached) |
3856 | - icon_pixbuf_cache.set (icon_key, image); |
3857 | - |
3858 | - return image; |
3859 | - } |
3860 | - |
3861 | - /** |
3862 | - * get the next window that should be active on a workspace right now |
3863 | - **/ |
3864 | - public static Window get_next_window (Meta.Workspace workspace, bool backward=false) |
3865 | - { |
3866 | - var screen = workspace.get_screen (); |
3867 | - var display = screen.get_display (); |
3868 | - |
3869 | - var window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
3870 | - screen.get_active_workspace (), null, backward); |
3871 | - |
3872 | - if (window == null) |
3873 | - window = display.get_tab_current (Meta.TabList.NORMAL, screen, workspace); |
3874 | - |
3875 | - return window; |
3876 | - } |
3877 | - |
3878 | /** |
3879 | * set the area where clutter can receive events |
3880 | **/ |
3881 | @@ -243,59 +95,16 @@ |
3882 | Util.empty_stage_input_region (screen); |
3883 | return; |
3884 | } |
3885 | + |
3886 | + // add plugin's requested areas |
3887 | + if (area == InputArea.FULLSCREEN || area == InputArea.HOT_CORNER) { |
3888 | + foreach (var rect in PluginManager.get_default ().regions) { |
3889 | + rects += rect; |
3890 | + } |
3891 | + } |
3892 | |
3893 | var xregion = X.Fixes.create_region (display.get_xdisplay (), rects); |
3894 | Util.set_stage_input_region (screen, xregion); |
3895 | } |
3896 | - |
3897 | - /** |
3898 | - * get the number of toplevel windows on a workspace |
3899 | - **/ |
3900 | - public static uint get_n_windows (Workspace workspace) |
3901 | - { |
3902 | - var n = 0; |
3903 | - foreach (var window in workspace.list_windows ()) { |
3904 | - if (window.is_on_all_workspaces ()) |
3905 | - continue; |
3906 | - if (window.window_type == WindowType.NORMAL || |
3907 | - window.window_type == WindowType.DIALOG || |
3908 | - window.window_type == WindowType.MODAL_DIALOG) |
3909 | - n ++; |
3910 | - } |
3911 | - |
3912 | - return n; |
3913 | - } |
3914 | - |
3915 | - static Gtk.CssProvider fallback_style = null; |
3916 | - |
3917 | - public static Gtk.CssProvider get_default_style () |
3918 | - { |
3919 | - if (fallback_style == null) { |
3920 | - fallback_style = new Gtk.CssProvider (); |
3921 | - try { |
3922 | - fallback_style.load_from_path (Config.PKGDATADIR + "/gala.css"); |
3923 | - } catch (Error e) { warning (e.message); } |
3924 | - } |
3925 | - |
3926 | - return fallback_style; |
3927 | - } |
3928 | - |
3929 | - public static void get_window_frame_offset (Window window, out float x, out float y, out float width, out float height) |
3930 | - { |
3931 | - var actor = window.get_compositor_private () as Clutter.Actor; |
3932 | - var frame = window.get_outer_rect (); |
3933 | - x = actor.x - frame.x; |
3934 | - y = actor.y - frame.y; |
3935 | - width = actor.width - frame.width; |
3936 | - height = actor.height - frame.height; |
3937 | - } |
3938 | - |
3939 | - public static void bell (Meta.Screen screen) |
3940 | - { |
3941 | - if (Meta.Prefs.bell_is_audible ()) |
3942 | - Gdk.beep (); |
3943 | - else |
3944 | - screen.get_display ().get_compositor ().flash_screen (screen); |
3945 | - } |
3946 | } |
3947 | } |
3948 | |
3949 | === modified file 'src/Main.vala' |
3950 | --- src/Main.vala 2013-07-14 17:20:53 +0000 |
3951 | +++ src/Main.vala 2014-04-06 18:03:36 +0000 |
3952 | @@ -38,11 +38,7 @@ |
3953 | Meta.exit (Meta.ExitCode.ERROR); |
3954 | } |
3955 | |
3956 | -#if HAS_MUTTER36 |
3957 | - Meta.Plugin.manager_set_plugin_type (new Plugin ().get_type ()); |
3958 | -#else |
3959 | - Meta.Plugin.type_register (new Plugin ().get_type ()); |
3960 | -#endif |
3961 | + Meta.Plugin.manager_set_plugin_type (new WindowManagerGala ().get_type ()); |
3962 | |
3963 | Meta.set_wm_name ("Mutter(Gala)"); |
3964 | |
3965 | |
3966 | === added file 'src/Makefile.am' |
3967 | --- src/Makefile.am 1970-01-01 00:00:00 +0000 |
3968 | +++ src/Makefile.am 2014-04-06 18:03:36 +0000 |
3969 | @@ -0,0 +1,77 @@ |
3970 | +include $(top_srcdir)/Makefile.common |
3971 | + |
3972 | +VAPIDIR = $(top_srcdir)/vapi |
3973 | + |
3974 | +gala_VALAFLAGS = \ |
3975 | + $(GALA_CORE_VALAFLAGS) \ |
3976 | + $(top_builddir)/lib/gala.vapi \ |
3977 | + --vapidir $(VAPIDIR) \ |
3978 | + $(VAPIDIR)/config.vapi \ |
3979 | + $(VAPIDIR)/cogl-fixes.vapi \ |
3980 | + $(NULL) |
3981 | + |
3982 | +galadir = $(bindir) |
3983 | + |
3984 | +BUILT_SOURCES = gala_vala.stamp |
3985 | + |
3986 | +gala_PROGRAMS = gala |
3987 | + |
3988 | +gala_CFLAGS = \ |
3989 | + $(GALA_CORE_CFLAGS) \ |
3990 | + -include config.h \ |
3991 | + -w \ |
3992 | + -DGNOME_DESKTOP_USE_UNSTABLE_API \ |
3993 | + -I$(top_builddir)/lib \ |
3994 | + $(NULL) |
3995 | + |
3996 | +gala_LDADD = \ |
3997 | + -lm \ |
3998 | + $(GALA_CORE_LIBS) \ |
3999 | + $(top_builddir)/lib/libgala.la \ |
4000 | + $(NULL) |
4001 | + |
4002 | +gala_VALASOURCES = \ |
4003 | + DBus.vala \ |
4004 | + DragDropAction.vala \ |
4005 | + InternalUtils.vala \ |
4006 | + Main.vala \ |
4007 | + PluginManager.vala \ |
4008 | + ScreenSaver.vala \ |
4009 | + Settings.vala \ |
4010 | + TextShadowEffect.vala \ |
4011 | + WindowManager.vala \ |
4012 | + Background/Background.vala \ |
4013 | + Background/BackgroundCache.vala \ |
4014 | + Background/BackgroundManager.vala \ |
4015 | + Background/SlideShow.vala \ |
4016 | + Background/SystemBackground.vala \ |
4017 | + Widgets/AppIcon.vala \ |
4018 | + Widgets/WindowOverview.vala \ |
4019 | + Widgets/WindowSwitcher.vala \ |
4020 | + Widgets/WindowThumb.vala \ |
4021 | + Widgets/WorkspaceThumb.vala \ |
4022 | + Widgets/WorkspaceView.vala \ |
4023 | + $(NULL) |
4024 | + |
4025 | +nodist_gala_SOURCES = \ |
4026 | + gala_vala.stamp \ |
4027 | + $(gala_VALASOURCES:.vala=.c) \ |
4028 | + $(NULL) |
4029 | + |
4030 | +gala_vala.stamp: $(gala_VALASOURCES) |
4031 | + $(AM_V_VALA)$(VALAC) \ |
4032 | + $(gala_VALAFLAGS) \ |
4033 | + --basedir $(srcdir) \ |
4034 | + --directory $(builddir) \ |
4035 | + -C \ |
4036 | + $(filter %.vala %.c,$^) |
4037 | + $(AM_V_at)touch $@ |
4038 | + |
4039 | +CLEANFILES = \ |
4040 | + $(nodist_gala_SOURCES) \ |
4041 | + $(NULL) |
4042 | + |
4043 | +EXTRA_DIST = \ |
4044 | + $(gala_VALASOURCES) \ |
4045 | + $(NULL) |
4046 | + |
4047 | |
4048 | === added file 'src/PluginManager.vala' |
4049 | --- src/PluginManager.vala 1970-01-01 00:00:00 +0000 |
4050 | +++ src/PluginManager.vala 2014-04-06 18:03:36 +0000 |
4051 | @@ -0,0 +1,220 @@ |
4052 | +// |
4053 | +// Copyright (C) 2014 Tom Beckmann |
4054 | +// |
4055 | +// This program is free software: you can redistribute it and/or modify |
4056 | +// it under the terms of the GNU General Public License as published by |
4057 | +// the Free Software Foundation, either version 3 of the License, or |
4058 | +// (at your option) any later version. |
4059 | +// |
4060 | +// This program is distributed in the hope that it will be useful, |
4061 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
4062 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4063 | +// GNU General Public License for more details. |
4064 | +// |
4065 | +// You should have received a copy of the GNU General Public License |
4066 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
4067 | +// |
4068 | + |
4069 | +namespace Gala |
4070 | +{ |
4071 | + delegate PluginInfo RegisterPluginFunction (); |
4072 | + |
4073 | + public class PluginManager : Object |
4074 | + { |
4075 | + static PluginManager? instance = null; |
4076 | + public static PluginManager get_default () |
4077 | + { |
4078 | + if (instance == null) |
4079 | + instance = new PluginManager (); |
4080 | + |
4081 | + return instance; |
4082 | + } |
4083 | + |
4084 | + public signal void regions_changed (); |
4085 | + |
4086 | + public bool initialized { get; private set; default = false; } |
4087 | + |
4088 | + public X.Xrectangle[] regions { get; private set; } |
4089 | + |
4090 | + public string? window_switcher_provider { get; private set; default = null; } |
4091 | + public string? desktop_provider { get; private set; default = null; } |
4092 | + public string? window_overview_provider { get; private set; default = null; } |
4093 | + public string? workspace_view_provider { get; private set; default = null; } |
4094 | + |
4095 | + HashTable<string,Plugin> plugins; |
4096 | + File plugin_dir; |
4097 | + |
4098 | + WindowManager? wm = null; |
4099 | + |
4100 | + Gee.LinkedList<PluginInfo?> load_later_plugins; |
4101 | + |
4102 | + PluginManager () |
4103 | + { |
4104 | + plugins = new HashTable<string,Plugin> (str_hash, str_equal); |
4105 | + load_later_plugins = new Gee.LinkedList<PluginInfo?> (); |
4106 | + |
4107 | + if (!Module.supported ()) { |
4108 | + warning ("Modules are not supported on this platform"); |
4109 | + return; |
4110 | + } |
4111 | + |
4112 | + plugin_dir = File.new_for_path (Config.PLUGINDIR); |
4113 | + if (!plugin_dir.query_exists ()) |
4114 | + return; |
4115 | + |
4116 | + try { |
4117 | + var enumerator = plugin_dir.enumerate_children (FileAttribute.STANDARD_NAME + |
4118 | + "," + FileAttribute.STANDARD_CONTENT_TYPE, 0); |
4119 | + FileInfo info; |
4120 | + while ((info = enumerator.next_file ()) != null) { |
4121 | + if (info.get_content_type () == "application/x-sharedlib") |
4122 | + load_module (info.get_name ()); |
4123 | + } |
4124 | + } catch (Error e) { |
4125 | + warning (e.message); |
4126 | + } |
4127 | + |
4128 | + try { |
4129 | + plugin_dir.monitor_directory (FileMonitorFlags.NONE, null).changed.connect ((file, other_file, type) => { |
4130 | + if (type == FileMonitorEvent.CREATED) { |
4131 | + load_module (file.get_basename ()); |
4132 | + } |
4133 | + }); |
4134 | + } catch (Error e) { |
4135 | + warning (e.message); |
4136 | + } |
4137 | + } |
4138 | + |
4139 | + bool load_module (string plugin_name) |
4140 | + { |
4141 | + var path = Module.build_path (plugin_dir.get_path (), plugin_name); |
4142 | + var module = Module.open (path, ModuleFlags.BIND_LOCAL); |
4143 | + if (module == null) { |
4144 | + warning (Module.error ()); |
4145 | + return false; |
4146 | + } |
4147 | + |
4148 | + void* function; |
4149 | + module.symbol ("register_plugin", out function); |
4150 | + if (function == null) { |
4151 | + warning ("%s failed to register: register_plugin() function not found", plugin_name); |
4152 | + return false; |
4153 | + } |
4154 | + RegisterPluginFunction register = (RegisterPluginFunction)function; |
4155 | + |
4156 | + var info = register (); |
4157 | + if (info.plugin_type.is_a (typeof (Plugin)) == false) { |
4158 | + warning ("%s does not return a class of type Plugin", plugin_name); |
4159 | + return false; |
4160 | + } |
4161 | + |
4162 | + if (!check_provides (info.name, info.provides)) { |
4163 | + return false; |
4164 | + } |
4165 | + |
4166 | + info.module_name = plugin_name; |
4167 | + module.make_resident (); |
4168 | + |
4169 | + if (info.load_priority == LoadPriority.DEFERRED && !initialized) { |
4170 | + load_later_plugins.add (info); |
4171 | + } else { |
4172 | + load_plugin_class (info); |
4173 | + } |
4174 | + |
4175 | + return true; |
4176 | + } |
4177 | + |
4178 | + void load_plugin_class (PluginInfo info) |
4179 | + { |
4180 | + var plugin = (Plugin)Object.@new (info.plugin_type); |
4181 | + plugins.set (info.module_name, plugin); |
4182 | + |
4183 | + debug ("Loaded plugin %s (%s)", info.name, info.module_name); |
4184 | + |
4185 | + if (initialized) { |
4186 | + initialize_plugin (info.module_name, plugin); |
4187 | + recalculate_regions (); |
4188 | + } |
4189 | + } |
4190 | + |
4191 | + void initialize_plugin (string plugin_name, Plugin plugin) |
4192 | + { |
4193 | + plugin.initialize (wm); |
4194 | + plugin.region_changed.connect (recalculate_regions); |
4195 | + } |
4196 | + |
4197 | + bool check_provides (string name, PluginFunction provides) |
4198 | + { |
4199 | + var message = "Plugins %s and %s both provide %s functionality, using first one only"; |
4200 | + switch (provides) { |
4201 | + case PluginFunction.WORKSPACE_VIEW: |
4202 | + if (workspace_view_provider != null) { |
4203 | + warning (message, workspace_view_provider, name, "workspace view"); |
4204 | + return false; |
4205 | + } |
4206 | + workspace_view_provider = name; |
4207 | + return true; |
4208 | + case PluginFunction.WINDOW_OVERVIEW: |
4209 | + if (window_overview_provider != null) { |
4210 | + warning (message, window_overview_provider, name, "window overview"); |
4211 | + return false; |
4212 | + } |
4213 | + window_overview_provider = name; |
4214 | + return true; |
4215 | + case PluginFunction.DESKTOP: |
4216 | + if (desktop_provider != null) { |
4217 | + warning (message, desktop_provider, name, "desktop"); |
4218 | + return false; |
4219 | + } |
4220 | + desktop_provider = name; |
4221 | + return true; |
4222 | + case PluginFunction.WINDOW_SWITCHER: |
4223 | + if (window_switcher_provider != null) { |
4224 | + warning (message, window_switcher_provider, name, "window switcher"); |
4225 | + return false; |
4226 | + } |
4227 | + window_switcher_provider = name; |
4228 | + return true; |
4229 | + } |
4230 | + |
4231 | + return true; |
4232 | + } |
4233 | + |
4234 | + public void initialize (WindowManager _wm) |
4235 | + { |
4236 | + wm = _wm; |
4237 | + |
4238 | + plugins.@foreach (initialize_plugin); |
4239 | + recalculate_regions (); |
4240 | + |
4241 | + initialized = true; |
4242 | + } |
4243 | + |
4244 | + public void load_waiting_plugins () |
4245 | + { |
4246 | + foreach (var info in load_later_plugins) { |
4247 | + load_plugin_class (info); |
4248 | + } |
4249 | + |
4250 | + load_later_plugins.clear (); |
4251 | + } |
4252 | + |
4253 | + /** |
4254 | + * Iterate over all plugins and grab their regions, update the regions |
4255 | + * array accordingly and emit the regions_changed signal. |
4256 | + */ |
4257 | + void recalculate_regions () |
4258 | + { |
4259 | + X.Xrectangle[] regions = {}; |
4260 | + |
4261 | + plugins.@foreach ((name, plugin) => { |
4262 | + foreach (var region in plugin.region) |
4263 | + regions += region; |
4264 | + }); |
4265 | + |
4266 | + this.regions = regions; |
4267 | + regions_changed (); |
4268 | + } |
4269 | + } |
4270 | +} |
4271 | + |
4272 | |
4273 | === modified file 'src/Widgets/WindowOverview.vala' |
4274 | --- src/Widgets/WindowOverview.vala 2013-11-27 18:50:56 +0000 |
4275 | +++ src/Widgets/WindowOverview.vala 2014-04-06 18:03:36 +0000 |
4276 | @@ -29,7 +29,7 @@ |
4277 | |
4278 | public class WindowOverview : Actor |
4279 | { |
4280 | - Plugin plugin; |
4281 | + WindowManager wm; |
4282 | Screen screen; |
4283 | |
4284 | bool ready; |
4285 | @@ -39,10 +39,10 @@ |
4286 | |
4287 | static const int PADDING = 50; |
4288 | |
4289 | - public WindowOverview (Plugin _plugin) |
4290 | + public WindowOverview (WindowManager _wm) |
4291 | { |
4292 | - plugin = _plugin; |
4293 | - screen = plugin.get_screen (); |
4294 | + wm = _wm; |
4295 | + screen = wm.get_screen (); |
4296 | |
4297 | screen.workspace_switched.connect (() => close (false)); |
4298 | |
4299 | @@ -578,17 +578,12 @@ |
4300 | |
4301 | screen.window_left_monitor.connect (window_left_monitor); |
4302 | |
4303 | -#if !HAS_MUTTER38 |
4304 | - Compositor.get_background_actor_for_screen (screen). |
4305 | - animate (AnimationMode.EASE_OUT_QUAD, 350, dim_factor : 0.6); |
4306 | -#endif |
4307 | - |
4308 | // sort windows by stacking order |
4309 | var windows = screen.get_display ().sort_windows_by_stacking (used_windows); |
4310 | |
4311 | grab_key_focus (); |
4312 | |
4313 | - plugin.begin_modal (); |
4314 | + wm.begin_modal (); |
4315 | |
4316 | visible = true; |
4317 | |
4318 | @@ -615,12 +610,7 @@ |
4319 | { |
4320 | // see if that's happened on one of our workspaces |
4321 | foreach (var workspace in workspaces) { |
4322 | -#if HAS_MUTTER38 |
4323 | if (window.located_on_workspace (workspace)) { |
4324 | -#else |
4325 | - if (window.get_workspace () == workspace || |
4326 | - (window.is_on_all_workspaces () && window.get_screen () == workspace.get_screen ())) { |
4327 | -#endif |
4328 | remove_window (window); |
4329 | return; |
4330 | } |
4331 | @@ -711,8 +701,8 @@ |
4332 | |
4333 | ready = false; |
4334 | |
4335 | - plugin.end_modal (); |
4336 | - plugin.update_input_area (); |
4337 | + wm.end_modal (); |
4338 | + wm.update_input_area (); |
4339 | |
4340 | foreach (var child in get_children ()) { |
4341 | var exposed = child as WindowThumb; |
4342 | @@ -720,11 +710,6 @@ |
4343 | exposed.selected.disconnect (thumb_selected); |
4344 | } |
4345 | |
4346 | -#if !HAS_MUTTER38 |
4347 | - Compositor.get_background_actor_for_screen (screen). |
4348 | - animate (AnimationMode.EASE_OUT_QUAD, 300, dim_factor : 1.0); |
4349 | -#endif |
4350 | - |
4351 | if (animate) { |
4352 | Clutter.Threads.Timeout.add (300, () => { |
4353 | visible = false; |
4354 | |
4355 | === modified file 'src/Widgets/WindowSwitcher.vala' |
4356 | --- src/Widgets/WindowSwitcher.vala 2014-02-05 18:06:21 +0000 |
4357 | +++ src/Widgets/WindowSwitcher.vala 2014-04-06 18:03:36 +0000 |
4358 | @@ -22,7 +22,7 @@ |
4359 | { |
4360 | public class WindowSwitcher : Clutter.Actor |
4361 | { |
4362 | - Gala.Plugin plugin; |
4363 | + Gala.WindowManager wm; |
4364 | |
4365 | Gee.ArrayList<Clutter.Clone> window_clones = new Gee.ArrayList<Clutter.Clone> (); |
4366 | |
4367 | @@ -42,9 +42,9 @@ |
4368 | //estimated value, if possible |
4369 | float dock_width = 0.0f; |
4370 | |
4371 | - public WindowSwitcher (Gala.Plugin _plugin) |
4372 | + public WindowSwitcher (Gala.WindowManager _wm) |
4373 | { |
4374 | - plugin = _plugin; |
4375 | + wm = _wm; |
4376 | |
4377 | //pull drawing methods from libplank |
4378 | dock_settings = new Plank.DockPreferences.with_filename (Environment.get_user_config_dir () + "/plank/dock1/settings"); |
4379 | @@ -131,7 +131,7 @@ |
4380 | |
4381 | closing = true; |
4382 | |
4383 | - var screen = plugin.get_screen (); |
4384 | + var screen = wm.get_screen (); |
4385 | var workspace = screen.get_active_workspace (); |
4386 | |
4387 | if (dock_window != null) |
4388 | @@ -164,7 +164,7 @@ |
4389 | current_window = null; |
4390 | } |
4391 | |
4392 | - plugin.end_modal (); |
4393 | + wm.end_modal (); |
4394 | |
4395 | dock.animate (AnimationMode.EASE_OUT_CUBIC, 250, width:dest_width, opacity : 0). |
4396 | completed.connect (() => { |
4397 | @@ -201,7 +201,7 @@ |
4398 | bool released = false; |
4399 | public override bool captured_event (Clutter.Event event) |
4400 | { |
4401 | - var screen = plugin.get_screen (); |
4402 | + var screen = wm.get_screen (); |
4403 | var display = screen.get_display (); |
4404 | |
4405 | if (event.get_type () == EventType.KEY_RELEASE) { |
4406 | @@ -221,9 +221,7 @@ |
4407 | var prev_win = current_window; |
4408 | if (action == Meta.KeyBindingAction.SWITCH_GROUP || |
4409 | action == Meta.KeyBindingAction.SWITCH_WINDOWS || |
4410 | -#if HAS_MUTTER38 |
4411 | action == Meta.KeyBindingAction.SWITCH_APPLICATIONS || |
4412 | -#endif |
4413 | event.get_key_symbol () == Clutter.Key.Right) { |
4414 | |
4415 | current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
4416 | @@ -232,9 +230,7 @@ |
4417 | |
4418 | } else if (action == Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD || |
4419 | action == Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD || |
4420 | -#if HAS_MUTTER38 |
4421 | action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD || |
4422 | -#endif |
4423 | event.get_key_symbol () == Clutter.Key.Left) { |
4424 | |
4425 | current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
4426 | @@ -295,20 +291,15 @@ |
4427 | void window_left_monitor (int num, Meta.Window window) |
4428 | { |
4429 | // see if that's happened on our workspace |
4430 | - var workspace = plugin.get_screen ().get_active_workspace (); |
4431 | -#if HAS_MUTTER38 |
4432 | + var workspace = wm.get_screen ().get_active_workspace (); |
4433 | if (window.located_on_workspace (workspace)) { |
4434 | -#else |
4435 | - if (window.get_workspace () == workspace || |
4436 | - (window.is_on_all_workspaces () && window.get_screen () == workspace.get_screen ())) { |
4437 | -#endif |
4438 | remove_window (window); |
4439 | } |
4440 | } |
4441 | |
4442 | void add_window (Meta.Window window) |
4443 | { |
4444 | - var screen = plugin.get_screen (); |
4445 | + var screen = wm.get_screen (); |
4446 | |
4447 | if (window.get_workspace () != screen.get_active_workspace ()) |
4448 | return; |
4449 | @@ -366,7 +357,7 @@ |
4450 | if (meta_win != null && |
4451 | !window.is_destroyed () && |
4452 | !meta_win.minimized && |
4453 | - (meta_win.get_workspace () == plugin.get_screen ().get_active_workspace ()) || |
4454 | + (meta_win.get_workspace () == wm.get_screen ().get_active_workspace ()) || |
4455 | meta_win.is_on_all_workspaces ()) |
4456 | window.show (); |
4457 | |
4458 | @@ -401,7 +392,7 @@ |
4459 | |
4460 | public override void key_focus_out () |
4461 | { |
4462 | - close (plugin.get_screen ().get_display ().get_current_time ()); |
4463 | + close (wm.get_screen ().get_display ().get_current_time ()); |
4464 | } |
4465 | |
4466 | public void handle_switch_windows (Meta.Display display, Meta.Screen screen, Meta.Window? window, |
4467 | @@ -453,7 +444,7 @@ |
4468 | }); |
4469 | |
4470 | closing = false; |
4471 | - plugin.begin_modal (); |
4472 | + wm.begin_modal (); |
4473 | |
4474 | bool backward = (binding.get_name () == "switch-windows-backward"); |
4475 | |
4476 | @@ -514,7 +505,7 @@ |
4477 | Gdk.Display.get_default ().get_device_manager ().get_client_pointer ().get_state (Gdk.get_default_root_window (), |
4478 | null, out modifiers); |
4479 | if ((modifiers & Gdk.ModifierType.MOD1_MASK) == 0) |
4480 | - close (plugin.get_screen ().get_display ().get_current_time ()); |
4481 | + close (wm.get_screen ().get_display ().get_current_time ()); |
4482 | } |
4483 | } |
4484 | } |
4485 | |
4486 | === modified file 'src/Widgets/WorkspaceThumb.vala' |
4487 | --- src/Widgets/WorkspaceThumb.vala 2013-11-27 18:50:56 +0000 |
4488 | +++ src/Widgets/WorkspaceThumb.vala 2014-04-06 18:03:36 +0000 |
4489 | @@ -48,12 +48,8 @@ |
4490 | Gtk.StyleContext selector_style; |
4491 | Gtk.EventBox selector_style_widget; |
4492 | |
4493 | -#if HAS_MUTTER38 |
4494 | internal Actor wallpaper; |
4495 | Actor wallpaper_manager; |
4496 | -#else |
4497 | - internal Clone wallpaper; |
4498 | -#endif |
4499 | Clutter.Actor windows; |
4500 | internal Clutter.Actor icons; |
4501 | Actor indicator; |
4502 | @@ -61,11 +57,7 @@ |
4503 | |
4504 | uint hover_timer = 0; |
4505 | |
4506 | -#if HAS_MUTTER38 |
4507 | public WorkspaceThumb (Workspace _workspace, Meta.BackgroundGroup _wallpaper) |
4508 | -#else |
4509 | - public WorkspaceThumb (Workspace _workspace) |
4510 | -#endif |
4511 | { |
4512 | workspace = _workspace; |
4513 | screen = workspace.get_screen (); |
4514 | @@ -94,15 +86,11 @@ |
4515 | |
4516 | handle_workspace_switched (-1, screen.get_active_workspace_index (), MotionDirection.LEFT); |
4517 | |
4518 | -#if HAS_MUTTER38 |
4519 | wallpaper_manager = new BackgroundManager (screen); |
4520 | //FIXME apparently there are issues with scaling and animating the opacity. The wallpaper will |
4521 | // start flickering when the opacity changes. Wrapping it in a container solves this. |
4522 | wallpaper = new Clutter.Actor (); |
4523 | wallpaper.add_child (wallpaper_manager); |
4524 | -#else |
4525 | - wallpaper = new Clone (Compositor.get_background_actor_for_screen (screen)); |
4526 | -#endif |
4527 | wallpaper.x = INDICATOR_BORDER; |
4528 | wallpaper.y = INDICATOR_BORDER; |
4529 | wallpaper.height = THUMBNAIL_HEIGHT; |
4530 | @@ -210,10 +198,8 @@ |
4531 | indicator.width = width + 2 * INDICATOR_BORDER; |
4532 | (indicator.content as Canvas).set_size ((int)indicator.width, (int)indicator.height); |
4533 | |
4534 | -#if HAS_MUTTER38 |
4535 | wallpaper_manager.scale_x = width / swidth; |
4536 | wallpaper_manager.scale_y = THUMBNAIL_HEIGHT / sheight; |
4537 | -#endif |
4538 | wallpaper.width = width; |
4539 | windows.width = width; |
4540 | |
4541 | @@ -342,12 +328,7 @@ |
4542 | |
4543 | void window_left_monitor (int num, Meta.Window window) |
4544 | { |
4545 | -#if HAS_MUTTER38 |
4546 | if (window.located_on_workspace (workspace)) |
4547 | -#else |
4548 | - if (window.get_workspace () == workspace || |
4549 | - (window.is_on_all_workspaces () && window.get_screen () == workspace.get_screen ())) |
4550 | -#endif |
4551 | handle_window_removed (window); |
4552 | } |
4553 | |
4554 | |
4555 | === modified file 'src/Widgets/WorkspaceView.vala' |
4556 | --- src/Widgets/WorkspaceView.vala 2013-11-27 18:50:56 +0000 |
4557 | +++ src/Widgets/WorkspaceView.vala 2014-04-06 18:03:36 +0000 |
4558 | @@ -24,14 +24,11 @@ |
4559 | static const float VIEW_HEIGHT = 140.0f; |
4560 | static const float SCROLL_SPEED = 30.0f; |
4561 | |
4562 | - Gala.Plugin plugin; |
4563 | + Gala.WindowManager wm; |
4564 | Screen screen; |
4565 | |
4566 | Clutter.Actor thumbnails; |
4567 | Clutter.Actor scroll; |
4568 | -#if !HAS_MUTTER38 |
4569 | - Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view |
4570 | -#endif |
4571 | |
4572 | bool animating; // delay closing the popup |
4573 | |
4574 | @@ -41,10 +38,10 @@ |
4575 | Gtk.StyleContext background_style; |
4576 | Gtk.EventBox background_style_widget; |
4577 | |
4578 | - public WorkspaceView (Gala.Plugin _plugin) |
4579 | + public WorkspaceView (Gala.WindowManager _wm) |
4580 | { |
4581 | - plugin = _plugin; |
4582 | - screen = plugin.get_screen (); |
4583 | + wm = _wm; |
4584 | + screen = wm.get_screen (); |
4585 | |
4586 | height = VIEW_HEIGHT; |
4587 | reactive = true; |
4588 | @@ -69,16 +66,6 @@ |
4589 | scroll.content = new Clutter.Canvas (); |
4590 | (scroll.content as Clutter.Canvas).draw.connect (draw_scroll); |
4591 | |
4592 | -#if !HAS_MUTTER38 |
4593 | - click_catcher = new Clutter.Actor (); |
4594 | - click_catcher.reactive = true; |
4595 | - click_catcher.button_release_event.connect ((e) => { |
4596 | - hide (); |
4597 | - return true; |
4598 | - }); |
4599 | - Compositor.get_stage_for_screen (screen).add_child (click_catcher); |
4600 | -#endif |
4601 | - |
4602 | add_child (thumbnails); |
4603 | add_child (scroll); |
4604 | |
4605 | @@ -118,11 +105,7 @@ |
4606 | void init_thumbnails () |
4607 | { |
4608 | foreach (var workspace in screen.get_workspaces ()) { |
4609 | -#if HAS_MUTTER38 |
4610 | - var thumb = new WorkspaceThumb (workspace, plugin.background_group); |
4611 | -#else |
4612 | - var thumb = new WorkspaceThumb (workspace); |
4613 | -#endif |
4614 | + var thumb = new WorkspaceThumb (workspace, wm.background_group); |
4615 | thumb.clicked.connect (hide); |
4616 | thumb.closed.connect (remove_workspace); |
4617 | thumb.window_on_last.connect (add_workspace); |
4618 | @@ -137,13 +120,11 @@ |
4619 | add_workspace (); |
4620 | } |
4621 | |
4622 | -#if HAS_MUTTER38 |
4623 | bool outside_clicked (Clutter.ButtonEvent event) |
4624 | { |
4625 | hide (); |
4626 | return true; |
4627 | } |
4628 | -#endif |
4629 | |
4630 | bool draw_background (Cairo.Context cr) |
4631 | { |
4632 | @@ -184,11 +165,7 @@ |
4633 | |
4634 | void create_workspace_thumb (Meta.Workspace workspace) |
4635 | { |
4636 | -#if HAS_MUTTER38 |
4637 | - var thumb = new WorkspaceThumb (workspace, plugin.background_group); |
4638 | -#else |
4639 | - var thumb = new WorkspaceThumb (workspace); |
4640 | -#endif |
4641 | + var thumb = new WorkspaceThumb (workspace, wm.background_group); |
4642 | thumb.clicked.connect (hide); |
4643 | thumb.closed.connect (remove_workspace); |
4644 | thumb.window_on_last.connect (add_workspace); |
4645 | @@ -241,28 +218,6 @@ |
4646 | } |
4647 | } |
4648 | |
4649 | - void switch_to_next_workspace (MotionDirection direction) |
4650 | - { |
4651 | - var display = screen.get_display (); |
4652 | - var old_index = screen.get_active_workspace_index (); |
4653 | - var neighbor = screen.get_active_workspace ().get_neighbor (direction); |
4654 | - |
4655 | - neighbor.activate (display.get_current_time ()); |
4656 | - |
4657 | - // if we didnt switch, show a nudge-over animation. need to take the indices |
4658 | - // here since the changing only applies after the animation ends |
4659 | - if (old_index == 0 && direction == MotionDirection.LEFT || |
4660 | - old_index == screen.n_workspaces - 1 && direction == MotionDirection.RIGHT) { |
4661 | - |
4662 | - var dest = (direction == MotionDirection.LEFT ? 32.0f : -32.0f); |
4663 | - Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 100, x:dest); |
4664 | - Clutter.Threads.Timeout.add (210, () => { |
4665 | - Compositor.get_window_group_for_screen (screen).animate (Clutter.AnimationMode.LINEAR, 150, x:0.0f); |
4666 | - return false; |
4667 | - }); |
4668 | - } |
4669 | - } |
4670 | - |
4671 | public override void key_focus_out () |
4672 | { |
4673 | hide (); |
4674 | @@ -282,18 +237,18 @@ |
4675 | switch (event.keyval) { |
4676 | case Clutter.Key.Left: |
4677 | if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) != 0) |
4678 | - plugin.move_window (display.get_focus_window (), MotionDirection.LEFT); |
4679 | + wm.move_window (display.get_focus_window (), MotionDirection.LEFT); |
4680 | else |
4681 | - switch_to_next_workspace (MotionDirection.LEFT); |
4682 | + wm.switch_to_next_workspace (MotionDirection.LEFT); |
4683 | |
4684 | last_switch_time = current_time; |
4685 | |
4686 | return false; |
4687 | case Clutter.Key.Right: |
4688 | if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) != 0) |
4689 | - plugin.move_window (display.get_focus_window (), MotionDirection.RIGHT); |
4690 | + wm.move_window (display.get_focus_window (), MotionDirection.RIGHT); |
4691 | else |
4692 | - switch_to_next_workspace (MotionDirection.RIGHT); |
4693 | + wm.switch_to_next_workspace (MotionDirection.RIGHT); |
4694 | |
4695 | last_switch_time = current_time; |
4696 | |
4697 | @@ -403,16 +358,14 @@ |
4698 | |
4699 | wait_one_key_release = shortcut; |
4700 | |
4701 | - var screen = plugin.get_screen (); |
4702 | + var screen = wm.get_screen (); |
4703 | |
4704 | visible = true; |
4705 | grab_key_focus (); |
4706 | |
4707 | - plugin.begin_modal (); |
4708 | + wm.begin_modal (); |
4709 | |
4710 | -#if HAS_MUTTER38 |
4711 | - plugin.ui_group.button_release_event.connect (outside_clicked); |
4712 | -#endif |
4713 | + wm.ui_group.button_release_event.connect (outside_clicked); |
4714 | |
4715 | var area = screen.get_monitor_geometry (screen.get_primary_monitor ()); |
4716 | y = area.height + area.y; |
4717 | @@ -438,14 +391,6 @@ |
4718 | int swidth, sheight; |
4719 | screen.get_size (out swidth, out sheight); |
4720 | |
4721 | -#if !HAS_MUTTER38 |
4722 | - click_catcher.width = swidth; |
4723 | - click_catcher.height = sheight; |
4724 | - click_catcher.x = 0; |
4725 | - click_catcher.y = 0; |
4726 | - click_catcher.visible = true; |
4727 | -#endif |
4728 | - |
4729 | animating = true; |
4730 | Clutter.Threads.Timeout.add (50, () => { |
4731 | animating = false; |
4732 | @@ -465,15 +410,13 @@ |
4733 | if (!visible || animating) |
4734 | return; |
4735 | |
4736 | -#if HAS_MUTTER38 |
4737 | - plugin.ui_group.button_release_event.disconnect (outside_clicked); |
4738 | -#endif |
4739 | + wm.ui_group.button_release_event.disconnect (outside_clicked); |
4740 | |
4741 | float width, height; |
4742 | - plugin.get_screen ().get_size (out width, out height); |
4743 | + wm.get_screen ().get_size (out width, out height); |
4744 | |
4745 | - plugin.end_modal (); |
4746 | - plugin.update_input_area (); |
4747 | + wm.end_modal (); |
4748 | + wm.update_input_area (); |
4749 | |
4750 | animating = true; |
4751 | animate (Clutter.AnimationMode.EASE_OUT_EXPO, 500, y : height).completed.connect (() => { |
4752 | @@ -484,21 +427,10 @@ |
4753 | visible = false; |
4754 | }); |
4755 | |
4756 | -#if !HAS_MUTTER38 |
4757 | - click_catcher.visible = false; |
4758 | -#endif |
4759 | - |
4760 | var wins = Compositor.get_window_group_for_screen (screen); |
4761 | wins.detach_animation (); |
4762 | wins.x = 0.0f; |
4763 | wins.animate (Clutter.AnimationMode.EASE_OUT_EXPO, 500, y : 0.0f); |
4764 | } |
4765 | - |
4766 | - public void handle_switch_to_workspace (Meta.Display display, Meta.Screen screen, Meta.Window? window, |
4767 | - X.Event event, Meta.KeyBinding binding) |
4768 | - { |
4769 | - var direction = (binding.get_name () == "switch-to-workspace-left" ? MotionDirection.LEFT : MotionDirection.RIGHT); |
4770 | - switch_to_next_workspace (direction); |
4771 | - } |
4772 | } |
4773 | } |
4774 | |
4775 | === renamed file 'src/Plugin.vala' => 'src/WindowManager.vala' |
4776 | --- src/Plugin.vala 2014-02-05 18:06:21 +0000 |
4777 | +++ src/WindowManager.vala 2014-04-06 18:03:36 +0000 |
4778 | @@ -19,42 +19,22 @@ |
4779 | |
4780 | namespace Gala |
4781 | { |
4782 | - public enum ActionType |
4783 | - { |
4784 | - NONE = 0, |
4785 | - SHOW_WORKSPACE_VIEW, |
4786 | - MAXIMIZE_CURRENT, |
4787 | - MINIMIZE_CURRENT, |
4788 | - OPEN_LAUNCHER, |
4789 | - CUSTOM_COMMAND, |
4790 | - WINDOW_OVERVIEW, |
4791 | - WINDOW_OVERVIEW_ALL |
4792 | - } |
4793 | - |
4794 | - public enum InputArea { |
4795 | - NONE, |
4796 | - FULLSCREEN, |
4797 | - HOT_CORNER |
4798 | - } |
4799 | - |
4800 | - public class Plugin : Meta.Plugin |
4801 | - { |
4802 | - PluginInfo info; |
4803 | - |
4804 | - WindowSwitcher winswitcher; |
4805 | - WorkspaceView workspace_view; |
4806 | - Zooming zooming; |
4807 | - WindowOverview window_overview; |
4808 | + public class WindowManagerGala : Meta.Plugin, WindowManager |
4809 | + { |
4810 | + public Meta.BackgroundGroup background_group { get; protected set; } |
4811 | + public Clutter.Actor ui_group { get; protected set; } |
4812 | + public Clutter.Stage stage { get; protected set; } |
4813 | + |
4814 | + Meta.PluginInfo info; |
4815 | + |
4816 | + WindowSwitcher? winswitcher = null; |
4817 | + WorkspaceView? workspace_view = null; |
4818 | + WindowOverview? window_overview = null; |
4819 | |
4820 | // used to detect which corner was used to trigger an action |
4821 | Clutter.Actor? last_hotcorner; |
4822 | ScreenSaver? screensaver; |
4823 | |
4824 | -#if HAS_MUTTER38 |
4825 | - public Meta.BackgroundGroup background_group { get; private set; } |
4826 | - public Clutter.Actor ui_group { get; private set; } |
4827 | -#endif |
4828 | - |
4829 | Window? moving; //place for the window that is being moved over |
4830 | |
4831 | int modal_count = 0; //count of modal modes overlaying each other |
4832 | @@ -64,10 +44,10 @@ |
4833 | Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> (); |
4834 | Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> (); |
4835 | Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> (); |
4836 | - |
4837 | - public Plugin () |
4838 | + |
4839 | + public WindowManagerGala () |
4840 | { |
4841 | - info = PluginInfo () {name = "Gala", version = Config.VERSION, author = "Gala Developers", |
4842 | + info = Meta.PluginInfo () {name = "Gala", version = Config.VERSION, author = "Gala Developers", |
4843 | license = "GPLv3", description = "A nice elementary window manager"}; |
4844 | |
4845 | Prefs.set_ignore_request_hide_titlebar (true); |
4846 | @@ -80,19 +60,15 @@ |
4847 | |
4848 | public override void start () |
4849 | { |
4850 | -#if HAS_MUTTER38 |
4851 | Util.later_add (LaterType.BEFORE_REDRAW, show_stage); |
4852 | } |
4853 | |
4854 | bool show_stage () |
4855 | { |
4856 | -#endif |
4857 | var screen = get_screen (); |
4858 | |
4859 | DBus.init (this); |
4860 | -#if HAS_MUTTER38 |
4861 | BackgroundCache.init (screen); |
4862 | -#endif |
4863 | |
4864 | // Due to a bug which enables access to the stage when using multiple monitors |
4865 | // in the screensaver, we have to listen for changes and make sure the input area |
4866 | @@ -101,9 +77,12 @@ |
4867 | screensaver = Bus.get_proxy_sync (BusType.SESSION, "org.gnome.ScreenSaver", |
4868 | "/org/gnome/ScreenSaver"); |
4869 | screensaver.active_changed.connect (update_input_area); |
4870 | - } catch (Error e) { warning (e.message); } |
4871 | + } catch (Error e) { |
4872 | + screensaver = null; |
4873 | + warning (e.message); |
4874 | + } |
4875 | |
4876 | - var stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage; |
4877 | + stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage; |
4878 | |
4879 | var color = BackgroundSettings.get_default ().primary_color; |
4880 | stage.background_color = Clutter.Color.from_string (color); |
4881 | @@ -111,7 +90,6 @@ |
4882 | if (Prefs.get_dynamic_workspaces ()) |
4883 | screen.override_workspace_layout (ScreenCorner.TOPLEFT, false, 1, -1); |
4884 | |
4885 | -#if HAS_MUTTER38 |
4886 | /* our layer structure, copied from gnome-shell (from bottom to top): |
4887 | * stage |
4888 | * + system background |
4889 | @@ -138,38 +116,13 @@ |
4890 | background_group = new BackgroundManager (screen); |
4891 | window_group.add_child (background_group); |
4892 | window_group.set_child_below_sibling (background_group, null); |
4893 | -#endif |
4894 | - |
4895 | - workspace_view = new WorkspaceView (this); |
4896 | - workspace_view.visible = false; |
4897 | - |
4898 | - winswitcher = new WindowSwitcher (this); |
4899 | - |
4900 | - zooming = new Zooming (this); |
4901 | - window_overview = new WindowOverview (this); |
4902 | - |
4903 | -#if HAS_MUTTER38 |
4904 | - ui_group.add_child (workspace_view); |
4905 | - ui_group.add_child (winswitcher); |
4906 | - ui_group.add_child (window_overview); |
4907 | |
4908 | var top_window_group = Compositor.get_top_window_group_for_screen (screen); |
4909 | stage.remove_child (top_window_group); |
4910 | ui_group.add_child (top_window_group); |
4911 | -#else |
4912 | - stage.add_child (workspace_view); |
4913 | - stage.add_child (winswitcher); |
4914 | - stage.add_child (window_overview); |
4915 | -#endif |
4916 | |
4917 | /*keybindings*/ |
4918 | |
4919 | - screen.get_display ().add_keybinding ("expose-windows", KeybindingSettings.get_default ().schema, 0, () => { |
4920 | - window_overview.open (true); |
4921 | - }); |
4922 | - screen.get_display ().add_keybinding ("expose-all-windows", KeybindingSettings.get_default ().schema, 0, () => { |
4923 | - window_overview.open (true, true); |
4924 | - }); |
4925 | screen.get_display ().add_keybinding ("switch-to-workspace-first", KeybindingSettings.get_default ().schema, 0, () => { |
4926 | screen.get_workspace_by_index (0).activate (screen.get_display ().get_current_time ()); |
4927 | }); |
4928 | @@ -188,12 +141,6 @@ |
4929 | window.change_workspace (workspace); |
4930 | workspace.activate_with_focus (window, screen.get_display ().get_current_time ()); |
4931 | }); |
4932 | - screen.get_display ().add_keybinding ("zoom-in", KeybindingSettings.get_default ().schema, 0, () => { |
4933 | - zooming.zoom_in (); |
4934 | - }); |
4935 | - screen.get_display ().add_keybinding ("zoom-out", KeybindingSettings.get_default ().schema, 0, () => { |
4936 | - zooming.zoom_out (); |
4937 | - }); |
4938 | screen.get_display ().add_keybinding ("cycle-workspaces-next", KeybindingSettings.get_default ().schema, 0, () => { |
4939 | cycle_workspaces (1); |
4940 | }); |
4941 | @@ -222,24 +169,10 @@ |
4942 | } catch (Error e) { warning (e.message); } |
4943 | }); |
4944 | |
4945 | - KeyBinding.set_custom_handler ("show-desktop", () => { |
4946 | - workspace_view.show (true); |
4947 | - }); |
4948 | - |
4949 | -#if HAS_MUTTER38 |
4950 | - //FIXME we have to investigate this. Apparently alt-tab is now bound to switch-applications |
4951 | - // instead of windows, which we should probably handle too |
4952 | - KeyBinding.set_custom_handler ("switch-applications", winswitcher.handle_switch_windows); |
4953 | - KeyBinding.set_custom_handler ("switch-applications-backward", winswitcher.handle_switch_windows); |
4954 | -#else |
4955 | - KeyBinding.set_custom_handler ("switch-windows", winswitcher.handle_switch_windows); |
4956 | - KeyBinding.set_custom_handler ("switch-windows-backward", winswitcher.handle_switch_windows); |
4957 | -#endif |
4958 | - |
4959 | KeyBinding.set_custom_handler ("switch-to-workspace-up", () => {}); |
4960 | KeyBinding.set_custom_handler ("switch-to-workspace-down", () => {}); |
4961 | - KeyBinding.set_custom_handler ("switch-to-workspace-left", workspace_view.handle_switch_to_workspace); |
4962 | - KeyBinding.set_custom_handler ("switch-to-workspace-right", workspace_view.handle_switch_to_workspace); |
4963 | + KeyBinding.set_custom_handler ("switch-to-workspace-left", handle_switch_to_workspace); |
4964 | + KeyBinding.set_custom_handler ("switch-to-workspace-right", handle_switch_to_workspace); |
4965 | |
4966 | KeyBinding.set_custom_handler ("move-to-workspace-up", () => {}); |
4967 | KeyBinding.set_custom_handler ("move-to-workspace-down", () => {}); |
4968 | @@ -250,8 +183,8 @@ |
4969 | KeyBinding.set_custom_handler ("switch-group-backward", () => {}); |
4970 | |
4971 | /*shadows*/ |
4972 | - Utils.reload_shadow (); |
4973 | - ShadowSettings.get_default ().notify.connect (Utils.reload_shadow); |
4974 | + InternalUtils.reload_shadow (); |
4975 | + ShadowSettings.get_default ().notify.connect (InternalUtils.reload_shadow); |
4976 | |
4977 | /*hot corner, getting enum values from GraniteServicesSettings did not work, so we use GSettings directly*/ |
4978 | configure_hotcorners (); |
4979 | @@ -259,14 +192,56 @@ |
4980 | |
4981 | BehaviorSettings.get_default ().schema.changed.connect ((key) => update_input_area ()); |
4982 | |
4983 | -#if HAS_MUTTER38 |
4984 | + // initialize plugins and add default components if no plugin overrides them |
4985 | + var plugin_manager = PluginManager.get_default (); |
4986 | + plugin_manager.initialize (this); |
4987 | + plugin_manager.regions_changed.connect (update_input_area); |
4988 | + |
4989 | + if (plugin_manager.workspace_view_provider == null) { |
4990 | + workspace_view = new WorkspaceView (this); |
4991 | + workspace_view.visible = false; |
4992 | + ui_group.add_child (workspace_view); |
4993 | + |
4994 | + KeyBinding.set_custom_handler ("show-desktop", () => { |
4995 | + workspace_view.show (true); |
4996 | + }); |
4997 | + } |
4998 | + |
4999 | + if (plugin_manager.window_switcher_provider == null) { |
5000 | + winswitcher = new WindowSwitcher (this); |
* pkg-config file (libgala.pc) is missing
* libgala.deps generation summons not needed dependencies e.g. granite, clutter-gtk-1.0 are
not exposed in the public api, and xfixes-4.0 is missing there
* How do we want to handle vala bindings for libbamf3, libmutter and xfixes which would need
to be installed to have a working libgala.vapi?