Merge lp:~victored/wingpanel/lp-1295634 into lp:~elementary-pantheon/wingpanel/old-trunk
- lp-1295634
- Merge into old-trunk
Status: | Superseded | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp:~victored/wingpanel/lp-1295634 | ||||||||||||
Merge into: | lp:~elementary-pantheon/wingpanel/old-trunk | ||||||||||||
Diff against target: |
1144 lines (+459/-285) (has conflicts) 14 files modified
CMakeLists.txt (+31/-3) org.pantheon.desktop.wingpanel.gschema.xml (+11/-1) src/Indicator/IndicatorFactory.vala (+72/-16) src/Indicator/IndicatorFileModel.vala (+0/-94) src/Indicator/IndicatorObject.vala (+7/-7) src/Indicator/IndicatorObjectEntry.vala (+7/-30) src/Services/BackgroundManager.vala (+110/-0) src/Services/IndicatorSorter.vala (+8/-1) src/Services/Settings.vala (+2/-0) src/Widgets/BasePanel.vala (+112/-19) src/Widgets/Panel.vala (+19/-4) src/WingpanelApp.vala (+54/-56) vapi/indicator3-0.4.vapi (+22/-54) vapi/libido3-0.1.vapi (+4/-0) Text conflict in CMakeLists.txt Text conflict in vapi/indicator3-0.4.vapi |
||||||||||||
To merge this branch: | bzr merge lp:~victored/wingpanel/lp-1295634 | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
elementary Pantheon team | Pending | ||
Review via email: mp+212541@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-03-25.
Commit message
Go fully opaque only when there are visible maximized windows in the current workspace. Fixes lp:1295634
Description of the change
Go fully opaque only when there are visible maximized windows. Fixes lp:1295634
- 157. By Victor Martinez
-
Update panel opacity when opening and closing windows. Fixes lp:1294430 and lp:1294432
Unmerged revisions
- 157. By Victor Martinez
-
Update panel opacity when opening and closing windows. Fixes lp:1294430 and lp:1294432
- 156. By Victor Martinez
-
Only go fully opaque if there are visible maximized windows. Fixes lp:1295634
- 155. By Victor Martinez
-
Uses the gala dbus API to get the alpha value of the background. Adds a transition when changing alpha and uses wnck to check for maximized windows on the current screen
- 154. By Rico Tzschichholz
-
vapi: Update indicator3-0.4 bindings
- 153. By Victor Martinez
-
Support newer valac versions (>= 0.16)
- Remove duplicate code from IndicatorFileMo
del.vala and move it to IndicatorFactor y.vala to avoid copying data structures
- Update WingpanelApp.vala to make proper use of GLib.Application.startup and GLib.Applicatio n.activate
- Update respective license formats
- CMake corrections - 152. By David Gomes
-
Fixed code style.
- 151. By Tom Beckmann
-
replace tabs with spaces, adding credit here: indicator vapi is from unity-greeter
- 150. By Tom Beckmann
-
add support for the new indicator files
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-01-24 17:27:31 +0000 |
3 | +++ CMakeLists.txt 2014-03-25 04:00:57 +0000 |
4 | @@ -1,6 +1,6 @@ |
5 | # Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation |
6 | |
7 | -project (wingpanel) |
8 | +project (wingpanel C) |
9 | cmake_minimum_required (VERSION 2.8) |
10 | cmake_policy (VERSION 2.8) |
11 | |
12 | @@ -33,8 +33,29 @@ |
13 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
14 | |
15 | # Set dependencies |
16 | +<<<<<<< TREE |
17 | set (WINGPANEL_DEPS "gobject-2.0;glib-2.0;gio-2.0;gee-0.8;gdk-x11-3.0;x11;gtk+-3.0;granite") |
18 | set (WINGPANEL_DEPS_NOVALA "gthread-2.0;indicator3-0.4") |
19 | +======= |
20 | +set (WINGPANEL_DEPS |
21 | + gobject-2.0 |
22 | + glib-2.0 |
23 | + gio-2.0 |
24 | + gee-0.8 |
25 | + gdk-x11-3.0 |
26 | + x11 |
27 | + gtk+-3.0 |
28 | + granite |
29 | + indicator3-0.4 |
30 | + libido3-0.1 |
31 | + libwnck-3.0 |
32 | +) |
33 | + |
34 | +set (WINGPANEL_DEPS_NOVALA |
35 | + gthread-2.0 |
36 | +) |
37 | + |
38 | +>>>>>>> MERGE-SOURCE |
39 | find_package (PkgConfig) |
40 | pkg_check_modules (DEPS REQUIRED ${WINGPANEL_DEPS}) |
41 | pkg_check_modules (DEPS_NOVALA REQUIRED ${WINGPANEL_DEPS_NOVALA}) |
42 | @@ -57,6 +78,8 @@ |
43 | link_libraries(${DEPS_LIBRARIES} ${DEPS_NOVALA_LIBRARIES}) |
44 | link_directories(${DEPS_LIBRARY_DIRS} ${DEPS_NOVALA_DIRS}) |
45 | |
46 | +add_definitions (-DWNCK_I_KNOW_THIS_IS_UNSTABLE) |
47 | + |
48 | # Handle Vala Compilation |
49 | find_package(Vala REQUIRED) |
50 | include(ValaVersion) |
51 | @@ -69,7 +92,6 @@ |
52 | src/IndicatorIface.vala |
53 | src/IndicatorLoader.vala |
54 | |
55 | - src/Indicator/IndicatorFileModel.vala |
56 | src/Indicator/IndicatorObjectEntry.vala |
57 | src/Indicator/IndicatorObject.vala |
58 | src/Indicator/IndicatorFactory.vala |
59 | @@ -87,14 +109,19 @@ |
60 | src/Services/AppLauncherService.vala |
61 | src/Services/LauncherRunner.vala |
62 | src/Services/IndicatorSorter.vala |
63 | + src/Services/BackgroundManager.vala |
64 | PACKAGES |
65 | ${WINGPANEL_DEPS} |
66 | CUSTOM_VAPIS |
67 | vapi/config.vapi |
68 | - vapi/indicator-0.4.vapi |
69 | OPTIONS |
70 | + -g |
71 | --thread |
72 | +<<<<<<< TREE |
73 | -g |
74 | +======= |
75 | + --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ |
76 | +>>>>>>> MERGE-SOURCE |
77 | ) |
78 | |
79 | # Settings Schema |
80 | @@ -106,6 +133,7 @@ |
81 | |
82 | # Create the Executable |
83 | add_executable(${EXEC_NAME} ${VALA_C}) |
84 | +target_link_libraries(${EXEC_NAME} m) |
85 | |
86 | # Installation |
87 | install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin) |
88 | |
89 | === modified file 'org.pantheon.desktop.wingpanel.gschema.xml' |
90 | --- org.pantheon.desktop.wingpanel.gschema.xml 2012-07-08 03:02:36 +0000 |
91 | +++ org.pantheon.desktop.wingpanel.gschema.xml 2014-03-25 04:00:57 +0000 |
92 | @@ -13,7 +13,17 @@ |
93 | <key type="s" name="default-launcher"> |
94 | <default>"slingshot-launcher"</default> |
95 | <summary>The default program to use as App launcher.</summary> |
96 | - <description>Description</description> |
97 | + <description>The default program to use as App launcher.</description> |
98 | + </key> |
99 | + <key type="d" name="background-alpha"> |
100 | + <default>0.8</default> |
101 | + <summary>Background opacity variable.</summary> |
102 | + <description>Background opacity variable (must be between zero and one).</description> |
103 | + </key> |
104 | + <key type="b" name="auto-adjust-alpha"> |
105 | + <default>true</default> |
106 | + <summary>Automatically update background alpha.</summary> |
107 | + <description>Automatically update the background alpha to zero if it will be readable, else 0.8.</description> |
108 | </key> |
109 | </schema> |
110 | </schemalist> |
111 | |
112 | === modified file 'src/Indicator/IndicatorFactory.vala' |
113 | --- src/Indicator/IndicatorFactory.vala 2013-04-14 17:37:10 +0000 |
114 | +++ src/Indicator/IndicatorFactory.vala 2014-03-25 04:00:57 +0000 |
115 | @@ -1,45 +1,101 @@ |
116 | // -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
117 | -// |
118 | +// |
119 | // Copyright (C) 2013 Wingpanel Developers |
120 | -// |
121 | +// |
122 | // This program is free software: you can redistribute it and/or modify |
123 | // it under the terms of the GNU General Public License as published by |
124 | // the Free Software Foundation, either version 3 of the License, or |
125 | // (at your option) any later version. |
126 | -// |
127 | +// |
128 | // This program is distributed in the hope that it will be useful, |
129 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
130 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
131 | // GNU General Public License for more details. |
132 | -// |
133 | +// |
134 | // You should have received a copy of the GNU General Public License |
135 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
136 | |
137 | public class Wingpanel.Backend.IndicatorFactory : Object, IndicatorLoader { |
138 | - private IndicatorFileModel model; |
139 | private Gee.Collection<IndicatorIface> indicators; |
140 | - private bool initted = false; |
141 | + private string[] settings_blacklist; |
142 | |
143 | - public IndicatorFactory (Services.Settings settings) { |
144 | - model = new IndicatorFileModel (settings); |
145 | + public IndicatorFactory (string[] settings_blacklist) { |
146 | + this.settings_blacklist = settings_blacklist; |
147 | } |
148 | |
149 | public Gee.Collection<IndicatorIface> get_indicators () { |
150 | - if (!initted) { |
151 | + if (indicators == null) { |
152 | + indicators = new Gee.LinkedList<IndicatorIface> (); |
153 | load_indicators (); |
154 | - initted = true; |
155 | } |
156 | |
157 | return indicators.read_only_view; |
158 | } |
159 | |
160 | private void load_indicators () { |
161 | - indicators = new Gee.LinkedList<IndicatorIface> (); |
162 | - var indicators_list = model.get_indicators (); |
163 | - |
164 | - foreach (var indicator in indicators_list) { |
165 | - string name = model.get_indicator_name (indicator); |
166 | - indicators.add (new IndicatorObject (indicator, name)); |
167 | + // Fetch list of indicators that should not be loaded |
168 | + string skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP") ?? ""; |
169 | + |
170 | + if (skip_list == "all") { |
171 | + warning ("Skipping all indicator loading"); |
172 | + return; |
173 | + } |
174 | + |
175 | + foreach (string blocked_indicator in settings_blacklist) |
176 | + skip_list += "," + blocked_indicator; |
177 | + |
178 | + debug ("Blacklisted Indicators: %s", skip_list); |
179 | + |
180 | + // Legacy indicator libraries |
181 | + load_indicators_from_dir (Build.INDICATORDIR, true, skip_list); |
182 | + |
183 | + // Ng indicators |
184 | + load_indicators_from_dir ("/usr/share/unity/indicators", false, skip_list); |
185 | + } |
186 | + |
187 | + private void load_indicators_from_dir (string dir_path, bool legacy_libs_only, string skip_list) { |
188 | + try { |
189 | + var dir = File.new_for_path (dir_path); |
190 | + var enumerator = dir.enumerate_children (FileAttribute.STANDARD_NAME, |
191 | + FileQueryInfoFlags.NONE, null); |
192 | + FileInfo file_info; |
193 | + |
194 | + while ((file_info = enumerator.next_file (null)) != null) { |
195 | + string name = file_info.get_name (); |
196 | + |
197 | + if (name in skip_list) |
198 | + continue; |
199 | + |
200 | + load_indicator (dir, legacy_libs_only, name); |
201 | + } |
202 | + } catch (Error err) { |
203 | + warning ("Unable to read indicators: %s", err.message); |
204 | + } |
205 | + } |
206 | + |
207 | + private void load_indicator (File parent_dir, bool legacy_lib, string name) { |
208 | + string indicator_path = parent_dir.get_child (name).get_path (); |
209 | + |
210 | + try { |
211 | + Indicator.Object indicator = null; |
212 | + |
213 | + if (legacy_lib) { |
214 | + if (!name.has_suffix (".so")) |
215 | + return; |
216 | + |
217 | + debug ("Loading Indicator Library: %s", name); |
218 | + indicator = new Indicator.Object.from_file (indicator_path); |
219 | + } else { |
220 | + debug ("Loading Indicator File: %s", name); |
221 | + indicator = new Indicator.Ng.for_profile (indicator_path, "desktop"); |
222 | + } |
223 | + |
224 | + if (indicator != null) |
225 | + indicators.add (new IndicatorObject (indicator, name)); |
226 | + else |
227 | + critical ("Unable to load %s: invalid object.", name); |
228 | + } catch (Error err) { |
229 | + warning ("Could not load indicator at %s: %s", indicator_path, err.message); |
230 | } |
231 | } |
232 | } |
233 | |
234 | === removed file 'src/Indicator/IndicatorFileModel.vala' |
235 | --- src/Indicator/IndicatorFileModel.vala 2013-04-14 17:31:20 +0000 |
236 | +++ src/Indicator/IndicatorFileModel.vala 1970-01-01 00:00:00 +0000 |
237 | @@ -1,94 +0,0 @@ |
238 | -// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
239 | -/*** |
240 | - BEGIN LICENSE |
241 | - |
242 | - Copyright (C) 2010-2012 Canonical Ltd |
243 | - This program is free software: you can redistribute it and/or modify it |
244 | - under the terms of the GNU Lesser General Public License version 3, as published |
245 | - by the Free Software Foundation. |
246 | - |
247 | - This program is distributed in the hope that it will be useful, but |
248 | - WITHOUT ANY WARRANTY; without even the implied warranties of |
249 | - MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
250 | - PURPOSE. See the GNU General Public License for more details. |
251 | - |
252 | - You should have received a copy of the GNU General Public License along |
253 | - with this program. If not, see <http://www.gnu.org/licenses/> |
254 | - |
255 | - END LICENSE |
256 | - |
257 | - Authored by canonical.com |
258 | -***/ |
259 | - |
260 | -namespace Wingpanel.Backend { |
261 | - |
262 | - public class IndicatorFileModel { |
263 | - private Gee.HashMap<Indicator.Object, string> indicator_map; |
264 | - |
265 | - public IndicatorFileModel (Services.Settings settings) { |
266 | - indicator_map = new Gee.HashMap<Indicator.Object, string> (); |
267 | - |
268 | - // Indicators we don't want to load |
269 | - string skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP") ?? ""; |
270 | - |
271 | - if (skip_list == "all") { |
272 | - warning ("Skipping all indicator loading"); |
273 | - return; |
274 | - } |
275 | - |
276 | - foreach (string blocked_indicator in settings.blacklist) { |
277 | - skip_list += "," + blocked_indicator; |
278 | - debug ("Blacklisting %s", blocked_indicator); |
279 | - } |
280 | - |
281 | - debug ("Blacklisted Indicators: %s", skip_list); |
282 | - |
283 | - var indicators_to_load = new Gee.ArrayList<string> (); |
284 | - var dir = File.new_for_path (Build.INDICATORDIR); |
285 | - debug ("Indicator Directory: %s", dir.get_path ()); |
286 | - |
287 | - try { |
288 | - var enumerator = dir.enumerate_children (FileAttribute.STANDARD_NAME, |
289 | - FileQueryInfoFlags.NONE, null); |
290 | - |
291 | - FileInfo file_info; |
292 | - |
293 | - while ((file_info = enumerator.next_file (null)) != null) { |
294 | - string leaf = file_info.get_name (); |
295 | - |
296 | - if (leaf in skip_list) { |
297 | - warning ("SKIP LOADING: %s", leaf); |
298 | - continue; |
299 | - } |
300 | - |
301 | - if (leaf.has_suffix (".so")) |
302 | - indicators_to_load.add (leaf); |
303 | - } |
304 | - } catch (Error err) { |
305 | - error ("Unable to read indicators: %s", err.message); |
306 | - } |
307 | - |
308 | - foreach (string leaf in indicators_to_load) |
309 | - load_indicator (dir.get_child (leaf).get_path (), leaf); |
310 | - } |
311 | - |
312 | - public Gee.Collection<Indicator.Object> get_indicators () { |
313 | - return indicator_map.keys; |
314 | - } |
315 | - |
316 | - public string get_indicator_name (Indicator.Object indicator) { |
317 | - return indicator_map.get (indicator); |
318 | - } |
319 | - |
320 | - private void load_indicator (string filename, string leaf) { |
321 | - debug ("LOADING: %s", leaf); |
322 | - |
323 | - var indicator = new Indicator.Object.from_file (filename); |
324 | - |
325 | - if (indicator is Indicator.Object) |
326 | - indicator_map.set (indicator, leaf); |
327 | - else |
328 | - critical ("Unable to load %s", filename); |
329 | - } |
330 | - } |
331 | -} |
332 | |
333 | === modified file 'src/Indicator/IndicatorObject.vala' |
334 | --- src/Indicator/IndicatorObject.vala 2013-04-14 17:39:47 +0000 |
335 | +++ src/Indicator/IndicatorObject.vala 2014-03-25 04:00:57 +0000 |
336 | @@ -1,17 +1,17 @@ |
337 | // -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
338 | -// |
339 | +// |
340 | // Copyright (C) 2013 Wingpanel Developers |
341 | -// |
342 | +// |
343 | // This program is free software: you can redistribute it and/or modify |
344 | // it under the terms of the GNU General Public License as published by |
345 | // the Free Software Foundation, either version 3 of the License, or |
346 | // (at your option) any later version. |
347 | -// |
348 | +// |
349 | // This program is distributed in the hope that it will be useful, |
350 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
351 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
352 | // GNU General Public License for more details. |
353 | -// |
354 | +// |
355 | // You should have received a copy of the GNU General Public License |
356 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
357 | |
358 | @@ -63,14 +63,14 @@ |
359 | |
360 | private void on_entry_removed (Indicator.Object object, Indicator.ObjectEntry entry) { |
361 | assert (this.object == object); |
362 | - |
363 | + |
364 | var entry_widget = entries.get (entry); |
365 | entries.unset (entry); |
366 | - |
367 | + |
368 | entry_removed (entry_widget); |
369 | } |
370 | |
371 | private IndicatorWidget create_entry (Indicator.ObjectEntry entry) { |
372 | - return new IndicatorObjectEntry (entry, this); |
373 | + return new IndicatorObjectEntry (entry, object, this); |
374 | } |
375 | } |
376 | |
377 | === modified file 'src/Indicator/IndicatorObjectEntry.vala' |
378 | --- src/Indicator/IndicatorObjectEntry.vala 2013-08-25 14:47:58 +0000 |
379 | +++ src/Indicator/IndicatorObjectEntry.vala 2014-03-25 04:00:57 +0000 |
380 | @@ -18,10 +18,11 @@ |
381 | END LICENSE |
382 | ***/ |
383 | |
384 | -namespace Wingpanel.Backend |
385 | -{ |
386 | +namespace Wingpanel.Backend { |
387 | + |
388 | public class IndicatorObjectEntry: Widgets.IndicatorButton, IndicatorWidget { |
389 | private unowned Indicator.ObjectEntry entry; |
390 | + private unowned Indicator.Object parent_object; |
391 | private IndicatorIface indicator; |
392 | |
393 | // used for drawing |
394 | @@ -37,17 +38,18 @@ |
395 | .menu { |
396 | background-color:@transparent; |
397 | border-color:@transparent; |
398 | - -unico-inner-stroke-width: 0; |
399 | background-image:none; |
400 | + border-width:0; |
401 | } |
402 | .popover_bg { |
403 | background-color:#fff; |
404 | } |
405 | """; |
406 | |
407 | - public IndicatorObjectEntry (Indicator.ObjectEntry entry, IndicatorIface indicator) { |
408 | + public IndicatorObjectEntry (Indicator.ObjectEntry entry, Indicator.Object obj, IndicatorIface indicator) { |
409 | this.entry = entry; |
410 | this.indicator = indicator; |
411 | + parent_object = obj; |
412 | |
413 | var image = entry.image; |
414 | if (image != null && image is Gtk.Image) |
415 | @@ -218,32 +220,7 @@ |
416 | } |
417 | |
418 | public override bool scroll_event (Gdk.EventScroll event) { |
419 | - var direction = Indicator.ScrollDirection.UP; |
420 | - double delta = 0; |
421 | - |
422 | - switch (event.direction) { |
423 | - case Gdk.ScrollDirection.UP: |
424 | - delta = event.delta_y; |
425 | - direction = Indicator.ScrollDirection.UP; |
426 | - break; |
427 | - case Gdk.ScrollDirection.DOWN: |
428 | - delta = event.delta_y; |
429 | - direction = Indicator.ScrollDirection.DOWN; |
430 | - break; |
431 | - case Gdk.ScrollDirection.LEFT: |
432 | - delta = event.delta_x; |
433 | - direction = Indicator.ScrollDirection.LEFT; |
434 | - break; |
435 | - case Gdk.ScrollDirection.RIGHT: |
436 | - delta = event.delta_x; |
437 | - direction = Indicator.ScrollDirection.RIGHT; |
438 | - break; |
439 | - default: |
440 | - break; |
441 | - } |
442 | - |
443 | - entry.parent_object.entry_scrolled (entry, (uint) delta, direction); |
444 | - |
445 | + parent_object.entry_scrolled (entry, 1, (Indicator.ScrollDirection) event.direction); |
446 | return false; |
447 | } |
448 | } |
449 | |
450 | === added file 'src/Services/BackgroundManager.vala' |
451 | --- src/Services/BackgroundManager.vala 1970-01-01 00:00:00 +0000 |
452 | +++ src/Services/BackgroundManager.vala 2014-03-25 04:00:57 +0000 |
453 | @@ -0,0 +1,110 @@ |
454 | +// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
455 | +// |
456 | +// Copyright (C) 2014 Wingpanel Developers |
457 | +// |
458 | +// This program is free software: you can redistribute it and/or modify |
459 | +// it under the terms of the GNU General Public License as published by |
460 | +// the Free Software Foundation, either version 3 of the License, or |
461 | +// (at your option) any later version. |
462 | +// |
463 | +// This program is distributed in the hope that it will be useful, |
464 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
465 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
466 | +// GNU General Public License for more details. |
467 | +// |
468 | +// You should have received a copy of the GNU General Public License |
469 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
470 | + |
471 | +namespace Wingpanel.Services { |
472 | + struct ColorInformation { |
473 | + double average_red; |
474 | + double average_green; |
475 | + double average_blue; |
476 | + double mean; |
477 | + double variance; |
478 | + } |
479 | + |
480 | + [DBus (name = "org.pantheon.gala")] |
481 | + interface GalaDBus : Object { |
482 | + public signal void background_changed (); |
483 | + public async abstract ColorInformation get_background_color_information (int monitor, |
484 | + int x, int y, int width, int height) throws IOError; |
485 | + } |
486 | + |
487 | + public class BackgroundManager : Object { |
488 | + public static const double MIN_ALPHA = 0.3; |
489 | + |
490 | + private const int HEIGHT = 50; |
491 | + private const double MIN_VARIANCE = 50; |
492 | + private const double MIN_LUM = 25; |
493 | + |
494 | + /** |
495 | + * Emitted when the background changed. It supplies the alpha value that |
496 | + * can be used with this wallpaper while maintining legibility |
497 | + */ |
498 | + public signal void update_background_alpha (double legible_alpha_value); |
499 | + |
500 | + private Services.Settings settings; |
501 | + private Gdk.Screen screen; |
502 | + private GalaDBus gala_dbus; |
503 | + |
504 | + public BackgroundManager (Services.Settings settings, Gdk.Screen screen) { |
505 | + this.settings = settings; |
506 | + this.screen = screen; |
507 | + establish_connection (); |
508 | + } |
509 | + |
510 | + private void establish_connection () { |
511 | + try { |
512 | + gala_dbus = Bus.get_proxy_sync (BusType.SESSION, |
513 | + "org.pantheon.gala", |
514 | + "/org/pantheon/gala"); |
515 | + gala_dbus.background_changed.connect (on_background_change); |
516 | + on_background_change (); |
517 | + } catch (Error e) { |
518 | + gala_dbus = null; |
519 | + warning ("Auto-adjustment of background opacity not available, " + |
520 | + "connecting to gala dbus failed: %s", e.message); |
521 | + return; |
522 | + } |
523 | + } |
524 | + |
525 | + private void on_background_change () { |
526 | + if (!settings.auto_adjust_alpha) |
527 | + return; |
528 | + |
529 | + calculate_alpha.begin ((obj, res) => { |
530 | + var alpha = calculate_alpha.end (res); |
531 | + update_background_alpha (alpha); |
532 | + }); |
533 | + } |
534 | + |
535 | + private async double calculate_alpha () { |
536 | + double alpha = 0; |
537 | + Gdk.Rectangle monitor_geometry; |
538 | + ColorInformation? color_info = null; |
539 | + |
540 | + var primary = screen.get_primary_monitor (); |
541 | + screen.get_monitor_geometry (primary, out monitor_geometry); |
542 | + |
543 | + try { |
544 | + color_info = yield gala_dbus.get_background_color_information ( |
545 | + primary, // monitor index |
546 | + 0, // x of reference rect |
547 | + 0, // y of rect |
548 | + monitor_geometry.width, // width of rect |
549 | + HEIGHT); // height of rect |
550 | + } catch (Error e) { |
551 | + warning (e.message); |
552 | + alpha = MIN_ALPHA; |
553 | + } |
554 | + |
555 | + if (color_info != null |
556 | + && (color_info.mean > MIN_LUM |
557 | + || color_info.variance > MIN_VARIANCE)) |
558 | + alpha = MIN_ALPHA; |
559 | + |
560 | + return alpha; |
561 | + } |
562 | + } |
563 | +} |
564 | |
565 | === modified file 'src/Services/IndicatorSorter.vala' |
566 | --- src/Services/IndicatorSorter.vala 2013-04-14 10:19:10 +0000 |
567 | +++ src/Services/IndicatorSorter.vala 2014-03-25 04:00:57 +0000 |
568 | @@ -23,6 +23,7 @@ |
569 | * be passed as CompareFuncs. |
570 | */ |
571 | public class Wingpanel.Services.IndicatorSorter { |
572 | + |
573 | private struct IndicatorOrderNode { |
574 | public string name; // name of indicator (library) |
575 | public string? entry_name; // name of entry (menu item) |
576 | @@ -32,19 +33,25 @@ |
577 | { "libapplication.so", null }, // indicator-application (App indicators) |
578 | { "libapplication.so", "keyboard" }, // Keyboard layout selector (old) |
579 | { "libapplication.so", "gsd-keyboard-xkb" }, // keyboard layout selector |
580 | + { "com.canonical.indicator.keyboard", null }, |
581 | { "libsoundmenu.so", null }, // indicator-sound |
582 | + { "com.canonical.indicator.sound", null }, |
583 | { "libnetwork.so", null }, // indicator-network |
584 | { "libnetworkmenu.so", null }, // indicator-network |
585 | { "libapplication.so", "nm-applet" }, // network manager |
586 | { "libbluetooth.so", null }, // indicator-bluetooth |
587 | { "libapplication.so", "bluetooth-manager" }, // indicator-gnome-bluetooth (old) |
588 | + { "com.canonical.indicator.bluetooth", null }, |
589 | { "libprintersmenu.so", null }, // indicator-printers |
590 | { "libsyncindicator.so", null }, // indicator-sync |
591 | { "libpower.so", null }, // indicator-power |
592 | + { "com.canonical.indicator.power", null }, |
593 | { "libmessaging.so", null }, // indicator-messages |
594 | + { "com.canonical.indicator.messages", null }, |
595 | { "libsession.so", null }, // indicator-session |
596 | { "libsession.so", "indicator-session-users" }, // indicator-session |
597 | - { "libsession.so", "indicator-session-devices" } // indicator-session |
598 | + { "libsession.so", "indicator-session-devices" },// indicator-session |
599 | + { "com.canonical.indicator.session", null } |
600 | }; |
601 | |
602 | public static int compare_func (IndicatorWidget? a, IndicatorWidget? b) { |
603 | |
604 | === modified file 'src/Services/Settings.vala' |
605 | --- src/Services/Settings.vala 2013-04-14 07:54:25 +0000 |
606 | +++ src/Services/Settings.vala 2014-03-25 04:00:57 +0000 |
607 | @@ -23,6 +23,8 @@ |
608 | public string[] blacklist { get; set; } |
609 | public bool show_launcher { get; set; } |
610 | public string default_launcher { get; set; } |
611 | + public double background_alpha { get; set; } |
612 | + public bool auto_adjust_alpha { get; set; } |
613 | |
614 | public Settings () { |
615 | base ("org.pantheon.desktop.wingpanel"); |
616 | |
617 | === modified file 'src/Widgets/BasePanel.vala' |
618 | --- src/Widgets/BasePanel.vala 2013-08-07 10:18:24 +0000 |
619 | +++ src/Widgets/BasePanel.vala 2014-03-25 04:00:57 +0000 |
620 | @@ -1,17 +1,17 @@ |
621 | // -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
622 | -// |
623 | -// Copyright (C) 2011-2013 Wingpanel Developers |
624 | -// |
625 | +// |
626 | +// Copyright (C) 2011-2014 Wingpanel Developers |
627 | +// |
628 | // This program is free software: you can redistribute it and/or modify |
629 | // it under the terms of the GNU General Public License as published by |
630 | // the Free Software Foundation, either version 3 of the License, or |
631 | // (at your option) any later version. |
632 | -// |
633 | +// |
634 | // This program is distributed in the hope that it will be useful, |
635 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
636 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
637 | // GNU General Public License for more details. |
638 | -// |
639 | +// |
640 | // You should have received a copy of the GNU General Public License |
641 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
642 | |
643 | @@ -32,6 +32,8 @@ |
644 | N_VALUES |
645 | } |
646 | |
647 | + protected Services.Settings settings { get; private set; } |
648 | + |
649 | private const int SHADOW_SIZE = 4; |
650 | |
651 | private int panel_height = 0; |
652 | @@ -41,9 +43,19 @@ |
653 | private int panel_displacement = -40; |
654 | private uint animation_timer = 0; |
655 | |
656 | + private double legible_alpha_value = -1.0; |
657 | + private double panel_alpha = 0.0; |
658 | + private double panel_current_alpha = 0.0; |
659 | + private uint panel_alpha_timer = 0; |
660 | + const int FPS = 60; |
661 | + const double ALPHA_ANIMATION_STEP = 0.05; |
662 | + |
663 | private PanelShadow shadow = new PanelShadow (); |
664 | - |
665 | - public BasePanel () { |
666 | + private Wnck.Screen wnck_screen; |
667 | + |
668 | + public BasePanel (Services.Settings settings) { |
669 | + this.settings = settings; |
670 | + |
671 | decorated = false; |
672 | resizable = false; |
673 | skip_taskbar_hint = true; |
674 | @@ -58,6 +70,29 @@ |
675 | screen.monitors_changed.connect (on_monitors_changed); |
676 | |
677 | destroy.connect (Gtk.main_quit); |
678 | + |
679 | + wnck_screen = Wnck.Screen.get_default (); |
680 | + wnck_screen.active_workspace_changed.connect (update_panel_alpha); |
681 | + wnck_screen.window_opened.connect ((window) => { |
682 | + if (window.get_window_type () == Wnck.WindowType.NORMAL) |
683 | + window.state_changed.connect (window_state_changed); |
684 | + }); |
685 | + wnck_screen.window_closed.connect ((window) => { |
686 | + if (window.get_window_type () == Wnck.WindowType.NORMAL) |
687 | + window.state_changed.disconnect (window_state_changed); |
688 | + }); |
689 | + |
690 | + update_panel_alpha (); |
691 | + } |
692 | + |
693 | + private void window_state_changed (Wnck.Window window, |
694 | + Wnck.WindowState changed_mask, Wnck.WindowState new_state) { |
695 | + if (((changed_mask & Wnck.WindowState.MAXIMIZED_HORIZONTALLY) != 0 |
696 | + || (changed_mask & Wnck.WindowState.MAXIMIZED_VERTICALLY) != 0 |
697 | + || (changed_mask & Wnck.WindowState.MINIMIZED) != 0) |
698 | + && (window.get_workspace () == wnck_screen.get_active_workspace () |
699 | + || window.is_sticky ())) |
700 | + update_panel_alpha (); |
701 | } |
702 | |
703 | protected abstract Gtk.StyleContext get_draw_style_context (); |
704 | @@ -79,7 +114,11 @@ |
705 | } |
706 | |
707 | var ctx = get_draw_style_context (); |
708 | - ctx.render_background (cr, size.x, size.y, size.width, size.height); |
709 | + var background_color = ctx.get_background_color (Gtk.StateFlags.NORMAL); |
710 | + background_color.alpha = panel_current_alpha; |
711 | + Gdk.cairo_set_source_rgba (cr, background_color); |
712 | + cr.rectangle (size.x, size.y, size.width, size.height); |
713 | + cr.fill (); |
714 | |
715 | // Slide in |
716 | if (animation_timer == 0) { |
717 | @@ -92,21 +131,75 @@ |
718 | if (child != null) |
719 | propagate_draw (child, cr); |
720 | |
721 | - if (!shadow.visible) |
722 | + if (panel_alpha > 1E-3) { |
723 | + shadow.show (); |
724 | shadow.show_all (); |
725 | + } else |
726 | + shadow.hide (); |
727 | |
728 | return true; |
729 | } |
730 | |
731 | + public void update_opacity (double alpha) { |
732 | + legible_alpha_value = alpha; |
733 | + update_panel_alpha (); |
734 | + } |
735 | + |
736 | + private void update_panel_alpha () { |
737 | + panel_alpha = settings.background_alpha; |
738 | + if (settings.auto_adjust_alpha) { |
739 | + if (active_workspace_has_maximized_window ()) |
740 | + panel_alpha = 1.0; |
741 | + else if (legible_alpha_value >= 0) |
742 | + panel_alpha = legible_alpha_value; |
743 | + } |
744 | + |
745 | + if (panel_current_alpha != panel_alpha) |
746 | + panel_alpha_timer = Gdk.threads_add_timeout (1000 / FPS, draw_timeout); |
747 | + } |
748 | + |
749 | + private bool draw_timeout () { |
750 | + queue_draw (); |
751 | + |
752 | + if (panel_current_alpha > panel_alpha) { |
753 | + panel_current_alpha -= ALPHA_ANIMATION_STEP; |
754 | + panel_current_alpha = double.max (panel_current_alpha, panel_alpha); |
755 | + } else if (panel_current_alpha < panel_alpha) { |
756 | + panel_current_alpha += ALPHA_ANIMATION_STEP; |
757 | + panel_current_alpha = double.min (panel_current_alpha, panel_alpha); |
758 | + } |
759 | + |
760 | + if (panel_current_alpha != panel_alpha) |
761 | + return true; |
762 | + |
763 | + if (panel_alpha_timer > 0) { |
764 | + Source.remove (panel_alpha_timer); |
765 | + panel_alpha_timer = 0; |
766 | + } |
767 | + |
768 | + return false; |
769 | + } |
770 | + |
771 | private bool animation_callback () { |
772 | - if (panel_displacement >= 0 ) { |
773 | + if (panel_displacement >= 0 ) |
774 | return false; |
775 | - } else { |
776 | - panel_displacement += 1; |
777 | - move (panel_x, panel_y + panel_displacement); |
778 | - shadow.move (panel_x, panel_y + panel_height + panel_displacement); |
779 | - return true; |
780 | + |
781 | + panel_displacement += 1; |
782 | + move (panel_x, panel_y + panel_displacement); |
783 | + shadow.move (panel_x, panel_y + panel_height + panel_displacement); |
784 | + return true; |
785 | + } |
786 | + |
787 | + private bool active_workspace_has_maximized_window () { |
788 | + var workspace = wnck_screen.get_active_workspace (); |
789 | + |
790 | + foreach (var window in wnck_screen.get_windows ()) { |
791 | + if ((window.is_pinned () || window.get_workspace () == workspace) |
792 | + && window.is_maximized () && !window.is_minimized ()) |
793 | + return true; |
794 | } |
795 | + |
796 | + return false; |
797 | } |
798 | |
799 | private void on_monitors_changed () { |
800 | @@ -144,9 +237,9 @@ |
801 | screen.get_monitor_geometry (screen.get_primary_monitor (), out monitor_dimensions); |
802 | |
803 | // if we have multiple monitors, we must check if the panel would be placed inbetween |
804 | - // monitors. If that's the case we have to move it to the topmost, or we'll make the |
805 | + // monitors. If that's the case we have to move it to the topmost, or we'll make the |
806 | // upper monitor unusable because of the struts. |
807 | - // First check if there are monitors overlapping horizontally and if they are higher |
808 | + // First check if there are monitors overlapping horizontally and if they are higher |
809 | // our current highest, make this one the new highest and test all again |
810 | if (screen.get_n_monitors () > 1) { |
811 | Gdk.Rectangle dimensions; |
812 | @@ -156,8 +249,8 @@ |
813 | && dimensions.x < monitor_dimensions.x + monitor_dimensions.width) |
814 | || (dimensions.x + dimensions.width > monitor_dimensions.x |
815 | && dimensions.x + dimensions.width <= monitor_dimensions.x + monitor_dimensions.width) |
816 | - || (dimensions.x < monitor_dimensions.x |
817 | - && dimensions.x + dimensions.width > monitor_dimensions.x + monitor_dimensions.width)) |
818 | + || (dimensions.x < monitor_dimensions.x |
819 | + && dimensions.x + dimensions.width > monitor_dimensions.x + monitor_dimensions.width)) |
820 | && dimensions.y < monitor_dimensions.y) { |
821 | warning ("Not placing wingpanel on the primary monitor because of problems" + |
822 | " with multimonitor setups"); |
823 | |
824 | === modified file 'src/Widgets/Panel.vala' |
825 | --- src/Widgets/Panel.vala 2013-04-14 07:54:25 +0000 |
826 | +++ src/Widgets/Panel.vala 2014-03-25 04:00:57 +0000 |
827 | @@ -2,7 +2,7 @@ |
828 | /*** |
829 | BEGIN LICENSE |
830 | |
831 | - Copyright (C) 2011-2012 Wingpanel Developers |
832 | + Copyright (C) 2011-2014 Wingpanel Developers |
833 | This program is free software: you can redistribute it and/or modify it |
834 | under the terms of the GNU Lesser General Public License version 3, as published |
835 | by the Free Software Foundation. |
836 | @@ -31,10 +31,11 @@ |
837 | |
838 | private IndicatorLoader indicator_loader; |
839 | |
840 | - public Panel (WingpanelApp app, Services.Settings settings, IndicatorLoader indicator_loader) { |
841 | - set_application (app as Gtk.Application); |
842 | + public Panel (Gtk.Application app, Services.Settings settings, IndicatorLoader indicator_loader) { |
843 | + base (settings); |
844 | |
845 | this.indicator_loader = indicator_loader; |
846 | + set_application (app); |
847 | |
848 | container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |
849 | left_wrapper = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |
850 | @@ -77,7 +78,9 @@ |
851 | } |
852 | |
853 | private void create_entry (IndicatorWidget entry) { |
854 | - if (entry.get_indicator ().get_name () == "libdatetime.so") |
855 | + string entry_name = entry.get_indicator ().get_name (); |
856 | + |
857 | + if (entry_name == "libdatetime.so" || entry_name == "com.canonical.indicator.datetime") |
858 | clock.prepend (entry); |
859 | else |
860 | menubar.insert_sorted (entry); |
861 | @@ -110,6 +113,18 @@ |
862 | var gpr = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL); |
863 | gpr.add_widget (left_wrapper); |
864 | gpr.add_widget (right_wrapper); |
865 | + |
866 | + // make sure those are all transparent when we later adjust the transparency |
867 | + // in the panel's draw callback |
868 | + clock.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () { |
869 | + red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0 |
870 | + }); |
871 | + menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () { |
872 | + red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0 |
873 | + }); |
874 | + apps_menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () { |
875 | + red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0 |
876 | + }); |
877 | } |
878 | } |
879 | } |
880 | |
881 | === modified file 'src/WingpanelApp.vala' |
882 | --- src/WingpanelApp.vala 2013-04-14 07:54:25 +0000 |
883 | +++ src/WingpanelApp.vala 2014-03-25 04:00:57 +0000 |
884 | @@ -1,59 +1,57 @@ |
885 | // -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*- |
886 | -/*** |
887 | - BEGIN LICENSE |
888 | - |
889 | - Copyright (C) 2011-2012 Wingpanel Developers |
890 | - This program is free software: you can redistribute it and/or modify it |
891 | - under the terms of the GNU Lesser General Public License version 3, as published |
892 | - by the Free Software Foundation. |
893 | - |
894 | - This program is distributed in the hope that it will be useful, but |
895 | - WITHOUT ANY WARRANTY; without even the implied warranties of |
896 | - MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
897 | - PURPOSE. See the GNU General Public License for more details. |
898 | - |
899 | - You should have received a copy of the GNU General Public License along |
900 | - with this program. If not, see <http://www.gnu.org/licenses/> |
901 | - |
902 | - END LICENSE |
903 | -***/ |
904 | - |
905 | -namespace Wingpanel { |
906 | - |
907 | - public class WingpanelApp : Granite.Application { |
908 | - private IndicatorLoader indicator_loader; |
909 | - private Services.Settings settings; |
910 | - private Widgets.BasePanel panel; |
911 | - |
912 | - construct { |
913 | - build_data_dir = Build.DATADIR; |
914 | - build_pkg_data_dir = Build.PKGDATADIR; |
915 | - build_release_name = Build.RELEASE_NAME; |
916 | - build_version = Build.VERSION; |
917 | - build_version_info = Build.VERSION_INFO; |
918 | - |
919 | - program_name = "Wingpanel"; |
920 | - exec_name = "wingpanel"; |
921 | - application_id = "net.launchpad.wingpanel"; |
922 | - } |
923 | - |
924 | - protected override void activate () { |
925 | - debug ("Activating"); |
926 | - |
927 | - if (get_windows () == null) |
928 | - init (); |
929 | - } |
930 | - |
931 | - private void init () { |
932 | - settings = new Services.Settings (); |
933 | - indicator_loader = new Backend.IndicatorFactory (settings); |
934 | - panel = new Widgets.Panel (this, settings, indicator_loader); |
935 | - |
936 | - panel.show_all (); |
937 | - } |
938 | - |
939 | - public static int main (string[] args) { |
940 | - return new WingpanelApp ().run (args); |
941 | - } |
942 | +// |
943 | +// Copyright (C) 2013 Wingpanel Developers |
944 | +// |
945 | +// This program is free software: you can redistribute it and/or modify |
946 | +// it under the terms of the GNU General Public License as published by |
947 | +// the Free Software Foundation, either version 3 of the License, or |
948 | +// (at your option) any later version. |
949 | +// |
950 | +// This program is distributed in the hope that it will be useful, |
951 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
952 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
953 | +// GNU General Public License for more details. |
954 | +// |
955 | +// You should have received a copy of the GNU General Public License |
956 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
957 | + |
958 | +public class Wingpanel.App : Granite.Application { |
959 | + private IndicatorLoader indicator_loader; |
960 | + private Widgets.BasePanel panel; |
961 | + private Services.BackgroundManager background_manager; |
962 | + |
963 | + construct { |
964 | + build_data_dir = Build.DATADIR; |
965 | + build_pkg_data_dir = Build.PKGDATADIR; |
966 | + build_release_name = Build.RELEASE_NAME; |
967 | + build_version = Build.VERSION; |
968 | + build_version_info = Build.VERSION_INFO; |
969 | + |
970 | + program_name = "Wingpanel"; |
971 | + exec_name = "wingpanel"; |
972 | + application_id = "net.launchpad.wingpanel"; |
973 | + } |
974 | + |
975 | + protected override void startup () { |
976 | + base.startup (); |
977 | + |
978 | + Ido.init (); |
979 | + |
980 | + var settings = new Services.Settings (); |
981 | + indicator_loader = new Backend.IndicatorFactory (settings.blacklist); |
982 | + panel = new Widgets.Panel (this, settings, indicator_loader); |
983 | + |
984 | + panel.show_all (); |
985 | + |
986 | + background_manager = new Services.BackgroundManager (settings, panel.get_screen ()); |
987 | + background_manager.update_background_alpha.connect (panel.update_opacity); |
988 | + } |
989 | + |
990 | + protected override void activate () { |
991 | + panel.present (); |
992 | + } |
993 | + |
994 | + public static int main (string[] args) { |
995 | + return new Wingpanel.App ().run (args); |
996 | } |
997 | } |
998 | |
999 | === renamed file 'vapi/indicator-0.4.vapi' => 'vapi/indicator3-0.4.vapi' |
1000 | --- vapi/indicator-0.4.vapi 2013-10-15 20:44:53 +0000 |
1001 | +++ vapi/indicator3-0.4.vapi 2014-03-25 04:00:57 +0000 |
1002 | @@ -1,4 +1,4 @@ |
1003 | -/* indicator-0.4.vapi generated by vapigen, do not modify. */ |
1004 | +/* indicator3-0.4.vapi generated by vapigen, do not modify. */ |
1005 | |
1006 | namespace Indicator { |
1007 | [CCode (cheader_filename = "libindicator/indicator-desktop-shortcuts.h", type_check_function = "INDICATOR_IS_DESKTOP_SHORTCUTS", type_id = "indicator_desktop_shortcuts_get_type ()")] |
1008 | @@ -7,12 +7,28 @@ |
1009 | public DesktopShortcuts (string file, string identity); |
1010 | public unowned string get_nicks (); |
1011 | public bool nick_exec (string nick); |
1012 | + public bool nick_exec_with_context (string nick, GLib.AppLaunchContext launch_context); |
1013 | public unowned string nick_get_name (string nick); |
1014 | public string desktop_file { construct; } |
1015 | [NoAccessorMethod] |
1016 | public string identity { owned get; construct; } |
1017 | } |
1018 | - [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")] |
1019 | +<<<<<<< TREE |
1020 | + [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")] |
1021 | +======= |
1022 | + [CCode (cheader_filename = "libindicator/indicator-ng.h", type_check_function = "INDICATOR_IS_NG", type_id = "indicator_ng_get_type ()")] |
1023 | + public class Ng : Indicator.Object, GLib.Initable { |
1024 | + [CCode (has_construct_function = false)] |
1025 | + public Ng (string service_file) throws GLib.Error; |
1026 | + [CCode (has_construct_function = false)] |
1027 | + public Ng.for_profile (string service_file, string profile) throws GLib.Error; |
1028 | + public unowned string get_profile (); |
1029 | + public unowned string get_service_file (); |
1030 | + public string profile { get; construct; } |
1031 | + public string service_file { get; construct; } |
1032 | + } |
1033 | + [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")] |
1034 | +>>>>>>> MERGE-SOURCE |
1035 | public class Object : GLib.Object { |
1036 | [CCode (has_construct_function = false)] |
1037 | protected Object (); |
1038 | @@ -42,17 +58,8 @@ |
1039 | public virtual unowned Gtk.Menu get_menu (); |
1040 | [NoWrapper] |
1041 | public virtual unowned string get_name_hint (); |
1042 | + public virtual int get_position (); |
1043 | public virtual bool get_show_now (Indicator.ObjectEntry entry); |
1044 | - [NoWrapper] |
1045 | - public virtual void reserved1 (); |
1046 | - [NoWrapper] |
1047 | - public virtual void reserved2 (); |
1048 | - [NoWrapper] |
1049 | - public virtual void reserved3 (); |
1050 | - [NoWrapper] |
1051 | - public virtual void reserved4 (); |
1052 | - [NoWrapper] |
1053 | - public virtual void reserved5 (); |
1054 | public void set_environment (string[] env); |
1055 | public void set_visible (bool visible); |
1056 | [NoAccessorMethod] |
1057 | @@ -75,26 +82,15 @@ |
1058 | public weak Gtk.Menu menu; |
1059 | public weak string name_hint; |
1060 | public weak Indicator.Object parent_object; |
1061 | - public weak GLib.Callback reserved1; |
1062 | - public weak GLib.Callback reserved2; |
1063 | - public weak GLib.Callback reserved3; |
1064 | - public weak GLib.Callback reserved4; |
1065 | public static void activate (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp); |
1066 | public static void activate_window (Indicator.Object io, Indicator.ObjectEntry entry, uint windowid, uint timestamp); |
1067 | public static void close (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp); |
1068 | + public static bool is_visible (Indicator.Object io, Indicator.ObjectEntry entry); |
1069 | } |
1070 | [CCode (cheader_filename = "libindicator/indicator-service.h", type_check_function = "INDICATOR_IS_SERVICE", type_id = "indicator_service_get_type ()")] |
1071 | public class Service : GLib.Object { |
1072 | [CCode (has_construct_function = false)] |
1073 | public Service (string name); |
1074 | - [NoWrapper] |
1075 | - public virtual void indicator_service_reserved1 (); |
1076 | - [NoWrapper] |
1077 | - public virtual void indicator_service_reserved2 (); |
1078 | - [NoWrapper] |
1079 | - public virtual void indicator_service_reserved3 (); |
1080 | - [NoWrapper] |
1081 | - public virtual void indicator_service_reserved4 (); |
1082 | [CCode (cname = "indicator_service_new_version", has_construct_function = false)] |
1083 | public Service.with_version (string name, uint version); |
1084 | [NoAccessorMethod] |
1085 | @@ -108,14 +104,6 @@ |
1086 | [CCode (has_construct_function = false)] |
1087 | public ServiceManager (string dbus_name); |
1088 | public bool connected (); |
1089 | - [NoWrapper] |
1090 | - public virtual void indicator_service_manager_reserved1 (); |
1091 | - [NoWrapper] |
1092 | - public virtual void indicator_service_manager_reserved2 (); |
1093 | - [NoWrapper] |
1094 | - public virtual void indicator_service_manager_reserved3 (); |
1095 | - [NoWrapper] |
1096 | - public virtual void indicator_service_manager_reserved4 (); |
1097 | public void set_refresh (uint time_in_ms); |
1098 | [CCode (cname = "indicator_service_manager_new_version", has_construct_function = false)] |
1099 | public ServiceManager.with_version (string dbus_name, uint version); |
1100 | @@ -140,28 +128,6 @@ |
1101 | public const string GET_TYPE_S; |
1102 | [CCode (cheader_filename = "libindicator/indicator.h")] |
1103 | public const string GET_VERSION_S; |
1104 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1105 | - public const string OBJECT_DEFAULT_VISIBILITY; |
1106 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1107 | - public const string OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE; |
1108 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1109 | - public const string OBJECT_SIGNAL_ENTRY_ADDED; |
1110 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1111 | - public const string OBJECT_SIGNAL_ENTRY_MOVED; |
1112 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1113 | - public const string OBJECT_SIGNAL_ENTRY_REMOVED; |
1114 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1115 | - public const string OBJECT_SIGNAL_ENTRY_SCROLLED; |
1116 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1117 | - public const string OBJECT_SIGNAL_MENU_SHOW; |
1118 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1119 | - public const string OBJECT_SIGNAL_SECONDARY_ACTIVATE; |
1120 | - [CCode (cheader_filename = "libindicator/indicator-gobject.h")] |
1121 | - public const string OBJECT_SIGNAL_SHOW_NOW_CHANGED; |
1122 | - [CCode (cheader_filename = "libindicator/indicator-service-manager.h")] |
1123 | - public const string SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE; |
1124 | - [CCode (cheader_filename = "libindicator/indicator-service.h")] |
1125 | - public const string SERVICE_SIGNAL_SHUTDOWN; |
1126 | [CCode (cheader_filename = "libindicator/indicator.h")] |
1127 | public const int SET_VERSION; |
1128 | [CCode (cheader_filename = "libindicator/indicator.h")] |
1129 | @@ -172,4 +138,6 @@ |
1130 | public static unowned Gtk.Image image_helper (string name); |
1131 | [CCode (cheader_filename = "libindicator/indicator-image-helper.h")] |
1132 | public static void image_helper_update (Gtk.Image image, string name); |
1133 | + [CCode (cheader_filename = "libindicator/indicator-image-helper.h")] |
1134 | + public static void image_helper_update_from_gicon (Gtk.Image image, GLib.Icon icon); |
1135 | } |
1136 | |
1137 | === added file 'vapi/libido3-0.1.vapi' |
1138 | --- vapi/libido3-0.1.vapi 1970-01-01 00:00:00 +0000 |
1139 | +++ vapi/libido3-0.1.vapi 2014-03-25 04:00:57 +0000 |
1140 | @@ -0,0 +1,4 @@ |
1141 | +[CCode (cheader_filename="libido/libido.h", lower_case_cprefix = "ido_")] |
1142 | +namespace Ido { |
1143 | + public void init (); |
1144 | +} |